| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- <template>
- <div class="ele-body">
- <el-card shadow="never" v-loading="loading">
- <order-search @search="reload" ref="searchRef"> </order-search>
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- :cache-key="cacheKeyUrl"
- @columns-change="handleColumnChange"
- >
- <template v-slot:Weight="{ row }">
- <span>{{ row.weight | weightFilter }}</span>
- </template>
- <template v-slot:SlottingType="{ row }">
- {{ getDictValue('开槽类型', row.slottingType + '') }}
- </template>
- <!-- <template v-slot:Status="{ row }">
- {{ hangingStatus(row.status) }}
- </template> -->
- <!-- 操作列 -->
- <template v-slot:action="{ row }">
- <el-link
- type="primary"
- :underline="false"
- icon="el-icon-truck"
- @click="confirm(row)"
- v-if="row.status == 0"
- >
- 任务下发
- </el-link>
- </template>
- </ele-pro-table>
- </el-card>
- </div>
- </template>
- <script>
- // import { getList, releaseWorkOrder } from '@/api/workOrder/index.js';
- import OrderSearch from './components/order-search.vue';
- import dictMixins from '@/mixins/dictMixins';
- import { hangingStatus } from '@/utils/util';
- import {
- getPutMeshWorkOrderByPage,
- issuedPutMeshWorkOrder
- } from '@/api/mergePutMesh/mergePutMesh';
- import tabMixins from '@/mixins/tableColumnsMixin';
- export default {
- components: {
- OrderSearch
- },
- mixins: [dictMixins, tabMixins],
- data() {
- return {
- visible: false,
- loading: false,
- releasParams: {
- teamId: '',
- id: ''
- },
- current: null,
- cacheKeyUrl: '79025f25-aps-hangingWorkOrder',
- columnsVersion:1
- };
- },
- computed: {
- // 表格列配置
- columns() {
- const num = this.columnsVersion;
- return [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'weight',
- label: '等级',
- align: 'center',
- slot: 'Weight'
- },
- {
- prop: 'height',
- label: '高度',
- align: 'center'
- },
- {
- prop: 'length',
- label: '长1+长2+长3',
- align: 'center'
- },
- {
- prop: 'productName',
- label: '产品名称',
- align: 'center'
- },
- {
- prop: 'allowance',
- label: '余量',
- align: 'center'
- },
- {
- prop: 'moCount',
- label: '模数',
- align: 'center'
- },
- {
- prop: 'blockCount',
- label: '片1+片2+片3',
- align: 'center'
- },
- {
- prop: 'slottingType',
- label: '开槽类型',
- align: 'center',
- slot: 'SlottingType'
- },
- {
- prop: 'taskTime',
- label: '任务日期',
- align: 'center'
- },
- {
- prop: 'issuedTime',
- label: '下发日期',
- align: 'center'
- },
- {
- prop: 'teamName',
- label: '班组',
- align: 'center'
- },
- {
- prop: 'status',
- label: '状态',
- align: 'center',
- formatter: (row, column, cellValue) => {
- return hangingStatus(cellValue);
- }
- },
- {
- prop: 'remark',
- label: '完结原因',
- align: 'center'
- },
- {
- prop: 'customerName',
- label: '客户名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'serialNo',
- label: '客户代号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'simpleName',
- label: '客户简称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- columnKey: 'action',
- label: '操作',
- width: 120,
- align: 'center',
- resizable: false,
- fixed: 'right',
- slot: 'action',
- showOverflowTooltip: true
- }
- ];
- }
- },
- created() {
- this.requestDict('开槽类型');
- },
- filters: {
- weightFilter(value) {
- let weight = '';
- switch (value) {
- case 1:
- weight = 'A';
- break;
- case 2:
- weight = 'B';
- break;
- case 3:
- weight = 'C';
- break;
- }
- return weight;
- }
- },
- methods: {
- /* 表格数据源 */
- datasource({ page, limit, where }) {
- return getPutMeshWorkOrderByPage({
- pageNum: page,
- size: limit,
- ...where
- });
- },
- // 下达
- toRelease(row) {
- this.current = row;
- this.visible = true;
- },
- // 下达
- confirm(row) {
- this.$confirm('确认下发选中的任务吗?', '提示', {
- confirmButtonText: '确定',
- cancleButtonText: '取消',
- type: 'warning'
- })
- .then(async () => {
- const res = await issuedPutMeshWorkOrder({
- id: [row.id],
- status: 1
- });
- this.$message.success('任务下发成功!');
- this.reload();
- })
- .catch(() => {});
- },
- /* 刷新表格 */
- reload(where) {
- console.log(where,'where')
- this.$nextTick(() => {
- this.$refs.table.reload({ page: 1, where });
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped></style>
|