Sfoglia il codice sorgente

销售订单转生产计划bug修复

jingshuyong 1 anno fa
parent
commit
bf2ef4c3c5

+ 275 - 125
src/views/productionPlan/components/homogeneityInspectDialog.vue

@@ -10,11 +10,13 @@
       :maxable="true"
     >
       <div class="form-wrapper">
-        <div v-if="leftShow" :style="{ width: leftWidth }">
+        <div v-show="leftShow" :style="{ width: leftWidth }">
           <el-tree
+            ref="treeRef"
             :expand-on-click-node="false"
             :data="cardList"
             :props="treeProps"
+            node-key="id"
             highlight-current
             @node-click="handleNodeClick"
           ></el-tree>
@@ -41,34 +43,7 @@
               <el-col :span="6"> 型号:{{ planInfo.model }} </el-col>
               <el-col :span="6"> 计划数量:{{ planInfo.productNum }} </el-col>
             </el-row>
-            <el-row>
-              <el-form
-                :inline="true"
-                :model="formInline"
-                class="demo-form-inline"
-              >
-                <el-form-item label="审批人">
-                  <el-select
-                    size="mini"
-                    v-model="formInline.region"
-                    placeholder="BOM类型"
-                  >
-                    <el-option label="区域一" value="shanghai"></el-option>
-                    <el-option label="区域二" value="beijing"></el-option>
-                  </el-select>
-                </el-form-item>
-                <el-form-item label="活动区域">
-                  <el-select
-                    size="mini"
-                    v-model="formInline.region"
-                    placeholder="BOM版本"
-                  >
-                    <el-option label="区域一" value="shanghai"></el-option>
-                    <el-option label="区域二" value="beijing"></el-option>
-                  </el-select>
-                </el-form-item>
-              </el-form>
-            </el-row>
+            <el-row> </el-row>
           </div>
           <div>
             <ele-pro-table
@@ -79,6 +54,53 @@
               :init-load="false"
               :datasource="datasourceList"
             >
+              <template v-slot:toolbar>
+                <el-button type="primary" @click="bulkPurchase" size="mini"
+                  >采购申请</el-button
+                >
+              </template>
+              <template v-slot:toolkit>
+                <el-form
+                  :inline="true"
+                  :model="formInline"
+                  class="demo-form-inline"
+                >
+                  <el-form-item label="BOM类型">
+                    <el-select
+                      size="mini"
+                      v-model="formInline.bomType"
+                      placeholder="BOM类型"
+                      class="select-type"
+                      @change="bomTypeChange"
+                    >
+                      <el-option
+                        v-for="item in bomListType"
+                        :key="item.id"
+                        :label="item.bomName"
+                        :value="item.id"
+                      >
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                  <el-form-item label="BOM版本">
+                    <el-select
+                      class="select-type"
+                      size="mini"
+                      v-model="formInline.bomId"
+                      placeholder="BOM版本"
+                      @change="bomVChange"
+                    >
+                      <el-option
+                        v-for="item in bomListV"
+                        :key="item.bomId"
+                        :label="item.versions"
+                        :value="item.bomId"
+                      >
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-form>
+              </template>
               <template v-slot:stockCount="{ row }">
                 <el-link
                   type="primary"
@@ -118,19 +140,29 @@
                   <div v-else>-</div>
                 </div>
               </template>
+              <template v-slot:action="{ row }">
+                <el-link
+                  type="primary"
+                  :underline="false"
+                  @click="purchase(row)"
+                >
+                  采购申请
+                </el-link>
+              </template>
             </ele-pro-table>
           </div>
         </div>
       </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">确定</el-button> -->
       </div>
     </ele-modal>
 
     <stockDetailDialog ref="stockDetailDialog" />
-
     <currentDetailDialog ref="currentDetailDialog" />
+    <producePlan ref="produceRef" @success="reloads"></producePlan>
+    <purchaseDialog ref="purchaseDialogRef" />
   </div>
 </template>
 
@@ -139,14 +171,20 @@
     homogeneityInspect,
     homogeneityInspectMerge,
     findMaterialInfoByPlanId,
-    findBomCategoryByCategoryId
+    findBomCategoryByCategoryId,
+    getBom
   } from '@/api/productionPlan/index.js';
+  import { listBomByPlanIdsOverride } from '@/api/materialPlan/index';
   import stockDetailDialog from './stockDetailDialog.vue';
   import currentDetailDialog from './currentDetailDialog.vue';
+  import producePlan from '@/views/materialPlan/components/producePlan.vue';
+  import purchaseDialog from './purchaseDialog.vue';
   export default {
     components: {
       stockDetailDialog,
-      currentDetailDialog
+      currentDetailDialog,
+      producePlan,
+      purchaseDialog
     },
     data() {
       return {
@@ -163,9 +201,7 @@
         // form: {
         //   homogeneityInspect: []
         // },
-
         rules: {},
-
         columns: [
           {
             columnKey: 'index',
@@ -173,56 +209,80 @@
             type: 'index',
             width: 55,
             align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            slot: 'selection',
+            fixed: 'left'
+          },
+          {
+            prop: 'productCode',
+            label: '计划编号',
+            align: 'center',
+            minWidth: 100,
             showOverflowTooltip: true
           },
-          // {
-          //   prop: 'productCode',
-          //   label: '计划编号',
-          //   align: 'center',
-          //   minWidth: 100,
-          //   showOverflowTooltip: true
-          // },
-          // {
-          //   prop: 'opCode',
-          //   label: '工序编码',
-          //   align: 'center',
-          //   minWidth: 100,
-          //   showOverflowTooltip: true
-          // },
-          // {
-          //   prop: 'opName',
-          //   label: '工序名称',
-          //   align: 'center',
-          //   minWidth: 100
-          // },
-          // {
-          //   prop: 'bomCode',
-          //   label: '物料编码',
-          //   align: 'center',
-          //   minWidth: 100,
-          //   showOverflowTooltip: true
-          // },
-          // {
-          //   prop: 'bomName',
-          //   label: '物料名称',
-          //   align: 'center',
-          //   minWidth: 100
-          // },
           {
-            prop: 'demandQuantity',
-            label: '定额数量',
+            prop: 'opCode',
+            label: '工序编码',
+            align: 'center',
+            minWidth: 100,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'taskName',
+            label: '工序名称',
+            align: 'center',
+            minWidth: 100
+          },
+          {
+            prop: 'code',
+            label: '物料编码',
+            align: 'center',
+            minWidth: 100,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '物料名称',
+            align: 'center',
+            minWidth: 100
+          },
+          {
+            prop: 'inventoryQuantity',
+            label: '库存',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'secureInventory',
+            label: '安全库存',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'lockQuantity',
+            label: '锁库数量',
+            showOverflowTooltip: true
+          },
+
+          {
+            label: '采购数量',
+            align: 'center',
+            minWidth: 120
+          },
+          {
+            slot: 'stockCount',
+            prop: 'stockCount',
+            label: '库存数量',
             align: 'center',
             minWidth: 80
           },
-          // {
-          //   slot: 'stockCount',
-          //   prop: 'stockCount',
-          //   label: '库存数量',
-          //   align: 'center',
-          //   minWidth: 80
-          // },
           {
-            slot: 'stockColor',
+            slot: 'stockStatus',
             prop: 'stockStatus',
             label: '库存状态',
             align: 'center',
@@ -235,13 +295,13 @@
             align: 'center',
             minWidth: 80
           },
-          // {
-          //   slot: 'currentColor',
-          //   prop: 'currentStatus',
-          //   label: '在途状态',
-          //   align: 'center',
-          //   minWidth: 80
-          // },
+          {
+            slot: 'currentColor',
+            prop: 'currentStatus',
+            label: '在途状态',
+            align: 'center',
+            minWidth: 80
+          },
           {
             label: '最终缺料数量',
             align: 'center',
@@ -261,6 +321,15 @@
             label: '最终状态',
             align: 'center',
             minWidth: 80
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 120,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action'
           }
         ],
         ids: [],
@@ -275,16 +344,20 @@
         planInfo: {
           salesCode: ''
         },
-        datasourceList: []
+        datasourceList: [], // 表格物料数据
+        bomListV: [], // BOM版本
+        bomListType: [], // BOM 类型
+        planId: '',
+        selectNodeId: ''
       };
     },
     watch: {
       leftShow(newVal, oldVal) {
         if (newVal) {
-          this.leftWidth = '15%';
-          this.rightWidth = '85%';
+          this.leftWidth = '230px';
+          this.rightWidth = 'calc(100% - 230px)';
         } else {
-          this.leftWidth = '0%';
+          this.leftWidth = '0';
           this.rightWidth = '100%';
         }
       }
@@ -292,13 +365,16 @@
     mounted() {},
     methods: {
       handleNodeClick(data) {
-        this.reload({ planIds: [data.id] });
+        this.getBomData(data);
+        this.selectNodeId = data.id;
+        // this.reload({ planIds: [data.id] });
       },
       reload(where) {
         this.$nextTick(() => {
           this.$refs.table.reload({ page: 1, where });
         });
       },
+      reloads() {},
       /* 表格数据源 */
       // datasource({ page, limit, where }) {
       //   return homogeneityInspect({
@@ -313,60 +389,134 @@
       currentDetail(row) {
         this.$refs.currentDetailDialog.open(row);
       },
+      // 选择BOM类型
+      bomTypeChange(e) {
+        this.formInline.bomType = e;
+        let data = this.bomListType.find((el) => el.id === e);
+        if (!data) return;
+        this.bomListV = data.bomList;
+        this.bomVChange(data.bomList[0].bomId);
+      },
+      // 选择BOM版本
+      bomVChange(e) {
+        this.formInline.bomId = e;
+        let data = this.bomListV.find((el) => el.bomId === e);
+        if (!data) return;
+        this.getMaterialData(data);
+      },
+      // 获取物料数据信息
+      async getMaterialData(data) {
+        let params = { planId: this.planId, bomVersionId: data.bomId };
+        const result = await findMaterialInfoByPlanId(params);
+        this.datasourceList = result;
+      },
+      // 批量采购
+      async bulkPurchase(list) {
+        if (list.length == 0) {
+          return this.$message.warning('请至少选择一条数据');
+        }
+        // let planIds = list.map((item) => item.id);
+        // let data = {
+        //   planIds: ['1948548495278911490', '1948548022580850689'],
+        //   demandType: '1'
+        // };
+        // this.$refs.produceRef.visible = true;
+        const o = this.cardList.find((el) => el.id === this.selectNodeId);
+        let obj = JSON.parse(JSON.stringify(o));
+        obj.materialList = list;
+        this.$nextTick(() => {
+          this.$refs.purchaseDialogRef.open([obj], '生产计划');
+        });
+        // const result = await listBomByPlanIdsOverride(data);
+      },
+      // 采购申请
+      purchase(row) {
+        this.bulkPurchase([row]);
+      },
       async open(dataList) {
+        console.log(dataList, '00000000000');
         this.visible = true;
+        this.cardList = dataList;
+        // .map((item) => {
+        //   return {
+        //     id: item.id,
+        //     code: item.code,
+        //     categoryId: item.categoryId,
+        //     children: []
+        //   };
+        // });
+        if (dataList.length === 1) {
+          this.leftShow = false;
+        } else {
+          this.leftShow = true;
+          const firstNodeKey = dataList[0].id;
+          this.$nextTick(() => {
+            console.log(this.$refs, '00000000000');
+            this.$refs.treeRef.setCurrentKey(firstNodeKey);
+          });
+        }
+        this.handleNodeClick(dataList[0]);
+        // for (let item of this.cardList) {
+        //   let children = [];
+        //   if (item.salesCode) {
+        //     for (let ele of item.salesCode) {
+        //       children.push({ code: ele, id: item.id });
+        //     }
+        //   }
+        //   item.children = children;
+        // }
+        // this.planInfo = dataList.length > 0 ? dataList[0] : null;
+        // console.log(this.cardList,'cardListcardList');
+        // if (dataList.length > 1) {
+        //   this.leftShow = true;
+        // } else {
+        //   this.leftShow = false;
+        // }
+        // if (this.planInfo) {
+        //   this.reload({ planIds: [this.planInfo.id] });
+        // }
+      },
+      cancel() {
+        this.formData = {};
+        this.visible = false;
+      },
+
+      // 获取bom 数据
+      async getBomData(data) {
         try {
-          let data = dataList[0];
+          this.planId = data.id;
           const res = await findBomCategoryByCategoryId(data.categoryId);
+          if (!res || res.length == 0) {
+            this.bomListD = [];
+            this.datasourceList = [];
+            return;
+          }
           let obj = {};
+          let bomMap = {
+            1: 'PBOM',
+            2: 'MBOM',
+            3: 'ABOM',
+            4: 'EBOM'
+          };
           res.map((el) => {
+            el.bomName = bomMap[el.bomType];
             let OBMINFO = {
               bomId: el.bomId,
               bomType: el.type,
               versions: `V${el.versions}.0`
             };
             if (obj[el.bomType]) {
-              obj[el.bomType].bomList.push(OBMINFO);
+              obj[el.bomType].bomList.unshift(OBMINFO);
             } else {
               obj[el.bomType] = { ...el, bomList: [OBMINFO] };
             }
           });
-          console.log(obj,'obj ++++++++++')
-          console.log(res, '版本 类型');
-          let params = {
-            planId: data.id
-          };
-          const result = await findMaterialInfoByPlanId(params);
-          console.log(result, 'result +++++');
-          this.datasourceList = result;
+          let list = Object.values(obj);
+          this.bomListType = list;
+          this.bomTypeChange(list[0].id);
         } catch (err) {
           this.$message.error(err.message);
         }
-        return;
-        this.cardList = dataList || [];
-        for (let item of this.cardList) {
-          let children = [];
-          if (item.salesCode) {
-            for (let ele of item.salesCode) {
-              children.push({ code: ele, id: item.id });
-            }
-          }
-          item.children = children;
-        }
-        this.planInfo = dataList.length > 0 ? dataList[0] : null;
-        console.log(this.planInfo);
-        if (dataList.length > 1) {
-          this.leftShow = true;
-        } else {
-          this.leftShow = false;
-        }
-        if (this.planInfo) {
-          this.reload({ planIds: [this.planInfo.id] });
-        }
-      },
-      cancel() {
-        this.formData = {};
-        this.visible = false;
       },
 
       confirm() {

+ 346 - 0
src/views/productionPlan/components/purchaseDialog.vue

@@ -0,0 +1,346 @@
+<template>
+  <ele-modal
+    :visible.sync="buVisible"
+    @closed="cancel"
+    title="采购申请"
+    custom-class="ele-dialog-form"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    width="80%"
+    :maxable="true"
+  >
+    <el-form>
+      <ele-pro-table
+        ref="tableRef3"
+        :columns="columns"
+        :datasource="tableList"
+        :need-page="false"
+        :toolbar="false"
+        row-key="id"
+        default-expand-all
+      >
+        <template v-slot:action="{ row, $index }">
+          <template>
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="categorySelect(row)"
+            >
+              添加物料
+            </el-link>
+            <!-- <el-popconfirm
+              class="ele-action"
+              title="确定要删除此生产计划吗?"
+              @confirm="remove(row, $index)"
+            >
+              <template v-slot:reference>
+                <el-link type="danger" :underline="false" icon="el-icon-delete">
+                  删除
+                </el-link>
+              </template>
+            </el-popconfirm> -->
+          </template>
+        </template>
+
+        <template v-slot:expand="{ row, $index }">
+          <div
+            style="
+              width: calc(100% - 55px);
+              min-height: 60px;
+              margin-left: 55px;
+            "
+          >
+            <ele-pro-table
+              :columns="materiaList"
+              :datasource="row.materialList || []"
+              :need-page="false"
+              height="300px"
+              class="el-form-box"
+              :toolkit="[]"
+            ></ele-pro-table> </div
+        ></template>
+      </ele-pro-table>
+    </el-form>
+    <ProductModal ref="productRefs" @chooseModal="chooseModal" />
+  </ele-modal>
+</template>
+
+<script>
+  import ProductModal from '@/views/materialPlan/components/ProductModal.vue';
+  export default {
+    components: {
+      ProductModal,
+    },
+    data() {
+      return {
+        buVisible: false,
+        tableList: []
+      };
+    },
+    computed: {
+      columns() {
+        return [
+          {
+            width: 45,
+            type: 'expand',
+            columnKey: 'materialList',
+            align: 'center',
+            slot: 'expand'
+          },
+
+          {
+            width: 50,
+            label: '序号',
+            type: 'index',
+            align: 'center',
+            slot: 'index'
+          },
+          {
+            prop: 'producePlanCode',
+            label: '计划编号',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 170,
+            sortable: true
+          },
+          {
+            prop: 'code',
+            label: '销售订单号',
+            slot: 'code',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 170,
+            sortable: true
+          },
+          {
+            prop: 'customerName',
+            label: '客户名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'deliveryNum',
+            label: '客户代号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productCode',
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+
+          {
+            prop: 'productName',
+            label: '名称',
+            align: 'center',
+            minWidth: 120
+          },
+
+          {
+            prop: 'model',
+            label: '型号',
+            align: 'center',
+            minWidth: 120
+          },
+
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center'
+          },
+
+          {
+            prop: 'deliveryTime',
+            label: '交付日期',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'contractNum',
+            label: '订单数量',
+            align: 'center'
+          },
+          {
+            prop: 'lackNum',
+            label: '欠交数量',
+            align: 'center'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 150,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ];
+      },
+      materiaList() {
+        return [
+          {
+            columnKey: 'selection',
+            type: 'selection',
+            width: 50,
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            width: 50,
+            label: '序号',
+            prop: 'sort',
+            slot: 'sort',
+            align: 'center'
+          },
+
+          {
+            label: '物料名称',
+            prop: 'name',
+            align: 'center',
+            minWidth: 120,
+            fixed: 'left'
+          },
+
+          {
+            label: '物料编码',
+            prop: 'code',
+            align: 'center',
+            minWidth: 120,
+            fixed: 'left'
+          },
+          {
+            label: '牌号',
+            prop: 'brandNum',
+            align: 'center'
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            label: '型号',
+            prop: 'modelType',
+            align: 'center'
+          },
+          {
+            prop: 'inventoryQuantity',
+            label: '库存',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'secureInventory',
+            label: '安全库存',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'lockQuantity',
+            label: '锁库数量',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'inTransitNum',
+            label: '在途数量',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'inTransitOrdersNum',
+            label: '在途已关联数量',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'availableQuantity',
+            label: '可用数量',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'unit',
+            label: '计量单位',
+            showOverflowTooltip: true,
+            action: 'unit',
+            slot: 'unit'
+          },
+
+          {
+            label: '需求数量',
+            slot: 'demandQuantity',
+            action: 'demandQuantity',
+            align: 'center',
+            minWidth: 120
+          },
+
+          {
+            label: '采购数量',
+            slot: 'purchaseQuantity',
+            action: 'purchaseQuantity',
+            align: 'center',
+            minWidth: 120
+          },
+
+          {
+            label: '到货方式',
+            slot: 'deliveryMethod',
+            action: 'deliveryMethod',
+            align: 'center',
+            minWidth: 140
+          },
+          {
+            label: '采购周期',
+            slot: 'purchasingCycle',
+            action: 'purchasingCycle',
+            align: 'center',
+            minWidth: 160
+          },
+          {
+            label: '要求到货时间',
+            slot: 'requireDeliveryTime',
+            action: 'requireDeliveryTime',
+            align: 'center',
+            minWidth: 180
+          },
+
+          {
+            label: '图纸',
+            slot: 'imgUrl',
+            action: ' imgUrl',
+            align: 'center',
+            minWidth: 140
+          },
+
+          {
+            label: '附件',
+            slot: 'files',
+            action: ' files',
+            align: 'center',
+            minWidth: 140
+          }
+        ];
+      }
+    },
+    methods: {
+      open(list) {
+        console.log(list, 'list 000000000000');
+        this.tableList = list;
+        this.buVisible = true;
+      },
+      cancel() {
+        this.buVisible = false;
+      },
+      categorySelect(row) {
+        // this.$refs.productRefs.open(row.materialList, row, this.type);
+      },
+      chooseModal() {},
+      remove(row, index) {
+        // this.formData.detailRemoveIds.push(row.id);
+        // let _arr = this.$refs.table.getData() || [];
+        // _arr.splice(index, 1);
+        // this.$refs.table.setData([..._arr]);
+      }
+    }
+  };
+</script>

+ 71 - 22
src/views/saleOrder/salesToProductionNewTwo.vue

@@ -254,34 +254,51 @@
 
         <el-row> </el-row>
 
-        <el-row :gutter="24" class="row-intro">
+        <el-row :gutter="24" class="row-intro product_info">
           <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
-            <el-form-item label="销售单数量:">{{ form.codeNum }}</el-form-item>
+            <el-form-item label-width="88px" label="销售单数量:">{{
+              form.codeNum
+            }}</el-form-item>
           </el-col>
           <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
-            <el-form-item label="订单总数量:">{{
+            <el-form-item label-width="88px" label="订单总数量:">{{
               form.contractNum
             }}</el-form-item>
           </el-col>
           <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 4 }">
-            <el-form-item label="订单总重量:">{{
+            <el-form-item label-width="88px" label="订单总重量:">{{
               form.sumOrderWeight
             }}</el-form-item>
           </el-col>
-          <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
-            <el-form-item label="产品编码:">{{
-              form.productCode
-            }}</el-form-item>
+          <el-col
+            style="padding: 0 0"
+            v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }"
+          >
+            <el-form-item
+              label-width="80px"
+              class="product_code_name"
+              label="产品编码:"
+              ><span>{{ form.productCode }}</span></el-form-item
+            >
           </el-col>
-          <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
-            <el-form-item label="牌号:">{{ form.brandNo }}</el-form-item>
+          <el-col
+            style="padding: 0 0 0 5px"
+            v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }"
+          >
+            <el-form-item label-width="50px" label="牌号:">{{
+              form.brandNo
+            }}</el-form-item>
           </el-col>
           <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 5 }">
-            <el-form-item label="型号:">{{ form.model }}</el-form-item>
+            <el-form-item label-width="50px" label="型号:">{{
+              form.model
+            }}</el-form-item>
           </el-col>
 
           <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 3 }">
-            <el-form-item label="规格:">{{ form.specification }}</el-form-item>
+            <el-form-item label-width="50px" label="规格:">{{
+              form.specification
+            }}</el-form-item>
           </el-col>
           <!-- <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
                     <el-form-item label="库存数量:">{{
@@ -321,7 +338,8 @@
             width="120"
           >
             <template slot-scope="scope">
-              {{ scope.row.contractNum }} {{ scope.row.measuringUnit }}
+              {{ scope.row.contractNum }}
+              <!-- {{ scope.row.measuringUnit }} -->
             </template>
           </el-table-column>
           <el-table-column
@@ -927,8 +945,6 @@
         if (data.endTime) {
           this.$set(this.form, 'endTime', data.endTime);
         }
-        console.log(data, '000000000000000000000 参数');
-        console.log(this.form, 'form 的赋值');
       },
       // 是否必填
       mandatoryField() {
@@ -992,7 +1008,6 @@
       async _getInventory() {
         let code = [this.form.productCode];
         const res = await getInventoryTotalAPI(code);
-        console.log(res, '这是库存的数据 ---');
         this.form.stockCountBase = res[0].stockCountBase;
       },
 
@@ -1104,12 +1119,10 @@
       getSaleInfo() {
         let params = JSON.parse(this.$route.query.selection);
         productionToPlan(params).then((res) => {
-          console.log(res, 'resresres');
           this.form = deepClone(res);
           this.initTime();
           this.bomListVersion();
 
-          console.log(this.bomVersionList, 'this.bomVersionList');
           this.form.produceRoutingName =
             res.produceRoutingName || this.$route.query.produceRoutingName;
           this.form.produceRoutingId =
@@ -1225,14 +1238,31 @@
             (v) => v.id == this.form.factoriesId
           )?.name;
         }
+        // let data = this.form.salesOrders[0];
+
         if (this.form.salesOrders.length > 1) {
           //多条订单时,拼接批次号(订单数量)
-          this.form.batchNo = this.form.salesOrders
-            .map((v) => v.batchNo + `(生产数量:${v.contractNum})`)
-            .join(',');
+          let arr = [];
+          this.form.salesOrders.map((v) => {
+            if (v.batchNo) {
+              arr.push(v.batchNo);
+            }
+          });
+          this.form.batchNo = arr.toString();
         } else {
+          // ((data.productSumWeight /contractNum)  * data.planProductNum).toFixed(2);
           this.form.batchNo = this.form.salesOrders[0].batchNo;
         }
+        let newSumOrderWeight = 0;
+        this.form.salesOrders &&
+          this.form.salesOrders.map((el) => {
+            let total = (
+              (el.productSumWeight / el.contractNum) *
+              el.planProductNum
+            ).toFixed(2);
+            newSumOrderWeight = newSumOrderWeight + (total - 0);
+          });
+        this.form.newSumOrderWeight = newSumOrderWeight;
         let flag = this.parameterVerification();
         // 必填参数校验
         if (!flag) return;
@@ -1308,7 +1338,7 @@
         this.form.productNum = productNum;
         this.form.productUnitWeight =
           this.form.salesOrders[0]?.productUnitWeight;
-        this.form.newSumOrderWeight = _sumOrderWeight.toFixed(2);
+        // this.form.newSumOrderWeight = _sumOrderWeight.toFixed(2);
         this.form.requiredFormingNum = requiredFormingNum;
         const collection = deepClone(this.form.salesOrders);
         const sortedCollection = collection.sort(
@@ -1355,6 +1385,7 @@
       // 删除产品
       handleDeleteItem(index) {
         this.form.salesOrders.splice(index, 1);
+        this.changeData();
       },
       addEquipment() {
         this.$refs.additionalRefs.open(this.form.planType);
@@ -1711,4 +1742,22 @@
     top: 11px;
     left: 2px;
   }
+
+  ::v-deep .product_info {
+    .el-form-item--medium {
+      .el-form-item__label {
+        line-height: 26px;
+      }
+      .el-form-item__content {
+        line-height: 26px;
+      }
+    }
+
+    .product_code_name {
+      .el-form-item__content {
+        white-space: normal;
+        word-break: break-all;
+      }
+    }
+  }
 </style>