From 7c4ab845b1ea52e2c8f86a8d0182f70c0e6e5d2e Mon Sep 17 00:00:00 2001 From: chenshuichuan <1154693969@qq.com> Date: Thu, 27 Jun 2024 09:39:00 +0800 Subject: [PATCH] fix mes stock in and out type --- src/api/erp/stock/in/index.ts | 13 +- src/api/erp/stock/out/index.ts | 1 + src/views/erp/stock/in/StockInForm.vue | 49 +++- src/views/erp/stock/in/index.vue | 12 + src/views/erp/stock/out/StockOutForm.vue | 66 +++-- src/views/mes/stockin/StockInForm.vue | 24 +- .../stockin/components/StockInItemForm.vue | 267 ++++++++++++++++++ src/views/mes/stockin/index.vue | 12 +- 8 files changed, 395 insertions(+), 49 deletions(-) create mode 100644 src/views/mes/stockin/components/StockInItemForm.vue diff --git a/src/api/erp/stock/in/index.ts b/src/api/erp/stock/in/index.ts index 148b64f2..5148d521 100644 --- a/src/api/erp/stock/in/index.ts +++ b/src/api/erp/stock/in/index.ts @@ -6,6 +6,7 @@ export interface StockInVO { no: string // 入库单号 supplierId: number // 供应商编号 inTime: Date // 入库时间 + inType: string //入库类型 totalCount: number // 合计数量 totalPrice: number // 合计金额,单位:元 status: number // 状态 @@ -58,5 +59,15 @@ export const StockInApi = { // 导出其它入库单 Excel exportStockIn: async (params) => { return await request.download({ url: `/erp/stock-in/export-excel`, params }) - } + }, + + // 查询其它入库单分页 + getMesStockInPage: async (params: any) => { + return await request.get({ url: `/erp/stock-in/pageMesStockIn`, params }) + }, + // 新增其它入库单 + createMesStockIn: async (data: StockInVO) => { + return await request.post({ url: `/erp/stock-in/createMesStockIn`, data }) + }, + } diff --git a/src/api/erp/stock/out/index.ts b/src/api/erp/stock/out/index.ts index 72d0ec8b..c62d2de8 100644 --- a/src/api/erp/stock/out/index.ts +++ b/src/api/erp/stock/out/index.ts @@ -6,6 +6,7 @@ export interface StockOutVO { no: string // 出库单号 customerId: number // 客户编号 outTime: Date // 出库时间 + outType: string //出库类型 totalCount: number // 合计数量 totalPrice: number // 合计金额,单位:元 status: number // 状态 diff --git a/src/views/erp/stock/in/StockInForm.vue b/src/views/erp/stock/in/StockInForm.vue index f36bbb60..4b934ec6 100644 --- a/src/views/erp/stock/in/StockInForm.vue +++ b/src/views/erp/stock/in/StockInForm.vue @@ -14,6 +14,25 @@ + + + + + + + - + formType.value === 'detail') const formRef = ref() // 表单 Ref const supplierList = ref([]) // 供应商列表 +const options = [ + { + value: '其他入库', + label: '其他入库', + }, + { + value: '关键件入库', + label: '关键件入库', + + }, + { + value: '原料入库', + label: '原料入库', + }, + { + value: '产品入库', + label: '产品入库', + }, + { + value: '生产入库', + label: '生产入库', + disabled: true, + }, +] /** 子表的表单 */ const subTabsName = ref('item') const itemFormRef = ref() diff --git a/src/views/erp/stock/in/index.vue b/src/views/erp/stock/in/index.vue index 92b23741..a07f05e6 100644 --- a/src/views/erp/stock/in/index.vue +++ b/src/views/erp/stock/in/index.vue @@ -147,6 +147,13 @@ + + + + + + + { }) // TODO 芋艿:可优化功能:列表界面,支持导入 // TODO 芋艿:可优化功能:详情界面,支持打印 +let activeName = '产品入库' +const handleTabClick = (tab: TabsPaneContext) => { + queryParams.outType = tab.paneName + handleQuery() +} diff --git a/src/views/erp/stock/out/StockOutForm.vue b/src/views/erp/stock/out/StockOutForm.vue index 5a48a060..25ac3689 100644 --- a/src/views/erp/stock/out/StockOutForm.vue +++ b/src/views/erp/stock/out/StockOutForm.vue @@ -15,16 +15,21 @@ - - - - {{ dict.label }} - - + + + + @@ -39,23 +44,26 @@ - + + + formType.value === 'detail') const formRef = ref() // 表单 Ref const customerList = ref([]) // 客户列表 +const options = [ + { + value: '其他出库', + label: '其他出库', + }, + { + value: '关键件出库', + label: '关键件出库', + + }, + { + value: '原料出库', + label: '原料出库', + }, + { + value: '产品出库', + label: '产品出库', + }, + { + value: '领料出库', + label: '领料出库', + disabled: true, + }, +] /** 子表的表单 */ const subTabsName = ref('item') const itemFormRef = ref() diff --git a/src/views/mes/stockin/StockInForm.vue b/src/views/mes/stockin/StockInForm.vue index f36bbb60..b52f0ff6 100644 --- a/src/views/mes/stockin/StockInForm.vue +++ b/src/views/mes/stockin/StockInForm.vue @@ -25,24 +25,6 @@ /> - - - - - - - formType.value === 'detail') const formRef = ref() // 表单 Ref -const supplierList = ref([]) // 供应商列表 + /** 子表的表单 */ const subTabsName = ref('item') @@ -125,8 +107,6 @@ const open = async (type: string, id?: number) => { formLoading.value = false } } - // 加载供应商列表 - supplierList.value = await SupplierApi.getSupplierSimpleList() } defineExpose({ open }) // 提供 open 方法,用于打开弹窗 @@ -141,7 +121,7 @@ const submitForm = async () => { try { const data = formData.value as unknown as StockInVO if (formType.value === 'create') { - await StockInApi.createStockIn(data) + await StockInApi.createMesStockIn(data) message.success(t('common.createSuccess')) } else { await StockInApi.updateStockIn(data) diff --git a/src/views/mes/stockin/components/StockInItemForm.vue b/src/views/mes/stockin/components/StockInItemForm.vue new file mode 100644 index 00000000..0f667c00 --- /dev/null +++ b/src/views/mes/stockin/components/StockInItemForm.vue @@ -0,0 +1,267 @@ + + diff --git a/src/views/mes/stockin/index.vue b/src/views/mes/stockin/index.vue index 8d000740..c2ed75ef 100644 --- a/src/views/mes/stockin/index.vue +++ b/src/views/mes/stockin/index.vue @@ -62,7 +62,7 @@ /> - + ([]) // 产品列表 const warehouseList = ref([]) // 仓库列表 -const supplierList = ref([]) // 供应商列表 -const userList = ref([]) // 用户列表 + /** 查询列表 */ const getList = async () => { loading.value = true try { - const data = await StockInApi.getStockInPage(queryParams) + const data = await StockInApi.getMesStockInPage(queryParams) list.value = data.list total.value = data.total } finally { @@ -325,10 +324,9 @@ const handleSelectionChange = (rows: StockInVO[]) => { onMounted(async () => { await getList() // 加载产品、仓库列表、供应商 - productList.value = await ProductApi.getProductSimpleList() + productList.value = await ProductApi.getMesProductSimpleList() warehouseList.value = await WarehouseApi.getWarehouseSimpleList() - supplierList.value = await SupplierApi.getSupplierSimpleList() - userList.value = await UserApi.getSimpleUserList() + }) // TODO 芋艿:可优化功能:列表界面,支持导入 // TODO 芋艿:可优化功能:详情界面,支持打印