فهرست منبع

临时计划新增销售订单号的选择

695593266@qq.com 2 ماه پیش
والد
کامیت
714646443e

+ 17 - 3
src/api/saleOrder/index.js

@@ -329,7 +329,10 @@ export async function getFactoryarea(params) {
 
 // 根据产品ID列表查询BOM分类
 export async function findBomCategoryByCategoryIds(data) {
-  const res = await request.post(`/aps/salesorder/findBomCategoryByCategoryIds`, data);
+  const res = await request.post(
+    `/aps/salesorder/findBomCategoryByCategoryIds`,
+    data
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -338,7 +341,9 @@ export async function findBomCategoryByCategoryIds(data) {
 
 // 临时计划
 export async function getUpdateInfoByCode(code) {
-  const res = await request.get(`/aps/productionplan/getUpdateInfoByCode/${code}`);
+  const res = await request.get(
+    `/aps/productionplan/getUpdateInfoByCode/${code}`
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -354,4 +359,13 @@ export async function enterprisePage(params) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}
+
+//获取ERP销售订单
+export async function getErpSalesOrder(params) {
+  const res = await request.get(`/eom/saleorder/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 99 - 0
src/views/productionPlan/components/factoryAdd/components/saleOrder-search.vue

@@ -0,0 +1,99 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="100px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="24">
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
+        <el-form-item label="订单编码:">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="where.orderNo"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
+        <el-form-item label="产品名称:">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="where.productName"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
+        <el-form-item label="产品编码:">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="where.productCode"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+
+      <!-- <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
+        <el-form-item label="销售类型:">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="where.productCodes"
+          ></el-input>
+        </el-form-item>
+      </el-col> -->
+
+      <el-col v-bind="styleResponsive ? { sm: 4 } : { span: 4 }">
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset">重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        orderNo: '',
+        productName: '',
+        productCode: ''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    props: {},
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>

+ 286 - 0
src/views/productionPlan/components/factoryAdd/components/saleOrderPop.vue

@@ -0,0 +1,286 @@
+<template>
+  <el-dialog
+    :title="title"
+    v-if="visible"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="true"
+    :close-on-press-escape="false"
+    append-to-body
+    width="90%"
+  >
+    <el-card shadow="never">
+      <saleOrderSearch @search="reload" />
+
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        :selection.sync="selection"
+        :class="{ 'single-select-table': !isMultiple }"
+        row-key="id"
+        :page-size="20"
+        :initLoad="false"
+        @select="handleSelect"
+        @select-all="handleSelectAll"
+        :cache-key="cacheKeyUrl"
+      >
+      </ele-pro-table>
+    </el-card>
+
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import saleOrderSearch from './saleOrder-search';
+  import { getErpSalesOrder } from '@/api/saleOrder';
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    components: { saleOrderSearch },
+    mixins: [dictMixins],
+    props: {
+      isMultiple: {
+        type: Boolean,
+        default: true
+      }
+    },
+    data() {
+      return {
+        visible: false,
+        title: '销售订单',
+
+        columns: [
+          {
+            columnKey: 'selection',
+            type: 'selection',
+            width: 45,
+            align: 'center',
+            reserveSelection: true,
+            fixed: 'left'
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'orderNo',
+            label: '订单编码',
+            align: 'center',
+            slot: 'orderNo',
+            showOverflowTooltip: true,
+            sortable: true,
+            minWidth: 200
+          },
+          {
+            prop: 'preOrderNo',
+            label: '预销售订单编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            sortable: true,
+            minWidth: 200
+          },
+
+          {
+            prop: 'productNames',
+            label: '产品名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'productCodes',
+            label: '产品编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'saleTypeName',
+            label: '销售类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'projectName',
+            label: '项目名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180
+          },
+          {
+            prop: 'partaName',
+            label: '客户名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180
+          },
+          {
+            prop: 'partaLinkName',
+            label: '客户联系人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+
+          {
+            prop: 'partaTel',
+            label: '客户联系电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+
+          {
+            prop: 'payAmount',
+            label: '金额(元)',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 80
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          }
+        ],
+
+        // 表格选中数据
+        selection: [],
+
+        tableData: [],
+        current: null,
+        cacheKeyUrl: 'factoryAddSaleOrderTable-key-1'
+      };
+    },
+
+    watch: {},
+    created() {
+      this.requestDict('按单按库');
+      this.requestDict('交付要求');
+      this.requestDict('订单类型');
+      this.requestDict('订单来源');
+      this.requestDict('生产状态');
+    },
+    methods: {
+      open() {
+        this.visible = true;
+        this.reload();
+      },
+
+      /* 表格数据源 */
+      async datasource({ page, limit, where }) {
+        where.orderStatus = 2;
+
+        const data = await getErpSalesOrder({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+        return data;
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$nextTick(() => {
+          this.$refs.table.reload({ page: 1, where: where });
+        });
+      },
+
+      handleClose() {
+        this.visible = false;
+        this.$refs.table.setSelectedRows([]);
+        this.selection = [];
+      },
+      setSingleSelection(row) {
+        this.$refs.table.clearSelection();
+        this.$nextTick(() => {
+          if (row) {
+            this.$refs.table.toggleRowSelection(row, true);
+            this.selection = [row];
+          } else {
+            this.selection = [];
+          }
+        });
+      },
+      handleSelect(selection, row) {
+        if (!this.isMultiple) {
+          const currentRow = selection.find((item) => item.id === row.id);
+          this.setSingleSelection(currentRow || null);
+          return;
+        }
+        this.selection = selection;
+      },
+      handleSelectAll(selection) {
+        if (!this.isMultiple) {
+          this.setSingleSelection(selection[0] || null);
+          return;
+        }
+        this.selection = selection;
+      },
+      selected() {
+        if (!this.selection.length) {
+          this.$message.error('请至少选择一条数据');
+          return;
+        }
+        if (!this.isMultiple && this.selection.length > 1) {
+          this.selection = [this.selection[this.selection.length - 1]];
+        }
+        const selectedIds = new Set(this.selection.map((item) => item.orderNo));
+        const hasIds = this.tableData.some((item) =>
+          selectedIds.has(item.orderNo)
+        );
+
+        if (hasIds) {
+          this.$confirm('您勾选了已存在的数据,是否继续?', '提示', {
+            type: 'warning'
+          })
+            .then(() => {
+              this.$emit('chooseOrder', this.selection);
+              this.handleClose();
+            })
+            .catch(() => {});
+        } else {
+          this.$emit('chooseOrder', this.selection);
+          this.handleClose();
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
+
+  ::v-deep .single-select-table .el-table__header-wrapper .el-checkbox {
+    display: none;
+  }
+</style>

+ 195 - 195
src/views/productionPlan/components/factoryAdd/index.vue

@@ -72,7 +72,7 @@
         </el-row>
 
         <el-row :gutter="24">
-          <!-- <el-col :span="6">
+          <el-col :span="6" v-if="isSaleOrder">
             <el-form-item label="销售订单号:" prop="saleOrder">
               <div class="sale-order-select">
                 <el-input
@@ -92,7 +92,7 @@
                 </el-button>
               </div>
             </el-form-item>
-          </el-col> -->
+          </el-col>
 
           <el-col :span="6">
             <el-form-item
@@ -511,7 +511,7 @@
 <script>
   import { findBomCategoryByCategoryId } from '@/api/productionPlan/index';
   import EquipmentDialog from '@/views/saleOrder/components/EquipmentDialog';
-  import saleOrderPop from '@/views/materialPlan/components/saleOrderPop.vue';
+  import saleOrderPop from './components/saleOrderPop.vue';
   import { getCode } from '@/api/codeManagement';
   import ProcessRoute from '@/components/selectionDialog/processRoute.vue';
   import { parameterGetByCode } from '@/api/mainData/index';
@@ -899,7 +899,8 @@
         ],
         selectIndex: 0, // 选择工艺路线的当前数据下标
         processingRequired: 0, // 生产类型跟BOM 版本是否必填 1:是 0:否
-        isReview: false
+        isReview: false,
+        isSaleOrder: false
         // selectionRowShow: false // 工艺路线输入框展示 状态
       };
     },
@@ -909,18 +910,7 @@
     //     return this.$store.state.user.info.clientEnvironmentId;
     //   }
     // },
-    mounted() {
-      this.getCodeData();
-      // 生产类型跟BOM版本字段是否必填
-      parameterGetByCode({
-        code: 'production_plan_code'
-      }).then((res) => {
-        console.log(res, 'res 1');
-        if (res) {
-          this.processingRequired = res.value;
-        }
-      });
-    },
+    mounted() {},
     methods: {
       // 获取
       async getCodeData() {
@@ -983,138 +973,110 @@
         this.factoryList = await getFactoryList();
       },
       async open(val) {
-        await this.getFactoryList();
-        await this.getPlannedReleaseRequire('planned_release_require');
+        const [processingRes, saleOrderRes] = await Promise.all([
+          parameterGetByCode({ code: 'production_plan_code' }),
+          parameterGetByCode({ code: 'create_plan_binding_sale_order' }),
+          this.getCodeData(),
+          this.getFactoryList(),
+          this.getPlannedReleaseRequire('planned_release_require')
+        ]);
+
+        if (processingRes) {
+          this.processingRequired = processingRes.value;
+        }
+        this.isSaleOrder = saleOrderRes?.value === '1';
         this.clientEnvironmentId =
           this.$store.state.user.info.clientEnvironmentId;
         this.factoriesId = this.$store.state.user.info.factoryId;
 
-        if (val) {
-          if (val.planType == null || val.planType == 'null') {
-            val.planType = '';
-          }
-          this.title = !val.id ? '新增临时生产计划' : '编辑临时生产计划';
-          val.planType = String(val.planType);
-          this.form = await getUpdateInfoByCode(val.code);
-          // 修改
-          if (val.id) {
-            if (
-              Array.isArray(val.productInfoList) &&
-              val.productInfoList.length
-            ) {
-              this.form.productInfoList.map(async (v, index) => {
-                if (!v.bomCategoryId) {
-                  v.productType = '';
-                  v.selectionRowShow = true;
-                } else {
-                  v.selectionRowShow = false;
-                }
-                if (v.productType) {
-                  this.$set(
-                    this.form.productInfoList[index],
-                    'bomVersionList',
-                    await this.bomListVersionFn(v.productType, v.categoryId)
-                  );
-                }
-                if (v.bomCategoryId) {
-                  this.$set(
-                    this.form.productInfoList[index],
-                    'routingList',
-                    await this.changeBomIdFn(
-                      v.bomCategoryId,
-                      this.form.productInfoList[index]
-                    )
-                  );
-                }
-              });
-            }
-            // let categoryId = this.form.productInfoList[0].categoryId;
-            // const res = await findBomCategoryByCategoryId(categoryId);
-            let promiseAll = [];
-            this.form.productInfoList.forEach(async (item) => {
-              let categoryId = item.categoryId;
-              promiseAll.push(findBomCategoryByCategoryId(categoryId));
-            });
-            const resAll = await Promise.all(promiseAll);
-            console.log(this.form.productInfoList);
+        if (!val) {
+          this.title = '新增临时生产计划';
+          this.visible = true;
+          return;
+        }
 
-            this.form.productInfoList.forEach((item, index) => {
-              if (item.colorKey && typeof item.colorKey == 'string') {
-                this.$set(
-                  this.form.productInfoList[index],
-                  'colorKey',
-                  item.colorKey.split(',')
-                );
+        if (val.planType == null || val.planType === 'null') {
+          val.planType = '';
+        }
+        this.title = val.id ? '编辑临时生产计划' : '新增临时生产计划';
+        val.planType = String(val.planType);
+        this.form = await getUpdateInfoByCode(val.code);
+
+        if (this.isSaleOrder) {
+          const salesCode = this.form.salesCode;
+          this.$set(
+            this.form,
+            'saleOrder',
+            Array.isArray(salesCode) ? salesCode.join(',') : salesCode || ''
+          );
+        }
+
+        if (val.id) {
+          await this.initEditProductList(val);
+        }
+
+        this.$forceUpdate();
+        this.visible = true;
+      },
+
+      async initEditProductList(val) {
+        const productList = this.form.productInfoList;
+
+        if (Array.isArray(val.productInfoList) && val.productInfoList.length) {
+          await Promise.all(
+            productList.map(async (v, index) => {
+              v.selectionRowShow = !v.bomCategoryId;
+              if (!v.bomCategoryId) {
+                v.productType = '';
               }
-              if (item.modelKey && typeof item.modelKey == 'string') {
-                this.$set(
-                  this.form.productInfoList[index],
-                  'modelKey',
-                  item.modelKey.split(',')
+              if (v.productType) {
+                this.$set(productList[index], 'bomVersionList',
+                  await this.bomListVersionFn(v.productType, v.categoryId)
                 );
               }
-              if (resAll[index]) {
-                let list = [];
-                let listMap = {};
-
-                resAll[index].map((el) => {
-                  if (el.bomType == '2' || el.bomType == '3') {
-                    console.log(listMap, 'listMap');
-                    if (listMap[el.bomType]) {
-                      listMap[el.bomType].push(el);
-                    } else {
-                      listMap[el.bomType] = [el];
-                    }
-                  }
-                });
-                if (listMap[2]) {
-                  list.push({ code: 2, name: 'MBOM' });
-                }
-                if (listMap[3]) {
-                  list.push({ code: 3, name: 'ABOM' });
-                }
-
-                if (!item.factoriesId) {
-                  this.$set(
-                    this.form.productInfoList[index],
-                    'factoriesId',
-                    this.factoriesId
-                  );
-                  this.$set(
-                    this.form.productInfoList[index],
-                    'factoriesName',
-                    this.factoryList?.find(
-                      (factoryData) => factoryData.id === this.factoriesId
-                    )?.name
-                  );
-                }
-                this.$set(
-                  this.form.productInfoList[index],
-                  'producedList',
-                  list
+              if (v.bomCategoryId) {
+                this.$set(productList[index], 'routingList',
+                  await this.changeBomIdFn(v.bomCategoryId, productList[index])
                 );
               }
-            });
-          }
-          this.$forceUpdate();
-        } else {
-          this.title = '新增临时生产计划';
+            })
+          );
         }
-        this.visible = true;
 
-        // this.$nextTick(async () => {
-        //   console.log(val.productInfoList);
-        //   this.$set(this.form, 'productInfoList', val.productInfoList);
-        //   this.$set(this.form, 'routingList', val.routingList);
+        const resAll = await Promise.all(
+          productList.map((item) => findBomCategoryByCategoryId(item.categoryId))
+        );
+
+        productList.forEach((item, index) => {
+          if (typeof item.colorKey === 'string' && item.colorKey) {
+            this.$set(productList[index], 'colorKey', item.colorKey.split(','));
+          }
+          if (typeof item.modelKey === 'string' && item.modelKey) {
+            this.$set(productList[index], 'modelKey', item.modelKey.split(','));
+          }
+
+          if (!resAll[index]) return;
 
-        // });
+          const listMap = {};
+          resAll[index].forEach((el) => {
+            if (el.bomType === '2' || el.bomType === '3') {
+              if (!listMap[el.bomType]) listMap[el.bomType] = [];
+              listMap[el.bomType].push(el);
+            }
+          });
 
-        //this.clientEnvironmentId 环境判断 宝悦环境
-        // if (this.clientEnvironmentId == 4) {
-        //   this.getPlanRoutingNew();
-        // }
+          const list = [];
+          if (listMap[2]) list.push({ code: 2, name: 'MBOM' });
+          if (listMap[3]) list.push({ code: 3, name: 'ABOM' });
 
-        // this.getPlanRoutingNew();
+          if (!item.factoriesId) {
+            this.$set(productList[index], 'factoriesId', this.factoriesId);
+            this.$set(productList[index], 'factoriesName',
+              this.factoryList?.find((f) => f.id === this.factoriesId)?.name
+            );
+          }
+          this.$set(productList[index], 'producedList', list);
+        });
       },
 
       addEquipment() {
@@ -1380,7 +1342,7 @@
       },
       chooseSaleOrder(list) {
         const currentRow = list[0] || {};
-        this.$set(this.form, 'saleOrder', currentRow.code || '');
+        this.$set(this.form, 'saleOrder', currentRow.orderNo || '');
       },
       // 清空BOM 跟工艺路线
       wipeData(index) {
@@ -1476,75 +1438,113 @@
         });
         return flag;
       },
+
       save(type) {
         this.$refs.form.validate(async (valid) => {
-          if (!valid) {
-            return false;
-          }
-          let flag = this.parameterVerification();
-          // 必填参数校验
-          if (!flag) return;
-
-          this.form.productInfoList.forEach((item, index) => {
-            this.$set(
-              this.form.productInfoList[index],
-              'colorKey',
-              item.colorKey.toString()
-            );
-            this.$set(
-              this.form.productInfoList[index],
-              'modelKey',
-              item.modelKey.toString()
-            );
-          });
+          if (!valid) return;
+          if (!this.parameterVerification()) return;
 
-          // this.
-          if (!this.form.id) {
-            if (this.form.productInfoList.length) {
-              this.form.productInfoList.map((item, index) => {
-                delete item.selectionRowShow;
-                // if (item.bomVersionList && item.bomVersionList.length) {
-                //   item.bomCategoryName = item.bomVersionList[0].name;
-                //   item.bomCategoryVersions = item.bomVersionList[0].versions;
-                //   item.produceRoutingName = item.routingList[0].name;
-                // }
-              });
-            }
+          const isAdd = !this.form.id;
+
+          this.form.productInfoList.forEach((item) => {
+            item.colorKey = item.colorKey.toString();
+            item.modelKey = item.modelKey.toString();
+            if (isAdd) delete item.selectionRowShow;
+          });
 
+          if (isAdd) {
             this.form.timeDimensionPlanType = this.type;
-            // await this.getPlanCode();
-            this.loading = true;
-
-            let api = type == 'sub' ? saveAndRelease : temporaryPlanSave;
-            api(this.form)
-              .then((res) => {
-                this.$message.success('新增成功!');
-                this.visible = false;
-                this.initForm();
-                this.$emit('close', true);
-              })
-              .finally(() => {
-                this.loading = false;
-              });
-          } else {
-            this.loading = true;
-            let api = type == 'sub' ? saveAndRelease : temporaryPlanSave;
-
-            console.log(type, this.isReview, this.form, '请求数据');
-
-            api(this.form)
-              .then((res) => {
-                this.$message.success('修改成功!');
-                this.visible = false;
-                this.initForm();
-                this.$emit('close', true);
-              })
-              .finally(() => {
-                this.loading = false;
-              });
           }
+          if (this.isSaleOrder) {
+            this.form.salesCode = this.form.saleOrder.split(',');
+          }
+
+          this.loading = true;
+          const api = type === 'sub' ? saveAndRelease : temporaryPlanSave;
+          api(this.form)
+            .then(() => {
+              this.$message.success(isAdd ? '新增成功!' : '修改成功!');
+              this.visible = false;
+              this.initForm();
+              this.$emit('close', true);
+            })
+            .finally(() => {
+              this.loading = false;
+            });
         });
       },
+      // save(type) {
+      //   this.$refs.form.validate(async (valid) => {
+      //     if (!valid) {
+      //       return false;
+      //     }
+      //     let flag = this.parameterVerification();
+      //     // 必填参数校验
+      //     if (!flag) return;
+
+      //     this.form.productInfoList.forEach((item, index) => {
+      //       this.$set(
+      //         this.form.productInfoList[index],
+      //         'colorKey',
+      //         item.colorKey.toString()
+      //       );
+      //       this.$set(
+      //         this.form.productInfoList[index],
+      //         'modelKey',
+      //         item.modelKey.toString()
+      //       );
+      //     });
+
+      //     // this.
+      //     if (!this.form.id) {
+      //       if (this.form.productInfoList.length) {
+      //         this.form.productInfoList.map((item, index) => {
+      //           delete item.selectionRowShow;
+      //           // if (item.bomVersionList && item.bomVersionList.length) {
+      //           //   item.bomCategoryName = item.bomVersionList[0].name;
+      //           //   item.bomCategoryVersions = item.bomVersionList[0].versions;
+      //           //   item.produceRoutingName = item.routingList[0].name;
+      //           // }
+      //         });
+      //       }
+
+      //       this.form.timeDimensionPlanType = this.type;
+      //       if (this.isSaleOrder) {
+      //         this.form.saleOrder = this.form.saleOrder.split(',');
+      //       }
+      //       this.loading = true;
+
+      //       let api = type == 'sub' ? saveAndRelease : temporaryPlanSave;
+      //       api(this.form)
+      //         .then((res) => {
+      //           this.$message.success('新增成功!');
+      //           this.visible = false;
+      //           this.initForm();
+      //           this.$emit('close', true);
+      //         })
+      //         .finally(() => {
+      //           this.loading = false;
+      //         });
+      //     } else {
+      //       this.loading = true;
+      //       let api = type == 'sub' ? saveAndRelease : temporaryPlanSave;
+      //       if (this.isSaleOrder) {
+      //         this.form.saleOrder = this.form.saleOrder.split(',');
+      //       }
+
+      //       api(this.form)
+      //         .then((res) => {
+      //           this.$message.success('修改成功!');
+      //           this.visible = false;
+      //           this.initForm();
+      //           this.$emit('close', true);
+      //         })
+      //         .finally(() => {
+      //           this.loading = false;
+      //         });
+      //     }
+      //   });
+      // },
       bomListVersionFn(produceType, categoryId) {
         return new Promise((resolve, reject) => {
           let param = {