| | |
| | | import {VXETable} from "vxe-table"; |
| | | import { useI18n } from 'vue-i18n' |
| | | import useUserInfoStore from '@/stores/userInfo' |
| | | import {toolbarButtonClickEvent} from "@/hook/mouseMove"; |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | const userStore = useUserInfoStore() |
| | |
| | | switch (type) { |
| | | case 'select' : { |
| | | router.push({path: '/main/processCard/SelectDetailProcessCard', query: { processId: row.processId }}) |
| | | break |
| | | } |
| | | case 'setType': { |
| | | let state=row.layoutStatus |
| | | |
| | | if (state=='可排版'){ |
| | | request.post(`/processCard/updateLayoutStatus/${row.processId}/2`).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success(t('processCard.typesettingSuccess') |
| | | ) |
| | | router.push({path: '/main/processCard/SelectProcessCard', query: {random:Math.random()}}) |
| | | } else { |
| | | |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | else if(state=='不可排版'){ |
| | | request.post(`/processCard/updateLayoutStatus/${row.processId}/1`).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success(t('processCard.modifySuccessfully')) |
| | | router.push({path: '/main/processCard/SelectProcessCard', query: {random:Math.random()}}) |
| | | } else { |
| | | |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | break |
| | | } |
| | | case 'delete': { |
| | |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {title: t('basicData.operate'), width: 160, slots: { default: 'button_slot' },fixed:"left"}, |
| | | {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80}, |
| | | {title: t('basicData.operate'), width: 100, slots: { default: 'button_slot' },fixed:"left"}, |
| | | { type: 'seq',fixed:"left", title: t('basicData.Number'), width: 50 }, |
| | | {field: 'orderId', title: t('order.orderId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' },width: 110 }, |
| | | {field: 'processId', width: 140, title: t('processCard.processId') ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | // buttons: [{ |
| | | // |
| | | // }], |
| | | buttons: [ |
| | | {code: 'update', name: '排版', status: 'primary'}, |
| | | ], |
| | | import: false, |
| | | // export: true, |
| | | // print: true, |
| | |
| | | |
| | | }) |
| | | |
| | | //表格按钮 |
| | | const gridEvents = { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'update': { |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | if (selectRecords.length == 0) { |
| | | ElMessage.warning("请勾选需要的数据") |
| | | return; |
| | | } |
| | | |
| | | let composingData = ref({ |
| | | composing: selectRecords, |
| | | }) |
| | | |
| | | //修改排版状态 |
| | | request.post("/processCard/updateComposing", composingData.value).then((res) => { |
| | | if (res.code == 200 && res.data===true) { |
| | | ElMessage.success("修改成功") |
| | | router.push({ |
| | | path: '/main/processCard/SelectProcessCard', |
| | | query: {random: Math.random()} |
| | | }) |
| | | } else { |
| | | |
| | | ElMessage.warning('修改失败') |
| | | |
| | | } |
| | | }) |
| | | |
| | | } |
| | | return; |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | const checkBoxConfig = { |
| | | checkMethod: ({ row }) => { |
| | | if (row['layoutStatus']==='已排版'||row['layoutStatus']==='不可排版'){ |
| | | return row.disable |
| | | }else{ |
| | | return !row.disable |
| | | } |
| | | |
| | | }, |
| | | reserve:true |
| | | } |
| | | |
| | | |
| | | </script> |
| | |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | :checkbox-config="checkBoxConfig" |
| | | |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | |
| | | size="small"> |
| | | {{ $t('basicData.edit') }} |
| | | </el-button> |
| | | <el-button v-if="row.layoutStatus=='可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.composing')}}</el-button> |
| | | <el-button v-else-if="row.layoutStatus=='不可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.composingOk')}}</el-button> |
| | | <el-button v-else-if="row.layoutStatus=='已排版'" disabled @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.typesetter')}}</el-button> |
| | | <!-- <el-button v-if="row.layoutStatus=='可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.composing')}}</el-button>--> |
| | | <!-- <el-button v-else-if="row.layoutStatus=='不可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.composingOk')}}</el-button>--> |
| | | <!-- <el-button v-else-if="row.layoutStatus=='已排版'" disabled @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.typesetter')}}</el-button>--> |
| | | <!-- <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">{{$t('basicData.delete')}}</el-button>--> |
| | | <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')"> |
| | | <template #reference> |