合同待办已办功能调整

This commit is contained in:
z9130 2024-10-10 17:24:57 +08:00
parent 4a5c4e0e5c
commit dc87bbca61
16 changed files with 972 additions and 1026 deletions

View File

@ -1,4 +1,4 @@
```shell
generate-api --swagger_url=http://127.0.0.1:4523/export/openapi/2?version=3.0 --template ./resource/apiDefinitions.ejs --output_dir ./resource --type path --prefix_to_filter /
generate-api --swagger_url="http://127.0.0.1:4523/export/openapi?projectId=4582192&specialPurpose=openapi-generator" --template ./resource/apiDefinitions.ejs --output_dir ./resource --type path --prefix_to_filter /
```

View File

@ -92,12 +92,6 @@ const routes: RouteRecordRaw[] = [
{
name: 'ContractBusinessEdit',
path: '/contract/business/edit/:id?',
beforeEnter: (e) => {
if (e.params.id && e.params.id === ':id') {
e.params.id = '';
e.fullPath = '/contract/business/edit';
}
},
component: () => import('#/views/contract/business/edit/index.vue'),
meta: {
hideInMenu: true,

View File

@ -99,11 +99,7 @@ export default {
// 合同待办类型
contract_todo_type: createEntry('合同待办类型', [
{ label: '合同立项', value: 'contractSetup' },
{ label: '合同立项废除', value: 'contractSetupAbolish' },
{ label: '合同选商', value: 'selectMerchant' },
{ label: '合同选商废除', value: 'selectMerchantAbolish' },
{ label: '合同选商结果', value: 'selectMerchantResult' },
{ label: '合同选商结果废除', value: 'selectMerchantResultAbolish' },
{ label: '合同申报', value: 'contractDeclare' },
{ label: '合同签订', value: 'contractSign' },
{ label: '合同履行', value: 'contractPerform' },

View File

@ -2,6 +2,12 @@ import type { VxeGridPropTypes } from 'vxe-table';
export function getBidColumns(_params?: any): VxeGridPropTypes.Columns {
const columns: VxeGridPropTypes.Columns = [
{
field: 'operate',
title: '操作',
width: 120,
slots: { default: 'operate-slot' },
},
{
type: 'seq',
width: 50,
@ -29,13 +35,6 @@ export function getBidColumns(_params?: any): VxeGridPropTypes.Columns {
minWidth: 300,
slots: { default: 'phasedesc-slot' },
},
{
field: 'operate',
title: '操作',
width: 120,
slots: { default: 'operate-slot' },
fixed: 'right',
},
];
return columns;
@ -43,31 +42,42 @@ export function getBidColumns(_params?: any): VxeGridPropTypes.Columns {
export function getProviderColumns(_params?: any): VxeGridPropTypes.Columns {
const columns: VxeGridPropTypes.Columns = [
{
field: 'operate',
title: '操作',
width: 120,
slots: { default: 'operate-slot' },
},
{
field: 'providerName',
title: '供应商名称',
width: 200,
width: 250,
},
{
field: 'qualification',
title: '资质情况',
width: 200,
slots: { default: 'qualification-slot' },
},
{
field: 'contactPerson',
title: '联系人',
width: 150,
slots: { default: 'contactPerson-slot' },
},
{
field: 'contactPhone',
title: '联系电话',
width: 150,
slots: { default: 'contactPhone-slot' },
},
{
field: 'remarks',
title: '备注',
minWidth: 200,
slots: { default: 'remarks-slot' },
},
];
return columns;

View File

@ -14,13 +14,36 @@ const [ChooseCompanyModal, chooseCompanyModalApi] = useVbenModal({
connectedComponent: chooseCompanyModal,
});
export function getFormSchema(params: any = {}) {
const { formRef, dictMap = {} } = params;
const xGridRefs = ref<Map<string, any>>(new Map());
const xGridRef = ref();
const gridRefs = ref<Map<string, any>>(new Map());
export function getExtraData() {
// let tempBiddingList = xGridRef.value.getTableData().fullData;
// console.log(gridRefs.value);
for (const [key, value] of xGridRefs.value) {
console.log(`Key: ${key}, Value: ${value}`);
let xRef = value;
console.log(xRef.getTableData().fullData);
}
for (const [key, value] of gridRefs.value) {
console.log(`Key: ${key}, Value: ${value}`);
let xRef = value;
console.log(xRef.getTableData().fullData);
}
return {
biddingList: [],
};
}
export function getFormSchema(params: any = {}) {
let { formRef, dictMap = {}, bidList = [] } = params;
/** Hooks - 表格 */
const gridOptions = {
showOverflow: true,
columns: getBidColumns({ readOnly: false }),
data: [],
toolbarConfig: {
@ -55,15 +78,13 @@ export function getFormSchema(params: any = {}) {
},
};
const gridRefs = ref<Map<string, any>>(new Map());
return {
col: { span: 24 },
initialForm: {
contractName: '',
priceType: 'CNY',
isBid: '0',
budgetSum2: 0,
bidNum: 2,
},
labelCol: { style: { width: '120px' } },
columns: {
@ -209,29 +230,30 @@ export function getFormSchema(params: any = {}) {
class="min-w-[180px]"
onChange={(value) => {
// 获取当前表格的全部数据
const { fullData } = xGridRef.value.getTableData();
let fullData = bidList;
const currentLength = fullData.length;
if (value < currentLength) {
// 删除多余的行(从 value 开始的行)
const rowsToRemove = fullData.slice(value);
xGridRef.value.remove(rowsToRemove);
fullData = fullData.slice(0, value);
} else if (value > currentLength) {
// 插入新的行数据
const rowsToAdd = Array.from({
length: value - currentLength,
}).map((_, i) => ({
id: currentLength + i + 1,
bidName: `${currentLength + i + 1}标段`,
phaseSeq: currentLength + i + 1,
phaseName: `${currentLength + i + 1}标段`,
phaseMoney: null,
phaseDesc: '',
providerList: [],
}));
xGridRef.value.insertAt(rowsToAdd, -1);
fullData = [...fullData, ...rowsToAdd];
}
xGridRef.value.setAllRowExpand(true);
bidList = fullData;
}}
options={options2}
v-model:value={form.budgetSum2}
v-model:value={form.bidNum}
/>
</div>
</a-form-item-rest>
@ -242,16 +264,17 @@ export function getFormSchema(params: any = {}) {
class="mt-2"
style={{
display:
form.isBid === '1' && form.budgetSum2 > 0
? 'block'
: 'none',
form.isBid === '1' && form.bidNum > 0 ? 'block' : 'none',
}}
>
<a-form-item-rest>
<VxeGrid ref={xGridRef} {...gridOptions}>
<VxeGrid
ref={(el) => el && xGridRefs.value.set(row.id, el)}
{...gridOptions}
>
{{
'bidname-slot': ({ row }: any) => (
<a-input v-model:value={row.bidName} />
<a-input v-model:value={row.phaseName} />
),
'phasemoney-slot': ({ row }: any) => (
<a-input-number
@ -267,7 +290,35 @@ export function getFormSchema(params: any = {}) {
data={row.providerList}
ref={(el) => el && gridRefs.value.set(row.id, el)}
{...gridOptionsByProvider}
/>
>
{{
'qualification-slot': ({ row }: any) => (
<a-input v-model:value={row.aptitudeName} />
),
'contactPerson-slot': ({ row }: any) => (
<a-input v-model:value={row.contactPerson} />
),
'contactPhone-slot': ({ row }: any) => (
<a-input v-model:value={row.ContactPhone} />
),
'remarks-slot': ({ row }: any) => (
<a-textarea v-model:value={row.remarks} />
),
'operate-slot': ({ row }: any) => (
<a-button
type="text"
size="small"
class="text-red-500"
onClick={() => {
const xGridRef = gridRefs.value.get(id);
xGridRef && xGridRef.remove(row);
}}
>
</a-button>
),
}}
</VxeGrid>
),
'operate-slot': ({ row }: any) => (
<a-button

View File

@ -23,7 +23,7 @@ import chooseUserModal from '#/views/system/user/choose-user-modal.vue';
import { getColumns } from '../../approval/signing-basis/columns';
import { getFormSchema as getFormSchemaByBaseInfo } from './basic-info-curd';
import { getFormSchema } from './curd';
import { getFormSchema, getExtraData } from './curd';
const [ChooseUserModal, chooseUserModalApi] = useVbenModal({
connectedComponent: chooseUserModal,
@ -59,7 +59,7 @@ const formBindingByBaseInfo = ref({
columns: {},
});
const formBinding = ref(null);
const formBinding = ref<any>(null);
/** Hooks - 表格 */
const gridOptions = reactive(
@ -118,7 +118,8 @@ function handleDelete() {
});
}
const collapses = ['1', '2', '3', '4'];
// const collapses = ['1', '2', '3', '4'];
const collapses = ['3', '4'];
const collapseActiveKey = ref(collapses);
function areArraysEqualUnordered(arr1, arr2) {
if (arr1.length !== arr2.length) return false;
@ -154,8 +155,7 @@ async function handleAudit(
title: '提示',
content: '是否确认审核通过?',
onOk: async () => {
try {
await Apis.selectMerchantsBasicInfo.post_submit({
const [error, _] = await Apis.selectMerchantsBasicInfo.post_submit({
params: {
guid: selectMerchantsBasicInfoId.value,
},
@ -166,12 +166,12 @@ async function handleAudit(
comment: '通过',
},
});
message.success('审核通过');
back();
} catch (error) {
if (error) {
logger.error('审核通过失败', error);
message.error('审核通过失败,请稍候再试');
return;
}
message.success('审核通过');
},
});
}
@ -231,6 +231,12 @@ async function handleAudit(
}
async function handleSave() {
console.log(formRefByBaseInfo.value.form);
console.log(formRef.value.form);
console.log(getExtraData());
return;
isLoading.value = true;
try {
@ -416,13 +422,14 @@ const contractData = ref<any>({});
const businessData = ref<any>({});
const auditId = ref();
const dictMap = ref({});
onMounted(async () => {
isLoading.value = true;
try {
if (id.value) {
const dictMap = await getDictDatasAsync([
dictMap.value = await getDictDatasAsync([
DICT_TYPE.contract_authorization_period,
DICT_TYPE.comprehensive_project_name,
DICT_TYPE.contract_price_style,
@ -432,13 +439,12 @@ onMounted(async () => {
DICT_TYPE.section_num,
DICT_TYPE.contract_price_style,
]);
console.log(dictMap);
const contractReferTypeData: any = await Apis.contractReferType.get_list({
params: {},
});
contractTypeData.value = contractReferTypeData.rows || [];
formBinding.value = getFormSchema({ formRef, dictMap });
formBinding.value = getFormSchema({ formRef, dictMap: dictMap.value });
formBindingByBaseInfo.value.columns = getFormSchemaByBaseInfo({
contractTypeData: contractTypeData.value,
@ -470,6 +476,9 @@ onMounted(async () => {
const files = await fileUploader.select(business.fileUuid);
business.fileList = files;
}
business.isBid = '1';
business.bidNum = 2;
businessData.value = business;
nextTick(() => {
@ -560,7 +569,12 @@ onMounted(async () => {
<a-spin :spinning="isLoading">
<div class="mx-auto overflow-auto py-2">
<a-collapse v-model:active-key="collapseActiveKey" :bordered="false">
<a-collapse-panel key="1" class="w-full" header="基本信息">
<a-collapse-panel
key="1"
class="w-full"
forceRender
header="基本信息"
>
<fs-form
ref="formRefByBaseInfo"
class="w-full"
@ -584,17 +598,49 @@ onMounted(async () => {
</fs-form>
</a-collapse-panel>
<a-collapse-panel key="2" class="w-full" header="签约依据">
<a-collapse-panel
key="2"
class="w-full"
forceRender
header="签约依据"
>
<VxeGrid ref="xGridRef" v-bind="gridOptions" class="">
<template #toolbar_buttons></template>
</VxeGrid>
</a-collapse-panel>
<a-collapse-panel key="3" class="w-full" header="选商资料">
<fs-form ref="formRef" class="w-full" v-bind="formBinding" />
<a-collapse-panel
key="3"
class="w-full"
forceRender
header="选商资料"
>
<fs-form ref="formRef" class="w-full" v-bind="formBinding">
<template #form_isBid="{ form }">
<div class="flex flex-col">
<div class="flex items-center">
<a-form-item class="!mb-0 inline-block">
<a-radio-group
:options="dictMap[DICT_TYPE.section_type]"
v-model:value="form.isBid"
/>
</a-form-item>
<div class="w-2"></div>
<a-select v-if="form.isBid === '1'">
</a-select>
</div>
</div>
</template>
</fs-form>
</a-collapse-panel>
<a-collapse-panel key="4" class="w-full" header="招标文件上传">
<a-collapse-panel
key="4"
class="w-full"
forceRender
header="招标文件上传"
>
<a-form :label-col="{ style: { width: '120px' } }">
<a-form-item label="附件上传" name="fileList">
<a-upload

View File

@ -429,7 +429,12 @@ onMounted(async () => {
<a-spin :spinning="isLoading">
<div class="mx-auto overflow-auto py-2">
<a-collapse v-model:active-key="collapseActiveKey" :bordered="false">
<a-collapse-panel key="1" class="w-full" header="合同基本信息">
<a-collapse-panel
key="1"
class="w-full"
forceRender
header="合同基本信息"
>
<fs-form
ref="formRefByBaseInfo"
class="w-full"
@ -453,29 +458,54 @@ onMounted(async () => {
</fs-form>
</a-collapse-panel>
<a-collapse-panel key="2" class="w-full" header="选商资料">
<a-collapse-panel
key="2"
class="w-full"
forceRender
header="选商资料"
>
<fs-form ref="formRef" class="w-full" v-bind="formBinding" />
</a-collapse-panel>
<a-collapse-panel key="3" class="w-full" header="招标文件">
<a-collapse-panel
key="3"
class="w-full"
forceRender
header="招标文件"
>
<VxeGrid ref="xGridRef" v-bind="gridOptions" class="">
<template #toolbar_buttons></template>
</VxeGrid>
</a-collapse-panel>
<a-collapse-panel key="4" class="w-full" header="审批信息">
<a-collapse-panel
key="4"
class="w-full"
forceRender
header="审批信息"
>
<VxeGrid ref="xGridRef" v-bind="gridOptions" class="">
<template #toolbar_buttons></template>
</VxeGrid>
</a-collapse-panel>
<a-collapse-panel key="5" class="w-full" header="招标(谈判)结果填报">
<a-collapse-panel
key="5"
class="w-full"
forceRender
header="招标(谈判)结果填报"
>
<VxeGrid ref="xGridRef" v-bind="gridOptions" class="">
<template #toolbar_buttons></template>
</VxeGrid>
</a-collapse-panel>
<a-collapse-panel key="6" class="w-full" header="招标相关资料上传">
<a-collapse-panel
key="6"
class="w-full"
forceRender
header="招标相关资料上传"
>
<a-form :label-col="{ style: { width: '120px' } }">
<a-form-item label="附件上传" name="fileList">
<a-upload

View File

@ -3,17 +3,18 @@ import type { VxeGridPropTypes } from 'vxe-table';
import { dict } from '@fast-crud/fast-crud';
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
import { useRender } from '#/hooks/useRender';
export const PrimaryKey = 'guid';
export function getColumns(params: any = {}): VxeGridPropTypes.Columns {
if (params.type === 'choose') {
return [
{ field: 'providerId', title: '编号', type: 'checkbox', width: 100 },
{ field: 'providerId', title: '编号', type: 'checkbox', width: 130 },
{
field: 'providerName',
title: '单位全称',
minWidth: 200,
minWidth: 250,
slots: {
default: 'provider-name-slot',
},
@ -26,8 +27,17 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns {
{ field: 'inputPerson1', title: '注册资金', width: 100 },
{ field: 'currencyTypeName', title: '币种', width: 100 },
{ field: 'createPerson', title: '创建人', width: 100 },
{ field: 'createDate', title: '创建时间', width: 100 },
{ field: 'inputDepartName', title: '备注', width: 100 },
{
field: 'createDate',
title: '创建时间',
width: 120,
slots: {
default: ({ row }) => {
return useRender.renderDate(row.applyTime, 'YYYY-MM-DD');
},
},
},
{ field: 'inputDepartName', title: '备注', width: 150 },
];
}
return [

View File

@ -7,7 +7,7 @@ import { Page } from '@vben/common-ui';
import Apis from '#/api';
import { useVxeTable } from '#/hooks/vxeTable';
import { getTodoColumns } from '#/views/contract/schema';
import { toDetail, toDetailPage } from '#/views/contract/utils';
import { toDetailPage } from '#/views/contract/utils';
const props = withDefaults(
defineProps<{
@ -80,6 +80,22 @@ const grid2Options = reactive(
}),
);
function toDetail(type: string, id: string, row?: any) {
switch (type) {
case 'contractSetup': {
router.push(`/contract/approval/edit/${id}`);
break;
}
case 'selectMerchant': {
router.push(`/contract/business/edit/${row.contractId}`);
break;
}
default: {
break;
}
}
}
onMounted(() => {});
//

View File

@ -16,13 +16,13 @@ export function getTodoColumns(_params: any = {}): VxeGridPropTypes.Columns {
{
field: 'contractName',
title: '名称',
minWidth: 200,
minWidth: 250,
slots: { default: 'title_slot' },
},
{
field: 'module',
title: '模块',
width: 150,
width: 120,
slots: {
default: ({ row }) => {
return (
@ -52,11 +52,11 @@ export function getApprovalColumns(
): VxeGridPropTypes.Columns {
return [
{ type: 'seq', width: 50, align: 'center', fixed: 'left' },
{ field: 'contractId', title: '编号', width: 100 },
{ field: 'contractId', title: '编号', width: 150 },
{
field: 'title',
title: '任务名称',
minWidth: 200,
minWidth: 250,
slots: {
default: ({ row }) => {
const text = row.title;

View File

@ -1,26 +1,4 @@
import Apis from '#/api';
import { router } from '#/router';
/**
*
* @param type
* @param id
*/
export function toDetail(type: string, id: string, row?: any) {
switch (type) {
case 'contractSetup': {
router.push(`/contract/approval/edit/${id}`);
break;
}
case 'selectMerchant': {
router.push(`/contract/business/edit/${row.contractId}`);
break;
}
default: {
break;
}
}
}
/**
*

View File

@ -7,7 +7,10 @@ import Apis from '#/api';
import { useVxeTable } from '#/hooks/vxeTable';
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
import { getTodoColumns } from '#/views/contract/schema';
import { toDetail, toDetailPage } from '#/views/contract/utils';
import { toDetailPage } from '#/views/contract/utils';
import { useRouter } from 'vue-router';
const router = useRouter();
const { xGridRef, triggerProxy, gridProps } = useVxeTable({ ref: 'xGridRef' });
const { xGridRef: xGrid2Ref, triggerProxy: triggerProxy2 } = useVxeTable({
@ -89,6 +92,22 @@ async function loadDataByDictType() {
treeData.value = [{ title: '全部', key: 'all', children: data }];
}
function toDetail(type: string, id: string, row?: any) {
switch (type) {
case 'contractSetup': {
router.push(`/contract/approval/edit/${id}`);
break;
}
case 'selectMerchant': {
router.push(`/contract/business/edit/${row.contractId}`);
break;
}
default: {
break;
}
}
}
onMounted(() => {
loadDataByDictType();
});
@ -150,6 +169,11 @@ onMounted(() => {
>
<vxe-grid ref="xGrid2Ref" v-bind="grid2Options" class="flex-1">
<template #toolbar_buttons> </template>
<template #title_slot="{ row }">
<span class="">
{{ row.contractName }}
</span>
</template>
<template #operate="{ row }">
<a-button
class="text-blue-500"

View File

@ -30,35 +30,35 @@ export default defineConfig(async () => {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/app/, '/'),
// target: `http://10.71.220.24:8083/rl`,
target: `http://192.168.147.164:8083/rl`,
target: `http://192.168.148.88:8083/rl`,
ws: true,
},
'/api/flowCenter': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/flowCenter/, '/flowCenter'),
// target: `http://10.71.220.24:8083/rl`,
target: `http://192.168.147.164:19007`,
target: `http://192.168.148.88:19007`,
ws: true,
},
'/api/czg/flowCenter': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/flowCenter/, '/flowCenter'),
// target: `http://10.71.220.24:8083/rl`,
target: `http://192.168.147.164:19007`,
target: `http://192.168.148.88:19007`,
ws: true,
},
'/api/zp/flowCenter': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/flowCenter/, '/flowCenter'),
// target: `http://10.71.220.24:8083/rl`,
target: `http://192.168.147.164:19007`,
target: `http://192.168.148.88:19007`,
ws: true,
},
'/api/zzz/flowCenter': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/flowCenter/, '/flowCenter'),
// target: `http://10.71.220.24:8083/rl`,
target: `http://192.168.147.164:19007`,
target: `http://192.168.148.88:19007`,
ws: true,
},
'/api/czg/app': {
@ -71,15 +71,15 @@ export default defineConfig(async () => {
'/api/czg/uc': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/czg\/uc/, '/'),
target: `http://192.168.147.164:8082`,
// target: `http://192.168.147.164:8082`,
target: `http://192.168.148.88:8082`,
// target: `http://192.168.148.88:8082`,
ws: true,
},
'/api/uc': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/uc/, '/'),
// target: `http://10.71.220.24:8082`,
target: `http://192.168.147.164:8082`,
target: `http://192.168.148.88:8082`,
ws: true,
},
'/api/xmh/app': {
@ -93,7 +93,7 @@ export default defineConfig(async () => {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/xmh\/uc/, '/'),
// mock代理目标地址
target: `http://192.168.147.164:8082`,
target: `http://192.168.148.88:8082`,
ws: true,
},
'/api/zp/app': {
@ -107,21 +107,21 @@ export default defineConfig(async () => {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/zp\/uc/, '/'),
// mock代理目标地址
target: `http://192.168.147.164:8082`,
target: `http://192.168.148.88:8082`,
ws: true,
},
'/api/zzz/app': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/zzz\/app/, '/'),
// target: `http://192.168.0.193:8083/rl`,
target: `http://192.168.147.164:8089/rl`,
target: `http://192.168.148.88:8089/rl`,
ws: true,
},
'/api/zzz/uc': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/zzz\/uc/, '/'),
target: `http://192.168.147.164:8082`,
// target: `http://192.168.147.164:8082`,
target: `http://192.168.148.88:8082`,
// target: `http://192.168.148.88:8082`,
ws: true,
},
},

View File

@ -243,7 +243,7 @@ function handleUserRowClick(row) {
formRef.value?.setFormData({
[`${selectField.value}People`]: row.label,
[`${selectField.value}Telphone`]: row.mobile,
[`${selectField.value}Phone`]: '',
[`${selectField.value}Phone`]: row.PHONE,
});
console.log(peoples);
console.log(formRef.value?.form);

View File

@ -80,6 +80,7 @@ function getColumns(_params: any = {}): VxeGridPropTypes.Columns {
{ field: 'EMPLOYEE_GENDER', title: '性别', width: 80 },
{ field: 'MAIL_ADDRESS', title: '邮箱', width: 150 },
{ field: 'PHONE_NUM', title: '联系方式', width: 120 },
{ field: 'PHONE', title: '办公室电话', width: 120 },
{ field: 'ORG_NAME', title: '所属组织', minWidth: 120 },
];
return columns;

File diff suppressed because it is too large Load Diff