<!--
|
* @Description: file content
|
* @Author: Ben Lin
|
* @version:
|
* @Date: 2024-06-18 15:09:48
|
* @LastEditors: Ben Lin
|
* @LastEditTime: 2024-07-17 04:50:55
|
-->
|
<template>
|
<div>
|
<BasicTable @register="registerTable">
|
<template #toolbar>
|
<a-button v-if="is_active" type="primary" @click="handleCreate"> 新增调拨单 </a-button>
|
</template>
|
<template #action="{ record }">
|
<TableAction :actions="[
|
{
|
icon: 'clarity:info-standard-line',
|
tooltip: bt('查看单据详情'),
|
onClick: handleEdit.bind(null, record),
|
},
|
]" />
|
</template>
|
</BasicTable>
|
<TransferModal @register="registerModal" @success="handleSuccess" />
|
</div>
|
</template>
|
<script lang="ts" setup>
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
import { columns, searchFormSchema } from './transfer.data';
|
import { getTransferListByPage } from '/@/api/tigerapi/wms/transfer';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useGo } from '/@/hooks/web/usePage';
|
import TransferModal from './TransferModal.vue';
|
import { useUserStore } from '/@/store/modules/user';
|
import { useModal } from '/@/components/Modal';
|
const [registerModal, { openModal: openTransferModal }] = useModal();
|
const { t: bt } = useI18n();
|
const go = useGo();
|
const id = '8c3da85182d044e7a4839dd2e11ac809';
|
const roles = useUserStore().getUserInfo.roles
|
const is_active = roles.some(item => item.MENU_CODE === id)
|
const [registerTable, { reload }] = useTable({
|
title: bt('调拨单列表'),
|
api: getTransferListByPage,
|
columns,
|
formConfig: {
|
labelWidth: 120,
|
schemas: searchFormSchema,
|
},
|
actionColumn: {
|
width: 80,
|
title: bt('操作'),
|
dataIndex: 'action',
|
slots: { customRender: 'action' },
|
fixed: 'right', //undefined,
|
},
|
canResize: true,
|
useSearchForm: true,
|
showTableSetting: true,
|
bordered: true,
|
showIndexColumn: false,
|
});
|
// function handleCreate() {
|
// openDrawer(true, {
|
// isUpdate: false,
|
// });
|
// }
|
function handleCreate() {
|
openTransferModal(true, {
|
data: 'content',
|
info: 'Info',
|
});
|
}
|
function handleSuccess() {
|
reload();
|
}
|
function handleEdit(record: Recordable) {
|
go('/transferDetail/' + record.BILLCODE);
|
}
|
</script>
|