|
|
|
@ -12,7 +12,7 @@
|
|
|
|
|
<el-button-group
|
|
|
|
|
style="display: flex; margin: 0px 0 15px 0; height: 35px;float: right"
|
|
|
|
|
>
|
|
|
|
|
<el-button size="mini" type="primary" @click="triggerFileUpload2"
|
|
|
|
|
<el-button size="mini" type="primary" @click="triggerFileUpload2" icon="el-icon-upload"
|
|
|
|
|
>
|
|
|
|
|
上传阳采单据
|
|
|
|
|
</el-button>
|
|
|
|
@ -361,7 +361,7 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row v-if="viewType != 1">
|
|
|
|
|
<el-col :span="20">
|
|
|
|
|
<el-col :span="18">
|
|
|
|
|
<el-form-item prop="code" label="扫码录入校验:">
|
|
|
|
|
<el-input
|
|
|
|
|
id="inputer"
|
|
|
|
@ -374,7 +374,7 @@
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="2">
|
|
|
|
|
<el-col :span="4">
|
|
|
|
|
<el-button-group
|
|
|
|
|
style="display: flex; height: 35px">
|
|
|
|
|
<el-button
|
|
|
|
@ -389,11 +389,20 @@
|
|
|
|
|
size="mini"
|
|
|
|
|
@click.native="selectOrder()"
|
|
|
|
|
v-if="curAction.checkWebNew != 2 || viewType !=1"
|
|
|
|
|
icon="el-icon-document-add"
|
|
|
|
|
>下载码上放心追溯码
|
|
|
|
|
<!-- v-if="(curAction.checkWebNew !== 2 || viewType !== 1) && orderFormData.billNo"-->
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
<el-button size="mini" type="primary" @click="triggerFileUpload" icon="el-icon-upload2"
|
|
|
|
|
v-if="curAction.checkWebNew != 2 || viewType !=1"
|
|
|
|
|
>
|
|
|
|
|
导入阳采追溯码
|
|
|
|
|
</el-button>
|
|
|
|
|
<!-- 隐藏的文件输入元素 -->
|
|
|
|
|
<input type="file" ref="fileInput" accept=".xlsx,.xls" style="display: none;" @change="handleFileUpload"/>
|
|
|
|
|
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
size="mini"
|
|
|
|
|
v-if="curAction.useDyCount == 2"
|
|
|
|
@ -828,9 +837,74 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
this.selectOrderVisible = true
|
|
|
|
|
},
|
|
|
|
|
triggerFileUpload() {
|
|
|
|
|
this.$refs.fileInput.click();
|
|
|
|
|
},
|
|
|
|
|
triggerFileUpload2() {
|
|
|
|
|
this.$refs.fileInput2.click();
|
|
|
|
|
},
|
|
|
|
|
handleFileUpload(event) {
|
|
|
|
|
const file = event.target.files[0];
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (file) {
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
formData.append('billNo', billNo);
|
|
|
|
|
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}`);
|
|
|
|
|
}
|
|
|
|
|
return response.json();
|
|
|
|
|
})
|
|
|
|
|
.then(data => {
|
|
|
|
|
if (data.code === 20000) {
|
|
|
|
|
// 更新单据号
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 清空文件输入框的值
|
|
|
|
|
event.target.value = '';
|
|
|
|
|
},
|
|
|
|
|
handleFileUpload2(event) {
|
|
|
|
|
const file = event.target.files[0];
|
|
|
|
|
const uploadUrl = process.env.VUE_APP_BASE_API + '/udiwms/inout/order/yc/orderFileUpload';
|
|
|
|
|