权限相关修改
This commit is contained in:
@@ -89,13 +89,6 @@
|
||||
handleCompanySelect(party, value, option)
|
||||
"
|
||||
/>
|
||||
<a-button
|
||||
class="icon-btn"
|
||||
:disabled="isViewMode || isOurPartyLocked"
|
||||
@click="showSearchTip(`${party.displayName}`)"
|
||||
>
|
||||
<SearchOutlined />
|
||||
</a-button>
|
||||
</div>
|
||||
<div class="party-info-box">
|
||||
<div class="info-line">
|
||||
@@ -114,17 +107,6 @@
|
||||
<span>公司地址</span
|
||||
><strong>{{ party.registeredAddress || "/" }}</strong>
|
||||
</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>
|
||||
|
||||
@@ -172,12 +154,6 @@
|
||||
handleCompanySelect(party, value, option)
|
||||
"
|
||||
/>
|
||||
<a-button
|
||||
class="icon-btn"
|
||||
@click="showSearchTip(`${party.displayName}`)"
|
||||
>
|
||||
<SearchOutlined />
|
||||
</a-button>
|
||||
</div>
|
||||
<div class="party-info-box">
|
||||
<div class="info-line">
|
||||
@@ -192,17 +168,6 @@
|
||||
<span>公司地址</span
|
||||
><strong>{{ party.registeredAddress || "/" }}</strong>
|
||||
</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>
|
||||
|
||||
@@ -1046,7 +1011,7 @@
|
||||
<script setup>
|
||||
import { computed, ref } from "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 {
|
||||
downloadLaunchFile,
|
||||
@@ -1054,6 +1019,7 @@ import {
|
||||
queryPartnerOptions,
|
||||
uploadLaunchFile,
|
||||
} from "@/api/launch.js";
|
||||
import { getOrgTree } from "@/api/manifest.js";
|
||||
import {
|
||||
contractSourceOptions,
|
||||
contractTypeOptions,
|
||||
@@ -1068,7 +1034,8 @@ import {
|
||||
getOptionLabel,
|
||||
} from "../contractLaunchOptions.js";
|
||||
|
||||
const contractCompanyOptions = ref([]);
|
||||
const counterpartyOptions = ref([]);
|
||||
const ourPartyOrgOptions = ref([]);
|
||||
|
||||
// ========== 合同相关字典 ==========
|
||||
|
||||
@@ -1269,8 +1236,6 @@ function createEmptyParty(roleCode, index = 0) {
|
||||
registeredAddress: "",
|
||||
legalRepresentative: "",
|
||||
creditCode: "",
|
||||
bankName: "",
|
||||
bankAccount: "",
|
||||
naturalPersonIdType: "",
|
||||
naturalPersonIdNumber: "",
|
||||
isGroupInternal: false,
|
||||
@@ -1776,9 +1741,9 @@ function resetCurrentState() {
|
||||
}
|
||||
|
||||
function showSearchTip(title) {
|
||||
loadPartnerOptions();
|
||||
loadCounterpartyOptions();
|
||||
message.info(
|
||||
`${title}数据已从客户/主体库加载;相对方下拉仅展示已同步到法务的记录。`,
|
||||
`${title}数据已刷新;我方主体来自组织树,相对方下拉仅展示已同步到法务的记录。`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1834,8 +1799,6 @@ function mapPartnerToParty(raw = {}, roleKey, companyName) {
|
||||
contactPhone: firstContact.contactPhone || raw.officephone || "",
|
||||
contactEmail: firstContact.email || raw.emailAddress || "",
|
||||
contactAddress: firstContact.postalAddress || raw.customerAddress || "",
|
||||
bankName: raw.customerBank || "",
|
||||
bankAccount: raw.customerBankaccount || "",
|
||||
naturalPersonIdType: raw.certificateType || "",
|
||||
naturalPersonIdNumber: raw.certificateNum || "",
|
||||
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) {
|
||||
const baseOptions = contractCompanyOptions.value || [];
|
||||
if (roleCode !== PARTY_ROLE_OUR) {
|
||||
return baseOptions.filter(isSyncedCounterpartyOption);
|
||||
return (counterpartyOptions.value || []).filter(isSyncedCounterpartyOption);
|
||||
}
|
||||
const selfParty = currentSelfParty.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,
|
||||
];
|
||||
return ourPartyOrgOptions.value || [];
|
||||
}
|
||||
|
||||
function handleCompanySelect(party, companyName, option = {}) {
|
||||
if (!party) return;
|
||||
|
||||
const rawPartner =
|
||||
option?.raw ||
|
||||
contractCompanyOptions.value.find((item) => item.value === companyName)
|
||||
?.raw;
|
||||
if (rawPartner) {
|
||||
const optionList =
|
||||
party.roleCode === PARTY_ROLE_OUR
|
||||
? ourPartyOrgOptions.value
|
||||
: counterpartyOptions.value;
|
||||
const rawData =
|
||||
option?.raw || optionList.find((item) => item.value === companyName)?.raw;
|
||||
if (rawData) {
|
||||
Object.assign(
|
||||
party,
|
||||
mapPartnerToParty(rawPartner, party.roleCode, companyName),
|
||||
party.roleCode === PARTY_ROLE_OUR
|
||||
? mapOrgNodeToParty(rawData)
|
||||
: mapPartnerToParty(rawData, party.roleCode, companyName),
|
||||
);
|
||||
refreshPartyDisplayMeta();
|
||||
return;
|
||||
@@ -2278,8 +2232,6 @@ function buildLaunchRecord() {
|
||||
registeredAddress: party.registeredAddress,
|
||||
legalRepresentative: party.legalRepresentative,
|
||||
creditCode: party.creditCode,
|
||||
bankName: party.bankName,
|
||||
bankAccount: party.bankAccount,
|
||||
naturalPersonIdType: party.naturalPersonIdType,
|
||||
naturalPersonIdNumber: party.naturalPersonIdNumber,
|
||||
isGroupInternal: party.isGroupInternal ? "1" : "0",
|
||||
@@ -2304,8 +2256,6 @@ function buildLaunchRecord() {
|
||||
registeredAddress: party.registeredAddress,
|
||||
legalRepresentative: party.legalRepresentative,
|
||||
creditCode: party.creditCode,
|
||||
bankName: party.bankName,
|
||||
bankAccount: party.bankAccount,
|
||||
naturalPersonIdType: party.naturalPersonIdType,
|
||||
naturalPersonIdNumber: party.naturalPersonIdNumber,
|
||||
isGroupInternal: party.isGroupInternal ? "1" : "0",
|
||||
@@ -2461,8 +2411,6 @@ function applySelfProfile(profile = {}) {
|
||||
contactEmail: profile.contactEmail || "",
|
||||
contactAddress: profile.contactAddress || "",
|
||||
registeredAddress: profile.registeredAddress || "",
|
||||
bankName: profile.bankName || "",
|
||||
bankAccount: profile.bankAccount || "",
|
||||
legalRepresentative: profile.legalRepresentative || "",
|
||||
creditCode: profile.creditCode || "",
|
||||
};
|
||||
@@ -2483,8 +2431,6 @@ function applySelfProfile(profile = {}) {
|
||||
contactAddress: profile.contactAddress || firstOurParty.contactAddress,
|
||||
registeredAddress:
|
||||
profile.registeredAddress || firstOurParty.registeredAddress,
|
||||
bankName: profile.bankName || firstOurParty.bankName,
|
||||
bankAccount: profile.bankAccount || firstOurParty.bankAccount,
|
||||
legalRepresentative:
|
||||
profile.legalRepresentative || firstOurParty.legalRepresentative,
|
||||
creditCode: profile.creditCode || firstOurParty.creditCode,
|
||||
@@ -2515,18 +2461,53 @@ async function showModal(context = {}, mode = "create") {
|
||||
forceSingleAgreementDefaults();
|
||||
syncCounterpartyState();
|
||||
syncUploadLists();
|
||||
loadPartnerOptions();
|
||||
loadOurPartyOptions();
|
||||
loadCounterpartyOptions();
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
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) => {
|
||||
const options = (list || []).map((item) => ({
|
||||
label: `${item.customerNameC || "未命名相对方"}${item.oppositeId ? `(${item.oppositeId})` : ""}`,
|
||||
value: item.customerNameC,
|
||||
raw: item,
|
||||
}));
|
||||
contractCompanyOptions.value = options;
|
||||
counterpartyOptions.value = options;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user