权限相关修改

This commit is contained in:
2026-06-24 14:48:11 +08:00
parent 29b3bee464
commit 2644913e79
@@ -89,13 +89,6 @@
handleCompanySelect(party, value, option) handleCompanySelect(party, value, option)
" "
/> />
<a-button
class="icon-btn"
:disabled="isViewMode || isOurPartyLocked"
@click="showSearchTip(`${party.displayName}`)"
>
<SearchOutlined />
</a-button>
</div> </div>
<div class="party-info-box"> <div class="party-info-box">
<div class="info-line"> <div class="info-line">
@@ -114,17 +107,6 @@
<span>公司地址</span <span>公司地址</span
><strong>{{ party.registeredAddress || "/" }}</strong> ><strong>{{ party.registeredAddress || "/" }}</strong>
</div> </div>
<div class="info-line">
<span>银行/账号</span
><strong>{{ party.bankAccount || "/" }}</strong>
</div>
<a-button
class="mini-search-btn"
type="text"
@click="showSearchTip(`${party.displayName}详情`)"
>
<SearchOutlined />
</a-button>
</div> </div>
</div> </div>
@@ -172,12 +154,6 @@
handleCompanySelect(party, value, option) handleCompanySelect(party, value, option)
" "
/> />
<a-button
class="icon-btn"
@click="showSearchTip(`${party.displayName}`)"
>
<SearchOutlined />
</a-button>
</div> </div>
<div class="party-info-box"> <div class="party-info-box">
<div class="info-line"> <div class="info-line">
@@ -192,17 +168,6 @@
<span>公司地址</span <span>公司地址</span
><strong>{{ party.registeredAddress || "/" }}</strong> ><strong>{{ party.registeredAddress || "/" }}</strong>
</div> </div>
<div class="info-line">
<span>银行/账号</span
><strong>{{ party.bankAccount || "/" }}</strong>
</div>
<a-button
class="mini-search-btn"
type="text"
@click="showSearchTip(`${party.displayName}详情`)"
>
<SearchOutlined />
</a-button>
</div> </div>
</div> </div>
@@ -1046,7 +1011,7 @@
<script setup> <script setup>
import { computed, ref } from "vue"; import { computed, ref } from "vue";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { PlusOutlined, SearchOutlined } from "@ant-design/icons-vue"; import { PlusOutlined } from "@ant-design/icons-vue";
import ContractTemplateFillDemoModal from "./ContractTemplateFillDemoModal.vue"; import ContractTemplateFillDemoModal from "./ContractTemplateFillDemoModal.vue";
import { import {
downloadLaunchFile, downloadLaunchFile,
@@ -1054,6 +1019,7 @@ import {
queryPartnerOptions, queryPartnerOptions,
uploadLaunchFile, uploadLaunchFile,
} from "@/api/launch.js"; } from "@/api/launch.js";
import { getOrgTree } from "@/api/manifest.js";
import { import {
contractSourceOptions, contractSourceOptions,
contractTypeOptions, contractTypeOptions,
@@ -1068,7 +1034,8 @@ import {
getOptionLabel, getOptionLabel,
} from "../contractLaunchOptions.js"; } from "../contractLaunchOptions.js";
const contractCompanyOptions = ref([]); const counterpartyOptions = ref([]);
const ourPartyOrgOptions = ref([]);
// ========== 合同相关字典 ========== // ========== 合同相关字典 ==========
@@ -1269,8 +1236,6 @@ function createEmptyParty(roleCode, index = 0) {
registeredAddress: "", registeredAddress: "",
legalRepresentative: "", legalRepresentative: "",
creditCode: "", creditCode: "",
bankName: "",
bankAccount: "",
naturalPersonIdType: "", naturalPersonIdType: "",
naturalPersonIdNumber: "", naturalPersonIdNumber: "",
isGroupInternal: false, isGroupInternal: false,
@@ -1776,9 +1741,9 @@ function resetCurrentState() {
} }
function showSearchTip(title) { function showSearchTip(title) {
loadPartnerOptions(); loadCounterpartyOptions();
message.info( message.info(
`${title}数据已从客户/主体库加载;相对方下拉仅展示已同步到法务的记录。`, `${title}数据已刷新;我方主体来自组织树,相对方下拉仅展示已同步到法务的记录。`,
); );
} }
@@ -1834,8 +1799,6 @@ function mapPartnerToParty(raw = {}, roleKey, companyName) {
contactPhone: firstContact.contactPhone || raw.officephone || "", contactPhone: firstContact.contactPhone || raw.officephone || "",
contactEmail: firstContact.email || raw.emailAddress || "", contactEmail: firstContact.email || raw.emailAddress || "",
contactAddress: firstContact.postalAddress || raw.customerAddress || "", contactAddress: firstContact.postalAddress || raw.customerAddress || "",
bankName: raw.customerBank || "",
bankAccount: raw.customerBankaccount || "",
naturalPersonIdType: raw.certificateType || "", naturalPersonIdType: raw.certificateType || "",
naturalPersonIdNumber: raw.certificateNum || "", naturalPersonIdNumber: raw.certificateNum || "",
isGroupInternal: raw.groupFlag === "Y" || raw.isJtn === "1", isGroupInternal: raw.groupFlag === "Y" || raw.isJtn === "1",
@@ -1845,53 +1808,44 @@ function mapPartnerToParty(raw = {}, roleKey, companyName) {
}; };
} }
function mapOrgNodeToParty(raw = {}) {
return {
...createEmptyParty(PARTY_ROLE_OUR),
subjectCode: raw.orgId == null ? "" : String(raw.orgId),
companyName: raw.orgName || "",
contactPhone: raw.contactPhone || "",
contactEmail: raw.contactEmail || "",
contactAddress: raw.contactAddress || "",
registeredAddress: raw.registeredAddress || "",
legalRepresentative: raw.legalRepresentative || "",
creditCode: raw.creditCode || "",
roleCode: PARTY_ROLE_OUR,
roleName: "我方",
};
}
function getPartyOptions(roleCode) { function getPartyOptions(roleCode) {
const baseOptions = contractCompanyOptions.value || [];
if (roleCode !== PARTY_ROLE_OUR) { if (roleCode !== PARTY_ROLE_OUR) {
return baseOptions.filter(isSyncedCounterpartyOption); return (counterpartyOptions.value || []).filter(isSyncedCounterpartyOption);
} }
const selfParty = currentSelfParty.value; return ourPartyOrgOptions.value || [];
if (!selfParty?.companyName) {
return baseOptions;
}
const exists = baseOptions.some(
(item) => item.value === selfParty.companyName,
);
if (exists) {
return baseOptions;
}
return [
{
label: `${selfParty.companyName}(当前主体)`,
value: selfParty.companyName,
raw: {
customerNameC: selfParty.companyName,
orgId: selfParty.subjectCode,
officephone: selfParty.contactPhone,
emailAddress: selfParty.contactEmail,
customerAddress: selfParty.contactAddress,
customerRegaddr: selfParty.registeredAddress,
customerBank: selfParty.bankName,
customerBankaccount: selfParty.bankAccount,
legalPersonName: selfParty.legalRepresentative,
customerTaxno: selfParty.creditCode,
},
},
...baseOptions,
];
} }
function handleCompanySelect(party, companyName, option = {}) { function handleCompanySelect(party, companyName, option = {}) {
if (!party) return; if (!party) return;
const rawPartner = const optionList =
option?.raw || party.roleCode === PARTY_ROLE_OUR
contractCompanyOptions.value.find((item) => item.value === companyName) ? ourPartyOrgOptions.value
?.raw; : counterpartyOptions.value;
if (rawPartner) { const rawData =
option?.raw || optionList.find((item) => item.value === companyName)?.raw;
if (rawData) {
Object.assign( Object.assign(
party, party,
mapPartnerToParty(rawPartner, party.roleCode, companyName), party.roleCode === PARTY_ROLE_OUR
? mapOrgNodeToParty(rawData)
: mapPartnerToParty(rawData, party.roleCode, companyName),
); );
refreshPartyDisplayMeta(); refreshPartyDisplayMeta();
return; return;
@@ -2278,8 +2232,6 @@ function buildLaunchRecord() {
registeredAddress: party.registeredAddress, registeredAddress: party.registeredAddress,
legalRepresentative: party.legalRepresentative, legalRepresentative: party.legalRepresentative,
creditCode: party.creditCode, creditCode: party.creditCode,
bankName: party.bankName,
bankAccount: party.bankAccount,
naturalPersonIdType: party.naturalPersonIdType, naturalPersonIdType: party.naturalPersonIdType,
naturalPersonIdNumber: party.naturalPersonIdNumber, naturalPersonIdNumber: party.naturalPersonIdNumber,
isGroupInternal: party.isGroupInternal ? "1" : "0", isGroupInternal: party.isGroupInternal ? "1" : "0",
@@ -2304,8 +2256,6 @@ function buildLaunchRecord() {
registeredAddress: party.registeredAddress, registeredAddress: party.registeredAddress,
legalRepresentative: party.legalRepresentative, legalRepresentative: party.legalRepresentative,
creditCode: party.creditCode, creditCode: party.creditCode,
bankName: party.bankName,
bankAccount: party.bankAccount,
naturalPersonIdType: party.naturalPersonIdType, naturalPersonIdType: party.naturalPersonIdType,
naturalPersonIdNumber: party.naturalPersonIdNumber, naturalPersonIdNumber: party.naturalPersonIdNumber,
isGroupInternal: party.isGroupInternal ? "1" : "0", isGroupInternal: party.isGroupInternal ? "1" : "0",
@@ -2461,8 +2411,6 @@ function applySelfProfile(profile = {}) {
contactEmail: profile.contactEmail || "", contactEmail: profile.contactEmail || "",
contactAddress: profile.contactAddress || "", contactAddress: profile.contactAddress || "",
registeredAddress: profile.registeredAddress || "", registeredAddress: profile.registeredAddress || "",
bankName: profile.bankName || "",
bankAccount: profile.bankAccount || "",
legalRepresentative: profile.legalRepresentative || "", legalRepresentative: profile.legalRepresentative || "",
creditCode: profile.creditCode || "", creditCode: profile.creditCode || "",
}; };
@@ -2483,8 +2431,6 @@ function applySelfProfile(profile = {}) {
contactAddress: profile.contactAddress || firstOurParty.contactAddress, contactAddress: profile.contactAddress || firstOurParty.contactAddress,
registeredAddress: registeredAddress:
profile.registeredAddress || firstOurParty.registeredAddress, profile.registeredAddress || firstOurParty.registeredAddress,
bankName: profile.bankName || firstOurParty.bankName,
bankAccount: profile.bankAccount || firstOurParty.bankAccount,
legalRepresentative: legalRepresentative:
profile.legalRepresentative || firstOurParty.legalRepresentative, profile.legalRepresentative || firstOurParty.legalRepresentative,
creditCode: profile.creditCode || firstOurParty.creditCode, creditCode: profile.creditCode || firstOurParty.creditCode,
@@ -2515,18 +2461,53 @@ async function showModal(context = {}, mode = "create") {
forceSingleAgreementDefaults(); forceSingleAgreementDefaults();
syncCounterpartyState(); syncCounterpartyState();
syncUploadLists(); syncUploadLists();
loadPartnerOptions(); loadOurPartyOptions();
loadCounterpartyOptions();
visible.value = true; visible.value = true;
} }
function loadPartnerOptions() { function loadPartnerOptions() {
loadCounterpartyOptions();
}
function flattenOrgTree(nodes = [], result = []) {
(nodes || []).forEach((node) => {
result.push({
orgId: node.id,
orgName: node.orgName,
contactPhone: node.contactPhone || "",
contactEmail: node.contactEmail || "",
contactAddress: node.contactAddress || "",
registeredAddress: node.registeredAddress || "",
legalRepresentative: node.legalRepresentative || "",
creditCode: node.creditCode || "",
});
if (Array.isArray(node.children) && node.children.length) {
flattenOrgTree(node.children, result);
}
});
return result;
}
function loadOurPartyOptions() {
return getOrgTree().then((tree) => {
const flatList = flattenOrgTree(tree);
ourPartyOrgOptions.value = flatList.map((item) => ({
label: `${item.orgName}${String(item.orgId || "").trim() === currentSelfSubjectCode.value ? "(当前主体)" : ""}`,
value: item.orgName,
raw: item,
}));
});
}
function loadCounterpartyOptions() {
queryPartnerOptions().then((list) => { queryPartnerOptions().then((list) => {
const options = (list || []).map((item) => ({ const options = (list || []).map((item) => ({
label: `${item.customerNameC || "未命名相对方"}${item.oppositeId ? `${item.oppositeId}` : ""}`, label: `${item.customerNameC || "未命名相对方"}${item.oppositeId ? `${item.oppositeId}` : ""}`,
value: item.customerNameC, value: item.customerNameC,
raw: item, raw: item,
})); }));
contractCompanyOptions.value = options; counterpartyOptions.value = options;
}); });
} }