签报接口
This commit is contained in:
@ -109,5 +109,8 @@
|
||||
.ant-picker.ant-picker-disabled .ant-picker-input .ant-picker-suffix {
|
||||
display: none !important;
|
||||
}
|
||||
.ant-input-search > .ant-input-group > .ant-input-group-addon-disabled:last-child {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -10,9 +10,37 @@ enum Api {
|
||||
LngAppro = '/approve/appro',
|
||||
compDept = '/magic-api/sales/getCompAndDeptByUserId',
|
||||
depart = '/magic-api/mdm/queryAllDepartment',
|
||||
user = '/magic-api/sales/getUsersByDept'
|
||||
|
||||
|
||||
user = '/magic-api/sales/queryUsersByDept',
|
||||
company = '/magic-api/mdm/queryAllCompany',
|
||||
deptByCompany ='/magic-api/mdm/queryDeptByCompany'
|
||||
}
|
||||
/**
|
||||
* @description: 根据公司id查部门
|
||||
*/
|
||||
export async function getDeptByCompany(params: LngApproPageParams, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngApproPageModel>(
|
||||
{
|
||||
url: Api.deptByCompany,
|
||||
params
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @description: 查询查询全部公司
|
||||
*/
|
||||
export async function getAllCompany( mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngApproPageModel>(
|
||||
{
|
||||
url: Api.company,
|
||||
params: { },
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @description: 根据部门查询部门下的用户
|
||||
|
||||
89
src/api/contract/ContractFact/index.ts
Normal file
89
src/api/contract/ContractFact/index.ts
Normal file
@ -0,0 +1,89 @@
|
||||
import { LngContractFactPageModel, LngContractFactPageParams, LngContractFactPageResult } from './model/ContractFactModel';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
|
||||
enum Api {
|
||||
Page = '/contract/contractFact/page',
|
||||
List = '/contract/contractFact/list',
|
||||
Info = '/contract/contractFact/info',
|
||||
LngContractFact = '/contract/contractFact',
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 查询LngContractFact分页列表
|
||||
*/
|
||||
export async function getLngContractFactPage(params: LngContractFactPageParams, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngContractFactPageResult>(
|
||||
{
|
||||
url: Api.Page,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 获取LngContractFact信息
|
||||
*/
|
||||
export async function getLngContractFact(id: String, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngContractFactPageModel>(
|
||||
{
|
||||
url: Api.Info,
|
||||
params: { id },
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 新增LngContractFact
|
||||
*/
|
||||
export async function addLngContractFact(lngContractFact: Recordable, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.LngContractFact,
|
||||
params: lngContractFact,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 更新LngContractFact
|
||||
*/
|
||||
export async function updateLngContractFact(lngContractFact: Recordable, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.put<boolean>(
|
||||
{
|
||||
url: Api.LngContractFact,
|
||||
params: lngContractFact,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 删除LngContractFact(批量删除)
|
||||
*/
|
||||
export async function deleteLngContractFact(ids: string[], mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.delete<boolean>(
|
||||
{
|
||||
url: Api.LngContractFact,
|
||||
data: ids,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
112
src/api/contract/ContractFact/model/ContractFactModel.ts
Normal file
112
src/api/contract/ContractFact/model/ContractFactModel.ts
Normal file
@ -0,0 +1,112 @@
|
||||
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
|
||||
|
||||
/**
|
||||
* @description: LngContractFact分页参数 模型
|
||||
*/
|
||||
export interface LngContractFactPageParams extends BasicPageParams {
|
||||
kNo: string;
|
||||
|
||||
kName: string;
|
||||
|
||||
kTypeCode1: string;
|
||||
|
||||
comId: string;
|
||||
|
||||
modifyDate: string;
|
||||
|
||||
cpCount: string;
|
||||
|
||||
dateDraft: string;
|
||||
|
||||
periodTypeCode: string;
|
||||
|
||||
dateFrom: string;
|
||||
|
||||
dateTo: string;
|
||||
|
||||
curCode: string;
|
||||
|
||||
amount: string;
|
||||
|
||||
empId: string;
|
||||
|
||||
tel: string;
|
||||
|
||||
bDeptId: string;
|
||||
|
||||
bidSign: string;
|
||||
|
||||
preApproSign: string;
|
||||
|
||||
aheadSign: string;
|
||||
|
||||
tempSign: string;
|
||||
|
||||
impSign: string;
|
||||
|
||||
approCode: string;
|
||||
|
||||
kDesc: string;
|
||||
|
||||
note: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: LngContractFact分页返回值模型
|
||||
*/
|
||||
export interface LngContractFactPageModel {
|
||||
id: string;
|
||||
|
||||
kNo: string;
|
||||
|
||||
kName: string;
|
||||
|
||||
kTypeCode1: string;
|
||||
|
||||
comId: string;
|
||||
|
||||
modifyDate: string;
|
||||
|
||||
cpCount: string;
|
||||
|
||||
dateDraft: string;
|
||||
|
||||
periodTypeCode: string;
|
||||
|
||||
dateFrom: string;
|
||||
|
||||
dateTo: string;
|
||||
|
||||
curCode: string;
|
||||
|
||||
amount: string;
|
||||
|
||||
empId: string;
|
||||
|
||||
tel: string;
|
||||
|
||||
bDeptId: string;
|
||||
|
||||
bidSign: string;
|
||||
|
||||
preApproSign: string;
|
||||
|
||||
aheadSign: string;
|
||||
|
||||
tempSign: string;
|
||||
|
||||
impSign: string;
|
||||
|
||||
approCode: string;
|
||||
|
||||
kDesc: string;
|
||||
|
||||
note: string;
|
||||
}
|
||||
|
||||
0;
|
||||
|
||||
/**
|
||||
* @description: LngContractFact分页返回值结构
|
||||
*/
|
||||
export type LngContractFactPageResult = BasicFetchResult<LngContractFactPageModel>;
|
||||
@ -9,7 +9,7 @@
|
||||
<template v-if="column.dataIndex === 'fileOrg'">
|
||||
<a @click="handleDownload(record)">{{record.fileOrg}}</a>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'docDesc' && !disabled">
|
||||
<template v-if="column.dataIndex === 'docDesc' && !disabled">
|
||||
<a-input :placeholder="t('请输入附件说明')" :disabled="disabled" v-model:value="record.docDesc" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'operation'">
|
||||
|
||||
@ -1,21 +1,29 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" width="65%" :title="getTitle" @ok="handleSubmit"
|
||||
@visible-change="handleVisibleChange" >
|
||||
<BasicTable @register="registerTable" class="deptListModal"></BasicTable>
|
||||
<div>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" width="70%" :title="getTitle" @ok="handleSubmit" @visible-change="handleVisibleChange" >
|
||||
<div style="display: flex;">
|
||||
|
||||
<div class="w-1/3 xl:w-1/3 overflow-hidden bg-white" :style="{ 'border-right': '1px solid #e5e7eb' }">
|
||||
<BasicTree :title="t('公司列表')" ref="asyncTreeRef" search toolbar :clickRowToExpand="true" expandOnSearch :treeData="treeData" :fieldNames="{ key: 'id', title: 'name' }" @select="handleSelect" />
|
||||
</div>
|
||||
<BasicTable @register="registerTable" class="deptListModal w-2/3 xl:w-2/3"></BasicTable>
|
||||
</div>
|
||||
</BasicModal>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, unref, nextTick } from 'vue';
|
||||
import { ref, computed, unref, nextTick, reactive } from 'vue';
|
||||
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { getDept, } from '/@/api/approve/Appro';
|
||||
import { getLngCustomerPage} from '/@/api/sales/Customer';
|
||||
import { BasicTree, TreeActionType, TreeItem } from '/@/components/Tree';
|
||||
import { getDeptByCompany, getAllCompany } from '/@/api/approve/Appro';
|
||||
|
||||
const { t } = useI18n();
|
||||
const treeData = ref<TreeItem[]>([]);
|
||||
const codeFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'name',
|
||||
@ -53,12 +61,13 @@
|
||||
const rowId = ref('');
|
||||
const selectedKeys = ref<string[]>([]);
|
||||
const selectedValues = ref([]);
|
||||
const companyInfo = ref({})
|
||||
const props = defineProps({
|
||||
selectType: { type: String, default: 'radio' },
|
||||
|
||||
});
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
|
||||
fetch()
|
||||
setModalProps({ confirmLoading: false });
|
||||
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
@ -66,7 +75,7 @@
|
||||
|
||||
const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload }] = useTable({
|
||||
title: t('部门列表'),
|
||||
api: getDept,
|
||||
api: getDeptByCompany,
|
||||
columns,
|
||||
|
||||
bordered: true,
|
||||
@ -77,21 +86,40 @@
|
||||
schemas: codeFormSchema,
|
||||
showResetButton: true,
|
||||
},
|
||||
showIndexColumn: false,
|
||||
immediate: false, // 设置为不立即调用
|
||||
beforeFetch: (params) => {
|
||||
console.log(params, 'params')
|
||||
return { ...params};
|
||||
return { ...params, companyId: companyInfo.value.id};
|
||||
},
|
||||
rowSelection: {
|
||||
type: props.selectType,
|
||||
onChange: onSelectChange
|
||||
},
|
||||
});
|
||||
|
||||
const handleSelect = (val) => {
|
||||
companyInfo.value = findNode(treeData.value, val[0])
|
||||
reload({ searchInfo: { companyId: val[0] } });
|
||||
|
||||
}
|
||||
const findNode = (data, key) => {
|
||||
for (const item of data) {
|
||||
if (item.id === key) {
|
||||
return item;
|
||||
}
|
||||
if (item.children) {
|
||||
const found = findNode(item.children, key);
|
||||
if (found) return found;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
async function fetch() {
|
||||
treeData.value = (await getAllCompany()) as unknown as TreeItem[];
|
||||
}
|
||||
const handleVisibleChange = (visible: boolean) => {
|
||||
if (visible) {
|
||||
nextTick(() => {
|
||||
reload();
|
||||
// reload();
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -99,7 +127,7 @@
|
||||
selectedKeys.value = rowKeys;
|
||||
selectedValues.value = e
|
||||
}
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? t('部门列表') : t('')));
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? t('选择部门') : t('')));
|
||||
|
||||
async function handleSubmit() {
|
||||
if (!selectedValues.value.length) {
|
||||
@ -110,15 +138,9 @@
|
||||
return
|
||||
}
|
||||
closeModal();
|
||||
emit('success', selectedValues.value);
|
||||
emit('success', selectedValues.value, companyInfo.value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<style >
|
||||
.deptListModal .basicCol{
|
||||
|
||||
@ -133,13 +133,6 @@
|
||||
closeModal();
|
||||
emit('success', selectedValues.value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<style >
|
||||
.deptUserModal .basicCol{
|
||||
|
||||
@ -7,13 +7,18 @@ export const formConfig = {
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'code',
|
||||
label: '编号',
|
||||
component: 'Input',
|
||||
field: 'dateAppro',
|
||||
label: '拟稿日期',
|
||||
component: 'RangePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD',
|
||||
style: { width: '100%' },
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'title',
|
||||
label: '标题',
|
||||
label: '标题/编号',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
@ -29,59 +34,6 @@ export const searchFormSchema: FormSchema[] = [
|
||||
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: '审批状态',
|
||||
@ -95,14 +47,17 @@ export const searchFormSchema: FormSchema[] = [
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'content',
|
||||
label: '内容摘要',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
dataIndex: 'title',
|
||||
title: '标题',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'code',
|
||||
title: '编号',
|
||||
@ -113,16 +68,7 @@ export const columns: BasicColumn[] = [
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'title',
|
||||
title: '标题',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'typeCode',
|
||||
dataIndex: 'typeName',
|
||||
title: '签报类型',
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
@ -131,7 +77,7 @@ export const columns: BasicColumn[] = [
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'securityCode',
|
||||
dataIndex: 'securityName',
|
||||
title: '密级',
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
@ -140,7 +86,7 @@ export const columns: BasicColumn[] = [
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'urgencyCode',
|
||||
dataIndex: 'urgencyName',
|
||||
title: '缓级',
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
@ -149,7 +95,7 @@ export const columns: BasicColumn[] = [
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'empId',
|
||||
dataIndex: 'empName',
|
||||
title: '拟稿人',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
@ -158,7 +104,7 @@ export const columns: BasicColumn[] = [
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'bDeptId',
|
||||
dataIndex: 'deptName',
|
||||
title: '拟稿人所属部门',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
@ -176,22 +122,13 @@ export const columns: BasicColumn[] = [
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'approCode',
|
||||
dataIndex: 'approName',
|
||||
title: '审批状态',
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'content',
|
||||
title: '内容摘要',
|
||||
componentType: 'textarea',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
//表单事件
|
||||
export const formEventConfigs = {
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="16">
|
||||
<a-form-item label="标题" name="title" :label-col="{ span: 5, offset }" :wrapper-col="{ span: 24 }">
|
||||
<a-input v-model:value="formState.title" placeholder="请输入标题"/>
|
||||
<a-form-item label="标题" name="title" :label-col="{ span: 4 }" :wrapper-col="{ span: 24 }">
|
||||
<a-input v-model:value="formState.title" :disabled="isDisable" placeholder="请输入标题"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@ -43,12 +43,12 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="拟稿人" name="empName">
|
||||
<a-input-search v-model:value="formState.empName" placeholder="请选择拟稿人" readonly @search="onSearchUser"/>
|
||||
<a-input-search v-model:value="formState.empName" :disabled="isDisable" placeholder="请选择拟稿人" readonly @search="onSearchUser"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="拟稿人所属部门" name="bDeptName">
|
||||
<a-input-search v-model:value="formState.bDeptName" placeholder="请选择拟稿人部门" readonly @search="onSearch"/>
|
||||
<a-form-item label="拟稿人所属部门" name="deptName">
|
||||
<a-input-search v-model:value="formState.deptName" :disabled="isDisable" placeholder="请选择拟稿人部门" readonly @search="onSearch"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@ -58,7 +58,7 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="拟稿日期" name="dateAppro">
|
||||
<a-date-picker v-model:value="formState.dateAppro" style="width: 100%" placeholder="请选择评价日期" />
|
||||
<a-date-picker v-model:value="formState.dateAppro" :disabled="isDisable" style="width: 100%" placeholder="请选择评价日期" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@ -70,12 +70,12 @@
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-col :span="22">
|
||||
<a-form-item label="内容摘要" name="content" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
<a-textarea v-model:value="formState.content" :disabled="isDisable" placeholder="请输入备注,最多1000字" :maxlength="1000" :auto-size="{ minRows: 4, }"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<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>
|
||||
@ -156,17 +156,16 @@
|
||||
securityCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
urgencyCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
empName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
bDeptName: [{ 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: 9 },
|
||||
wrapperCol: { span: 15 },
|
||||
labelCol: { span: 8 },
|
||||
wrapperCol: { span: 16 },
|
||||
}
|
||||
const dataList= ref([]);
|
||||
const dataFile = ref([]);
|
||||
let optionSelect= reactive({
|
||||
approCodeList: [],
|
||||
@ -225,12 +224,15 @@
|
||||
optionSelect.urgencyCodeList = await getDictionary('LNG_URGEN')
|
||||
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
||||
|
||||
const res = await getCompDept(userInfo.id)
|
||||
formState.bDeptName = res?.dept?.name
|
||||
formState.bDeptId = res?.dept?.id
|
||||
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
|
||||
}
|
||||
|
||||
formState.comName = res?.comp?.name
|
||||
formState.comId = res?.comp?.id
|
||||
}
|
||||
const onSearch = (val)=> {
|
||||
openModalDept(true,{isUpdate: false})
|
||||
@ -242,9 +244,12 @@
|
||||
formState.empName = val[0].name
|
||||
formState.empId = val[0].id
|
||||
}
|
||||
const handleSuccessDept = (val) => {
|
||||
formState.bDeptName = val[0].name
|
||||
const handleSuccessDept = (val, info) => {
|
||||
formState.deptName = val[0].name
|
||||
formState.bDeptId = val[0].id
|
||||
|
||||
formState.comName = info.name
|
||||
formState.comId = info.id
|
||||
}
|
||||
|
||||
function close() {
|
||||
@ -258,7 +263,6 @@
|
||||
await formRef.value.validateFields();
|
||||
let obj = {
|
||||
...formState,
|
||||
lngScoreDtlList: dataList.value,
|
||||
lngFileUploadList: dataFile.value
|
||||
|
||||
}
|
||||
|
||||
@ -74,9 +74,9 @@
|
||||
|
||||
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 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},,{"name":"变更","code":"update","icon":"ant-design:edit-filled","isDefault":false,"isUse":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 actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete','update', 'startwork','flowRecord']);
|
||||
const buttonConfigs = computed(()=>{
|
||||
return filterButtonAuth(buttons.value);
|
||||
})
|
||||
@ -89,7 +89,7 @@
|
||||
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 btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete,update: handleUpdate}
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
@ -121,8 +121,8 @@
|
||||
gutter: 16,
|
||||
},
|
||||
schemas: customSearchFormSchema,
|
||||
fieldMapToTime: [],
|
||||
showResetButton: false,
|
||||
fieldMapToTime: [['dateAppro', ['startDate', 'endDate'], 'YYYY-MM-DD HH:mm:ss ', true],],
|
||||
showResetButton: true,
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit};
|
||||
@ -159,7 +159,8 @@
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
} else if (schemaId && !taskIds && processId) {
|
||||
@ -169,18 +170,32 @@
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/Appro/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: 'approve/Appro',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||
query: {
|
||||
formPath: 'approve/Appro',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type:'edit',
|
||||
id: record.id,
|
||||
disabled: 1,
|
||||
}
|
||||
});
|
||||
}
|
||||
// router.push({
|
||||
// path: '/form/Appro/' + record.id + '/viewForm',
|
||||
// query: {
|
||||
// formPath: 'approve/Appro',
|
||||
// formName: formName,
|
||||
// formId:currentRoute.value.meta.formId
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
@ -211,15 +226,43 @@
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/form/Appro/' + record.id + '/updateForm',
|
||||
query: {
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||
query: {
|
||||
formPath: 'approve/Appro',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type:'edit',
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/Appro/' + record.id + '/updateForm',
|
||||
query: {
|
||||
formPath: 'approve/Appro',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
function handleUpdate(record: Recordable) {
|
||||
const { processId, taskIds, schemaId, status } = record.workflowData || {};
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||
query: {
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId,
|
||||
id: record.id,
|
||||
status
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteList([record.id]);
|
||||
@ -289,7 +332,7 @@
|
||||
onClick: btnEvent[button.code].bind(null, record),
|
||||
});
|
||||
}
|
||||
if (['edit', 'delete'].includes(button.code)) {
|
||||
if (['edit', 'delete','update'].includes(button.code)) {
|
||||
editAndDelBtn.push({
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
@ -312,6 +355,10 @@
|
||||
actionsList = actionsList.concat(editAndDelBtn);
|
||||
}
|
||||
}
|
||||
if (record.approCode !== 'YSP') {
|
||||
let idx = actionsList.findIndex(v =>v.tooltip == '变更')
|
||||
idx>-1 && actionsList.splice(idx, 1)
|
||||
}
|
||||
return actionsList;
|
||||
}
|
||||
function handleStartwork(record: Recordable) {
|
||||
@ -396,6 +443,13 @@
|
||||
:deep(.ant-table-selection-col) {
|
||||
width: 50px;
|
||||
}
|
||||
:deep( .ant-col-8:nth-child(1)) {
|
||||
width: 320px !important;
|
||||
max-width: 320px !important;;
|
||||
}
|
||||
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
|
||||
width: 80px !important;
|
||||
}
|
||||
.show{
|
||||
display: flex;
|
||||
}
|
||||
|
||||
110
src/views/contract/ContractFact/components/ContractFactModal.vue
Normal file
110
src/views/contract/ContractFact/components/ContractFactModal.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/contract/ContractFact/components/Form.vue
Normal file
224
src/views/contract/ContractFact/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 { 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>
|
||||
1059
src/views/contract/ContractFact/components/config.ts
Normal file
1059
src/views/contract/ContractFact/components/config.ts
Normal file
File diff suppressed because it is too large
Load Diff
447
src/views/contract/ContractFact/components/createForm.vue
Normal file
447
src/views/contract/ContractFact/components/createForm.vue
Normal 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>
|
||||
347
src/views/contract/ContractFact/components/workflowPermission.ts
Normal file
347
src/views/contract/ContractFact/components/workflowPermission.ts
Normal 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: [],
|
||||
},
|
||||
];
|
||||
407
src/views/contract/ContractFact/index.vue
Normal file
407
src/views/contract/ContractFact/index.vue
Normal file
@ -0,0 +1,407 @@
|
||||
<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>
|
||||
<ContractFactModal @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('/contract/contractFact/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 { getLngContractFactPage, deleteLngContractFact} from '/@/api/contract/ContractFact';
|
||||
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 { getLngContractFact } from '/@/api/contract/ContractFact';
|
||||
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 ContractFactModal from './components/ContractFactModal.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([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true,"type":"primary"},{"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":"update","icon":"ant-design:edit-filled","isDefault":false,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":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: getLngContractFactPage,
|
||||
rowKey: 'id',
|
||||
columns: customConfigColums,
|
||||
formConfig: {
|
||||
rowProps: {
|
||||
gutter: 16,
|
||||
},
|
||||
schemas: customSearchFormSchema,
|
||||
fieldMapToTime: [['dateDraft', ['dateDraftStart', 'dateDraftEnd'], 'YYYY-MM-DD ', true],
|
||||
['dateFrom', ['dateFromStart', 'dateFromEnd'], 'YYYY-MM-DD HH:mm:ss ', true],
|
||||
['dateTo', ['dateToStart', 'dateToEnd'], 'YYYY-MM-DD HH:mm:ss ', true],],
|
||||
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/ContractFact/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: 'contract/ContractFact',
|
||||
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/ContractFact/0/createForm',
|
||||
query: {
|
||||
formPath: 'contract/ContractFact',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/form/ContractFact/' + record.id + '/updateForm',
|
||||
query: {
|
||||
formPath: 'contract/ContractFact',
|
||||
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() {
|
||||
deleteLngContractFact(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 getLngContractFact(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>
|
||||
@ -117,7 +117,7 @@
|
||||
}
|
||||
const handleSuccess = (val) => {
|
||||
val.forEach(v => {
|
||||
delete v.id
|
||||
v.id = ''
|
||||
v.diName = v.dI
|
||||
v.typeName = v.typeCode
|
||||
v.className = v.classCode
|
||||
@ -129,6 +129,7 @@
|
||||
let arr = []
|
||||
val.forEach(v => {
|
||||
dataList.value.forEach(i => {
|
||||
v.id = ''
|
||||
if (v.cuCode == i.cuCode){
|
||||
message.warning(v.cuCode + '已重复')
|
||||
} else {
|
||||
@ -266,7 +267,7 @@
|
||||
let list = JSON.parse(JSON.stringify(dataList.value));
|
||||
list.forEach(v => {
|
||||
!v.gsId && (v.gsId = values.gsId)
|
||||
!v.id && (v.id = values.id)
|
||||
// !v.id && (v.id = values.id)
|
||||
})
|
||||
let obj = {
|
||||
...values,
|
||||
|
||||
@ -12,9 +12,6 @@
|
||||
<a style="margin-right: 10px" @click="btnCheck('edit', record, index)">编辑</a>
|
||||
<a style="margin-right: 10px" @click="btnCheck('delete', record, index)">删除</a>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'eDeptCode'">
|
||||
{{ !record.id ? record.eDeptName : '' }}
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<evaluateModal @register="registerEvaluate" @success="handleSuccessEvaluate"></evaluateModal>
|
||||
@ -64,7 +61,7 @@
|
||||
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 100},
|
||||
{ title: t('评价事项'), dataIndex: 'itemName', sorter: true, width:200},
|
||||
{ title: t('评价标准'), dataIndex: 'itemDesc', sorter: true, },
|
||||
{ title: t('评价部门'), dataIndex: 'eDeptCode', sorter: true, width: 200},
|
||||
{ title: t('评价部门'), dataIndex: 'eDeptName', sorter: true, width: 200},
|
||||
{ title: t('操作'), dataIndex: 'operation', width: 120},
|
||||
]);
|
||||
const curIdx = ref(null)
|
||||
@ -82,6 +79,7 @@
|
||||
}
|
||||
}
|
||||
const handleSuccessEvaluate = (val) => {
|
||||
val.id = ''
|
||||
if (curIdx.value != null) {
|
||||
dataList.value[curIdx.value] = {...val}
|
||||
return
|
||||
@ -206,7 +204,7 @@
|
||||
list.forEach(v => {
|
||||
delete v.eDeptName
|
||||
!v.gsId && (v.gsId = values.gsId)
|
||||
!v.id && (v.id = values.id)
|
||||
// !v.id && (v.id = values.id)
|
||||
})
|
||||
let obj = {
|
||||
...values,
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="客户名称" name="cpName">
|
||||
<a-input-search v-model:value="formState.cpName" placeholder="请选择客户" readonly @search="onSearch"/>
|
||||
<a-input-search v-model:value="formState.cpName" placeholder="请选择客户" :disabled="isDisable" readonly @search="onSearch"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@ -29,7 +29,7 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="分类合计" name="score">
|
||||
<a-form-item label="分数合计" name="score">
|
||||
<a-input v-model:value="formState.score" disabled/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@ -48,10 +48,10 @@
|
||||
<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)"/>
|
||||
<a-input-number v-model:value="record.score" :disabled="isDisable" @change="numChagne('score', record, index)"/>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'scoreDesc'">
|
||||
<a-input v-model:value="record.scoreDesc" @change="numChagne('scoreDesc', record, index)"/>
|
||||
<a-input v-model:value="record.scoreDesc" :disabled="isDisable" @change="numChagne('scoreDesc', record, index)"/>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
@ -85,6 +85,7 @@
|
||||
import customerListModal from '/@/components/common/customerListModal.vue';
|
||||
import { getUserInfo } from '/@/api/system/login';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { getCompDept } from '/@/api/approve/Appro';
|
||||
|
||||
const tableName = 'ScoreCustomer';
|
||||
const columnName = 'ScoreCustomer'
|
||||
@ -114,6 +115,7 @@
|
||||
const curIdx = ref(null)
|
||||
const { notification } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const compDep = ref({})
|
||||
const formState = reactive({
|
||||
approCode: 'WTJ',
|
||||
dateGrade: dayjs(new Date()),
|
||||
@ -133,12 +135,12 @@
|
||||
{ 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: 'eDeptName', sorter: true},
|
||||
{ title: t('评分'), dataIndex: 'score', sorter: true},
|
||||
{ title: t('分数说明'), dataIndex: 'scoreDesc', sorter: true},
|
||||
{ title: t('评价人'), dataIndex: 'aEmpCode', sorter: true},
|
||||
{ title: t('评价人'), dataIndex: 'aEmpName', sorter: true},
|
||||
{ title: t('评价时间'), dataIndex: 'aTime', sorter: true},
|
||||
{ title: t('实际评价部门'), dataIndex: 'aDeptCode', sorter: true},
|
||||
{ title: t('实际评价部门'), dataIndex: 'aDeptName', sorter: true},
|
||||
]);
|
||||
const dataList= ref([]);
|
||||
const dataFile = ref([]);
|
||||
@ -194,6 +196,7 @@
|
||||
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
||||
let res = await getUserInfo()
|
||||
Object.assign(userInfo, {...res})
|
||||
compDep.value = await getCompDept(userInfo.id)
|
||||
}
|
||||
const onSearch = (val)=> {
|
||||
openModal(true,{isUpdate: false})
|
||||
@ -244,7 +247,10 @@
|
||||
formState.score = null
|
||||
dataList.value.forEach(v => {
|
||||
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
||||
v.aEmpCode = userInfo.name
|
||||
v.aEmpCode = userInfo.id
|
||||
v.aEmpName = userInfo.name
|
||||
v.aDeptCode = compDep.value?.dept?.id
|
||||
v.aDeptName = compDep.value?.dept?.name
|
||||
v.gsiId = v.id
|
||||
|
||||
delete v.id
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
export const customFormConfig = {
|
||||
codeList: ['addCustomer','addSupplier', 'addCustomerScore', 'addSupplierScore', 'addAppro'],
|
||||
codeList: ['addCustomer','addSupplier', 'addCustomerScore', 'addSupplierScore', 'addAppro', 'contractFactApprove'],
|
||||
router: [
|
||||
{code: 'addCustomer', src: ''}
|
||||
]
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="供应商" name="cpName">
|
||||
<a-input-search v-model:value="formState.cpName" placeholder="请选择供应商" readonly @search="onSearch"/>
|
||||
<a-input-search v-model:value="formState.cpName" placeholder="请选择供应商" :disabled="isDisable" readonly @search="onSearch"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@ -29,7 +29,7 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="分类合计" name="score">
|
||||
<a-form-item label="分数合计" name="score">
|
||||
<a-input v-model:value="formState.score" disabled/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@ -48,10 +48,10 @@
|
||||
<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)"/>
|
||||
<a-input-number v-model:value="record.score" :disabled="isDisable" @change="numChagne('score', record, index)"/>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'scoreDesc'">
|
||||
<a-input v-model:value="record.scoreDesc" @change="numChagne('scoreDesc', record, index)"/>
|
||||
<a-input v-model:value="record.scoreDesc" :disabled="isDisable" @change="numChagne('scoreDesc', record, index)"/>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
@ -85,6 +85,7 @@
|
||||
import supplierListModal from '/@/components/common/supplierListModal.vue';
|
||||
import { getUserInfo } from '/@/api/system/login';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { getCompDept } from '/@/api/approve/Appro';
|
||||
|
||||
const tableName = 'ScoreSupplier';
|
||||
const columnName = 'ScoreSupplier'
|
||||
@ -114,6 +115,7 @@
|
||||
const curIdx = ref(null)
|
||||
const { notification } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const compDep = ref({})
|
||||
const formState = reactive({
|
||||
approCode: 'WTJ',
|
||||
dateGrade: dayjs(new Date()),
|
||||
@ -133,12 +135,12 @@
|
||||
{ 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: 'eDeptName', sorter: true},
|
||||
{ title: t('评分'), dataIndex: 'score', sorter: true},
|
||||
{ title: t('分数说明'), dataIndex: 'scoreDesc', sorter: true},
|
||||
{ title: t('评价人'), dataIndex: 'aEmpCode', sorter: true},
|
||||
{ title: t('评价人'), dataIndex: 'aEmpName', sorter: true},
|
||||
{ title: t('评价时间'), dataIndex: 'aTime', sorter: true},
|
||||
{ title: t('实际评价部门'), dataIndex: 'aDeptCode', sorter: true},
|
||||
{ title: t('实际评价部门'), dataIndex: 'aDeptName', sorter: true},
|
||||
]);
|
||||
const dataList= ref([]);
|
||||
const dataFile = ref([]);
|
||||
@ -194,6 +196,7 @@
|
||||
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
||||
let res = await getUserInfo()
|
||||
Object.assign(userInfo, {...res})
|
||||
compDep.value = await getCompDept(userInfo.id)
|
||||
}
|
||||
const onSearch = (val)=> {
|
||||
openModal(true,{isUpdate: false})
|
||||
@ -245,7 +248,10 @@
|
||||
formState.score = null
|
||||
dataList.value.forEach(v => {
|
||||
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
||||
v.aEmpCode = userInfo.name
|
||||
v.aEmpCode = userInfo.id
|
||||
v.aEmpName = userInfo.name
|
||||
v.aDeptCode = compDep.value?.dept?.id
|
||||
v.aDeptName = compDep.value?.dept?.name
|
||||
v.gsiId = v.id
|
||||
|
||||
delete v.id
|
||||
|
||||
Reference in New Issue
Block a user