选入阳采,选入阿里

dev_unify
yewj 6 months ago
parent 06366b7bb0
commit c165c4af8c

@ -10,13 +10,13 @@
同步阳采单据 同步阳采单据
</el-button> </el-button>
<!-- 隐藏的文件输入元素 --> <!-- 隐藏的文件输入元素 -->
<input type="file" ref="fileInput2" accept=".xlsx,.xls" style="display: none;" @change="handleFileUpload2" /> <input type="file" ref="fileInput2" accept=".xlsx,.xls" style="display: none;" @change="handleFileUpload2"/>
<el-button size="mini" type="primary" @click="triggerFileUpload" <el-button size="mini" type="primary" @click="triggerFileUpload"
v-if="(curAction.checkWebNew !== 2 || viewType !== 1) && orderFormData.billNo"> v-if="(curAction.checkWebNew !== 2 || viewType !== 1) && orderFormData.billNo">
同步阳采追溯码 同步阳采追溯码
</el-button> </el-button>
<!-- 隐藏的文件输入元素 --> <!-- 隐藏的文件输入元素 -->
<input type="file" ref="fileInput" accept=".xlsx,.xls" style="display: none;" @change="handleFileUpload" /> <input type="file" ref="fileInput" accept=".xlsx,.xls" style="display: none;" @change="handleFileUpload"/>
<el-button size="mini" type="primary" @click.native="selectOrder()" <el-button size="mini" type="primary" @click.native="selectOrder()"
v-if="curAction.checkWebNew != 2 || viewType !=1" v-if="curAction.checkWebNew != 2 || viewType !=1"
@ -33,15 +33,15 @@
v-if="curAction.checkWebNew != 2 || viewType !=1" v-if="curAction.checkWebNew != 2 || viewType !=1"
>立即提交 >立即提交
</el-button> </el-button>
<!-- <el-button size="mini" type="primary" @click.native="submit(1)"--> <!-- <el-button size="mini" type="primary" @click.native="submit(1)"-->
<!-- v-if="curAction.checkWebNew > 1 && viewType == 1"--> <!-- v-if="curAction.checkWebNew > 1 && viewType == 1"-->
<!-- >待配货提交--> <!-- >待配货提交-->
<!-- </el-button>--> <!-- </el-button>-->
<!-- <el-button size="mini" type="primary" @click.native="submit(1)"--> <!-- <el-button size="mini" type="primary" @click.native="submit(1)"-->
<!-- v-if="curAction.checkWebNew == 3"--> <!-- v-if="curAction.checkWebNew == 3"-->
<!-- >未配货提交--> <!-- >未配货提交-->
<!-- </el-button>--> <!-- </el-button>-->
</el-button-group> </el-button-group>
<el-row> <el-row>
@ -262,8 +262,8 @@
:close-on-press-escape="false" :close-on-press-escape="false"
v-if="selectOrderVisible"> v-if="selectOrderVisible">
<selectMsfxOrderDialog <selectMsfxOrderDialog
:orderFormData = this.orderFormData :orderFormData=this.orderFormData
:closeDialog = this.orderFormDataClose :closeDialog=this.orderFormDataClose
> >
</selectMsfxOrderDialog> </selectMsfxOrderDialog>
@ -291,6 +291,7 @@ import selectMsfxOrderDialog from "./selectMsfxOrderDialog"
import A from "@/plugins/KeyScaner" import A from "@/plugins/KeyScaner"
import {findByInvUser, getLocalJoinByUser, getBusTypeList} from '@/api/basic/busType' import {findByInvUser, getLocalJoinByUser, getBusTypeList} from '@/api/basic/busType'
import {deleteRe} from "@/api/auth/register"; import {deleteRe} from "@/api/auth/register";
import store from "@/store";
export default { export default {
name: "ioCreateOrder", name: "ioCreateOrder",
@ -350,7 +351,7 @@ export default {
remark: null, remark: null,
fromType: 2, fromType: 2,
errMsg: null, errMsg: null,
orderEntity: { } orderEntity: {}
}, },
errView: 0, errView: 0,
@ -382,7 +383,7 @@ export default {
editCodeVisible: false, editCodeVisible: false,
actionEnable: false, actionEnable: false,
editOriginCodeVisible: false, editOriginCodeVisible: false,
selectOrderVisible:false, selectOrderVisible: false,
curId: null, curId: null,
storageList: [], storageList: [],
@ -430,7 +431,7 @@ export default {
}; };
}, },
components: { components: {
codesPanel, codeDetailPanel, bizDetailPanel, editCodeDialog,selectMsfxOrderDialog codesPanel, codeDetailPanel, bizDetailPanel, editCodeDialog, selectMsfxOrderDialog
}, },
methods: { methods: {
triggerFileUpload() { triggerFileUpload() {
@ -441,12 +442,14 @@ export default {
}, },
handleFileUpload(event) { handleFileUpload(event) {
const file = event.target.files[0]; const file = event.target.files[0];
const billNo = this.orderFormData.billNo; // UUID const billNo = this.orderFormData.billNo;
const uploadUrl = process.env.VUE_APP_BASE_API + '/udiwms/inout/order/yc/fileUpload'; // URL const uploadUrl = process.env.VUE_APP_BASE_API + '/udiwms/inout/order/yc/fileUpload';
if (this.$isBlank(this.orderFormData.billNo)){
if (this.$isBlank(this.orderFormData.billNo)) {
this.$message.error("单据编号不可以为空!"); this.$message.error("单据编号不可以为空!");
return return;
} }
if (file) { if (file) {
const formData = new FormData(); const formData = new FormData();
formData.append('billNo', billNo); formData.append('billNo', billNo);
@ -454,73 +457,109 @@ export default {
fetch(uploadUrl, { fetch(uploadUrl, {
method: 'POST', method: 'POST',
headers: {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
},
body: formData, body: formData,
}) })
.then(response => { .then(response => {
if (!response.ok) { 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 => { .then(data => {
//
if (data.code === 20000) { if (data.code === 20000) {
this.$message.success("上传成功!") //
}else { 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); this.$message.error(data.message);
} }
}) })
.catch(error => { .catch(error => {
//
console.error('File upload failed:', 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) { handleFileUpload2(event) {
const file = event.target.files[0]; 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';
const uploadUrl = process.env.VUE_APP_BASE_API + '/udiwms/inout/order/yc/orderFileUpload'; // URL
// if (this.$isBlank(this.orderFormData.billNo)){
// this.$message.error("!");
// return
// }
if (file) { if (file) {
const formData = new FormData() const formData = new FormData();
this.orderFormData.orderEntity = Object.assign(JSON.parse(JSON.stringify(this.orderFormData))); this.orderFormData.orderEntity = Object.assign(JSON.parse(JSON.stringify(this.orderFormData)));
formData.append('billNoJson', JSON.stringify(this.orderFormData)); formData.append('billNoJson', JSON.stringify(this.orderFormData));
formData.append('file', file); formData.append('file', file);
fetch(uploadUrl, { fetch(uploadUrl, {
method: 'POST', method: 'POST',
headers: {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
},
body: formData body: formData
}) })
.then(response => { .then(response => {
if (!response.ok) { 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 => { .then(data => {
//
if (data.code === 20000) { if (data.code === 20000) {
console.log(data.data) //
this.$message.success("上传成功!") if (data.data && data.data.billNo) {
}else { 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); this.$message.error(data.message);
} }
}) })
.catch(error => { .catch(error => {
//
console.error('File upload failed:', error); console.error('File upload failed:', error);
// this.$message.error('文件上传失败:' + error.message);
}); });
} else { } else {
// this.$message.warning('请选择要上传的文件');
console.error('No file selected for upload!');
} }
//
event.target.value = '';
}, },
//url //url
selectAuthMenuByMenuKeys() { selectAuthMenuByMenuKeys() {
@ -577,14 +616,14 @@ export default {
spUse: 2, spUse: 2,
vueType: "supDelivery", vueType: "supDelivery",
enable: true, enable: true,
productType:2, productType: 2,
}; };
getLocalJoinByUser(query) getLocalJoinByUser(query)
.then((response) => { .then((response) => {
this.busTypeOptions = response.data.list || []; this.busTypeOptions = response.data.list || [];
if (this.busTypeOptions.length == 1 && this.orderFormData.action == null) { if (this.busTypeOptions.length == 1 && this.orderFormData.action == null) {
this.orderFormData.action = this.busTypeOptions[0].action; this.orderFormData.action = this.busTypeOptions[0].action;
this.actionChange(this.orderFormData.action ) this.actionChange(this.orderFormData.action)
} }
}) })
.catch(() => { .catch(() => {
@ -643,7 +682,7 @@ export default {
actionChange(item) { actionChange(item) {
this.curAction = this.getActionItem(item); this.curAction = this.getActionItem(item);
if ((this.curAction.checkEnable && this.curAction.checkWebNew != 0) || this.viewType == 1) { if ((this.curAction.checkEnable && this.curAction.checkWebNew != 0) || this.viewType == 1) {
// 1 // 1
this.bizShow = true; this.bizShow = true;
} else } else
this.bizShow = false; this.bizShow = false;
@ -978,14 +1017,14 @@ export default {
}, },
//msfx //msfx
selectOrder(){ selectOrder() {
if (this.orderFormData.action == null) { if (this.orderFormData.action == null) {
this.$message.error('请选择单据类型!') this.$message.error('请选择单据类型!')
return return
} }
this.selectOrderVisible = true this.selectOrderVisible = true
}, },
orderFormDataClose(data){ orderFormDataClose(data) {
this.orderFormData = data this.orderFormData = data
this.refreshCodesPanel(); this.refreshCodesPanel();
this.selectOrderVisible = false this.selectOrderVisible = false

Loading…
Cancel
Save