yijing 1 год назад
Родитель
Сommit
2b181cbec4

+ 2 - 0
src/views/inspectionWork/components/QualityContentTabs.vue

@@ -3,6 +3,8 @@
     <header-title title="质检内容">
       <el-button type="primary" :loading="loading" v-if="type != 'detail'"
         @click="$emit('batch-quality')">批量质检</el-button>
+      <el-button type="primary" :loading="loading" v-if="type != 'detail'"
+        @click="$emit('batch-dispose')">批量处置</el-button>
     </header-title>
 
     <el-tabs v-model="activeName" @tab-click="handleClick">

+ 16 - 7
src/views/inspectionWork/components/sampleDisposeDialog.vue

@@ -93,7 +93,15 @@ export default {
       visible: false,
       rowIndex: 0,
       type: '',
-      formData: {},
+      formData: {
+        disposalStatus: '',
+        sampleDate: '',
+        disposeTime: '',
+        sampleCondition: '',
+        producerManufacturer: '',
+        samplePlace: '',
+        sampleRemark: ''
+      },
       qualityType: '',
       warehouseList: [],
       // 表单验证规则
@@ -200,14 +208,16 @@ export default {
       })
     },
     async openDispose(index, row, type, qualityType) {
+      this.visible = true;
+      if (index != null) {
+        this.formData = JSON.parse(JSON.stringify(row));
+      } else {
+        this.formData = {};
+      }
 
-      this.qualityType = qualityType;
       this.rowIndex = index
       this.type = type;
-      this.formData = row;
-
-
-      this.visible = true;
+      this.qualityType = qualityType;
     },
     handleClose() {
       this.visible = false;
@@ -215,7 +225,6 @@ export default {
     handleConfirm() {
       this.$refs.form1.validate((valid) => {
         if (valid) {
-          console.log(this.formData, "sdfd");
           this.$emit('handleDisposeConfirm', this.formData, this.rowIndex);
 
           this.visible = false;

+ 25 - 8
src/views/inspectionWork/edit.vue

@@ -11,9 +11,9 @@
 
       <quality-content-tabs ref="tabsRef" :type="type" :ids="this.$route.query.id" :sample-list="sampleList"
         :scheme-list="schemeList" :loading="loading" :form="form" @selection-change="handleSelectionChange1"
-        @batch-quality="batchQuality" @handleDetail="handleDetail" @inputWeight="inputWeight"
-        @handleDispose="handleDispose" @changeSamUnit="changeSamUnit" @handleSample1="handleSample1"
-        @handleSampleSubmit="handleSampleSubmit" />
+        @batch-quality="batchQuality" @batch-dispose="batchDispose" @handleDetail="handleDetail"
+        @inputWeight="inputWeight" @handleDispose="handleDispose" @changeSamUnit="changeSamUnit"
+        @handleSample1="handleSample1" @handleSampleSubmit="handleSampleSubmit" />
     </el-card>
 
     <sampleListDialog ref="detailRef" @handleConfirm="handleConfirm" @handleDispose="handleDispose"></sampleListDialog>
@@ -583,12 +583,25 @@ export default {
       })
     },
     // 处理确认事件
-    handleDisposeConfirm(row, index) {
-      if (index > -1) {
-        this.$set(this.sampleList, index, row)
+    handleDisposeConfirm(data, index) {
+      console.log(data, index, '确认处置事件')
+
+      if (index != null) {
+        this.$set(this.sampleList, index, data)
+      } else {
+        this.sampleList.forEach(obj => {
+          obj.disposalStatus = data.disposalStatus;
+          obj.sampleDate = data.sampleDate;
+          obj.disposeTime = data.disposeTime;
+          obj.sampleCondition = data.sampleCondition;
+          obj.producerManufacturer = data.producerManufacturer;
+          obj.samplePlace = data.samplePlace;
+          obj.sampleRemark = data.sampleRemark;
+
+        });
       }
     },
-    //确认报工
+    //确认质检
     handleConfirm(list, index) {
       console.log(list)
 
@@ -626,7 +639,11 @@ export default {
     // 批量质检
     batchQuality(index, row, type) {
       this.$refs.detailRef.openDia(null, null, 'report', this.sampleList, null)
-    }
+    },
+    // 批量处置
+    batchDispose() {
+      this.$refs.disposeRef.openDispose(null, null, 'dispose', this.qualityType);
+    },
   }
 };
 </script>