import { action, observable } from "mobx"; import { WeaForm, WeaTableNew } from "comsMobx"; import * as API from "../apis/payrollFiles"; import { getDataPerspective, statisticsEmployeeDetailList } from "../apis/statistics"; import { getTaxdeclarationContrastList } from "../apis/declare"; const { TableStore } = WeaTableNew; export class PayrollFilesStore { @observable tableStore = new TableStore(); @observable employeeTableStore = new TableStore(); @observable pivotTableStore = new TableStore(); @observable declareTableStore = new TableStore();//个税申请线下对比 @observable adjustForm = new WeaForm(); //调薪记录-核算form @action initAdjustForm = () => this.adjustForm = new WeaForm();//调薪记录-初始化核算form /*薪资档案页面重构*/ @observable salaryFileQueryForm = new WeaForm(); // 薪资档案查询form @observable salaryFileForm = new WeaForm(); // 薪资档案form @action initSalaryFileForm = () => this.salaryFileForm = new WeaForm(); // 薪资档案form初始化 @observable hasBeenModify = false; //薪资档案-员工薪资档案-是否修改过 @action setHasBeenModify = (v) => this.hasBeenModify = v;//薪资档案-员工薪资档案数据 /*薪资档案页面重构*/ @action("薪资档案-列表查询") queryList = (payload = {}, searchItemsValue = {}, url = "") => { return new Promise((resolve, reject) => { const { departmentIds, positionIds, subcompanyIds, statuses, taxAgentIds, ...extra } = searchItemsValue; API.queryList({ departmentIds: departmentIds ? departmentIds.split(",") : [], positionIds: positionIds ? positionIds.split(",") : [], subcompanyIds: subcompanyIds ? subcompanyIds.split(",") : [], taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [], statuses: statuses ? statuses.split(",") : [], ...payload, ...extra, url }).then(res => { const { data, status } = res; if (status) { const { dataKey } = data; const { datas } = dataKey; this.tableStore.getDatas(datas); // table 请求数据 } resolve(res); }).catch(() => { reject(); }); }); }; @action("薪酬统计列表员工详情-列表查询") statisticsEmployeeDetailList = (payload) => { return new Promise((resolve, reject) => { statisticsEmployeeDetailList(payload).then(res => { const { data, status } = res; if (status) { const { dataKey } = data; const { datas } = dataKey; this.employeeTableStore.getDatas(datas); // table 请求数据 } resolve(res); }).catch(() => { reject(); }); }); }; @action("报表查看-数据透视") getDataPerspective = (payload) => { return new Promise((resolve, reject) => { getDataPerspective(payload).then(res => { const { data, status } = res; if (status) { const { dataKey } = data; const { datas } = dataKey; this.pivotTableStore.getDatas(datas); // table 请求数据 } resolve(res); }).catch(() => { reject(); }); }); }; @action("个税申请线下对比-列表查询") getTaxdeclarationContrastList = (payload) => { return new Promise((resolve, reject) => { getTaxdeclarationContrastList(payload).then(res => { const { data, status } = res; if (status) { const { dataKey } = data; const { datas } = dataKey; this.declareTableStore.getDatas(datas); // table 请求数据 } resolve(res); }).catch(() => { reject(); }); }); }; }