From 5fd0749dac1ad26eb28c4c7142fdf0f0c8ba074e Mon Sep 17 00:00:00 2001 From: chenhc <2369838784@qq.com> Date: Fri, 28 Mar 2025 14:28:49 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E9=98=B3=E9=87=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/views/inoutDrug/DialogCreateDrugOrder.vue | 82 ++++++++++++++++++- 2 files changed, 79 insertions(+), 5 deletions(-) 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';