<template>
|
<div>
|
<BasicTable
|
@register="registerTable"
|
>
|
<template #toolbar>
|
<a-button type="primary" @click="handleCreate"> {{t('新增盘点单')}} </a-button>
|
<!-- <a-button type="primary" @click="handleCreate"> 盘点启动 </a-button>
|
<a-button type="primary" @click="handleCreate"> 盘点结束 </a-button>
|
<a-button type="primary" @click="handleCreate"> 撤销 </a-button> -->
|
</template>
|
<template #action="{ record }">
|
<TableAction
|
:actions="[
|
{
|
icon: 'clarity:info-standard-line',
|
tooltip: t('查看盘点单详情'),
|
onClick: handleEdit.bind(null, record),
|
}
|
]"
|
/>
|
</template>
|
</BasicTable>
|
<!-- <InventoryDrawer @register="registerDrawer" @success="handleSuccess" /> -->
|
</div>
|
</template>
|
<script lang="ts">
|
import { defineComponent, ref } from 'vue';
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
// import { useDrawer } from '/@/components/Drawer';
|
|
import { columns, searchFormSchema } from './inventory.data';
|
import { getInventoryListByPage,CreateBillCode } from '/@/api/tigerapi/wms/inventory';
|
import { buildUUID } from '/@/utils/uuid';
|
import { useGo } from '/@/hooks/web/usePage';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
const { t } = useI18n('WMS.Count');
|
export default defineComponent({
|
name: 'WHManagement',
|
components: { BasicTable, TableAction },
|
setup() {
|
const go = useGo();
|
// const [registerDrawer, { openDrawer }] = useDrawer();
|
const [registerTable, { reload }] = useTable({
|
title: t('盘点单列表'),
|
api: getInventoryListByPage,
|
columns,
|
formConfig: {
|
labelWidth: 120,
|
schemas: searchFormSchema,
|
},
|
useSearchForm: true,
|
showTableSetting: false,
|
bordered: true,
|
//canResize:true,
|
showIndexColumn: false,
|
actionColumn: {
|
width: 80,
|
title: t('操作'),
|
dataIndex: 'action',
|
slots: { customRender: 'action' },
|
fixed: 'right' //undefined,
|
},
|
});
|
|
async function handleCreate() {
|
|
const count = {ITEM_CODE:"0",ID: buildUUID()}
|
go(`/inventoryDetail/${encodeURI(JSON.stringify(count))}`);
|
}
|
|
function handleEdit(record: Recordable) {
|
// openDrawer(true, {
|
// record,
|
// isUpdate: true,
|
// });
|
|
const count = {ITEM_CODE:'1',ID: record.ID}
|
go(`/inventoryDetail/${encodeURI(JSON.stringify(count))}`);
|
|
}
|
|
function handleSuccess() {
|
reload();
|
}
|
|
return {
|
registerTable,
|
handleCreate,
|
handleEdit,
|
handleSuccess,
|
t
|
};
|
},
|
});
|
</script>
|