Bladeren bron

修改bug

695593266@qq.com 10 maanden geleden
bovenliggende
commit
6493d62867

+ 42 - 15
src/views/InTheSystem/components/tgDetails.vue

@@ -22,6 +22,10 @@
           }}
         </template>
 
+        <template v-slot:taskStayTimeDuration="{ row }">
+          <span>{{ getTimeData(row.taskStayTimeDuration) }}</span>
+        </template>
+
         <template v-slot:weight="{ row }">
           <span v-if="row.extInfo.newWeight">
             {{ row.extInfo.newWeight }} {{ row.extInfo.weightUnit }}</span
@@ -66,7 +70,8 @@
             prop: 'batchNo',
             label: '批次号',
             align: 'center',
-            fixed: 'left'
+            fixed: 'left',
+            showOverflowTooltip: true
           },
 
           {
@@ -80,20 +85,23 @@
           {
             prop: 'qualityTaskName',
             label: '当前工序',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'taskName',
             label: '处置工序',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'categoryCode',
             label: '物品编码',
             align: 'center',
-            minWidth: 160
+            minWidth: 160,
+            showOverflowTooltip: true
           },
 
           {
@@ -105,48 +113,58 @@
           {
             slot: 'feedStatus',
             label: '类型',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'extInfo.engrave',
             label: '刻码',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'extInfo.materielDesignation',
             label: '物料代号	',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'quantity',
             label: '数量',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             prop: 'taskStayTimeDuration',
-            label: '停留时间(分钟)',
-            align: 'center'
+            slot: 'taskStayTimeDuration',
+            label: '停留时间',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
           },
           {
             prop: 'weight',
             slot: 'weight',
             label: '重量',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'deviceName',
             label: '设备名称',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'workstationName',
             label: '工位',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
@@ -166,13 +184,15 @@
           {
             prop: 'factoriesName',
             label: '所属工厂',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'createName',
             label: '创建人',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
@@ -211,6 +231,13 @@
         this.$nextTick(() => {
           this.$refs.table.reload({ page: 1, where });
         });
+      },
+      getTimeData(time) {
+        if (time) {
+          var hours = Math.floor(time / 60);
+          var remainingMinutes = time - hours * 60;
+          return hours + '小时' + remainingMinutes + '分钟';
+        }
       }
     }
   };

+ 55 - 18
src/views/InTheSystem/index.vue

@@ -19,6 +19,10 @@
               : ''
           }}
         </template>
+
+        <template v-slot:taskStayTimeDuration="{ row }">
+          <span>{{ getTimeData(row.taskStayTimeDuration) }}</span>
+        </template>
       </ele-pro-table>
     </el-card>
   </div>
@@ -42,7 +46,7 @@
       // 表格列配置
       columns() {
         return [
-        {
+          {
             columnKey: 'index',
             label: '序号',
             type: 'index',
@@ -54,81 +58,95 @@
             prop: 'batchNo',
             label: '批次号',
             align: 'center',
-            fixed: 'left'
+            fixed: 'left',
+            showOverflowTooltip: true
           },
 
-      
           {
             prop: 'workOrderCode',
             label: '工单编码',
             align: 'center',
             minWidth: 110,
-            fixed: 'left'
+            fixed: 'left',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'qualityTaskName',
             label: '当前工序',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'taskName',
             label: '处置工序',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
-         
+
           {
             prop: 'categoryCode',
             label: '物品编码',
             align: 'center',
-            minWidth: 160
+            minWidth: 160,
+            showOverflowTooltip: true
           },
 
           {
             prop: 'name',
             label: '物品名称',
             align: 'center',
-            minWidth: 160
+            minWidth: 160,
+            showOverflowTooltip: true
           },
 
           {
             slot: 'feedStatus',
             label: '类型',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             prop: 'number',
             label: '数量',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'deviceName',
             label: '设备名称',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             prop: 'taskStayTimeDuration',
-            label: '停留时间(分钟)',
-            align: 'center'
+            slot: 'taskStayTimeDuration',
+            label: '停留时间',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
           },
           {
             prop: 'workstationName',
             label: '工位',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'factoriesName',
             label: '所属工厂',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'createName',
             label: '创建人',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
@@ -136,7 +154,8 @@
             label: '创建时间',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 110,
+            showOverflowTooltip: true
           }
         ];
       }
@@ -159,6 +178,24 @@
         this.$nextTick(() => {
           this.$refs.table.reload({ page: 1, where });
         });
+      },
+
+      getTimeData(time) {
+        if (time) {
+          const days = Math.floor(time / 1440);
+          const remainingMinutes = time % 1440;
+          const hours = Math.floor(remainingMinutes / 60);
+          const minutes = remainingMinutes % 60;
+
+          // 返回格式化的字符串
+          if (days) {
+            return `${days}天${hours}小时${minutes}分钟`;
+          } else if (hours) {
+            return `${hours}小时${minutes}分钟`;
+          } else {
+            return `${minutes}分钟`;
+          }
+        }
       }
     }
   };

+ 4 - 11
src/views/produce/components/feeding/components/batchProductsBom.vue

@@ -85,9 +85,7 @@
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="asyncgetQualityParam"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="getQualityParam">确 定</el-button>
       </span>
     </el-dialog>
   </div>
@@ -129,7 +127,6 @@
     },
 
     mounted() {
-      console.log(this.itemObj, 'this.itemObj');
       if (this.itemObj.product) {
         this.list.push(...this.itemObj.product);
         this.list.forEach((item) => {
@@ -141,10 +138,6 @@
       } else {
         this.list.push(...this.itemObj.inProductList);
       }
-
-      console.log(this.list, 'this.list');
-
-      console.log(this.itemObj, 'this.itemObj');
     },
 
     computed: {
@@ -258,7 +251,7 @@
         this.dialogVisible = true;
       },
 
-      async asyncgetQualityParam() {
+      async getQualityParam() {
         if (this.form.quantity && this.form.batchNo) {
           if (this.itemData.feedQuantity <= this.form.quantity) {
             this.$message.warning('拆批数不能大于数量');
@@ -313,10 +306,10 @@
         if (obj instanceof Date) return new Date(obj);
         if (obj instanceof RegExp) return new RegExp(obj);
         if (typeof obj !== 'object' && typeof obj !== 'function') return obj;
-        if (hash.has(obj)) return hash.get(obj); // 处理循环引用
+        if (hash.has(obj)) return hash.get(obj);
 
         const result = Array.isArray(obj) ? [] : {};
-        hash.set(obj, result); // 存储原始对象和其副本的映射关系
+        hash.set(obj, result);
 
         return Object.keys(obj).reduce((acc, key) => {
           acc[key] = this.deepCopy(obj[key], hash);

+ 1 - 1
src/views/produce/components/feeding/details.vue

@@ -167,7 +167,7 @@
     watch: {
       curTaskObj: {
         handler(obj) {
-          if (obj) {
+          if (obj && obj.taskId != -2) {
             this.getList(obj.taskId);
           }
         },

+ 111 - 31
src/views/produce/components/jobBooking/components/batchSemiProductJobBom.vue

@@ -296,6 +296,14 @@
       </template>
       <!-- 操作列 -->
       <template v-slot:action="{ row, $index }" v-if="!isDetails">
+        <el-link
+          type="text"
+          @click="openBatch(row, $index)"
+          v-if="
+            row.feedQuantity > 1 && item.currentTaskDiagram.isFirstTask != 1
+          "
+          >拆批</el-link
+        >
         <el-link
           type="success"
           @click="getOk($index)"
@@ -478,6 +486,27 @@
         >
       </span>
     </el-dialog>
+
+    <el-dialog
+      title="拆批数"
+      :visible.sync="batchVisible"
+      width="30%"
+      :before-close="handleClose"
+      append-to-body
+    >
+      <el-form ref="form" :model="batchForm" label-width="80px">
+        <el-form-item label="批次号">
+          <el-input v-model="batchForm.batchNo"></el-input>
+        </el-form-item>
+        <el-form-item label="拆批数">
+          <el-input v-model="batchForm.quantity"></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="batchVisible = false">取 消</el-button>
+        <el-button type="primary" @click="getQualityParam">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -489,6 +518,7 @@
   } from '@/api/produce/job';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { parameterGetByCode } from '@/api/system/dictionary-data';
+  import { splitBatch } from '@/api/produce/feeding';
 
   export default {
     name: 'semiProductJobBom',
@@ -833,7 +863,7 @@
           {
             columnKey: 'action',
             label: '操作',
-            width: 120,
+            width: 180,
             align: 'center',
             resizable: false,
             slot: 'action',
@@ -935,7 +965,14 @@
           maxNumber: ''
         },
         dialogVisible: false,
-        dialogEngrave: false
+        dialogEngrave: false,
+        batchVisible: false,
+        batchForm: {
+          quantity: '',
+          batchNo: ''
+        },
+        itemData: {},
+        itemIndex: ''
       };
     },
 
@@ -984,7 +1021,6 @@
         await parameterGetByCode({ code: 'enable_quality_plus' }).then(
           (res) => {
             if (res.value == '1') {
-              console.log('请求code');
               this.isDisable = true;
             } else {
               this.isDisable = false;
@@ -998,31 +1034,6 @@
         this.sumweight(this.list);
       },
 
-      handleSelectionChange(data) {
-        // this.chooseData = data;
-        // console.log(data, '选择的数据');
-        // this.$emit('chooseData', data);
-        // if (data.length > 0) {
-        //   console.log(data, 'data');
-        //   data.forEach((item) => {
-        //     this.list.forEach((o) => {
-        //       if (item.id == o.id) {
-        //         console.log(11111, 'data');
-        //         o.confirm = 1;
-        //       } else {
-        //         console.log('0000000', 'data');
-        //         o.confirm = 0;
-        //       }
-        //     });
-        //   });
-        // } else {
-        //   console.log(data, 'data');
-        //   this.list.forEach((item) => {
-        //     item.confirm = 0;
-        //   });
-        // }
-      },
-
       handleInput() {
         console.log(12354987498498);
         let arr = JSON.parse(JSON.stringify(this.list));
@@ -1055,6 +1066,7 @@
       handleClose() {
         this.dialogVisible = false;
         this.dialogEngrave = false;
+        this.batchVisible = false;
       },
 
       batchEngrave() {
@@ -1104,6 +1116,77 @@
         this.dialogEngrave = false;
       },
 
+      openBatch(item, index) {
+        this.batchForm.quantity = '';
+        this.batchForm.batchNo = '';
+        this.itemData = item;
+        this.itemIndex = index;
+        this.batchForm.batchNo = item.batchNo;
+        this.batchVisible = true;
+      },
+
+      async getQualityParam() {
+        if (this.batchForm.quantity && this.batchForm.batchNo) {
+          if (this.itemData.feedQuantity <= this.batchForm.quantity) {
+            this.$message.warning('拆批数不能大于数量');
+            return;
+          }
+
+          let dataList = [];
+          await splitBatch({
+            product: this.itemData,
+            splitQt: Number(this.batchForm.quantity),
+            batchNo: this.batchForm.batchNo
+          }).then((res) => {
+            res.forEach((item) => {
+              dataList.push(this.deepCopy(item));
+            });
+
+            this.refreshData(dataList);
+          });
+        }
+        this.batchVisible = false;
+      },
+
+      refreshData(list) {
+        const number =
+          Number(this.list[this.itemIndex].feedQuantity) -
+          Number(this.batchForm.quantity);
+        this.list[this.itemIndex].extInfo.sourceQuantity = number;
+        this.list[this.itemIndex].feedQuantity = number;
+        this.list[this.itemIndex].extInfo.newWeight =
+          (Number(this.list[this.itemIndex].extInfo.newWeight) * 100000) /
+            100000 -
+          (Number(list[0].extInfo.newWeight) * 100000) / 100000;
+
+        list.forEach((item) => {
+          item.childBatch = 1;
+        });
+        let _arr = [...this.list, ...list];
+
+        console.log(this.list, '拆批的数据');
+
+        // this.list = _arr;
+
+        this.$set(this.item, 'product', _arr);
+      },
+
+      deepCopy(obj, hash = new WeakMap()) {
+        if (obj === null) return null;
+        if (obj instanceof Date) return new Date(obj);
+        if (obj instanceof RegExp) return new RegExp(obj);
+        if (typeof obj !== 'object' && typeof obj !== 'function') return obj;
+        if (hash.has(obj)) return hash.get(obj);
+
+        const result = Array.isArray(obj) ? [] : {};
+        hash.set(obj, result);
+
+        return Object.keys(obj).reduce((acc, key) => {
+          acc[key] = this.deepCopy(obj[key], hash);
+          return acc;
+        }, result);
+      },
+
       // changeHeatNumber() {
       //   if (this.deviceList.length > 0) {
       //     const device = this.deviceList[0];
@@ -1151,7 +1234,6 @@
               this.$forceUpdate();
             } else if (this.deviceList.length == 1) {
               o['deviceId'] = this.deviceList[0].id || f.instanceId;
-              console.log('111111', this.deviceList[0].id);
               // o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
               // this.$set(this.list[index],'heatNumber',this.deviceList[0].extInfo.heatNumber)
               this.$set(
@@ -1207,12 +1289,10 @@
       },
 
       getOk(index) {
-        console.log(11111);
         this.list[index].confirm = 1;
       },
 
       getCancle(index) {
-        console.log('00000');
         this.list[index].confirm = 0;
       },
 

+ 1 - 1
src/views/produce/components/jobBooking/details.vue

@@ -383,7 +383,7 @@
     watch: {
       curTaskObj: {
         handler(obj) {
-          if (obj) {
+          if (obj && obj.taskId != -2) {
             console.log(obj, '55555555555');
             this.taskType = obj.type;
             this.getList();

+ 214 - 206
src/views/produce/components/jobBooking/index.vue

@@ -493,246 +493,254 @@
 
       getList(ids) {
         this.idsList = ids || [];
-        let param = {
-          ids: ids,
-          taskId: this.taskObj.id,
-          type: 0
-        };
 
-        this.isLoad = false;
-        listByIdsReport(param)
-          .then((res) => {
-            this.List = res.map((obj) => {
-              if (!Object.prototype.hasOwnProperty.call(obj, 'turnover')) {
-                obj['turnover'] = [];
-              }
-              if (
-                !Object.prototype.hasOwnProperty.call(obj, 'aridRegionList')
-              ) {
-                obj['aridRegionList'] = [];
-              }
+        if (this.taskObj.id != -2) {
+          let param = {
+            ids: ids,
+            taskId: this.taskObj.id,
+            type: 0
+          };
+
+          this.isLoad = false;
+          listByIdsReport(param)
+            .then((res) => {
+              this.List = res.map((obj) => {
+                if (!Object.prototype.hasOwnProperty.call(obj, 'turnover')) {
+                  obj['turnover'] = [];
+                }
+                if (
+                  !Object.prototype.hasOwnProperty.call(obj, 'aridRegionList')
+                ) {
+                  obj['aridRegionList'] = [];
+                }
 
-              if (!Object.prototype.hasOwnProperty.call(obj, 'instanceList')) {
-                obj['instanceList'] = [];
-              }
+                if (
+                  !Object.prototype.hasOwnProperty.call(obj, 'instanceList')
+                ) {
+                  obj['instanceList'] = [];
+                }
 
-              if (!Object.prototype.hasOwnProperty.call(obj, 'palletList')) {
-                obj['palletList'] = [];
-              }
+                if (!Object.prototype.hasOwnProperty.call(obj, 'palletList')) {
+                  obj['palletList'] = [];
+                }
 
-              if (
-                !Object.prototype.hasOwnProperty.call(obj, 'revolvingDiskList')
-              ) {
-                obj['revolvingDiskList'] = [];
-              }
+                if (
+                  !Object.prototype.hasOwnProperty.call(
+                    obj,
+                    'revolvingDiskList'
+                  )
+                ) {
+                  obj['revolvingDiskList'] = [];
+                }
 
-              if (obj.palletList.length > 0) {
-                obj.palletList = obj.palletList.map((m) => {
-                  return {
-                    hideKc: true, // 不显示库存
-                    quantity: m.feedQuantity,
-                    ...m
-                  };
-                });
-              }
+                if (obj.palletList.length > 0) {
+                  obj.palletList = obj.palletList.map((m) => {
+                    return {
+                      hideKc: true, // 不显示库存
+                      quantity: m.feedQuantity,
+                      ...m
+                    };
+                  });
+                }
 
-              // console.log(this.taskObj.type, 'this.taskObj.type');
+                // console.log(this.taskObj.type, 'this.taskObj.type');
 
-              if (
-                (this.taskObj.type == 6 && obj.singleReport == 1) ||
-                (this.clientEnvironmentId == 3 &&
-                  obj.singleReport == 0 &&
-                  this.taskObj.type == 6)
-              ) {
-                obj.semiProductList = obj.pickOutInList;
-                obj.pickOutInList = [];
-
-                console.log('赋值了');
-              } else if (this.taskObj.type == 6 && obj.singleReport == 0) {
-                obj.product = obj.pickOutInList;
-                obj.pickOutInList = [];
-              } else if (
-                this.taskObj.type == 4 &&
-                obj.singleReport == 0 &&
-                this.clientEnvironmentId != 3 &&
-                this.clientEnvironmentId != 2
-              ) {
-                if (obj.pickOutInList && obj.pickOutInList.length != 0) {
+                if (
+                  (this.taskObj.type == 6 && obj.singleReport == 1) ||
+                  (this.clientEnvironmentId == 3 &&
+                    obj.singleReport == 0 &&
+                    this.taskObj.type == 6)
+                ) {
+                  obj.semiProductList = obj.pickOutInList;
+                  obj.pickOutInList = [];
+
+                  console.log('赋值了');
+                } else if (this.taskObj.type == 6 && obj.singleReport == 0) {
                   obj.product = obj.pickOutInList;
                   obj.pickOutInList = [];
+                } else if (
+                  this.taskObj.type == 4 &&
+                  obj.singleReport == 0 &&
+                  this.clientEnvironmentId != 3 &&
+                  this.clientEnvironmentId != 2
+                ) {
+                  if (obj.pickOutInList && obj.pickOutInList.length != 0) {
+                    obj.product = obj.pickOutInList;
+                    obj.pickOutInList = [];
+                  }
+                } else if (
+                  this.taskObj.type == 4 &&
+                  obj.singleReport == 1 &&
+                  this.clientEnvironmentId != 3 &&
+                  this.clientEnvironmentId != 2
+                ) {
+                  if (obj.pickOutInList && obj.pickOutInList.length != 0) {
+                    obj.semiProductList = obj.pickOutInList;
+                    obj.pickOutInList = [];
+                  }
                 }
-              } else if (
-                this.taskObj.type == 4 &&
-                obj.singleReport == 1 &&
-                this.clientEnvironmentId != 3 &&
-                this.clientEnvironmentId != 2
-              ) {
-                if (obj.pickOutInList && obj.pickOutInList.length != 0) {
-                  obj.semiProductList = obj.pickOutInList;
-                  obj.pickOutInList = [];
+
+                if (
+                  obj.singleReport == 1 &&
+                  obj.currentTaskDiagram.type != 2 &&
+                  obj.currentTaskDiagram.type != 3 &&
+                  obj.currentTaskDiagram.type != 6
+                ) {
+                  obj.semiProductList.map((item) => {
+                    item.extInfo.taskId = '';
+                    item.extInfo.taskName = '';
+                  });
                 }
-              }
 
-              if (
-                obj.singleReport == 1 &&
-                obj.currentTaskDiagram.type != 2 &&
-                obj.currentTaskDiagram.type != 3 &&
-                obj.currentTaskDiagram.type != 6
-              ) {
-                obj.semiProductList.map((item) => {
-                  item.extInfo.taskId = '';
-                  item.extInfo.taskName = '';
-                });
-              }
+                if (
+                  obj.singleReport == 0 &&
+                  obj.currentTaskDiagram.type != 2 &&
+                  obj.currentTaskDiagram.type != 3 &&
+                  obj.currentTaskDiagram.type != 6
+                ) {
+                  obj.product.map((item) => {
+                    item.extInfo.taskId = '';
+                    item.extInfo.taskName = '';
+                  });
+                }
 
-              if (
-                obj.singleReport == 0 &&
-                obj.currentTaskDiagram.type != 2 &&
-                obj.currentTaskDiagram.type != 3 &&
-                obj.currentTaskDiagram.type != 6
-              ) {
-                obj.product.map((item) => {
-                  item.extInfo.taskId = '';
-                  item.extInfo.taskName = '';
-                });
-              }
+                if (
+                  this.clientEnvironmentId == 3 &&
+                  obj.singleReport == 0 &&
+                  this.taskObj.type != 6
+                ) {
+                  obj.semiProductList.map((a) => {
+                    a.extInfo.batchReportInfo = [
+                      {
+                        allFeedQuantity: '',
+                        allReportWeight: '',
+                        taskId: '',
+                        taskName: ''
+                      }
+                    ];
+
+                    a.extInfo.notBatchReportInfo = [
+                      {
+                        allFeedQuantity: '',
+                        notType: '',
+                        taskId: '',
+                        taskName: '',
+                        notReason: ''
+                      }
+                    ];
+
+                    return {
+                      a
+                    };
+                  });
 
-              if (
-                this.clientEnvironmentId == 3 &&
-                obj.singleReport == 0 &&
-                this.taskObj.type != 6
-              ) {
-                obj.semiProductList.map((a) => {
-                  a.extInfo.batchReportInfo = [
-                    {
-                      allFeedQuantity: '',
-                      allReportWeight: '',
-                      taskId: '',
-                      taskName: ''
-                    }
-                  ];
-
-                  a.extInfo.notBatchReportInfo = [
-                    {
-                      allFeedQuantity: '',
-                      notType: '',
-                      taskId: '',
-                      taskName: '',
-                      notReason: ''
+                  obj.semiProductList = JSON.parse(
+                    JSON.stringify(obj.semiProductList)
+                  );
+                }
+                obj.semiProductList = obj.semiProductList.map((item) => {
+                  if (this.taskObj.type != 6) {
+                    if (item['extInfo']?.reportWeight) {
+                      item['extInfo'].reportWeight = '';
                     }
-                  ];
-
-                  return {
-                    a
-                  };
-                });
-
-                obj.semiProductList = JSON.parse(
-                  JSON.stringify(obj.semiProductList)
-                );
-              }
-              obj.semiProductList = obj.semiProductList.map((item) => {
-                if (this.taskObj.type != 6) {
-                  if (item['extInfo']?.reportWeight) {
-                    item['extInfo'].reportWeight = '';
                   }
-                }
-                item.confirm = 0;
+                  item.confirm = 0;
 
-                console.log(item, 'item');
-                return item;
-              });
+                  console.log(item, 'item');
+                  return item;
+                });
 
-              obj.product = obj.product.map((item) => {
-                if (this.taskObj.type != 6) {
-                  if (item['extInfo']?.reportWeight) {
-                    item['extInfo'].reportWeight = '';
+                obj.product = obj.product.map((item) => {
+                  if (this.taskObj.type != 6) {
+                    if (item['extInfo']?.reportWeight) {
+                      item['extInfo'].reportWeight = '';
+                    }
                   }
-                }
-                item.confirm = 0;
+                  item.confirm = 0;
 
-                console.log(item, 'item');
-                return item;
-              });
+                  console.log(item, 'item');
+                  return item;
+                });
 
-              obj.workReportInfo = {
-                executorTime: null,
-                formingNum: null,
-                formingWeight: null,
-                formedNum: null,
-                formedWeight: null,
-                taskId: this.taskObj.id,
-                notFormedNum: null,
-                notFormedWeigh: null
-              };
-
-              obj.notFormedList = [
-                {
+                obj.workReportInfo = {
+                  executorTime: null,
+                  formingNum: null,
+                  formingWeight: null,
+                  formedNum: null,
+                  formedWeight: null,
+                  taskId: this.taskObj.id,
                   notFormedNum: null,
-                  notFormedWeight: null,
-                  weightUnit: obj.weightUnit,
-                  unit: obj.unit,
-                  warehouseId: null // 处置 仓库id
-                }
-              ];
+                  notFormedWeigh: null
+                };
+
+                obj.notFormedList = [
+                  {
+                    notFormedNum: null,
+                    notFormedWeight: null,
+                    weightUnit: obj.weightUnit,
+                    unit: obj.unit,
+                    warehouseId: null // 处置 仓库id
+                  }
+                ];
 
-              if (obj.semiProductList.length > 0) {
-                // 预制体报工
-                obj.workReportInfo.formedNum = obj.semiProductList.length;
-                let numCot = 0;
                 if (obj.semiProductList.length > 0) {
-                  obj.semiProductList.map((fitem) => {
-                    numCot = numCot + fitem.feedQuantity || 1;
-                  });
-                  obj.workReportInfo.formedNum = numCot;
+                  // 预制体报工
+                  obj.workReportInfo.formedNum = obj.semiProductList.length;
+                  let numCot = 0;
+                  if (obj.semiProductList.length > 0) {
+                    obj.semiProductList.map((fitem) => {
+                      numCot = numCot + fitem.feedQuantity || 1;
+                    });
+                    obj.workReportInfo.formedNum = numCot;
+                  }
+                } else if (obj.product.length > 0) {
+                  const number = obj.product.reduce((acc, pro) => {
+                    return pro.feedQuantity
+                      ? acc + Number(pro.feedQuantity)
+                      : acc;
+                  }, 0);
+
+                  obj.workReportInfo.formedNum = number;
                 }
-              } else if (obj.product.length > 0) {
-                const number = obj.product.reduce((acc, pro) => {
-                  return pro.feedQuantity
-                    ? acc + Number(pro.feedQuantity)
-                    : acc;
-                }, 0);
-
-                obj.workReportInfo.formedNum = number;
-              }
 
-              obj.workReportInfo.formingNum = obj.formingNum;
-              obj.workReportInfo.formingWeight = obj.formingWeight;
-              obj.workReportInfo.unit = obj.unit;
-              obj.workReportInfo.weightUnit = obj.weightUnit;
-              obj.workReportInfo.workOrderId = obj.workOrderId;
-              obj.workReportInfo.executorTime = obj.executorTime;
+                obj.workReportInfo.formingNum = obj.formingNum;
+                obj.workReportInfo.formingWeight = obj.formingWeight;
+                obj.workReportInfo.unit = obj.unit;
+                obj.workReportInfo.weightUnit = obj.weightUnit;
+                obj.workReportInfo.workOrderId = obj.workOrderId;
+                obj.workReportInfo.executorTime = obj.executorTime;
+
+                obj.paramDetailList.map((m) => {
+                  if (m.extInfo.textType == 5) {
+                    m.remainingTime = m.extInfo.remainingTime;
+                  }
+                  return {
+                    ...m.extInfo
+                  };
+                });
+
+                console.log(obj, 4445555);
 
-              obj.paramDetailList.map((m) => {
-                if (m.extInfo.textType == 5) {
-                  m.remainingTime = m.extInfo.remainingTime;
+                if (this.taskObj.type == 4) {
+                  let numVal = 0;
+                  obj.pickOutInList.map((item) => {
+                    numVal = numVal + item.feedQuantity;
+                  });
+                  obj.workReportInfo.formedNum = numVal;
                 }
                 return {
-                  ...m.extInfo
+                  ...obj
                 };
               });
+            })
+            .finally(() => {
+              this.isLoad = true;
 
-              console.log(obj, 4445555);
-
-              if (this.taskObj.type == 4) {
-                let numVal = 0;
-                obj.pickOutInList.map((item) => {
-                  numVal = numVal + item.feedQuantity;
-                });
-                obj.workReportInfo.formedNum = numVal;
+              if (this.taskObj.type == 1) {
+                this.getCacheFn();
               }
-              return {
-                ...obj
-              };
             });
-          })
-          .finally(() => {
-            this.isLoad = true;
-
-            if (this.taskObj.type == 1) {
-              this.getCacheFn();
-            }
-          });
+        }
       },
 
       openPicking(id, item) {

+ 2 - 0
src/views/produce/components/warehousing/index.vue

@@ -490,6 +490,8 @@
         };
         this.isLoad = false;
 
+        console.log(param, 'idsidsidsids');
+
         listByIdsReport(param)
           .then((res) => {
             if (res[0].workOrderType == 1) {

+ 3 - 3
src/views/produceOrder/components/details/index.vue

@@ -62,8 +62,8 @@
             ></jobDetails>
           </el-tab-pane>
 
-          <el-tab-pane label="退料详情">
-          </el-tab-pane>
+          <!-- <el-tab-pane label="退料详情">
+          </el-tab-pane> -->
 
         </el-tabs>
       </div>
@@ -129,7 +129,7 @@
             (item) => Number(item.taskId) == Number(this.workOrderInfo.taskId)
           );
 
-          
+
           this.desIndex = index;
           console.log(this.routeList,'888888');
           this.newId = this.routeList[this.desIndex].taskId||'';

+ 9 - 1
src/views/produceOrder/index.vue

@@ -10,7 +10,7 @@
       <el-tabs v-model="tabValue" type="card" @tab-click="handleTabClick">
         <!-- <el-tab-pane label="未完成工单" name="first"></el-tab-pane>
         <el-tab-pane label="已完成工单" name="second"></el-tab-pane> -->
-        <el-tab-pane label="我的单" name="1"></el-tab-pane>
+        <el-tab-pane label="我的单" name="1"></el-tab-pane>
         <el-tab-pane label="生产中" name="5"></el-tab-pane>
         <el-tab-pane label="待生产" name="4"></el-tab-pane>
         <el-tab-pane label="已完成" name="6"></el-tab-pane>
@@ -596,6 +596,14 @@
             minWidth: 150,
             sortable: 'custom'
           },
+          {
+            prop: 'endTime',
+            label: '实际结束时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150,
+            sortable: 'custom'
+          },
           ...opt[this.activeName],
           {
             prop: 'createTime',

+ 1 - 1
src/views/produceOrder/info.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="material">
+  <div>
     <div class="content_table">
       <div class="item rx-sc">
         <div class="rx ww25">

+ 151 - 118
src/views/produceOrder/workReport.vue

@@ -6,7 +6,7 @@
       :before-close="handleClose"
       :custom-class="isFullscreen ? 'not-fullscreen' : 'is-fullscreen'"
       :with-header="false"
-      :append-to-body="true"
+      append-to-body
     >
       <div>
         <div>
@@ -57,9 +57,14 @@
                 <b style="font-size: 14px">下道工序:{{ title1 }}</b>
               </div>
 
-              <b style="font-weight: blod; font-size: 14px">
-                操作员:{{ info.name }}
-              </b>
+              <div>
+                <b style="font-size: 14px; margin-right: 10px; color: orange"
+                  >工艺路线:{{ workOrderInfo.produceRoutingName }}
+                </b>
+                <b style="font-weight: blod; font-size: 14px">
+                  操作员:{{ info.name }}
+                </b>
+              </div>
 
               <div class="rx-ec">
                 <el-button
@@ -81,9 +86,6 @@
           </div>
 
           <div class="drawer_content">
-            <div class="taskTitle"
-              >工艺路线:{{ workOrderInfo.produceRoutingName }}</div
-            >
             <el-steps :active="activeIndex" space="20px" align-center>
               <el-step
                 v-for="(item, index) in routeList"
@@ -96,77 +98,79 @@
             </el-steps>
           </div>
 
-          <ele-split-layout
-            space="0px"
-            width="26%"
-            :resizable="true"
-            :min-size="200"
-            :max-size="-200"
-            :left-style="{
-              overflow: 'hidden',
-              width: '100%'
-            }"
-            :right-style="{ overflow: 'hidden' }"
-            :responsive="false"
-            style="height: calc(100vh - 230px)"
-          >
-            <!-- 左侧 工单列表 -->
-            <div class="left_main">
-              <div class="top">
-                <Info :workOrderInfo="workOrderInfo"></Info>
-              </div>
-            </div>
-            <!-- //详细信息 -->
-            <template v-slot:content>
-              <div class="right_main">
-                <!-- 领料 -->
-                <!-- <div v-if="operationType == 'pick'"> -->
-                <div v-if="operationType == 'pick'">
-                  <pickDetails
-                    ref="pickListRef"
-                    :workTaskId="workTaskId"
-                    :taskId="taskObj.id"
-                    @pickAdd="pickAdd"
-                  ></pickDetails>
-                </div>
-
-                <div v-if="operationType == 'feed'">
-                  <!-- 投料 -->
-                  <feeding
-                    :workListIds="workListIds"
-                    :feedNeedEquipment="feedNeedEquipment"
-                    @feedSuccess="feedSuccess"
-                  ></feeding>
+          <el-tabs type="border-card">
+            <el-tab-pane label="基本信息">
+              <ele-split-layout
+                space="0px"
+                width="26%"
+                :resizable="true"
+                :min-size="200"
+                :max-size="-200"
+                :left-style="{
+                  overflow: 'hidden',
+                  width: '100%'
+                }"
+                :right-style="{ overflow: 'hidden' }"
+                :responsive="false"
+                style="height: calc(100vh - 230px)"
+              >
+                <!-- 详细信息 -->
+                <div class="left_main">
+                  <div class="top">
+                    <Info :workOrderInfo="workOrderInfo"></Info>
+                  </div>
                 </div>
-
-                <div v-if="operationType == 'job'">
-                  <!-- // 报工列表 入库 -->
-
-                  <warehousing
-                    v-if="taskObj.id == -1"
-                    :workListIds="workListIds"
-                    ref="wareRef"
-                    @warehouseSuccess="warehouseSuccess"
-                  ></warehousing>
-
-                  <!-- // 设备 入库 -->
-                  <!-- 普通报工 -->
-                  <!-- <jobBooking
+                <!-- //报工信息 -->
+                <template v-slot:content>
+                  <div class="right_main">
+                    <!-- 领料 -->
+                    <!-- <div v-if="operationType == 'pick'"> -->
+                    <div v-if="operationType == 'pick'">
+                      <pickDetails
+                        ref="pickListRef"
+                        :workTaskId="workTaskId"
+                        :taskId="taskObj.id"
+                        @pickAdd="pickAdd"
+                      ></pickDetails>
+                    </div>
+
+                    <div v-if="operationType == 'feed'">
+                      <!-- 投料 -->
+                      <feeding
+                        :workListIds="workListIds"
+                        :feedNeedEquipment="feedNeedEquipment"
+                        @feedSuccess="feedSuccess"
+                      ></feeding>
+                    </div>
+
+                    <div v-if="operationType == 'job'">
+                      <!-- // 报工列表 入库 -->
+
+                      <warehousing
+                        v-if="taskObj.id == -1"
+                        :workListIds="workListIds"
+                        ref="wareRef"
+                        @warehouseSuccess="warehouseSuccess"
+                      ></warehousing>
+
+                      <!-- // 设备 入库 -->
+                      <!-- 普通报工 -->
+                      <!-- <jobBooking
                   v-else
                   :workListIds="workListIds"
                   ref="jobRef"
                   :reportNeedFeed="reportNeedFeed"
                 ></jobBooking> -->
 
-                  <jobBooking
-                    v-else
-                    :workListIds="workListIds"
-                    ref="jobRef"
-                    :reportNeedFeed="reportNeedFeed"
-                    @jobSuccess="jobSuccess"
-                  ></jobBooking>
+                      <jobBooking
+                        v-else
+                        :workListIds="workListIds"
+                        ref="jobRef"
+                        :reportNeedFeed="reportNeedFeed"
+                        @jobSuccess="jobSuccess"
+                      ></jobBooking>
 
-                  <!-- <workPlan
+                      <!-- <workPlan
                   style="width: 100%"
                   v-else
                   :workListIds="workListIds"
@@ -174,48 +178,67 @@
                   :reportNeedFeed="reportNeedFeed"
                 >
                 </workPlan> -->
-                </div>
-
-                <!-- 工步 -->
-                <div v-if="operationType == 'workStep'"> </div>
-                <!-- 质检工序 -->
-
-                <div v-if="operationType == 'inspection'">
-                  <inspection
-                    :workListIds="workListIds"
-                    ref="inspectionRef"
-                  ></inspection>
-                </div>
-
-                <!-- 委外 -->
-                <div
-                  v-if="operationType == 'Outsourcing' && isType == '3'"
-                  class="right_main_box"
-                >
-                  <outsourcing
-                    :outsourceFormVal="outsourceForm"
-                    @changePlugIn="changePlugIn"
-                    v-if="isStep"
-                  ></outsourcing>
-
-                  <!--   -->
-                  <outsourceList
-                    :outsourceFormVal="outObj"
-                    @closeForm="closeForm"
-                    @outScucc="outScucc"
-                    v-else
-                  ></outsourceList>
-                </div>
-              </div>
-            </template>
-          </ele-split-layout>
-
-          <footBtn
-            @footBtn="footBtn"
-            :type="type"
-            :singleReportInspection="singleReportInspection"
-            style="background: rgba(223, 250, 222, 0.6); padding: 10px"
-          ></footBtn>
+                    </div>
+
+                    <!-- 工步 -->
+                    <div v-if="operationType == 'workStep'"> </div>
+                    <!-- 质检工序 -->
+
+                    <div v-if="operationType == 'inspection'">
+                      <inspection
+                        :workListIds="workListIds"
+                        ref="inspectionRef"
+                      ></inspection>
+                    </div>
+
+                    <!-- 委外 -->
+                    <div
+                      v-if="operationType == 'Outsourcing' && isType == '3'"
+                      class="right_main_box"
+                    >
+                      <outsourcing
+                        :outsourceFormVal="outsourceForm"
+                        @changePlugIn="changePlugIn"
+                        v-if="isStep"
+                      ></outsourcing>
+
+                      <!--   -->
+                      <outsourceList
+                        :outsourceFormVal="outObj"
+                        @closeForm="closeForm"
+                        @outScucc="outScucc"
+                        v-else
+                      ></outsourceList>
+                    </div>
+                  </div>
+                </template>
+              </ele-split-layout>
+
+              <footBtn
+                @footBtn="footBtn"
+                :type="type"
+                :singleReportInspection="singleReportInspection"
+                style="background: rgba(223, 250, 222, 0.6); padding: 10px"
+              ></footBtn>
+            </el-tab-pane>
+
+            <el-tab-pane label="投料详情">
+              <feedDetails
+                :routeObj="routeObj"
+                :curTaskObj="curTaskObj"
+              ></feedDetails
+            ></el-tab-pane>
+
+            <el-tab-pane label="报工详情">
+              <jobDetails
+                :routeObj="routeObj"
+                :curTaskObj="curTaskObj"
+                :newId="newId"
+              ></jobDetails>
+            </el-tab-pane>
+
+            <!-- <el-tab-pane label="退料详情"> </el-tab-pane> -->
+          </el-tabs>
         </div>
       </div>
 
@@ -281,6 +304,8 @@
   } from '@/api/produce/index';
   import { getTaskInstanceList } from '@/api/produce/job';
   import { workorderInfo } from '@/api/produceOrder/index.js';
+  import feedDetails from '@/views/produce/components/feeding/details.vue';
+  import jobDetails from '@/views/produce/components/jobBooking/details.vue';
 
   export default {
     components: {
@@ -302,7 +327,9 @@
       workPlan,
       TaskDialog,
       createError,
-      Info
+      Info,
+      feedDetails,
+      jobDetails
     },
     data() {
       return {
@@ -355,7 +382,9 @@
           taskId: null,
           workOrderId: null,
           bomCategoryId: null
-        }
+        },
+        newId: '',
+        curTaskObj: null
       };
     },
 
@@ -745,8 +774,10 @@
         taskObj = this.routeList.find((e) => e.taskId === item.taskId);
         taskObj.id = taskObj.sourceTaskId;
         taskObj.isOrderListData = true;
-        this.$store.commit('user/setTaskObj', taskObj);
-        this.workListIds = [this.workOrderInfo.id];
+        if (taskObj.taskId != 2) {
+          this.$store.commit('user/setTaskObj', taskObj);
+          this.workListIds = [this.workOrderInfo.id];
+        }
 
         // if (item.taskId == -2) {
         //   this.$message.info('完结状态不能点击');
@@ -773,8 +804,6 @@
           this.outsourceForm = {
             ...res.data
           };
-
-          console.log(this.taskObj, 'this.outsourceForm');
           this.outsourceForm.name = this.taskObj.taskTypeName + '委外';
 
           if (res.data.outsource) {
@@ -1057,4 +1086,8 @@
   ::v-deep .el-step__title {
     line-height: 30px;
   }
+
+  ::v-deep .el-tabs__content {
+    padding: 1px !important;
+  }
 </style>