|
|
@@ -29,14 +29,24 @@
|
|
|
@sort-change="onSortChange"
|
|
|
>
|
|
|
<template v-slot:toolbar>
|
|
|
- <el-button type="primary" size="mini" @click="handleMerge">合并计划</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="handleMerge"
|
|
|
+ >合并计划</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:batchNo="{ row }">
|
|
|
+ <el-link type="primary" :underline="false">
|
|
|
+ {{ row.batchNo }}
|
|
|
+ <el-tag type="success" size="mini" v-if="row.joinPlanCode"
|
|
|
+ >拆</el-tag
|
|
|
+ >
|
|
|
+ <el-tag type="danger" v-if="row.splitBatch == 2"> 和</el-tag>
|
|
|
+ </el-link>
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:code="{ row }">
|
|
|
<el-link type="primary" :underline="false" @click="goDetail(row)">
|
|
|
{{ row.code }}
|
|
|
- <el-tag type="success" size="mini" v-if="row.joinPlanCode">拆</el-tag>
|
|
|
- <el-tag type="danger" v-if="row.splitBatch == 2"> 和</el-tag>
|
|
|
</el-link>
|
|
|
</template>
|
|
|
|
|
|
@@ -127,6 +137,8 @@
|
|
|
</el-card>
|
|
|
|
|
|
<unpackDialog ref="unpackRef" @success="reload" />
|
|
|
+
|
|
|
+ <mergeDialog ref="mergeRef" @success="reload"></mergeDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -134,6 +146,7 @@
|
|
|
import { getList, del, updatePriority } from '@/api/productionPlan/index.js';
|
|
|
import productionPlanSearch from './components/productionPlan-search.vue';
|
|
|
import unpackDialog from './components/unpackDialog.vue';
|
|
|
+ import mergeDialog from './components/mergeDialog.vue';
|
|
|
import { release } from '@/api/productionPlan/order.js';
|
|
|
|
|
|
import { getCode } from '@/api/codeManagement';
|
|
|
@@ -144,7 +157,8 @@
|
|
|
export default {
|
|
|
components: {
|
|
|
productionPlanSearch,
|
|
|
- unpackDialog
|
|
|
+ unpackDialog,
|
|
|
+ mergeDialog
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -244,7 +258,11 @@
|
|
|
columnKey: 'selection',
|
|
|
align: 'center',
|
|
|
selectable: (row, index) => {
|
|
|
- return this.activeName == 'first' && row.splitBatch != 2 && !row.joinPlanCode;
|
|
|
+ return (
|
|
|
+ this.activeName == 'first' &&
|
|
|
+ row.splitBatch != 2 &&
|
|
|
+ !row.joinPlanCode
|
|
|
+ );
|
|
|
},
|
|
|
reserveSelection: true,
|
|
|
fixed: 'left'
|
|
|
@@ -255,8 +273,16 @@
|
|
|
type: 'index',
|
|
|
width: 55,
|
|
|
align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
|
|
|
+ {
|
|
|
+ slot: 'batchNo',
|
|
|
+ prop: 'batchNo',
|
|
|
+ label: '批次号',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 120,
|
|
|
+ showOverflowTooltip: true
|
|
|
},
|
|
|
{
|
|
|
slot: 'code',
|
|
|
@@ -265,7 +291,7 @@
|
|
|
label: '计划编号',
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true,
|
|
|
- minWidth: 200
|
|
|
+ minWidth: 160
|
|
|
},
|
|
|
{
|
|
|
prop: 'productCode',
|
|
|
@@ -288,13 +314,7 @@
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
- {
|
|
|
- prop: 'batchNo',
|
|
|
- label: '批号',
|
|
|
- align: 'center',
|
|
|
- minWidth: 100,
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
+
|
|
|
{
|
|
|
prop: 'specification',
|
|
|
label: '规格',
|
|
|
@@ -561,14 +581,32 @@
|
|
|
|
|
|
// 拆批
|
|
|
toUnpack(row) {
|
|
|
- if(!row.batchNo) {
|
|
|
- return this.$message.error('请先填写批次号!')
|
|
|
+ if (!row.batchNo) {
|
|
|
+ return this.$message.error('请先填写批次号!');
|
|
|
}
|
|
|
this.$refs.unpackRef.open(row);
|
|
|
},
|
|
|
// 合并
|
|
|
handleMerge() {
|
|
|
- console.log( this.selection)
|
|
|
+ if (this.selection.length <= 1) {
|
|
|
+ return this.$message.warning('请先勾选二个或多个计划!');
|
|
|
+ }
|
|
|
+ const productCode = this.selection[0].productCode;
|
|
|
+ const produceRoutingId = this.selection[0].produceRoutingId;
|
|
|
+
|
|
|
+ for (var i = 0; i < this.selection.length; i++) {
|
|
|
+ if (productCode != this.selection[i].productCode) {
|
|
|
+ return this.$message.warning('产品编码不一致!');
|
|
|
+ }
|
|
|
+
|
|
|
+ if (produceRoutingId != this.selection[i].produceRoutingId) {
|
|
|
+ return this.$message.warning('工艺路线不一致!');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$refs.mergeRef.open(this.selection);
|
|
|
+
|
|
|
+ console.log(this.selection);
|
|
|
},
|
|
|
|
|
|
handleDelete({ id }) {
|