feat(crm): add tenant-level contract approver setting with submit prefill
Mirror the quote approver setting so contract submit dialogs can prefill ordered approvers from a tenant config page while remaining editable. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
ce75576fb0
commit
06956b742b
13 files changed
+532
-15
No files matched your search
@@ -2,9 +2,16 @@
|
||||
* 合同管理 API(门户 http + Java 对齐 GET/PUT/DELETE 语义)
|
||||
*/
|
||||
import request from '@/utils/http'
|
||||
import type { ContractForm, ContractQuery, ContractVO } from './types'
|
||||
import type {
|
||||
ContractApproverSettingForm,
|
||||
ContractApproverSettingVO,
|
||||
ContractForm,
|
||||
ContractQuery,
|
||||
ContractVO
|
||||
} from './types'
|
||||
|
||||
const BASE = '/web/crm/contract'
|
||||
const SETTING_BASE = '/web/crm/contract-approver-setting'
|
||||
|
||||
function unwrapData(res: any) {
|
||||
return res?.data ?? res ?? {}
|
||||
@@ -323,4 +330,27 @@ export async function listContractOperLog(_contractId: number | string) {
|
||||
return { rows: data.list || data.rows || [], total: data.total ?? 0 }
|
||||
}
|
||||
|
||||
export async function getContractApproverSetting() {
|
||||
const res = await request.post({ url: `${SETTING_BASE}/get`, data: {} })
|
||||
const data = unwrapData(res) || {}
|
||||
return {
|
||||
data: {
|
||||
id: data.id,
|
||||
approverIds: (data.approverIds || []).map(String),
|
||||
status: data.status === '1' ? '1' : '0',
|
||||
updateTime: data.updateTime
|
||||
} as ContractApproverSettingVO
|
||||
}
|
||||
}
|
||||
|
||||
export function saveContractApproverSetting(data: ContractApproverSettingForm) {
|
||||
return request.post({
|
||||
url: `${SETTING_BASE}/save`,
|
||||
data: {
|
||||
approverIds: (data.approverIds || []).map(String),
|
||||
status: data.status
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export * from './types'
|
||||
@@ -379,3 +379,16 @@ export type CreateFromQuoteForm = Pick<
|
||||
ContractForm,
|
||||
'contractNo' | 'contractName' | 'customerId' | 'contractType' | 'amount' | 'signDate' | 'startDate' | 'endDate' | 'remark' | 'products'
|
||||
>
|
||||
|
||||
/** 合同审批人设置 */
|
||||
export interface ContractApproverSettingVO {
|
||||
id?: string
|
||||
approverIds: (string | number)[]
|
||||
status: '0' | '1' | string
|
||||
updateTime?: string
|
||||
}
|
||||
|
||||
export interface ContractApproverSettingForm {
|
||||
approverIds: (string | number)[]
|
||||
status: '0' | '1'
|
||||
}
|
||||
Reference in new issue
Block a user