| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <template>
- <div class="ele-body">
- <el-card shadow="never" v-loading="loading">
- <productionPlan-search
- @search="reload"
- ref="searchRef"
- :statusOpt="statusOpt"
- :planType="planType"
- :activeName="activeName"
- >
- </productionPlan-search>
- <el-tabs v-model="activeName" type="card" @tab-click="handleTabChange">
- <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"
- :columns="columns"
- :datasource="datasource"
- :cache-key="`${activeName}ProductionPlanTable`"
- >
- <!-- 操作列 -->
- <template v-slot:action="{ row }">
- <el-link
- type="primary"
- :underline="false"
- icon="el-icon-truck"
- @click="handleOrderPublish(row)"
- >
- 发布工单
- </el-link>
- <el-link type="primary" :underline="false" icon="el-icon-truck">
- 重新发布
- </el-link>
- <el-link type="primary" :underline="false" icon="el-icon-edit">
- 修改计划
- </el-link>
- <el-link type="primary" :underline="false" icon="el-icon-edit">
- 删除
- </el-link>
- </template>
- </ele-pro-table>
- </el-card>
- </div>
- </template>
- <script>
- import { getList } from '@/api/productionPlan/index.js';
- import productionPlanSearch from './components/productionPlan-search.vue';
- export default {
- components: {
- productionPlanSearch
- },
- data () {
- return {
- activeName: 'first',
- // 加载状态
- loading: false,
- pageType: 'add',
- dialogTitle: '',
- isBindPlan: false,
- statusOpt: {
- first: [
- { label: '所有状态', value: '1,2' },
- { label: '待发布', value: '1' },
- { label: '发布状态', value: '2' }
- ],
- second: [
- { label: '所有状态', value: '0,3,4,5,6' },
- { label: '待排产', value: '0' },
- { label: '待生产', value: '3' },
- { label: '生产中', value: '4' },
- { label: '已完成', value: '5' },
- { label: '已延期', value: '6' }
- ]
- },
- planType: [
- { label: '所有计划类型', value: '0,1' },
- { label: '内销计划', value: '0' },
- { label: '外销计划', value: '1' }
- ]
- };
- },
- computed: {
- // 表格列配置
- 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: 'deliveryTime',
- label: '预测交货日期',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'formingTime',
- label: '实际交货日期',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- }
- ]
- };
- 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: 110
- },
- {
- prop: 'productCode',
- label: '产品编号',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'brandNo',
- label: '牌号',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'model',
- label: '型号',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'productNum',
- label: '计划数量',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'productWeight',
- label: '计划重量',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'requiredFormingNum',
- label: '要求成型数量',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- // {
- // prop: '',
- // label: '已成型数量',
- // align: 'center',
- // showOverflowTooltip: true,
- // minWidth: 110
- // },
- {
- prop: 'requiredFormingTime',
- label: '要求成型日期',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'planFormingTime',
- label: '预测成型日期',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- ...opt[this.activeName],
- {
- prop: 'orderType',
- label: '计划类型',
- align: 'center',
- showOverflowTooltip: true,
- formatter: (row) => {
- const obj = this.planType.find((i) => i.value == row.orderType);
- return obj && obj.label;
- }
- },
- {
- prop: 'createTime',
- label: '创建时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'planStatus',
- label: '状态',
- align: 'center',
- minWidth: 110,
- formatter: (row) => {
- const obj = this.statusOpt[this.activeName].find(
- (i) => i.value == row.orderType
- );
- return obj && obj.label;
- }
- },
- ...(this.activeName === 'second'
- ? [
- {
- prop: 'releaseTime',
- label: '发布时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- }
- ]
- : []),
- ...(this.activeName === 'first'
- ? [
- {
- 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
- });
- },
- // 发布工单
- handleOrderPublish (row) {
- this.$router.push({
- path: '/productionPlan/workOrderPublish'
- });
- },
- handleTabChange () {
- this.$refs.searchRef.reset();
- },
- /* 刷新表格 */
- reload (where) {
- this.$refs.table.reload({ page: 1, where });
- },
- goDetail (row) {
- row.title = '工单详情';
- row.tabLabel = '工单信息';
- this.$router.push({
- path: '/productionPlan/detail'
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped></style>
|