✨ 新增导入结算单页面,并优化 MK 开关缓存与客商同步入口
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -208,7 +208,7 @@
|
||||
v-if="
|
||||
hasPermission('customer_archive_sync') &&
|
||||
row.approvalStatus === 'approved' &&
|
||||
row.kingdeeStatus === 'failed'
|
||||
!['synced', 'exist'].includes(row.kingdeeStatus)
|
||||
"
|
||||
@click="handleSyncKingdee(row)"
|
||||
>
|
||||
@@ -1791,6 +1791,8 @@ export default {
|
||||
},
|
||||
/** 业务字典 mk_template「开启MK」=1 */
|
||||
mkEnabled: false,
|
||||
/** 是否已完成 MK 开关加载,避免提交时误判 */
|
||||
_mkEnabledResolved: false,
|
||||
formRules: {
|
||||
customerCode: [{ max: 20, message: '客商编号最多20个字符', trigger: 'blur' }],
|
||||
fullName: [{ required: true, message: '请输入客商名称', trigger: 'blur' }],
|
||||
@@ -1871,7 +1873,7 @@ export default {
|
||||
editBtn: false,
|
||||
selection: true,
|
||||
dialogClickModal: false,
|
||||
menuWidth: 320,
|
||||
menuWidth: 400,
|
||||
column: [
|
||||
{
|
||||
label: '客商编号',
|
||||
@@ -2340,7 +2342,13 @@ export default {
|
||||
sessionStorage.setItem(customerArchiveListRefreshKey, '1');
|
||||
},
|
||||
hasPermission(code) {
|
||||
return this.isAdmin || this.validData(this.permission[code], false);
|
||||
if (this.isAdmin) {
|
||||
return true;
|
||||
}
|
||||
const permission = this.permission || {};
|
||||
const value = permission[code];
|
||||
// 不依赖 Avue validData,避免权限值为 true 以外的真值时被误判
|
||||
return value === true || value === 'true' || value === 1 || value === '1';
|
||||
},
|
||||
mergeSelectOptions(target, values) {
|
||||
const list = Array.isArray(values) ? values : values ? [values] : [];
|
||||
@@ -3100,12 +3108,15 @@ export default {
|
||||
});
|
||||
},
|
||||
initMkEnabled() {
|
||||
this._mkEnabledResolved = false;
|
||||
loadMkEnabled()
|
||||
.then(enabled => {
|
||||
this.mkEnabled = !!enabled;
|
||||
this._mkEnabledResolved = true;
|
||||
})
|
||||
.catch(() => {
|
||||
this.mkEnabled = false;
|
||||
this._mkEnabledResolved = true;
|
||||
});
|
||||
},
|
||||
initScoreQuantificationOptions() {
|
||||
@@ -4481,15 +4492,34 @@ export default {
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 列表 / 新增 / 编辑提交共用:开启 MK 时提交审核流,并更新客商审批状态
|
||||
* 列表 / 新增 / 编辑提交共用:
|
||||
* 未开启 MK 时仅走本地提交审批(与新增一致,不请求 MK 流程);
|
||||
* 开启 MK 时先提交审核流,再更新客商审批状态。
|
||||
*/
|
||||
submitCustomerApproval(id, fullName = '', approvalStatus = '') {
|
||||
return submitMkApprovalFlow({
|
||||
bizType: 'customer-archive',
|
||||
bizId: id,
|
||||
subjectName: fullName,
|
||||
approvalStatus,
|
||||
}).then(() => submitApproval(id));
|
||||
const submitLocal = () => submitApproval(id);
|
||||
const run = enabled => {
|
||||
this.mkEnabled = !!enabled;
|
||||
this._mkEnabledResolved = true;
|
||||
if (!this.mkEnabled) {
|
||||
return submitLocal();
|
||||
}
|
||||
return submitMkApprovalFlow({
|
||||
bizType: 'customer-archive',
|
||||
bizId: id,
|
||||
subjectName: fullName,
|
||||
approvalStatus,
|
||||
mkEnabled: true,
|
||||
}).then(submitLocal);
|
||||
};
|
||||
|
||||
// 与列表按钮一致:以页面 mkEnabled 为准,未开启时不请求 MK
|
||||
if (this._mkEnabledResolved) {
|
||||
return run(this.mkEnabled);
|
||||
}
|
||||
return loadMkEnabled()
|
||||
.then(enabled => run(enabled))
|
||||
.catch(() => run(false));
|
||||
},
|
||||
openReviewScore() {
|
||||
const scores = this.archiveForm.scores || [];
|
||||
|
||||
Reference in New Issue
Block a user