feat(work): 添加商务经理和大区额度功能
This commit is contained in:
parent
da443dc7ed
commit
78008fc80b
@ -82,4 +82,22 @@ export const orderReviewBack = (saleIds) => {
|
||||
id: saleIds
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 商务经理额度
|
||||
export const getManagerCreditLine = (query) => {
|
||||
return request({
|
||||
method: 'post',
|
||||
url: '/bussiness/salemain/getManagerCreditLine',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
// 大区额度
|
||||
export const getAreaCreditLine = (query) => {
|
||||
return request({
|
||||
method: 'post',
|
||||
url: '/bussiness/salemain/getAreaCreditLine',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
@ -135,6 +135,7 @@ import UniTag from "../../../uni_modules/uni-tag/components/uni-tag/uni-tag.vue"
|
||||
import {formatPrice} from "../../../utils/utils";
|
||||
import DictSelect from "../../../components/DictSelect/DictSelect.vue";
|
||||
import MBCard from "../../../components/MB/MBCard.vue";
|
||||
import {getAreaCreditLine, getManagerCreditLine} from "../../../api/Salemain";
|
||||
|
||||
const id = ref('')
|
||||
const queryParams = ref({})
|
||||
@ -147,6 +148,7 @@ onLoad((options) => {
|
||||
|
||||
onMounted(async () => {
|
||||
const actionType = new Date().getDate() < 25 ? '1' : '0'
|
||||
|
||||
const {data} = await salemainDetailSWJL({
|
||||
id: id.value,
|
||||
isThisMonth: actionType
|
||||
@ -159,8 +161,44 @@ onMounted(async () => {
|
||||
actionType: actionType,
|
||||
goods: goods
|
||||
}
|
||||
|
||||
// 商务经理额度
|
||||
const {data: mangerCreditLine} = await getManagerCreditLine({
|
||||
isThisMonth: actionType
|
||||
})
|
||||
const manger = parseCompanyData(mangerCreditLine)
|
||||
queryParams.value = {
|
||||
...queryParams.value,
|
||||
budgetmoney1: manger.budgetmoney1,
|
||||
CAN: manger.CAN,
|
||||
}
|
||||
|
||||
// 大区额度
|
||||
const {data: areaCreditLine} = await getAreaCreditLine({
|
||||
isThisMonth: actionType
|
||||
})
|
||||
const area = parseCompanyData(areaCreditLine)
|
||||
queryParams.value = {
|
||||
...queryParams.value,
|
||||
budgetmoney_area: area.budgetmoney1,
|
||||
CAN_area: area.CAN
|
||||
}
|
||||
})
|
||||
|
||||
const parseCompanyData = (data) => {
|
||||
const result = {}
|
||||
|
||||
Object.entries(data).forEach(([key, value]) => {
|
||||
const match = key.match(/\{(\d+)=/)
|
||||
if (!match) return
|
||||
|
||||
const id = Number(match[1])
|
||||
result[id] = value?.[0] ?? {}
|
||||
})
|
||||
|
||||
return result[queryParams.value.dept_id]
|
||||
}
|
||||
|
||||
|
||||
const handleCallBack = () => {
|
||||
managerRefuse({
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
export const formatPrice = (value) => {
|
||||
return Number(value).toFixed(2)
|
||||
return Number(value).toLocaleString('en-US', {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2
|
||||
})
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user