选入阳采,选入阿里

dev_unify
yewj 6 months ago
parent 06366b7bb0
commit c165c4af8c

@ -291,6 +291,7 @@ import selectMsfxOrderDialog from "./selectMsfxOrderDialog"
import A from "@/plugins/KeyScaner"
import {findByInvUser, getLocalJoinByUser, getBusTypeList} from '@/api/basic/busType'
import {deleteRe} from "@/api/auth/register";
import store from "@/store";
export default {
name: "ioCreateOrder",
@ -441,12 +442,14 @@ export default {
},
handleFileUpload(event) {
const file = event.target.files[0];
const billNo = this.orderFormData.billNo; // UUID
const uploadUrl = process.env.VUE_APP_BASE_API + '/udiwms/inout/order/yc/fileUpload'; // URL
const billNo = this.orderFormData.billNo;
const uploadUrl = process.env.VUE_APP_BASE_API + '/udiwms/inout/order/yc/fileUpload';
if (this.$isBlank(this.orderFormData.billNo)) {
this.$message.error("单据编号不可以为空!");
return
return;
}
if (file) {
const formData = new FormData();
formData.append('billNo', billNo);
@ -454,73 +457,109 @@ export default {
fetch(uploadUrl, {
method: 'POST',
headers: {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
},
body: formData,
})
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.json(); // JSON
return response.json();
})
.then(data => {
//
if (data.code === 20000) {
this.$message.success("上传成功!")
//
if (data.data && data.data.billNo) {
this.orderFormData.billNo = data.data.billNo;
}
//
this.isCodeAlive = false;
this.isBizDetailAlive = false;
this.isCodeDetailAlive = false;
this.$nextTick(() => {
this.isCodeAlive = true;
this.isBizDetailAlive = true;
this.isCodeDetailAlive = true;
this.$refs.inputRef.focus();
this.$refs.inputRef.select();
this.$message.success("上传成功!");
});
} else {
this.$message.error(data.message);
}
})
.catch(error => {
//
console.error('File upload failed:', error);
//
this.$message.error('文件上传失败:' + error.message);
});
} else {
//
console.error('No file selected for upload!');
}
//
event.target.value = '';
},
handleFileUpload2(event) {
const file = event.target.files[0];
const billNo = this.orderFormData.billNo; // UUID
const uploadUrl = process.env.VUE_APP_BASE_API + '/udiwms/inout/order/yc/orderFileUpload'; // URL
// if (this.$isBlank(this.orderFormData.billNo)){
// this.$message.error("!");
// return
// }
const uploadUrl = process.env.VUE_APP_BASE_API + '/udiwms/inout/order/yc/orderFileUpload';
if (file) {
const formData = new FormData()
const formData = new FormData();
this.orderFormData.orderEntity = Object.assign(JSON.parse(JSON.stringify(this.orderFormData)));
formData.append('billNoJson', JSON.stringify(this.orderFormData));
formData.append('file', file);
fetch(uploadUrl, {
method: 'POST',
headers: {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
},
body: formData
})
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`)
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.json() // JSON
return response.json();
})
.then(data => {
//
if (data.code === 20000) {
console.log(data.data)
this.$message.success("上传成功!")
//
if (data.data && data.data.billNo) {
this.orderFormData.billNo = data.data.billNo;
}
//
this.isCodeAlive = false;
this.isBizDetailAlive = false;
this.isCodeDetailAlive = false;
this.$nextTick(() => {
this.isCodeAlive = true;
this.isBizDetailAlive = true;
this.isCodeDetailAlive = true;
this.$refs.inputRef.focus();
this.$refs.inputRef.select();
this.$message.success("上传成功!");
});
} else {
this.$message.error(data.message);
}
})
.catch(error => {
//
console.error('File upload failed:', error);
//
this.$message.error('文件上传失败:' + error.message);
});
} else {
//
console.error('No file selected for upload!');
this.$message.warning('请选择要上传的文件');
}
//
event.target.value = '';
},
//url
selectAuthMenuByMenuKeys() {
@ -643,7 +682,7 @@ export default {
actionChange(item) {
this.curAction = this.getActionItem(item);
if ((this.curAction.checkEnable && this.curAction.checkWebNew != 0) || this.viewType == 1) {
// 1
// 1
this.bizShow = true;
} else
this.bizShow = false;

Loading…
Cancel
Save