Explorar el Código

派单 报工类型

jingshuyong hace 10 meses
padre
commit
16f8f54ce2

+ 1 - 1
src/views/saleOrder/components/create-order.vue

@@ -224,7 +224,7 @@
                 :prop="'productInfoList.' + scope.$index + '.contractNum'"
                 :rules="{
                   required: true,
-                  message: '请输入订单数量且订单数量不能为0',
+                  message: '请输入订单数量',
                   trigger: 'blur'
                 }"
               >

+ 2 - 2
src/views/workOrder/components/releaseDialog.vue

@@ -367,7 +367,7 @@
           crewIds: '',
           workstationIds: '',
           teamId: '',
-          singleReport: 0,
+          singleReport: '',
           workCenterId: '',
           taskAss: 1,
           factoryName: '',
@@ -551,7 +551,7 @@
       this.workCenterData(); // 查询工作中心
       this.getClassesData(); // 查询班次
       this.queryCheckExists(); // 查询是否派单
-      this.form.singleReport = this.clientEnvironmentId == 2 ? 0 : 1;
+      // this.form.singleReport = this.clientEnvironmentId == 2 ? 0 : 1;
       this.dateValue = this.getFormattedDate();
     },
     methods: {

+ 21 - 6
src/views/workOrder/mixins/release.js

@@ -305,6 +305,8 @@ export default {
     },
     // 派单
     dispatch(row, type) {
+      console.log(row,'row 333');
+      console.log(type,'type');
       if (row.selection.length == 0) {
         return this.$message.warning('请最少选择一条数据');
       }
@@ -347,7 +349,7 @@ export default {
         return;
       }
       let data = null;
-      this.toolbarLoading = true;
+
       if (type == 2) {
         data = changeIds;
       } else {
@@ -367,9 +369,12 @@ export default {
         if (this.isDispatchRow.hasExists) {
           data.dispatchType = this.isDispatchRow.dispatchType;
         } else {
+          let singFlag = this.singleReportRadio();
+          if (!singFlag) return;
           data.dispatchType = this.form.singleReport;
         }
       }
+      this.toolbarLoading = true;
       const api =
         type == 1 ? taskAssignment : type == 2 ? taskRevoked : taskSave;
       api(data)
@@ -403,12 +408,18 @@ export default {
       }
       this.getAssignData(row.index, arr);
     },
+
+    singleReportRadio() {
+      if (this.form.singleReport === 0 || this.form.singleReport === 1) {
+        return true;
+      }
+      this.$message.warning('请先选择报工类型');
+      return false;
+    },
     // 最后提交
     async confirm() {
-      if (this.form.singleReport != 1 && this.form.singleReport != 0) {
-        this.$message.warning('请先选择报工类型');
-        return;
-      }
+      let flag = this.singleReportRadio();
+      if (!flag) return;
       // if (!this.form.singleReport) {
 
       // }
@@ -668,6 +679,10 @@ export default {
       // 这里重新调用一个方法 计算出 startDate endDate
       this.$set(dataRow, 'list', listArr);
       this.$set(dataRow, 'radioBun', radioBun);
+      this.$set(dataRow, 'selection', []);
+      let tab = `tableRef${[dataRow.index]}`;
+      this.$refs[tab][0].setSelectedRowKeys([]);
+      console.log(dataRow, 'dataRow +++++');
     },
     // 时间比较与赋值方法 开始时间
     compareAndSetTime(data, dataRow) {
@@ -798,7 +813,7 @@ export default {
     selectedListData(row, item) {
       let data = item.selection.find((el) => el.id == row.id);
       if (!data) {
-        let ids = item.selection.map(el=>el.id);
+        let ids = item.selection.map((el) => el.id);
         ids.push(row.id);
         let tab = `tableRef${[item.index]}`;
         this.$refs[tab][0].setSelectedRowKeys(ids);