From 8a964d7e40af4e068493bcdf0fb4ebe660cb8352 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Tue, 1 Nov 2022 14:06:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/cumSituation.js | 4 + .../pages/dataAcquisition/addItems.js | 12 +- .../pages/dataAcquisition/attendance/index.js | 4 +- .../dataAcquisition/cumDeduct/index.less | 1 - .../dataAcquisition/cumSituation/columns.js | 58 +++++- .../dataAcquisition/cumSituation/index.js | 174 +++++++++++------- .../pages/dataAcquisition/index.less | 2 +- .../dataAcquisition/otherDeduct/index.js | 1 - 8 files changed, 173 insertions(+), 83 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/cumSituation.js b/pc4mobx/hrmSalary/apis/cumSituation.js index d8f84017..512f3d14 100644 --- a/pc4mobx/hrmSalary/apis/cumSituation.js +++ b/pc4mobx/hrmSalary/apis/cumSituation.js @@ -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); +} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js index 5ed7b58a..751934a9 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js @@ -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 } }); } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js index d942b925..e568b84a 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js @@ -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 }); } } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.less index dc458e34..46ce46d5 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.less +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.less @@ -3,7 +3,6 @@ position: relative; .searchConditionWrapper { - width: 600px; margin-left: 10px; margin-top: 8px; } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js index 93f13900..ce99e24c 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js @@ -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: "十二月" + }, +]; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index bd4241e2..82849f06 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -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 }); }} /> -
+
+ 税款所属期: + { + 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 }); + }} + /> +
个税扣缴义务人: {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 = [ // 高级搜索内部按钮 - , , @@ -694,11 +725,11 @@ export default class CumSituation extends React.Component { title={ { 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}/> : } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/index.less index fab55464..b583068d 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/index.less +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/index.less @@ -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; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index 9b7a19d4..ca12c043 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -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")