From 681afc864f0c37f2f41eaf852853d024aecb66fb Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 01 三月 2023 16:40:52 +0800
Subject: [PATCH] 1.质检方案开发完成

---
 src/views/zlgl/zjfa.vue |  322 ++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 241 insertions(+), 81 deletions(-)

diff --git a/src/views/zlgl/zjfa.vue b/src/views/zlgl/zjfa.vue
index 1126347..3bcabd8 100644
--- a/src/views/zlgl/zjfa.vue
+++ b/src/views/zlgl/zjfa.vue
@@ -124,7 +124,12 @@
             sortable="custom"
           >
             <template slot-scope="{row}">
-              <div v-if="row.status==='Y'"><i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right:5px" />鏄�</div>
+              <div v-if="row.status==='Y'"><i
+                class="el-icon-success"
+                :style="{color:$store.state.settings.theme}"
+                style="margin-right:5px"
+              />鏄�
+              </div>
               <div v-else-if="row.status==='N'"><i class="el-icon-info" style="margin-right: 5px" />鍚�</div>
               <div v-else>/</div>
             </template>
@@ -135,7 +140,7 @@
             sortable="custom"
           >
             <template slot-scope="{row}">
-              <div v-if="row.checktype">{{ checktypeArr.find(i=>i.code===row.checktype).name }}</div>
+              <div v-if="row.checktype">{{ checktypeArr.find(i => i.code === row.checktype).name }}</div>
               <div v-else>/</div>
             </template>
           </el-table-column>
@@ -145,7 +150,7 @@
             sortable="custom"
           >
             <template slot-scope="{row}">
-              <div v-if="row.sampmethod">{{ sampltypeArr.find(i=>i.code===row.sampmethod).name }}</div>
+              <div v-if="row.sampmethod">{{ sampltypeArr.find(i => i.code === row.sampmethod).name }}</div>
               <div v-else>/</div>
             </template>
           </el-table-column>
@@ -155,7 +160,7 @@
             sortable="custom"
           >
             <template slot-scope="{row}">
-              <div v-if="row.suitobject">{{ suitobjectArr.find(i=>i.code===row.suitobject).name }}</div>
+              <div v-if="row.suitobject">{{ suitobjectArr.find(i => i.code === row.suitobject).name }}</div>
               <div v-else>/</div>
             </template>
           </el-table-column>
@@ -227,14 +232,15 @@
         <el-form-item label="璐ㄦ鏂规缂栫爜" prop="qualityinsptcode">
           <el-input v-model="dialogForm.qualityinsptcode" :disabled="operation!=='add'" style="width: 200px" />
         </el-form-item>
-        <el-form-item label="璐ㄦ鏂规鍚嶇О" prop="stepcheckitem_name">
-          <el-input v-model="dialogForm.stepcheckitem_name" style="width: 200px" />
+        <el-form-item label="璐ㄦ鏂规鍚嶇О" prop="qualityinsptname">
+          <el-input v-model="dialogForm.qualityinsptname" style="width: 200px" />
         </el-form-item>
         <br>
         <el-form-item prop="status" label="鏈夋晥鐘舵��">
           <el-select
             v-model="dialogForm.status"
             style="width: 200px"
+
             placeholder="璇烽�夋嫨"
             :popper-append-to-body="false"
           >
@@ -264,21 +270,48 @@
           </el-radio-group>
         </el-form-item>
         <el-form-item v-if="dialogForm.sampmethod==='FIXED'" label="鏍锋湰鏁伴噺" prop="sampnum">
-          <el-input v-model="dialogForm.sampnum" style="width: 200px" />
+          <el-input v-model="dialogForm.sampnum" oninput="value=value.replace(/[^0-9]/g,'')" style="width: 200px" />
         </el-form-item>
         <el-form-item v-if="dialogForm.sampmethod==='SCARE'" label="鎶芥姣斾緥" prop="sampscale">
-          <el-input v-model="dialogForm.sampscale" style="width: 180px" />
+          <el-input v-model="dialogForm.sampscale" oninput="value=value.replace(/[^0-9]/g,'')" style="width: 180px" />
           %
         </el-form-item>
         <br>
         <el-form-item prop="suitobject" label="閫傜敤瀵硅薄">
-          <el-radio-group v-model="dialogForm.suitobject" style="width: 200px;">
+          <el-radio-group v-model="dialogForm.suitobject" style="width: 200px;" @change="suitobjectChange">
             <el-radio label="PY">鐗╂枡绫诲埆</el-radio>
             <el-radio label="P">鐗╂枡</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item prop="suitpart" :label="dialogForm.suitobject==='P'?'閫傜敤鐗╂枡':'閫傜敤鐗╂枡绫诲埆'">
-          <el-input v-model="dialogForm.suitpart" style="width: 200px;" />
+        <el-form-item
+          prop="suitpart"
+          :label="dialogForm.suitobject==='Y'?'閫傜敤鐗╂枡':'閫傜敤鐗╂枡绫诲埆'"
+        >
+          <el-select
+            v-model="dialogForm.suitpart"
+            style="width: 200px"
+            multiple
+            filterable
+
+            collapse-tags
+            placeholder="璇烽�夋嫨"
+            :popper-append-to-body="false"
+          >
+            <el-option
+              v-for="item in PartSelectArr"
+              v-if="dialogForm.suitobject==='P'"
+              :key="item.partcode"
+              :label="item.partname"
+              :value="item.partcode"
+            />
+            <el-option
+              v-for="item in StockTypeSelectArr"
+              v-if="dialogForm.suitobject==='PY'"
+              :key="item.code"
+              :label="item.name"
+              :value="item.code"
+            />
+          </el-select>
         </el-form-item>
         <br>
         <el-form-item label="妫�楠屾柟妗堟弿杩�">
@@ -296,6 +329,7 @@
         </div>
         <div>璐ㄦ鍒楄〃锛�</div>
         <el-button
+          v-if="operation!=='check'"
           v-waves
           type="primary"
           style="margin-left: 20px;"
@@ -306,7 +340,7 @@
       </div>
 
       <el-table
-        ref="tableDataRef"
+        ref="tableDataRef2"
         class="tableFixed"
         :data="checkitem"
         height="250"
@@ -391,7 +425,10 @@
                 :value="item.code"
               />
             </el-select>
-            <div v-if="row.isVisible===0">{{ CheckItemSelectAllArr.find(i => i.code === row.stepcheckitem_code).name }}</div>
+            <div v-else>{{
+              CheckItemSelectAllArr.find(i => i.code === row.stepcheckitem_code).name
+            }}
+            </div>
           </template>
         </el-table-column>
 
@@ -414,7 +451,7 @@
                 :value="item.code"
               />
             </el-select>
-            <div v-if="row.isVisible===0">{{ row.required === 'Y' ? '鏄�' : '鍚�' }}</div>
+            <div v-else>{{ row.required === 'Y' ? '鏄�' : '鍚�' }}</div>
           </template>
         </el-table-column>
         <el-table-column
@@ -437,7 +474,7 @@
                 :value="item.code"
               />
             </el-select>
-            <div v-if="row.isVisible===0">{{ row.numberjudge === 'Y' ? '鏄�' : '鍚�' }}</div>
+            <div v-else>{{ row.numberjudge === 'Y' ? '鏄�' : '鍚�' }}</div>
           </template>
         </el-table-column>
         <el-table-column
@@ -445,24 +482,31 @@
           label="鍗曚綅"
         >
           <template slot-scope="{row}">
-            <el-select
+            <!--            <el-select-->
+            <!--              v-if="row.isVisible===1"-->
+            <!--              v-model="row.unit"-->
+            <!--              filterable-->
+            <!--              :disabled="row.numberjudge==='N'"-->
+            <!--              placeholder="璇烽�夋嫨"-->
+            <!--            >-->
+            <!--              <el-option-->
+            <!--                v-for="item in UomSelectArr"-->
+            <!--                :key="item.code"-->
+            <!--                :label="item.name"-->
+            <!--                :value="item.code"-->
+            <!--              />-->
+            <!--            </el-select>-->
+            <!--            <div v-if="row.isVisible===0">{{-->
+            <!--                row.numberjudge === 'Y' ? UomSelectArr.find(i => i.code === row.unit).name : '/'-->
+            <!--              }}-->
+            <!--            </div>-->
+            <el-input
               v-if="row.isVisible===1"
               v-model="row.unit"
-              filterable
-              :disabled="row.numberjudge==='N'"
               placeholder="璇烽�夋嫨"
-            >
-              <el-option
-                v-for="item in UomSelectArr"
-                :key="item.code"
-                :label="item.name"
-                :value="item.code"
-              />
-            </el-select>
-            <div v-if="row.isVisible===0">{{
-              row.numberjudge === 'Y' ? UomSelectArr.find(i => i.code === row.unit).name : '/'
-            }}
-            </div>
+              :disabled="row.numberjudge==='N'"
+            />
+            <div v-else>{{ row.unit?row.unit:'/' }}</div>
           </template>
         </el-table-column>
         <el-table-column
@@ -491,7 +535,7 @@
               oninput="value=value.replace(/[^0-9]/g,'')"
               placeholder="璇疯緭鍏�"
             />
-            <div v-if="row.isVisible===0">{{ row.numberjudge === 'Y' ? row.decimalnum : '/' }}</div>
+            <div v-else>{{ row.numberjudge === 'Y' ? row.decimalnum : '/' }}</div>
           </template>
         </el-table-column>
         <el-table-column
@@ -506,7 +550,7 @@
               oninput="value=value.replace(/[^0-9.]/g,'')"
               placeholder="璇疯緭鍏�"
             />
-            <div v-if="row.isVisible===0">{{ row.standvalue ? row.standvalue : '/' }}</div>
+            <div v-else>{{ row.standvalue ? row.standvalue : '/' }}</div>
           </template>
         </el-table-column>
         <el-table-column
@@ -521,7 +565,7 @@
               oninput="value=value.replace(/[^0-9.]/g,'')"
               placeholder="璇疯緭鍏�"
             />
-            <div v-if="row.isVisible===0">{{ row.uppervalue ? row.uppervalue : '/' }}</div>
+            <div v-else>{{ row.uppervalue ? row.uppervalue : '/' }}</div>
           </template>
         </el-table-column>
         <el-table-column
@@ -536,7 +580,7 @@
               oninput="value=value.replace(/[^0-9.]/g,'')"
               placeholder="璇疯緭鍏�"
             />
-            <div v-if="row.isVisible===0">{{ row.lowervalue ? row.lowervalue : '/' }}</div>
+            <div v-else>{{ row.lowervalue ? row.lowervalue : '/' }}</div>
           </template>
         </el-table-column>
         <el-table-column
@@ -549,20 +593,21 @@
               v-model="row.stepcheckitem_desc"
               placeholder="璇疯緭鍏�"
             />
-            <div v-if="row.isVisible===0">{{ row.stepcheckitem_desc ? row.stepcheckitem_desc : '/' }}</div>
+            <div v-else>{{ row.stepcheckitem_desc ? row.stepcheckitem_desc : '/' }}</div>
           </template>
         </el-table-column>
         <el-table-column
+          v-if="operation!=='check'"
           label="鎿嶄綔"
           width="120"
           fixed="right"
         >
           <template slot-scope="{row}">
             <div class="operationClass">
-              <el-button v-if="row.isVisible===0" v-waves type="text" @click="editZjlbRow(row)">缂栬緫</el-button>
-              <el-button v-if="row.isVisible===0" v-waves type="text" @click="delZjlbRow(row)">鍒犻櫎</el-button>
-              <el-button v-if="row.isVisible===1" v-waves type="text" @click="saveZjlbRow(row)">淇濆瓨</el-button>
-              <el-button v-if="row.isVisible===1" v-waves type="text" @click="cancelZjlbRow(row)">鍙栨秷</el-button>
+              <el-button v-if="row.isVisible===1" v-waves type="text" @click="saveZjlbRow(row)">纭</el-button>
+              <el-button v-if="row.isVisible===1&&isCancel" v-waves type="text" @click="cancelZjlbRow(row)">鍙栨秷</el-button>
+              <el-button v-if="row.isVisible!==1" v-waves type="text" @click="editZjlbRow(row)">缂栬緫</el-button>
+              <el-button v-if="row.isVisible!==1" v-waves type="text" @click="delZjlbRow(row)">鍒犻櫎</el-button>
             </div>
           </template>
         </el-table-column>
@@ -570,8 +615,16 @@
 
       <span slot="footer" class="dialog-footer">
         <div class="footerButton">
-          <el-button v-waves @click="dialogVisibleCancel">鍙� 娑�</el-button>
-          <el-button v-waves type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>
+          <el-button v-if="operation!=='check'" v-waves @click="dialogVisibleCancel">鍙� 娑�</el-button>
+          <el-button
+            v-if="operation!=='check'"
+            v-waves
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            type="primary"
+            @click="dialogVisibleConfirm"
+          >淇� 瀛�</el-button>
+          <el-button v-if="operation==='check'" v-waves @click="dialogVisibleCancel">杩� 鍥�</el-button>
         </div>
       </span>
     </el-dialog>
@@ -581,14 +634,16 @@
 
 <script>
 import Pagination from '@/components/Pagination'
-import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
-import { getCookie } from '@/utils/auth'
-
 import { validateCode } from '@/utils/global'
 import elDragDialog from '@/directive/el-drag-dialog'
 import waves from '@/directive/waves'
-import { UomSelect } from '@/api/zzmx'
-import { QualityInspectionDelete, QualityInspectionSearch, StepCheckItemSelect } from '@/api/zlgl'
+import { PartSelect, StockTypeSelect, UomSelect } from '@/api/zzmx'
+import {
+  QualityInspectionAddEditSave,
+  QualityInspectionDelete,
+  QualityInspectionSearch, QualityInspectionSeeEdit,
+  StepCheckItemSelect
+} from '@/api/zlgl'
 
 export default {
   name: 'Zzjg',
@@ -609,7 +664,7 @@
         checktype: '', // 璐ㄦ绫诲瀷
         sampltype: '', // 鎶芥牱鏂瑰紡
         suitobject: '', // 閫傜敤瀵硅薄
-        prop: 'code', // 鎺掑簭瀛楁
+        prop: 'lm_date', // 鎺掑簭瀛楁
         order: 'desc', // 鎺掑簭瀛楁
         page: 1, // 绗嚑椤�
         rows: 20 // 姣忛〉澶氬皯鏉�
@@ -634,14 +689,14 @@
       dialogVisible: false,
       dialogForm: {
         qualityinsptcode: '', // 璐ㄦ鏂规缂栫爜
-        stepcheckitem_name: '', // 璐ㄦ鏂规鍚嶇О
+        qualityinsptname: '', // 璐ㄦ鏂规鍚嶇О
         status: 'Y', // 鏈夋晥鐘舵��
         checktype: '', // 妫�楠岀被鍨�
         sampmethod: 'FIXED', // 鎶芥鏂瑰紡
         sampnum: '', // 鏍锋湰鏁伴噺
         sampscale: '', // 鎶芥姣斾緥
         suitobject: 'P', // 閫傜敤瀵硅薄
-        suitpart: '', // 閫傜敤鐗╂枡
+        suitpart: [], // 閫傜敤鐗╂枡
         descr: '' // /鎻忚堪
       },
       operation: '',
@@ -652,7 +707,7 @@
         qualityinsptcode: [
           { required: true, validator: validateCode, trigger: ['blur', 'change'] }
         ],
-        stepcheckitem_name: [
+        qualityinsptname: [
           { required: true, message: '璇疯緭鍏ヨ川妫�鏂规鍚嶇О', trigger: ['blur', 'change'] }
         ],
         checktype: [
@@ -671,7 +726,7 @@
           { required: true, message: '璇烽�夋嫨閫傜敤瀵硅薄', trigger: ['blur', 'change'] }
         ],
         suitpart: [
-          { required: true, message: '璇疯緭鍏ラ�傜敤鐗╂枡', trigger: ['blur', 'change'] }
+          { required: true, message: '璇烽�夋嫨鐗╂枡鎴栫墿鏂欑被鍒�', trigger: ['blur', 'change'] }
         ]
       },
       checkitem: [],
@@ -681,9 +736,13 @@
         { code: 'N', name: '鍚�' }
       ],
 
+      PartSelectArr: [], // 鐗╂枡涓嬫媺鏁扮粍
+      StockTypeSelectArr: [], // 鐗╂枡绫诲埆涓嬫媺鏁扮粍
       UomSelectArr: [], // 鍗曚綅涓嬫媺鏁扮粍
       CheckItemSelectAllArr: [], // 妫�楠岄」鐩�(鎵�鏈�)
-      CheckItemSelectArr: []// 妫�楠岄」鐩�
+      CheckItemSelectArr: [], // 妫�楠岄」鐩�
+
+      isCancel: true// 鏄惁鍙彇娑�
 
     }
   },
@@ -699,8 +758,10 @@
     handleRequest() {
       this.getQualityInspectionSearch().then(res => {
         if (res.code === '200') {
-          this.getUomSelect()
+          // this.getUomSelect()
           this.getStepCheckItemSelect()
+          this.getPartSelect()
+          this.getStockTypeSelect()
         }
       })
     },
@@ -711,6 +772,7 @@
 
       return { code: res.code }
     },
+
     // 鎺掑簭鏀瑰彉鏃�
     sortChange({ column, prop, order }) {
       if (order === 'descending') {
@@ -745,19 +807,72 @@
       this.dialogVisible = true
     },
     // 鏌ョ湅
-    check(operation, row) {
+    async check(operation, row) {
       this.operation = operation
       this.dialogVisible = true
-    },
-    // 淇敼鎸夐挳
-    edit(operation, row) {
-      this.operation = operation
-      this.dialogVisible = true
+
+      const { data: res } = await QualityInspectionSeeEdit({ qualityinsptcode: row.code })
 
       this.$nextTick(() => {
         this.dialogForm.qualityinsptcode = row.code
         this.dialogForm.qualityinsptname = row.name
-        // this.dialogForm.SupUnit = row.parent_id
+        this.dialogForm.status = row.status
+        this.dialogForm.checktype = row.checktype
+        this.dialogForm.sampmethod = row.sampmethod
+        // this.dialogForm.sampscare =  row.sampscare
+        if (this.dialogForm.sampmethod === 'FIXED') {
+          this.dialogForm.sampnum = row.sampscare
+        } else {
+          this.dialogForm.sampscale = row.sampscare
+        }
+        this.dialogForm.suitobject = row.suitobject
+        this.dialogForm.suitpart = row.suitpart.split(',')
+        this.dialogForm.descr = row.descr
+        this.checkitem = res
+
+        this.$refs.tableDataRef2.doLayout()
+      })
+    },
+    // 淇敼鎸夐挳
+    async  edit(operation, row) {
+      this.operation = operation
+      this.dialogVisible = true
+
+      const { data: res } = await QualityInspectionSeeEdit({ qualityinsptcode: row.code })
+
+      const tempCodeArr = []
+      res.forEach(i => {
+        let number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
+        number = number === 0 ? (10 + Math.random()) : number
+        i.number = number
+        i.isVisible = 0
+        tempCodeArr.push(i.stepcheckitem_code)
+      })
+
+      this.CheckItemSelectArr = []
+      this.CheckItemSelectAllArr.forEach(i => {
+        if (!tempCodeArr.includes(i.code)) {
+          this.CheckItemSelectArr.push(i)
+        }
+      })
+
+      this.$nextTick(() => {
+        this.dialogForm.qualityinsptcode = row.code
+        this.dialogForm.qualityinsptname = row.name
+        this.dialogForm.status = row.status
+        this.dialogForm.checktype = row.checktype
+        this.dialogForm.sampmethod = row.sampmethod
+        if (this.dialogForm.sampmethod === 'FIXED') {
+          this.dialogForm.sampnum = row.sampscare
+        } else {
+          this.dialogForm.sampscale = row.sampscare
+        }
+        this.dialogForm.suitobject = row.suitobject
+        this.dialogForm.suitpart = row.suitpart.split(',')
+        this.dialogForm.descr = row.descr
+        this.checkitem = res
+        // console.log(this.checkitem, 2)
+        this.$refs.tableDataRef2.doLayout()
       })
     },
     // 鍒犻櫎鎸夐挳
@@ -780,10 +895,24 @@
         this.$message.info('宸插彇娑堝垹闄�')
       })
     },
+    // 鐗╂枡涓嬫媺
+    async getPartSelect() {
+      const { data: res } = await PartSelect()
+      this.PartSelectArr = res
+    },
+    // 鐗╂枡绫诲埆涓嬫媺
+    async getStockTypeSelect() {
+      const { data: res } = await StockTypeSelect()
+      this.StockTypeSelectArr = res
+    },
     // 鑾峰彇鍗曚綅涓嬫媺鎺ュ彛
     async getUomSelect() {
       const { data: res } = await UomSelect()
       this.UomSelectArr = res
+    },
+    // 閫傜敤瀵硅薄鍊兼敼鍙樻槸
+    suitobjectChange() {
+      this.dialogForm.suitpart = []
     },
     // 鑾峰彇妫�楠岄」鐩笅鎷夋帴鍙�
     async getStepCheckItemSelect() {
@@ -821,7 +950,7 @@
       let number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
       number = number === 0 ? (10 + Math.random()) : number
 
-      this.checkitem.unshift({
+      this.checkitem.push({
         number,
         isVisible: 1,
         // jyxmbm: '',
@@ -861,6 +990,8 @@
       }
       this.CheckItemSelectArr = this.CheckItemSelectArr.filter(i => i.code !== row.stepcheckitem_code)
       row.isVisible = 0
+
+      this.isCancel = true
     },
     // 鍙栨秷琛�
     cancelZjlbRow(row) {
@@ -871,25 +1002,27 @@
       if (this.checkitem.find(i => i.isVisible === 1)) {
         return this.$message.info('璇峰厛淇濆瓨褰撳墠琛屾暟鎹紒')
       }
+      row.isVisible = 1
+      this.isCancel = false
       const t = this.CheckItemSelectAllArr.find(i => i.code === row.stepcheckitem_code)
       this.CheckItemSelectArr.unshift(t)
-      row.isVisible = 1
     },
     // 瀵硅瘽妗嗗叧闂簨浠�
     handleClose() {
       this.dialogForm = {
         qualityinsptcode: '',
-        stepcheckitem_name: '',
+        qualityinsptname: '',
         status: 'Y',
         checktype: '',
         sampmethod: 'FIXED',
         sampnum: '',
         sampscale: '',
         suitobject: 'P',
-        suitpart: '',
+        suitpart: [],
         descr: ''
       }
 
+      this.isCancel = true
       this.checkitem = []
       this.$refs.dialogForm.clearValidate()
     },
@@ -902,23 +1035,50 @@
     dialogVisibleConfirm() {
       this.$refs.dialogForm.validate(valid => {
         if (valid) {
-          console.log(this.dialogForm, 'dialogForm')
-          console.log(this.checkitem, 'checkitem')
-          // const data = {
-          //   OrganCode: this.dialogForm.qualityinsptcode,
-          //   OrganName: this.dialogForm.qualityinsptname,
-          //   OperType: this.operation === 'add' ? 'Add' : 'Update',
-          //   Operator: getCookie('admin')
-          // }
-          // AddUpdateOrganization(data).then(res => {
-          //   if (res.code === '200') {
-          //     this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
-          //     this.dialogVisible = false
-          //     this.getQualityInspectionSearch()
-          //   } else {
-          //     this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
-          //   }
-          // })
+          if (this.checkitem.length < 1) {
+            return this.$message.info('璐ㄦ鍒楄〃涓嶈兘涓虹┖锛�')
+          }
+
+          const checkitem = []
+          this.checkitem.forEach((item, index) => {
+            checkitem.push({
+              stepcheckitem_seq: index + 1,
+              stepcheckitem_code: item.stepcheckitem_code,
+              stepcheckitem_desc: item.stepcheckitem_desc,
+              required: item.required,
+              numberjudge: item.numberjudge,
+              unit: item.unit,
+              decimalnum: item.decimalnum,
+              standvalue: item.standvalue,
+              uppervalue: item.uppervalue,
+              lowervalue: item.lowervalue
+            })
+          })
+          const data = {
+            qualityinsptcode: this.dialogForm.qualityinsptcode,
+            qualityinsptname: this.dialogForm.qualityinsptname,
+            status: this.dialogForm.status,
+            checktype: this.dialogForm.checktype,
+            sampmethod: this.dialogForm.sampmethod,
+            sampscare: this.dialogForm.sampnum ? this.dialogForm.sampnum : this.dialogForm.sampscale,
+            suitobject: this.dialogForm.suitobject,
+            suitpart: this.dialogForm.suitpart.join(','),
+            type: this.operation === 'add' ? 'Add' : 'Update',
+            descr: this.dialogForm.descr,
+            checkitem
+          }
+
+          this.$store.state.app.buttonIsDisabled = true
+          QualityInspectionAddEditSave(data).then(res => {
+            if (res.code === '200') {
+              this.$message.success(this.operation === 'add' ? '淇濆瓨鎴愬姛锛�' : '淇敼鎴愬姛锛�')
+              this.dialogVisible = false
+              this.getQualityInspectionSearch()
+              this.$store.state.app.buttonIsDisabled = false
+            } else {
+              this.$message.error(this.operation === 'add' ? '淇濆瓨澶辫触锛�' : '淇敼澶辫触锛�')
+            }
+          })
         }
       })
     },

--
Gitblit v1.9.3