数据采集接口联调

This commit is contained in:
18652063575 2022-11-01 14:06:06 +08:00
parent d4ecfb3a1e
commit 8a964d7e40
8 changed files with 173 additions and 83 deletions

View File

@ -117,3 +117,7 @@ export const deleteSelectAddUpSituation = (params) => {
export const deleteAllAddUpSituation = (params) => {
return postFetch('/api/bs/hrmsalary/addUpSituation/deleteAllAddUpSituation', params);
}
//查看信息
export const getAddUpSituation = (params) => {
return postFetch('/api/bs/hrmsalary/addUpSituation/getAddUpSituation', params);
}

View File

@ -20,7 +20,7 @@ class AddItems extends Component {
taxAgentName: "",
employeeId: "",
employeeName: "",
personArea: "",
personArea: "ORGANIZATION",
username: "",
idcard: ""
}
@ -94,7 +94,7 @@ class AddItems extends Component {
{
com: PickDate({
label: "税款所属期",
viewAttr: 3,
viewAttr: _.isEmpty(editId) ? 3 : 1,
labelCol: { span: 6 },
wrapperCol: { span: 18 },
format: "YYYY-MM",
@ -107,7 +107,7 @@ class AddItems extends Component {
{
com: Select({
label: "个税扣缴义务人",
viewAttr: 3,
viewAttr: _.isEmpty(editId) ? 3 : 1,
options: taxAgentOption,
value: baseInfo.taxAgentId,
onChange: (data) => {
@ -118,7 +118,7 @@ class AddItems extends Component {
{
com: Select({
label: "人员范围",
viewAttr: 3,
viewAttr: _.isEmpty(editId) ? 3 : 1,
options: [
{ key: "ORGANIZATION", showname: "内部人员" }
// { key: "EXT_EMPLOYEE", showname: "非系统人员" }
@ -133,7 +133,9 @@ class AddItems extends Component {
const insider = [{
com: Browser({
label: "人员",
viewAttr: 3,
viewAttr: _.isEmpty(editId) ? 3 : 1,
value: baseInfo.employeeId,
valueSpan: baseInfo.employeeName,
onChange: ({ids, names}) => {
this.setState({ baseInfo: { ...baseInfo, employeeId: ids, employeeName: names } });
}

View File

@ -159,8 +159,8 @@ export default class Attendance extends React.Component {
handleFinish() {
this.setState({ modalVisiable: false });
const { attendanceStore: { getAttendanceList, step } } = this.props;
if (step == 2) {
this.getAttendanceList({ ...this.pageInfo });
if (step === 2) {
getAttendanceList({ ...this.pageInfo });
}
}

View File

@ -3,7 +3,6 @@
position: relative;
.searchConditionWrapper {
width: 600px;
margin-left: 10px;
margin-top: 8px;
}

View File

@ -66,7 +66,6 @@ export const columns = [
}
];
export const modalColumns = [
{
title: "姓名",
@ -285,9 +284,64 @@ export const dataCollectCondition = [
labelcol: 8,
value: "",
viewAttr: 2
},
}
],
title: "数据采集",
defaultshow: true
}
];
export const taxOptions = [
{
key: "",
showname: ""
},
{
key: "01",
showname: "一月",
},
{
key: "02",
showname: "二月"
},
{
key: "03",
showname: "三月"
},
{
key: "04",
showname: "四月"
},
{
key: "05",
showname: "五月"
},
{
key: "06",
showname: "六月"
},
{
key: "07",
showname: "七月"
},
{
key: "08",
showname: "八月"
},
{
key: "09",
showname: "九月"
},
{
key: "10",
showname: "十月"
},
{
key: "11",
showname: "十一月"
},
{
key: "12",
showname: "十二月"
},
];

View File

@ -1,12 +1,12 @@
import React from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { Button, Col, Dropdown, Menu, message, Modal, Row, Popover } from "antd";
import { Button, Col, Dropdown, Menu, message, Modal, Popover, Row } from "antd";
import { WeaDatePicker, WeaHelpfulTip, WeaRightMenu, WeaSelect, WeaSlideModal, WeaTab, WeaTable, WeaTop } from "ecCom";
import moment from "moment";
import { getSearchs, renderLoading } from "../../../util"; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import ImportModal from "../../../components/importModal";
import { dataCollectCondition, modalColumns } from "./columns";
import { dataCollectCondition, modalColumns, taxOptions } from "./columns";
import { optionAddAll } from "../../../util/options";
import SlideModalTitle from "../../../components/slideModalTitle";
import EditSlideContent from "./editSlideContent";
@ -14,7 +14,6 @@ import AddItems from "../addItems";
import * as API from "../../../apis/cumSituation";
import "./index.less";
@inject("cumSituationStore", "taxAgentStore")
@observer
export default class CumSituation extends React.Component {
@ -23,14 +22,14 @@ export default class CumSituation extends React.Component {
this.state = {
saveLoading: false,
addVisible: false,
editId: "",
editId: {},
value: "",
selectedKey: [],
slideSelectedKey: [], //详情表格的选中项
visiable: false,
inited: false,
monthValue: moment(new Date()).format("YYYY"),
taxYearMonth: moment(new Date()).format("YYYY-MM"),
taxYearMonth: moment(new Date()).month() + 1 > 10 ? (moment(new Date()).month() + 1) + "" : "0" + (moment(new Date()).month() + 1),
taxAgentId: "All",
modalParam: {
taxYearMonth: ""
@ -45,7 +44,11 @@ export default class CumSituation extends React.Component {
taxAgentStore: { fetchTaxAgentOption }
} = this.props;
addForm.initFormFields(dataCollectCondition);
doInit({ year: this.state.monthValue, taxAgentId: "" });
doInit({
year: this.state.monthValue,
taxAgentId: "",
taxYearMonth: this.state.monthValue + "-" + this.state.taxYearMonth
});
fetchTaxAgentOption().then(() => {
this.setState({
inited: true
@ -54,7 +57,7 @@ export default class CumSituation extends React.Component {
}
getSearchsAdQuick() {
const { monthValue, taxAgentId } = this.state;
const { monthValue, taxAgentId, taxYearMonth } = this.state;
const {
taxAgentStore: { taxAgentOption },
cumSituationStore: { form, getTableDatas }
@ -67,22 +70,21 @@ export default class CumSituation extends React.Component {
value={monthValue}
format="YYYY"
width={200}
onChange={v => {
this.setState({ monthValue: v });
onChange={c => {
this.setState({ monthValue: c, taxYearMonth: "01" });
let params = {};
if (taxAgentId == "All") {
params.taxAgentId = "";
} else {
params.taxAgentId = taxAgentId;
}
if (v != null && v != "") {
params.year = v;
if (c != null && c !== "") {
params.year = c;
}
getTableDatas(params);
getTableDatas({ ...params, taxYearMonth: c + "-" + taxYearMonth });
}}
/>
</div>
<div className="helperWrapper">
<WeaHelpfulTip
title="<div>提示:默认显示本年截至上次所有员工的累计收入及各项累计扣除额、已预扣税额,与本月应发和各项应扣除项一起计算出本月应缴纳税额</div>"
@ -91,6 +93,27 @@ export default class CumSituation extends React.Component {
/>
</div>
<div className="searchConditionItem" style={{ marginRight: 10 }}>
<span className="conditionFormLabel">税款所属期:</span>
<WeaSelect
style={{ width: 80 }}
options={taxOptions}
value={taxYearMonth}
onChange={v => {
this.setState({ taxYearMonth: v });
let params = {};
if (taxAgentId == "All") {
params.taxAgentId = "";
} else {
params.taxAgentId = taxAgentId;
}
if (v != null && v != "") {
params.taxYearMonth = monthValue + "-" + v;
}
getTableDatas({ ...params, year: monthValue });
}}
/>
</div>
<div className="searchConditionItem">
<span className="conditionFormLabel">个税扣缴义务人:</span>
{this.state.inited &&
@ -101,15 +124,15 @@ export default class CumSituation extends React.Component {
value={taxAgentId}
onChange={v => {
let params = {};
if (v == "All") {
if (v === "All") {
params.taxAgentId = "";
} else {
params.taxAgentId = v;
}
if (monthValue != null && monthValue != "") {
if (monthValue != null && monthValue !== "") {
params.year = monthValue;
}
getTableDatas(params);
getTableDatas({ ...params, taxYearMonth: monthValue + "-" + taxYearMonth });
this.setState({ taxAgentId: v });
}}
/>}
@ -227,7 +250,7 @@ export default class CumSituation extends React.Component {
// 搜索
handleSearch = () => {
const { cumSituationStore: { getTableDatas } } = this.props;
const { monthValue, taxAgentId } = this.state;
const { monthValue, taxAgentId, taxYearMonth } = this.state;
let params = {};
if (monthValue != null && monthValue !== "") {
params.year = monthValue;
@ -235,43 +258,63 @@ export default class CumSituation extends React.Component {
if (taxAgentId != null && taxAgentId !== "" && taxAgentId !== "All") {
params.taxAgentId = taxAgentId;
}
getTableDatas(params);
getTableDatas({ ...params, taxYearMonth: monthValue + "-" + taxYearMonth });
};
//新功能
createAddUpSituation= (payload)=>{
handleCreateUpSituation = (payload) => {
const { editId } = this.state;
this.setState({ saveLoading: true });
API.createAddUpSituation(payload).then(({ status }) => {
this.setState({ saveLoading: false });
if (status) {
message.success("新增成功");
this.setState({
addVisible: false,
editId: ""
}, () => {
const { cumSituationStore: { doSearch, addForm } } = this.props;
const { monthValue, taxAgentId } = this.state;
doSearch({
declareMonth: [monthValue],
taxAgentId: taxAgentId === "All" ? "" : taxAgentId
if (!_.isEmpty(editId)) {
API.editAddUpSituation({ ...payload, id: editId.id }).then(({ status }) => {
this.setState({ saveLoading: false });
if (status) {
message.success("编辑成功");
this.setState({
addVisible: false,
editId: {}
}, () => {
const { cumSituationStore: { addForm } } = this.props;
this.handleSearch();
addForm.resetForm();
});
addForm.resetForm();
});
} else {
message.error("新增失败");
}
});
}
} else {
message.error("编辑失败");
}
});
} else {
API.createAddUpSituation(payload).then(({ status }) => {
this.setState({ saveLoading: false });
if (status) {
message.success("新增成功");
this.setState({
addVisible: false,
editId: {}
}, () => {
const { cumSituationStore: { addForm } } = this.props;
this.handleSearch();
addForm.resetForm();
});
} else {
message.error("新增失败");
}
});
}
};
handleOperate = ({ key }, row) => {
const { monthValue: declareMonth, taxAgentId } = this.state;
const { cumSituationStore: { doSearch } } = this.props;
const { monthValue: declareMonth, taxYearMonth } = this.state;
if (key === "edit") {
this.setState({
addVisible: true,
editId: row.id
addVisible: true
}, () => {
API.getAddUpSituation({ id: row.id }).then(({ status, data }) => {
if (status) {
this.setState({ editId: data });
}
});
});
} else if (key === "delete") {
const payload = {
declareMonth,
taxYearMonth: declareMonth + "-" + taxYearMonth,
ids: [row.id]
};
Modal.confirm({
@ -281,10 +324,7 @@ export default class CumSituation extends React.Component {
API.deleteSelectAddUpSituation(payload).then(({ status }) => {
if (status) {
message.success("删除成功");
doSearch({
declareMonth: [declareMonth],
taxAgentId: taxAgentId === "All" ? "" : taxAgentId
});
this.handleSearch();
} else {
message.error("删除失败");
}
@ -294,14 +334,13 @@ export default class CumSituation extends React.Component {
}
};
deleteSelectAddUpSituation = () => {
const { monthValue: declareMonth, taxAgentId, selectedKey } = this.state;
const { cumSituationStore: { doSearch } } = this.props;
const { monthValue: declareMonth, selectedKey, taxYearMonth } = this.state;
if (selectedKey.length === 0) {
message.warning("未选择条目");
return;
}
const payload = {
declareMonth,
taxYearMonth: declareMonth + "-" + taxYearMonth,
ids: selectedKey
};
Modal.confirm({
@ -311,10 +350,7 @@ export default class CumSituation extends React.Component {
API.deleteSelectAddUpSituation(payload).then(({ status }) => {
if (status) {
message.success("删除成功");
doSearch({
declareMonth: [declareMonth],
taxAgentId: taxAgentId === "All" ? "" : taxAgentId
});
this.handleSearch();
} else {
message.error("删除失败");
}
@ -326,11 +362,9 @@ export default class CumSituation extends React.Component {
};
deleteAllAddUpSituation = () => {
const { monthValue: declareMonth, taxAgentId } = this.state;
const { cumSituationStore: { doSearch } } = this.props;
const { monthValue: declareMonth, taxYearMonth } = this.state;
const payload = {
declareMonth,
taxAgentId: taxAgentId === "All" ? "" : taxAgentId
taxYearMonth: declareMonth + "-" + taxYearMonth
};
Modal.confirm({
title: "信息确认",
@ -339,10 +373,7 @@ export default class CumSituation extends React.Component {
API.deleteAllAddUpSituation(payload).then(({ status }) => {
if (status) {
message.success("删除成功");
doSearch({
declareMonth: [declareMonth],
taxAgentId: taxAgentId === "All" ? "" : taxAgentId
});
this.handleSearch();
} else {
message.error("删除失败");
}
@ -353,7 +384,7 @@ export default class CumSituation extends React.Component {
render() {
const { cumSituationStore, taxAgentStore } = this.props;
const { slideSelectedKey, addVisible, editId, saveLoading, taxYearMonth } = this.state;
const { slideSelectedKey, addVisible, editId, saveLoading } = this.state;
const {
loading,
dataSource,
@ -406,7 +437,7 @@ export default class CumSituation extends React.Component {
};
const adBtn = [
// 高级搜索内部按钮
<Button type="primary" onClick={doSearch}>
<Button type="primary" onClick={() => this.handleSearch()}>
搜索
</Button>,
<Button type="ghost" onClick={() => form.resetForm()}>
@ -486,7 +517,7 @@ export default class CumSituation extends React.Component {
onClick={() => {
this.setState({
addVisible: true
});
}, () => addForm.resetForm());
}}>
新建
</Button>,
@ -694,11 +725,11 @@ export default class CumSituation extends React.Component {
title={
<SlideModalTitle
loading={saveLoading}
subtitle={addVisible ? (editId ? "编辑" : "新建") : "往期累计情况(工资、薪金)记录"}
subtitle={addVisible ? (!_.isEmpty(editId) ? "编辑" : "新建") : "往期累计情况(工资、薪金)记录"}
onSave={() => {
const { baseInfo } = this.addItemRef.state;
const bool = _.every(_.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId"]), v => !_.isEmpty(v));
if (!bool) {
if (!bool && _.isEmpty(editId)) {
Modal.warning({
title: "信息确认",
content: "必要信息不完整,红色*为必填项!"
@ -710,7 +741,7 @@ export default class CumSituation extends React.Component {
..._.pick(baseInfo, ["taxAgentId", "employeeId", "taxAgentName"]),
...addForm.getFormParams()
};
this.createAddUpSituation(payload);
this.handleCreateUpSituation(payload);
}}
editable={!!addVisible}
showOperateBtn={showOperateBtn}
@ -724,6 +755,7 @@ export default class CumSituation extends React.Component {
taxAgentOption={taxAgentOption}
form={addForm}
isCum
editId={!_.isEmpty(editId) ? { ...editId, declareMonth: editId.taxYearMonth } : editId}
condition={dataCollectCondition}/> :
<EditSlideContent
slideSelectedKey={slideSelectedKey}
@ -735,7 +767,7 @@ export default class CumSituation extends React.Component {
setSlideVisiable(false);
this.setState({
addVisible: false,
editId: ""
editId: {}
});
}}
showMask={true}
@ -743,7 +775,7 @@ export default class CumSituation extends React.Component {
setSlideVisiable(false);
this.setState({
addVisible: false,
editId: ""
editId: {}
});
}}
/>}

View File

@ -1,7 +1,7 @@
.tipWrapper{
display: flex;
flex-direction: column;
margin: 0 25px;
margin: 0 25px 20px 25px;
border: 1px solid #e5e5e5;
.title{
border-bottom: 1px solid #e5e5e5;

View File

@ -13,7 +13,6 @@ import EditSlideContent from "./editSlideContent";
import { optionAddAll } from "../../../util/options";
import * as API from "../../../apis/otherDeduct";
import "./index.less";
import { getData } from "../../../apis/otherDeduct";
@inject("otherDeductStore", "taxAgentStore")