Просмотр исходного кода

禅道bug 2426 2421 2420 2418 2415 2411修复

jingshuyong 10 месяцев назад
Родитель
Сommit
5ce3999c40

+ 2 - 2
src/views/materialPlan/components/ProductModal2.vue

@@ -51,7 +51,7 @@ export default {
       visible: false,
       title: '选择物料',
 
-      categoryLevelId: null,
+      categoryLevelId: '',
       categoryId: 1,
       treeList: [],
       treeLoading: false,
@@ -60,7 +60,7 @@ export default {
         children: 'children',
         label: 'name'
       },
-      type: null,
+      type: '',
 
       // 表格列配置
       columns: [

+ 3 - 2
src/views/productionPlan/components/factoryAdd/index.vue

@@ -808,6 +808,9 @@
         await this.getFactoryList();
 
         if (val) {
+          if(val.planType == null || val.planType == 'null'){
+            val.planType = '';
+          }
           this.title = !val.id ? '新增临时生产计划' : '编辑临时生产计划';
           val.planType = String(val.planType);
           this.form = val;
@@ -1128,8 +1131,6 @@
           if (!valid) {
             return false;
           }
-          console.log(this.form.productInfoList, '1111111111');
-
           let flag = this.parameterVerification();
           // 必填参数校验
           if (!flag) return;

+ 1 - 1
src/views/productionPlan/components/homogeneityInspectDialog.vue

@@ -302,7 +302,7 @@
             showOverflowTooltip: true
           },
           {
-            prop: 'demandQuantity',
+            prop: 'dosage',
             label: '定额数量',
             showOverflowTooltip: true,
             align: 'center'

+ 63 - 19
src/views/productionPlan/components/unpackDialog.vue

@@ -144,7 +144,6 @@
                 class="w100"
                 v-model="scope.row.reqMoldTime"
                 type="date"
-                :picker-options="pickerOptions"
                 value-format="yyyy-MM-dd"
               ></el-date-picker>
             </el-form-item>
@@ -168,7 +167,9 @@
     </div>
     <div slot="footer">
       <el-button plain @click="cancel">取消</el-button>
-      <el-button type="primary" @click="confirm">确定</el-button>
+      <el-button type="primary" @click="confirm" :loading="loading"
+        >确定</el-button
+      >
     </div>
   </ele-modal>
 </template>
@@ -211,7 +212,6 @@
 
         columns: [
           {
-           
             prop: 'batchNo',
             label: '批次号',
             align: 'center',
@@ -237,7 +237,7 @@
 
         columns2: [
           {
-             slot: 'batchNo',
+            slot: 'batchNo',
             prop: 'batchNo',
             label: '批次号',
             align: 'center',
@@ -275,16 +275,15 @@
             slot: 'action',
             showOverflowTooltip: true
           }
-        ]
+        ],
+        loading: false,
+        custom_code: 1
       };
     },
     methods: {
       open(row) {
         this.visible = true;
         this.formData = deepClone(row);
-
-        console.log(this.formData);
-
         if (this.formData.splitBatch == 1) {
           this.columns[2].label = '剩余数量';
           this.requiredFormingNum = this.formData.splitResidue;
@@ -295,8 +294,48 @@
         this.form.surplusUnpack = [];
         this.form.unpackList = [];
         this.setSurplus();
+        // 自定义编码
+        if (!row.children || row.children.length == 0) {
+          this.custom_code = 1;
+          return;
+        }
+        let maxSum = 0;
+        row.children.map((el) => {
+          if (!el.batchNo) return;
+          // 自定义批次号规则
+          let rules = this.extractIntegerAfterDash(el.batchNo);
+          if (!rules.exists || !rules.isInteger) return;
+          let value = rules.rightValue - 0;
+          maxSum = maxSum < value ? value : maxSum;
+        });
+        this.custom_code = maxSum - 0 + 1;
       },
+      extractIntegerAfterDash(str) {
+        // 1. 检查字符串是否包含分隔符 '-'
+        if (str.includes('-')) {
+          // 2. 找到最后一个 '-' 的位置
+          const lastIndex = str.lastIndexOf('-');
+
+          // 3. 提取 '-' 右侧的内容
+          const rightPart = str.substring(lastIndex + 1).trim();
+
+          // 4. 验证是否为纯整数(正整数或0)
+          const isInteger = /^[1-9]\d*$|^0$/.test(rightPart); // 不允许负号和小数点
+
+          return {
+            exists: true,
+            rightValue: rightPart,
+            isInteger: isInteger
+          };
+        }
 
+        // 不存在分隔符时返回默认结果
+        return {
+          exists: false,
+          rightValue: null,
+          isInteger: false
+        };
+      },
       setSurplus() {
         this.form.surplusUnpack.push({
           joinPlanCode: this.formData.code,
@@ -310,17 +349,17 @@
       },
 
       openUnpack() {
+        let batchNo = `${this.formData.batchNo}-${this.custom_code}`;
         this.form.unpackList.push({
           joinPlanCode: this.formData.code,
-          batchNo: this.formData.batchNo,
+          batchNo: batchNo,
           requiredFormingNum: '',
           reqMoldTime: ''
         });
+        this.custom_code = this.custom_code + 1;
       },
 
       changeNum(index) {
-        console.log(index, '111111111111');
-
         let num =
           this.formData.splitBatch == 1
             ? this.formData.splitResidue
@@ -359,6 +398,7 @@
 
       cancel() {
         this.formData = {};
+        this.custom_code = 1;
         this.visible = false;
         // this.$refs.form.resetFields();
       },
@@ -399,14 +439,18 @@
             // console.log(params, '拆分参数----------------------');
 
             // return;
-
-            const res = await splitWork(params);
-
-            if (res) {
-              this.$message.success('拆分成功!');
-
-              this.$emit('success', []);
-              this.cancel();
+            this.loading = true;
+            try {
+              const res = await splitWork(params);
+              this.loading = false;
+              if (res) {
+                this.$message.success('拆分成功!');
+
+                this.$emit('success', []);
+                this.cancel();
+              }
+            } catch (err) {
+              this.loading = false;
             }
           }
         });

+ 2 - 0
src/views/saleOrder/components/create-order.vue

@@ -1105,6 +1105,8 @@
           this.$message.warning('请输入订单数量且订单数量不能为0');
           return;
         }
+        console.log(row,'row');
+        console.log(this.form,'form +++');
         this.$refs.orderHomogeneityInspectDialog.open([row], this.form, 'new');
         // if (row.productType == 2) {
         //   let data = [];

+ 1 - 1
src/views/saleOrder/components/orderHomogeneityInspectDialog.vue

@@ -38,7 +38,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="合同数量:">
+              <el-form-item label="订单数量:">
                 <el-input readonly v-model="orderInfo.contractNum"></el-input>
               </el-form-item>
             </el-col>

+ 65 - 9
src/views/workOrder/index.vue

@@ -32,6 +32,8 @@
         row-key="id"
         @sort-change="onSortChange"
         @columns-change="handleColumnChange"
+        @select-all="selectAll"
+        default-expand-all
       >
         <!-- :key="activeName" -->
         <!-- :selection.sync="selection" -->
@@ -98,6 +100,9 @@
           </span>
         </template>
         <!-- 操作列 -->
+        <template v-slot:selectionHeader="{ column }">
+          <span>123</span>
+        </template>
         <template v-slot:action="{ row }">
           <el-link
             v-if="unpackShow(row)"
@@ -371,7 +376,8 @@
             columnKey: 'selection',
             align: 'center',
             slot: 'selection',
-            fixed: 'left'
+            fixed: 'left',
+            headerSlot: 'selectionHeader'
             // selectable: (row, index) => {
             //   if (row.children) {
             //   }
@@ -591,6 +597,53 @@
       this.getFieldModel();
     },
     methods: {
+      // 全选/取消全选
+      selectAll(selection) {
+        if (selection.length == 0) { // 取消全选
+          let list = this.$refs.table._data.tableData;
+          list.map((el) => {
+            this.$set(el, 'checkedata', false);
+            if (el.children && el.children.length > 0) {
+              el.children.map((item) => {
+                this.$set(item, 'checkedata', false);
+                delete this.selectionMap[item.id];
+              });
+            }
+            delete this.selectionMap[el.id];
+          });
+          return;
+        }
+        // 全选
+        let list = [];
+        selection.map((item) => {
+          let flag = this.dispatchPermission(item);
+          this.$set(item, 'checkedata', flag);
+          if (flag) {
+            list.push(item);
+          }
+          if (item.children && item.children.length > 0) {
+            item.children.map((el) => {
+              let flags = this.dispatchPermission(el);
+              this.$set(el, 'checkedata', flags);
+              if (flags) {
+                list.push(el);
+              }
+            });
+          }
+          list.map((row) => {
+            this.selectionMap[row.id] = {
+              id: row.id,
+              firstTaskId: row.firstTaskId,
+              productName: row.productName,
+              productCode: row.productCode,
+              code: row.code,
+              productionPlanCode: row.productionPlanCode,
+              batchNo: row.batchNo,
+              formingNum: row.formingNum
+            };
+          });
+        });
+      },
       // 单选数据
       selectRow(e, row) {
         this.$set(row, 'checkedata', e);
@@ -615,7 +668,18 @@
         let list = Object.values(this.selectionMap);
         if (list.length === 0) {
           this.$message.warning('请至少选择一条派单的数据');
+          return;
         }
+        if (list.length > 1) {
+          for (let i = 1; i < list.length; i++) {
+            let el = list[i];
+            if (list[0].firstTaskId !== el.firstTaskId) {
+              this.$message.warning('请选择首工序相同的数据进行批量派单');
+              return;
+            }
+          }
+        }
+
         this.$refs.batchRef.open(list);
       },
 
@@ -853,12 +917,4 @@
   // ::v-deep .el-table__row {
   //   height: 51px !important;
   // }
-
-  ::v-deep thead {
-    .cell {
-      .el-checkbox {
-        display: none;
-      }
-    }
-  }
 </style>