|
|
@@ -1,28 +1,17 @@
|
|
|
<template>
|
|
|
<div class="ele-body">
|
|
|
<el-card shadow="never" v-loading="loading">
|
|
|
- <produceOrder-search
|
|
|
- @search="reload"
|
|
|
- ref="searchRef"
|
|
|
- :statusOpt="statusOpt"
|
|
|
- :planType="planType"
|
|
|
- :activeName="activeName"
|
|
|
- >
|
|
|
+ <produceOrder-search @search="reload" ref="searchRef" :statusOpt="statusOpt" :planType="planType"
|
|
|
+ :activeName="activeName">
|
|
|
</produceOrder-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>
|
|
|
</el-tabs>
|
|
|
<!-- 数据表格 -->
|
|
|
- <ele-pro-table
|
|
|
- ref="table"
|
|
|
- :key="activeName"
|
|
|
- :initLoad="false"
|
|
|
- :columns="columns"
|
|
|
- :datasource="datasource"
|
|
|
- :cache-key="`${activeName}produceOrderTable`"
|
|
|
- :selection.sync="selection"
|
|
|
- >
|
|
|
+ <ele-pro-table ref="table" :key="activeName" :initLoad="false" :columns="columns" :datasource="datasource" row-key="code"
|
|
|
+ :cache-key="`${activeName}produceOrderTable`" :selection.sync="selection" :parse-data="parseData">
|
|
|
+
|
|
|
<template v-slot:toolbar>
|
|
|
<el-button type="success">新建</el-button>
|
|
|
<el-button type="success">暂停</el-button>
|
|
|
@@ -35,6 +24,12 @@
|
|
|
<!-- <el-button type="success" @click="handleCreate">创建工单</el-button> -->
|
|
|
<!-- <el-button type="success">工单操作控制</el-button> -->
|
|
|
</template>
|
|
|
+
|
|
|
+
|
|
|
+ <template v-slot:index="{ row }">
|
|
|
+ <el-tag>{{ row.isSplit == '' }}</el-tag>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template v-slot:code="{ row }">
|
|
|
<el-link type="primary" :underline="false" @click="goDetail(row)">
|
|
|
{{ row.code }}
|
|
|
@@ -49,40 +44,17 @@
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
|
<template v-if="activeName == 'second'">
|
|
|
- <el-link
|
|
|
- type="primary"
|
|
|
- :underline="false"
|
|
|
- icon="el-icon-truck"
|
|
|
- v-if="row.status == 6"
|
|
|
- @click="toCancel(row)"
|
|
|
- >
|
|
|
+ <el-link type="primary" :underline="false" icon="el-icon-truck" v-if="row.status == 6" @click="toCancel(row)">
|
|
|
取消完结
|
|
|
- </el-link></template
|
|
|
- >
|
|
|
+ </el-link></template>
|
|
|
<template v-else>
|
|
|
- <el-link
|
|
|
- type="primary"
|
|
|
- :underline="false"
|
|
|
- icon="el-icon-truck"
|
|
|
- @click="handleOrderPublish(1, row)"
|
|
|
- >
|
|
|
+ <el-link type="primary" :underline="false" icon="el-icon-truck" @click="handleOrderPublish(1, row)">
|
|
|
报工
|
|
|
</el-link>
|
|
|
- <el-link
|
|
|
- type="primary"
|
|
|
- v-if="row.status == 4"
|
|
|
- :underline="false"
|
|
|
- icon="el-icon-truck"
|
|
|
- @click="toUnpack(row)"
|
|
|
- >
|
|
|
+ <el-link type="primary" v-if="row.status == 4" :underline="false" icon="el-icon-truck" @click="toUnpack(row)">
|
|
|
拆分
|
|
|
</el-link>
|
|
|
- <el-link
|
|
|
- type="primary"
|
|
|
- :underline="false"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="toEnd(row)"
|
|
|
- >
|
|
|
+ <el-link type="primary" :underline="false" icon="el-icon-edit" @click="toEnd(row)">
|
|
|
完结
|
|
|
</el-link>
|
|
|
</template>
|
|
|
@@ -96,361 +68,394 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {
|
|
|
- getPage,
|
|
|
- batchCompletion,
|
|
|
- cancelCompletion
|
|
|
- } from '@/api/produceOrder/index.js';
|
|
|
- import produceOrderSearch from './components/produceOrder-search.vue';
|
|
|
- import createDialog from './components/createDialog.vue';
|
|
|
- import unpackDialog from './components/unpackDialog.vue';
|
|
|
- import pickingDialog from './components/pickingDialog.vue';
|
|
|
- import { positiveIntegerReg } from 'ele-admin';
|
|
|
- export default {
|
|
|
- components: {
|
|
|
- produceOrderSearch,
|
|
|
- pickingDialog,
|
|
|
- createDialog,
|
|
|
- unpackDialog
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- activeName: 'first',
|
|
|
+import {
|
|
|
+ getPage,
|
|
|
+ batchCompletion,
|
|
|
+ cancelCompletion
|
|
|
+} from '@/api/produceOrder/index.js';
|
|
|
+import produceOrderSearch from './components/produceOrder-search.vue';
|
|
|
+import createDialog from './components/createDialog.vue';
|
|
|
+import unpackDialog from './components/unpackDialog.vue';
|
|
|
+import pickingDialog from './components/pickingDialog.vue';
|
|
|
+import { positiveIntegerReg } from 'ele-admin';
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ produceOrderSearch,
|
|
|
+ pickingDialog,
|
|
|
+ createDialog,
|
|
|
+ unpackDialog
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ activeName: 'first',
|
|
|
|
|
|
- // 加载状态
|
|
|
- loading: false,
|
|
|
- pageType: 'add',
|
|
|
- dialogTitle: '',
|
|
|
- isBindPlan: false,
|
|
|
- statusOpt: {
|
|
|
- first: [
|
|
|
- { label: '所有状态', value: '5,4' },
|
|
|
- { label: '待生产', value: '4' },
|
|
|
- { label: '生产中', value: '5' }
|
|
|
- // { label: '已延期', value: '7' }
|
|
|
- ],
|
|
|
- second: [{ label: '已完成', value: '6' }]
|
|
|
- },
|
|
|
- planType: [
|
|
|
- { label: '所有计划类型', value: null },
|
|
|
- { label: '内销计划', value: '1' },
|
|
|
- { label: '外销计划', value: '2' },
|
|
|
- { label: '预制计划', value: '3' }
|
|
|
+ // 加载状态
|
|
|
+ loading: false,
|
|
|
+ pageType: 'add',
|
|
|
+ dialogTitle: '',
|
|
|
+ isBindPlan: false,
|
|
|
+ statusOpt: {
|
|
|
+ first: [
|
|
|
+ { label: '所有状态', value: '5,4' },
|
|
|
+ { label: '待生产', value: '4' },
|
|
|
+ { label: '生产中', value: '5' }
|
|
|
+ // { label: '已延期', value: '7' }
|
|
|
],
|
|
|
- selection: []
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {
|
|
|
- // 表格列配置
|
|
|
- columns() {
|
|
|
- const opt = {
|
|
|
- first: [
|
|
|
- // {
|
|
|
- // prop: 'deliveryTime',
|
|
|
- // label: '预测交货日期',
|
|
|
- // align: 'center',
|
|
|
- // showOverflowTooltip: true,
|
|
|
- // minWidth: 110
|
|
|
- // }
|
|
|
- ],
|
|
|
- second: [
|
|
|
- {
|
|
|
- prop: 'completeTime',
|
|
|
- label: '完成时间',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'cycle',
|
|
|
- label: '生产周期',
|
|
|
- align: 'center'
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
-
|
|
|
- return [
|
|
|
- {
|
|
|
- width: 45,
|
|
|
- type: 'selection',
|
|
|
- columnKey: 'selection',
|
|
|
- align: 'center',
|
|
|
- fixed: 'left'
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'index',
|
|
|
- label: '序号',
|
|
|
- type: 'index',
|
|
|
- width: 55,
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- fixed: 'left'
|
|
|
- },
|
|
|
- {
|
|
|
- slot: 'code',
|
|
|
- label: '生产订单号',
|
|
|
- align: 'center',
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'originalCode',
|
|
|
- label: '原始工单号',
|
|
|
- align: 'center',
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'productionPlanCode',
|
|
|
- label: '计划编号',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'planType',
|
|
|
- label: '计划类型',
|
|
|
- align: 'center',
|
|
|
- formatter: (row) => {
|
|
|
- const obj = this.planType.find((i) => i.value == row.planType);
|
|
|
- return obj && obj.label;
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'produceVersionName',
|
|
|
- label: '生产版本',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'productCode',
|
|
|
- label: '物料编号',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'productName',
|
|
|
- label: '产品名称',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
+ second: [{ label: '已完成', value: '6' }]
|
|
|
+ },
|
|
|
+ planType: [
|
|
|
+ { label: '所有计划类型', value: null },
|
|
|
+ { label: '内销计划', value: '1' },
|
|
|
+ { label: '外销计划', value: '2' },
|
|
|
+ { label: '预制计划', value: '3' }
|
|
|
+ ],
|
|
|
+ selection: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // 表格列配置
|
|
|
+ columns() {
|
|
|
+ const opt = {
|
|
|
+ first: [
|
|
|
+ // {
|
|
|
+ // prop: 'deliveryTime',
|
|
|
+ // label: '预测交货日期',
|
|
|
+ // align: 'center',
|
|
|
+ // showOverflowTooltip: true,
|
|
|
+ // minWidth: 110
|
|
|
+ // }
|
|
|
+ ],
|
|
|
+ second: [
|
|
|
{
|
|
|
- prop: 'brandNo',
|
|
|
- label: '牌号',
|
|
|
+ prop: 'completeTime',
|
|
|
+ label: '完成时间',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- prop: 'model',
|
|
|
- label: '型号',
|
|
|
+ prop: 'cycle',
|
|
|
+ label: '生产周期',
|
|
|
align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'formingNum',
|
|
|
- label: '要求成型数量',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'formingWeight',
|
|
|
- label: '要求成型重量',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'formedNum',
|
|
|
- label: '已成型数量',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'formedWeight',
|
|
|
- label: '已成型重量',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'planStartTime',
|
|
|
- label: '计划开始时间',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'startTime',
|
|
|
- label: '实际开始时间',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
|
|
|
- ...opt[this.activeName],
|
|
|
- {
|
|
|
- prop: 'createTime',
|
|
|
- label: '创建时间',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- slot: 'status',
|
|
|
- label: '状态',
|
|
|
- align: 'center',
|
|
|
- formatter: (row) => {
|
|
|
- const obj = this.statusOpt[this.activeName].find(
|
|
|
- (i) => i.value == row.status
|
|
|
- );
|
|
|
- return obj && obj.label;
|
|
|
- }
|
|
|
- },
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ type: 'selection',
|
|
|
+ columnKey: 'selection',
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '类型',
|
|
|
+ type: 'index',
|
|
|
+ slot: 'index',
|
|
|
+ width: 65,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'code',
|
|
|
+ label: '生产订单号',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'originalCode',
|
|
|
+ label: '原始工单号',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'productionPlanCode',
|
|
|
+ label: '计划编号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'planType',
|
|
|
+ label: '计划类型',
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) => {
|
|
|
+ const obj = this.planType.find((i) => i.value == row.planType);
|
|
|
+ return obj && obj.label;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'produceVersionName',
|
|
|
+ label: '生产版本',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'productCode',
|
|
|
+ label: '物料编号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'productName',
|
|
|
+ label: '产品名称',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'brandNo',
|
|
|
+ label: '牌号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'model',
|
|
|
+ label: '型号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'formingNum',
|
|
|
+ label: '要求成型数量',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'formingWeight',
|
|
|
+ label: '要求成型重量',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'formedNum',
|
|
|
+ label: '已成型数量',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'formedWeight',
|
|
|
+ label: '已成型重量',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'planStartTime',
|
|
|
+ label: '计划开始时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'startTime',
|
|
|
+ label: '实际开始时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
|
|
|
- {
|
|
|
- prop: 'teamName',
|
|
|
- label: '班组',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 250,
|
|
|
- align: 'center',
|
|
|
- resizable: false,
|
|
|
- fixed: 'right',
|
|
|
- slot: 'action',
|
|
|
- showOverflowTooltip: true
|
|
|
+ ...opt[this.activeName],
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '创建时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'status',
|
|
|
+ label: '状态',
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) => {
|
|
|
+ const obj = this.statusOpt[this.activeName].find(
|
|
|
+ (i) => i.value == row.status
|
|
|
+ );
|
|
|
+ return obj && obj.label;
|
|
|
}
|
|
|
- ];
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'teamName',
|
|
|
+ label: '班组',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 250,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ fixed: 'right',
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // created(){
|
|
|
+ // console.log('positiveIntegerReg',positiveIntegerReg)
|
|
|
+ // },
|
|
|
+ methods: {
|
|
|
+ handlePicking() {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/produceOrder/picking'
|
|
|
+ });
|
|
|
},
|
|
|
- // created(){
|
|
|
- // console.log('positiveIntegerReg',positiveIntegerReg)
|
|
|
- // },
|
|
|
- methods: {
|
|
|
- handlePicking() {
|
|
|
- this.$router.push({
|
|
|
- path: '/produceOrder/picking'
|
|
|
- });
|
|
|
- },
|
|
|
- statusFormatter(status) {
|
|
|
- const obj = this.statusOpt[this.activeName].find(
|
|
|
- (i) => i.value == status
|
|
|
- );
|
|
|
+ statusFormatter(status) {
|
|
|
+ const obj = this.statusOpt[this.activeName].find(
|
|
|
+ (i) => i.value == status
|
|
|
+ );
|
|
|
|
|
|
- return obj && obj.label;
|
|
|
- },
|
|
|
- /* 表格数据源 */
|
|
|
- datasource({ page, limit, where }) {
|
|
|
- return getPage({
|
|
|
- pageNum: page,
|
|
|
- size: limit,
|
|
|
- ...where
|
|
|
- });
|
|
|
- },
|
|
|
- createSuccess() {
|
|
|
- this.reload();
|
|
|
- },
|
|
|
- handleCreate() {
|
|
|
- this.$refs.createRef.open(0);
|
|
|
- },
|
|
|
- // 发布工单
|
|
|
- handleOrderPublish(type, row) {
|
|
|
- this.$router.push({
|
|
|
- path: '/produceOrder/report',
|
|
|
- query: {
|
|
|
- type,
|
|
|
- id: row.id
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // 完结与批量完结
|
|
|
- toEnd(row) {
|
|
|
- if (row) {
|
|
|
- this.$confirm(`是否要完结工单【${row.code}】?`, '提醒', {
|
|
|
- confirmButtonText: '确认',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- batchCompletion([row.id]).then((res) => {
|
|
|
- this.$message.success('成功');
|
|
|
- this.reload();
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ return obj && obj.label;
|
|
|
+ },
|
|
|
+ /* 表格数据源 */
|
|
|
+ async datasource({ page, limit, where }) {
|
|
|
+
|
|
|
+
|
|
|
+ let res = await getPage({ ...where, pageNum: page, size: limit });
|
|
|
+ // res['list'] = this.flattenArray(res.list)
|
|
|
+ return res
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ flattenArray(arr) {
|
|
|
+ var result = []; // 存放结果的数组
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
+ if (Array.isArray(arr[i].subWorkOrder)) {
|
|
|
+ let _arr = []
|
|
|
+ _arr = _arr.concat(arr[i].subWorkOrder)
|
|
|
+ delete arr[i].subWorkOrder
|
|
|
+ result.push(arr[i])
|
|
|
+ result.push(..._arr)
|
|
|
} else {
|
|
|
- if (!this.selection.length) {
|
|
|
- return this.$message.warning('请至少选择一条工单!');
|
|
|
- }
|
|
|
- const ids = [];
|
|
|
- this.selection.map((item) => {
|
|
|
- ids.push(item.id);
|
|
|
- });
|
|
|
- const h = this.$createElement;
|
|
|
- this.$msgbox({
|
|
|
- title: '提醒',
|
|
|
- message: h('p', null, [
|
|
|
- h('span', null, '是否要完结 '),
|
|
|
- h(
|
|
|
- 'span',
|
|
|
- { style: 'color: #70B603' },
|
|
|
- `${this.selection.length}`
|
|
|
- ),
|
|
|
- h('span', null, ' 条工单?')
|
|
|
- ]),
|
|
|
- showCancelButton: true,
|
|
|
- confirmButtonText: '确认',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- batchCompletion(ids).then((res) => {
|
|
|
- this.$message.success('成功');
|
|
|
- this.reload();
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ result.push(arr[i])
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- // 取消完结
|
|
|
- toCancel(row) {
|
|
|
- cancelCompletion([row.id]).then((res) => {
|
|
|
- this.$message.success('成功');
|
|
|
- this.reload();
|
|
|
- });
|
|
|
- },
|
|
|
+ return result;
|
|
|
+ },
|
|
|
|
|
|
- // 拆分
|
|
|
- toUnpack(row) {
|
|
|
- this.$refs.unpackRef.open(row);
|
|
|
- },
|
|
|
- handleTabChange() {
|
|
|
- this.$refs.searchRef.reset();
|
|
|
- },
|
|
|
+ /* 数据转为树形结构 */
|
|
|
+ parseData(data) {
|
|
|
+ return this.$util.toTreeData({
|
|
|
+ data: data.list,
|
|
|
+ idField: 'code',
|
|
|
+ parentIdField: 'originalCode'
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- /* 刷新表格 */
|
|
|
- reload(where = {}) {
|
|
|
- this.$nextTick(() => {
|
|
|
- where.statusList = (
|
|
|
- where.status || this.statusOpt[this.activeName][0].value
|
|
|
- ).split(',');
|
|
|
- this.$refs.table.reload({ page: 1, where });
|
|
|
- });
|
|
|
- },
|
|
|
+ /* 数据转为树形结构 */
|
|
|
|
|
|
- goDetail(row) {
|
|
|
- this.$router.push({
|
|
|
- path: '/produceOrder/detail/' + row.id,
|
|
|
- query: {
|
|
|
- produceVersionId: row.produceVersionId
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- handleDelete({ id }) {
|
|
|
- this.$confirm('确定删除当前数据?', '提示').then(async () => {
|
|
|
- await del(id);
|
|
|
- this.$message.success('删除成功!');
|
|
|
- this.reload();
|
|
|
+
|
|
|
+ createSuccess() {
|
|
|
+ this.reload();
|
|
|
+ },
|
|
|
+ handleCreate() {
|
|
|
+ this.$refs.createRef.open(0);
|
|
|
+ },
|
|
|
+ // 发布工单
|
|
|
+ handleOrderPublish(type, row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/produceOrder/report',
|
|
|
+ query: {
|
|
|
+ type,
|
|
|
+ id: row.id
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 完结与批量完结
|
|
|
+ toEnd(row) {
|
|
|
+ if (row) {
|
|
|
+ this.$confirm(`是否要完结工单【${row.code}】?`, '提醒', {
|
|
|
+ confirmButtonText: '确认',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ batchCompletion([row.id]).then((res) => {
|
|
|
+ this.$message.success('成功');
|
|
|
+ this.reload();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => { });
|
|
|
+ } else {
|
|
|
+ if (!this.selection.length) {
|
|
|
+ return this.$message.warning('请至少选择一条工单!');
|
|
|
+ }
|
|
|
+ const ids = [];
|
|
|
+ this.selection.map((item) => {
|
|
|
+ ids.push(item.id);
|
|
|
});
|
|
|
+ const h = this.$createElement;
|
|
|
+ this.$msgbox({
|
|
|
+ title: '提醒',
|
|
|
+ message: h('p', null, [
|
|
|
+ h('span', null, '是否要完结 '),
|
|
|
+ h(
|
|
|
+ 'span',
|
|
|
+ { style: 'color: #70B603' },
|
|
|
+ `${this.selection.length}`
|
|
|
+ ),
|
|
|
+ h('span', null, ' 条工单?')
|
|
|
+ ]),
|
|
|
+ showCancelButton: true,
|
|
|
+ confirmButtonText: '确认',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ batchCompletion(ids).then((res) => {
|
|
|
+ this.$message.success('成功');
|
|
|
+ this.reload();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => { });
|
|
|
}
|
|
|
+ },
|
|
|
+
|
|
|
+ // 取消完结
|
|
|
+ toCancel(row) {
|
|
|
+ cancelCompletion([row.id]).then((res) => {
|
|
|
+ this.$message.success('成功');
|
|
|
+ this.reload();
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 拆分
|
|
|
+ toUnpack(row) {
|
|
|
+ this.$refs.unpackRef.open(row);
|
|
|
+ },
|
|
|
+ handleTabChange() {
|
|
|
+ this.$refs.searchRef.reset();
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload(where = {}) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ where.statusList = (
|
|
|
+ where.status || this.statusOpt[this.activeName][0].value
|
|
|
+ ).split(',');
|
|
|
+ this.$refs.table.reload({ page: 1, where });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ goDetail(row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/produceOrder/detail/' + row.id,
|
|
|
+ query: {
|
|
|
+ produceVersionId: row.produceVersionId
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleDelete({ id }) {
|
|
|
+ this.$confirm('确定删除当前数据?', '提示').then(async () => {
|
|
|
+ await del(id);
|
|
|
+ this.$message.success('删除成功!');
|
|
|
+ this.reload();
|
|
|
+ });
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped></style>
|