From a2e9db2a4068f780f039453680b7fd38cfd21f3d Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Fri, 22 Nov 2024 09:46:53 +0800 Subject: [PATCH] =?UTF-8?q?YT-1186=E5=8F=91=E8=B4=A7=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=EF=BC=8C=E5=8F=AF=E7=BC=96=E8=BE=91=E7=9A=84=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=20=E2=80=9C=E5=8F=91=E8=B4=A7=E7=B1=BB=E5=9E=8B=E2=80=9D=20?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=8C=E5=85=B6=E4=BD=99=E7=9A=86=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=A6=82=E5=9B=BE=EF=BC=88?= =?UTF-8?q?=E9=9C=80=E6=B1=82=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/deliverRecordDetail/index.ts | 4 ++ .../deliverRecordMain.data.ts | 45 +++++++++++++----- .../deliverRecordMain/index.vue | 47 ++++++++++++++++--- 3 files changed, 77 insertions(+), 19 deletions(-) diff --git a/src/api/wms/deliverRecordDetail/index.ts b/src/api/wms/deliverRecordDetail/index.ts index 293f1c00a..b222acae4 100644 --- a/src/api/wms/deliverRecordDetail/index.ts +++ b/src/api/wms/deliverRecordDetail/index.ts @@ -68,6 +68,10 @@ export const createDeliverRecordDetail = async (data: DeliverRecordDetailVO) => export const updateDeliverRecordDetail = async (data: DeliverRecordDetailVO) => { return await request.put({ url: `/wms/deliver-record-detail/update`, data }) } +// 修改所有子表发货记录 +export const updateDeliverRecordDetailAll = async (data) => { + return await request.put({ url: `/wms/deliver-record-detail/updateByMasterId`, data }) +} // 删除发货记录子 export const deleteDeliverRecordDetail = async (id: number) => { diff --git a/src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts b/src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts index 4d04ca31d..28fc088e2 100644 --- a/src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts +++ b/src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts @@ -18,9 +18,9 @@ export const DeliverRecordMain = useCrudSchemas( width: 180, fixed: 'left' }, - isSearch: true + isSearch: true, + isForm:false, }, - { label: '发货类型', field: 'businessType', @@ -40,7 +40,8 @@ export const DeliverRecordMain = useCrudSchemas( table: { width: 150 }, - isSearch: true + isSearch: true, + isForm: false, }, { label: '客户月台代码', @@ -49,7 +50,8 @@ export const DeliverRecordMain = useCrudSchemas( table: { width: 150 }, - isTable: true + isTable: true, + isForm: false, }, { label: '客户订单号', @@ -60,10 +62,10 @@ export const DeliverRecordMain = useCrudSchemas( }, isSearch: true, isTable: true, - isForm: true, search: { component: 'Input', - } + }, + isForm: false, }, { label: '车牌号', @@ -72,7 +74,8 @@ export const DeliverRecordMain = useCrudSchemas( table: { width: 150 }, - isTable: false + isTable: false, + isForm: false, }, { label: '截止时间', @@ -93,7 +96,8 @@ export const DeliverRecordMain = useCrudSchemas( dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x' } - } + }, + isForm: false, }, { label: '从仓库代码', @@ -102,7 +106,8 @@ export const DeliverRecordMain = useCrudSchemas( table: { width: 150 }, - isTable: false + isTable: false, + isForm: false, }, { label: '到仓库代码', @@ -111,7 +116,8 @@ export const DeliverRecordMain = useCrudSchemas( table: { width: 150 }, - isTable: false + isTable: false, + isForm: false, }, { label: '创建时间', @@ -125,6 +131,7 @@ export const DeliverRecordMain = useCrudSchemas( width: 180 }, isTable: false, + isForm:false, form: { component: 'DatePicker', componentProps: { @@ -150,7 +157,8 @@ export const DeliverRecordMain = useCrudSchemas( table: { width: 150 }, - isTable: false + isTable: false, + isForm: false, }, // { // label: '代码', @@ -178,7 +186,20 @@ export const DeliverRecordMain = useCrudSchemas( inactiveValue: 'FALSE', activeValue: 'TRUE' } - } + }, + isForm: false, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 150, + fixed: 'right' + }, + hiddenInMain: true, + isTableForm: false, } ]) ) diff --git a/src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/index.vue b/src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/index.vue index 464f07310..4faea3df5 100644 --- a/src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/index.vue +++ b/src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/index.vue @@ -38,13 +38,11 @@ { if(findIndex>-1&&findIndex<$index){ return [] }else{ - return [defaultButtons.mainListDocumentPrintBtn(null),] // 标签打印 + return [ + // defaultButtons.mainListDocumentPrintBtn(null), // 标签打印 + defaultButtons.mainListEditBtn(null), // 编辑 + ] } } // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { - if (val == 'documentPrint') { // 标签打印 - handlePoint(row) + if (val == 'edit') { // 编辑 + openForm('update', row) } } +/** 添加/修改操作 */ +const basicFormRef = ref() +const tableData = ref([]) +const openForm = (type: string, row?: any) => { + tableData.value = [] + basicFormRef.value.open(type, row) +} // 获取部门 用于详情 部门回显 const { wsCache } = useCache() @@ -267,6 +275,31 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => formRef.setValues(setV) } } +// 主子数据 提交 +const submitForm = async (formType, submitData) => { + let data = {...submitData} + if(data.masterId){ + data.id = data.masterId + } + + try { + if (formType === 'create') { + await DeliverRecordMainApi.createDeliverRecordMain(data) + message.success(t('common.createSuccess')) + getList() + } else { + await DeliverRecordMainApi.updateDeliverRecordMain(data) + await DeliverRecordDetailApi.updateDeliverRecordDetailAll(data) + message.success(t('common.updateSuccess')) + basicFormRef.value.dialogVisible = false + buttonBaseClick('refresh',null) + } + + } finally { + basicFormRef.value.formLoading = false + } +} + /** 初始化 **/ onMounted(async () => {