|
@@ -90,6 +90,69 @@
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
</el-descriptions>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+ <headerTitle title="计划列表" class="mt20" v-if="isAutoGenerateSubPlans">
|
|
|
|
|
+ </headerTitle>
|
|
|
|
|
+
|
|
|
|
|
+ <ele-pro-table
|
|
|
|
|
+ ref="table2"
|
|
|
|
|
+ :needPage="false"
|
|
|
|
|
+ :columns="jsColumns"
|
|
|
|
|
+ :datasource="jhList"
|
|
|
|
|
+ tool-class="ele-toolbar-actions"
|
|
|
|
|
+ max-height="360px"
|
|
|
|
|
+ v-if="isAutoGenerateSubPlans"
|
|
|
|
|
+ >
|
|
|
|
|
+ <!-- <template v-slot:toolbar>
|
|
|
|
|
+ <div class="toolbar_box">
|
|
|
|
|
+ <el-button type="primary" size="mini" @click="handleAdd"
|
|
|
|
|
+ >新增</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template> -->
|
|
|
|
|
+ <template v-slot:produceRoutingName="{ row }">
|
|
|
|
|
+ <span>{{ row.produceRoutingName }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:startTime="{ row }">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ class="w100"
|
|
|
|
|
+ v-model="row.startTime"
|
|
|
|
|
+ type="datetime"
|
|
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
+ placeholder="开始时间"
|
|
|
|
|
+ @change="handleStartTimeChange(row)"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ ></el-date-picker>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:endTime="{ row }">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ class="w100"
|
|
|
|
|
+ v-model="row.endTime"
|
|
|
|
|
+ type="datetime"
|
|
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
+ @change="handleEndTimeChange(row)"
|
|
|
|
|
+ placeholder="完成时间"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ ></el-date-picker>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:requiredFormingNum="{ row }">
|
|
|
|
|
+ <span>{{ row.requiredFormingNum }} {{ row.measuringUnit }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:action="{ row, $index }">
|
|
|
|
|
+ <el-popconfirm
|
|
|
|
|
+ class="ele-action"
|
|
|
|
|
+ title="确定要删除这条数据吗?"
|
|
|
|
|
+ @confirm="removeRow(row, $index)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template v-slot:reference>
|
|
|
|
|
+ <el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </el-link>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-popconfirm>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </ele-pro-table>
|
|
|
|
|
+
|
|
|
<div slot="footer" class="footer">
|
|
<div slot="footer" class="footer">
|
|
|
<div>
|
|
<div>
|
|
|
<el-button @click="cancel">取消</el-button>
|
|
<el-button @click="cancel">取消</el-button>
|
|
@@ -112,6 +175,7 @@
|
|
|
import { getCode } from '@/api/codeManagement';
|
|
import { getCode } from '@/api/codeManagement';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
import { debounce } from 'lodash';
|
|
import { debounce } from 'lodash';
|
|
|
|
|
+ import { parameterGetByCode } from '@/api/mainData/index';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
mixins: [dictMixins],
|
|
@@ -123,12 +187,92 @@
|
|
|
return {
|
|
return {
|
|
|
visible: false,
|
|
visible: false,
|
|
|
loading: false,
|
|
loading: false,
|
|
|
- tableList: []
|
|
|
|
|
|
|
+ tableList: [],
|
|
|
|
|
+ isAutoGenerateSubPlans: false,
|
|
|
|
|
+ jhList: [],
|
|
|
|
|
+ jsColumns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ columnKey: 'index',
|
|
|
|
|
+ label: '序号',
|
|
|
|
|
+ type: 'index',
|
|
|
|
|
+ width: 55,
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'productCode',
|
|
|
|
|
+ label: '编码',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 140
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'productName',
|
|
|
|
|
+ label: '名称',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 140
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'brandNo',
|
|
|
|
|
+ label: '牌号',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'specification',
|
|
|
|
|
+ label: '规格',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 150,
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'model',
|
|
|
|
|
+ label: '型号',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ slot: 'startTime',
|
|
|
|
|
+ prop: 'startTime',
|
|
|
|
|
+ label: '计划开始时间',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 180
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ slot: 'endTime',
|
|
|
|
|
+ prop: 'endTime',
|
|
|
|
|
+ label: '计划完成时间',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 180
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'produceRoutingName',
|
|
|
|
|
+ slot: 'produceRoutingName',
|
|
|
|
|
+ label: '工艺路线',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 120
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'requiredFormingNum',
|
|
|
|
|
+ label: '要求生产数量',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ slot: 'requiredFormingNum',
|
|
|
|
|
+ width: 130
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // {
|
|
|
|
|
+ // columnKey: 'action',
|
|
|
|
|
+ // label: '操作',
|
|
|
|
|
+ // width: 90,
|
|
|
|
|
+ // align: 'center',
|
|
|
|
|
+ // fixed: 'right',
|
|
|
|
|
+ // slot: 'action'
|
|
|
|
|
+ // }
|
|
|
|
|
+ ]
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {},
|
|
computed: {},
|
|
|
created() {
|
|
created() {
|
|
|
this.requestDict('订单计划类型');
|
|
this.requestDict('订单计划类型');
|
|
|
|
|
+ this.getAutoGenerateSubPlans('auto_split_produce_plan');
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
open() {
|
|
open() {
|
|
@@ -136,11 +280,62 @@
|
|
|
if (this.type != 'edit') {
|
|
if (this.type != 'edit') {
|
|
|
this.getPlanCode();
|
|
this.getPlanCode();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (this.isAutoGenerateSubPlans) {
|
|
|
|
|
+ console.log(this.info, 'this.infothis.info');
|
|
|
|
|
+ this.getJHListData(this.info);
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
cancel() {
|
|
cancel() {
|
|
|
this.visible = false;
|
|
this.visible = false;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ async getAutoGenerateSubPlans(code) {
|
|
|
|
|
+ await parameterGetByCode({ code }).then((res) => {
|
|
|
|
|
+ this.isAutoGenerateSubPlans = res.value == '0' ? false : true;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ getJHListData(m) {
|
|
|
|
|
+ for (let i = 0; i < this.jhList.length; i++) {
|
|
|
|
|
+ let item = this.jhList[i];
|
|
|
|
|
+ if (item.id == m.id) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ let row = {};
|
|
|
|
|
+ // if (
|
|
|
|
|
+ // m.processRoute &&
|
|
|
|
|
+ // m.processRoute.list &&
|
|
|
|
|
+ // m.processRoute.list.length > 0
|
|
|
|
|
+ // ) {
|
|
|
|
|
+ // row = m.processRoute.list[0];
|
|
|
|
|
+ // }
|
|
|
|
|
+ // let _num =
|
|
|
|
|
+ // ((this.formData.requiredFormingNum || 0) / (this.baseCount || 0)) *
|
|
|
|
|
+ // m.dosage;
|
|
|
|
|
+ // _num = _num.toFixed(3);
|
|
|
|
|
+ // _num = this.formattedNum(_num);
|
|
|
|
|
+ let data = {
|
|
|
|
|
+ id: m.id,
|
|
|
|
|
+ categoryId: m.categoryId,
|
|
|
|
|
+ productCode: m.productCode,
|
|
|
|
|
+ productName: m.productName,
|
|
|
|
|
+ brandNo: m.brandNo,
|
|
|
|
|
+ specification: m.specification,
|
|
|
|
|
+ model: m.model,
|
|
|
|
|
+ produceRoutingName: m.produceRoutingName || '',
|
|
|
|
|
+ productUnitWeight: m.productUnitWeight,
|
|
|
|
|
+ requiredFormingNum: m.requiredFormingNum,
|
|
|
|
|
+ measuringUnit: m.measuringUnit,
|
|
|
|
|
+ startTime: m.startTime || '',
|
|
|
|
|
+ endTime: m.endTime || '',
|
|
|
|
|
+ unit: this.unit,
|
|
|
|
|
+ resourceType: 0
|
|
|
|
|
+ };
|
|
|
|
|
+ this.jhList.push(data);
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
async getPlanCode() {
|
|
async getPlanCode() {
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
try {
|
|
try {
|