Browse Source

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

695593266@qq.com 7 months ago
parent
commit
ae1a3669d6

+ 11 - 3
src/views/materialPlan/components/plan-edit-dialog.vue

@@ -1238,7 +1238,8 @@
               this.$message.info('请添加销售订单');
               return false;
             }
-            let _arr2 = [];
+            let _arr2 = [],
+              isNoMaterial = [];
 
             _arr2 = _arr.map((m) => {
               if (
@@ -1251,12 +1252,19 @@
                 delete m.id;
                 delete m.code;
               }
-
+              if (!m.materialList.length) {
+                isNoMaterial.push(m.productName);
+              }
               return {
                 ...m
               };
             });
-
+            if (isNoMaterial.length) {
+              this.$message.info(
+                isNoMaterial.join(',') + ' 物料清单为空,请检查!'
+              );
+              return;
+            }
             this.formData['type'] = 1;
             this.formData['salesOrderList'] = _arr2;
             this.formData.baitingType = 2;

+ 7 - 2
src/views/materialPlan/components/produce-edit-dialog.vue

@@ -485,7 +485,7 @@
               return false;
             }
 
-            let _arr2 = [];
+            let _arr2 = [],isNoMaterial = [];
 
             _arr2 = _arr.map((m) => {
               if (
@@ -510,7 +510,12 @@
               };
             });
 
-            console.log(_arr2);
+            if (isNoMaterial.length) {
+              this.$message.info(
+                isNoMaterial.join(',') + ' 物料清单为空,请检查!'
+              );
+              return;
+            }
 
             this.formData['type'] = 2;
             this.formData['workOrderList'] = _arr2;

+ 15 - 7
src/views/materialPlan/components/producePlan.vue

@@ -448,7 +448,7 @@
             <el-option
               label="分批到货"
               :value="2"
-              @click.native="handleMethod()"
+              @click.native="handleMethod(null, null, true)"
             />
           </el-select>
         </el-form-item>
@@ -471,7 +471,7 @@
             type="primary"
             :underline="false"
             v-show="formData2.deliveryMethod == 2"
-            @click.native="handleMethod()"
+            @click.native="handleMethod(null, null, true)"
           >
             设置分批时间
           </el-link>
@@ -986,7 +986,7 @@
           planIds: planIds,
           demandType: this.formData.demandType
         });
-        
+
         if (this.$store.state.user.info.clientEnvironmentId == '5') {
           if (res && res.length > 0) {
             const firstOrderName = res[0].productName || '';
@@ -1180,12 +1180,12 @@
         };
         this.batchVisible = true;
       },
-      handleMethod(row, index) {
+      handleMethod(row, index, isAll) {
         console.log(index, 'index');
         if (row) {
           this.multipleSelection = [];
         }
-        this.$refs.timeDialogRef.open(row || {}, index);
+        this.$refs.timeDialogRef.open(row || {}, index, isAll);
       },
       chooseTime(current, timeList, currentIndex) {
         const tableList = this.$refs.table.getData();
@@ -1277,6 +1277,7 @@
             }
 
             let _arr2 = [];
+            let isNoMaterial = [];
 
             _arr2 = _arr.map((m) => {
               if (
@@ -1289,12 +1290,19 @@
                 delete m.id;
                 delete m.code;
               }
-
+              if (!m.materialList.length) {
+                isNoMaterial.push(m.productName);
+              }
               return {
                 ...m
               };
             });
-
+            if (isNoMaterial.length) {
+              this.$message.info(
+                isNoMaterial.join(',') + ' 物料清单为空,请检查!'
+              );
+              return;
+            }
             this.formData['type'] = 1;
             this.formData['salesOrderList'] = _arr2;
             this.formData.baitingType = 2;

+ 7 - 1
src/views/productionPlan/components/detail/plan.vue

@@ -67,7 +67,10 @@
       <el-descriptions-item label="使用改型">{{
         productionPlan.modification ? '是' : '否'
       }}</el-descriptions-item>
-      <el-descriptions-item label="备注" :span="5">{{
+      <el-descriptions-item label="生产要求">{{
+        salesOrderList.productionRequirements
+      }}</el-descriptions-item>
+      <el-descriptions-item label="备注" :span="4">{{
         productionPlan.notes
       }}</el-descriptions-item>
     </el-descriptions>
@@ -171,6 +174,9 @@
       },
       productRequirementInfo() {
         return this.infoData.productRequirementInfo || {};
+      },
+      salesOrderList() {
+        return this.infoData.salesOrderList[0] || {};
       }
     },
     data() {

+ 29 - 19
src/views/productionPlan/components/factoryAdd/index.vue

@@ -377,9 +377,9 @@
               </div>
             </template>
 
-            <template v-slot:productWeight="{ row, $index }">
+            <!-- <template v-slot:productWeight="{ row, $index }">
               <span>{{ row.productWeight ? row.productWeight : '-' }}</span>
-            </template>
+            </template> -->
 
             <template v-slot:set="{ row, $index }">
               <el-button type="text" @click="handleDeleteItem($index)"
@@ -701,9 +701,9 @@
           },
 
           {
-            slot: 'productWeight',
-            prop: 'productWeight',
-            label: '订单重量',
+            slot: 'newSumOrderWeight',
+            prop: 'newSumOrderWeight',
+            label: '计划重量',
             align: 'center',
             minWidth: 140
           },
@@ -1378,20 +1378,6 @@
           if (!this.form.id) {
             if (this.form.productInfoList.length) {
               this.form.productInfoList.map((item, index) => {
-                if (
-                  item.weightUnit == 'G' ||
-                  item.weightUnit == 'g' ||
-                  item.weightUnit == '克'
-                ) {
-                  let total =
-                    ((item.requiredFormingNum - 0) * item.productUnitWeight) /
-                    1000;
-                  item.newSumOrderWeight = total.toFixed(2);
-                  item.newWeightUnit = 'KG';
-                } else {
-                  item.newWeightUnit = item.weightUnit;
-                  item.newSumOrderWeight = item.requiredFormingNum;
-                }
                 delete item.selectionRowShow;
                 // if (item.bomVersionList && item.bomVersionList.length) {
                 //   item.bomCategoryName = item.bomVersionList[0].name;
@@ -1600,6 +1586,30 @@
         // }
         // 更新绑定值
         row.requiredFormingNum = value;
+        //       if (
+        //   item.weightUnit == 'G' ||
+        //   item.weightUnit == 'g' ||
+        //   item.weightUnit == '克'
+        // ) {
+        //   let total =
+        //     ((item.requiredFormingNum - 0) * item.productUnitWeight) /
+        //     1000;
+        //   item.newSumOrderWeight = total.toFixed(2);
+        //   item.newWeightUnit = 'KG';
+        // } else {
+        //   item.newWeightUnit = item.weightUnit;
+        //   item.newSumOrderWeight = item.requiredFormingNum;
+        // }
+        row.newWeightUnit = row.weightUnit;
+        if (row.weightUnit == row.measuringUnit) {
+          row.newSumOrderWeight = row.requiredFormingNum;
+        } else if (row.requiredFormingNum && row.productUnitWeight) {
+          row.newSumOrderWeight =
+            row.requiredFormingNum * row.productUnitWeight;
+        } else {
+          row.newSumOrderWeight = 0;
+        }
+        row.productWeight = row.newSumOrderWeight;
         this.tableHandleKeyUp(row, 'sum');
       },
       changeProduceType(e) {

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

@@ -148,6 +148,17 @@
               </DictSelection>
             </el-form-item>
           </el-col>
+          <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
+            <el-form-item label="生产要求:" required>
+              <el-input
+                v-model="form.productionRequirements"
+                style="width: 100%"
+                placeholder=""
+                type="textarea"
+                disabled
+              ></el-input>
+            </el-form-item>
+          </el-col>
         </el-row>
 
         <el-table :data="form.productInfoList" border height="40vh" key="id">
@@ -884,10 +895,12 @@
                 );
               }
               item.lackNum = null;
+              if(item.bomVersionList?.length&&item.productType){
+                  item.bomVersionList=item.bomVersionList.filter(el=>el.bomType==item.productType)
+              }
             });
           }
           // this.disabledList = res.productInfoList;
-
           if (res.productInfoList.length > 0) {
             const promiselist = [];
             res.productInfoList.forEach(async (el, index) => {

+ 4 - 0
src/views/saleOrder/components/order-detail.vue

@@ -98,6 +98,10 @@
           <template slot="label"> 生产状态 </template>
           {{ getDictValue('生产状态', form.salesOrderBasicInfo.status) }}
         </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label"> 生产要求 </template>
+          {{ form.salesOrderBasicInfo.productionRequirements }}
+        </el-descriptions-item>
       </el-descriptions>
       <div class="basic-details-title border-none">
         <span class="border-span">产品规格需求</span>

+ 4 - 0
src/views/saleOrder/components/plan-submit.vue

@@ -81,6 +81,10 @@
           <template slot="label"> 所属工厂 </template>
           {{ info.factoriesIdName }}
         </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label"> 生产要求 </template>
+          {{ info.productionRequirements }}
+        </el-descriptions-item>
         <el-descriptions-item :span="3">
           <template slot="label"> </template>
         </el-descriptions-item>

+ 5 - 0
src/views/saleOrder/index.vue

@@ -521,6 +521,11 @@
             prop: 'hostDescription',
             label: '主机描述',
             showOverflowTooltip: true
+          },
+          {
+            prop: 'productionRequirements',
+            label: '生产要求',
+            showOverflowTooltip: true
           }
         ];
       },

+ 57 - 28
src/views/saleOrder/salesToProductionNewTwo.vue

@@ -142,16 +142,6 @@
               ></el-input>
             </el-form-item>
           </el-col>
-
-          <!-- <el-col v-bind="styleResponsive ? { lg: 3, md: 6 } : { span: 3 }">
-              <el-form-item label="使用改型:" prop="modification">
-                <el-checkbox
-                  v-model="form.modification"
-                  :true-label="1"
-                  :false-label="0"
-                ></el-checkbox>
-              </el-form-item>
-            </el-col> -->
         </el-row>
         <el-row :gutter="24">
           <el-col v-bind="styleResponsive ? { lg: 4, md: 8 } : { span: 4 }">
@@ -240,6 +230,18 @@
             </el-form-item>
           </el-col>
 
+          <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
+            <el-form-item label="生产要求:" required>
+              <el-input
+                v-model="form.productionRequirements"
+                style="width: 100%"
+                placeholder=""
+                type="textarea"
+                disabled
+              ></el-input>
+            </el-form-item>
+          </el-col>
+
           <!-- <el-form-item label="生产类型:" prop="produceType">
                 <el-select v-model="form.produceType" style="width: 100%"   @change="changeProduceType" >
                     <el-option
@@ -430,16 +432,27 @@
             prop="batchNo"
           >
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.batchNo"
-                size="small"
-                style="width: 100%"
-                placeholder="批次号"
-                @input="
-                  (value) =>
-                    (scope.row.batchNo = value.replace(/[^a-zA-Z0-9_-]/g, ''))
-                "
-              ></el-input>
+              <el-form-item
+                label-width="0px"
+                :prop="'salesOrders.' + scope.$index + '.batchNo'"
+                :rules="{
+                  required: isSalesToProduction_batchNo,
+                  message: '请输入批次号',
+                  trigger: 'blur'
+                }"
+                class="table-item"
+              >
+                <el-input
+                  v-model="scope.row.batchNo"
+                  size="small"
+                  style="width: 100%"
+                  placeholder="批次号"
+                  @input="
+                    (value) =>
+                      (scope.row.batchNo = value.replace(/[^a-zA-Z0-9_-]/g, ''))
+                  "
+                ></el-input>
+              </el-form-item>
             </template>
           </el-table-column>
           <el-table-column
@@ -931,7 +944,8 @@
         validDate,
         modelList: [], // 机型数据
         colorList: [], // 颜色数据
-        isReview: false
+        isReview: false,
+        isSalesToProduction_batchNo: false
       };
     },
     props: {
@@ -977,6 +991,11 @@
       this.mandatoryField();
       this.getCodeData();
       this.getplannedReleaseRequire('planned_release_require');
+      parameterGetByCode({ code: 'salesToProduction_batchNo' }).then((res) => {
+        if (res) {
+          this.isSalesToProduction_batchNo = res.value == '1' ? true : false;
+        }
+      });
     },
     computed: {
       clientEnvironmentId() {
@@ -1113,6 +1132,8 @@
         // if (data.endTime) {
         //   this.form.endTime = new Date(data.endTime);
         // }
+        this.form.productionRequirements =
+            data?.salesOrders[0]?.productionRequirements || '';
         if (!data.bomCategoryId || data.bomCategoryId == null) {
           this.form.produceType = '';
           this.selectionRowShow = true;
@@ -1266,8 +1287,10 @@
         let params = JSON.parse(this.$route.query.selection);
         productionToPlan(params).then((res) => {
           this.form = deepClone(res);
-          console.log(222222222222222222222222, '===');
+          console.log(222222222222222222222222, '===', res);
           this.initTime();
+          this.form.productionRequirements =
+            res?.salesOrders[0]?.productionRequirements || '';
           // this.bomListVersion('init');
           this.form.produceRoutingName =
             res.produceRoutingName || this.$route.query.produceRoutingName;
@@ -1436,11 +1459,22 @@
         let flag = this.parameterVerification();
         // 必填参数校验
         if (!flag) return;
-        this.$refs.form.validate((valid) => {
+        this.$refs.form.validate((valid,obj) => {
           if (valid) {
+            if (this.form.produceType == 1) {
+              this.$message.warning('请选择MBOM或者ABOM');
+              return;
+            }
             this.mapList();
 
             this.$refs.submitRefs.open();
+          } else {
+            if (obj) {
+              let messages = Object.keys(obj).map((key) => obj[key][0]);
+              if (messages.length > 0) {
+                this.$message.warning(messages[0].message);
+              }
+            }
           }
         });
       },
@@ -1726,11 +1760,6 @@
       },
 
       async publishData(type) {
-        if (!this.form.batchNo && this.clientEnvironmentId == 5) {
-          this.$message.warning('批次号不能为空');
-          return;
-        }
-
         const key = getRouteTabKey();
         let params = deepClone(this.form);
         params.categoryId = params.salesOrders[0]?.categoryId;

+ 3 - 0
src/views/workOrder/components/details.vue

@@ -417,6 +417,9 @@
             { label: '颜色:', prop: 'colorKey' },
             { label: '派单人:', prop: 'dispatcher' },
             { label: '派单时间:', prop: 'dispatchTime' }
+          ],
+          [
+            { label: '生产要求:', prop: 'productionRequirements' },
           ]
         ],
         shiftList: [],

+ 3 - 3
src/views/workOrder/components/order-search.vue

@@ -136,8 +136,8 @@
           <el-input
             size="mini"
             clearable
-            v-model="where.searchInfo"
-            placeholder="批次号/生产工单号/计划编号/产品编码/产品名称/牌号/型号"
+            v-model="where.keyWord"
+            placeholder="批次号/生产工单号/产品名称"
           />
         </el-form-item>
       </el-col>
@@ -166,7 +166,7 @@
                     <el-input
                       size="mini"
                       clearable
-                      v-model="where.keyWord"
+                      v-model="where.searchInfo"
                       placeholder="请输入"
                     />
                   </el-form-item>