yusheng hace 4 días
padre
commit
dda6f3bcb1
Se han modificado 1 ficheros con 29 adiciones y 3 borrados
  1. 29 3
      src/views/inspectionPlan/components/new-edit.vue

+ 29 - 3
src/views/inspectionPlan/components/new-edit.vue

@@ -1170,7 +1170,7 @@
         return list;
       },
       async getSampleList(id) {
-        return
+        return;
         let newRes = await getSampleListByPlanId({
           planId: id,
           pageNum: 1,
@@ -2173,7 +2173,32 @@
           }
           this.baseForm.conditionType =
             this.conditionType ?? this.kkconditionType;
-          console.log(this.newSampleList, 'newSampleList');
+          let cycleList =
+            this.$refs.baseInfoRefs.$refs.cycleMultipleRef.recordRulesCycleList
+              .map((i) => {
+                // 根据月日时分排序计算权重排序
+                let sortNum = 0;
+                if (i.month) {
+                  sortNum += i.month * 60 * 24 * 30;
+                }
+                if (i.day) {
+                  sortNum += i.day * 60 * 24;
+                }
+                if (i.hour) {
+                  sortNum += i.hour * 60;
+                }
+
+                if (i.minute) {
+                  sortNum += i.minute * 1;
+                }
+
+                return { ...i, sortNum };
+              })
+              .sort((a, b) => a.sortNum - b.sortNum)
+              .map((i, index) => {
+                return { ...i, sortNum: index + 1 };
+              });
+
           const qualityListData = this.sourceList;
           const sampleListData =
             this.btnType == 'add'
@@ -2185,7 +2210,8 @@
             ...this.baseForm,
             qualityInventoryList: qualityListData,
             sampleList: sampleListData,
-            planTemplateList: this.schemeList
+            planTemplateList: this.schemeList,
+            cycleList
           };
 
           console.log(params, 'params');