KPI HT事业部

feature/2.0-sales-trade
Lei OT 2 years ago
parent 45236c6bfa
commit 9348c4c980

@ -30,7 +30,7 @@ export default observer((props) => {
const config = merge({ const config = merge({
color: { color: {
range: [ '#FFF3E1', '#FFe0b0', '#bfeec8'], // '#FFbcb8', '#FFe0b0', range: [ '#FFF3E1', '#FFF3E1', '#FFe0b0', '#bfeec8'], // '#FFbcb8', '#FFe0b0',
measure: '#5B8FF9', measure: '#5B8FF9',
target: '#FF9845', target: '#FF9845',
}, },

@ -117,7 +117,7 @@ export const dataFieldAlias = dataFieldOptions.reduce(
*/ */
export const KPIObjects = [ export const KPIObjects = [
{ key: 'overview', value: 'overview', label: '海纳' }, { key: 'overview', value: 'overview', label: '海纳' },
{ key: 'bu', value: 'bu', label: '事业部', data: bu }, { key: 'bu', value: 'bu', label: 'HT事业部', data: bu },
{ key: 'dept', value: 'dept', label: '小组', data: leafGroup }, { key: 'dept', value: 'dept', label: '小组', data: leafGroup },
{ key: 'du', value: 'du', label: '销售小组', data: deptUnits }, { key: 'du', value: 'du', label: '销售小组', data: deptUnits },
{ key: 'operator', value: 'operator', label: '顾问' }, { key: 'operator', value: 'operator', label: '顾问' },

@ -22,13 +22,14 @@ class KPI {
} }
async onSubmit(tableData, { delQueue }) { async onSubmit(tableData, { delQueue }) {
this.listLoading = true;
const flushData = tableData.filter(row => !isEmpty(row.value) || !isEmpty(row?.kpi_id)); const flushData = tableData.filter(row => !isEmpty(row.value) || !isEmpty(row?.kpi_id));
const postRes = isEmpty(flushData) ? true : await this.saveOrUpdate(flushData); const postRes = isEmpty(flushData) ? true : await this.saveOrUpdate(flushData);
const delRes = isEmpty(flush(delQueue)) ? true : await this.delByID(delQueue); const delRes = isEmpty(flush(delQueue)) ? true : await this.delByID(delQueue);
return postRes && delRes; return postRes && delRes;
} }
getList(param = {}) { async getList(param = {}) {
const _param = { const _param = {
date_type: 'applyDate', date_type: 'applyDate',
start_date: '2020-01-01', start_date: '2020-01-01',
@ -38,7 +39,7 @@ class KPI {
}; };
this.listLoading = true; this.listLoading = true;
this.pageData = []; this.pageData = [];
return req.fetchJSON('/service-Analyse2/getkpi', _param).then((json) => { const json = await req.fetchJSON('/service-Analyse2/getkpi', _param);
if (json.errcode === 0) { if (json.errcode === 0) {
runInAction(() => { runInAction(() => {
this.listLoading = false; this.listLoading = false;
@ -49,7 +50,6 @@ class KPI {
}); });
} }
return this.pageData; return this.pageData;
});
} }
settingYear = moment().year(); settingYear = moment().year();

@ -58,6 +58,7 @@ export default observer((props) => {
KPIStore.setSettingYear(formVal?.year?.year() || KPIStore.settingYear); KPIStore.setSettingYear(formVal?.year?.year() || KPIStore.settingYear);
// console.log('invoke on search', obj, formVal, getkpiParam); // console.log('invoke on search', obj, formVal, getkpiParam);
if (curObject === 'operator') { if (curObject === 'operator') {
KPIStore.setListLoading(true);
const searchOperator = await DictDataStore.fetchDictData('operator', { const searchOperator = await DictDataStore.fetchDictData('operator', {
is_assign: 1, is_assign: 1,
dept_id: (obj?.DepartmentList || '').replace('ALL', ''), dept_id: (obj?.DepartmentList || '').replace('ALL', ''),
@ -71,11 +72,12 @@ export default observer((props) => {
delete getkpiParam.dept_id; delete getkpiParam.dept_id;
} }
} }
getKPIList(getkpiParam); await getKPIList(getkpiParam);
}; };
const getKPIList = (getkpiParam) => { const getKPIList = async (getkpiParam) => {
KPIStore.getList(getkpiParam).then((data) => { const _data = await KPIStore.getList(getkpiParam);
// setDataSource(data); // KPIStore.getList(getkpiParam).then((data) => {
// // setDataSource(data);
if (objectFilterKey?.[curObject]) { if (objectFilterKey?.[curObject]) {
const selectItem = searchFormStore.formValues[objectFilterKey[curObject]]; const selectItem = searchFormStore.formValues[objectFilterKey[curObject]];
if (selectItem) { if (selectItem) {
@ -83,7 +85,7 @@ export default observer((props) => {
} }
setRetObjects(flush([selectItem])); setRetObjects(flush([selectItem]));
} }
}); // });
}; };
return ( return (
<> <>

Loading…
Cancel
Save