master
吴普建 11 months ago
parent 9b92babe46
commit ba0c39443c

@ -1,56 +1,56 @@
<template> <template>
<div class="h-full"> <div class="h-full">
<my-card title="搜索条件" search> <my-card title="搜索条件" search>
<n-form ref="formRef" inline label-width="auto" :model="searchForm" size="medium"> <n-form ref="formRef" inline label-width="auto" :model="searchForm" size="medium">
<n-form-item label="采购订单编号"> <n-form-item label="采购订单编号">
<n-input v-model:value="searchForm.poCode" placeholder="请输入采购订单编号" /> <n-input v-model:value="searchForm.poCode" placeholder="请输入采购订单编号" />
</n-form-item> </n-form-item>
<n-form-item label="供应商名称"> <n-form-item label="供应商名称">
<n-input v-model:value="searchForm.vendorName" placeholder="请输入供应商名称" /> <n-input v-model:value="searchForm.vendorName" placeholder="请输入供应商名称" />
</n-form-item> </n-form-item>
<n-form-item label="单据状态"> <n-form-item label="单据状态">
<n-select v-model:value="searchForm.status" class="w-180px" :options="wms_item_recpt_status"></n-select> <n-select v-model:value="searchForm.status" class="w-180px" :options="wms_item_recpt_status"></n-select>
<!-- <n-input v-model:value="searchForm.status" placeholder="请选择单据状态" /> --> <!-- <n-input v-model:value="searchForm.status" placeholder="请选择单据状态" /> -->
</n-form-item> </n-form-item>
<n-form-item> <n-form-item>
<component :is="useSearchBtn(search, reset)"></component> <component :is="useSearchBtn(search, reset)"></component>
</n-form-item> </n-form-item>
</n-form> </n-form>
</my-card> </my-card>
<my-card title="采购入库列表"> <my-card title="采购入库列表">
<template #right> <template #right>
<div class="flex-center"> <div class="flex-center">
<component <component
:is="useDelBtn(delSelect, undefined, '确定要删除所有已选中的数据吗?', Boolean(!selectKeys.length))" :is="useDelBtn(delSelect, undefined, '确定要删除所有已选中的数据吗?', Boolean(!selectKeys.length))"
v-hasPermi="['wms:recpt:remove']" v-hasPermi="['wms:recpt:remove']"
></component> ></component>
<!-- <component :is="useAddBtn(handleAddTable, undefined, '新增')" v-hasPermi="['wms:recpt:add']"></component> <!-- <component :is="useAddBtn(handleAddTable, undefined, '新增')" v-hasPermi="['wms:recpt:add']"></component>
<component :is="useDownBtn(handleExport)"></component> --> <component :is="useDownBtn(handleExport)"></component> -->
<n-button size="small" class="mr-5px" type="primary" @click="getWmsItemRecptData"> <n-button size="small" class="mr-5px" type="primary" @click="getWmsItemRecptData">
<icon-mdi-refresh class="mr-4px text-16px" :class="{ 'animate-spin': loading }" /> <icon-mdi-refresh class="mr-4px text-16px" :class="{ 'animate-spin': loading }" />
刷新表格 刷新表格
</n-button> </n-button>
</div> </div>
</template> </template>
<div> <div>
<n-data-table <n-data-table
:row-key="row => row.recptId" :row-key="row => row.recptId"
:columns="columns" :columns="columns"
:data="data" :data="data"
:loading="loading" :loading="loading"
:scroll-x="1000" :scroll-x="1000"
@update-checked-row-keys="handleSelect" @update-checked-row-keys="handleSelect"
/> />
<my-pagination v-model:search-form="searchForm" @init="init"></my-pagination> <my-pagination v-model:search-form="searchForm" @init="init"></my-pagination>
</div> </div>
<table-action-modal <table-action-modal
v-model:visible="showModal" v-model:visible="showModal"
:type="modalType" :type="modalType"
:edit-data="editData" :edit-data="editData"
:get-list="getWmsItemRecptData" :get-list="getWmsItemRecptData"
/> />
</my-card> </my-card>
</div> </div>
</template> </template>
<script lang="tsx" setup> <script lang="tsx" setup>
@ -63,10 +63,10 @@ import { useLoading, useBoolean } from '@/hooks';
// import { deepClone } from '@/utils'; // import { deepClone } from '@/utils';
import { selectWmsItemRecptList, delWmsItemRecpt } from '@/service/api/wms/recpt'; import { selectWmsItemRecptList, delWmsItemRecpt } from '@/service/api/wms/recpt';
import { import {
useSearchBtn, useSearchBtn,
useDelBtn, useDelBtn,
// useBtn, // useBtn,
useEditBtn useEditBtn
} from '@/hooks/common/useBtn'; } from '@/hooks/common/useBtn';
// import { download } from '@/service/request/helpers'; // import { download } from '@/service/request/helpers';
import { useSocketStore } from '@/store/modules/socket/index'; import { useSocketStore } from '@/store/modules/socket/index';
@ -90,213 +90,203 @@ const message = useMessage();
const total = ref(); const total = ref();
const page = ref(1); const page = ref(1);
const searchForm = ref({ const searchForm = ref({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
poCode: undefined, poCode: undefined,
vendorName: undefined, vendorName: undefined,
attr1: 'YL', attr1: 'YL',
status: null status: null
}); });
const editData = ref<wms.recptRawType.columns>({ const editData = ref<wms.recptRawType.columns>({
recptId: null, recptId: null,
recptCode: null, recptCode: null,
recptName: null, recptName: null,
iqcId: null, iqcId: null,
iqcCode: null, iqcCode: null,
poCode: null, poCode: null,
vendorId: null, vendorId: null,
vendorCode: null, vendorCode: null,
vendorName: null, vendorName: null,
vendorNick: null, vendorNick: null,
warehouseId: null, warehouseId: null,
warehouseCode: null, warehouseCode: null,
warehouseName: null, warehouseName: null,
locationId: null, locationId: null,
locationCode: null, locationCode: null,
locationName: null, locationName: null,
areaId: null, areaId: null,
areaCode: null, areaCode: null,
areaName: null, areaName: null,
recptDate: null, recptDate: null,
status: null, status: null,
remark: null, remark: null,
attr1: null, attr1: null,
attr2: null, attr2: null,
attr3: null, attr3: null,
attr4: null, attr4: null,
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
type: null, type: null,
fromBillId: null, fromBillId: null,
fromBillCode: null, fromBillCode: null,
fromBillName: null, fromBillName: null,
snidCode: null, snidCode: null,
createByNick: null, createByNick: null,
manageBy: null, manageBy: null,
manageByNick: null, manageByNick: null,
headBy: null, headBy: null,
headByNick: null, headByNick: null,
salseDeptId: null, salseDeptId: null,
salseDeptName: null, salseDeptName: null,
salseBy: null, salseBy: null,
salseByNick: null salseByNick: null
}); });
const selectKeys = ref<DataTableRowKey[]>([]); const selectKeys = ref<DataTableRowKey[]>([]);
function handleSelect(keys: DataTableRowKey[]) { function handleSelect(keys: DataTableRowKey[]) {
selectKeys.value = keys; selectKeys.value = keys;
} }
const data = ref<wms.recptRawType.columns[]>([]); const data = ref<wms.recptRawType.columns[]>([]);
const columns: Ref<DataTableColumns<wms.recptRawType.columns>> = ref([ const columns: Ref<DataTableColumns<wms.recptRawType.columns>> = ref([
{ {
type: 'selection', type: 'selection',
align: 'center' align: 'center'
}, },
{ {
title: '入库单编号', title: '入库单编号',
key: 'recptCode', key: 'recptCode',
align: 'center', align: 'center',
width: 110, width: 130,
ellipsis: { ellipsis: {
tooltip: true tooltip: true
} }
}, },
{ {
title: '入库单名称', title: '入库单名称',
key: 'recptName', key: 'recptName',
align: 'center', align: 'center',
width: 110, ellipsis: {
ellipsis: { tooltip: true
tooltip: true }
} },
}, {
{ title: '销售订单编号',
title: '销售订单编号', key: 'poCode',
key: 'poCode', align: 'center',
align: 'center', ellipsis: {
width: 110, tooltip: true
ellipsis: { }
tooltip: true },
} {
}, title: '供应商名称',
{ key: 'vendorName',
title: '供应商名称', align: 'center',
key: 'vendorName', ellipsis: {
align: 'center', tooltip: true
width: 110, }
ellipsis: { },
tooltip: true {
} title: '仓库名称',
}, key: 'warehouseName',
{ align: 'center',
title: '仓库名称', ellipsis: {
key: 'warehouseName', tooltip: true
align: 'center', }
width: 110, },
ellipsis: { // {
tooltip: true // title: '',
} // key: 'locationName',
}, // align: 'center',
// { // width: 110
// title: '', // },
// key: 'locationName', // {
// align: 'center', // title: '',
// width: 110 // key: 'areaName',
// }, // align: 'center',
// { // width: 110
// title: '', // },
// key: 'areaName', {
// align: 'center', title: '入库日期',
// width: 110 key: 'recptDate',
// }, align: 'center',
{ ellipsis: {
title: '入库日期', tooltip: true
key: 'recptDate', }
align: 'center', },
width: 110, {
ellipsis: { title: '创建时间',
tooltip: true key: 'createTime',
} align: 'center',
}, ellipsis: {
{ tooltip: true
title: '创建时间', }
key: 'createTime', },
align: 'center', {
width: 180, title: '单据状态',
ellipsis: { key: 'status',
tooltip: true align: 'center',
} render: row => {
}, return <dict-tag options={wms_item_recpt_status.value} value={row.status}></dict-tag>;
{ },
title: '单据状态', ellipsis: {
key: 'status', tooltip: true
align: 'center', }
render: row => { },
return <dict-tag options={wms_item_recpt_status.value} value={row.status}></dict-tag>; {
}, title: '来源单据编码',
width: 110, key: 'fromBillCode',
ellipsis: { align: 'center',
tooltip: true ellipsis: {
} tooltip: true
}, }
{ },
title: '来源单据编码', {
key: 'fromBillCode', title: '负责人简称',
align: 'center', key: 'headByNick',
width: 110, align: 'center',
ellipsis: { ellipsis: {
tooltip: true tooltip: true
} }
}, },
{ {
title: '负责人简称', title: '操作',
key: 'headByNick', key: 'action',
align: 'center', fixed: 'right',
width: 110, align: 'center',
ellipsis: { render: row => {
tooltip: true console.log(wms_item_recpt_status.value, row.status, '----');
} if (row.status === 'FINISHED') {
}, return (
{ <n-button size="small" type="info" onClick={() => print(row)}>
title: '操作', 补打标签
key: 'action', </n-button>
fixed: 'right', );
width: 220, }
align: 'center', const Btn: JSX.Element[] = [];
render: row => { if (row.status !== 'FINISHED') {
console.log(wms_item_recpt_status.value, row.status, '----'); Btn.push(
if (row.status === 'FINISHED') { useEditBtn(
return ( () => {
<n-button size="small" type="info" onClick={() => print(row)}> router.push({
补打标签 name: 'storage_auxiliaryProduceinfo',
</n-button> query: {id: row.recptId, warehouseId: row.warehouseId}
); });
} },
const Btn: JSX.Element[] = []; 'tiny',
if (row.status !== 'FINISHED') { '执行入库'
Btn.push( )
useEditBtn( );
() => { }
router.push({ return Btn;
name: 'storage_auxiliaryProduceinfo', }
query: { id: row.recptId, warehouseId: row.warehouseId } }
});
},
'tiny',
'执行入库'
)
);
}
return Btn;
}
}
]) as Ref<DataTableColumns<any>>; ]) as Ref<DataTableColumns<any>>;
const { loading, startLoading, endLoading } = useLoading(false); const {loading, startLoading, endLoading} = useLoading(false);
// const { setTrue: openModal } = useBoolean(); // const { setTrue: openModal } = useBoolean();
// function setModalType(type: ModalType) { // function setModalType(type: ModalType) {
@ -304,34 +294,35 @@ const { loading, startLoading, endLoading } = useLoading(false);
// } // }
// //
function reset() { function reset() {
searchForm.value.pageNum = 1; searchForm.value.pageNum = 1;
page.value = 1; page.value = 1;
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
const { pageNum, pageSize, ...rest } = searchForm.value; const {pageNum, pageSize, ...rest} = searchForm.value;
for (const key in rest) { for (const key in rest) {
if (searchForm.value[key] !== '' && searchForm.value[key] !== 'YL') { if (searchForm.value[key] !== '' && searchForm.value[key] !== 'YL') {
searchForm.value[key] = null; searchForm.value[key] = null;
} }
} }
getWmsItemRecptData(); getWmsItemRecptData();
} }
function print(row: wms.recptRawType.columns) { function print(row: wms.recptRawType.columns) {
socketStore.setMsg( socketStore.setMsg(
JSON.stringify({ JSON.stringify({
templateType: 'YL-MB', templateType: 'YL-MB',
printValue: row.lineList printValue: row.lineList
}) })
); );
window.$message?.success('已发送打印命令'); window.$message?.success('已发送打印命令');
} }
// async function handleEditTable(issueId: number) { // async function handleEditTable(issueId: number) {
// console.log('', issueId); // console.log('', issueId);
// } // }
function search() { function search() {
searchForm.value.pageNum = 1; searchForm.value.pageNum = 1;
init(); init();
} }
// //
@ -357,32 +348,34 @@ function search() {
// //
function getWmsItemRecptData() { function getWmsItemRecptData() {
startLoading(); startLoading();
selectWmsItemRecptList({ params: searchForm.value }).then(res => { selectWmsItemRecptList({params: searchForm.value}).then(res => {
data.value = res.rows; data.value = res.rows;
total.value = res.total; total.value = res.total;
searchForm.value.total = res.total; searchForm.value.total = res.total;
if (data.value) { if (data.value) {
setTimeout(() => { setTimeout(() => {
endLoading(); endLoading();
}, 200); }, 200);
} }
}); });
} }
// //
function delSelect() { function delSelect() {
delWmsItemRecpt(selectKeys.value.join(',') as string).then(() => { delWmsItemRecpt(selectKeys.value.join(',') as string).then(() => {
getWmsItemRecptData(); getWmsItemRecptData();
message.success('删除成功'); message.success('删除成功');
}); });
} }
// function handleExport() { // function handleExport() {
// show.value = true; // show.value = true;
// } // }
function init() { function init() {
getWmsItemRecptData(); getWmsItemRecptData();
// //
} }
init(); init();
</script> </script>

Loading…
Cancel
Save