diff --git a/package.json b/package.json index 44df32ce..c7d81fc0 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "preview": "node build/index.js --preview", "lint": "eslint --ext .js,.vue src", "server": "SET NODE_OPTIONS=--openssl-legacy-provider && webpack-dev-server --env.server --env.develop --inline --max-old-space-size=3000", - "dev": "vue-cli-service serve --open" + "dev": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --open" }, "husky": { "hooks": { diff --git a/src/views/inoutDrug/DialogCreateDrugOrder.vue b/src/views/inoutDrug/DialogCreateDrugOrder.vue index 9926d889..0b15a714 100644 --- a/src/views/inoutDrug/DialogCreateDrugOrder.vue +++ b/src/views/inoutDrug/DialogCreateDrugOrder.vue @@ -12,7 +12,7 @@ - 上传阳采单据 @@ -361,7 +361,7 @@ - + - + 下载码上放心追溯码 - + 导入阳采追溯码 + + + + + { + 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';