1.0.84 合同变更编辑添加字段

dev
yinq 1 week ago
parent 7032b2b9ce
commit fcc2961aee

@ -74,11 +74,21 @@ export interface ContractChangeVO {
*/
undertakeDeptId: string | number;
/**
*
*/
undertakeDeptName?: string;
/**
*
*/
undertakeBy: number;
/**
*
*/
undertakeByName?: string;
/**
* /
*/

@ -20,26 +20,60 @@
<el-button class="float-right" link @click="goBack"></el-button>
</template>
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="变更编号" prop="changeCode">
<el-input v-model="form.changeCode" placeholder="保存后自动生成" disabled/>
</el-form-item>
<el-form-item label="变更类型" prop="changeType">
<el-radio-group v-model="form.changeType" :disabled="isFormDisabled">
<el-radio v-for="dict in contract_change_type" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="选择合同" prop="contractId">
<el-input
v-model="selectedContractName"
placeholder="请选择已激活的合同(点击右侧图标选择)"
readonly
:disabled="isFormDisabled"
>
<template #suffix>
<el-icon style="cursor: pointer" @click="openContractSelect"><Search /></el-icon>
</template>
</el-input>
</el-form-item>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="变更编号" prop="changeCode">
<el-input v-model="form.changeCode" placeholder="保存后自动生成" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="变更类型" prop="changeType">
<el-radio-group v-model="form.changeType" :disabled="isFormDisabled">
<el-radio v-for="dict in contract_change_type" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="选择合同" prop="contractId">
<el-input
v-model="selectedContractName"
placeholder="请选择已激活的合同(点击右侧图标选择)"
readonly
:disabled="isFormDisabled"
>
<template #suffix>
<el-icon style="cursor: pointer" @click="openContractSelect"><Search /></el-icon>
</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="承办人" prop="undertakeBy">
<el-select v-model="form.undertakeBy" placeholder="请选择承办人" :disabled="isFormDisabled" filterable clearable style="width: 100%">
<el-option v-for="item in userInfoList" :key="item.userId" :label="item.nickName" :value="item.userId" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="行业/大区" prop="industryRegion">
<el-input v-model="form.industryRegion" placeholder="请输入行业/大区" :disabled="isFormDisabled" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="承办部门" prop="undertakeDeptId">
<el-select v-model="form.undertakeDeptId" placeholder="请选择承办部门" :disabled="isFormDisabled" filterable clearable style="width: 100%">
<el-option v-for="item in deptInfoList" :key="item.deptId" :label="item.deptName" :value="item.deptId" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="印章法人单位" prop="sealLegalEntity">
<el-radio-group v-model="form.sealLegalEntity" :disabled="isFormDisabled">
<el-radio v-for="dict in seal_legal_entity" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="变更原因" prop="changeReason">
<el-input
v-model="form.changeReason"
@ -418,6 +452,8 @@ import type { PaymentStageVO } from '@/api/oa/base/paymentStage/types';
import { getCrmCustomerInfoList } from '@/api/oa/crm/customerInfo';
import { getCrmPaymentAccountList } from '@/api/oa/crm/paymentAccount';
import { getUserList } from '@/api/system/user';
import { allListDept } from '@/api/system/dept';
import { getInfo } from '@/api/login';
import { getBasePrintTemplateList } from '@/api/oa/base/printTemplate';
import ApprovalButton from '@/components/Process/approvalButton.vue';
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
@ -436,9 +472,18 @@ const {
business_direction,
contract_flag,
contract_template_flag,
material_flag
material_flag,
seal_legal_entity
} = toRefs<any>(
proxy?.useDict('contract_change_type', 'contract_category', 'business_direction', 'contract_flag', 'contract_template_flag', 'material_flag')
proxy?.useDict(
'contract_change_type',
'contract_category',
'business_direction',
'contract_flag',
'contract_template_flag',
'material_flag',
'seal_legal_entity'
)
);
const paymentMethodOptions = ['电汇', '银行承兑6个月内', '电汇/银行承兑6个月内', '商业承兑'];
@ -459,6 +504,7 @@ const customerInfoList = ref<any[]>([]);
const userInfoList = ref<any[]>([]);
const paymentAccountList = ref<any[]>([]);
const printTemplateList = ref<any[]>([]);
const deptInfoList = ref<any[]>([]);
// /使
const changeMaterialList = computed(() => form.value.changeMaterialList || []);
@ -619,7 +665,11 @@ const form = ref<
changeInfo: undefined,
changeMaterialList: undefined,
changePaymentMethodList: undefined,
changeCode: undefined
changeCode: undefined,
undertakeDeptId: undefined,
undertakeBy: undefined,
industryRegion: undefined,
sealLegalEntity: undefined
});
const rules = {
@ -753,6 +803,10 @@ async function loadDetail() {
form.value.changeInfo = d.changeInfo ? { ...d.changeInfo } : undefined;
form.value.changeMaterialList = (d.changeMaterialList || []).map((x: any) => ({ ...x }));
form.value.changePaymentMethodList = (d.changePaymentMethodList || []).map((x: any) => ({ ...x }));
form.value.undertakeDeptId = m.undertakeDeptId;
form.value.undertakeBy = m.undertakeBy;
form.value.industryRegion = m.industryRegion;
form.value.sealLegalEntity = m.sealLegalEntity;
selectedContractName.value = m.contractName || '';
}
@ -763,6 +817,7 @@ function loadSelectOptions() {
getUserList({ pageNum: 1, pageSize: 1000 }).then((res) => (userInfoList.value = res.data || []));
getCrmPaymentAccountList({}).then((res) => (paymentAccountList.value = res.data || []));
getBasePrintTemplateList({ templateType: '1' }).then((res) => (printTemplateList.value = res.data || []));
allListDept({} as any).then((res) => (deptInfoList.value = res.data || []));
}
// ----- -----
@ -933,7 +988,11 @@ function buildPayload(changeStatus: '1' | '2'): ContractChangeSaveForm {
changeContractCode: f.changeContractCode,
changeContractName: f.changeContractName,
customerName: f.customerName,
changeContractAmount: f.changeContractAmount
changeContractAmount: f.changeContractAmount,
undertakeDeptId: f.undertakeDeptId,
undertakeBy: f.undertakeBy,
industryRegion: f.industryRegion,
sealLegalEntity: f.sealLegalEntity
};
if (f.changeType === '1') {
payload.changeInfo = f.changeInfo;
@ -1019,6 +1078,17 @@ onMounted(async () => {
} else {
form.value.changeType = '1';
form.value.flowStatus = 'draft';
//
try {
const infoRes = await getInfo();
if (infoRes?.data?.user) {
const user = infoRes.data.user as any;
if (user.deptId != null) form.value.undertakeDeptId = user.deptId;
if (user.userId != null) form.value.undertakeBy = user.userId;
}
} catch (e) {
console.error('获取登录用户信息失败', e);
}
}
});
</script>

@ -20,9 +20,6 @@
<el-option v-for="dict in contract_change_status" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="申请时间" prop="applyTime">
<el-date-picker clearable v-model="queryParams.applyTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择申请时间" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
@ -51,35 +48,56 @@
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['oa/erp:contractChange:export']"> </el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :search="true" @queryTable="getList"></right-toolbar>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" border :data="contractChangeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="变更单编号" align="center" prop="changeCode" width="140" />
<el-table-column label="变更类型" align="center" prop="changeType" width="100">
<el-table-column label="合同变更ID" align="center" prop="contractChangeId" width="100" v-if="columns[0].visible" />
<el-table-column label="变更单编号" align="center" prop="changeCode" width="140" v-if="columns[1].visible" />
<el-table-column label="变更类型" align="center" prop="changeType" width="100" v-if="columns[2].visible">
<template #default="scope">
<dict-tag :options="contract_change_type" :value="scope.row.changeType" />
</template>
</el-table-column>
<el-table-column label="原合同编号" align="center" prop="contractCode" width="140" />
<el-table-column label="原合同名称" align="center" prop="contractName" min-width="160" show-overflow-tooltip />
<el-table-column label="变更状态" align="center" prop="changeStatus" width="100">
<el-table-column label="原合同ID" align="center" prop="contractId" width="100" v-if="columns[3].visible" />
<el-table-column label="原合同编号" align="center" prop="contractCode" width="140" v-if="columns[4].visible" />
<el-table-column label="原合同名称" align="center" prop="contractName" min-width="160" show-overflow-tooltip v-if="columns[5].visible" />
<el-table-column label="原客户名称" align="center" prop="originalCustomerName" min-width="120" show-overflow-tooltip v-if="columns[6].visible" />
<el-table-column label="原合同金额" align="center" prop="originalContractAmount" width="120" v-if="columns[7].visible" />
<el-table-column label="变更后合同编号" align="center" prop="changeContractCode" width="140" v-if="columns[8].visible" />
<el-table-column label="变更后合同名称" align="center" prop="changeContractName" min-width="160" show-overflow-tooltip v-if="columns[9].visible" />
<el-table-column label="客户名称" align="center" prop="customerName" min-width="120" show-overflow-tooltip v-if="columns[10].visible" />
<el-table-column label="变更后合同金额" align="center" prop="changeContractAmount" width="120" v-if="columns[11].visible" />
<el-table-column label="变更原因" align="center" prop="changeReason" min-width="160" show-overflow-tooltip v-if="columns[12].visible" />
<el-table-column label="申请时间" align="center" prop="applyTime" width="160" v-if="columns[13].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.applyTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="承办部门" align="center" prop="undertakeDeptName" width="120" v-if="columns[14].visible" />
<el-table-column label="承办人" align="center" prop="undertakeByName" width="100" v-if="columns[15].visible" />
<el-table-column label="行业/大区" align="center" prop="industryRegion" width="100" v-if="columns[16].visible" />
<el-table-column label="印章法人单位" align="center" prop="sealLegalEntity" width="120" v-if="columns[17].visible" />
<el-table-column label="变更状态" align="center" prop="changeStatus" width="100" v-if="columns[18].visible">
<template #default="scope">
<dict-tag :options="contract_change_status" :value="scope.row.changeStatus" />
</template>
</el-table-column>
<el-table-column label="申请时间" align="center" prop="applyTime" width="160">
<template #default="scope">
<span>{{ parseTime(scope.row.applyTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="是否回写" align="center" prop="writeBackFlag" width="90">
<el-table-column label="流程状态" align="center" prop="flowStatus" width="100" v-if="columns[19].visible" />
<el-table-column label="是否回写" align="center" prop="writeBackFlag" width="90" v-if="columns[20].visible">
<template #default="scope">
<dict-tag :options="write_back_flag" :value="scope.row.writeBackFlag" />
</template>
</el-table-column>
<el-table-column label="回写时间" align="center" prop="writeBackTime" width="160" v-if="columns[21].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.writeBackTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" min-width="120" show-overflow-tooltip v-if="columns[22].visible" />
<el-table-column label="激活标识" align="center" prop="activeFlag" width="90" v-if="columns[23].visible" />
<el-table-column label="操作" align="center" fixed="right" width="160" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="查看详情" placement="top" v-if="canViewDetail(scope.row)">
@ -129,6 +147,34 @@ const queryParams = ref<ContractChangeQuery>({
params: {}
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: '合同变更ID', visible: false },
{ key: 1, label: '变更单编号', visible: true },
{ key: 2, label: '变更类型', visible: true },
{ key: 3, label: '原合同ID', visible: false },
{ key: 4, label: '原合同编号', visible: true },
{ key: 5, label: '原合同名称', visible: true },
{ key: 6, label: '原客户名称', visible: true },
{ key: 7, label: '原合同金额', visible: false },
{ key: 8, label: '变更后合同编号', visible: false },
{ key: 9, label: '变更后合同名称', visible: false },
{ key: 10, label: '客户名称', visible: false },
{ key: 11, label: '变更后合同金额', visible: false },
{ key: 12, label: '变更原因', visible: false },
{ key: 13, label: '申请时间', visible: true },
{ key: 14, label: '承办部门', visible: true },
{ key: 15, label: '承办人', visible: true },
{ key: 16, label: '行业/大区', visible: false },
{ key: 17, label: '印章法人单位', visible: false },
{ key: 18, label: '变更状态', visible: true },
{ key: 19, label: '流程状态', visible: false },
{ key: 20, label: '是否回写', visible: true },
{ key: 21, label: '回写时间', visible: false },
{ key: 22, label: '备注', visible: false },
{ key: 23, label: '激活标识', visible: false }
]);
/** 查询合同变更列表 */
const getList = async () => {
loading.value = true;

Loading…
Cancel
Save