Explorar o código

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-mes into dev

liujt hai 8 meses
pai
achega
d50762a150

+ 1 - 1
src/views/produce/components/new_produceOrder.vue

@@ -404,7 +404,7 @@
         // } else {
         return workorderPage2({
           pageNum: page,
-          size: 1000,
+          size: 5000,
           workOrderId: this.$route.query.workOrderId
             ? this.$route.query.workOrderId
             : null,

+ 61 - 20
src/views/produceOrder/components/releaseDialog/index.vue

@@ -255,7 +255,7 @@
               <template v-slot:quantity="{ row }">
                 <el-input
                   v-model="row.quantity"
-                  :disabled="permissions(row, item)"
+                  :disabled="row.disposalStatus == 1"
                   placeholder="请输入数量"
                   type="number"
                   @input="(e) => handleQuantityInput(e, row, item)"
@@ -264,7 +264,7 @@
               <template v-slot:weight="{ row }">
                 <el-input
                   v-model="row.weight"
-                  :disabled="permissions(row, item)"
+                  :disabled="row.disposalStatus == 1"
                   placeholder="请输入重量"
                   type="number"
                   @input="(e) => handleWeightInput(e, row, item)"
@@ -275,7 +275,7 @@
                   v-model="row.teamTimeIds"
                   multiple
                   placeholder="班次"
-                  :disabled="permissions(row, item)"
+                  :disabled="row.disposalStatus == 1"
                   @change="(e) => shiftSelection(e, row, item)"
                 >
                   <el-option
@@ -290,7 +290,7 @@
               <template v-slot:startTime="{ row }">
                 <el-date-picker
                   v-model="row.startTime"
-                  :disabled="permissions(row, item)"
+                  :disabled="row.disposalStatus == 1"
                   @change="handleStartTimeChange(row, item)"
                   class="w100"
                   placeholder="开始时间"
@@ -301,7 +301,7 @@
               <template v-slot:endTime="{ row }">
                 <el-date-picker
                   v-model="row.endTime"
-                  :disabled="permissions(row, item)"
+                  :disabled="row.disposalStatus == 1"
                   class="w100"
                   placeholder="完成时间"
                   type="datetime"
@@ -476,7 +476,10 @@
             type: 'selection',
             columnKey: 'selection',
             align: 'center',
-            fixed: 'left'
+            fixed: 'left',
+            selectable: (row, index) => {
+              return row.disposalStatus != 1;
+            }
           },
           {
             prop: 'name',
@@ -503,6 +506,22 @@
               return row.status.desc || '';
             }
           },
+          {
+            prop: 'disposalStatus',
+            label: '接收状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150,
+            formatter: (row) => {
+              console.log('row', row);
+              return row.disposalStatus == 1
+                ? '已接收'
+                : row.disposalStatus == 2
+                ? '已拒绝'
+                : '未接收';
+            }
+          },
+
           {
             slot: 'quantity',
             prop: 'quantity',
@@ -654,7 +673,8 @@
               selection: [], // 当前工序下面的指派 选中的数据
               code: item.code, // 工序 编码
               index: index, // 当前工序数据的下标
-              isSpecialField: item.isSpecialField,
+              // isSpecialField: item.isSpecialField,
+              isSpecialField: false, //需求不清晰 为了满足江南需求 先默认false
               radioBun: {
                 // 指派按钮的操作状态 绑定 默认false(可操作)
                 stationDis: false, // 工位按钮
@@ -797,33 +817,51 @@
             this.$message.warning(err.message);
           });
       },
-      // 撤回的逻辑
+      // 派单/撤回 判断
       getWithdrawT(row, type) {
-        if (type != 2) {
-          return true;
-        }
-        let isFlag = true;
+        // if (type != 2) {
+        //   return true;
+        // }
+        let isWithdraw = [];
         row.selection.forEach((item) => {
-          if (!item.status) {
-            isFlag = false;
-            return;
+          //撤回逻辑
+          if (type == 2) {
+            if (!item.status || !item.status.code) {
+              isWithdraw.push(item.name);
+            }
           }
-          if (!item.status.code) {
-            isFlag = false;
+          if (type == 1) {
+            if (item?.status?.code == 1) {
+              isWithdraw.push(item.name);
+            }
           }
+          // if (!item.status.code) {
+          //   isFlag = false;
+          // }
         });
-        return isFlag;
+        return isWithdraw;
       },
       // 派单
       dispatch(row, type) {
         if (row.selection.length == 0) {
           return this.$message.warning('请最少选择一条数据');
         }
+
         let isWithdraw = this.getWithdrawT(row, type);
-        if (!isWithdraw) {
-          this.$message.warning('只有状态为派单的数据才能进行撤回');
+        if (isWithdraw.length) {
+          if (type == 1) {
+            this.$message.warning(
+              isWithdraw.toString() + ',状态为已派单,如需重新派单请先撤回!'
+            );
+          }
+          if (type == 2) {
+            this.$message.warning(
+              isWithdraw.toString() + '还未派单,无需撤回!'
+            );
+          }
           return;
         }
+
         let assignees = [];
         let changeIds = [];
         let flag = true; // 是否填写 校验
@@ -1024,6 +1062,7 @@
         arrList.map((item) => {
           if (item.assigneeType.code == dataRow.assignType) {
             let idx = listMap[item.assigneeId];
+            listArr[idx].disposalStatus = item.disposalStatus;
             listArr[idx].status = item.status;
             listArr[idx].startTime = item.startTime;
             listArr[idx].endTime = item.endTime;
@@ -1035,6 +1074,8 @@
             this.compareEndSetTime(listArr[idx], dataRow);
           }
         });
+        // console.log(listArr,'listArr')
+        // console.log(listArr,'listArr')
         this.$set(dataRow, 'list', listArr);
         this.$set(dataRow, 'radioBun', radioBun);
       },