相对方增加公司绑定
This commit is contained in:
@@ -43,3 +43,20 @@ export function mockSyncPartner(id) {
|
|||||||
method: "post",
|
method: "post",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 获取货代公司组织列表(用于关联内部组织选择) */
|
||||||
|
export function getAgentOrgList() {
|
||||||
|
return request({
|
||||||
|
url: "/admin/org/listAllOrgNameByTypeWithId",
|
||||||
|
method: "post",
|
||||||
|
data: { orgCode: "AGENT" },
|
||||||
|
}).then((res) => {
|
||||||
|
if (String(res?.code || "") === "0000") {
|
||||||
|
return (res?.result || []).map((item) => ({
|
||||||
|
label: item.name,
|
||||||
|
value: item.id,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -82,11 +82,25 @@
|
|||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="是否集团内" required>
|
<a-form-item label="是否集团内" required>
|
||||||
<a-radio-group v-model:value="formState.groupFlag">
|
<a-radio-group v-model:value="formState.groupFlag" @change="(e) => handleGroupFlagChange(e)">
|
||||||
<a-radio value="Y">是</a-radio>
|
<a-radio value="Y">是</a-radio>
|
||||||
<a-radio value="N">否</a-radio>
|
<a-radio value="N">否</a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<a-form-item
|
||||||
|
v-if="formState.groupFlag === 'Y'"
|
||||||
|
label="关联内部组织"
|
||||||
|
class="field-span-2"
|
||||||
|
>
|
||||||
|
<a-select
|
||||||
|
v-model:value="formState.linkedOrgId"
|
||||||
|
:options="agentOrgOptions"
|
||||||
|
placeholder="请选择关联的内部货代公司组织"
|
||||||
|
allow-clear
|
||||||
|
show-search
|
||||||
|
option-filter-prop="label"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
v-if="showCustomerTaxno"
|
v-if="showCustomerTaxno"
|
||||||
label="统一社会信用代码"
|
label="统一社会信用代码"
|
||||||
@@ -260,6 +274,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 { getAgentOrgList } from "@/api/partner.js";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
optionSets: {
|
optionSets: {
|
||||||
@@ -319,6 +334,8 @@ function createFormData() {
|
|||||||
createTime: "",
|
createTime: "",
|
||||||
syncTime: "",
|
syncTime: "",
|
||||||
syncMessage: "",
|
syncMessage: "",
|
||||||
|
linkedOrgId: undefined,
|
||||||
|
linkedUserAccount: "",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,6 +364,7 @@ const visible = ref(false);
|
|||||||
const modalMode = ref("create");
|
const modalMode = ref("create");
|
||||||
const originalState = ref(createFormData());
|
const originalState = ref(createFormData());
|
||||||
const formState = ref(createFormData());
|
const formState = ref(createFormData());
|
||||||
|
const agentOrgOptions = ref([]);
|
||||||
|
|
||||||
const isViewMode = computed(() => modalMode.value === "view");
|
const isViewMode = computed(() => modalMode.value === "view");
|
||||||
|
|
||||||
@@ -424,6 +442,13 @@ function handleOppositeCharacterChange() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleGroupFlagChange(e) {
|
||||||
|
const value = e?.target?.value ?? e;
|
||||||
|
if (value !== "Y") {
|
||||||
|
formState.value.linkedOrgId = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function handleNatureOfEnterpriseOrgChange() {
|
function handleNatureOfEnterpriseOrgChange() {
|
||||||
if (formState.value.natureOfEnterpriseOrg !== "QY") {
|
if (formState.value.natureOfEnterpriseOrg !== "QY") {
|
||||||
formState.value.natureOfEnterpriseOrgLev = undefined;
|
formState.value.natureOfEnterpriseOrgLev = undefined;
|
||||||
@@ -497,6 +522,12 @@ function normalizeFormBeforeSave() {
|
|||||||
formState.value.isSgat = formState.value.gatFlag === "Y" ? "1" : "0";
|
formState.value.isSgat = formState.value.gatFlag === "Y" ? "1" : "0";
|
||||||
formState.value.isJtn = formState.value.groupFlag === "Y" ? "1" : "0";
|
formState.value.isJtn = formState.value.groupFlag === "Y" ? "1" : "0";
|
||||||
|
|
||||||
|
// 如果非集团内,清空关联内部组织
|
||||||
|
if (formState.value.groupFlag !== "Y") {
|
||||||
|
formState.value.linkedOrgId = undefined;
|
||||||
|
formState.value.linkedUserAccount = "";
|
||||||
|
}
|
||||||
|
|
||||||
formState.value.contacts = (formState.value.contacts || []).map((item) => ({
|
formState.value.contacts = (formState.value.contacts || []).map((item) => ({
|
||||||
...item,
|
...item,
|
||||||
contactName: item.contactName?.trim?.() || "",
|
contactName: item.contactName?.trim?.() || "",
|
||||||
@@ -528,6 +559,10 @@ function showModal(record = {}, mode = "create") {
|
|||||||
modalMode.value === "create" ? createFormData() : copyFormData(record);
|
modalMode.value === "create" ? createFormData() : copyFormData(record);
|
||||||
originalState.value = copyFormData(source);
|
originalState.value = copyFormData(source);
|
||||||
formState.value = copyFormData(source);
|
formState.value = copyFormData(source);
|
||||||
|
// 加载货代公司组织列表
|
||||||
|
getAgentOrgList().then((options) => {
|
||||||
|
agentOrgOptions.value = options;
|
||||||
|
});
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user