湖州项目前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

645 lines
18 KiB

1 year ago
import { FormSchema } from '@/components/Form';
import { BasicColumn } from '@/components/Table';
import { useDictStore } from '@/store/modules/dict';
const dictStore = useDictStore();
const reformTasksDicts: Array<Object> = dictStore.selectDictArray("reformTasks")
const roomDicts: Array<Object> = dictStore.selectDictArray("superLeader")
11 months ago
import { getWorkPlaceTypeDict, getContactorDict, getUserInfoByid ,getUserDictByRoles} from '../initiatesProjects/initiatesProjects.api'
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
import { getDutyWorkplaceList } from '@/views/informationSub/countStatistics/countStatistics.api';
async function getDutyWorkplaceOptions() {
let dutyWorkplaceOption = await getDutyWorkplaceList();
let uniqueList = [...new Set(dutyWorkplaceOption)];
let res = uniqueList.map((item) => {
return {
label: item,
value: item,
};
});
console.log('wwres', res);
return res;
}
1 year ago
// let manageOrgDict = await getWorkPlaceTypeDict({ workPlaceType: "1" })
// let supervisorDict = await getWorkPlaceTypeDict({ workPlaceType: "2" })
// let contructorDict = await getWorkPlaceTypeDict({ workPlaceType: "4" })
// let ownerDict = await getWorkPlaceTypeDict({ workPlaceType: "3" })
// let controlerDict = await getWorkPlaceTypeDict({ workPlaceType: "6" })
// let consultDict = await getWorkPlaceTypeDict({ workPlaceType: "5" })
// let manageOrgDict = []
// let supervisorDict = []
// let contructorDict = []
// let ownerDict = []
// let controlerDict = []
// let consultDict = []
export const projectInfoHistoryColumns: BasicColumn[] = [
{
title: '项目编号',
width: 150,
dataIndex: 'projectid',
ifShow:false,
},
{
title: '项目名称',
dataIndex: 'projectName',
width: 150,
align:'left',
},
{
title: '总修改次数',
dataIndex: 'total',
},
{
title: '行政区划',
dataIndex: 'adminDivision',
},
{
title: '改革所属项目',
dataIndex: 'reformName',
format: 'dict|reformTasks',
},
{
title: '上级指导处室',
dataIndex: 'superLeader',
format: 'dict|superLeader',
},
];
export const projectInfoHistoryDetailColumns:BasicColumn[] = [
{
title: '字段名称',
width: 150,
dataIndex: 'fieldName',
},
{
title: '字段修改次数',
dataIndex: 'fieldTotal',
},
{
title: '新值',
dataIndex: 'newvalue',
},
{
title: '旧值',
dataIndex: 'oldvalue',
},
{
title: '修改时间',
dataIndex: 'createDate',
},
]
export const searchFormSchema: FormSchema[] = [
{
label: '项目名称',
field: 'projectName',
component: 'Input',
//colProps: { span: 6 },
},
{
label: '项目编号',
field: 'projectId',
component: 'Input',
//colProps: { span: 6 },
}
];
11 months ago
export const historyformSchemas: FormSchema[] = [
{
//标题名称
label: '项目id',
//字段
field: 'id',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//标题宽度,支持数字和字符串
// labelWidth: 150,
// //标题长度,超过位数隐藏
// labelLength: 3,
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
ifShow: false,
},
{
//标题名称
label: '项目名称',
//字段
field: 'projectName',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//标题宽度,支持数字和字符串
// labelWidth: 150,
// //标题长度,超过位数隐藏
// labelLength: 3,
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
{
label: '行政区划',
field: 'adminDivision',
//子标题名称(在主标题后面)
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
// {
// label: '项目类型',
// field: 'projectType',
// component: 'Select',
// colProps: { span: 12 },
// //填写组件Select的属性
// componentProps: {
// options:projectTypeDict()
// },
// //默认值
// defaultValue: 1,
// required: true,
// },
{
label: '主要任务',
field: 'description',
//子标题名称(在主标题后面)
component: 'InputTextArea',
//一列占比总共24,比如一行显示2列
colProps: { span: 24 },
required: true,
},
{
//标题名称
label: '责任单位',
//字段
field: 'dutyWorkplace',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
{
//标题名称
label: '单位属性',
//字段
field: 'workplaceProperties',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
{
//标题名称
label: '建设周期(月)',
//字段
field: 'constructionPeriod',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
colProps: { span: 12 },
required: true,
},
{
//标题名称
label: '总投资(元)',
//字段
field: 'totalMoney',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
{
//标题名称
label: '中央资金(元)',
//字段
field: 'centralMoney',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
{
//标题名称
label: '省级资金(元)',
//字段
field: 'provincialMoney',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
{
//标题名称
label: '市级资金(元)',
//字段
field: 'cityMoney',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
{
//标题名称
label: '区县级资金(元)',
//字段
field: 'countyMoney',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
{
//标题名称
label: '自筹资金(元)',
//字段
field: 'selfMoney',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
{
//标题名称
label: '2023年支付(元)',
//字段
field: 'payamount2023Money',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
{
//标题名称
label: '2024年支付(元)',
//字段
field: 'payamount2024Money',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
}, {
//标题名称
label: '2025年支付(元)',
//字段
field: 'payamount2025Money',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
{
field: 'reformName',
label: '改革所属项目',
component: 'DictSelect',
componentProps: {
dictType: 'reformTasks',
},
itemProps: { validateTrigger: 'blur' },
colProps: { span: 12 },
required: true,
},
{
field: 'superLeader',
label: '任务牵头处室',
required: true,
component: 'DictSelect',
componentProps: {
dictType: 'superLeader',
},
itemProps: { validateTrigger: 'blur' },
colProps: { span: 12 },
},
{
//标题名称
label: '项目联系人',
//字段
field: 'projectContacts',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'ApiSelect',
componentProps: ({ formModel, formActionType }) => {
return {
//
api: () => getUserDictByRoles({ roles: "projectContact" }),
showSearch: true,
filterOption: (input: string, option: any) => { return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 },
onChange: async (value, option) => {
// formModel.manageContactor = undefined; // reset city value
const { updateSchema, setFieldsValue } = formActionType;
if (option?.phone) {
setFieldsValue({ phone: option.phone })
}
},
};
},
defaultValue: userStore.getUserInfo.id,
dynamicDisabled: true,
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
{
//标题名称
label: '联系电话',
//字段
field: 'phone',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
defaultValue: userStore.getUserInfo.phoneNumber,
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
dynamicDisabled: true,
},
{
//标题名称
label: '信息化工作专班',
//字段
field: 'manageOrg',
// component: 'Select',
// componentProps: {
// options: [
// { label: '信息化工作专班', value: '信息化工作专班' }]
// },
//一列占比总共24,比如一行显示2列
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'ApiSelect',
componentProps: ({ formModel, formActionType }) => {
return {
//
api: () => getWorkPlaceTypeDict({ roleCode: "manageOrg" }),
onChange: async (value) => {
// console.log(e)
let manageContactorDict = await getContactorDict({ workPlace: value, roleCode: "manageOrg" })
// formModel.manageContactor = undefined; // reset city value
const { updateSchema, setFieldsValue } = formActionType;
updateSchema({
field: 'manageContactor',
componentProps: {
options: manageContactorDict,
},
});
let ischange = true;
if (manageContactorDict?.length > 0) {
manageContactorDict.forEach(element => {
if (formModel.manageContactor == null || element.value == formModel.manageContactor) {
ischange = false
return;
}
});
}
if (ischange) {
setFieldsValue({ manageContactor: "" })
}
},
};
},
required: true,
// dynamicDisabled:true,
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
},
{
//标题名称
label: '管理单位负责人',
//字段
field: 'manageContactor',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Select',
// componentProps: {
// options: [
// {
// value: '1782674355449606145',
// label: '俞慧慧',
// }
// ],
// },
componentProps: (({ formModel }) => {
return {
options: [
],
}
}),
required: true,
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
},
{
//标题名称
label: '承建单位',
//字段
field: 'contructor',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'ApiSelect',
componentProps: ({ formModel, formActionType }) => {
return {
//
api: () => getWorkPlaceTypeDict({ roleCode: "contructor" }),
onChange: async (value) => {
// console.log(e)
let contructorContactorDict = await getContactorDict({ workPlace: value, roleCode: "contructor" })
// formModel.manageContactor = undefined; // reset city value
const { updateSchema, setFieldsValue } = formActionType;
updateSchema({
field: 'contructorContactor',
componentProps: {
options: contructorContactorDict,
},
});
let ischange = true;
if (contructorContactorDict?.length > 0) {
contructorContactorDict.forEach(element => {
if (formModel.contructorContactor == null || element.value == formModel.contructorContactor) {
ischange = false
return;
}
});
}
if (ischange) {
setFieldsValue({ contructorContactor: "" })
}
},
};
},
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
},
{
//标题名称
label: '承建单位负责人',
//字段
field: 'contructorContactor',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Select',
componentProps: {
options: [],
},
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
},
{
//标题名称
label: '监理单位',
//字段
field: 'controler',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'ApiSelect',
componentProps: ({ formModel, formActionType }) => {
return {
//
api: () => getWorkPlaceTypeDict({ roleCode: "controler" }),
onChange: async (value) => {
// console.log(e)
let controlerContactorDict = await getContactorDict({ workPlace: value, roleCode: "controler" })
// formModel.manageContactor = undefined; // reset city value
const { updateSchema, setFieldsValue } = formActionType;
updateSchema({
field: 'controlerContactor',
componentProps: {
options: controlerContactorDict,
}
});
let ischange = true;
if (controlerContactorDict?.length > 0) {
controlerContactorDict.forEach(element => {
if (formModel.controlerContactor == null || element.value == formModel.controlerContactor) {
ischange = false
return;
}
});
}
if (ischange) {
setFieldsValue({ controlerContactor: "" })
}
},
};
},
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
},
{
//标题名称
label: '监理单位负责人',
//字段
field: 'controlerContactor',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Select',
componentProps: {
options: [],
},
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
},
{
//标题名称
label: '咨询单位',
//字段
field: 'consult',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'ApiSelect',
componentProps: ({ formModel, formActionType }) => {
return {
//
api: () => getWorkPlaceTypeDict({ roleCode: "consult" }),
onChange: async (value) => {
// console.log(e)
let consultContactoDict = await getContactorDict({ workPlace: value, roleCode: "consult" })
// formModel.manageContactor = undefined; // reset city value
const { updateSchema, setFieldsValue } = formActionType;
updateSchema({
field: 'consultContactor',
componentProps: {
options: consultContactoDict,
}
});
let ischange = true;
if (consultContactoDict?.length > 0) {
consultContactoDict.forEach(element => {
if (formModel.consultContactor == null || element.value == formModel.consultContactor) {
ischange = false
return;
}
});
}
if (ischange) {
setFieldsValue({ consultContactor: "" })
}
},
};
},
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
},
{
//标题名称
label: '咨询单位负责人',
//字段
field: 'consultContactor',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Select',
componentProps: {
options: [],
},
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
},
{
//标题名称
label: '项目状态',
//字段
field: 'stage',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
ifShow: false
}
];