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