| | |
| | | const editChild = ref(null) |
| | | const showTaskDetlChild = ref(null) |
| | | |
| | | const state = reactive({ |
| | | selectedRowKeys: [], |
| | | loading: false, |
| | | }); |
| | | |
| | | let tableData = ref([]); |
| | | getPage(); |
| | | |
| | |
| | | dataIndex: 'oper', |
| | | key: 'oper', |
| | | fixed: 'right', |
| | | width: 240, |
| | | width: 300, |
| | | }, |
| | | ]; |
| | | |
| | | const state = reactive({ |
| | | selectedRowKeys: [], |
| | | loading: false, |
| | | }); |
| | | const hasSelected = computed(() => state.selectedRowKeys.length > 0); |
| | | const start = () => { |
| | | state.loading = true; |
| | |
| | | }; |
| | | |
| | | function getPage() { |
| | | state.loading = true; |
| | | |
| | | post('/api/task/page', { |
| | | current: currentPage, |
| | | pageSize: pageSize, |
| | |
| | | if (result.code == 200) { |
| | | let data = result.data; |
| | | tableData.value = data; |
| | | |
| | | state.loading = false; |
| | | } else if (result.code === 401) { |
| | | message.error(result.msg); |
| | | logout() |
| | |
| | | }); |
| | | } |
| | | |
| | | const handlePick = (record) => { |
| | | Modal.confirm({ |
| | | title: formatMessage('page.pick', '拣料'), |
| | | content: formatMessage('page.pick.confirm', '确定拣料该项吗?'), |
| | | maskClosable: true, |
| | | onOk: async () => { |
| | | const hide = message.loading(formatMessage('common.loading', '请求中')); |
| | | try { |
| | | post('/api/task/pick', record).then(resp => { |
| | | let result = resp.data; |
| | | if (result.code === 200) { |
| | | message.success(result.msg); |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | getPage() |
| | | hide() |
| | | }) |
| | | } catch (error) { |
| | | message.error(formatMessage('common.fail', '请求失败')); |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | |
| | | <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }" |
| | | :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id" |
| | | :pagination="{ total: tableData.total, onChange: onPageChange }" |
| | | :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns" @resizeColumn="handleResizeColumn"> |
| | | :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns" @resizeColumn="handleResizeColumn" |
| | | :loading="state.loading"> |
| | | <template #bodyCell="{ column, text, record }"> |
| | | <template v-if="column.dataIndex === 'oper'"> |
| | | <div style="display: flex;justify-content: space-evenly;"> |
| | | <a-button type="link" primary @click="showDetl(record)">{{ formatMessage('page.task.orderDetl', '任务明细') |
| | | }}</a-button> |
| | | <a-button type="link" primary @click="handleComplete(record)">{{ formatMessage('page.complete', '完成') }}</a-button> |
| | | <a-button v-if="record.taskType == 103" type="link" primary @click="handlePick(record)">{{ |
| | | formatMessage('page.pick', '拣料') |
| | | }}</a-button> |
| | | <a-button type="link" primary @click="handleComplete(record)">{{ formatMessage('page.complete', '完成') |
| | | }}</a-button> |
| | | <a-button type="link" danger @click="handleCancel(record)">{{ formatMessage('page.cancel', '取消') |
| | | }}</a-button> |
| | | </div> |