Merge branch 'refs/heads/feature/bfi-api-rate' into feature/hcs-api-p0-web
# Conflicts: # src/option/business/contract-manage.js
This commit is contained in:
@@ -249,6 +249,9 @@
|
||||
<el-select
|
||||
v-model="form.undertakeDeptId"
|
||||
placeholder="请选择"
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
clearable
|
||||
filterable
|
||||
:disabled="isBasicInfoReadonly"
|
||||
@@ -591,7 +594,7 @@
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入"
|
||||
maxlength="200"
|
||||
maxlength="1000"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -601,7 +604,7 @@
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入"
|
||||
maxlength="200"
|
||||
maxlength="1000"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -611,7 +614,7 @@
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入"
|
||||
maxlength="200"
|
||||
maxlength="1000"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -621,7 +624,7 @@
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入"
|
||||
maxlength="200"
|
||||
maxlength="1000"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -663,11 +666,22 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="文件名" min-width="220" align="center" show-overflow-tooltip>
|
||||
<el-table-column
|
||||
label="文件名"
|
||||
min-width="220"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
class-name="is-ellipsis-link"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-link type="primary" @click="previewAttachment(row)">
|
||||
{{ attachmentName(row) }}
|
||||
</el-link>
|
||||
<span
|
||||
class="attachment-file-name"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
@click="previewAttachment(row)"
|
||||
@keydown.enter="previewAttachment(row)"
|
||||
@keydown.space.prevent="previewAttachment(row)"
|
||||
>{{ attachmentName(row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="附件描述" min-width="240" align="center">
|
||||
@@ -864,15 +878,15 @@
|
||||
v-model="userQuery.realName"
|
||||
placeholder="用户姓名"
|
||||
clearable
|
||||
@keyup.enter="loadUsers"
|
||||
@keyup.enter="searchUsers"
|
||||
/>
|
||||
<el-input
|
||||
v-model="userQuery.phone"
|
||||
placeholder="手机号"
|
||||
clearable
|
||||
@keyup.enter="loadUsers"
|
||||
@keyup.enter="searchUsers"
|
||||
/>
|
||||
<el-button type="primary" @click="loadUsers">查询</el-button>
|
||||
<el-button type="primary" @click="searchUsers">查询</el-button>
|
||||
<el-button @click="resetUserQuery">重置</el-button>
|
||||
</div>
|
||||
<el-table :data="userData" border v-loading="userLoading" @row-dblclick="selectUser">
|
||||
@@ -964,7 +978,7 @@ const emptyForm = () => ({
|
||||
projectShortName: '',
|
||||
businessDeptId: '',
|
||||
businessDeptName: '',
|
||||
undertakeDeptId: '',
|
||||
undertakeDeptId: [],
|
||||
undertakeDeptName: '',
|
||||
projectSource: '',
|
||||
sourceRemark: '',
|
||||
@@ -1156,7 +1170,15 @@ export default {
|
||||
{ max: 20, message: '项目简称不能超过20个字符', trigger: 'blur' },
|
||||
],
|
||||
businessDeptId: [{ required: true, message: '请选择业务部门', trigger: 'change' }],
|
||||
undertakeDeptId: [{ required: true, message: '请选择平台公司', trigger: 'change' }],
|
||||
undertakeDeptId: [
|
||||
{
|
||||
type: 'array',
|
||||
required: true,
|
||||
min: 1,
|
||||
message: '请选择平台公司',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
businessMode: [{ required: true, message: '请选择业务模式', trigger: 'change' }],
|
||||
customerNames: [{ required: true, message: '请选择客户名称', trigger: 'change' }],
|
||||
carrierNames: [{ required: true, message: '请选择下游承运商', trigger: 'change' }],
|
||||
@@ -1209,6 +1231,18 @@ export default {
|
||||
changeReason: [
|
||||
{ max: 2000, message: '变更原因不能超过2000个字符', trigger: 'blur' },
|
||||
],
|
||||
projectIntro: [
|
||||
{ max: 1000, message: '项目简介不能超过1000个字符', trigger: 'blur' },
|
||||
],
|
||||
profitRemark: [
|
||||
{ max: 1000, message: '盈利模式及利润测算情况说明不能超过1000个字符', trigger: 'blur' },
|
||||
],
|
||||
riskPoint: [
|
||||
{ max: 1000, message: '项目风险点不能超过1000个字符', trigger: 'blur' },
|
||||
],
|
||||
emergencyPlan: [
|
||||
{ max: 1000, message: '风险防范措施及应急预案不能超过1000个字符', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
deptOptions: [],
|
||||
businessDeptTreeOptions: [],
|
||||
@@ -1506,13 +1540,13 @@ export default {
|
||||
this.businessDeptTreeOptions = [{ label, value: detail.businessDeptId }];
|
||||
this.deptOptions = [{ label, rawLabel: label, value: detail.businessDeptId }];
|
||||
}
|
||||
if (detail.undertakeDeptId) {
|
||||
this.platformCompanyOptions = [
|
||||
{
|
||||
label: detail.undertakeDeptName || String(detail.undertakeDeptId),
|
||||
value: detail.undertakeDeptId,
|
||||
},
|
||||
];
|
||||
const undertakeDeptIds = this.parseUndertakeDeptIds(detail.undertakeDeptId);
|
||||
const undertakeDeptNames = this.parseUndertakeDeptNames(detail.undertakeDeptName);
|
||||
if (undertakeDeptIds.length) {
|
||||
this.platformCompanyOptions = undertakeDeptIds.map((id, index) => ({
|
||||
label: undertakeDeptNames[index] || String(id),
|
||||
value: id,
|
||||
}));
|
||||
}
|
||||
},
|
||||
resolvePublicDictOptions(options, currentValue) {
|
||||
@@ -1897,6 +1931,8 @@ export default {
|
||||
this.form = {
|
||||
...form,
|
||||
...situation,
|
||||
undertakeDeptId: this.parseUndertakeDeptIds(form.undertakeDeptId),
|
||||
undertakeDeptName: form.undertakeDeptName || '',
|
||||
customerNames: this.getCustomerRowNames(customerRows, 'customer') || form.customerNames,
|
||||
carrierNames: this.getCustomerRowNames(carrierRows, 'carrier') || form.carrierNames,
|
||||
};
|
||||
@@ -2063,8 +2099,13 @@ export default {
|
||||
});
|
||||
},
|
||||
normalizeSubmitForm(options = {}) {
|
||||
const undertakeDeptIds = this.parseUndertakeDeptIds(this.form.undertakeDeptId);
|
||||
const undertakeDeptName =
|
||||
this.resolveUndertakeDeptNames(undertakeDeptIds) || this.form.undertakeDeptName || '';
|
||||
const submitRow = {
|
||||
...this.form,
|
||||
undertakeDeptId: undertakeDeptIds.join(','),
|
||||
undertakeDeptName,
|
||||
fundLimit: this.formatAmount(this.form.fundLimit),
|
||||
receivableLimit: this.formatAmount(this.form.receivableLimit),
|
||||
...Object.fromEntries(
|
||||
@@ -2456,11 +2497,40 @@ export default {
|
||||
this.$refs.projectForm?.validateField('businessDeptId');
|
||||
},
|
||||
handleUndertakeDeptChange(value) {
|
||||
const id = Array.isArray(value) ? value.at(-1) : value;
|
||||
const dept = this.platformCompanyOptions.find(item => String(item.value) === String(id));
|
||||
this.form.undertakeDeptName = dept ? dept.label : '';
|
||||
const ids = this.parseUndertakeDeptIds(value);
|
||||
this.form.undertakeDeptId = ids;
|
||||
this.form.undertakeDeptName = this.resolveUndertakeDeptNames(ids);
|
||||
this.$refs.projectForm?.validateField('undertakeDeptId');
|
||||
},
|
||||
parseUndertakeDeptIds(value) {
|
||||
if (Array.isArray(value)) {
|
||||
return value
|
||||
.map(item => String(item ?? '').trim())
|
||||
.filter(item => item && item !== '-1');
|
||||
}
|
||||
return String(value ?? '')
|
||||
.split(/[,,]/)
|
||||
.map(item => item.trim())
|
||||
.filter(item => item && item !== '-1');
|
||||
},
|
||||
parseUndertakeDeptNames(value) {
|
||||
return String(value ?? '')
|
||||
.split(/[,,、]/)
|
||||
.map(item => item.trim())
|
||||
.filter(Boolean);
|
||||
},
|
||||
resolveUndertakeDeptNames(ids = []) {
|
||||
return ids
|
||||
.map(id => {
|
||||
const dept = this.platformCompanyOptions.find(item => String(item.value) === String(id));
|
||||
return dept?.label || '';
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join('、');
|
||||
},
|
||||
firstUndertakeDeptId(value) {
|
||||
return this.parseUndertakeDeptIds(value)[0] || '';
|
||||
},
|
||||
// 由部门 id 反查「根 → 该节点」的 id 路径,供级联回显(找不到返回 null)
|
||||
findDeptPath(id, tree = [], parents = []) {
|
||||
const target = Array.isArray(id) ? id.at(-1) : id;
|
||||
@@ -2499,15 +2569,23 @@ export default {
|
||||
});
|
||||
},
|
||||
ensureCurrentPlatformOption() {
|
||||
const id = this.form.undertakeDeptId;
|
||||
if (!id) return;
|
||||
const exists = this.platformCompanyOptions.some(item => String(item.value) === String(id));
|
||||
if (!exists) {
|
||||
this.platformCompanyOptions.unshift({
|
||||
label: this.form.undertakeDeptName || String(id),
|
||||
value: id,
|
||||
});
|
||||
}
|
||||
const ids = this.parseUndertakeDeptIds(this.form.undertakeDeptId);
|
||||
if (!ids.length) return;
|
||||
const names = this.parseUndertakeDeptNames(this.form.undertakeDeptName);
|
||||
ids.forEach((id, index) => {
|
||||
const exists = this.platformCompanyOptions.some(item => String(item.value) === String(id));
|
||||
if (!exists) {
|
||||
this.platformCompanyOptions.unshift({
|
||||
label: names[index] || String(id),
|
||||
value: id,
|
||||
});
|
||||
}
|
||||
});
|
||||
// 选项 value 与已选 ID 类型对齐,避免回显失败
|
||||
this.form.undertakeDeptId = ids.map(id => {
|
||||
const matched = this.platformCompanyOptions.find(item => String(item.value) === String(id));
|
||||
return matched ? matched.value : id;
|
||||
});
|
||||
},
|
||||
excludeExternalOrganization(list = []) {
|
||||
return list.reduce((result, item) => {
|
||||
@@ -2816,11 +2894,20 @@ export default {
|
||||
if (this.dialogReadonly) return;
|
||||
this.userPickType = type;
|
||||
this.userBox = true;
|
||||
this.userPage.currentPage = 1;
|
||||
this.loadUsers();
|
||||
},
|
||||
searchUsers() {
|
||||
this.userPage.currentPage = 1;
|
||||
this.loadUsers();
|
||||
},
|
||||
loadUsers() {
|
||||
this.userLoading = true;
|
||||
getUserList(this.userPage.currentPage, this.userPage.pageSize, this.userQuery)
|
||||
const params = {
|
||||
realName: String(this.userQuery.realName || '').trim(),
|
||||
phone: String(this.userQuery.phone || '').trim(),
|
||||
};
|
||||
getUserList(this.userPage.currentPage, this.userPage.pageSize, params)
|
||||
.then(res => {
|
||||
const result = res.data.data || {};
|
||||
this.userData = result.records || [];
|
||||
@@ -2870,7 +2957,7 @@ export default {
|
||||
}
|
||||
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 14px;
|
||||
//margin-bottom: 24px;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__label) {
|
||||
|
||||
Reference in New Issue
Block a user