|
|
@@ -0,0 +1,343 @@
|
|
|
+<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>
|
|
|
+ <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`"
|
|
|
+ >
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <el-button type="primary">工单刷新</el-button>
|
|
|
+ <el-button type="success">领料</el-button>
|
|
|
+ <el-button type="success">批量完结</el-button>
|
|
|
+ <el-button type="success" @click="handleCreate">创建工单</el-button>
|
|
|
+ <el-button type="success">工单操作控制</el-button>
|
|
|
+ </template>
|
|
|
+ <template v-slot:code="{ row }">
|
|
|
+ <el-link type="primary" :underline="false" @click="goDetail(row)">
|
|
|
+ {{ row.code }}
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:status="{ row }">
|
|
|
+ <span :class="{ 'ele-text-danger': row.status == 3 }">
|
|
|
+ {{ statusFormatter(row.status) }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <!-- 操作列 -->
|
|
|
+ <template v-slot:action="{ row }">
|
|
|
+ <template v-if="activeName == 'second'">
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ icon="el-icon-truck"
|
|
|
+ v-if="row.status == 2"
|
|
|
+ @click="handleOrderPublish(1, row)"
|
|
|
+ >
|
|
|
+ 取消完结
|
|
|
+ </el-link></template
|
|
|
+ >
|
|
|
+ <template v-else>
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ icon="el-icon-truck"
|
|
|
+ v-if="row.status == 2"
|
|
|
+ @click="handleOrderPublish(1, row)"
|
|
|
+ >
|
|
|
+ 报工
|
|
|
+ </el-link>
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ v-if="row.status == 3"
|
|
|
+ :underline="false"
|
|
|
+ icon="el-icon-truck"
|
|
|
+ @click="handleOrderPublish(2, row)"
|
|
|
+ >
|
|
|
+ 拆分
|
|
|
+ </el-link>
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="planEdit(row)"
|
|
|
+ >
|
|
|
+ 完结
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ </el-card>
|
|
|
+ <createDialog ref="createRef" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ // import { getList, del } from '@/api/produceOrder/index.js';
|
|
|
+ import produceOrderSearch from './components/produceOrder-search.vue';
|
|
|
+ import createDialog from './components/createDialog.vue';
|
|
|
+ export default {
|
|
|
+ components: {
|
|
|
+ produceOrderSearch,
|
|
|
+ createDialog
|
|
|
+ },
|
|
|
+ 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' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ planType: [
|
|
|
+ { label: '所有计划类型', value: null },
|
|
|
+ { label: '内销计划', value: '1' },
|
|
|
+ { label: '外销计划', value: '2' },
|
|
|
+ { label: '预制计划', value: '3' }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // 表格列配置
|
|
|
+ columns () {
|
|
|
+ const opt = {
|
|
|
+ first: [
|
|
|
+ // {
|
|
|
+ // prop: 'deliveryTime',
|
|
|
+ // label: '预测交货日期',
|
|
|
+ // align: 'center',
|
|
|
+ // showOverflowTooltip: true,
|
|
|
+ // minWidth: 110
|
|
|
+ // }
|
|
|
+ ],
|
|
|
+ second: [
|
|
|
+ {
|
|
|
+ prop: 'formingTime',
|
|
|
+ label: '完成时间',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'formingTime',
|
|
|
+ label: '生产周期',
|
|
|
+ align: 'center'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'releaseTime',
|
|
|
+ label: '生产工单号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'planFormingTime',
|
|
|
+ label: '计划编号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'deliveryTime',
|
|
|
+ label: '计划类型',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '生产版本',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'productCode',
|
|
|
+ label: '产品编号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'brandNo',
|
|
|
+ label: '产品名称',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'model',
|
|
|
+ label: '牌号',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'model',
|
|
|
+ label: '型号',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'productNum',
|
|
|
+ label: '要求成型数量',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'productWeight',
|
|
|
+ label: '要求成型重量',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'requiredFormingNum',
|
|
|
+ label: '已成型数量',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'requiredFormingNum',
|
|
|
+ label: '已成型重量',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'reqMoldTime',
|
|
|
+ label: '计划开始时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'reqMoldTime',
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 350,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ fixed: 'right',
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /* 表格数据源 */
|
|
|
+ datasource ({ page, limit, where }) {
|
|
|
+ return [];
|
|
|
+ // getList({
|
|
|
+ // pageNum: page,
|
|
|
+ // size: limit,
|
|
|
+ // ...where
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ handleCreate () {
|
|
|
+ this.$refs.createRef.open(0);
|
|
|
+ },
|
|
|
+ // 发布工单
|
|
|
+ handleOrderPublish (type, row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/productionPlan/workOrderPublish',
|
|
|
+ query: {
|
|
|
+ type,
|
|
|
+ id: row.id
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 修改计划
|
|
|
+ planEdit ({ id }) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/saleOrder/salesToProduction',
|
|
|
+ query: {
|
|
|
+ type: 'edit',
|
|
|
+ id
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleTabChange () {
|
|
|
+ this.$refs.searchRef.reset();
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload (where) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.table.reload({ page: 1, where });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ goDetail (row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/productionPlan/detail',
|
|
|
+ query: {
|
|
|
+ id: row.id
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleDelete ({ id }) {
|
|
|
+ this.$confirm('确定删除当前数据?', '提示').then(async () => {
|
|
|
+ await del(id);
|
|
|
+ this.$message.success('删除成功!');
|
|
|
+ this.reload();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped></style>
|