lucw před 7 měsíci
rodič
revize
1c45c5dff2
2 změnil soubory, kde provedl 41 přidání a 5 odebrání
  1. 39 3
      src/views/batchRecord/components/statistics.vue
  2. 2 2
      vue.config.js

+ 39 - 3
src/views/batchRecord/components/statistics.vue

@@ -623,7 +623,7 @@
 
         if (this.workOrderId) {
           // 并发获取工序任务列表和物料数据
-          let [routingTaskObj, pickAndFeedList, inStoreageRecordList] =
+          let [routingTaskReslut, pickAndFeedList, inStoreageRecordList] =
             await Promise.all([
               listProduceTaskAndFormNum({ workOrderId: this.workOrderId }),
               getPickAndFeed({
@@ -635,8 +635,44 @@
               })
             ]);
           pickAndFeed = pickAndFeedList || [];
-          routingTaskList = routingTaskObj?.list || [];
+          routingTaskList = routingTaskReslut || [];
           console.log('inStoreageRecordList', inStoreageRecordList);
+          if (inStoreageRecordList && inStoreageRecordList.length > 0) {
+            // 成品入库一行的记录
+            const rows = this.rulesDetailList
+              .filter((i) => i.statisticsType == 1)
+              .map((i) => {
+                return {
+                  title: i.paramValue,
+                  value: i.defaultValue,
+                  formula: i.formula,
+                  unit: i.unitName || this.unit,
+                  paramType: i.paramType
+                };
+              });
+
+            const list = inStoreageRecordList.map((record) => {
+              const rowsCopy = JSON.parse(JSON.stringify(rows));
+              rowsCopy.forEach((item) => {
+                if (item.title.includes('成品入库数')) {
+                  item.value = record.totalCount;
+                } else if (
+                  item.title === '成品入库时间' ||
+                  item.title === '入库时间'
+                ) {
+                  item.value = record.executorTime;
+                }
+                item.unit = record.measuringUnit || this.unit;
+              });
+              return rowsCopy;
+            });
+            // 赋值
+            this.localDetails[0].statisticsValue = list;
+            console.log(
+              'this.localDetails[0].statisticsValue 重新',
+              this.localDetails[0].statisticsValue
+            );
+          }
         }
 
         console.log('routingTaskList 工序数据', routingTaskList);
@@ -724,7 +760,7 @@
 
             data.unshift({
               title: '工序名称',
-              value: task.name || task.taskInstanceName,
+              value: task.name || task.produceTaskName,
               formula: '',
               unit: '',
               // 仅展示不计算和输入

+ 2 - 2
vue.config.js

@@ -36,7 +36,7 @@ module.exports = {
         // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.251:18086',
-        target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.116:18086', // 赵沙金
         // target: 'http://192.168.1.251:18086', // 开发环境
         // target: 'http://192.168.1.103:18086',192.168.1.116
@@ -44,7 +44,7 @@ module.exports = {
         // target: 'http://192.168.1.30:18086',
         // target: 'http://192.168.1.211:18086',
         // target: 'http://192.168.1.33:18086',
-        // target: 'http://192.168.1.251:18186',
+        target: 'http://192.168.1.251:18186', // 测试环境
         // target: 'http://192.168.1.251:18087',
         // target: 'http://116.163.22.90:86/api', // 嘉实生产
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域