695593266@qq.com пре 1 година
родитељ
комит
23446219cb

+ 6 - 89
src/views/inspectionPlan/components/new-baseInfo.vue

@@ -433,94 +433,6 @@
       }
     },
     watch: {
-      // 'form.productNumber': {
-      //   handler(newVal) {
-      //     // if (this.form.productNumber) {
-      //     //   this.isInforChangeNumber = false;
-      //     // }
-      //     // 现在生产检验所有的类型也用这个
-      //     // if (newVal && this.form.planSource == '5') { //主数据来源才生效
-      //     // if (newVal && this.quantityShow && !this.isInforChangeNumber) {
-      //     //   this.$emit('changeProductNumberModel', newVal);
-      //     //   this.form.totalWeight = this.categoryInfo.netWeight * newVal || 0;
-      //     // } else {
-      //     //   console.log('清空样品清单1');
-      //     //   this.isInforChangeNumber = true;
-      //     //   this.$emit('table2');
-      //     // }
-      //     console.log(this.btnType);
-      //     if (newVal && this.quantityShow && !this.isInforChangeNumber) {
-      //       this.$emit('changeProductNumberModel', newVal);
-      //       this.form.totalWeight = this.categoryInfo.netWeight * newVal || 0;
-      //     } else {
-      //       console.log('清空样品清单1');
-      //       this.isInforChangeNumber = true;
-      //       this.$emit('table2');
-      //     }
-      //   },
-      //   // immediate: false
-      //   immediate: true
-      // },
-      // 'form.qualityMode': {
-      //   handler(newVal) {
-      //     console.log(321321);
-      //     console.log(this.form.qualityMode);
-      //     // if (newVal && !this.isInfoChangeModel) {
-      //     //   this.$emit('changeModel', newVal);
-      //     //   console.log(45464646464);
-      //     // } else {
-      //     //   console.log('清空样品清单2');
-      //     //   this.isInfoChangeModel = true;
-      //     //   this.$emit('table2');
-      //     // }
-      //     // if (this.form.qualityMode) {
-      //     //   this.isInfoChangeModel = false;
-      //     // }
-      //     console.log(this.btnType, this.isInfoChangeModel, '=====>');
-      //     if (newVal && !this.isInfoChangeModel) {
-      //       console.log(
-      //         this.btnType,
-      //         this.isInfoChangeModel,
-      //         '--------------->'
-      //       );
-      //       this.$emit('changeModel', newVal);
-      //       console.log(45464646464);
-      //     } else {
-      //       console.log('清空样品清单2');
-      //       this.isInfoChangeModel = true;
-      //       this.$emit('table2');
-      //     }
-      //   },
-      //   // immediate: false
-      //   immediate: true
-      // },
-      // 'form.inspectionStandards': {
-      //   handler(newVal) {
-      //     // if (this.form.inspectionStandards) {
-      //     //   this.isInfoChangeType = false;
-      //     // }
-      //     // console.log(this.btnType);
-      //     // if (newVal && !this.isInfoChangeType) {
-      //     //   this.$emit('getInspectionStandards', newVal);
-      //     // } else {
-      //     //   this.isInfoChangeType = true;
-      //     //   console.log('清空样品清单3');
-      //     //   this.$emit('table2');
-      //     // }
-      //     console.log(this.btnType);
-      //     // console.log(465413);
-      //     if (newVal) {
-      //       console.log('=====<><><><><');
-      //       this.$emit('getInspectionStandards', newVal);
-      //     } else {
-      //       this.isInfoChangeType = true;
-      //       console.log('清空样品清单3');
-      //       this.$emit('table2');
-      //     }
-      //   },
-      //   // immediate: false
-      //   immediate: true
-      // },
       'form.type': {
         handler(newVal) {
           if (!newVal) {
@@ -853,7 +765,12 @@
         console.log(this.categoryInfo.measureType, 'getProductDetails');
         this.form.inspectionStandards = this.categoryInfo.measureType;
 
-        this.form.qualityMode = qmsData.checkFormula || 1;
+        this.form.qualityMode = this.form.qualityMode
+          ? this.form.qualityMode
+          : qmsData.checkFormula
+          ? qmsData.checkFormula
+          : 1;
+        // this.form.qualityMode = qmsData.checkFormula || 1;
         // if (this.form.qualityMode) {
         //   this.changeQualityMode(this.form.qualityMode, 'Details');
         // }

+ 203 - 79
src/views/inspectionPlan/components/new-edit.vue

@@ -48,19 +48,19 @@
             "
             @selection-change="handleSelectionChange"
           > -->
+          <!-- :datasource="sourceList" -->
 
+          <!-- :datasource="
+              btnType == 'add' ||
+              (btnType == 'edit' && (!isPackingList || !isSampleList))
+                ? sourceList
+                : datasource
+            " -->
           <!-- 来料列表表格 -->
           <ele-pro-table
             ref="table12"
             :columns="tableColumns"
-            :datasource="datasource"
-            :needPage="
-              btnType == 'add' ||
-              (btnType == 'edit' && !isPackingList) ||
-              !isSampleList
-                ? false
-                : true
-            "
+            :datasource="sourceList"
             @selection-change="handleSelectionChange"
           >
             <template
@@ -515,7 +515,8 @@
         dimensionType: '',
         isSampleList: true,
         isPackingList: true,
-        isSchemeList: true
+        isSchemeList: true,
+        newSampleList: []
       };
     },
     computed: {
@@ -619,6 +620,7 @@
 
       //分页后的来源列表
       paginatedSourceList() {
+        console.log('分页');
         const { currentPage, pageSize } = this.sourcePagination;
         const start = (currentPage - 1) * pageSize;
         const end = start + pageSize;
@@ -639,7 +641,6 @@
       // 分页后的质检方案列表
       paginatedSchemeList() {
         if (this.rowIds && this.isScheme) {
-          console.log('101010');
           console.log(this.schemeList, 'test');
           return this.schemeList;
         }
@@ -703,7 +704,8 @@
         //   console.log(this.baseForm, 'form --');
         // }
         console.log('数据33333');
-        this.$refs.table12.setData([]);
+        // this.$refs.table12.setData([]);
+        this.sourceList = [];
         this.packingList = [];
         this.isOrder = false;
         let nums = Number(num);
@@ -738,7 +740,8 @@
         }
         console.log('数据22222');
         console.log(this.isOrder);
-        this.$refs.table12.setData(list);
+        // this.$refs.table12.setData(list);
+        this.sourceList = list;
         this.packingList = list;
 
         // *** 如果检验方式是全量的话 还需要同步样品清单数据
@@ -756,12 +759,15 @@
       //成品类型检验类型,计划来源库存台账, 生成来源清单
       changesStokledgerNumberModal(val, dimension, type) {
         console.log(val, dimension, '获取成品检验订单数据', type);
-        this.$refs.table12.setData([]);
+        // this.$refs.table12.setData([]);
+        this.sourceList = [];
         this.packingList = [];
         if (dimension) this.dimensionType = dimension;
         if (dimension == 3) {
-          this.$refs.table12.setData(val);
+          // this.$refs.table12.setData(val);
+          this.sourceList = val;
           this.packingList = val;
+          this.calculateWeightAndQuantity(val);
           if (this.baseForm.qualityMode == '1' || type) {
             this.handleUnpackCase(val);
           } else if (this.baseForm.qualityMode == '2' || type) {
@@ -799,7 +805,8 @@
         //   ...item
         // });
         console.log(list, 'for循环成品检验订单数据');
-        this.$refs.table12.setData(list);
+        // this.$refs.table12.setData(list);
+        this.sourceList = list;
         this.packingList = list;
         if (this.baseForm.qualityMode == '1' || type) {
           this.handleUnpackCase(list);
@@ -954,6 +961,7 @@
           } else {
             this.isCheck = false;
           }
+          await this.getSourceList(row.id);
           //操作行点击时查询清单
           // await this.getInventoryList();
           await this.reload({ planId: row.id });
@@ -969,6 +977,17 @@
             this.$refs.table12.reload({ page: 1, where: where });
         });
       },
+
+      async getSourceList(id) {
+        const listData = await getInventoryListByPlanId({
+          planId: id,
+          pageNum: 1,
+          size: -1
+        });
+        this.sourceList = listData.list;
+        console.log(this.sourceList);
+      },
+
       async getSampleList(id) {
         let res = await getSampleListByPlanId({
           planId: id,
@@ -978,8 +997,15 @@
         console.log(res.list, 'yyyyyyyyyyyyyy样品----------------------------');
 
         this.sampleList = res?.list || [];
-        console.log(this.sampleList);
         this.samplePagination.total = res.count;
+
+        let newRes = await getSampleListByPlanId({
+          planId: id,
+          pageNum: 1,
+          size: -1
+        });
+
+        this.newSampleList = newRes?.list || [];
       },
 
       async getTemplateList(id) {
@@ -1003,7 +1029,6 @@
         supplierMark
       ) {
         //通过来源和产品 获取来料清单
-        console.log(999999);
         await this.getGoodsList(
           receiveNo,
           productCode,
@@ -1030,11 +1055,10 @@
         supplierName,
         supplierMark
       ) {
-        console.log('数据1-1-1-1-1');
-        this.$refs.table12.setData([]);
+        // this.$refs.table12.setData([]);
+        this.sourceList = [];
         this.packingList = [];
 
-        console.log(999999);
         let res;
         const res1 = await outInRecordsPage({
           sourceBizNo: receiveNo,
@@ -1083,35 +1107,44 @@
             delete m.id;
             return { ...m };
           });
-          console.log(_arr1, '1234567890');
 
           this.packingList = _arr1;
-          console.log('数据1010101010');
-          this.$refs.table12.setData(_arr1); //赋值
+          // this.$refs.table12.setData(_arr1); //赋值
+          this.sourceList = _arr1;
           this.packingList = _arr1;
-          const _arr2 = this.$refs.table12.getData();
-          if (_arr2.length > 1) {
-            this.baseForm.productNumber = _arr2.length;
+          // const _arr2 = this.$refs.table12.getData();
+          // if (_arr2.length > 1) {
+          //   this.baseForm.productNumber = _arr2.length;
+          // } else {
+          //   this.baseForm.productNumber = _arr2[0].measureQuantity;
+          // }
+          this.baseForm.totalWeight = this.sourceList.reduce((acc, pre) => {
+            return pre.weight ? acc + Number(pre.weight) : acc;
+          }, 0);
+
+          if (this.sourceList.length > 1) {
+            this.baseForm.productNumber = this.sourceList.reduce((acc, pre) => {
+              return pre.measureQuantity
+                ? acc + Number(pre.measureQuantity)
+                : acc;
+            }, 0);
           } else {
-            this.baseForm.productNumber = _arr2[0].measureQuantity;
+            this.baseForm.productNumber = this.sourceList[0].measureQuantity;
           }
+
           //处理样品清单
-          console.log('+++++++++3');
+          console.log('处理来源清单数据');
           // await this.handleSampleList();
           await this.updatePackingList(_arr1);
         } else {
-          console.log('数据99999');
-          this.$refs.table12.setData([]);
+          console.log('来料清单数据为空');
+          // this.$refs.table12.setData([]);
+          this.sourceList = val;
           this.packingList = [];
         }
       },
       async handleSampleList() {
         // let packingList = this.$refs.table12.getData();
-        console.log(
-          this.baseForm.qualityMode,
-          this.baseForm.inspectionStandards,
-          this.btnType
-        );
 
         if (this.baseForm.type == '1' && this.btnType != 'detail') {
           if (this.baseForm.inspectionStandards == '2') {
@@ -1134,7 +1167,8 @@
               list.push(obj);
             }
             if (list.length > 0 && list[0].categoryCode) {
-              this.$refs.table12.setData(list);
+              // this.$refs.table12.setData(list);
+              this.sourceList = list;
               this.packingList = list;
               let packList = this.$refs.table12.getData();
               this.getFullInspectionWeight(packList);
@@ -1188,7 +1222,8 @@
           if (this.baseForm.productNumber) {
             console.log('数据777777');
             if (this.$refs.table12) {
-              this.$refs.table12.setData([]);
+              // this.$refs.table12.setData([]);
+              this.sourceList = [];
               this.packingList = [];
               let nums = Number(this.baseForm.productNumber);
               let p = this.productItem;
@@ -1208,7 +1243,8 @@
                 list.push(obj);
               }
               console.log('数据666666');
-              this.$refs.table12.setData(list);
+              // this.$refs.table12.setData(list);
+              this.sourceList = list;
               this.packingList = list;
               let packList = this.$refs.table12.getData();
               await this.handleUnpackCase(packList);
@@ -1296,7 +1332,8 @@
           console.log('数据55555');
           console.log(list);
           if (list.length > 0 && list[0].categoryCode) {
-            this.$refs.table12.setData(list);
+            // this.$refs.table12.setData(list);
+            this.sourceList = list;
             this.packingList = list;
             let packList = this.$refs.table12.getData();
             this.getFullInspectionWeight(packList);
@@ -1334,8 +1371,6 @@
 
       //更新样品清单数据
       async updatePackingList(list) {
-        console.log(list);
-        console.log(this.isScheme, this.isOrder);
         for (let i = 0; i < list.length; i++) {
           list[i].sampleCode = await this.getSampleCode();
         }
@@ -1610,7 +1645,6 @@
           }
         }
 
-        console.log('+++++++++9');
         this.isConsumable = val.category.isConsumable;
         this.netWeight = val.category.netWeight;
         this.productItem = val.category; //产品信息
@@ -1620,6 +1654,16 @@
         this.$refs.baseInfoRefs.getsampleMeasureUnit(val);
       },
 
+      calculateWeightAndQuantity(list) {
+        console.log(list);
+        this.baseForm.totalWeight = list.reduce((acc, pre) => {
+          return pre.weight ? acc + Number(pre.weight) : acc;
+        }, 0);
+        this.baseForm.productNumber = list.reduce((acc, pre) => {
+          return pre.measureQuantity ? acc + Number(pre.measureQuantity) : acc;
+        }, 0);
+      },
+
       //整样确认按钮-样品列表右上角确认按钮
       // handleExtractFull() {
       //   this.$refs.ruleForm.validate((valid) => {
@@ -1792,11 +1836,11 @@
         console.log('样品清单', this.sampleList);
         console.log('样品清单List', result);
         this.sampleList = result;
-        console.log(11111);
+
         this.samplePagination.total = result.length;
-        console.log(2222);
+
         this.baseForm.sampleNumber = this.sampleList.length; // 更新样品数量
-        console.log(33333);
+
         this.changeSamUnit(sampleUnit);
       },
 
@@ -1874,6 +1918,7 @@
       },
       table1() {
         this.$refs.table12.setData([]);
+        this.sourceList = [];
         this.packingList = [];
         this.schemeList = [];
       },
@@ -1984,20 +2029,19 @@
 
           console.log(this.isSampleList);
           console.log(this.isPackingList);
+          console.log(this.$refs.table12.getData());
 
           const qualityListData =
             this.btnType == 'add'
-              ? this.$refs.table12.getData()
-              : this.btnType == 'edit' &&
-                this.isPackingList &&
-                this.isSampleList
+              ? this.sourceList
+              : this.btnType == 'edit' && this.isPackingList
               ? []
-              : this.$refs.table12.getData();
+              : this.sourceList;
           const sampleListData =
             this.btnType == 'add'
               ? this.sampleList
               : this.btnType == 'edit' && this.isSampleList
-              ? []
+              ? this.newSampleList
               : this.sampleList;
 
           // let params = {
@@ -2051,10 +2095,37 @@
             this.baseForm.isUnpack = this.isCheck ? 1 : 2;
           }
           this.baseForm.conditionType = this.conditionType;
+          // let params = {
+          //   ...this.baseForm,
+          //   qualityInventoryList: this.$refs.table12.getData(),
+          //   sampleList: this.sampleList,
+          //   planTemplateList: this.schemeList
+          // };
+          // const qualityListData =
+          //   this.btnType == 'add'
+          //     ? this.sourceList
+          //     : this.btnType == 'edit' && this.isPackingList
+          //     ? []
+          //     : this.sourceList;
+          console.log(this.newSampleList, 'newSampleList');
+          const qualityListData = this.sourceList;
+          const sampleListData =
+            this.btnType == 'add'
+              ? this.sampleList
+              : this.btnType == 'edit' && this.isSampleList
+              ? this.newSampleList
+              : this.sampleList;
+
+          // let params = {
+          //   ...this.baseForm,
+          //   qualityInventoryList: this.$refs.table12.getData(),
+          //   sampleList: this.sampleList,
+          //   planTemplateList: this.schemeList
+          // };
           let params = {
             ...this.baseForm,
-            qualityInventoryList: this.$refs.table12.getData(),
-            sampleList: this.sampleList,
+            qualityInventoryList: qualityListData,
+            sampleList: sampleListData,
             planTemplateList: this.schemeList
           };
 
@@ -2117,40 +2188,82 @@
         if (this.btnType != 'issued') {
           this.baseForm.sampleNumber = '';
         }
-        console.log(
-          this.baseForm.productNumber,
-          'productNumberproductNumber数量'
-        );
 
         if (this.baseForm.type == '3') {
-          if (this.$refs.table12 && this.dimensionType) {
-            const listData = this.$refs.table12.getData();
-            console.log(listData, '成品检验订单数据');
+          console.log(this.sourceList, this.dimensionType, '更改检验方式223');
+          if (
+            this.sourceList &&
+            this.dimensionType &&
+            this.baseForm.qualityMode == '1'
+          ) {
+            // const listData = this.$refs.table12.getData();
+            console.log(this.sourceList, '成品检验订单数据');
             this.changesStokledgerNumberModal(
-              listData,
+              this.sourceList,
               this.dimensionType,
               'type'
             );
-            // if (this.dimensionType == 3) {
-            //   if (this.baseForm.qualityMode == '1') {
-            //     this.handleUnpackCase(val);
-            //   } else if (this.baseForm.qualityMode == '2') {
-            //     this.sampleList = [];
-            //   }
-            // } else {
-            //   if (this.baseForm.qualityMode == '1') {
-            //     this.handleUnpackCase(listData);
-            //   } else if (this.baseForm.qualityMode == '2') {
-            //     this.sampleList = [];
-            //   }
-            // }
+            return;
+          } else if (
+            this.sourceList &&
+            this.dimensionType &&
+            this.baseForm.qualityMode == '2'
+          ) {
+            this.sampleList = [];
+          } else {
+            if (
+              this.baseForm.qualityMode == '1' &&
+              this.sourceList.length > 1
+            ) {
+              this.changesStokledgerNumberModal(this.sourceList, '3', 'type');
+            } else if (
+              this.baseForm.qualityMode == '2' &&
+              this.sourceList.length > 1
+            ) {
+              this.sampleList = [];
+            } else if (
+              this.baseForm.qualityMode == '2' &&
+              this.sourceList.length > 0
+            ) {
+              this.changesStokledgerNumberModal(
+                this.sourceList,
+                this.dimensionType,
+                'type'
+              );
+            } else {
+              this.sampleList = [];
+            }
           }
+
+          // if (this.$refs.table12 && this.dimensionType) {
+          //   const listData = this.$refs.table12.getData();
+          //   console.log(listData, '成品检验订单数据');
+          //   this.changesStokledgerNumberModal(
+          //     listData,
+          //     this.dimensionType,
+          //     'type'
+          //   );
+          //   // if (this.dimensionType == 3) {
+          //   //   if (this.baseForm.qualityMode == '1') {
+          //   //     this.handleUnpackCase(val);
+          //   //   } else if (this.baseForm.qualityMode == '2') {
+          //   //     this.sampleList = [];
+          //   //   }
+          //   // } else {
+          //   //   if (this.baseForm.qualityMode == '1') {
+          //   //     this.handleUnpackCase(listData);
+          //   //   } else if (this.baseForm.qualityMode == '2') {
+          //   //     this.sampleList = [];
+          //   //   }
+          //   // }
+          // }
           return;
         }
 
         if (this.baseForm.qualityMode == 1) {
-          console.log('+++++++++1');
-          this.handleSampleList();
+          // console.log('+++++++++1');
+          // this.handleSampleList();
+          this.updatePackingList(this.sourceList);
         } else {
           this.sampleList = [];
         }
@@ -2296,9 +2409,20 @@
       },
 
       validateSampleCount(sampleCount) {
-        const invalidItem = this.selectedList.find(
-          (item) => item.measureQuantity < sampleCount
-        );
+        // const invalidItem = this.selectedList.find(
+        //   (item) => item.measureQuantity < sampleCount
+        // );
+
+        // const totalNumber = this.sourceList.reduce((acc, pro) => {
+        //   return pro.measureQuantity ? acc + Number(pro.measureQuantity) : acc;
+        // }, 0);
+
+        const chooseNumber = this.selectedList.reduce((acc, pro) => {
+          return pro.measureQuantity ? acc + Number(pro.measureQuantity) : acc;
+        }, 0);
+
+        const invalidItem = chooseNumber < sampleCount;
+
         if (invalidItem) {
           this.$message.info('所选的条目计量数量小于取样计量数量');
           return false;

+ 400 - 380
src/views/inspectionWork/index.vue

@@ -19,7 +19,12 @@
         <!--        </template>-->
 
         <template v-slot:code="{ row }">
-          <el-link type="primary" :underline="false" @click="openEdit('detail', row)">{{ row.code }}</el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="openEdit('detail', row)"
+            >{{ row.code }}</el-link
+          >
         </template>
 
         <!--        <template v-slot:qualityPlanName="{ row }">-->
@@ -38,11 +43,16 @@
             type="primary"
             :underline="false"
             @click="downloadFile(link)"
-          >{{ link.name }}</el-link>
+            >{{ link.name }}</el-link
+          >
         </template>
 
-        <template v-slot:qualityType="{ row }">{{ getDictValue('质检计划类型', row.qualityType) }}</template>
-        <template v-slot:qualityMode="{ row }">{{ getDictValue('取样类型', row.qualityMode) }}</template>
+        <template v-slot:qualityType="{ row }">{{
+          getDictValue('质检计划类型', row.qualityType)
+        }}</template>
+        <template v-slot:qualityMode="{ row }">{{
+          getDictValue('取样类型', row.qualityMode)
+        }}</template>
         <template v-slot:accessory="scope">
           <el-link
             v-for="link in scope.row.accessory"
@@ -50,7 +60,8 @@
             type="primary"
             :underline="false"
             @click="downloadFile(link)"
-          >{{ link.name }}</el-link>
+            >{{ link.name }}</el-link
+          >
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
@@ -59,10 +70,13 @@
             :underline="false"
             v-if="row.status == 0"
             @click="openEdit('edit', row)"
-          >报工</el-link>
-          <el-link type="primary" :underline="false" @click="openNumber(row)">合格证</el-link>
+            >报工</el-link
+          >
+          <el-link type="primary" :underline="false" @click="openNumber(row)"
+            >合格证</el-link
+          >
           <jimureportBrowse
-            style="display: inline-block;margin-left: 5px;"
+            style="display: inline-block; margin-left: 5px"
             v-if="row.status == 1"
             text="质检报告"
             :businessId="row.id"
@@ -94,397 +108,403 @@
       </el-dialog>-->
       <!--  -->
     </el-card>
-    <Certificate @search="search" v-if="addOpen" :rowData="rowData" :addOpen="addOpen" @closeModel="closeModel" />
+    <Certificate
+      @search="search"
+      v-if="addOpen"
+      :rowData="rowData"
+      :addOpen="addOpen"
+      @closeModel="closeModel"
+    />
   </div>
 </template>
 <script>
-import Certificate from './components/Certificate.vue'
-import search from './components/search.vue';
-import jimureportBrowse from '@/components/jimureport/browseModal.vue';
-import {
-  getList,
-  removeItem,
-  updateCertificateNumber
-} from '@/api/inspectionWork';
-import dictMixins from '@/mixins/dictMixins';
-import { getFile } from '@/api/system/file';
-import { getByCode } from '@/api/system/dictionary-data';
+  import Certificate from './components/Certificate.vue';
+  import search from './components/search.vue';
+  import jimureportBrowse from '@/components/jimureport/browseModal.vue';
+  import {
+    getList,
+    removeItem,
+    updateCertificateNumber
+  } from '@/api/inspectionWork';
+  import dictMixins from '@/mixins/dictMixins';
+  import { getFile } from '@/api/system/file';
+  import { getByCode } from '@/api/system/dictionary-data';
 
-export default {
-  mixins: [dictMixins],
-  components: {
-    search,
-    jimureportBrowse,
-    Certificate
-  },
-  data() {
-    return {
-      columns: [
-        {
-          type: 'index',
-          columnKey: 'index',
-          align: 'center',
-          label: '序号',
-          width: 55,
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'code',
-          label: '质检工单编码',
-          slot: 'code',
-          align: 'center',
-          width: 180,
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'name',
-          slot: 'name',
-          width: 120,
-          label: '质检工单名称',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          label: '来源单号',
-          prop: 'sourceCode',
-          slot: 'sourceCode',
-          align: 'center',
-          width: 160,
-          showOverflowTooltip: true
-        },
-        {
-          label: '类型',
-          prop: 'qualityType',
-          slot: 'qualityType',
-          align: 'center',
-          width: 120,
-          showOverflowTooltip: true
-        },
-        {
-          label: '质检方式',
-          prop: 'qualityMode',
-          slot: 'qualityMode',
-          align: 'center',
-          width: 120,
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'qualityName',
-          label: '质检人',
-          align: 'center',
-          width: 120,
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'qualityTime',
-          label: '质检时间',
-          align: 'center',
-          width: 120,
-          showOverflowTooltip: true
-        },
+  export default {
+    mixins: [dictMixins],
+    components: {
+      search,
+      jimureportBrowse,
+      Certificate
+    },
+    data() {
+      return {
+        columns: [
+          {
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            label: '序号',
+            width: 55,
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '质检工单编码',
+            slot: 'code',
+            align: 'center',
+            width: 180,
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'name',
+            slot: 'name',
+            width: 120,
+            label: '质检工单名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '来源单号',
+            prop: 'sourceCode',
+            slot: 'sourceCode',
+            align: 'center',
+            width: 160,
+            showOverflowTooltip: true
+          },
+          {
+            label: '类型',
+            prop: 'qualityType',
+            slot: 'qualityType',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            label: '质检方式',
+            prop: 'qualityMode',
+            slot: 'qualityMode',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'qualityName',
+            label: '质检人',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'qualityTime',
+            label: '质检时间',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
 
-        {
-          prop: 'productCode',
-          width: 120,
-          label: '编码',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'productName',
-          width: 120,
-          label: '名称',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'batchNo',
-          label: '批次号',
-          align: 'center',
-          width: 120,
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'specification',
-          label: '规格',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'brandNo',
-          label: '牌号',
-          align: 'center',
-          showOverflowTooltip: true
-        },
+          {
+            prop: 'productCode',
+            width: 120,
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productName',
+            width: 120,
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
 
-        {
-          prop: 'produceTaskName',
-          label: '工序',
-          align: 'center',
-          width: 120,
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'total',
-          label: '总数量',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'qualifiedNumber',
-          label: '合格数',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'qualificationRate',
-          label: '合格率',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'noQualifiedNumber',
-          label: '不合格数',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'noQualificationRate',
-          label: '不合格率',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'hours',
-          label: '工时',
-          align: 'center',
-          showOverflowTooltip: true
-        },
+          {
+            prop: 'produceTaskName',
+            label: '工序',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'total',
+            label: '总数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'qualifiedNumber',
+            label: '合格数',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'qualificationRate',
+            label: '合格率',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'noQualifiedNumber',
+            label: '不合格数',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'noQualificationRate',
+            label: '不合格率',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'hours',
+            label: '工时',
+            align: 'center',
+            showOverflowTooltip: true
+          },
 
-        {
-          label: '附件',
-          prop: 'accessory',
-          align: 'center',
-          slot: 'accessory',
-          showOverflowTooltip: true
-        },
-        {
-          label: '创建时间',
-          prop: 'createTime',
-          align: 'center',
-          width: 160
-        },
-        {
-          prop: 'status',
-          label: '状态',
-          align: 'center',
-          width: 80,
-          formatter: (row, column, cellValue) => {
-            return cellValue == 0 ? '未报工' : cellValue == 1 ? '已报工' : '';
+          {
+            label: '附件',
+            prop: 'accessory',
+            align: 'center',
+            slot: 'accessory',
+            showOverflowTooltip: true
           },
-          fixed: 'right'
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          align: 'center',
-          width: 200,
-          resizable: false,
-          slot: 'action',
-          fixed: 'right'
-        }
-      ],
-      formData: {
-        certificateNumber: ''
-      },
-      // certificateVisible: false,
-      rowData: {},
-      typeList: [], //类型列表
-      qualityMode: [], //取样类型
-      statusList: [
-        {
-          value: 0,
-          label: '未报工'
-        },
-        {
-          value: 1,
-          label: '已报工'
-        }
-      ],
-      addOpen: false
-    };
-  },
-  created() {
-    this.requestDict('质检计划类型');
-    this.requestDict('不良品处理类型');
-    this.requestDict('取样类型');
-    this.getTnspectionPlanType();
-    this.getQualityMethodCode();
-  },
-  computed: {
-    seekList() {
-      return [
-        {
-          label: '工单编码:',
-          value: 'code',
-          type: 'input',
-          placeholder: ''
-        },
-        {
-          label: '工单名称:',
-          value: 'name',
-          type: 'input',
-          placeholder: ''
-        },
-        {
-          label: '来源单号:',
-          value: 'sourceCode',
-          type: 'input',
-          placeholder: ''
-        },
-        {
-          label: '类型:',
-          value: 'qualityType',
-          type: 'select',
-          placeholder: '',
-          planList: this.typeList
-        },
-        {
-          label: '质检方式:',
-          value: 'qualityMode',
-          type: 'select',
-          placeholder: '',
-          planList: this.qualityMode
-        },
-        {
-          label: '编码:',
-          value: 'productCode',
-          type: 'input',
-          placeholder: ''
-        },
-        {
-          label: '名称:',
-          value: 'productName',
-          type: 'input',
-          placeholder: ''
+          {
+            label: '创建时间',
+            prop: 'createTime',
+            align: 'center',
+            width: 160
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            width: 80,
+            formatter: (row, column, cellValue) => {
+              return cellValue == 0 ? '未报工' : cellValue == 1 ? '已报工' : '';
+            },
+            fixed: 'right'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            align: 'center',
+            width: 200,
+            resizable: false,
+            slot: 'action',
+            fixed: 'right'
+          }
+        ],
+        formData: {
+          certificateNumber: ''
         },
-        {
-          label: '状态:',
-          value: 'status',
-          type: 'select',
-          placeholder: '',
-          planList: this.statusList
-        }
-      ];
-    }
-  },
-  methods: {
-    datasource({ page, where, limit }) {
-      return getList({
-        ...where,
-        pageNum: page,
-        size: limit
-      });
+        // certificateVisible: false,
+        rowData: {},
+        typeList: [], //类型列表
+        qualityMode: [], //取样类型
+        statusList: [
+          {
+            value: 0,
+            label: '未报工'
+          },
+          {
+            value: 1,
+            label: '已报工'
+          }
+        ],
+        addOpen: false
+      };
+    },
+    created() {
+      this.requestDict('质检计划类型');
+      this.requestDict('不良品处理类型');
+      this.requestDict('取样类型');
+      this.getTnspectionPlanType();
+      this.getQualityMethodCode();
     },
-    search(where) {
-      this.$refs.table.reload({
-        where: where,
-        page: 1
-      });
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '工单编码:',
+            value: 'code',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '工单名称:',
+            value: 'name',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '来源单号:',
+            value: 'sourceCode',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '类型:',
+            value: 'qualityType',
+            type: 'select',
+            placeholder: '',
+            planList: this.typeList
+          },
+          {
+            label: '质检方式:',
+            value: 'qualityMode',
+            type: 'select',
+            placeholder: '',
+            planList: this.qualityMode
+          },
+          {
+            label: '编码:',
+            value: 'productCode',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '名称:',
+            value: 'productName',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '状态:',
+            value: 'status',
+            type: 'select',
+            placeholder: '',
+            planList: this.statusList
+          }
+        ];
+      }
     },
-    openEdit(type, row) {
-      const menusList = this.$store.state.user.menus;
-      let found = false;
-      for (const item of menusList) {
-        if (item.children) {
-          for (const item2 of item.children) {
-            if (item2.path === '/inspectionWork/edit') {
-              found = true;
-              const id = type !== 'add' ? row.id : '';
-              const qualityType = type !== 'add' ? row.qualityType : null;
-              const qualityTimeStart = row.qualityTimeStart || '';
+    methods: {
+      datasource({ page, where, limit }) {
+        return getList({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+      },
+      search(where) {
+        this.$refs.table.reload({
+          where: where,
+          page: 1
+        });
+      },
+      openEdit(type, row) {
+        const menusList = this.$store.state.user.menus;
+        let found = false;
+        for (const item of menusList) {
+          if (item.children) {
+            for (const item2 of item.children) {
+              if (item2.path === '/inspectionWork/edit') {
+                found = true;
+                const id = type !== 'add' ? row.id : '';
+                const qualityType = type !== 'add' ? row.qualityType : null;
+                const qualityTimeStart = row.qualityTimeStart || '';
 
-              this.$router.push({
-                path: '/inspectionWork/edit',
-                query: {
-                  type,
-                  id,
-                  qualityType,
-                  qualityTimeStart
-                }
-              });
-              return;
+                this.$router.push({
+                  path: '/inspectionWork/edit',
+                  query: {
+                    type,
+                    id,
+                    qualityType,
+                    qualityTimeStart
+                  }
+                });
+                return;
+              }
             }
           }
         }
-      }
 
-      if (!found) {
-        this.$message.error('请到角色管理配置菜单权限!');
-      }
-    },
-    downloadFile(file) {
-      getFile({ objectName: file.storePath }, file.name);
-    },
-    remove(row) {
-      removeItem([row.id])
-        .then((message) => {
-          this.$message.success(message);
-          this.done();
-        })
-        .catch((e) => {});
-    },
-    done() {
-      this.$refs.search.search();
-    },
-    openNumber(row) {
-      this.formData.certificateNumber = row.certificateNumber;
-      this.rowData = row;
-      this.addOpen = true;
-      // this.certificateVisible = true
-    },
-    closeModel(){
-      this.addOpen = false;
-    },
-    // handleClose() {
-    //   this.certificateVisible = false;
-    // },
-    // async handleSubmit() {
-    //   this.rowData.certificateNumber = this.formData.certificateNumber;
-    //   this.rowData.qualityTimeStart = new Date(this.rowData.qualityTimeStart);
-    //   this.rowData.qualityTimeEnd = new Date(this.rowData.qualityTimeEnd);
+        if (!found) {
+          this.$message.error('请到角色管理配置菜单权限!');
+        }
+      },
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      },
+      remove(row) {
+        removeItem([row.id])
+          .then((message) => {
+            this.$message.success(message);
+            this.done();
+          })
+          .catch((e) => {});
+      },
+      done() {
+        this.$refs.search.search();
+      },
+      openNumber(row) {
+        this.formData.certificateNumber = row.certificateNumber;
+        this.rowData = row;
+        this.addOpen = true;
+        // this.certificateVisible = true
+      },
+      closeModel() {
+        this.addOpen = false;
+      },
+      // handleClose() {
+      //   this.certificateVisible = false;
+      // },
+      // async handleSubmit() {
+      //   this.rowData.certificateNumber = this.formData.certificateNumber;
+      //   this.rowData.qualityTimeStart = new Date(this.rowData.qualityTimeStart);
+      //   this.rowData.qualityTimeEnd = new Date(this.rowData.qualityTimeEnd);
 
-    //   const data = await updateCertificateNumber(this.rowData)
-    //   if (data) {
-    //     this.$message.success('修改成功!');
-    //     this.done();
-    //   }
-    //   this.certificateVisible = false;
-    // },
+      //   const data = await updateCertificateNumber(this.rowData)
+      //   if (data) {
+      //     this.$message.success('修改成功!');
+      //     this.done();
+      //   }
+      //   this.certificateVisible = false;
+      // },
 
-    async getTnspectionPlanType() {
-      let res = await getByCode('inspection_plan_type');
-      if (res?.code == 0) {
-        let list = res.data.map((item) => {
-          let key = Object.keys(item)[0];
-          return { value: key, label: item[key] };
-        });
-        this.typeList = list;
-      }
-    },
+      async getTnspectionPlanType() {
+        let res = await getByCode('inspection_plan_type');
+        if (res?.code == 0) {
+          let list = res.data.map((item) => {
+            let key = Object.keys(item)[0];
+            return { value: key, label: item[key] };
+          });
+          this.typeList = list;
+        }
+      },
 
-    async getQualityMethodCode() {
-      let res = await getByCode('quality_method_code');
-      if (res?.code == 0) {
-        let list = res.data.map((item) => {
-          let key = Object.keys(item)[0];
-          return { value: key, label: item[key] };
-        });
-        this.qualityMode = list;
+      async getQualityMethodCode() {
+        let res = await getByCode('quality_method_code');
+        if (res?.code == 0) {
+          let list = res.data.map((item) => {
+            let key = Object.keys(item)[0];
+            return { value: key, label: item[key] };
+          });
+          this.qualityMode = list;
+        }
       }
     }
-  }
-};
+  };
 </script>

+ 2 - 2
vue.config.js

@@ -34,9 +34,9 @@ module.exports = {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.107:18086',
         // target: 'http://192.168.1.125:18086',
-        // target: 'http://192.168.1.144:18086',
+        target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.251:18086',
-        target: 'http://192.168.1.251:18186',
+        // target: 'http://192.168.1.251:18186',
         // target: 'http://124.71.68.31:50001',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {