签报
This commit is contained in:
89
src/api/approve/Appro/index.ts
Normal file
89
src/api/approve/Appro/index.ts
Normal file
@ -0,0 +1,89 @@
|
||||
import { LngApproPageModel, LngApproPageParams, LngApproPageResult } from './model/ApproModel';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
|
||||
enum Api {
|
||||
Page = '/approve/appro/page',
|
||||
List = '/approve/appro/list',
|
||||
Info = '/approve/appro/info',
|
||||
LngAppro = '/approve/appro',
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 查询LngAppro分页列表
|
||||
*/
|
||||
export async function getLngApproPage(params: LngApproPageParams, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngApproPageResult>(
|
||||
{
|
||||
url: Api.Page,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 获取LngAppro信息
|
||||
*/
|
||||
export async function getLngAppro(id: String, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngApproPageModel>(
|
||||
{
|
||||
url: Api.Info,
|
||||
params: { id },
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 新增LngAppro
|
||||
*/
|
||||
export async function addLngAppro(lngAppro: Recordable, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.LngAppro,
|
||||
params: lngAppro,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 更新LngAppro
|
||||
*/
|
||||
export async function updateLngAppro(lngAppro: Recordable, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.put<boolean>(
|
||||
{
|
||||
url: Api.LngAppro,
|
||||
params: lngAppro,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 删除LngAppro(批量删除)
|
||||
*/
|
||||
export async function deleteLngAppro(ids: string[], mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.delete<boolean>(
|
||||
{
|
||||
url: Api.LngAppro,
|
||||
data: ids,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
60
src/api/approve/Appro/model/ApproModel.ts
Normal file
60
src/api/approve/Appro/model/ApproModel.ts
Normal file
@ -0,0 +1,60 @@
|
||||
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
|
||||
|
||||
/**
|
||||
* @description: LngAppro分页参数 模型
|
||||
*/
|
||||
export interface LngApproPageParams extends BasicPageParams {
|
||||
code: string;
|
||||
|
||||
title: string;
|
||||
|
||||
typeCode: string;
|
||||
|
||||
securityCode: string;
|
||||
|
||||
urgencyCode: string;
|
||||
|
||||
empId: string;
|
||||
|
||||
bDeptId: string;
|
||||
|
||||
dateAppro: string;
|
||||
|
||||
approCode: string;
|
||||
|
||||
content: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: LngAppro分页返回值模型
|
||||
*/
|
||||
export interface LngApproPageModel {
|
||||
id: string;
|
||||
|
||||
code: string;
|
||||
|
||||
title: string;
|
||||
|
||||
typeCode: string;
|
||||
|
||||
securityCode: string;
|
||||
|
||||
urgencyCode: string;
|
||||
|
||||
empId: string;
|
||||
|
||||
bDeptId: string;
|
||||
|
||||
dateAppro: string;
|
||||
|
||||
approCode: string;
|
||||
|
||||
content: string;
|
||||
}
|
||||
|
||||
0;
|
||||
|
||||
/**
|
||||
* @description: LngAppro分页返回值结构
|
||||
*/
|
||||
export type LngApproPageResult = BasicFetchResult<LngApproPageModel>;
|
||||
@ -3,7 +3,8 @@ import { defHttp } from '/@/utils/http/axios';
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
|
||||
enum Api {
|
||||
Page = '/sales/scoreCustomer/page',
|
||||
// Page = '/sales/scoreCustomer/page',
|
||||
Page = '/magic-api/sales/scoreCustomerPage',
|
||||
List = '/sales/scoreCustomer/list',
|
||||
Info = '/sales/scoreCustomer/info',
|
||||
LngScore = '/sales/scoreCustomer',
|
||||
|
||||
@ -3,7 +3,8 @@ import { defHttp } from '/@/utils/http/axios';
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
|
||||
enum Api {
|
||||
Page = '/supplier/scoreSupplier/page',
|
||||
// Page = '/supplier/scoreSupplier/page',
|
||||
Page = '/magic-api/supplier/scoreSupplierPage',
|
||||
List = '/supplier/scoreSupplier/list',
|
||||
Info = '/supplier/scoreSupplier/info',
|
||||
LngScore = '/supplier/scoreSupplier',
|
||||
|
||||
110
src/views/approve/Appro/components/ApproModal.vue
Normal file
110
src/views/approve/Appro/components/ApproModal.vue
Normal file
@ -0,0 +1,110 @@
|
||||
<template>
|
||||
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit" @cancel="handleClose" :paddingRight="15" :bodyStyle="{ minHeight: '400px !important' }">
|
||||
<ModalForm ref="formRef" :fromPage="FromPageType.MENU" />
|
||||
</BasicModal>
|
||||
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, reactive } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { formProps } from './config';
|
||||
import ModalForm from './Form.vue';
|
||||
import { FromPageType } from '/@/enums/workflowEnum';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { notification } = useMessage();
|
||||
const formRef = ref();
|
||||
const state = reactive({
|
||||
formModel: {},
|
||||
isUpdate: true,
|
||||
isView: false,
|
||||
isCopy: false,
|
||||
rowId: '',
|
||||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
state.isUpdate = !!data?.isUpdate;
|
||||
state.isView = !!data?.isView;
|
||||
state.isCopy = !!data?.isCopy;
|
||||
|
||||
setModalProps({
|
||||
destroyOnClose: true,
|
||||
maskClosable: false,
|
||||
showCancelBtn: !state.isView,
|
||||
showOkBtn: !state.isView,
|
||||
canFullscreen: true,
|
||||
width: 900,
|
||||
});
|
||||
if (state.isUpdate || state.isView || state.isCopy) {
|
||||
state.rowId = data.id;
|
||||
if (state.isView) {
|
||||
await formRef.value.setDisabledForm();
|
||||
}
|
||||
await formRef.value.setFormDataFromId(state.rowId);
|
||||
} else {
|
||||
formRef.value.resetFields();
|
||||
}
|
||||
});
|
||||
|
||||
const getTitle = computed(() => (state.isView ? '查看' : !state.isUpdate ? '新增' : '编辑'));
|
||||
|
||||
async function saveModal() {
|
||||
let saveSuccess = false;
|
||||
try {
|
||||
const values = await formRef.value?.validate();
|
||||
//添加隐藏组件
|
||||
if (formProps.hiddenComponent?.length) {
|
||||
formProps.hiddenComponent.forEach((component) => {
|
||||
values[component.bindField] = component.value;
|
||||
});
|
||||
}
|
||||
if (values !== false) {
|
||||
try {
|
||||
if (!state.isUpdate || state.isCopy) {
|
||||
saveSuccess = await formRef.value.add(values);
|
||||
} else {
|
||||
saveSuccess = await formRef.value.update({ values, rowId: state.rowId });
|
||||
}
|
||||
return saveSuccess;
|
||||
} catch (error) {}
|
||||
}
|
||||
} catch (error) {
|
||||
return saveSuccess;
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const saveSuccess = await saveModal();
|
||||
setModalProps({ confirmLoading: true });
|
||||
if (saveSuccess) {
|
||||
if (!state.isUpdate || state.isCopy) {
|
||||
//false 新增
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('新增成功!'),
|
||||
}); //提示消息
|
||||
} else {
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('修改成功!'),
|
||||
}); //提示消息
|
||||
}
|
||||
closeModal();
|
||||
formRef.value.resetFields();
|
||||
emit('success');
|
||||
}
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
formRef.value.resetFields();
|
||||
}
|
||||
</script>
|
||||
224
src/views/approve/Appro/components/Form.vue
Normal file
224
src/views/approve/Appro/components/Form.vue
Normal file
@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<SimpleForm
|
||||
ref="systemFormRef"
|
||||
:formProps="data.formDataProps"
|
||||
:formModel="{}"
|
||||
:isWorkFlow="props.fromPage!=FromPageType.MENU"
|
||||
/>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref,onBeforeMount,onMounted } from 'vue';
|
||||
import { formProps, formEventConfigs ,formConfig} from './config';
|
||||
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
|
||||
import { addLngAppro, getLngAppro, updateLngAppro, deleteLngAppro } from '/@/api/approve/Appro';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { FormDataProps } from '/@/components/Designer/src/types';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import { useFormConfig } from '/@/hooks/web/useFormConfig';
|
||||
import { FromPageType } from '/@/enums/workflowEnum';
|
||||
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent';
|
||||
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
|
||||
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const { filterFormSchemaAuth } = usePermission();
|
||||
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig();
|
||||
const { currentRoute } = useRouter();
|
||||
|
||||
const RowKey = 'id';
|
||||
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'form-mounted']);
|
||||
const props = defineProps({
|
||||
fromPage: {
|
||||
type: Number,
|
||||
default: FromPageType.MENU,
|
||||
},
|
||||
});
|
||||
const systemFormRef = ref();
|
||||
const data: { formDataProps: FormDataProps } = reactive({
|
||||
formDataProps: {schemas:[]} as FormDataProps,
|
||||
});
|
||||
const state = reactive({
|
||||
formModel: {},
|
||||
});
|
||||
|
||||
let customFormEventConfigs=[];
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
// 合并渲染覆盖配置中的字段配置、表单事件配置
|
||||
await mergeCustomFormRenderConfig();
|
||||
|
||||
if (props.fromPage == FromPageType.MENU) {
|
||||
setMenuPermission();
|
||||
await createFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:加载表单
|
||||
} else if (props.fromPage == FromPageType.FLOW) {
|
||||
emits('loadingCompleted'); //告诉系统表单已经加载完毕
|
||||
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
|
||||
} else if (props.fromPage == FromPageType.PREVIEW) {
|
||||
// 预览 无需权限,表单事件也无需执行
|
||||
} else if (props.fromPage == FromPageType.DESKTOP) {
|
||||
// 桌面设计 表单事件需要执行
|
||||
emits('loadingCompleted'); //告诉系统表单已经加载完毕
|
||||
await createFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:加载表单
|
||||
}
|
||||
emits('form-mounted', formProps);
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
async function mergeCustomFormRenderConfig() {
|
||||
let cloneProps=cloneDeep(formProps);
|
||||
let fEventConfigs=cloneDeep(formEventConfigs);
|
||||
if (formConfig.useCustomConfig) {
|
||||
if(props.fromPage !== FromPageType.FLOW){
|
||||
let formPath=currentRoute.value.query.formPath;
|
||||
//1.合并字段配置
|
||||
cloneProps.schemas=await mergeFormSchemas({formSchema:cloneProps.schemas!,formPath:formPath});
|
||||
//2.合并表单事件配置
|
||||
fEventConfigs=await mergeFormEventConfigs({formEventConfigs:fEventConfigs,formPath:formPath});
|
||||
}
|
||||
}
|
||||
data.formDataProps=cloneProps;
|
||||
customFormEventConfigs=fEventConfigs;
|
||||
}
|
||||
|
||||
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
|
||||
function setMenuPermission() {
|
||||
data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!);
|
||||
}
|
||||
|
||||
// 校验form 通过返回表单数据
|
||||
async function validate() {
|
||||
let values = [];
|
||||
try {
|
||||
values = await systemFormRef.value?.validate();
|
||||
//添加隐藏组件
|
||||
if (data.formDataProps.hiddenComponent?.length) {
|
||||
data.formDataProps.hiddenComponent.forEach((component) => {
|
||||
values[component.bindField] = component.value;
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
return values;
|
||||
}
|
||||
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
|
||||
async function setFormDataFromId(rowId, skipUpdate) {
|
||||
try {
|
||||
const record = await getLngAppro(rowId);
|
||||
if (skipUpdate) {
|
||||
return record;
|
||||
}
|
||||
setFieldsValue(record);
|
||||
state.formModel = record;
|
||||
await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
|
||||
return record;
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
}
|
||||
// 辅助设置表单数据
|
||||
function setFieldsValue(record) {
|
||||
systemFormRef.value.setFieldsValue(record);
|
||||
}
|
||||
// 重置表单数据
|
||||
async function resetFields() {
|
||||
await systemFormRef.value.resetFields();
|
||||
}
|
||||
// 设置表单数据全部为Disabled 【查看】
|
||||
async function setDisabledForm(isDisabled) {
|
||||
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas),isDisabled);
|
||||
}
|
||||
// 获取行键值
|
||||
function getRowKey() {
|
||||
return RowKey;
|
||||
}
|
||||
// 更新api表单数据
|
||||
async function update({ values, rowId }) {
|
||||
try {
|
||||
values[RowKey] = rowId;
|
||||
state.formModel = values;
|
||||
let saveVal = await updateLngAppro(values);
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
}
|
||||
// 新增api表单数据
|
||||
async function add(values) {
|
||||
try {
|
||||
state.formModel = values;
|
||||
let saveVal = await addLngAppro(values);
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
}
|
||||
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
|
||||
async function setWorkFlowForm(obj: WorkFlowFormParams) {
|
||||
try {
|
||||
const cloneProps=cloneDeep(formProps);
|
||||
customFormEventConfigs=cloneDeep(formEventConfigs);
|
||||
if (formConfig.useCustomConfig) {
|
||||
const parts = obj.formConfigKey.split('_');
|
||||
const formId=parts[1];
|
||||
cloneProps.schemas=await mergeFormSchemas({formSchema:cloneProps.schemas!,formId:formId});
|
||||
customFormEventConfigs=await mergeFormEventConfigs({formEventConfigs:customFormEventConfigs,formId:formId});
|
||||
}
|
||||
|
||||
let flowData = changeWorkFlowForm(cloneProps, obj);
|
||||
let { buildOptionJson, uploadComponentIds, formModels, isViewProcess } = flowData;
|
||||
data.formDataProps = buildOptionJson;
|
||||
emits('changeUploadComponentIds', uploadComponentIds); //工作流中必须保存上传组件id【附件汇总需要】
|
||||
if (isViewProcess) {
|
||||
setDisabledForm(); //查看
|
||||
}
|
||||
state.formModel = formModels;
|
||||
if(formModels[RowKey]) {
|
||||
setFormDataFromId(formModels[RowKey], false)
|
||||
} else {
|
||||
setFieldsValue(formModels)
|
||||
}
|
||||
} catch (error) {}
|
||||
await createFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:加载表单
|
||||
}
|
||||
function getFormModel() {
|
||||
return systemFormRef.value.formModel
|
||||
}
|
||||
async function handleDelete(id) {
|
||||
return await deleteLngAppro([id]);
|
||||
}
|
||||
defineExpose({
|
||||
setFieldsValue,
|
||||
resetFields,
|
||||
validate,
|
||||
add,
|
||||
update,
|
||||
setFormDataFromId,
|
||||
setDisabledForm,
|
||||
setMenuPermission,
|
||||
setWorkFlowForm,
|
||||
getRowKey,
|
||||
getFormModel,
|
||||
handleDelete
|
||||
});
|
||||
</script>
|
||||
663
src/views/approve/Appro/components/config.ts
Normal file
663
src/views/approve/Appro/components/config.ts
Normal file
@ -0,0 +1,663 @@
|
||||
import { FormProps, FormSchema } from '/@/components/Form';
|
||||
import { BasicColumn } from '/@/components/Table';
|
||||
|
||||
export const formConfig = {
|
||||
useCustomConfig: false,
|
||||
};
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'code',
|
||||
label: '编号',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'title',
|
||||
label: '标题',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'typeCode',
|
||||
label: '签报类型',
|
||||
component: 'XjrSelect',
|
||||
componentProps: {
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '2001500486723887105' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'securityCode',
|
||||
label: '密级',
|
||||
component: 'XjrSelect',
|
||||
componentProps: {
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '2001501242533273602' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'urgencyCode',
|
||||
label: '缓级',
|
||||
component: 'XjrSelect',
|
||||
componentProps: {
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '2001501562994876418' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'empId',
|
||||
label: '拟稿人',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'bDeptId',
|
||||
label: '拟稿人所属部门',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'dateAppro',
|
||||
label: '拟稿日期',
|
||||
component: 'XjrSelect',
|
||||
componentProps: {
|
||||
datasourceType: 'api',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
},
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'approCode',
|
||||
label: '审批状态',
|
||||
component: 'XjrSelect',
|
||||
componentProps: {
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1990669393069129729' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'content',
|
||||
label: '内容摘要',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
dataIndex: 'code',
|
||||
title: '编号',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'title',
|
||||
title: '标题',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'typeCode',
|
||||
title: '签报类型',
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'securityCode',
|
||||
title: '密级',
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'urgencyCode',
|
||||
title: '缓级',
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'empId',
|
||||
title: '拟稿人',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'bDeptId',
|
||||
title: '拟稿人所属部门',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'dateAppro',
|
||||
title: '拟稿日期',
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'approCode',
|
||||
title: '审批状态',
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'content',
|
||||
title: '内容摘要',
|
||||
componentType: 'textarea',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
//表单事件
|
||||
export const formEventConfigs = {
|
||||
0: [
|
||||
{
|
||||
type: 'circle',
|
||||
color: '#2774ff',
|
||||
text: '开始节点',
|
||||
icon: '#icon-kaishi',
|
||||
bgcColor: '#D8E5FF',
|
||||
isUserDefined: false,
|
||||
},
|
||||
{
|
||||
color: '#F6AB01',
|
||||
icon: '#icon-chushihua',
|
||||
text: '初始化表单',
|
||||
bgcColor: '#f9f5ea',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
],
|
||||
1: [
|
||||
{
|
||||
color: '#B36EDB',
|
||||
icon: '#icon-shujufenxi',
|
||||
text: '获取表单数据',
|
||||
detail: '(新增无此操作)',
|
||||
bgcColor: '#F8F2FC',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
],
|
||||
2: [
|
||||
{
|
||||
color: '#F8625C',
|
||||
icon: '#icon-jiazai',
|
||||
text: '加载表单',
|
||||
bgcColor: '#FFF1F1',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
],
|
||||
3: [
|
||||
{
|
||||
color: '#6C6AE0',
|
||||
icon: '#icon-jsontijiao',
|
||||
text: '提交表单',
|
||||
bgcColor: '#F5F4FF',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
],
|
||||
4: [
|
||||
{
|
||||
type: 'circle',
|
||||
color: '#F8625C',
|
||||
text: '结束节点',
|
||||
icon: '#icon-jieshuzhiliao',
|
||||
bgcColor: '#FFD6D6',
|
||||
isLast: true,
|
||||
isUserDefined: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
export const formProps: FormProps = {
|
||||
labelCol: { span: 3, offset: 0 },
|
||||
labelAlign: 'right',
|
||||
layout: 'horizontal',
|
||||
size: 'default',
|
||||
schemas: [
|
||||
{
|
||||
key: '7ab1b5af10724b47bfe63e811a7049be',
|
||||
field: 'code',
|
||||
label: '编号',
|
||||
type: 'input',
|
||||
component: 'Input',
|
||||
colProps: { span: 24 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请输入编号',
|
||||
maxlength: null,
|
||||
prefix: '',
|
||||
suffix: '',
|
||||
addonBefore: '',
|
||||
addonAfter: '',
|
||||
disabled: false,
|
||||
allowClear: false,
|
||||
showLabel: true,
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: '2d7032de7bd5495c91ff647ccd2188d0',
|
||||
field: 'title',
|
||||
label: '标题',
|
||||
type: 'input',
|
||||
component: 'Input',
|
||||
colProps: { span: 24 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请输入标题',
|
||||
maxlength: null,
|
||||
prefix: '',
|
||||
suffix: '',
|
||||
addonBefore: '',
|
||||
addonAfter: '',
|
||||
disabled: false,
|
||||
allowClear: false,
|
||||
showLabel: true,
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: '7a1f49fb11704d6ca87d451696cfb34f',
|
||||
field: 'typeCode',
|
||||
label: '签报类型',
|
||||
type: 'select',
|
||||
component: 'XjrSelect',
|
||||
colProps: { span: 24 },
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请选择下拉选择',
|
||||
sepTextField: '',
|
||||
showLabel: true,
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
disabled: false,
|
||||
mode: '',
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
],
|
||||
defaultSelect: null,
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '2001500486723887105' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '2001500486723887105',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'ff3e18c6e87e4f4bba30323f964c1a2e',
|
||||
field: 'securityCode',
|
||||
label: '密级',
|
||||
type: 'select',
|
||||
component: 'XjrSelect',
|
||||
colProps: { span: 24 },
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请选择下拉选择',
|
||||
sepTextField: '',
|
||||
showLabel: true,
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
disabled: false,
|
||||
mode: '',
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
],
|
||||
defaultSelect: null,
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '2001501242533273602' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '2001501242533273602',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'a9b3f7e8da73450f875b97e095e0f2fc',
|
||||
field: 'urgencyCode',
|
||||
label: '缓级',
|
||||
type: 'select',
|
||||
component: 'XjrSelect',
|
||||
colProps: { span: 24 },
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请选择下拉选择',
|
||||
sepTextField: '',
|
||||
showLabel: true,
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
disabled: false,
|
||||
mode: '',
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
],
|
||||
defaultSelect: null,
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '2001501562994876418' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '2001501562994876418',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: '1f8a833aa4d1438eab9db90ef043f9ff',
|
||||
field: 'empId',
|
||||
label: '拟稿人',
|
||||
type: 'input',
|
||||
component: 'Input',
|
||||
colProps: { span: 24 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请输入拟稿人',
|
||||
maxlength: null,
|
||||
prefix: '',
|
||||
suffix: '',
|
||||
addonBefore: '',
|
||||
addonAfter: '',
|
||||
disabled: false,
|
||||
allowClear: false,
|
||||
showLabel: true,
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: '1c796840a6f34d9bbad5544a95b9efbf',
|
||||
field: 'bDeptId',
|
||||
label: '拟稿人所属部门',
|
||||
type: 'input',
|
||||
component: 'Input',
|
||||
colProps: { span: 24 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请输入拟稿人所属部门',
|
||||
maxlength: null,
|
||||
prefix: '',
|
||||
suffix: '',
|
||||
addonBefore: '',
|
||||
addonAfter: '',
|
||||
disabled: false,
|
||||
allowClear: false,
|
||||
showLabel: true,
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: '3d7159660c3443f4ace6a1e7d438701b',
|
||||
field: 'dateAppro',
|
||||
label: '拟稿日期',
|
||||
type: 'select',
|
||||
component: 'XjrSelect',
|
||||
colProps: { span: 24 },
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请选择下拉选择',
|
||||
sepTextField: '',
|
||||
showLabel: true,
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
disabled: false,
|
||||
mode: 'multiple',
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
],
|
||||
defaultSelect: '',
|
||||
datasourceType: 'api',
|
||||
params: null,
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: '9de6fc02d0b5430fb8c8dbc6ff758809',
|
||||
field: 'approCode',
|
||||
label: '审批状态',
|
||||
type: 'select',
|
||||
component: 'XjrSelect',
|
||||
colProps: { span: 24 },
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请选择下拉选择',
|
||||
sepTextField: '',
|
||||
showLabel: true,
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
disabled: true,
|
||||
mode: '',
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
],
|
||||
defaultSelect: 'WTJ',
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1990669393069129729' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '1990669393069129729',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: '06458915e7e04b45bb7a1444ccff56a3',
|
||||
field: 'content',
|
||||
label: '内容摘要',
|
||||
type: 'textarea',
|
||||
component: 'InputTextArea',
|
||||
colProps: { span: 24 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: true,
|
||||
placeholder: '请输入内容摘要',
|
||||
maxlength: null,
|
||||
rows: 2,
|
||||
autoSize: false,
|
||||
showCount: false,
|
||||
disabled: false,
|
||||
showLabel: true,
|
||||
allowClear: false,
|
||||
required: false,
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
],
|
||||
showActionButtonGroup: false,
|
||||
buttonLocation: 'center',
|
||||
actionColOptions: { span: 24 },
|
||||
showResetButton: false,
|
||||
showSubmitButton: false,
|
||||
hiddenComponent: [],
|
||||
};
|
||||
328
src/views/approve/Appro/components/createForm.vue
Normal file
328
src/views/approve/Appro/components/createForm.vue
Normal file
@ -0,0 +1,328 @@
|
||||
<template>
|
||||
<a-spin :spinning="spinning" tip="加载中...">
|
||||
<div class="page-bg-wrap formViewStyle">
|
||||
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
|
||||
<a-card title="评价基础信息" :bordered="false" >
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="客户名称" name="cpCodeName">
|
||||
<a-input-search v-model:value="formState.cpCodeName" placeholder="请选择客户" readonly @search="onSearch"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="客户分类" name="classCode">
|
||||
<a-input v-model:value="formState.classCode" disabled />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="评价体系" name="gsId">
|
||||
<a-select v-model:value="formState.gsId" :disabled="isDisable" placeholder="请选择评价体系" @mouseenter="gsIdFocus(formState.gsId)" @change="gsIdChange" style="width: 100%" allow-clear>
|
||||
<a-select-option v-for="item in optionSelect.gsIdList" :key="item.id" :value="item.id">
|
||||
{{ item.gsName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="评价日期" name="dateGrade">
|
||||
<a-date-picker v-model:value="formState.dateGrade" disabled style="width: 100%" placeholder="请选择评价日期" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="分类合计" name="score">
|
||||
<a-input v-model:value="formState.score" disabled/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="审批状态" name="approCode">
|
||||
<a-select v-model:value="formState.approCode" disabled style="width: 100%" allow-clear>
|
||||
<a-select-option v-for="item in optionSelect.approCodeList" :key="item.code" :value="item.code">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
<a-card title="填写评分表信息" :bordered="false" >
|
||||
<a-table :columns="columns" :data-source="dataList" >
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'score'">
|
||||
<a-input-number v-model:value="record.score" @change="numChagne('score', record, index)"/>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'scoreDesc'">
|
||||
<a-input v-model:value="record.scoreDesc" @change="numChagne('scoreDesc', record, index)"/>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
<a-card title="附件信息" :bordered="false" >
|
||||
<UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/>
|
||||
</a-card>
|
||||
</a-form>
|
||||
</div>
|
||||
<customerListModal @register="register" selectType="radio" @success="handleSuccess"/>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useRouter } from 'vue-router';
|
||||
import { FromPageType, RecordType } from '/@/enums/workflowEnum';
|
||||
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { getDictionary } from '/@/api/sales/Customer';
|
||||
import { getLngGradeSystemPageList, getLngGradeSystem} from '/@/api/sales/GradeSystem';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { addLngScore,updateLngScore,getLngScore } from '/@/api/sales/ScoreCustomer';
|
||||
import dayjs from 'dayjs';
|
||||
import { getAppEnvConfig } from '/@/utils/env';
|
||||
import { message } from 'ant-design-vue';
|
||||
import UploadList from '/@/components/Form/src/components/UploadList.vue';
|
||||
import customerListModal from '/@/components/common/customerListModal.vue';
|
||||
import { getUserInfo } from '/@/api/system/login';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
|
||||
const tableName = 'ScoreCustomer';
|
||||
const columnName = 'ScoreCustomer'
|
||||
|
||||
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
||||
const formRef = ref();
|
||||
const props = defineProps({
|
||||
disabled: false,
|
||||
id: ''
|
||||
|
||||
});
|
||||
const { bus, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const router = useRouter();
|
||||
const { currentRoute } = router;
|
||||
const isDisable = ref(false);
|
||||
const { formPath } = currentRoute.value.query;
|
||||
const pathArr = [];
|
||||
|
||||
const tabStore = useMultipleTabStore();
|
||||
const formProps = ref(null);
|
||||
const formId = ref(currentRoute.value?.params?.id);
|
||||
const pageType = ref(currentRoute.value.query?.type);
|
||||
const pageId = ref(currentRoute.value.query?.id)
|
||||
|
||||
const spinning = ref(false);
|
||||
const curIdx = ref(null)
|
||||
const { notification } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const formState = reactive({
|
||||
approCode: 'WTJ',
|
||||
dateGrade: dayjs(new Date()),
|
||||
});
|
||||
const userInfo = reactive({})
|
||||
const [register, { openModal:openModal}] = useModal();
|
||||
const rules: Record<string, Rule[]> = {
|
||||
cpCodeName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
gsId: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
};
|
||||
const layout = {
|
||||
labelCol: { span: 9 },
|
||||
wrapperCol: { span: 15 },
|
||||
}
|
||||
const gsIdOld = ref()
|
||||
const columns = ref([
|
||||
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 80},
|
||||
{ title: t('评价事项'), dataIndex: 'itemName', sorter: true},
|
||||
{ title: t('评价标准'), dataIndex: 'itemDesc', sorter: true},
|
||||
{ title: t('评价部门'), dataIndex: 'eDeptCode', sorter: true},
|
||||
{ title: t('评分'), dataIndex: 'score', sorter: true},
|
||||
{ title: t('分数说明'), dataIndex: 'scoreDesc', sorter: true},
|
||||
{ title: t('评价人'), dataIndex: 'aEmpCode', sorter: true},
|
||||
{ title: t('评价时间'), dataIndex: 'aTime', sorter: true},
|
||||
{ title: t('实际评价部门'), dataIndex: 'aDeptCode', sorter: true},
|
||||
]);
|
||||
const dataList= ref([]);
|
||||
const dataFile = ref([]);
|
||||
let optionSelect= reactive({
|
||||
gsIdList: [],
|
||||
approCodeList: [],
|
||||
});
|
||||
watch(
|
||||
() => props.id,
|
||||
(val) => {
|
||||
if (val) {
|
||||
getInfo(val)
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => props.disabled,
|
||||
(val) => {
|
||||
isDisable.value = val
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
getOption()
|
||||
if (pageId.value) {
|
||||
getInfo(pageId.value)
|
||||
}
|
||||
|
||||
});
|
||||
const uploadListChange = (val) => {
|
||||
dataFile.value = val
|
||||
}
|
||||
async function getInfo(id) {
|
||||
spinning.value = true
|
||||
try {
|
||||
let data = await getLngScore(id)
|
||||
spinning.value = false
|
||||
Object.assign(formState, {...data})
|
||||
Object.assign(dataList.value, formState.lngScoreDtlList || [])
|
||||
Object.assign(dataFile.value, formState.lngFileUploadList || [])
|
||||
formState.dateGrade = formState.dateGrade ? dayjs(formState.dateGrade) : null
|
||||
} catch (error) {
|
||||
spinning.value = false
|
||||
}
|
||||
}
|
||||
async function getOption() {
|
||||
optionSelect.gsIdList = await getLngGradeSystemPageList({'valid': 'Y', 'typeCode': 'CU'})
|
||||
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
||||
let res = await getUserInfo()
|
||||
Object.assign(userInfo, {...res})
|
||||
}
|
||||
const onSearch = (val)=> {
|
||||
openModal(true,{isUpdate: false})
|
||||
}
|
||||
const handleSuccess = (val) => {
|
||||
formState.cpCode = val[0].cuCode
|
||||
formState.classCode = val[0].classCode
|
||||
formState.cpCodeName = val[0].cuName
|
||||
}
|
||||
const gsIdFocus = (val) => {
|
||||
gsIdOld.value = val
|
||||
}
|
||||
async function gsIdChange (val) {
|
||||
if (!val) {
|
||||
dataList.value = []
|
||||
return
|
||||
}
|
||||
const res = await getLngGradeSystem(val)
|
||||
let arr = res.lngGradeSystemItemList || []
|
||||
if (!gsIdOld.value) {
|
||||
dataList.value = res.lngGradeSystemItemList || []
|
||||
dataList.value.forEach(v => {
|
||||
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
||||
v.aEmpCode = userInfo.name
|
||||
v.gsiId = v.id
|
||||
})
|
||||
return
|
||||
}
|
||||
if (arr.length && gsIdOld.value) {
|
||||
Modal.confirm({
|
||||
title: t('提示'),
|
||||
content: t('变更将重新设置评分表,是否继续'),
|
||||
okText: t('确定'),
|
||||
cancelText: t('取消'),
|
||||
onOk() {
|
||||
dataList.value = res.lngGradeSystemItemList || []
|
||||
dataList.value.forEach(v => {
|
||||
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
||||
v.aEmpCode = userInfo.name
|
||||
v.gsiId = v.id
|
||||
})
|
||||
},
|
||||
onCancel() {
|
||||
formState.gsId = gsIdOld.value
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (!arr.length) {
|
||||
dataList.value = res.lngGradeSystemItemList || []
|
||||
dataList.value.forEach(v => {
|
||||
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
||||
v.aEmpCode = userInfo.name
|
||||
v.gsiId = v.id
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
const numChagne = (type, record, index) => {
|
||||
record.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
||||
if (type == 'score') {
|
||||
let num = 0
|
||||
dataList.value.forEach(v => {
|
||||
num+=Number(v.score || 0)
|
||||
})
|
||||
formState.score = num
|
||||
}
|
||||
}
|
||||
function close() {
|
||||
tabStore.closeTab(currentRoute.value, router);
|
||||
}
|
||||
async function getFormValue() {
|
||||
return formState
|
||||
}
|
||||
async function handleSubmit(type) {
|
||||
try {
|
||||
await formRef.value.validateFields();
|
||||
let obj = {
|
||||
...formState,
|
||||
lngScoreDtlList: dataList.value,
|
||||
lngFileUploadList: dataFile.value
|
||||
|
||||
}
|
||||
spinning.value = true;
|
||||
let request = !formState.id ? addLngScore :updateLngScore
|
||||
|
||||
try {
|
||||
const data = await request(obj);
|
||||
// 新增保存
|
||||
if (data?.id) {
|
||||
getInfo(data?.id)
|
||||
}
|
||||
// 同意保存不提示
|
||||
if (!type) {
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: data?.id ? t('新增成功!') : t('修改成功!')
|
||||
}); //提示消息
|
||||
}
|
||||
return data?.id ? data : obj
|
||||
|
||||
} finally {
|
||||
spinning.value = false;
|
||||
}
|
||||
|
||||
} catch (errorInfo) {
|
||||
spinning.value = false;
|
||||
errorInfo?.errorFields?.length && notification.warning({
|
||||
message: 'Tip',
|
||||
description: '请完善信息'
|
||||
});
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleSubmit,
|
||||
getFormValue
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.page-bg-wrap {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.top-toolbar {
|
||||
min-height: 44px;
|
||||
margin-bottom: 12px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
</style>
|
||||
152
src/views/approve/Appro/components/workflowPermission.ts
Normal file
152
src/views/approve/Appro/components/workflowPermission.ts
Normal file
@ -0,0 +1,152 @@
|
||||
export const permissionList = [
|
||||
{
|
||||
required: true,
|
||||
view: true,
|
||||
edit: true,
|
||||
disabled: false,
|
||||
isSaveTable: false,
|
||||
tableName: '',
|
||||
fieldName: '编号',
|
||||
fieldId: 'code',
|
||||
isSubTable: false,
|
||||
showChildren: true,
|
||||
type: 'input',
|
||||
key: '7ab1b5af10724b47bfe63e811a7049be',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
view: true,
|
||||
edit: true,
|
||||
disabled: false,
|
||||
isSaveTable: false,
|
||||
tableName: '',
|
||||
fieldName: '标题',
|
||||
fieldId: 'title',
|
||||
isSubTable: false,
|
||||
showChildren: true,
|
||||
type: 'input',
|
||||
key: '2d7032de7bd5495c91ff647ccd2188d0',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
view: true,
|
||||
edit: true,
|
||||
disabled: false,
|
||||
isSaveTable: false,
|
||||
tableName: '',
|
||||
fieldName: '签报类型',
|
||||
fieldId: 'typeCode',
|
||||
isSubTable: false,
|
||||
showChildren: true,
|
||||
type: 'select',
|
||||
key: '7a1f49fb11704d6ca87d451696cfb34f',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
view: true,
|
||||
edit: true,
|
||||
disabled: false,
|
||||
isSaveTable: false,
|
||||
tableName: '',
|
||||
fieldName: '密级',
|
||||
fieldId: 'securityCode',
|
||||
isSubTable: false,
|
||||
showChildren: true,
|
||||
type: 'select',
|
||||
key: 'ff3e18c6e87e4f4bba30323f964c1a2e',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
view: true,
|
||||
edit: true,
|
||||
disabled: false,
|
||||
isSaveTable: false,
|
||||
tableName: '',
|
||||
fieldName: '缓级',
|
||||
fieldId: 'urgencyCode',
|
||||
isSubTable: false,
|
||||
showChildren: true,
|
||||
type: 'select',
|
||||
key: 'a9b3f7e8da73450f875b97e095e0f2fc',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
view: true,
|
||||
edit: true,
|
||||
disabled: false,
|
||||
isSaveTable: false,
|
||||
tableName: '',
|
||||
fieldName: '拟稿人',
|
||||
fieldId: 'empId',
|
||||
isSubTable: false,
|
||||
showChildren: true,
|
||||
type: 'input',
|
||||
key: '1f8a833aa4d1438eab9db90ef043f9ff',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
view: true,
|
||||
edit: true,
|
||||
disabled: false,
|
||||
isSaveTable: false,
|
||||
tableName: '',
|
||||
fieldName: '拟稿人所属部门',
|
||||
fieldId: 'bDeptId',
|
||||
isSubTable: false,
|
||||
showChildren: true,
|
||||
type: 'input',
|
||||
key: '1c796840a6f34d9bbad5544a95b9efbf',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
view: true,
|
||||
edit: true,
|
||||
disabled: false,
|
||||
isSaveTable: false,
|
||||
tableName: '',
|
||||
fieldName: '拟稿日期',
|
||||
fieldId: 'dateAppro',
|
||||
isSubTable: false,
|
||||
showChildren: true,
|
||||
type: 'select',
|
||||
key: '3d7159660c3443f4ace6a1e7d438701b',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
view: true,
|
||||
edit: true,
|
||||
disabled: false,
|
||||
isSaveTable: false,
|
||||
tableName: '',
|
||||
fieldName: '审批状态',
|
||||
fieldId: 'approCode',
|
||||
isSubTable: false,
|
||||
showChildren: true,
|
||||
type: 'select',
|
||||
key: '9de6fc02d0b5430fb8c8dbc6ff758809',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
view: true,
|
||||
edit: true,
|
||||
disabled: false,
|
||||
isSaveTable: false,
|
||||
tableName: '',
|
||||
fieldName: '内容摘要',
|
||||
fieldId: 'content',
|
||||
isSubTable: false,
|
||||
showChildren: true,
|
||||
type: 'textarea',
|
||||
key: '06458915e7e04b45bb7a1444ccff56a3',
|
||||
children: [],
|
||||
},
|
||||
];
|
||||
405
src/views/approve/Appro/index.vue
Normal file
405
src/views/approve/Appro/index.vue
Normal file
@ -0,0 +1,405 @@
|
||||
<template>
|
||||
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
|
||||
<BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow">
|
||||
|
||||
<template #toolbar>
|
||||
<template v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
<a-button v-else :type="button.type">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<TableAction :actions="getActions(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<ApproModal @register="registerModal" @success="handleSuccess" />
|
||||
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible"/>
|
||||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
const modalVisible = ref(false);
|
||||
const logId = ref('')
|
||||
const logPath = ref('/approve/appro/datalog');
|
||||
import { DataLog } from '/@/components/pcitc';
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode,
|
||||
|
||||
} from 'vue';
|
||||
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||
import { getLngApproPage, deleteLngAppro} from '/@/api/approve/Appro';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import { useFormConfig } from '/@/hooks/web/useFormConfig';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { setIndexFlowStatus } from '/@/utils/flow/index'
|
||||
import { getLngAppro } from '/@/api/approve/Appro';
|
||||
import { useModal,BasicModal } from '/@/components/Modal';
|
||||
import LookProcess from '/@/views/workflow/task/components/LookProcess.vue';
|
||||
import LaunchProcess from '/@/views/workflow/task/components/LaunchProcess.vue';
|
||||
import ApprovalProcess from '/@/views/workflow/task/components/ApprovalProcess.vue';
|
||||
import { getDraftInfo } from '/@/api/workflow/process';
|
||||
import { isValidJSON } from '/@/utils/event/design';
|
||||
|
||||
import ApproModal from './components/ApproModal.vue';
|
||||
import {formConfig, searchFormSchema, columns } from './components/config';
|
||||
import Icon from '/@/components/Icon/index';
|
||||
import FlowRecord from '/@/views/workflow/task/components/flow/FlowRecord.vue';
|
||||
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const { notification } = useMessage();
|
||||
const { t } = useI18n();
|
||||
defineEmits(['register']);
|
||||
const { filterColumnAuth, filterButtonAuth } = usePermission();
|
||||
const { mergeColumns,mergeSearchFormSchema,mergeButtons } = useFormConfig();
|
||||
|
||||
const filterColumns = cloneDeep(filterColumnAuth(columns));
|
||||
const customConfigColums =ref(filterColumns);
|
||||
const customSearchFormSchema =ref(searchFormSchema);
|
||||
|
||||
const tableRef = ref();
|
||||
//所有按钮
|
||||
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true},{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]);
|
||||
//展示在列表内的按钮
|
||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
||||
const buttonConfigs = computed(()=>{
|
||||
return filterButtonAuth(buttons.value);
|
||||
})
|
||||
|
||||
const tableButtonConfig = computed(() => {
|
||||
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
||||
});
|
||||
|
||||
const actionButtonConfig = computed(() => {
|
||||
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||
});
|
||||
|
||||
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete,}
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
const formIdComputedRef = ref();
|
||||
formIdComputedRef.value = currentRoute.value.meta.formId
|
||||
const schemaIdComputedRef = ref();
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
||||
const visibleLookProcessRef = ref(false);
|
||||
const processIdRef = ref('');
|
||||
|
||||
const visibleLaunchProcessRef = ref(false);
|
||||
const schemaIdRef = ref('');
|
||||
const formDataRef = ref();
|
||||
const rowKeyData = ref();
|
||||
const draftsId = ref();
|
||||
|
||||
const visibleApproveProcessRef = ref(false);
|
||||
const taskIdRef = ref('');
|
||||
const visibleFlowRecordModal = ref(false);
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName='签报';
|
||||
const [registerTable, { reload, }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
api: getLngApproPage,
|
||||
rowKey: 'id',
|
||||
columns: customConfigColums,
|
||||
formConfig: {
|
||||
rowProps: {
|
||||
gutter: 16,
|
||||
},
|
||||
schemas: customSearchFormSchema,
|
||||
fieldMapToTime: [],
|
||||
showResetButton: false,
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableRef.value.setToolBarWidth();
|
||||
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
|
||||
striped: false,
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false,
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
function dbClickRow(record) {
|
||||
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
||||
return;
|
||||
}
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
if (taskIds && taskIds.length) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else if (schemaId && !taskIds && processId) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||
query: {
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/Appro/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: 'approve/Appro',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
|
||||
btnEvent[code]();
|
||||
}
|
||||
function handleDatalog (record: Recordable) {
|
||||
modalVisible.value = true
|
||||
logId.value = record.id
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow'
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/Appro/0/createForm',
|
||||
query: {
|
||||
formPath: 'approve/Appro',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/form/Appro/' + record.id + '/updateForm',
|
||||
query: {
|
||||
formPath: 'approve/Appro',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteList([record.id]);
|
||||
}
|
||||
function deleteList(ids) {
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '是否确认删除?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
deleteLngAppro(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('删除成功!'),
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
}
|
||||
function handleRefresh() {
|
||||
reload();
|
||||
}
|
||||
function handleSuccess() {
|
||||
|
||||
reload();
|
||||
}
|
||||
|
||||
function handleView(record: Recordable) {
|
||||
|
||||
dbClickRow(record);
|
||||
|
||||
}
|
||||
onMounted(() => {
|
||||
|
||||
if (schemaIdComputedRef.value) {
|
||||
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||
bus.on(CREATE_FLOW, handleRefresh);
|
||||
} else {
|
||||
bus.on(FORM_LIST_MODIFIED, handleRefresh);
|
||||
}
|
||||
|
||||
// 合并渲染覆盖配置中的列表配置,包括展示字段配置、搜索字段配置、按钮配置
|
||||
mergeCustomListRenderConfig();
|
||||
});
|
||||
onUnmounted(() => {
|
||||
if (schemaIdComputedRef.value) {
|
||||
bus.off(FLOW_PROCESSED, handleRefresh);
|
||||
bus.off(CREATE_FLOW, handleRefresh);
|
||||
} else {
|
||||
bus.off(FORM_LIST_MODIFIED, handleRefresh);
|
||||
}
|
||||
});
|
||||
function getActions(record: Recordable):ActionItem[] {
|
||||
|
||||
let actionsList: ActionItem[] = [];
|
||||
let editAndDelBtn: ActionItem[] = [];
|
||||
let hasFlowRecord = false;
|
||||
actionButtonConfig.value?.map((button) => {
|
||||
if (['view', 'copyData'].includes(button.code)) {
|
||||
actionsList.push({
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
onClick: btnEvent[button.code].bind(null, record),
|
||||
});
|
||||
}
|
||||
if (['edit', 'delete'].includes(button.code)) {
|
||||
editAndDelBtn.push({
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
color: button.code === 'delete' ? 'error' : undefined,
|
||||
onClick: btnEvent[button.code].bind(null, record),
|
||||
});
|
||||
}
|
||||
if (button.code === 'flowRecord') hasFlowRecord = true;
|
||||
});
|
||||
if (record.workflowData?.enabled) {
|
||||
//与工作流有关联的表单
|
||||
if (record.workflowData.status) {
|
||||
actionsList.unshift(setIndexFlowStatus(record.workflowData))
|
||||
} else {
|
||||
actionsList = actionsList.concat(editAndDelBtn);
|
||||
}
|
||||
} else {
|
||||
if (!record.workflowData?.processId) {
|
||||
//与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上
|
||||
actionsList = actionsList.concat(editAndDelBtn);
|
||||
}
|
||||
}
|
||||
return actionsList;
|
||||
}
|
||||
function handleStartwork(record: Recordable) {
|
||||
const { processId, schemaId } = record.workflowData;
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
query: {
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleFlowRecord(record: Recordable) {
|
||||
if (record.workflowData) {
|
||||
visibleFlowRecordModal.value = true;
|
||||
processIdRef.value = record.workflowData?.processId;
|
||||
}
|
||||
}
|
||||
|
||||
async function handleLaunchProcess(record: Recordable) {
|
||||
const schemaId=record.workflowData?.schemaId||schemaIdComputedRef.value;
|
||||
if(schemaId){
|
||||
if(record.workflowData?.draftId){
|
||||
let res = await getDraftInfo(record.workflowData.draftId);
|
||||
if (isValidJSON(res.formData)) {
|
||||
localStorage.setItem('draftsJsonStr', res.formData);
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/'+record.workflowData.draftId+'/createFlow'
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const result = await getLngAppro(record['id']);
|
||||
const form={};
|
||||
const key="form_"+schemaId+"_"+record['id'];
|
||||
form[key]=result;
|
||||
localStorage.setItem('formJsonStr', JSON.stringify(form));
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/0/createFlow',
|
||||
query: {
|
||||
fromKey: key
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function handleApproveProcess(record: Recordable) {
|
||||
const { processId, taskIds, schemaId } = record.workflowData;
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleCloseLaunch() {
|
||||
visibleLaunchProcessRef.value = false;
|
||||
reload();
|
||||
}
|
||||
function handleCloseApproval() {
|
||||
visibleApproveProcessRef.value = false;
|
||||
reload();
|
||||
}
|
||||
async function mergeCustomListRenderConfig(){
|
||||
if (formConfig.useCustomConfig) {
|
||||
let formId=currentRoute.value.meta.formId;
|
||||
//1.合并展示字段配置
|
||||
let cols= await mergeColumns(customConfigColums.value,formId);
|
||||
customConfigColums.value=cols;
|
||||
//2.合并搜索字段配置
|
||||
let sFormSchema= await mergeSearchFormSchema(customSearchFormSchema.value,formId);
|
||||
customSearchFormSchema.value=sFormSchema;
|
||||
//3.合并按钮配置
|
||||
let btns= await mergeButtons(buttons.value,formId);
|
||||
buttons.value=btns;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-table-selection-col) {
|
||||
width: 50px;
|
||||
}
|
||||
.show{
|
||||
display: flex;
|
||||
}
|
||||
.hide{
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
@ -142,7 +142,7 @@
|
||||
]);
|
||||
const dataList= ref([]);
|
||||
const dataFile = ref([]);
|
||||
let optionSelect= reactive({
|
||||
let optionSelect= reactive({
|
||||
gsIdList: [],
|
||||
approCodeList: [],
|
||||
});
|
||||
@ -249,7 +249,7 @@
|
||||
v.gsiId = v.id
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
const numChagne = (type, record, index) => {
|
||||
record.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
||||
|
||||
@ -125,7 +125,7 @@
|
||||
showResetButton: true,
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit };
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
clearSelectedRowKeys()
|
||||
|
||||
@ -125,7 +125,7 @@
|
||||
showResetButton: true,
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit };
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
clearSelectedRowKeys()
|
||||
|
||||
Reference in New Issue
Block a user