|
|
@@ -1,6 +1,7 @@
|
|
|
<template>
|
|
|
<!-- :close-on-click-modal="false" -->
|
|
|
- <ele-modal width="80vw" :visible.sync="visible" custom-class="ele-dialog-form" :title="title" :maxable="true">
|
|
|
+ <ele-modal width="80vw" :visible.sync="visible" custom-class="ele-dialog-form" :before-close="cancel" :title="title"
|
|
|
+ :maxable="true">
|
|
|
|
|
|
<div class="form-wrapper">
|
|
|
|
|
|
@@ -92,7 +93,6 @@
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
-
|
|
|
<headerTitle title="产品信息"> </headerTitle>
|
|
|
|
|
|
<el-row :gutter="24">
|
|
|
@@ -133,7 +133,8 @@
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="24">
|
|
|
- <div v-if="clientEnvironmentId == 4">
|
|
|
+ <!-- clientEnvironmentId == 4 -->
|
|
|
+ <div v-if="false">
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="模数:" prop="requiredFormingNum">
|
|
|
<el-input v-model.number="form.moCount" @input="tableHandleKeyUp(form, 'moCount')" size="mini"
|
|
|
@@ -175,110 +176,120 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</div>
|
|
|
- <el-table :data="form.productInfoList" border height="40vh" key="id">
|
|
|
- <el-table-column label="序号" align="center" width="60">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.$index + 1 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="行号" align="center" prop="lineNumber">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="产品名称" align="center" prop="productName">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="物料编码" align="center" prop="productCode">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="牌号" align="center" prop="brandNo">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="型号" align="center" prop="model">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="规格" align="center" prop="specification">
|
|
|
- </el-table-column>
|
|
|
- <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="要求生产数量" width="140" align="center" prop="">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'requiredFormingNum.' + scope.$index + '.requiredFormingNum'" :rules="{
|
|
|
+ <!-- <ele-pro-table
|
|
|
+ ref="table"
|
|
|
+ :key="activeName"
|
|
|
+ :initLoad="false"
|
|
|
+ :columns="newColumns"
|
|
|
+ :datasource="datasource"
|
|
|
+ row-key="code"
|
|
|
+ :selection.sync="selection"
|
|
|
+ :cache-key="`${activeName}ProductionPlanTable`"
|
|
|
+ @sort-change="onSortChange"
|
|
|
+ autoAmendPage
|
|
|
+ :parse-data="parseData"
|
|
|
+ @update:selection="handleSelectionChange"
|
|
|
+ ></ele-pro-table> -->
|
|
|
+ <ele-pro-table ref="tableRef" :columns="columns" row-key="code" :cache-key="`ProductionPlanTable`"
|
|
|
+ :datasource="form.productInfoList" border height="40vh" key="id">
|
|
|
+
|
|
|
+
|
|
|
+ <template v-slot:requiredFormingNum="{ row, $index }">
|
|
|
+ <!-- :prop="'requiredFormingNum.' + scope.$index + '.requiredFormingNum'" :rules="{
|
|
|
required: true,
|
|
|
message: '请输入要求生产数量',
|
|
|
trigger: 'blur'
|
|
|
}" -->
|
|
|
|
|
|
- <el-form-item label-width="0px">
|
|
|
- <el-input v-model.number="scope.row.requiredFormingNum" size="small" type="number" style="width: 100%"
|
|
|
- placeholder="输入数量" @input="inputNumber(scope.row, scope.$index)"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
|
|
|
+ <el-input v-model.number="row.requiredFormingNum" size="small" type="number" style="width: 100%"
|
|
|
+ placeholder="输入数量" @input="tableHandleKeyUp(row, 'sum')"></el-input>
|
|
|
|
|
|
+ </template>
|
|
|
|
|
|
- <el-table-column label="加工方式" width="140" align="center" prop="productType">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-form-item label-width="0px" :prop="'productInfoList.' + scope.$index + '.productType'">
|
|
|
+ <template v-slot:blockCount="{ row, $index }">
|
|
|
|
|
|
- <el-select v-model="scope.row.productType" @change="changeProductType(scope.row, scope.$index)"
|
|
|
- :key="scope.$index">
|
|
|
- <el-option v-for="item of producedList" :key="scope.$index + item.code" :label="item.name"
|
|
|
- :value="item.code"></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-input v-model.number="row.blockCount" size="small" type="number" style="width: 100%"
|
|
|
+ placeholder="输入数量" @input="inputNumber(row, $index)"></el-input>
|
|
|
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ </template>
|
|
|
|
|
|
|
|
|
|
|
|
- <el-table-column label="BOM版本" width="140" align="center" prop="bomCategoryId"
|
|
|
- v-if="clientEnvironmentId != 4">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-form-item label-width="0px" :prop="'productInfoList.' + scope.$index + '.bomCategoryId'"
|
|
|
- :key="scope.$index">
|
|
|
+ <template v-slot:productType="{ row, $index }">
|
|
|
|
|
|
- <el-select v-model="scope.row.bomCategoryId" @change="changeBomId(scope.row, scope.$index)">
|
|
|
- <el-option v-for="item of scope.row.bomVersionList" :key="item.id"
|
|
|
- :label="item.name + '(V' + item.versions + '.0)'" :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-select v-model="row.productType" @change="changeProductType(row, $index)" :key="$index">
|
|
|
+ <el-option v-for="item of producedList" :key="$index + item.code" :label="item.name"
|
|
|
+ :value="item.code"></el-option>
|
|
|
+ </el-select>
|
|
|
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ </template>
|
|
|
|
|
|
- <el-table-column label="工艺路线" width="140" align="center" prop="produceRoutingId"
|
|
|
- v-if="clientEnvironmentId != 4">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-form-item label-width="0px" :prop="'productInfoList.' + scope.$index + '.produceRoutingId'">
|
|
|
- <el-select v-model="scope.row.produceRoutingId">
|
|
|
- <el-option v-for="item of scope.row.routingList" :key="item.id" :label="item.name"
|
|
|
- :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
|
|
|
- <el-table-column label="工艺路线" align="center" prop="produceRoutingName" v-if="clientEnvironmentId == 4">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-form-item label-width="0px" :prop="'productInfoList.' + scope.$index + '.produceRoutingName'">
|
|
|
- <el-input v-model="form.produceRoutingName" style="width: 100%" readonly></el-input>
|
|
|
+ <template v-slot:bomCategoryId="{ row, $index }" >
|
|
|
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <el-select v-model="row.bomCategoryId" @change="changeBomId(row, $index)">
|
|
|
+ <el-option v-for="item of row.bomVersionList" :key="item.id"
|
|
|
+ :label="item.name + '(V' + item.versions + '.0)'" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
|
|
|
- <!-- <el-table-column label="所属工厂" width="140" align="center" prop="factoriesId">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-form-item label-width="0px">
|
|
|
|
|
|
- <el-select v-model="scope.row.factoriesId" :key="scope.row.factoriesId">
|
|
|
- <el-option v-for="item of factoryList" :key="item.id" :label="item.name"
|
|
|
- :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- //权重等级 -->
|
|
|
+ <template v-slot:weight="{ row, $index }" v-if="clientEnvironmentId == 4">
|
|
|
+
|
|
|
+ <el-select v-model="row.weight" style="width: 100%" @change="changeProduceType" size="mini">
|
|
|
+ <el-option v-for="item of weightList" :key="item.code" :label="item.name"
|
|
|
+ :value="item.code"></el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- 是否开槽 -->
|
|
|
+ <template v-slot:isSlotting="{ row, $index }" v-if="clientEnvironmentId == 4">
|
|
|
+
|
|
|
+ <el-select v-model="row.isSlotting" style="width: 100%" @change="changeProduceType" size="mini">
|
|
|
+ <el-option v-for="item of isSlotting" :key="item.code" :label="item.name"
|
|
|
+ :value="item.code"></el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ </template>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 开槽类型 -->
|
|
|
+ <template v-slot:slottingType="{ row, $index }" v-if="clientEnvironmentId == 4">
|
|
|
+
|
|
|
+ <DictSelection dictName="开槽类型" v-model="row.slottingType" size="mini">
|
|
|
+ </DictSelection>
|
|
|
+
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- 工艺路线 -->
|
|
|
+ <template v-slot:produceRoutingId="{ row, $index }" v-if="clientEnvironmentId != 4">
|
|
|
+ <el-select v-model="row.produceRoutingId">
|
|
|
+ <el-option v-for="item of row.routingList" :key="item.id" :label="item.name"
|
|
|
+ :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:produceRoutingId="{ row, $index }" v-else>
|
|
|
+ <el-input v-model="row.produceRoutingName" style="width: 100%" readonly></el-input>
|
|
|
+ </template>
|
|
|
+
|
|
|
+
|
|
|
+ <template v-slot:factoriesId="{ row, $index }">
|
|
|
+
|
|
|
+ <el-select v-model="row.factoriesId" :key="row.factoriesId">
|
|
|
+ <el-option v-for="item of factoryList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ </template>
|
|
|
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
|
|
|
<!-- <el-table-column label="所属工厂" width="140" align="center" prop="factoriesId">
|
|
|
<template slot-scope="scope">
|
|
|
@@ -294,52 +305,40 @@
|
|
|
</el-table-column> -->
|
|
|
|
|
|
|
|
|
+ <!-- 模具数量 -->
|
|
|
+ <template v-slot:moCount="{ row, $index }" v-if="clientEnvironmentId == '4'">
|
|
|
+ <div>
|
|
|
+ <el-input style="width: 100%" size="small" v-model="row.moCount"
|
|
|
+ oninput="value=value.replace(/[^0-9.]/g,'')" @input="
|
|
|
+ tableHandleKeyUp(row, 'moCount')
|
|
|
+ " placeholder="请输入">
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
|
|
|
+ <!-- 块数 -->
|
|
|
+ <template v-slot:blockCount="{ row, $index }" v-if="clientEnvironmentId == '4'">
|
|
|
+ <div>
|
|
|
+ <el-input size="small" style="width: 100%" @input="tableHandleKeyUp(row, 'blockCount')
|
|
|
|
|
|
- <el-table-column label="计量单位" align="center" prop="measuringUnit">
|
|
|
+ " v-model="row.blockCount" placeholder="请输入"></el-input>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="模数" align="center" width="100" v-if="clientEnvironmentId == '4'">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- <el-input style="width: 100%" size="small" v-model="scope.row.moCount"
|
|
|
- oninput="value=value.replace(/[^0-9.]/g,'')" @input="
|
|
|
- tableHandleKeyUp(scope.row, scope.$index, $event, 'moCount')
|
|
|
- " placeholder="请输入">
|
|
|
- </el-input>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
|
|
|
- <el-table-column align="center" width="100" label="块数" v-if="clientEnvironmentId == '4'">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- <el-input size="small" style="width: 100%" @input="
|
|
|
- tableHandleKeyUp(
|
|
|
- scope.row,
|
|
|
- scope.$index,
|
|
|
- $event,
|
|
|
- 'blockCount'
|
|
|
- )
|
|
|
- " v-model="scope.row.blockCount" placeholder="请输入"></el-input>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="订单重量" align="center" prop="productWeight">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <span>{{ row.productWeight ? row.productWeight : '-' }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column label="操作" align="center" width="70">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-link type="primary" :underline="false" @click="homogeneityInspect(scope.row)">
|
|
|
- 齐套性检查
|
|
|
- </el-link>
|
|
|
- <el-button type="text" @click="handleDeleteItem(scope.$index)" v-if="!scope.row.id">删除</el-button>
|
|
|
- </template>
|
|
|
+ <template v-slot:productWeight="{ row, $index }">
|
|
|
+ <span>{{ row.productWeight ? row.productWeight : '-' }}</span>
|
|
|
+ </template>
|
|
|
|
|
|
- </el-table-column> -->
|
|
|
- </el-table>
|
|
|
+
|
|
|
+ <template v-slot:set="{ row, $index }">
|
|
|
+
|
|
|
+ <el-button type="text" @click="handleDeleteItem($index)" v-if="!row.id">删除</el-button>
|
|
|
+
|
|
|
+ </template>
|
|
|
+
|
|
|
+
|
|
|
+ </ele-pro-table>
|
|
|
<div class="add-product" @click="addEquipment">
|
|
|
<i class="el-icon-circle-plus-outline"></i>
|
|
|
</div>
|
|
|
@@ -400,7 +399,7 @@ export default {
|
|
|
this.title = !val.id ? '新增临时生产计划' : '编辑临时生产计划';
|
|
|
// this.form = this.factoryObj;
|
|
|
|
|
|
- // this.getFactoryList();
|
|
|
+ this.getFactoryList();
|
|
|
|
|
|
this.form = val;
|
|
|
// 修改
|
|
|
@@ -421,6 +420,199 @@ export default {
|
|
|
clientEnvironmentId() {
|
|
|
return this.$store.state.user.info.clientEnvironmentId;
|
|
|
},
|
|
|
+ columns() {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ slot: 'lineNumber',
|
|
|
+ prop: 'lineNumber',
|
|
|
+ label: '行号',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'productName',
|
|
|
+ prop: 'productName',
|
|
|
+ label: '产品名称',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'productCode',
|
|
|
+ prop: 'productCode',
|
|
|
+ label: '物料编码',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'brandNo',
|
|
|
+ prop: 'brandNo',
|
|
|
+ label: '牌号',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'model',
|
|
|
+ prop: 'model',
|
|
|
+ label: '型号',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'specification',
|
|
|
+ prop: 'specification',
|
|
|
+ label: '规格',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'productUnitWeight',
|
|
|
+ prop: 'productUnitWeight',
|
|
|
+ label: '单重',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'weightUnit',
|
|
|
+ prop: 'weightUnit',
|
|
|
+ label: '重量单位',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ slot: 'requiredFormingNum',
|
|
|
+ prop: 'requiredFormingNum',
|
|
|
+ label: '要求生产数量',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'productType',
|
|
|
+ prop: 'productType',
|
|
|
+ label: '加工方式',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'bomCategoryId',
|
|
|
+ prop: 'bomCategoryId',
|
|
|
+ label: 'BOM版本',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+ show: this.clientEnvironmentId !== 4
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'produceRoutingId',
|
|
|
+ prop: 'produceRoutingId',
|
|
|
+ label: '工艺路线',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'measuringUnit',
|
|
|
+ prop: 'measuringUnit',
|
|
|
+ label: '计量单位',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'moCount',
|
|
|
+ prop: 'moCount',
|
|
|
+ label: '模数',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+ show: this.clientEnvironmentId == 4
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'blockCount',
|
|
|
+ prop: 'blockCount',
|
|
|
+ label: '块数',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+ show: this.clientEnvironmentId == 4
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'factoriesId',
|
|
|
+ prop: 'factoriesId',
|
|
|
+ label: '所属工厂',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ slot: 'weight',
|
|
|
+ prop: 'weight',
|
|
|
+ label: '权重等级',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+ show: this.clientEnvironmentId == 4
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'isSlotting',
|
|
|
+ prop: 'isSlotting',
|
|
|
+ label: '是否开槽',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+ show: this.clientEnvironmentId == 4
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'slottingType',
|
|
|
+ prop: 'slottingType',
|
|
|
+ label: '开槽类型',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+ show: this.clientEnvironmentId == 4
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ slot: 'productWeight',
|
|
|
+ prop: 'productWeight',
|
|
|
+ label: '订单重量',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'set',
|
|
|
+ prop: 'set',
|
|
|
+ label: '操作',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 140,
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -444,6 +636,10 @@ export default {
|
|
|
{ label: '改型计划', value: '4' },
|
|
|
{ label: '返工返修计划', value: '5' },
|
|
|
],
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
loading: false,
|
|
|
form: {
|
|
|
timeDimensionPlanType: 3,
|
|
|
@@ -500,12 +696,13 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
|
|
|
- computed: {
|
|
|
- clientEnvironmentId() {
|
|
|
- return this.$store.state.user.info.clientEnvironmentId;
|
|
|
- }
|
|
|
- },
|
|
|
+ // computed: {
|
|
|
+ // clientEnvironmentId() {
|
|
|
+ // return this.$store.state.user.info.clientEnvironmentId;
|
|
|
+ // }
|
|
|
+ // },
|
|
|
methods: {
|
|
|
+
|
|
|
async getFactoryList() {
|
|
|
this.factoryList = await getFactoryList();
|
|
|
},
|
|
|
@@ -528,28 +725,25 @@ export default {
|
|
|
},
|
|
|
|
|
|
confirmChoose(list) {
|
|
|
+
|
|
|
if (this.clientEnvironmentId == 4) {
|
|
|
- let data = {};
|
|
|
- if (list[0].name.includes('板材')) {
|
|
|
-
|
|
|
- data = {
|
|
|
- id: '1856970794952372226',
|
|
|
- name: '板材',
|
|
|
- produceVersionName: '板材'
|
|
|
- };
|
|
|
- } else {
|
|
|
- data = {
|
|
|
- id: '1857313733642596353',
|
|
|
- name: '砌块',
|
|
|
- produceVersionName: '砌块'
|
|
|
- };
|
|
|
- }
|
|
|
- this.$set(this.form, 'produceRoutingName', data.name);
|
|
|
- this.$set(this.form, 'produceRoutingId', data.id);
|
|
|
- this.$set(this.form, 'produceVersionName', data.produceVersionName);
|
|
|
- }
|
|
|
+ list.map(v => {
|
|
|
+
|
|
|
+ if (v.name.includes('板材')) {
|
|
|
+
|
|
|
+ v.produceRoutingId = '1856970794952372226';
|
|
|
+ v.produceRoutingName = '板材';
|
|
|
+ v.produceVersionName = '板材';
|
|
|
+ } else {
|
|
|
+ v.produceRoutingId = '1857313733642596353',
|
|
|
+ v.produceRoutingName = '砌块',
|
|
|
+ v.produceVersionName = '砌块'
|
|
|
|
|
|
- console.log('list', list);
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
list = list.filter(
|
|
|
@@ -559,7 +753,7 @@ export default {
|
|
|
)
|
|
|
)
|
|
|
.map((item, index) => {
|
|
|
-
|
|
|
+ console.log(item, '555555555555');
|
|
|
if (item.productCode) {
|
|
|
return item;
|
|
|
} else {
|
|
|
@@ -572,17 +766,20 @@ export default {
|
|
|
model: item.modelType,
|
|
|
specification: item.specification,
|
|
|
brandNo: item.brandNum,
|
|
|
- measuringUnit: item.measuringUnit
|
|
|
+ measuringUnit: item.measuringUnit,
|
|
|
+ produceRoutingId: item.produceRoutingId,
|
|
|
+ produceRoutingName: item.produceRoutingName,
|
|
|
+ produceVersionName: item.produceVersionName
|
|
|
};
|
|
|
}
|
|
|
})
|
|
|
.concat(this.disabledList);
|
|
|
+
|
|
|
this.form.productInfoList = [];
|
|
|
|
|
|
- console.log('list', list);
|
|
|
- console.log('this.form.productInfoList', this.form);
|
|
|
|
|
|
- // 取出在弹窗中选中并且不在表格中的数据
|
|
|
+ console.log(list, 'list');
|
|
|
+ // 取出在弹窗中选中并且不在表格中的数据
|
|
|
const result = list.filter(
|
|
|
(i) =>
|
|
|
this.form.productInfoList.findIndex(
|
|
|
@@ -597,10 +794,6 @@ export default {
|
|
|
|
|
|
for (let i = this.form.productInfoList.length - 1; i >= 0; i--) {
|
|
|
for (let j in del) {
|
|
|
- console.log(
|
|
|
- this.form.productInfoList[i].productCode,
|
|
|
- del[j].productCode
|
|
|
- );
|
|
|
if (this.form.productInfoList[i].productCode === del[j].productCode) {
|
|
|
this.form.productInfoList.splice(i, 1);
|
|
|
break;
|
|
|
@@ -608,23 +801,27 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
// bomVersionList
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
this.form.productInfoList = this.form.productInfoList.concat(result);
|
|
|
|
|
|
- console.log(this.form.productInfoList, '11111111111111');
|
|
|
+ console.log(this.form.productInfoList, '1111111111');
|
|
|
|
|
|
+ this.$refs.tableRef.setData(this.form.productInfoList);
|
|
|
|
|
|
this.changeLineNumber();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- this.$set(this.form, 'categoryId', list[0].id);
|
|
|
- this.$set(this.form, 'productName', list[0].name);
|
|
|
- this.$set(this.form, 'productCode', list[0].code);
|
|
|
- this.$set(this.form, 'specification', list[0].specification);
|
|
|
- this.$set(this.form, 'brandNum', list[0].brandNum);
|
|
|
- this.$set(this.form, 'modelType', list[0].modelType);
|
|
|
- this.$set(this.form, 'measuringUnit', list[0].measuringUnit);
|
|
|
+ // this.$set(this.form, 'categoryId', list[0].id);
|
|
|
+ // this.$set(this.form, 'productName', list[0].name);
|
|
|
+ // this.$set(this.form, 'productCode', list[0].code);
|
|
|
+ // this.$set(this.form, 'specification', list[0].specification);
|
|
|
+ // this.$set(this.form, 'brandNum', list[0].brandNum);
|
|
|
+ // this.$set(this.form, 'modelType', list[0].modelType);
|
|
|
+ // this.$set(this.form, 'measuringUnit', list[0].measuringUnit);
|
|
|
|
|
|
//重置
|
|
|
this.$set(this.form, 'produceType', '');
|
|
|
@@ -642,7 +839,16 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
handleDeleteItem(index) {
|
|
|
- this.form.salesOrders.splice(index, 1);
|
|
|
+ this.$confirm('确定删除当前数据?', '提示')
|
|
|
+ .then(() => {
|
|
|
+
|
|
|
+ const newArray = this.form.productInfoList.filter((item, i) => i !== index)
|
|
|
+
|
|
|
+ this.$refs.tableRef.setData(newArray);
|
|
|
+
|
|
|
+ })
|
|
|
+ .catch(() => { });
|
|
|
+
|
|
|
},
|
|
|
|
|
|
async getPlanCode() {
|
|
|
@@ -686,6 +892,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
changeProductType(row, index) {
|
|
|
+ console.log(row, '11111');
|
|
|
let param = {
|
|
|
bomType: row.productType,
|
|
|
categoryId: row.categoryId
|
|
|
@@ -696,7 +903,10 @@ export default {
|
|
|
row.bomCategoryId = '';
|
|
|
}
|
|
|
console.log(arr);
|
|
|
- this.$set(this.form.productInfoList[index], 'bomVersionList', arr);
|
|
|
+
|
|
|
+ row.bomVersionList = arr;
|
|
|
+ // this.$set(this.form.productInfoList[index], 'bomVersionList', arr);
|
|
|
+
|
|
|
this.$forceUpdate()
|
|
|
})
|
|
|
|
|
|
@@ -705,18 +915,25 @@ export default {
|
|
|
save() {
|
|
|
|
|
|
this.$refs.form.validate(async (valid) => {
|
|
|
- console.log(this.$refs.form, 'validvalid', valid);
|
|
|
+ console.log(this.form, 'validvalid', valid);
|
|
|
if (!valid) {
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
if (!this.form.id) {
|
|
|
- this.form.productInfoList.map((item, index) => {
|
|
|
- item.bomCategoryName = item.bomVersionList[0].name;
|
|
|
- item.bomCategoryVersions = item.bomVersionList[0].versions;
|
|
|
- item.produceRoutingName = item.routingList[0].name;
|
|
|
- });
|
|
|
+
|
|
|
+ if (this.form.productInfoList.length) {
|
|
|
+ this.form.productInfoList.map((item, index) => {
|
|
|
+ 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;
|
|
|
await this.getPlanCode();
|
|
|
this.loading = true;
|
|
|
@@ -779,18 +996,23 @@ export default {
|
|
|
tableHandleKeyUp(row, name) {
|
|
|
// return
|
|
|
// , index, e, name
|
|
|
- if (this.form.specification && this.clientEnvironmentId == 4) {
|
|
|
|
|
|
- let modelArr = this.form.specification.split('*');
|
|
|
+ console.log(row, name, '99999999999');
|
|
|
+
|
|
|
+ if (row.specification && this.clientEnvironmentId == 4) {
|
|
|
+
|
|
|
+ let modelArr = row.specification.split('*');
|
|
|
let modelLong = modelArr[0]; // model规格长度
|
|
|
let modeWide = modelArr[1]; // model规格宽度
|
|
|
let modeHight = modelArr[2].substr(0, modelArr[2].indexOf('cm')); // model规格高度
|
|
|
modeHight = Number(modeHight);
|
|
|
|
|
|
+
|
|
|
+ console.log(modeHight, '111111');
|
|
|
if (name === 'moCount') {
|
|
|
// 模数
|
|
|
|
|
|
- this.$set(this.form, 'moCount', row.moCount);
|
|
|
+ this.$set(row, 'moCount', row.moCount);
|
|
|
// 计算块数的公式:
|
|
|
// (一模6米长度 / model规格长度) * (一模1.2米宽度 / model规格宽度) = 每一模的块数
|
|
|
// 每一模的块数*模数moCount = 总块数
|
|
|
@@ -803,11 +1025,14 @@ export default {
|
|
|
Math.floor(60 / modeWide) *
|
|
|
row.moCount;
|
|
|
|
|
|
- this.$set(this.form, 'blockCount', blockCount);
|
|
|
+
|
|
|
+
|
|
|
+ row.blockCount = blockCount;
|
|
|
+ // this.$set(row, 'blockCount', blockCount);
|
|
|
|
|
|
|
|
|
} else if (row.productName.includes('砌块')) {
|
|
|
- console.log(1);
|
|
|
+
|
|
|
|
|
|
let modelLongFixed = (600 / modelLong).toFixed(2);
|
|
|
modelLongFixed = modelLongFixed.substring(
|
|
|
@@ -827,33 +1052,30 @@ export default {
|
|
|
let num =
|
|
|
Math.floor(modelLongFixed * modeWideFixed * modeHightFixed) *
|
|
|
row.moCount;
|
|
|
-
|
|
|
- this.$set(this.form, 'blockCount', num);
|
|
|
+ row['blockCount'] = num;
|
|
|
}
|
|
|
|
|
|
let numNew =
|
|
|
(Number((modelLong * modeWide * modeHight) / 1000000).toFixed(5) *
|
|
|
row.blockCount).toFixed(5);
|
|
|
-
|
|
|
-
|
|
|
- this.$set(this.form, 'requiredFormingNum', numNew);
|
|
|
+ row['requiredFormingNum'] = numNew;
|
|
|
|
|
|
} else if (name === 'sum') {
|
|
|
- let e = this.form.requiredFormingNum
|
|
|
+ let e = row.requiredFormingNum
|
|
|
console.log('方数');
|
|
|
|
|
|
//方数
|
|
|
- this.form.planProductNum = e;
|
|
|
+ row.planProductNum = e;
|
|
|
|
|
|
- this.form.blockCount = Math.floor(
|
|
|
+ row.blockCount = Math.floor(
|
|
|
e / ((modelLong * modeWide * modeHight) / 1000000)
|
|
|
);
|
|
|
|
|
|
- if (this.form.productName.includes('板材')) {
|
|
|
+ if (row.productName.includes('板材')) {
|
|
|
|
|
|
|
|
|
let num = Math.ceil(
|
|
|
- this.form.blockCount /
|
|
|
+ row.blockCount /
|
|
|
(Math.floor(600 / modelLong) *
|
|
|
Math.floor(120 / modeHight) *
|
|
|
Math.floor(60 / modeWide))
|
|
|
@@ -875,7 +1097,7 @@ export default {
|
|
|
//块数
|
|
|
// row.blockCount = row.moCount;
|
|
|
|
|
|
- this.$set(this.form, 'blockCount', row.blockCount);
|
|
|
+ row.blockCount = row.blockCount
|
|
|
|
|
|
if (row.productName.includes('板材')) {
|
|
|
|
|
|
@@ -900,8 +1122,7 @@ export default {
|
|
|
let a =
|
|
|
((Number(this.form.blockCount) * modelLong * modeWide * modeHight) / 1000000).toFixed(5);
|
|
|
|
|
|
-
|
|
|
- this.$set(this.form, 'requiredFormingNum', a);
|
|
|
+ row.requiredFormingNum = a;
|
|
|
|
|
|
}
|
|
|
}
|