<template>
|
<div>
|
<BasicTable @register="registerTable">
|
<template #action="{ record }">
|
<TableAction
|
:actions="[
|
{
|
icon: 'clarity:info-standard-line',
|
tooltip: '查看单据详情',
|
onClick: handleEdit.bind(null, record),
|
},
|
{
|
ifShow:
|
!isNullOrEmpty(record.ERP_BILL_CODE) && is_active && record.STATUS != 3
|
? true
|
: false,
|
icon: 'Posted|svg',
|
color: 'success',
|
tooltip: 'WMS过账',
|
onClick: handlePost.bind(null, record),
|
},
|
{
|
ifShow: isNullOrEmpty(record.ERP_BILL_CODE) ? false : true,
|
icon: 'restoration|svg',
|
tooltip: '状态回退',
|
onClick: handleStatus.bind(null, record),
|
},
|
]"
|
/>
|
</template>
|
<!-- <template #toolbar>
|
<a-button type="primary" @click="handleCreate"> 新增到货单 </a-button>
|
</template>
|
<template #action="{ record }">
|
<TableAction
|
:actions="[
|
{
|
icon: 'clarity:note-edit-line',
|
onClick: handleEdit.bind(null, record),
|
},
|
{
|
icon: 'ant-design:delete-outlined',
|
color: 'error',
|
popConfirm: {
|
title: '是否确认删除?',
|
placement: 'left',
|
confirm: handleDelete.bind(null, record),
|
},
|
},
|
]"
|
/>
|
</template> -->
|
</BasicTable>
|
<!-- <FinishedwarehouseDrawer @register="registerDrawer" @success="handleSuccess" /> -->
|
<ReqModal @register="register" @success="handleSuccess" />
|
</div>
|
</template>
|
<script lang="ts">
|
import { defineComponent } from 'vue';
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
//import { useDrawer } from '/@/components/Drawer';
|
|
import { columns, searchFormSchema } from './finishedwarehouse.data';
|
import {
|
//DeleteEnterWarehouse,
|
getFinishedwarehouseListByPage,
|
getStatusRestored,
|
} from '/@/api/tigerapi/wms/finishedwarehouse';
|
import { isNullOrEmpty } from '/@/utils/is';
|
import ReqModal from './ReqModal.vue';
|
import { useUserStore } from '/@/store/modules/user';
|
import { useGo } from '/@/hooks/web/usePage';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useModal } from '/@/components/Modal';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
const { createMessage } = useMessage();
|
|
export default defineComponent({
|
name: 'WHManagement',
|
components: { BasicTable, TableAction, ReqModal },
|
setup() {
|
const go = useGo();
|
const { t: bt } = useI18n();
|
const [register, { openModal: openModal }] = useModal();
|
//const [registerDrawer, { openDrawer }] = useDrawer();
|
const [registerTable, { reload }] = useTable({
|
title: '完工入库单',
|
api: getFinishedwarehouseListByPage,
|
columns,
|
formConfig: {
|
labelWidth: 120,
|
schemas: searchFormSchema,
|
},
|
useSearchForm: true,
|
showTableSetting: true,
|
bordered: true,
|
canResize: true,
|
showIndexColumn: false,
|
actionColumn: {
|
width: 120,
|
title: '操作',
|
dataIndex: 'action',
|
slots: { customRender: 'action' },
|
fixed: 'right',
|
},
|
});
|
|
const id = '22bed366178f46299dffdf87ea2136a6';
|
const roles = useUserStore().getUserInfo.roles;
|
const is_active = roles.some((item) => item.MENU_CODE === id);
|
|
// function handleCreate() {
|
// openDrawer(true, {
|
// isUpdate: false,
|
// });
|
// }
|
|
function handleEdit(record: Recordable) {
|
go('/finishedwarehouseDetail/' + record.BILLCODE);
|
}
|
|
// function handleDelete(record: Recordable) {
|
// console.log(record);
|
// //删除工厂
|
// const apiAction = DeleteEnterWarehouse(record);
|
// apiAction.then((action) => {
|
// if (action.IsSuccessed) {
|
// reload();
|
// }
|
// });
|
// }
|
//
|
//完工入库单T100过账,wms同步过账
|
async function handlePost(record: Recordable) {
|
//var res = await SaveProd(record)
|
//createMessage.info(bt('已手工过账,wms同步过账'));
|
openModal(true, {
|
data: record,
|
info: '',
|
});
|
}
|
// 状态复原
|
async function handleStatus(record: Recordable) {
|
const apiAction = getStatusRestored(record.BILLCODE);
|
apiAction.then((res) => {
|
console.log('res', res);
|
if (res.IsSuccessed) {
|
createMessage.success('状态复原成功');
|
} else {
|
createMessage.error('状态复原失败');
|
}
|
});
|
}
|
function handleSuccess() {
|
reload();
|
}
|
|
return {
|
registerTable,
|
handlePost,
|
handleStatus,
|
isNullOrEmpty,
|
is_active,
|
handleEdit,
|
register,
|
// handleDelete,
|
handleSuccess,
|
};
|
},
|
});
|
</script>
|