Ver código fonte

改处置bug

wsx 11 meses atrás
pai
commit
0fc2ad2698

+ 1 - 1
src/views/inspectionPlan/components/new-edit.vue

@@ -904,7 +904,7 @@
         this.activeName = tab.name;
         this.activeName = tab.name;
       },
       },
       async open(type, row) {
       async open(type, row) {
-        this.kkconditionType=row.conditionType
+        this.kkconditionType=row?.conditionType
         this.visible = true;
         this.visible = true;
         this.activeName = '1';
         this.activeName = '1';
         this.btnType = type;
         this.btnType = type;

+ 22 - 25
src/views/inspectionWork/components/baseInfo.vue

@@ -11,6 +11,7 @@
           />
           />
         </el-form-item>
         </el-form-item>
       </el-col>
       </el-col>
+      
       <!-- <el-col :span="6">
       <!-- <el-col :span="6">
         <el-form-item label="质检类型:" prop="qualityType">
         <el-form-item label="质检类型:" prop="qualityType">
           <DictSelection
           <DictSelection
@@ -188,7 +189,7 @@
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
         <el-col :span="6">
         <el-col :span="6">
-          <el-form-item label="检验标准" prop="inspectionStandards">
+          <el-form-item label="计量类型" prop="inspectionStandards">
             <!-- 计量 计重 -->
             <!-- 计量 计重 -->
             <el-select
             <el-select
               style="width: 100%"
               style="width: 100%"
@@ -260,7 +261,7 @@
             </div>
             </div>
           </el-form-item>
           </el-form-item>
         </el-col>-->
         </el-col>-->
-        <el-col :span="6">
+        <!-- <el-col :span="6">
           <el-form-item label="合格证号:" prop="certificateNumber">
           <el-form-item label="合格证号:" prop="certificateNumber">
             <el-input
             <el-input
               v-model="form.certificateNumber"
               v-model="form.certificateNumber"
@@ -268,7 +269,24 @@
               placeholder="请输入"
               placeholder="请输入"
             ></el-input>
             ></el-input>
           </el-form-item>
           </el-form-item>
+        </el-col> -->
+
+             <el-col :span="6">
+          <!-- <el-form-item label="质检结果:" prop="qualityResults" v-if="form.qualityMode == 2"> -->
+          <el-form-item label="质检结果:" prop="qualityResults">
+            <el-select
+              v-model="form.qualityResults"
+              placeholder="请选择"
+              style="width: 100%"
+              :disabled="btnType == 'detail'"
+            >
+              <el-option label="合格" :value="1" />
+              <el-option label="不合格" :value="2" />
+            </el-select>
+          </el-form-item>
         </el-col>
         </el-col>
+
+
       </el-row>
       </el-row>
       <el-row>
       <el-row>
         <el-col :span="6" v-if="parseInt(qualityType1) == 2">
         <el-col :span="6" v-if="parseInt(qualityType1) == 2">
@@ -310,29 +328,8 @@
             ></el-input>
             ></el-input>
           </el-form-item>
           </el-form-item>
         </el-col> -->
         </el-col> -->
-        <el-col :span="6">
-          <el-form-item label="质检类型:" prop="qualityType">
-            <DictSelection
-              dictName="质检计划类型"
-              v-model="form.qualityType"
-              disabled
-            ></DictSelection>
-          </el-form-item>
-        </el-col>
-        <el-col :span="6">
-          <!-- <el-form-item label="质检结果:" prop="qualityResults" v-if="form.qualityMode == 2"> -->
-          <el-form-item label="质检结果:" prop="qualityResults">
-            <el-select
-              v-model="form.qualityResults"
-              placeholder="请选择"
-              style="width: 100%"
-              :disabled="btnType == 'detail'"
-            >
-              <el-option label="合格" :value="1" />
-              <el-option label="不合格" :value="2" />
-            </el-select>
-          </el-form-item>
-        </el-col>
+       
+   
         <el-col :span="6">
         <el-col :span="6">
           <el-form-item label="备注:" prop="remark">
           <el-form-item label="备注:" prop="remark">
             <el-input
             <el-input

+ 3 - 1
src/views/inspectionWork/components/newQualityContentTabs.vue

@@ -1,3 +1,4 @@
+<!-- 质检内容 -->
 <template>
 <template>
   <el-row>
   <el-row>
     <!-- 选择质检方案 -->
     <!-- 选择质检方案 -->
@@ -284,6 +285,7 @@
             label="质检结果"
             label="质检结果"
             prop="qualityResults"
             prop="qualityResults"
             align="center"
             align="center"
+            width="100"
             fixed="right"
             fixed="right"
             :show-overflow-tooltip="true"
             :show-overflow-tooltip="true"
           >
           >
@@ -939,7 +941,7 @@
         this.$emit('inputWeight', row, index);
         this.$emit('inputWeight', row, index);
       },
       },
       handleDispose(index, row, type) {
       handleDispose(index, row, type) {
-        this.$emit('handleDispose', index, row, type);
+        this.$emit('handleDispose', { row, index });
       },
       },
       handleSampleSizeChange(val) {
       handleSampleSizeChange(val) {
         this.samplePagination.pageSize = val;
         this.samplePagination.pageSize = val;

+ 36 - 12
src/views/inspectionWork/components/sampleDisposeDialog.vue

@@ -1,15 +1,15 @@
 <template>
 <template>
   <ele-modal
   <ele-modal
     :title="title"
     :title="title"
-    :visible.sync="visible"
+    :visible.sync="sampleDisposeVisble"
     :before-close="handleClose"
     :before-close="handleClose"
     :close-on-click-modal="false"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     :close-on-press-escape="false"
     append-to-body
     append-to-body
-    width="80%"
+    width="30%"
     :maxable="true"
     :maxable="true"
   >
   >
-    <el-form ref="form1" :model="formData" :rules="rules" label-width="120px">
+    <el-form ref="form1" :model="formData" :rules="rules" label-width="140px">
       <el-form-item label="处置方式:" prop="disposeType">
       <el-form-item label="处置方式:" prop="disposeType">
         <el-select
         <el-select
           v-model="formData.disposeType"
           v-model="formData.disposeType"
@@ -101,7 +101,13 @@
         </el-row>
         </el-row>
       </template>
       </template>
 
 
-      <template v-if="this.formData.disposeType !== 8">
+      <template
+        v-if="
+          this.formData.disposeType == 3 ||
+          this.formData.disposeType == 6 ||
+          this.formData.disposeType == 9
+        "
+      >
         <el-form-item label="入库仓库:" prop="depotId" align="center">
         <el-form-item label="入库仓库:" prop="depotId" align="center">
           <el-select style="width: 100%" v-model="formData.depotId">
           <el-select style="width: 100%" v-model="formData.depotId">
             <el-option
             <el-option
@@ -261,6 +267,13 @@
   import { getWarehouseList } from '@/api/samplemanagement';
   import { getWarehouseList } from '@/api/samplemanagement';
 
 
   export default {
   export default {
+    props: {
+      sampleDisposeVisble: {
+        type: Boolean,
+        default: () => false
+      },
+      rowData: { type: Object, default: () => {} }
+    },
     components: {},
     components: {},
     data() {
     data() {
       return {
       return {
@@ -277,8 +290,8 @@
           { value: 10, label: '退货' }
           { value: 10, label: '退货' }
         ],
         ],
         title: '',
         title: '',
-        visible: false,
-        rowIndex: 0,
+        // visible: false,
+        rowIndex: null,
         type: '',
         type: '',
         formData: {
         formData: {
           disposeType: '',
           disposeType: '',
@@ -403,20 +416,23 @@
         }
         }
         console.log(this.formData);
         console.log(this.formData);
 
 
-        this.visible = true;
+        // this.visible = true;
         this.rowIndex = index;
         this.rowIndex = index;
         this.type = type;
         this.type = type;
         this.qualityType = qualityType;
         this.qualityType = qualityType;
       },
       },
       handleClose() {
       handleClose() {
-        this.visible = false;
+        this.$emit('close', false);
+       
       },
       },
       handleConfirm() {
       handleConfirm() {
         this.$refs.form1.validate((valid) => {
         this.$refs.form1.validate((valid) => {
           if (valid) {
           if (valid) {
-            this.$emit('handleDisposeConfirm', this.formData, this.rowIndex);
-
-            this.visible = false;
+            console.log(this.formData);
+            const res = { ...this.rowData?.row, ...this.formData };
+            console.log(res);
+            this.$emit('close');
+            this.$emit('handleDisposeConfirm', res, this.rowData?.index);
           }
           }
         });
         });
       },
       },
@@ -429,6 +445,14 @@
     watch: {
     watch: {
       'formData.disposeType': {
       'formData.disposeType': {
         handler(newVal, oldVal) {
         handler(newVal, oldVal) {
+          if (newVal == 6) {
+            this.rules.depotId = [];
+          } else {
+            this.rules.depotId = [
+              { required: true, message: '请选择仓库', trigger: 'change' }
+            ];
+          }
+
           this.formData.sampleCondition = '';
           this.formData.sampleCondition = '';
           this.formData.sampleDate = '';
           this.formData.sampleDate = '';
           this.formData.samplePlace = '';
           this.formData.samplePlace = '';
@@ -436,7 +460,7 @@
           this.formData.producerManufacturer = '';
           this.formData.producerManufacturer = '';
           this.formData.depotId = '';
           this.formData.depotId = '';
           this.formData.depotName = '';
           this.formData.depotName = '';
-        },
+        }
         // immediate: true
         // immediate: true
       }
       }
     }
     }

+ 51 - 21
src/views/inspectionWork/edit.vue

@@ -59,8 +59,13 @@
       @handleDispose="handleDispose"
       @handleDispose="handleDispose"
     ></sampleListDialog>
     ></sampleListDialog>
     <sampleDisposeDialog
     <sampleDisposeDialog
+      v-if="sampleDisposeVisble"
+      :sampleDisposeVisble.sync="sampleDisposeVisble"
       ref="disposeRef"
       ref="disposeRef"
       @handleDisposeConfirm="handleDisposeConfirm"
       @handleDisposeConfirm="handleDisposeConfirm"
+      :rowData="rowData"
+      @close="closeDispose"
+      @handleDispose="handleDispose"
     ></sampleDisposeDialog>
     ></sampleDisposeDialog>
   </div>
   </div>
 </template>
 </template>
@@ -134,7 +139,9 @@
         };
         };
       };
       };
       return {
       return {
+        rowData: null,
         defaultForm,
         defaultForm,
+        sampleDisposeVisble: false,
         // 表单数据
         // 表单数据
         form: { ...defaultForm() },
         form: { ...defaultForm() },
         voList: [],
         voList: [],
@@ -149,6 +156,7 @@
         // activeName: '2',
         // activeName: '2',
 
 
         packingList: [],
         packingList: [],
+        // 样品清单,处置,批量处置,批量质检,质检的操作
         sampleList: [],
         sampleList: [],
         schemeList: [],
         schemeList: [],
         inventoryList: [],
         inventoryList: [],
@@ -756,7 +764,10 @@
         console.log(res, '质检方案');
         console.log(res, '质检方案');
         this.schemeList = res.list;
         this.schemeList = res.list;
       },
       },
+      // 取样
       getConditionType(val) {
       getConditionType(val) {
+        console.log(val, '------取样的回调');
+
         this.form.conditionType = val;
         this.form.conditionType = val;
       },
       },
 
 
@@ -774,7 +785,7 @@
           let URL =
           let URL =
             this.type == 'add' ? save : this.type == 'edit' ? update : '';
             this.type == 'add' ? save : this.type == 'edit' ? update : '';
 
 
-          this.form.qualityTimeStart = this.qualityTimeStart
+          this.form.qualityTimeStart = this.qualityTimeStart;
 
 
           delete this.form['qualityTimeEnd'];
           delete this.form['qualityTimeEnd'];
 
 
@@ -846,18 +857,22 @@
         }, 0);
         }, 0);
         this.form.totalWeight = parseFloat(pNum.toFixed(2));
         this.form.totalWeight = parseFloat(pNum.toFixed(2));
       },
       },
-      handleDispose(index, row, type) {
-        if (!this.sampleList[index]) {
-          return;
-        }
+      handleDispose(data) {
+        console.log(data);
+        // return
+        this.rowData = data;
+        this.sampleDisposeVisble = true;
+        // if (!this.sampleList[index]) {
+        //   return;
+        // }
 
 
-        this.sampleList[index].sampleDate = this.getNowTimes();
+        // this.sampleList[index].sampleDate = this.getNowTimes();
 
 
-        this.sampleList[index].disposeTime = this.getNowTimes();
+        // this.sampleList[index].disposeTime = this.getNowTimes();
 
 
-        console.log(index, row, type, this.qualityType);
+        // console.log(index, row, type, this.qualityType);
 
 
-        this.$refs.disposeRef.openDispose(index, row, type, this.qualityType);
+        // this.$refs.disposeRef.openDispose(index, row, type, this.qualityType);
       },
       },
       // 报工
       // 报工
       handleReporting(index, row) {
       handleReporting(index, row) {
@@ -915,7 +930,7 @@
             qualityInventoryList: this.inventoryList
             qualityInventoryList: this.inventoryList
           };
           };
           console.log(params, 'params');
           console.log(params, 'params');
-       
+
           exeReportWork(params)
           exeReportWork(params)
             .then((msg) => {
             .then((msg) => {
               this.loading = false;
               this.loading = false;
@@ -931,20 +946,24 @@
       // 处理确认事件
       // 处理确认事件
       handleDisposeConfirm(data, index) {
       handleDisposeConfirm(data, index) {
         console.log(data, index, '确认处置事件');
         console.log(data, index, '确认处置事件');
+        console.log(this.sampleList);
 
 
-        if (index != null) {
-          this.$set(this.sampleList, index, data);
-        } else {
+        if (index == undefined) {
           this.sampleList.forEach((obj) => {
           this.sampleList.forEach((obj) => {
-            obj.disposalStatus = data.disposalStatus;
+            obj.disposeType = data.disposeType;
             obj.sampleDate = data.sampleDate;
             obj.sampleDate = data.sampleDate;
-            obj.disposeTime = data.disposeTime;
             obj.sampleCondition = data.sampleCondition;
             obj.sampleCondition = data.sampleCondition;
             obj.producerManufacturer = data.producerManufacturer;
             obj.producerManufacturer = data.producerManufacturer;
             obj.samplePlace = data.samplePlace;
             obj.samplePlace = data.samplePlace;
             obj.sampleRemark = data.sampleRemark;
             obj.sampleRemark = data.sampleRemark;
+            obj.depotId = data.depotId;
+            obj.depotName = data.depotName;
           });
           });
+        } else {
+          this.$set(this.sampleList, index, data);
         }
         }
+        
+        console.log(this.sampleList);
       },
       },
       //确认质检
       //确认质检
       handleConfirm(list, index) {
       handleConfirm(list, index) {
@@ -1021,12 +1040,18 @@
       },
       },
       // 批量处置
       // 批量处置
       batchDispose() {
       batchDispose() {
-        this.$refs.disposeRef.openDispose(
-          null,
-          null,
-          'dispose',
-          this.qualityType
-        );
+        if (this.sampleList && this.sampleList.length) {
+          this.sampleDisposeVisble = true;
+          return;
+        }
+        this.$message('当前没有样品清单可以处置');
+
+        // this.$refs.disposeRef.openDispose(
+        //   null,
+        //   null,
+        //   'dispose',
+        //   this.qualityType
+        // );
       },
       },
 
 
       //全检,检验标准改变时,重新获取样品列表
       //全检,检验标准改变时,重新获取样品列表
@@ -1319,6 +1344,11 @@
           qualificationRate,
           qualificationRate,
           noQualificationRate
           noQualificationRate
         );
         );
+      },
+      closeDispose() {
+        this.rowData = null;
+        this.sampleDisposeVisble = false;
+        // this.rowData = null;
       }
       }
     }
     }
   };
   };

+ 9 - 6
src/views/unqualifiedProduct/unqualifiedList/components/EquipmentDialog.vue

@@ -11,7 +11,7 @@
     <div>
     <div>
       <el-row>
       <el-row>
         <el-col :span="24" class="topsearch">
         <el-col :span="24" class="topsearch">
-          <el-form>
+          <el-form @submit.native.prevent="() => reload()">
             <el-row>
             <el-row>
               <el-col :span="6">
               <el-col :span="6">
                 <el-input
                 <el-input
@@ -22,7 +22,10 @@
               </el-col>
               </el-col>
 
 
               <el-col :span="6" style="margin-left: 10px">
               <el-col :span="6" style="margin-left: 10px">
-                <el-button type="primary" size="small" @click="reload"
+                <el-button
+                  type="primary"
+                  size="small"
+                  @click.enter.native="reload"
                   >搜索</el-button
                   >搜索</el-button
                 >
                 >
                 <el-button size="small" @click="reset">重置</el-button>
                 <el-button size="small" @click="reset">重置</el-button>
@@ -105,8 +108,8 @@
         selection: []
         selection: []
       };
       };
     },
     },
-    computed:{
-      columns(){
+    computed: {
+      columns() {
         return [
         return [
           {
           {
             width: 45,
             width: 45,
@@ -116,7 +119,7 @@
             reserveSelection: true,
             reserveSelection: true,
             show: this.type == 1,
             show: this.type == 1,
             selectable: (row, index) => {
             selectable: (row, index) => {
-              return !this.disabledCode.includes(row.code)
+              return !this.disabledCode.includes(row.code);
             }
             }
           },
           },
           {
           {
@@ -163,7 +166,7 @@
             showOverflowTooltip: true,
             showOverflowTooltip: true,
             minWidth: 110
             minWidth: 110
           }
           }
-        ]
+        ];
       }
       }
     },
     },
 
 

+ 1 - 1
src/views/unqualifiedProduct/unqualifiedList/components/salesToProduction.vue

@@ -572,7 +572,7 @@
       this.requestDict('按单按库');
       this.requestDict('按单按库');
       this.requestDict('订单类型');
       this.requestDict('订单类型');
       this.requestDict('交付要求');
       this.requestDict('交付要求');
-      this._teamPage();
+      // this._teamPage();
       this.getByCodeFn();
       this.getByCodeFn();
     },
     },
     methods: {
     methods: {

+ 21 - 21
src/views/unqualifiedProduct/unqualifiedList/index.vue

@@ -154,13 +154,13 @@
             width: 80,
             width: 80,
             showOverflowTooltip: true
             showOverflowTooltip: true
           },
           },
-          {
-            prop: 'unit',
-            label: '计量单位',
-            align: 'center',
-            width: 100,
-            showOverflowTooltip: true
-          },
+          // {
+          //   prop: 'unit',
+          //   label: '计量单位',
+          //   align: 'center',
+          //   width: 100,
+          //   showOverflowTooltip: true
+          // },
           {
           {
             prop: 'batchNo',
             prop: 'batchNo',
             label: '批次号',
             label: '批次号',
@@ -183,20 +183,20 @@
           //   width: 100,
           //   width: 100,
           //   showOverflowTooltip: true
           //   showOverflowTooltip: true
           // },
           // },
-          {
-            prop: 'produceRoutingName',
-            label: '工艺路线',
-            align: 'center',
-            width: 120,
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'taskName',
-            label: '工序',
-            align: 'center',
-            width: 120,
-            showOverflowTooltip: true
-          },
+          // {
+          //   prop: 'produceRoutingName',
+          //   label: '工艺路线',
+          //   align: 'center',
+          //   width: 120,
+          //   showOverflowTooltip: true
+          // },
+          // {
+          //   prop: 'taskName',
+          //   label: '工序',
+          //   align: 'center',
+          //   width: 120,
+          //   showOverflowTooltip: true
+          // },
           {
           {
             prop: 'disposeTime',
             prop: 'disposeTime',
             label: '处置时间',
             label: '处置时间',