From 496d50ab36e955bc1f65c8cf427c12da6f9cc40b Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Fri, 27 Sep 2024 09:07:19 +0800 Subject: [PATCH 1/3] =?UTF-8?q?YT-166=E7=89=A9=E6=96=99=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/itemSyntheticRelation/index.ts | 54 ++++ .../itemSyntheticRelation/index.vue | 244 ++++++++++++++++++ .../itemSyntheticRelation.data.ts | 95 +++++++ 3 files changed, 393 insertions(+) create mode 100644 src/api/wms/itemSyntheticRelation/index.ts create mode 100644 src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/index.vue create mode 100644 src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts diff --git a/src/api/wms/itemSyntheticRelation/index.ts b/src/api/wms/itemSyntheticRelation/index.ts new file mode 100644 index 000000000..a3139afed --- /dev/null +++ b/src/api/wms/itemSyntheticRelation/index.ts @@ -0,0 +1,54 @@ +import request from '@/config/axios' + +export interface ItemSyntheticRelationVO { + code: string + name: string + itemCode: string + itemName: string + creatorName: string + updaterName: string + deleteTime: Date + deleter: string + deleteName: string +} + +// 查询物料组合关系列表 +export const getItemSyntheticRelationPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/item-synthetic-relation/senior', data }) + } else { + return await request.get({ url: `/wms/item-synthetic-relation/page`, params }) + } +} + +// 查询物料组合关系详情 +export const getItemSyntheticRelation = async (id: number) => { + return await request.get({ url: `/wms/item-synthetic-relation/get?id=` + id }) +} + +// 新增物料组合关系 +export const createItemSyntheticRelation = async (data: ItemSyntheticRelationVO) => { + return await request.post({ url: `/wms/item-synthetic-relation/create`, data }) +} + +// 修改物料组合关系 +export const updateItemSyntheticRelation = async (data: ItemSyntheticRelationVO) => { + return await request.put({ url: `/wms/item-synthetic-relation/update`, data }) +} + +// 删除物料组合关系 +export const deleteItemSyntheticRelation = async (id: number) => { + return await request.delete({ url: `/wms/item-synthetic-relation/delete?id=` + id }) +} + +// 导出物料组合关系 Excel +export const exportItemSyntheticRelation = async (params) => { + return await request.download({ url: `/wms/item-synthetic-relation/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/item-synthetic-relation/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/index.vue b/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/index.vue new file mode 100644 index 000000000..a8b25d9e0 --- /dev/null +++ b/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts b/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts new file mode 100644 index 000000000..4b6996416 --- /dev/null +++ b/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts @@ -0,0 +1,95 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import {Area} from "@/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data"; +import * as AreaApi from "@/api/wms/areabasic"; +import {Itembasic} from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data"; +import * as ItembasicApi from "@/api/wms/itembasic"; + +// 表单校验 +export const ItemSyntheticRelationRules = reactive({ + name: [required], + itemCode: [required], + available: [required], +}) + +export const ItemSyntheticRelation = useCrudSchemas(reactive([ + { + label: '组合号', + field: 'code', + sort: 'custom', + isSearch: true, + isForm: false, + }, + { + label: '组合名称', + field: 'name', + sort: 'custom', + isSearch: true, + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + multiple: true, + enterSearch: true, //可输入回车 + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择物料代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '物料基础信息', // 查询弹窗标题 + searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 + searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: 'true', + isFormModel: true + }], // 失去焦点校验参数 + } + } + }, + { + label: '物料名称', + field: 'itemName', + sort: 'custom', + isSearch: true, + isForm:false, + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + table: { + width: 120 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) From 35f5473361471a4720b75d94a64914de869cbe5c Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Fri, 27 Sep 2024 09:29:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=89=A9=E6=96=99=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=E7=89=A9=E6=96=99=E4=BB=A3=E7=A0=81=E6=98=AF?= =?UTF-8?q?=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../itemManage/itemSyntheticRelation/index.vue | 7 ++++++- .../itemSyntheticRelation/itemSyntheticRelation.data.ts | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/index.vue b/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/index.vue index a8b25d9e0..fd91b2411 100644 --- a/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/index.vue +++ b/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/index.vue @@ -80,7 +80,12 @@ const tableColumns = ref(ItemSyntheticRelation.allSchemas.tableColumns) const searchTableSuccess = (formField, searchField, val, formRef) => { nextTick(() => { const setV = {} - setV[formField] = val[0][searchField] + if (formField == 'itemCode') { + setV[formField] = val.map(item=>item.code).join(',') + setV['itemName'] = val.map(item=>item.name).join(',') + } else { + setV[formField] = val[0][searchField] + } formRef.setValues(setV) }) } diff --git a/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts b/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts index 4b6996416..1710f055f 100644 --- a/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts +++ b/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts @@ -41,6 +41,7 @@ export const ItemSyntheticRelation = useCrudSchemas(reactive([ searchTitle: '物料基础信息', // 查询弹窗标题 searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 + verificationPage: ItembasicApi.getItemListByCodes, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', From 5c3b6c16186f2ccda9202bb9881ce8d74ca698e6 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Fri, 27 Sep 2024 14:03:12 +0800 Subject: [PATCH 3/3] =?UTF-8?q?YT-166=E7=89=A9=E6=96=99=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../itemManage/itemSyntheticRelation/index.vue | 12 ++++++++++-- .../itemSyntheticRelation.data.ts | 4 +--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/index.vue b/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/index.vue index fd91b2411..aca0b5a0c 100644 --- a/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/index.vue +++ b/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/index.vue @@ -54,7 +54,15 @@ - +