From b63f8c81cbafa3b266b82db031cc6aa53e13b08e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?=
<14166000+zhangtonghai@user.noreply.gitee.com>
Date: Tue, 15 Oct 2024 10:33:38 +0800
Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=B4=B9=E7=94=A8=E6=A8=A1?=
=?UTF-8?q?=E6=9D=BF=20=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../FeeCustTemplate/TenantAuditStepModal.vue | 15 +++++++++++++++
.../infoclient/FeeCustTemplate/columns.tsx | 13 ++++++-------
.../fee/FeeCustTemplate/TenantAuditStepModal.vue | 16 +++++++++++++++-
src/views/fee/FeeCustTemplate/columns.tsx | 13 ++++++-------
src/views/fee/FeeCustTemplate/feeField.vue | 7 +++++--
5 files changed, 47 insertions(+), 17 deletions(-)
diff --git a/src/views/baseinfo/infoclient/FeeCustTemplate/TenantAuditStepModal.vue b/src/views/baseinfo/infoclient/FeeCustTemplate/TenantAuditStepModal.vue
index 8143894d..7c15e889 100644
--- a/src/views/baseinfo/infoclient/FeeCustTemplate/TenantAuditStepModal.vue
+++ b/src/views/baseinfo/infoclient/FeeCustTemplate/TenantAuditStepModal.vue
@@ -53,6 +53,7 @@
import { formSchema } from './columns'
// 相关接口
import { ApiEdit, ApiInfo } from './api'
+ import { feeUnitDict } from '/@/hooks/dict/index'
// 提升消息混入
import { useMessage } from '/@/hooks/web/useMessage'
import { useUserStore } from '/@/store/modules/user'
@@ -90,6 +91,14 @@
setFieldsValue({
...res.data,
})
+ const UnitList = await feeUnitDict()
+ res.data.details.forEach((item) => {
+ UnitList.forEach((e: any) => {
+ if (e.value == item.unit) {
+ item.unitText = e.name
+ }
+ })
+ })
feeField.value.SetData(res.data.details)
feeField.value.condition = res.data.condition
detailId.value = res.data.id
@@ -103,8 +112,14 @@
...res.data,
id: '',
})
+ const UnitList = await feeUnitDict()
res.data.details.forEach((item) => {
delete item.id
+ UnitList.forEach((e: any) => {
+ if (e.value == item.unit) {
+ item.unitText = e.name
+ }
+ })
})
feeField.value.SetData(res.data.details)
feeField.value.condition = res.data.condition
diff --git a/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx b/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx
index d3aef981..f94cd20d 100644
--- a/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx
+++ b/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx
@@ -58,9 +58,9 @@ export const columns: BasicColumn[] = [
dataIndex: 'isDisabled',
width: 120,
customRender: ({ text }) => {
- if (text === true) {
+ if (text === false) {
return 启用
- } else if (text == false) {
+ } else if (text == true) {
return 禁用
}
return text
@@ -145,11 +145,10 @@ export const searchFormSchema: FormSchema[] = [
colProps: { span: 4 },
componentProps: {
checkedChildren: '启用',
- checkedValue: 1,
+ checkedValue: 0,
unCheckedChildren: '禁用',
- unCheckedValue: 0,
+ unCheckedValue: 1,
},
- defaultValue: 1,
},
{
field: 'priority',
@@ -476,9 +475,9 @@ export const formSchema: FormSchema[] = [
component: 'Switch',
componentProps: {
checkedChildren: '启用',
- checkedValue: true,
+ checkedValue: false,
unCheckedChildren: '禁用',
- unCheckedValue: false,
+ unCheckedValue: true,
},
defaultValue: true,
colProps: {
diff --git a/src/views/fee/FeeCustTemplate/TenantAuditStepModal.vue b/src/views/fee/FeeCustTemplate/TenantAuditStepModal.vue
index 43314d6e..b2f633a5 100644
--- a/src/views/fee/FeeCustTemplate/TenantAuditStepModal.vue
+++ b/src/views/fee/FeeCustTemplate/TenantAuditStepModal.vue
@@ -53,6 +53,7 @@
import { formSchema } from './columns'
// 相关接口
import { ApiEdit, ApiInfo } from './api'
+ import { feeUnitDict } from '/@/hooks/dict/index'
// 提升消息混入
import { useMessage } from '/@/hooks/web/useMessage'
import { useUserStore } from '/@/store/modules/user'
@@ -92,13 +93,20 @@
setFieldsValue({
...res.data,
})
+ const UnitList = await feeUnitDict()
+ res.data.details.forEach((item) => {
+ UnitList.forEach((e: any) => {
+ if (e.value == item.unit) {
+ item.unitText = e.name
+ }
+ })
+ })
feeField.value.SetData(res.data.details)
feeField.value.condition = res.data.condition
detailId.value = res.data.id
}
} else {
if (unref(isSave)) {
- console.log(data.record, 1111111111111)
setModalProps({ confirmLoading: true })
// const res: API.DataResult = await ApiInfo({ id: unref(data.record.id) })
// if (res.succeeded) {
@@ -127,8 +135,14 @@
...res.data,
id: '',
})
+ const UnitList = await feeUnitDict()
res.data.details.forEach((item) => {
delete item.id
+ UnitList.forEach((e: any) => {
+ if (e.value == item.unit) {
+ item.unitText = e.name
+ }
+ })
})
feeField.value.SetData(res.data.details)
feeField.value.condition = res.data.condition
diff --git a/src/views/fee/FeeCustTemplate/columns.tsx b/src/views/fee/FeeCustTemplate/columns.tsx
index d8784798..9c027bd2 100644
--- a/src/views/fee/FeeCustTemplate/columns.tsx
+++ b/src/views/fee/FeeCustTemplate/columns.tsx
@@ -63,9 +63,9 @@ export const columns: BasicColumn[] = [
dataIndex: 'isDisabled',
width: 120,
customRender: ({ text }) => {
- if (text === true) {
+ if (text === false) {
return 启用
- } else if (text == false) {
+ } else if (text == true) {
return 禁用
}
return text
@@ -150,11 +150,10 @@ export const searchFormSchema: FormSchema[] = [
colProps: { span: 4 },
componentProps: {
checkedChildren: '启用',
- checkedValue: 1,
+ checkedValue: 0,
unCheckedChildren: '禁用',
- unCheckedValue: 0,
+ unCheckedValue: 1,
},
- defaultValue: 1,
},
{
field: 'priority',
@@ -516,9 +515,9 @@ export const formSchema: FormSchema[] = [
component: 'Switch',
componentProps: {
checkedChildren: '启用',
- checkedValue: true,
+ checkedValue: false,
unCheckedChildren: '禁用',
- unCheckedValue: false,
+ unCheckedValue: true,
},
defaultValue: true,
colProps: {
diff --git a/src/views/fee/FeeCustTemplate/feeField.vue b/src/views/fee/FeeCustTemplate/feeField.vue
index 5a77a296..f20366b7 100644
--- a/src/views/fee/FeeCustTemplate/feeField.vue
+++ b/src/views/fee/FeeCustTemplate/feeField.vue
@@ -280,11 +280,12 @@
{
title: '单位标准',
width: 130,
- data: 'unit',
+ data: 'unitText',
type: 'dropdown',
source: async (query, process) => {
if (unitDict.value && unitDict.value.length) {
const dict = unitDict.value.map((item) => {
+ console.log(item, 11111111111111)
return item.name
})
process(dict)
@@ -292,6 +293,7 @@
const results = await feeUnitDict()
unitDict.value = results
const dict = results.map((item) => {
+ console.log(item, 11111111111111)
return item.name
})
process(dict)
@@ -632,12 +634,13 @@
}
})
// 修改单位
- if (changes[0][1] === 'unit') {
+ if (changes[0][1] === 'unitText') {
const item = unitDict.value.filter((item) => {
return changes[0][3].includes(item.name)
})
if (item) dict = item[0]
list.value[changes[0][0]]['unit'] = dict?.value
+ list.value[changes[0][0]]['unitText'] = dict?.label
// list.value[changes[0][0]]['unitText'] = changes[0][3].split('-')[1]
// 业务数据有件数,修改单位,带出件数
// const text = list.value[changes[0][0]]['unitText']