From 58d03b091851d3066df56b6b43b3d3c07d2f1c5e Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Fri, 16 Aug 2024 11:39:39 +0800 Subject: [PATCH] =?UTF-8?q?HL-5374=E7=9B=98=E7=82=B9=E8=AE=A1=E5=88=92=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=97=B6=EF=BC=8C=E4=B8=8D=E6=8B=86=E5=88=86?= =?UTF-8?q?=E6=97=B6=E5=8F=AA=E8=83=BD=E7=9B=B2=E7=9B=98=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E6=98=8E=E7=9B=98=EF=BC=8C=E5=BA=94=E8=AF=A5=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../count/countPlanMain/countPlanMain.data.ts | 44 ++++++----- .../countManage/count/countPlanMain/index.vue | 77 ++++++++++++------- 2 files changed, 74 insertions(+), 47 deletions(-) diff --git a/src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts b/src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts index a658c2a95..1ae19c31c 100644 --- a/src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts +++ b/src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts @@ -90,6 +90,25 @@ export const CountPlanMain = useCrudSchemas(reactive([ // } // } // }, + { + label: '明盘', + field: 'isOpenCount', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + form: { + component: 'Switch', + value: 'FALSE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, { label: '任务拆分方式', field: 'countSplitType', @@ -102,7 +121,10 @@ export const CountPlanMain = useCrudSchemas(reactive([ isTable:true, isForm: true, form: { - value: 'locationCode' + value: 'masterId', + componentProps: { + disabled:true + } } }, @@ -211,25 +233,7 @@ export const CountPlanMain = useCrudSchemas(reactive([ width: 150 }, }, - { - label: '明盘', - field: 'isOpenCount', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', - isTable: true, - form: { - component: 'Switch', - value: 'FALSE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' - } - }, - sort: 'custom', - table: { - width: 150 - }, - }, + { label: '业务类型', field: 'businessType', diff --git a/src/views/wms/countManage/count/countPlanMain/index.vue b/src/views/wms/countManage/count/countPlanMain/index.vue index acc297ea5..cf020b296 100644 --- a/src/views/wms/countManage/count/countPlanMain/index.vue +++ b/src/views/wms/countManage/count/countPlanMain/index.vue @@ -307,7 +307,7 @@ const buttonTableClick = async (val, row) => { .then(() => { message.success(t('打开成功')) tableObject.loading = false - buttonBaseClick('refresh',null) + buttonBaseClick('refresh', null) }) .catch((err) => { tableObject.loading = false @@ -321,7 +321,7 @@ const buttonTableClick = async (val, row) => { .then(() => { message.success(t('关闭成功')) tableObject.loading = false - buttonBaseClick('refresh',null) + buttonBaseClick('refresh', null) }) .catch((err) => { tableObject.loading = false @@ -334,7 +334,7 @@ const buttonTableClick = async (val, row) => { await CountPlanMainApi.submit(row.id) message.success(t('提交审批成功')) tableObject.loading = false - buttonBaseClick('refresh',null) + buttonBaseClick('refresh', null) } else if (val == 'mainPlanTur') { // 驳回 await message.confirm('确认要驳回吗?') @@ -343,7 +343,7 @@ const buttonTableClick = async (val, row) => { .then(() => { message.success(t('驳回成功')) tableObject.loading = false - buttonBaseClick('refresh',null) + buttonBaseClick('refresh', null) }) .catch((err) => { tableObject.loading = false @@ -357,7 +357,7 @@ const buttonTableClick = async (val, row) => { .then(() => { message.success(t('审批已通过')) tableObject.loading = false - buttonBaseClick('refresh',null) + buttonBaseClick('refresh', null) }) .catch((err) => { tableObject.loading = false @@ -371,7 +371,7 @@ const buttonTableClick = async (val, row) => { .then(() => { message.success(t('发布成功')) tableObject.loading = false - buttonBaseClick('refresh',null) + buttonBaseClick('refresh', null) }) .catch((err) => { tableObject.loading = false @@ -385,7 +385,7 @@ const buttonTableClick = async (val, row) => { .then(() => { message.success(t('common.updateSuccess')) tableObject.loading = false - buttonBaseClick('refresh',null) + buttonBaseClick('refresh', null) }) .catch((err) => { tableObject.loading = false @@ -401,6 +401,22 @@ const buttonTableClick = async (val, row) => { } const onChange = (field, value) => { console.log(field, value) + if (field == 'isOpenCount') { + if (value == 'FALSE') { + CountPlanMain.allSchemas.formSchema.forEach((item) => { + if (item.field == 'countSplitType') { + item.componentProps.disabled = true + } + }) + formRef.value.formRef.formModel.countSplitType = 'masterId' + } else { + CountPlanMain.allSchemas.formSchema.forEach((item) => { + if (item.field == 'countSplitType') { + item.componentProps.disabled = false + } + }) + } + } } /** 添加/修改操作 */ const formRef = ref() @@ -419,22 +435,29 @@ const openForm = async (type: string, row?: any) => { // } // }) if (row.type == 'CYCLE') { - CountPlanMain.allSchemas.formSchema.forEach((item) => { - if (item.field == 'crontab') { - item.componentProps.disabled = false - item.label = '执行周期' - } - }) - CountPlanMainRules.crontab[0].required = true - } else { - CountPlanMainRules.crontab[0].required = false - CountPlanMain.allSchemas.formSchema.forEach((item) => { - if (item.field == 'crontab') { - item.componentProps.disabled = true - item.label = '' - } - }) - } + CountPlanMain.allSchemas.formSchema.forEach((item) => { + if (item.field == 'crontab') { + item.componentProps.disabled = false + item.label = '执行周期' + } + }) + CountPlanMainRules.crontab[0].required = true + } else { + CountPlanMainRules.crontab[0].required = false + CountPlanMain.allSchemas.formSchema.forEach((item) => { + if (item.field == 'crontab') { + item.componentProps.disabled = true + item.label = '' + } + }) + } + if (type == 'create') { + CountPlanMain.allSchemas.formSchema.forEach((item) => { + if (item.field == 'countSplitType') { + item.componentProps.disabled = true + } + }) + } formRef.value.open(type, row) // Promise.all([getOwnerAllList(), @@ -458,7 +481,7 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { // getAreaAllList() // getLocationgroupAllList() // getLocationAllList() - detailRef.value.openDetail(row, titleName, titleValue,"planCountMain") + detailRef.value.openDetail(row, titleName, titleValue, 'planCountMain') } // 详情打开的编辑的时候设置盘点范围值列表 const detailOpenForm = (type, row) => { @@ -607,7 +630,7 @@ const handleDelete = async (id: number) => { tableObject.loading = false message.success(t('common.delSuccess')) // 刷新列表 - buttonBaseClick('refresh',null) + buttonBaseClick('refresh', null) } finally { tableObject.loading = false } @@ -693,8 +716,8 @@ const submitForm = async (formType, data) => { // 刷新当前列表 if (formType === 'create') { getList() - }else{ - buttonBaseClick('refresh',null) + } else { + buttonBaseClick('refresh', null) } } finally { formRef.value.formLoading = false