This commit is contained in:
‘huanghaiixia’
2026-02-27 17:28:41 +08:00
parent b56418cd38
commit 1ec6bede47
20 changed files with 280 additions and 132 deletions

View File

@ -58,7 +58,7 @@
import {formConfig, searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index';
import FlowRecord from '/@/views/workflow/task/components/flow/FlowRecord.vue';
import dayjs from 'dayjs';
import useEventBus from '/@/hooks/event/useEventBus';
import { cloneDeep } from 'lodash-es';
import { useUserStore } from '/@/store/modules/user';
@ -118,6 +118,8 @@
const [registerModal, { openModal }] = useModal();
// const formName='合同要素';
const formName=currentRoute.value.meta?.title;
const defaultDate = ref([dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]);
const comIdList = ref([])
const [registerTable, { reload, }] = useTable({
title: '' || (formName + '列表'),
api: getLngContractFactPage,
@ -127,10 +129,58 @@
rowProps: {
gutter: 16,
},
schemas: customSearchFormSchema,
schemas: [
{
field: 'dateFrom',
label: '有效期',
component: 'RangePicker',
defaultValue: defaultDate.value,
componentProps: {
format: 'YYYY-MM-DD',
style: { width: '100%' },
getPopupContainer: () => document.body,
},
},
{
field: 'kName',
label: '合同号/名称',
component: 'Input',
},
{
field: 'comId',
label: '合同主体',
component: 'Select',
componentProps: {
showSearch: true,
optionFilterProp: 'label',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
options: comIdList,
placeholder: '请选择',
allowClear: true,
getPopupContainer: () => document.body,
},
},
{
field: 'approCode',
label: '审批状态',
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '1990669393069129729' },
labelField: 'name',
valueField: 'value',
getPopupContainer: () => document.body,
},
},
],
fieldMapToTime: [['dateFrom', ['startDate', 'endDate'], 'YYYY-MM-DD']],
showResetButton: true,
},
immediate: false,
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit};
},
@ -326,17 +376,24 @@
}
onMounted(async () => {
reload({ searchInfo: { startDate: defaultDate.value[0], endDate: defaultDate.value[1] }});
let res = await getAllCom() || []
customSearchFormSchema.value.forEach(v => {
if (v.field == 'comId') {
v.componentProps.options = res.map(v=> {
return {
label: v.name,
value: v.id
}
})
comIdList.value = res.map(v=> {
return {
label: v.name,
value: v.id
}
});
})
// customSearchFormSchema.value.forEach(v => {
// if (v.field == 'comId') {
// v.componentProps.options = res.map(v=> {
// return {
// label: v.name,
// value: v.id
// }
// })
// }
// });
if (schemaIdComputedRef.value) {
bus.on(FLOW_PROCESSED, handleRefresh);
bus.on(CREATE_FLOW, handleRefresh);