diff --git a/smart-admin-web-typescript/src/api/business/receive/asnDetail/asn-detail-api.ts b/smart-admin-web-typescript/src/api/business/receive/asnDetail/asn-detail-api.ts new file mode 100644 index 0000000..fce8e14 --- /dev/null +++ b/smart-admin-web-typescript/src/api/business/receive/asnDetail/asn-detail-api.ts @@ -0,0 +1,48 @@ +/** + * 入库明细 api 封装 + * + * @Author: 霍锦 + * @Date: 2025-03-26 15:16:28 + * @Copyright 友仓 + */ +import {postRequest, getRequest} from '/@/lib/axios'; + +export const asnDetailApi = { + + /** + * 分页查询 @author 霍锦 + */ + queryPage: (param: object) => { + return postRequest('/asnDetail/queryPage', param); + }, + + /** + * 增加 @author 霍锦 + */ + add: (param: object) => { + return postRequest('/asnDetail/add', param); + }, + + /** + * 修改 @author 霍锦 + */ + update: (param: object) => { + return postRequest('/asnDetail/update', param); + }, + + + /** + * 删除 @author 霍锦 + */ + delete: (asnDetailId: number) => { + return getRequest('/asnDetail/delete', {asnDetailId}); + }, + + /** + * 批量删除 @author 霍锦 + */ + batchDelete: (idList: number[]) => { + return postRequest('/asnDetail/batchDelete', idList); + }, + +}; diff --git a/smart-admin-web-typescript/src/api/business/receive/asnDetail/asn-detail-const.ts b/smart-admin-web-typescript/src/api/business/receive/asnDetail/asn-detail-const.ts new file mode 100644 index 0000000..0ca4e82 --- /dev/null +++ b/smart-admin-web-typescript/src/api/business/receive/asnDetail/asn-detail-const.ts @@ -0,0 +1,11 @@ +/** + * 入库明细 枚举 + * + * @Author: 霍锦 + * @Date: 2025-03-26 15:16:28 + * @Copyright 友仓 + */ + + +export default { +}; \ No newline at end of file diff --git a/smart-admin-web-typescript/src/constants/support/table-id-const.ts b/smart-admin-web-typescript/src/constants/support/table-id-const.ts index ade4c88..589915d 100644 --- a/smart-admin-web-typescript/src/constants/support/table-id-const.ts +++ b/smart-admin-web-typescript/src/constants/support/table-id-const.ts @@ -46,6 +46,7 @@ export const TABLE_ID_CONST = { }, RECEIVE:{ ASN:businessRECEIVEInitTableId+1,//入库单 + ASN_DETAIL:businessRECEIVEInitTableId+2,//入库明细 } }, diff --git a/smart-admin-web-typescript/src/views/business/base/address/address-list.vue b/smart-admin-web-typescript/src/views/business/base/address/address-list.vue index be1e9af..1698367 100644 --- a/smart-admin-web-typescript/src/views/business/base/address/address-list.vue +++ b/smart-admin-web-typescript/src/views/business/base/address/address-list.vue @@ -110,6 +110,7 @@ + diff --git a/smart-admin-web-typescript/src/views/business/receive/asn/asn-form.vue b/smart-admin-web-typescript/src/views/business/receive/asn/asn-form.vue index 6b4cb9a..55a17e5 100644 --- a/smart-admin-web-typescript/src/views/business/receive/asn/asn-form.vue +++ b/smart-admin-web-typescript/src/views/business/receive/asn/asn-form.vue @@ -82,17 +82,13 @@ - - + + - - + - - - - - + + @@ -112,6 +108,7 @@ import {message} from "ant-design-vue"; import {SmartLoading} from "/@/components/framework/smart-loading"; import {asnApi} from "/@/api/business/receive/asn/asn-api"; import {smartSentry} from "/@/lib/smart-sentry"; +import ReceiveDetailList from "/@/views/business/receive/asn/receive-detail-list.vue"; // 表单 const formRef = ref(); @@ -163,9 +160,9 @@ onMounted(() => { const id = route.query.id; if (typeof id === 'string') { // 从sessionStorage中获取数据 - const res = JSON.parse(sessionStorage.getItem(id) as string); + const res = getDataFromSessionStorage(id); //编辑时自动填充数据 - if (res.asnId) { + if (res) { form.asnId = res.asnId; form.customerId = res.customerId; form.customerNumber = res.customerNumber; @@ -176,12 +173,22 @@ onMounted(() => { form.telephone = res.telephone; form.address = res.address; } - sessionStorage.removeItem(id); // 获取数据后移除存储项 + // 获取数据后移除存储项 + sessionStorage.removeItem(id); } - - }); +//从sessionStorage中获取数据 +function getDataFromSessionStorage(id: string) { + try { + const data = sessionStorage.getItem(id); + return data ? JSON.parse(data) : null; + } catch (error) { + message.error('解析 sessionStorage 数据时出错:'); + return null; + } +} + // 点击确定,验证表单 async function onSubmit() { try { diff --git a/smart-admin-web-typescript/src/views/business/receive/asn/asn-list.vue b/smart-admin-web-typescript/src/views/business/receive/asn/asn-list.vue index 52c2881..5df6c2b 100644 --- a/smart-admin-web-typescript/src/views/business/receive/asn/asn-list.vue +++ b/smart-admin-web-typescript/src/views/business/receive/asn/asn-list.vue @@ -64,7 +64,32 @@ :loading="tableLoading" :pagination="false" :row-selection="{ selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }" + @expand="querySubTableData" > + +