This commit is contained in:
MustangDeng 2022-05-26 09:46:28 +08:00
parent 709deef5a6
commit f4ac00ddbd
8 changed files with 80 additions and 31 deletions

View File

@ -158,3 +158,15 @@ export const querySupplementaryForm = (params) => {
params
);
};
// 核算详情页核算
export const commonAccount = (params) => {
return fetch("/api/bs/hrmsalary/siaccount/commonAccount", {
method: "post",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};

View File

@ -103,6 +103,7 @@ export default class StandingBook extends React.Component {
this.handleOperate({ key, billMonth })
}>
<Menu.Item key="archive">归档</Menu.Item>
<Menu.Item key="detail">异常详情</Menu.Item>
<Menu.Item key="delete">删除</Menu.Item>
{/* <Menu.Item key="operate">操作日志</Menu.Item> */}
</Menu>

View File

@ -7,7 +7,7 @@
import React, { Component } from "react";
import { Icon, Tooltip, Button, Spin } from "antd";
import { inject, observer } from "mobx-react";
import { WeaBrowser, WeaTable } from "ecCom";
import { WeaBrowser, WeaTable, WeaInputSearch } from "ecCom";
import "./index.less";
@inject("standingBookStore")
@ -18,6 +18,7 @@ export default class AbnormalListIndex extends Component {
this.state = {
selectedRowKeys: [],
current: 1,
searchValue: "",
tableData: {
list: [],
columns: [],
@ -43,6 +44,12 @@ export default class AbnormalListIndex extends Component {
});
});
};
handleSearch(value) {
const { billMonth } = this.props;
const { current } = this.state;
this.getChangeList({ billMonth, current, userName: value });
}
render() {
const { remarks, billMonth, selectedKey } = this.props;
const { selectedRowKeys } = this.state;
@ -78,15 +85,7 @@ export default class AbnormalListIndex extends Component {
</div>
<div className="tabOption">
<Button>导出全部</Button>
<WeaBrowser
type={17}
textDecoration={true}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) =>
console.log("多人力", ids, names, datas)
}
isSingle={false}
/>
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
</div>
{/* table */}
<div style={{ padding: "0 16px" }}>

View File

@ -24,10 +24,17 @@
padding: 8px 20px;
justify-content: flex-end;
i,
button {
i,button {
cursor: pointer;
// margin-right: 10px;
margin-right: 10px;
}
.anticon-search {
margin-right: 0px;
}
.wea-input-focus-btn {
margin-right: 0px;
}
}
}

View File

@ -97,7 +97,7 @@ export default class NormalIndex extends Component {
billMonth,
billMonthList: billMonthList.split(","),
includes: includes.split(","),
excludes: excludes.split(","),
// excludes: excludes.split(","),
projects: projects.split(","),
};
siaccountSupplementarySave(payload).then(() => {
@ -261,6 +261,20 @@ export default class NormalIndex extends Component {
},
});
};
// 核算按钮点击
handleCommonAccountClick() {
const { remarks, billMonth, selectedKey } = this.props;
const { commonAccount } =
this.props.standingBookStore;
commonAccount({
billMonth, includes: []
}).then(() => {
selectedKey === "1"
? this.getNormalList({ billMonth, current: this.state.current })
: this.getSupplementaryList({ billMonth, current: this.state.current });
})
}
render() {
const { remarks, billMonth, selectedKey } = this.props;
const { selectedRowKeys, addProps, date } = this.state;
@ -307,7 +321,7 @@ export default class NormalIndex extends Component {
</div>
)}
<div className="tabOption">
{/* <Tooltip title="">
<Tooltip title="批量删除">
<i
className="icon-coms-Batch-delete"
onClick={this.handleBatchDelete}
@ -315,7 +329,7 @@ export default class NormalIndex extends Component {
</Tooltip>
<Tooltip title="添加该月正常缴纳人员">
<i className="icon-coms-Add-to" onClick={this.handleAdd} />
</Tooltip> */}
</Tooltip>
{addProps.visible && (
<WeaDialog
{...addProps}
@ -345,10 +359,10 @@ export default class NormalIndex extends Component {
<i className="icon-coms02-Import" />
</Tooltip>
)}
{/* <Tooltip title="">
<Tooltip title="导出全部">
<i className="icon-coms02-coms2-export" />
</Tooltip> */}
{/* {selectedKey === "1" && <Button type="primary">核算</Button>} */}
</Tooltip>
{selectedKey === "1" && <Button type="primary" onClick={() => {this.handleCommonAccountClick()}}>核算</Button>}
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
</div>

View File

@ -33,10 +33,10 @@ class StandingBookDetail extends Component {
const billMonth = this.props.location.query.billMonth;
getTabList({ billMonth }).then(({ data }) => {
const { tabList, remarks, billMonth } = data;
let newTabList = tabList.filter(item => item.id != "2" && item.id != "3")
// let newTabList = tabList.filter(item => item.id != "2" && item.id != "3")
this.setState({
selectedKey: newTabList[0].id,
tabList: _.map(newTabList, it => ({ title: it.content, viewcondition: it.id })),
selectedKey: tabList[0].id,
tabList: _.map(tabList, it => ({ title: it.content, viewcondition: it.id })),
remarks, billMonth
});
})

View File

@ -1,6 +1,7 @@
import { observable, action, toJS } from "mobx";
import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx";
import { removePropertyCondition } from "../util/response";
import _ from "lodash";
import * as API from "../apis/standingBook"; // 引入API接口文件
@ -294,10 +295,11 @@ export class StandingBookStore {
action((res) => {
if (res.status) {
// 接口请求成功/失败处理
this.condition = res.data.condition;
this.form.initFormFields(res.data.condition); // 渲染高级搜索form表单
let condition = removePropertyCondition(res.data.condition)
this.condition = condition;
this.form.initFormFields(condition); // 渲染高级搜索form表单
} else {
message.error(res.msg || "接口调用失败!");
message.error(res.errormsg || "接口调用失败!");
}
})
);
@ -309,10 +311,11 @@ export class StandingBookStore {
action((res) => {
if (res.status) {
// 接口请求成功/失败处理
this.condition = res.data.condition;
this.form.initFormFields(res.data.condition); // 渲染高级搜索form表单
let condition = removePropertyCondition(res.data.condition)
this.condition = condition;
this.form.initFormFields(condition); // 渲染高级搜索form表单
} else {
message.error(res.msg || "接口调用失败!");
message.error(res.errormsg || "接口调用失败!");
}
})
);
@ -331,7 +334,7 @@ export class StandingBookStore {
this.tableStore.getDatas(res.datas); // table 请求数据
this.hasRight = res.hasRight;
} else {
message.error(res.msg || "接口调用失败!");
message.error(res.errormsg || "接口调用失败!");
}
this.loading = false;
})
@ -346,4 +349,19 @@ export class StandingBookStore {
this.getTableDatas();
this.showSearchAd = false;
};
@action
commonAccount = (params) => {
return new Promise((resolve, reject) => {
API.commonAccount(params).then(res => {
if(res.status) {
resolve();
} else {
message.error(res.errormsg || "接口调用失败!")
reject();
}
})
})
}
}

View File

@ -89,9 +89,7 @@ export const getCustomSearchs = (form, condition, col, isCenter) => {
export const getSearchs = (form, condition, col, isCenter) => {
const { isFormInit } = form;
const formParams = form.getFormParams();
console.log("formParams: ", formParams);
let group = [];
console.log("condition", condition);
isFormInit && condition && condition.map(c =>{
let items = [];
c.items.map(fields => {