|
|
@@ -9,6 +9,7 @@
|
|
|
:activeName="activeName"
|
|
|
>
|
|
|
</productionPlan-search>
|
|
|
+
|
|
|
<el-tabs v-model="activeName" type="card">
|
|
|
<el-tab-pane label="未发布" name="first"></el-tab-pane>
|
|
|
<el-tab-pane label="已发布" name="second"></el-tab-pane>
|
|
|
@@ -22,12 +23,20 @@
|
|
|
:columns="newColumns"
|
|
|
:datasource="datasource"
|
|
|
height="calc(100vh - 335px)"
|
|
|
+ row-key="code"
|
|
|
+ :selection.sync="selection"
|
|
|
:cache-key="`${activeName}ProductionPlanTable`"
|
|
|
@sort-change="onSortChange"
|
|
|
>
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <el-button type="primary" size="mini" @click="handleMerge">合并计划</el-button>
|
|
|
+ </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>
|
|
|
|
|
|
@@ -97,18 +106,19 @@
|
|
|
</el-link>
|
|
|
|
|
|
<el-link
|
|
|
- type="primary"
|
|
|
- :underline="false"
|
|
|
- @click="toUnpack(row)"
|
|
|
- >
|
|
|
- 拆批
|
|
|
- </el-link>
|
|
|
+ v-if="clientEnvironmentId != 4 && activeName == 'first'"
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ @click="toUnpack(row)"
|
|
|
+ >
|
|
|
+ 拆批
|
|
|
+ </el-link>
|
|
|
|
|
|
<el-link
|
|
|
type="danger"
|
|
|
:underline="false"
|
|
|
@click="handleDelete(row)"
|
|
|
- icon="el-icon-delete"
|
|
|
+ icon="el-icon-delete"
|
|
|
>
|
|
|
删除
|
|
|
</el-link>
|
|
|
@@ -117,149 +127,160 @@
|
|
|
</el-card>
|
|
|
|
|
|
<unpackDialog ref="unpackRef" @success="reload" />
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getList, del, updatePriority } from '@/api/productionPlan/index.js';
|
|
|
-import productionPlanSearch from './components/productionPlan-search.vue';
|
|
|
-import unpackDialog from './components/unpackDialog.vue';
|
|
|
-import { release } from '@/api/productionPlan/order.js';
|
|
|
-
|
|
|
-import { getCode } from '@/api/codeManagement';
|
|
|
-
|
|
|
-import { fieldModel } from '@/api/saleOrder';
|
|
|
-
|
|
|
-import { debounce } from 'lodash';
|
|
|
-export default {
|
|
|
- components: {
|
|
|
- productionPlanSearch,
|
|
|
- unpackDialog
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- activeName: 'first',
|
|
|
-
|
|
|
- // 加载状态
|
|
|
- loading: false,
|
|
|
- pageType: 'add',
|
|
|
- dialogTitle: '',
|
|
|
- isBindPlan: false,
|
|
|
- statusOpt: {
|
|
|
- first: [
|
|
|
- { label: '所有状态', value: '3,2' },
|
|
|
- { label: '待发布', value: '2' },
|
|
|
- { label: '发布失败', value: '3' }
|
|
|
- ],
|
|
|
- second: [
|
|
|
- { label: '所有状态', value: '7,4,5,6' },
|
|
|
- { label: '待生产', value: '4' },
|
|
|
- { label: '生产中', value: '5' },
|
|
|
- { label: '已完成', value: '6' },
|
|
|
- { label: '已延期', value: '7' }
|
|
|
- ], change: [
|
|
|
- { label: '已变更', value: '9' },
|
|
|
-
|
|
|
- ]
|
|
|
- },
|
|
|
- planType: [
|
|
|
- { label: '所有计划类型', value: null },
|
|
|
- { label: '内销计划', value: '1' },
|
|
|
- { label: '外销计划', value: '2' },
|
|
|
- { label: '预制计划', value: '3' }
|
|
|
- ], newColumns: []
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {
|
|
|
- clientEnvironmentId() {
|
|
|
- return this.$store.state.user.info.clientEnvironmentId;
|
|
|
+ import { getList, del, updatePriority } from '@/api/productionPlan/index.js';
|
|
|
+ import productionPlanSearch from './components/productionPlan-search.vue';
|
|
|
+ import unpackDialog from './components/unpackDialog.vue';
|
|
|
+ import { release } from '@/api/productionPlan/order.js';
|
|
|
+
|
|
|
+ import { getCode } from '@/api/codeManagement';
|
|
|
+
|
|
|
+ import { fieldModel } from '@/api/saleOrder';
|
|
|
+
|
|
|
+ import { debounce } from 'lodash';
|
|
|
+ export default {
|
|
|
+ components: {
|
|
|
+ productionPlanSearch,
|
|
|
+ unpackDialog
|
|
|
},
|
|
|
- // 表格列配置
|
|
|
- columns() {
|
|
|
- const opt = {
|
|
|
- first: [
|
|
|
- // {
|
|
|
- // prop: 'deliveryTime',
|
|
|
- // label: '预测交货日期',
|
|
|
- // align: 'center',
|
|
|
- // showOverflowTooltip: true,
|
|
|
- // minWidth: 110
|
|
|
- // }
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ activeName: 'first',
|
|
|
+
|
|
|
+ // 加载状态
|
|
|
+ loading: false,
|
|
|
+ pageType: 'add',
|
|
|
+ dialogTitle: '',
|
|
|
+ isBindPlan: false,
|
|
|
+ statusOpt: {
|
|
|
+ first: [
|
|
|
+ { label: '所有状态', value: '3,2' },
|
|
|
+ { label: '待发布', value: '2' },
|
|
|
+ { label: '发布失败', value: '3' }
|
|
|
+ ],
|
|
|
+ second: [
|
|
|
+ { label: '所有状态', value: '7,4,5,6' },
|
|
|
+ { label: '待生产', value: '4' },
|
|
|
+ { label: '生产中', value: '5' },
|
|
|
+ { label: '已完成', value: '6' },
|
|
|
+ { label: '已延期', value: '7' }
|
|
|
+ ],
|
|
|
+ change: [{ label: '已变更', value: '9' }]
|
|
|
+ },
|
|
|
+ planType: [
|
|
|
+ { label: '所有计划类型', value: null },
|
|
|
+ { label: '内销计划', value: '1' },
|
|
|
+ { label: '外销计划', value: '2' },
|
|
|
+ { label: '预制计划', value: '3' }
|
|
|
],
|
|
|
- second: [
|
|
|
- // {
|
|
|
- // prop: 'formingTime',
|
|
|
- // label: '实际生产日期',
|
|
|
- // align: 'center',
|
|
|
- // showOverflowTooltip: true,
|
|
|
- // minWidth: 110
|
|
|
- // },
|
|
|
+ newColumns: [],
|
|
|
+
|
|
|
+ selection: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ clientEnvironmentId() {
|
|
|
+ return this.$store.state.user.info.clientEnvironmentId;
|
|
|
+ },
|
|
|
+ // 表格列配置
|
|
|
+ columns() {
|
|
|
+ const opt = {
|
|
|
+ first: [
|
|
|
+ // {
|
|
|
+ // prop: 'deliveryTime',
|
|
|
+ // label: '预测交货日期',
|
|
|
+ // align: 'center',
|
|
|
+ // showOverflowTooltip: true,
|
|
|
+ // minWidth: 110
|
|
|
+ // }
|
|
|
+ ],
|
|
|
+ second: [
|
|
|
+ // {
|
|
|
+ // prop: 'formingTime',
|
|
|
+ // label: '实际生产日期',
|
|
|
+ // align: 'center',
|
|
|
+ // showOverflowTooltip: true,
|
|
|
+ // minWidth: 110
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ prop: 'releaseTime',
|
|
|
+ label: '工单发布日期',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'planFormingTime',
|
|
|
+ label: '预测生产日期',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'deliveryTime',
|
|
|
+ label: '预测交货日期',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'formingTime',
|
|
|
+ label: '实际交货日期',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ change: []
|
|
|
+ };
|
|
|
+
|
|
|
+ return [
|
|
|
{
|
|
|
- prop: 'releaseTime',
|
|
|
- label: '工单发布日期',
|
|
|
+ width: 45,
|
|
|
+ type: 'selection',
|
|
|
+ columnKey: 'selection',
|
|
|
+ align: 'center',
|
|
|
+ selectable: (row, index) => {
|
|
|
+ return this.activeName == 'first' && row.splitBatch != 2 && !row.joinPlanCode;
|
|
|
+ },
|
|
|
+ reserveSelection: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
+
|
|
|
},
|
|
|
{
|
|
|
- prop: 'planFormingTime',
|
|
|
- label: '预测生产日期',
|
|
|
+ slot: 'code',
|
|
|
+ prop: 'code',
|
|
|
+ action: 'code',
|
|
|
+ label: '计划编号',
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
+ minWidth: 200
|
|
|
},
|
|
|
{
|
|
|
- prop: 'deliveryTime',
|
|
|
- label: '预测交货日期',
|
|
|
+ prop: 'productCode',
|
|
|
+ label: '产品编码',
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
+ minWidth: 140
|
|
|
},
|
|
|
{
|
|
|
- prop: 'formingTime',
|
|
|
- label: '实际交货日期',
|
|
|
+ prop: 'productName',
|
|
|
+ label: '产品名称',
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- }
|
|
|
- ],
|
|
|
- change:[]
|
|
|
- };
|
|
|
-
|
|
|
- return [
|
|
|
- {
|
|
|
- columnKey: 'index',
|
|
|
- label: '序号',
|
|
|
- type: 'index',
|
|
|
- width: 55,
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- fixed: 'left'
|
|
|
- },
|
|
|
- {
|
|
|
- slot: 'code',
|
|
|
- prop: 'code',
|
|
|
- action: 'code',
|
|
|
- label: '计划编号',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 180
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'productCode',
|
|
|
- label: '产品编码',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 140
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'productName',
|
|
|
- label: '产品名称',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 140
|
|
|
- },
|
|
|
+ minWidth: 140
|
|
|
+ },
|
|
|
|
|
|
{
|
|
|
prop: 'brandNo',
|
|
|
@@ -363,65 +384,66 @@ export default {
|
|
|
minWidth: 110
|
|
|
},
|
|
|
|
|
|
- ...opt[this.activeName],
|
|
|
+ ...opt[this.activeName],
|
|
|
|
|
|
- {
|
|
|
- prop: 'orderType',
|
|
|
- label: '计划类型',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- formatter: (row) => {
|
|
|
- const obj = this.planType.find((i) => i.value == row.planType);
|
|
|
- return obj && obj.label;
|
|
|
- }
|
|
|
- },{
|
|
|
- prop: 'version',
|
|
|
- label: '版本',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 80
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createTime',
|
|
|
- label: '创建时间',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'status',
|
|
|
- slot: 'status',
|
|
|
- label: '状态',
|
|
|
- align: 'center',
|
|
|
- formatter: (row) => {
|
|
|
- const obj = this.statusOpt[this.activeName].find(
|
|
|
- (i) => i.value == row.status
|
|
|
- );
|
|
|
- return obj && obj.label;
|
|
|
+ {
|
|
|
+ prop: 'orderType',
|
|
|
+ label: '计划类型',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ formatter: (row) => {
|
|
|
+ const obj = this.planType.find((i) => i.value == row.planType);
|
|
|
+ return obj && obj.label;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'version',
|
|
|
+ label: '版本',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 80
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '创建时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'status',
|
|
|
+ slot: 'status',
|
|
|
+ label: '状态',
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) => {
|
|
|
+ const obj = this.statusOpt[this.activeName].find(
|
|
|
+ (i) => i.value == row.status
|
|
|
+ );
|
|
|
+ return obj && obj.label;
|
|
|
+ }
|
|
|
}
|
|
|
- },
|
|
|
- // ...(this.activeName === 'second'
|
|
|
- // ? [
|
|
|
- // {
|
|
|
- // prop: 'releaseTime',
|
|
|
- // label: '发布时间',
|
|
|
- // align: 'center',
|
|
|
- // showOverflowTooltip: true,
|
|
|
- // minWidth: 110
|
|
|
- // }
|
|
|
- // ]
|
|
|
- // : []),
|
|
|
- ];
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
+ // ...(this.activeName === 'second'
|
|
|
+ // ? [
|
|
|
+ // {
|
|
|
+ // prop: 'releaseTime',
|
|
|
+ // label: '发布时间',
|
|
|
+ // align: 'center',
|
|
|
+ // showOverflowTooltip: true,
|
|
|
+ // minWidth: 110
|
|
|
+ // }
|
|
|
+ // ]
|
|
|
+ // : []),
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
this.getFieldModel();
|
|
|
},
|
|
|
- methods: {
|
|
|
- statusFormatter(status) {
|
|
|
- const obj = this.statusOpt[this.activeName].find(
|
|
|
- (i) => i.value == status
|
|
|
- );
|
|
|
+ methods: {
|
|
|
+ statusFormatter(status) {
|
|
|
+ const obj = this.statusOpt[this.activeName].find(
|
|
|
+ (i) => i.value == status
|
|
|
+ );
|
|
|
|
|
|
return obj && obj.label;
|
|
|
},
|
|
|
@@ -499,7 +521,7 @@ export default {
|
|
|
align: 'center',
|
|
|
resizable: false,
|
|
|
fixed: 'right',
|
|
|
- slot: 'action',
|
|
|
+ slot: 'action'
|
|
|
});
|
|
|
} else {
|
|
|
privateColumn = [];
|
|
|
@@ -537,11 +559,17 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- // 拆批
|
|
|
- toUnpack(row) {
|
|
|
+ // 拆批
|
|
|
+ toUnpack(row) {
|
|
|
+ if(!row.batchNo) {
|
|
|
+ return this.$message.error('请先填写批次号!')
|
|
|
+ }
|
|
|
this.$refs.unpackRef.open(row);
|
|
|
},
|
|
|
-
|
|
|
+ // 合并
|
|
|
+ handleMerge() {
|
|
|
+ console.log( this.selection)
|
|
|
+ },
|
|
|
|
|
|
handleDelete({ id }) {
|
|
|
this.$confirm('确定删除当前数据?', '提示')
|