From 647cb2146a5914bf584046234b87839a314c6dc3 Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期三, 13 八月 2025 11:06:19 +0800 Subject: [PATCH] 样品编号修改按钮优化 --- src/components/do/b1-inspect-order-plan/Inspection.vue | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 54 insertions(+), 0 deletions(-) diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue index 86f67e1..3f2c62e 100644 --- a/src/components/do/b1-inspect-order-plan/Inspection.vue +++ b/src/components/do/b1-inspect-order-plan/Inspection.vue @@ -315,6 +315,7 @@ <span style="color: #3A7BFA;">淇濆瓨妯℃澘</span> </el-button> <!-- <el-button size="small" type="primary" @click="sampleVisible=true;uploadSample()">鏍峰搧鍒囨崲</el-button> --> + <el-button size="small" type="primary" @click="showSampleChangeDialog" v-show="!isLook">鏍峰搧缂栧彿鏇存敼</el-button> <el-button size="small" type="primary" @click="taskVisible = true" v-show="!isLook">浠诲姟鍒囨崲</el-button> <el-button size="small" type="primary" @click="handleSubmit" v-if="state == 1" :loading="submitLoading">鎻愪氦</el-button> @@ -1168,6 +1169,21 @@ <el-button type="primary" @click="upInsReview" :loading="reviewLoading">纭� 瀹�</el-button> </span> </el-dialog> + <el-dialog + title="淇敼鏍峰搧缂栧彿" + :visible.sync="changeSampleDialog" + width="30%" + :before-close="handleCloseSampleChangeDialog"> + <el-form ref="changeSampleFormRef" :model="changeSampleForm" :rules="{sampleCode:[{required:true,message:'璇疯緭鍏ユ牱鍝佺紪鍙�',trigger:'blur'}]}"> + <el-form-item label="鏍峰搧缂栧彿:" prop="sampleCode" > + <el-input clearable v-model="changeSampleForm.sampleCode" placeholder='鏍峰搧缂栧彿'></el-input> + </el-form-item> + </el-form> + <span slot="footer" class="dialog-footer"> + <el-button @click="handleCloseSampleChangeDialog">鍙� 娑�</el-button> + <el-button type="primary" @click="confirmChangeSample">纭� 瀹�</el-button> + </span> + </el-dialog> </div> </template> @@ -1206,6 +1222,10 @@ }, data() { return { + changeSampleDialog: false, + changeSampleForm:{ + sampleCode:null, + }, lookFileVisible: false, //棰勮鏂囦欢 experimentDia: false, experimentDia0: false, @@ -1645,6 +1665,37 @@ this.stopWorker(); }, methods: { + handleCloseSampleChangeDialog(){ + this.changeSampleForm = {sampleChange:null} + this.$refs.changeSampleFormRef.resetFields(); + this.changeSampleDialog = false + }, + //纭淇敼鏍峰搧缂栧彿 + confirmChangeSample(){ + this.$refs.changeSampleFormRef.validate((valid)=>{ + if(valid){ + this.$axios.post(this.$api.insOrderPlan.changeSampleCode,{ + id:this.currentSample.id, + sampleCode:this.changeSampleForm.sampleCode + },{ + headers:{"Content-Type":"application/json"} + }).then(res=>{ + if(res.code==200){ + this.$message.success("淇敼鎴愬姛") + //璋冪敤鍒锋柊鏂规硶 + this.currentSample.sampleCode = this.changeSampleForm.sampleCode + } + this.$nextTick(()=>{ + this.handleCloseSampleChangeDialog() + }) + }) + } + }) + }, + //鏄剧ず淇敼鏍峰搧缂栧彿 + showSampleChangeDialog(){ + this.changeSampleDialog = true + }, // 鏁版嵁閲囬泦 getDataAcquisitionDevice() { if ( @@ -4510,9 +4561,11 @@ let url = ""; if (res.data.type == 1) { url = this.javaApi + "/img/" + res.data.fileUrl; + url = url.replace(/#/g, "%23"); file.downloadIamge(url, row.fileName); } else { url = this.javaApi + "/word/" + res.data.fileUrl; + url = url.replace(/#/g, "%23"); const link = document.createElement("a"); link.href = url; link.download = row.fileName; @@ -4586,6 +4639,7 @@ } else { this.currentFile.url = this.javaApi + "/word/" + row.fileUrl; } + this.currentFile.url = this.currentFile.url.replace(/#/g, "%23"); this.lookFileVisible = true; }, handleBack() { -- Gitblit v1.9.3