签报接口

This commit is contained in:
‘huanghaiixia’
2025-12-24 17:38:00 +08:00
parent 03c943e4d6
commit 0387c2ca86
21 changed files with 3029 additions and 182 deletions

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

View 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 { addLngContractFact, getLngContractFact, updateLngContractFact, deleteLngContractFact } from '/@/api/contract/ContractFact';
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 getLngContractFact(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 updateLngContractFact(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 addLngContractFact(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 deleteLngContractFact([id]);
}
defineExpose({
setFieldsValue,
resetFields,
validate,
add,
update,
setFormDataFromId,
setDisabledForm,
setMenuPermission,
setWorkFlowForm,
getRowKey,
getFormModel,
handleDelete
});
</script>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,447 @@
<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="kNo">
<a-input v-model:value="formState.kNo" disabled />
</a-form-item>
</a-col>
<a-col :span="16">
<a-form-item label="合同名称" name="kName" :label-col="{ span: 4 }" :wrapper-col="{ span: 24 }">
<a-input v-model:value="formState.kName" placeholder="请输入标题"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="相对方数量" name="cpCount">
<a-input-number v-model:value="formState.cpCount" style="width: 100%" :precision="0" :min="0" :step="1" :max="20"/>
</a-form-item>
</a-col>
<a-col :span="16">
<a-form-item label="主相对方" name="code" :label-col="{ span: 4 }" :wrapper-col="{ span: 24 }">
<a-input v-model:value="formState.code" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="合同主体" name="comId">
<a-input v-model:value="formState.comId" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="合同类型" name="kTypeCode1">
<a-select v-model:value="formState.kTypeCode1" :disabled="isDisable" placeholder="请选择合同类型" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.typeCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="合同阶段" name="securityCode">
<a-select v-model:value="formState.securityCode" :disabled="isDisable" placeholder="请选择密级" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.securityCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="合同期限" name="periodTypeCode">
<a-select v-model:value="formState.periodTypeCode" :disabled="isDisable" placeholder="请选择合同期限" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.securityCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="有效期开始" name="dateFrom">
<a-date-picker v-model:value="formState.dateAppro" style="width: 100%" placeholder="请选择开始日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="有效期结束" name="dateTo">
<a-date-picker v-model:value="formState.dateAppro" style="width: 100%" placeholder="请选择结束日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="起草日期" name="dateDraft">
<a-date-picker v-model:value="formState.dateAppro" style="width: 100%" placeholder="请选择起草日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="币种" name="curCode">
<a-select v-model:value="formState.curCode" :disabled="isDisable" placeholder="请选择缓急" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.urgencyCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="合同金额" name="amount">
<a-input v-model:value="formState.amount" :disabled="isDisable"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="业务联系人" name="empId">
<a-input v-model:value="formState.empId" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="联系电话" name="tel">
<a-input v-model:value="formState.tel" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="业务部门" name="bDeptId">
<a-input v-model:value="formState.bDeptId" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="是否招投标" name="bidSign">
<a-select v-model:value="formState.bidSign" :disabled="isDisable" placeholder="请选择是否招投标" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.urgencyCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="已获前置审批" name="preApproSign">
<a-select v-model:value="formState.preApproSign" :disabled="isDisable" placeholder="请选择已获前置审批" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.urgencyCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="先行履行" name="aheadSign">
<a-select v-model:value="formState.aheadSign" :disabled="isDisable" placeholder="请选择先行履行" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.urgencyCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="采用范本" name="tempSign">
<a-select v-model:value="formState.tempSign" :disabled="isDisable" placeholder="请选择采用范本" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.urgencyCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="重大事项所涉合同" name="impSign">
<a-select v-model:value="formState.impSign" :disabled="isDisable" placeholder="请选择重大事项所涉合同" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.urgencyCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</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-col :span="22">
<a-form-item label="合同说明" name="kDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
<a-textarea v-model:value="formState.kDesc" :disabled="isDisable" placeholder="请输入备注最多1000字" :maxlength="1000" :auto-size="{ minRows: 4, }"/>
</a-form-item>
</a-col>
<a-col :span="22">
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
<a-textarea v-model:value="formState.note" :disabled="isDisable" placeholder="请输入备注最多200字" :maxlength="200" :auto-size="{ minRows: 2, maxRows: 5 }"/>
</a-form-item>
</a-col>
</a-row>
</a-card>
<a-card title="相对方信息" :bordered="false" >
<a-table :columns="columns" :data-source="dataList" :pagination="false" :scroll="{x: 200}">
<template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === 'operation'">
<!-- <a @click="btnCheck(record, index)">删除</a> -->
</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-card title="签报列表" :bordered="false" >
<a-table :columns="columnsAppro" :data-source="dataListAppro" :pagination="false">
<template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === 'operation'">
<!-- <a @click="btnCheck(record, index)">删除</a> -->
</template>
</template>
</a-table>
</a-card>
</a-form>
</div>
<deptUserModal @register="register" @success="handleSuccess"/>
<deptListModal @register="registerDept" @success="handleSuccessDept" />
</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 { useModal } from '/@/components/Modal';
import { addLngAppro,updateLngAppro,getLngAppro,getCompDept } from '/@/api/approve/Appro';
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 deptUserModal from '/@/components/common/deptUserModal.vue';
import deptListModal from '/@/components/common/deptListModal.vue';
import { Modal } from 'ant-design-vue';
import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore();
const userInfo = userStore.getUserInfo;
const tableName = 'ContractFact';
const columnName = 'ContractFact'
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',
dateAppro: dayjs(new Date()),
});
const [register, { openModal:openModal}] = useModal();
const [registerDept, { openModal:openModalDept}] = useModal();
const rules: Record<string, Rule[]> = {
title: [{ required: true, message: "该项为必填项", trigger: 'change' }],
typeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
securityCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
urgencyCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
empName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
deptName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
comName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
dateAppro: [{ required: true, message: "该项为必填项", trigger: 'change' }],
content: [{ required: true, message: "该项为必填项", trigger: 'change' }],
};
const layout = {
labelCol: { span: 8 },
wrapperCol: { span: 16 },
}
const columns= ref([
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 100},
{ title: t('相对方名称'), dataIndex: 'cpName', sorter: true, width:100},
{ title: t('相对方顺序'), dataIndex: 'sort', sorter: true, width: 100},
{ title: t('相对方银行名称'), dataIndex: 'cpBankName', sorter: true, width: 140},
{ title: t('对方银行开户名'), dataIndex: 'cpBankAccountName', sorter: true, width: 140},
{ title: t('对方银行账号'), dataIndex: 'cpBankAccount', sorter: true, width: 140},
{ title: t('对方联系人姓名'), dataIndex: 'contactName', sorter: true, width: 140},
{ title: t('对方联系人电话'), dataIndex: 'contactTel', sorter: true, width: 140},
{ title: t('对方联系人邮箱'), dataIndex: 'contactEmail', sorter: true, width: 140},
{ title: t('对方通讯地址'), dataIndex: 'contactAddress', sorter: true, width: 140},
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 140},
{ title: t('操作'), dataIndex: 'operation', width: 120},
]);
const columnsAppro= ref([
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 100},
{ title: t('标题'), dataIndex: 'title', sorter: true, width:100},
{ title: t('编号'), dataIndex: 'code', sorter: true},
{ title: t('签报类型'), dataIndex: 'typeName', sorter: true, width: 140},
{ title: t('拟稿人'), dataIndex: 'empName', sorter: true, width: 140},
{ title: t('拟稿人所属部门'), dataIndex: 'deptName', sorter: true, width: 140},
{ title: t('拟稿时间'), dataIndex: 'dateAppro', sorter: true, width: 140},
{ title: t('附件'), dataIndex: 'contactTel', sorter: true, width: 140},
{ title: t('操作'), dataIndex: 'operation', width: 120},
]);
const dataList = ref([])
const dataFile = ref([]);
const dataListAppro = ref([])
let optionSelect= reactive({
approCodeList: [],
typeCodeList: [],
securityCodeList: [],
urgencyCodeList: []
});
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)
} else {
formState.empName = userInfo.name
formState.empId = userInfo.id
}
});
const uploadListChange = (val) => {
dataFile.value = val
}
async function getInfo(id) {
spinning.value = true
try {
let data = await getLngAppro(id)
spinning.value = false
Object.assign(formState, {...data})
Object.assign(dataFile.value, formState.lngFileUploadList || [])
formState.dateAppro = formState.dateAppro ? dayjs(formState.dateAppro) : null
} catch (error) {
spinning.value = false
}
}
async function getOption() {
optionSelect.typeCodeList = await getDictionary('LNG_K_PER')
optionSelect.securityCodeList = await getDictionary('LNG_K_TYP1')
optionSelect.urgencyCodeList = await getDictionary('LNG_K_TYP2')
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
if (!pageId.value) {
const res = await getCompDept(userInfo.id)
formState.deptName = res?.dept?.name
formState.bDeptId = res?.dept?.id
formState.comName = res?.comp?.name
formState.comId = res?.comp?.id
}
}
const onSearch = (val)=> {
openModalDept(true,{isUpdate: false})
}
const onSearchUser = (val)=> {
openModal(true,{isUpdate: false})
}
const handleSuccess = (val) => {
formState.empName = val[0].name
formState.empId = val[0].id
}
const handleSuccessDept = (val, info) => {
formState.deptName = val[0].name
formState.bDeptId = val[0].id
formState.comName = info.name
formState.comId = info.id
}
function close() {
tabStore.closeTab(currentRoute.value, router);
}
async function getFormValue() {
return formState
}
async function handleSubmit(type) {
try {
await formRef.value.validateFields();
let obj = {
...formState,
lngFileUploadList: dataFile.value
}
spinning.value = true;
let request = !formState.id ? addLngAppro :updateLngAppro
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>

View File

@ -0,0 +1,347 @@
export const permissionList = [
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '合同号',
fieldId: 'kNo',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'ae5da38227f2404fad463d6e17015baa',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '合同名称',
fieldId: 'kName',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'a3313a3214834e608fe8708f8374a4a6',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '合同类型',
fieldId: 'kTypeCode1',
isSubTable: false,
showChildren: true,
type: 'input',
key: '2bf63267d12743c4bcfe126f4121261e',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '合同阶段',
fieldId: 'comId',
isSubTable: false,
showChildren: true,
type: 'input',
key: '062f5b672ecf4620a6df9c6473229e67',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '主相对方',
fieldId: 'modifyDate',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'f4ddf965a9514b96a363a23394bfd92a',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '相对方数量',
fieldId: 'cpCount',
isSubTable: false,
showChildren: true,
type: 'input',
key: '2677aab4a62545a7b6de8cea75ff0d53',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '起草日期',
fieldId: 'dateDraft',
isSubTable: false,
showChildren: true,
type: 'date',
key: 'bb61b5c5abf74808a37eeee4196b2bdb',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '合同期限',
fieldId: 'periodTypeCode',
isSubTable: false,
showChildren: true,
type: 'input',
key: '207b75d55c844d7098b13644a0c18f58',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '有效期开始',
fieldId: 'dateFrom',
isSubTable: false,
showChildren: true,
type: 'date',
key: '0ea4fb8d2ec84afd8b25685a98ab87a0',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '有效期结束',
fieldId: 'dateTo',
isSubTable: false,
showChildren: true,
type: 'date',
key: '011e9edcd0fc4a2aaf6447b74a002569',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '币种',
fieldId: 'curCode',
isSubTable: false,
showChildren: true,
type: 'select',
key: '6c3888d6f5454eac8ae5c0331a1d3e91',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '合同金额(万元)',
fieldId: 'amount',
isSubTable: false,
showChildren: true,
type: 'input',
key: '794518f2ca55402883de1bd035e86e6b',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '业务联系人',
fieldId: 'empId',
isSubTable: false,
showChildren: true,
type: 'input',
key: '493edd5b2c164ee5b4769d6b2a031abe',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '业方联系电话',
fieldId: 'tel',
isSubTable: false,
showChildren: true,
type: 'input',
key: '4dc4ad86a7a248cbbac969e4bcb36e04',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '业务部门',
fieldId: 'bDeptId',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'c41b1751b7484ab0971fccf8f261e919',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '是否招投标',
fieldId: 'bidSign',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'b326f6fef6ba42bc8b24d9ca675d46a3',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '是否已获前置审批',
fieldId: 'preApproSign',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'bc600fd947ff483589b890437e6806ef',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '先行履行',
fieldId: 'aheadSign',
isSubTable: false,
showChildren: true,
type: 'input',
key: '83f4a4fb83bb401cb643e3d736b5c206',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '采用范本',
fieldId: 'tempSign',
isSubTable: false,
showChildren: true,
type: 'input',
key: '8524de3b52db43a6a41614888d9dfc08',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '是否属于重大事项所涉合同',
fieldId: 'impSign',
isSubTable: false,
showChildren: true,
type: 'input',
key: '705571b7305c4898ad7a360e33864b72',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '状态',
fieldId: 'approCode',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'c4585093352045e2b2d5ec9415b9b237',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '合同说明',
fieldId: 'kDesc',
isSubTable: false,
showChildren: true,
type: 'input',
key: '5c742076babc4aa0b1de8314487609fc',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '备注',
fieldId: 'note',
isSubTable: false,
showChildren: true,
type: 'input',
key: '013ff2e03fe541779bae7ad4f24626a6',
children: [],
},
];