自动费用模板 调整

feature-JimuReport-1106-yjl
张同海 1 month ago
parent da4656284b
commit b63f8c81cb

@ -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

@ -58,9 +58,9 @@ export const columns: BasicColumn[] = [
dataIndex: 'isDisabled',
width: 120,
customRender: ({ text }) => {
if (text === true) {
if (text === false) {
return <Tag color="success"></Tag>
} else if (text == false) {
} else if (text == true) {
return <Tag color="error"></Tag>
}
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: {

@ -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

@ -63,9 +63,9 @@ export const columns: BasicColumn[] = [
dataIndex: 'isDisabled',
width: 120,
customRender: ({ text }) => {
if (text === true) {
if (text === false) {
return <Tag color="success"></Tag>
} else if (text == false) {
} else if (text == true) {
return <Tag color="error"></Tag>
}
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: {

@ -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']

Loading…
Cancel
Save