From 5fcfed0c9e6dac85f680c705c9b20abad79e1324 Mon Sep 17 00:00:00 2001
From: 王震 <10952869+daywangzhen@user.noreply.gitee.com>
Date: 星期二, 19 十二月 2023 17:33:05 +0800
Subject: [PATCH] 	modified:   src/const/website.js 	new file:   src/page/PackingLedgerDetails/index.vue 	modified:   src/router/page/index.js 	modified:   src/views/plan/manufacturingorder/index.vue 	modified:   src/views/quality/Packaging_ledger/index.vue 	modified:   vue.config.js

---
 src/views/quality/packageinspect/packageInspect-form.vue |   76 +++++++++++++++++++++++++++++++------
 1 files changed, 63 insertions(+), 13 deletions(-)

diff --git a/src/views/quality/packageinspect/packageInspect-form.vue b/src/views/quality/packageinspect/packageInspect-form.vue
index 891b0dd..4f825f5 100644
--- a/src/views/quality/packageinspect/packageInspect-form.vue
+++ b/src/views/quality/packageinspect/packageInspect-form.vue
@@ -160,6 +160,20 @@
         </el-row>
       </div>
     </div>
+    <el-dialog
+      title="鎻愮ず"
+      :visible.sync="dialogVisible"
+      width="30%">
+      <el-form :model="submitData" ref="form" label-width="100px" >
+        <el-form-item label="璇疯緭鍏ヨ鍙�" prop="lineNo" :rules="{required:true,message:'琛屽彿涓嶈兘涓虹┖',trigger:'blur'}">
+          <el-input v-model="submitData.lineNo" />
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+        <el-button type="primary" @click="confirmSubmit(submitData,false)">纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -168,6 +182,7 @@
   fetchListById,
   updatePackageInsProduct,
   updatePackageInspectById,
+  getCustomer,
 } from '@/api/quality/packageInspect'
 export default {
     computed:{},
@@ -175,6 +190,12 @@
     },
     data(){
         return{
+            submitData: {
+              id:null,
+              result: null,
+              lineNo: null,
+            },
+            dialogVisible: false,
             loading: false,
             resultVal: null,
             dataForm:{
@@ -222,6 +243,11 @@
       this.init()
     },
     watch:{
+      dialogVisible(newVal){
+        if(!newVal){
+          this.$refs.form.resetFields();
+        }
+      }
     },
     methods:{
       changeResult(){
@@ -249,20 +275,42 @@
           cancelButtonText: '鍙栨秷',
           type: 'warning'
         }).then(() => {
-          let data = {
-          id: _than.dataForm.id,
-          result: _than.conclusionTable[0].result,
-        }
-        updatePackageInspectById(data).then(res => {
-          if(res.data.code === 0){
-            _than.resultVal = res.data.data
-            sessionStorage.setItem("packIns-resultVal-"+_than.dataForm.id,res.data.data)
-            _than.$message.success("涓婃姤鎴愬姛");
-          }else{
-            _than.$message.error("涓婃姤澶辫触",res.data.data);
-          }
-        })
+          _than.submitData.id = _than.dataForm.id,
+          _than.submitData.result = _than.conclusionTable[0].result,
+          getCustomer(_than.dataForm.id).then(res=>{
+            if(res.status===200){
+              _than.confirmSubmit(_than.submitData,true)
+            }
+          }).catch(error=>{
+            _than.dialogVisible = true
+          })
+
         }).catch(() => {})
+      },
+      confirmSubmit(data,isOtc){
+        const _than = this
+        let isSubmit = false
+        if(isOtc){
+          isSubmit = true
+        }else{
+          _than.$refs.form.validate(valid=>{
+            if(valid){
+              isSubmit = true
+              _than.dialogVisible = false
+            }
+          })
+        }
+        if(isSubmit){
+          updatePackageInspectById(data).then(res => {
+            if(res.data.code === 0){
+              _than.resultVal = res.data.data
+              sessionStorage.setItem("packIns-resultVal-"+_than.dataForm.id,res.data.data)
+              _than.$message.success("涓婃姤鎴愬姛");
+            }else{
+              _than.$message.error("涓婃姤澶辫触",res.data.data);
+            }
+          })
+        }
       },
       // 娣诲姞琛�
       clickAddLine() {
@@ -304,6 +352,7 @@
           })
           this.list[i].children.splice(childrenIndex,1)
         }
+        this.changeResult()
       },
       //淇濆瓨妫�鏌ラ」
       savePackIns(){
@@ -330,6 +379,7 @@
           updatePackageInsProduct(dataList).then(res=>{
             if(res.status===200){
               this.$message.success("淇濆瓨鎴愬姛")
+              this.init()
             }
           }).catch(error=>{
             console.log(error);

--
Gitblit v1.9.3