2213980799@qq.com 1 rok temu
rodzic
commit
b3d8549a7c

+ 8 - 0
src/views/productionPlan/index.vue

@@ -260,6 +260,14 @@ export default {
             minWidth: 100,
             showOverflowTooltip: true
           },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            minWidth: 150,
+
+            showOverflowTooltip: true
+          },
           {
             prop: 'model',
             label: '型号',

+ 105 - 44
src/views/saleOrder/components/create-order.vue

@@ -1,6 +1,12 @@
 <template>
   <ele-modal :visible.sync="visible" :title="title" width="80vw" append-to-body>
-    <el-form ref="form" :model="form" :rules="rules" label-width="90px" class="create-form">
+    <el-form
+      ref="form"
+      :model="form"
+      :rules="rules"
+      label-width="90px"
+      class="create-form"
+    >
       <el-row :gutter="15">
         <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
           <el-form-item label="销售订单号:">
@@ -9,43 +15,72 @@
         </el-col>
         <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
           <el-form-item label="交付要求:">
-            <DictSelection dictName="紧急程度" clearable v-model="form.deliveryRequirements">
+            <DictSelection
+              dictName="紧急程度"
+              clearable
+              v-model="form.deliveryRequirements"
+            >
             </DictSelection>
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
           <el-form-item label="订单类型:">
-            <el-select v-model="form.orderType" placeholder="请选择" @change="chooseType" style="width: 100%">
-              <el-option v-for="item in typeList" :key="item.id" :label="item.label" :value="item.id">
+            <el-select
+              v-model="form.orderType"
+              placeholder="请选择"
+              @change="chooseType"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in typeList"
+                :key="item.id"
+                :label="item.label"
+                :value="item.id"
+              >
               </el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
           <el-form-item label="按单按库:">
-            <DictSelection dictName="按单按库" clearable v-model="form.orderLibraryType">
+            <DictSelection
+              dictName="按单按库"
+              clearable
+              v-model="form.orderLibraryType"
+            >
             </DictSelection>
           </el-form-item>
         </el-col>
-        <el-col v-bind="styleResponsive ?  { lg: 6, md: 12 } : { span: 6 }">
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
           <el-form-item label="客户名称:">
-            <el-input clearable v-model="form.customerName" :disabled="form.orderType == 3" />
+            <el-input
+              clearable
+              v-model="form.customerName"
+              :disabled="form.orderType == 3"
+            />
           </el-form-item>
         </el-col>
 
-        <el-col v-bind="styleResponsive ?  { lg: 6, md: 12 } : { span: 6 }">
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
           <el-form-item label="客户简称:">
-            <el-input clearable v-model="form.simpleName" :disabled="form.orderType == 3" />
+            <el-input
+              clearable
+              v-model="form.simpleName"
+              :disabled="form.orderType == 3"
+            />
           </el-form-item>
         </el-col>
 
-        <el-col v-bind="styleResponsive ?  { lg: 6, md: 12 } : { span: 6 }">
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
           <el-form-item label="客户代号:">
-            <el-input clearable v-model="form.serialNo" :disabled="form.orderType == 3" />
+            <el-input
+              clearable
+              v-model="form.serialNo"
+              :disabled="form.orderType == 3"
+            />
           </el-form-item>
         </el-col>
 
-
         <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
           <el-form-item label="业务员:">
             <el-input clearable v-model="form.salesman" />
@@ -53,8 +88,14 @@
         </el-col>
         <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
           <el-form-item label="交付日期:" prop="deliveryTime">
-            <el-date-picker :picker-options="pickerOptions" style="width: 100%" v-model="form.deliveryTime" type="date"
-              placeholder="选择日期" value-format="yyyy-MM-dd">
+            <el-date-picker
+              :picker-options="pickerOptions"
+              style="width: 100%"
+              v-model="form.deliveryTime"
+              type="date"
+              placeholder="选择日期"
+              value-format="yyyy-MM-dd"
+            >
             </el-date-picker>
           </el-form-item>
         </el-col>
@@ -85,20 +126,37 @@
         <el-table-column label="单重" align="center" prop="productUnitWeight">
         </el-table-column>
         <el-table-column label="重量单位" align="center" prop="weightUnit">
-          
         </el-table-column>
         <el-table-column label="交付数量" align="center" prop="contractNum">
           <template slot-scope="scope">
-            <el-form-item label-width="0px" :prop="'productInfoList.' + scope.$index + '.contractNum'" :rules="{
-              required: true,
-              message: '请输入交付数量',
-              trigger: 'blur'
-            }">
-              <el-input v-model.number="scope.row.contractNum" size="small" oninput="value=value.replace(/[^\d]/g,'')"
-                style="width: 100%" placeholder="输入数量" @input="inputNumber(scope.row, scope.$index)"></el-input>
+            <el-form-item
+              label-width="0px"
+              :prop="'productInfoList.' + scope.$index + '.contractNum'"
+              :rules="{
+                required: true,
+                message: '请输入交付数量',
+                trigger: 'blur'
+              }"
+            >
+              <el-input
+                v-model.number="scope.row.contractNum"
+                size="small"
+                oninput="value=value.replace(/[^\d]/g,'')"
+                style="width: 100%"
+                placeholder="输入数量"
+                @input="inputNumber(scope.row, scope.$index)"
+              ></el-input>
             </el-form-item>
           </template>
         </el-table-column>
+        <el-table-column label="单位" align="center" prop="productName">
+          <template slot-scope="{ row }">
+            <span v-if="clientEnvironmentId == 4">
+              {{ row.productName.includes('板材') ? '块' : '模' }}
+            </span>
+
+          </template>
+        </el-table-column>
         <el-table-column label="交付重量" align="center" prop="productWeight">
           <template slot-scope="{ row }">
             <span>{{ row.productWeight ? row.productWeight : '-' }}</span>
@@ -106,7 +164,12 @@
         </el-table-column>
         <el-table-column label="操作" align="center" width="70">
           <template slot-scope="scope">
-            <el-button type="text" @click="handleDeleteItem(scope.$index)" v-if="!scope.row.id">删除</el-button>
+            <el-button
+              type="text"
+              @click="handleDeleteItem(scope.$index)"
+              v-if="!scope.row.id"
+              >删除</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -122,10 +185,15 @@
     </template>
 
     <!-- 选择产品 -->
-    <EquipmentDialog ref="equipmentRefs" @choose="confirmChoose" :selectList="form.productInfoList.filter(
-      (i) => !disabledList.find((p) => p.productCode === i.productCode)
-    )
-      ">
+    <EquipmentDialog
+      ref="equipmentRefs"
+      @choose="confirmChoose"
+      :selectList="
+        form.productInfoList.filter(
+          (i) => !disabledList.find((p) => p.productCode === i.productCode)
+        )
+      "
+    >
     </EquipmentDialog>
   </ele-modal>
 </template>
@@ -186,9 +254,12 @@ export default {
     // 是否开启响应式布局
     styleResponsive() {
       return this.$store.state.theme.styleResponsive;
+    },
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
     }
   },
-  created() { },
+  created() {},
   methods: {
     open(row) {
       this.visible = true;
@@ -268,7 +339,7 @@ export default {
     },
     // 确定选择
     confirmChoose(list) {
-      console.log('444',list)
+      console.log('444', list);
       console.log(
         'this.form.productInfoList',
         deepClone(this.form.productInfoList)
@@ -288,8 +359,8 @@ export default {
               categoryId: item.id,
               productCode: item.code,
               productName: item.name,
-              productUnitWeight:  item.netWeight,
-              weightUnit:  item.weightUnit,
+              productUnitWeight: item.netWeight,
+              weightUnit: item.weightUnit,
               model: item.modelType,
               specification: item.specification,
               brandNo: item.brandNum
@@ -317,9 +388,7 @@ export default {
             this.form.productInfoList[i].productCode,
             del[j].productCode
           );
-          if (
-            this.form.productInfoList[i].productCode === del[j].productCode
-          ) {
+          if (this.form.productInfoList[i].productCode === del[j].productCode) {
             this.form.productInfoList.splice(i, 1);
             break;
           }
@@ -337,19 +406,11 @@ export default {
     },
 
     inputNumber(row, index) {
-
       const pos = this.form.productInfoList;
       if (pos[index].productUnitWeight) {
-        const number = multiply(
-          row.contractNum,
-          row.productUnitWeight
-        )
+        const number = multiply(row.contractNum, row.productUnitWeight);
 
-        this.$set(
-          pos[index],
-          'productWeight',
-          number
-        );
+        this.$set(pos[index], 'productWeight', number);
       }
     }
   }

+ 24 - 15
src/views/saleOrder/index.vue

@@ -183,6 +183,14 @@
             label: '牌号',
             align: 'center'
           },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            minWidth: 150,
+
+            showOverflowTooltip: true
+          },
           {
             prop: 'model',
             label: '型号',
@@ -207,26 +215,27 @@
           },
           {
             prop: 'contractNum',
-            label: '合同数量' + (this.clientEnvironmentId == '4' ? '(方)' : ''),
-            align: 'center'
-          },
-          {
-            prop: 'lackNum',
-            label: '欠交数量' + (this.clientEnvironmentId == '4' ? '(方)' : ''),
-            align: 'center'
-          },
-          {
-            prop: 'moCount',
-            label: '模数',
+            label: this.clientEnvironmentId == '4' ? '交付数量' : '合同数量' ,
             align: 'center',
-            show: this.clientEnvironmentId == '4'
+            
           },
           {
-            prop: 'blockCount',
-            label: '块数',
+            prop: 'lackNum',
+            label: '欠交数量',
             align: 'center',
-            show: this.clientEnvironmentId == '4'
           },
+          // {
+          //   prop: 'moCount',
+          //   label: '模数',
+          //   align: 'center',
+          //   show: this.clientEnvironmentId == '4'
+          // },
+          // {
+          //   prop: 'blockCount',
+          //   label: '块数',
+          //   align: 'center',
+          //   show: this.clientEnvironmentId == '4'
+          // },
           {
             prop: 'orderLibraryType',
             label: '按单按库',

+ 20 - 26
src/views/saleOrder/salesToProduction.vue

@@ -134,9 +134,7 @@
           <el-table-column label="行号" align="center" prop="lineNumber">
           </el-table-column>
           <el-table-column
-            :label="
-              '合同数量' + (clientEnvironmentId == '4' ? '(方)' : '')
-            "
+            :label="'合同数量' + (clientEnvironmentId == '4' ? '(方)' : '')"
             align="center"
             prop="contractNum"
           >
@@ -153,17 +151,13 @@
           <el-table-column label="规格" align="center" prop="specification">
           </el-table-column>
           <el-table-column
-            :label="
-              '欠交数量' + (clientEnvironmentId == '4' ? '(方)' : '')
-            "
+            :label="'欠交数量' + (clientEnvironmentId == '4' ? '(方)' : '')"
             align="center"
             prop="lackNum"
           >
           </el-table-column>
           <el-table-column
-            :label="
-              '计划生产数量' + (clientEnvironmentId == '4' ? '(方)' : '')
-            "
+            :label="'计划生产数量' + (clientEnvironmentId == '4' ? '(方)' : '')"
             align="center"
             prop="planProductNum"
             width="140"
@@ -193,9 +187,7 @@
             </template>
           </el-table-column>
           <el-table-column
-            :label="
-              '要求生产数量' + (clientEnvironmentId == '4' ? '(方)' : '')
-            "
+            :label="'要求生产数量' + (clientEnvironmentId == '4' ? '(方)' : '')"
             align="center"
             prop="requiredFormingNum"
             width="120"
@@ -597,12 +589,18 @@ export default {
           res.produceRoutingId || this.$route.query.produceRoutingId;
         this.form.salesOrders.map((item, index) => {
           if (this.clientEnvironmentId == '4') {
-            this.tableHandleKeyUp(item, '', item.lackNum, 'sum');
+            if (item.productName.includes('板材')) {
+              this.tableHandleKeyUp(item, '', item.lackNum, 'blockCount');
+            } else {
+              this.tableHandleKeyUp(item, '', item.lackNum, 'moCount');
+            }
+          } else {
+            item.planProductNum = item.lackNum;
+            item.requiredFormingNum = item.lackNum;
           }
           item.slottingType = item.slottingType && item.slottingType + '';
           item.priority = index + 1;
-          item.planProductNum = item.lackNum;
-          item.requiredFormingNum = item.lackNum;
+
           item.reqMoldTime = dayjs(
             new Date(item.deliveryTime).getTime() - 3600 * 1000 * 24 * 10
           ).format('YYYY-MM-DD');
@@ -784,11 +782,6 @@ export default {
           row.blockCount = Math.floor(
             e / ((modelLong * modeWide * modeHight) / 1000000)
           );
-          // console.log(e,'row.blockCount')
-          // console.log(modelLong,'row.blockCount')
-          // console.log(modeWide,'row.blockCount')
-          // console.log(modeHight,'row.blockCount')
-
           if (row.productName.includes('板材')) {
             row.moCount = Math.ceil(
               row.blockCount /
@@ -824,14 +817,15 @@ export default {
             );
           }
 
-          row.planProductNum = (
-            (Number(e) * modelLong * modeWide * modeHight) /
-            1000000
-          ).toFixed(5);
+          row.planProductNum =
+            (Number(e) * modelLong * modeWide * modeHight) / 1000000;
         }
       }
-
-      row.requiredFormingNum = this.toInt(row.planProductNum);
+      row.planProductNum = Number(row.planProductNum.toFixed(5));
+      row.contractNum=row.planProductNum;
+      row.requiredFormingNum = row.planProductNum;
+      row.lackNum = row.planProductNum;
+      this.form.contractNum=row.planProductNum;
     },
     confirmChoose(list) {
       // 取出在弹窗中选中并且不在表格中的数据

+ 12 - 2
src/views/schedulingCalculation/mergePutMesh/index.vue

@@ -273,7 +273,11 @@
                 label="剩余模数"
                 align="center"
                 prop="surplusModulus"
-              ></el-table-column>
+              >
+                <template slot-scope="scope">
+                  <span>{{ getSurplusModulus(scope.row.specification) }}</span>
+                </template>
+              </el-table-column>
               <el-table-column
                 label="附加工艺"
                 align="center"
@@ -939,7 +943,6 @@ export default {
         item.surplusModulus = Number(
           Math.ceil(item.noWordCount / item.blockCount / item.equalIdNum)
         );
-        console.log(item, 'sss');
 
         surplusModulusArr.push(item.surplusModulus);
       });
@@ -954,6 +957,13 @@ export default {
           this.editTableData.length +
         '%';
     },
+    getSurplusModulus(specification) {
+      return Math.min(
+        ...this.editTableData
+          .filter((item) => item.specification == specification)
+          .map((item) => item.surplusModulus)
+      );
+    },
     // 输入模数
     modulsNumInput() {
       this.modulusSum = Number(this.modulusNum1) + Number(this.modulusNum2);