From 8fa3b0918c46d5001e0f8bf8b88761c3078d2a42 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Mon, 24 Oct 2022 18:42:15 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=96=B0=E5=BB=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/appConfig/index.js | 5 +- .../pages/calculateDetail/userSure.js | 10 - .../pages/dataAcquisition/addItems.js | 178 +++++++ .../dataAcquisition/cumDeduct/columns.js | 346 ++++++++----- .../{ => components}/editSlideContent.js | 0 .../{ => components}/editSlideContent.less | 0 .../pages/dataAcquisition/cumDeduct/index.js | 120 +++-- .../dataAcquisition/cumSituation/columns.js | 473 +++++++++++------- .../dataAcquisition/cumSituation/index.js | 103 ++-- .../pages/dataAcquisition/index.less | 21 + .../dataAcquisition/otherDeduct/columns.js | 289 ++++++----- .../dataAcquisition/otherDeduct/index.js | 97 +++- pc4mobx/hrmSalary/pages/ruleConfig/index.js | 6 +- pc4mobx/hrmSalary/stores/cumDeduct.js | 3 +- pc4mobx/hrmSalary/stores/cumSituation.js | 3 +- pc4mobx/hrmSalary/stores/otherDeduct.js | 3 +- 16 files changed, 1093 insertions(+), 564 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js rename pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/{ => components}/editSlideContent.js (100%) rename pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/{ => components}/editSlideContent.less (100%) create mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/index.less diff --git a/pc4mobx/hrmSalary/pages/appConfig/index.js b/pc4mobx/hrmSalary/pages/appConfig/index.js index d7754d54..e0b8ee63 100644 --- a/pc4mobx/hrmSalary/pages/appConfig/index.js +++ b/pc4mobx/hrmSalary/pages/appConfig/index.js @@ -84,12 +84,13 @@ export const CheckBox = payload => { }; export const PickDate = payload => { - const { label, onChange, value, viewAttr } = payload; + const { label, onChange, value, viewAttr, format, labelCol = { span: 8 }, wrapperCol = { span: 16 } } = payload; return ( - + onChange({ type: label, date })}/> ); diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js index 5287c5bd..c6b0938a 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js @@ -69,16 +69,6 @@ export default class UserSure extends React.Component { { this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } }); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js new file mode 100644 index 00000000..bca10c14 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js @@ -0,0 +1,178 @@ +/* + * Author: 黎永顺 + * name: 新增数据采集项 + * Description: + */ +import React, { Component } from "react"; +import { WeaBrowser, WeaFormItem, WeaInput, WeaSearchGroup } from "ecCom"; +import { getSearchs } from "../../util"; +import { Select } from "../ruleConfig"; +import { PickDate } from "../appConfig"; +import "./index.less"; + +class AddItems extends Component { + constructor(props) { + super(props); + this.state = { + baseInfo: { + taxablePeriod: "", + taxAgentor: "", + employee: "", + personArea: "", + username: "", + idcard: "" + } + }; + } + + render() { + const { taxAgentOption = [], form, condition = [], isCum } = this.props; + const { baseInfo } = this.state; + const items = [ + { + com: PickDate({ + label: "税款所属期", + viewAttr: 3, + labelCol: { span: 6 }, + wrapperCol: { span: 18 }, + format: "YYYY-MM", + value: baseInfo.taxablePeriod, + onChange: (data) => { + this.setState({ baseInfo: { ...baseInfo, taxablePeriod: data.date } }); + } + }) + }, + { + com: Select({ + label: "个税扣缴义务人", + viewAttr: 3, + options: taxAgentOption, + value: baseInfo.taxAgentor, + onChange: (data) => { + this.setState({ baseInfo: { ...baseInfo, taxAgentor: data.selected } }); + } + }) + }, + { + com: Browser({ + label: "人员", + viewAttr: 3, + onChange: (employee) => { + this.setState({ baseInfo: { ...baseInfo, employee } }); + } + }) + } + ]; + const cumSituationitems = [ + { + com: PickDate({ + label: "税款所属期", + viewAttr: 3, + labelCol: { span: 6 }, + wrapperCol: { span: 18 }, + format: "YYYY-MM", + value: baseInfo.taxablePeriod, + onChange: (data) => { + this.setState({ baseInfo: { ...baseInfo, taxablePeriod: data.date } }); + } + }) + }, + { + com: Select({ + label: "个税扣缴义务人", + viewAttr: 3, + options: taxAgentOption, + value: baseInfo.taxAgentor, + onChange: (data) => { + this.setState({ baseInfo: { ...baseInfo, taxAgentor: data.selected } }); + } + }) + }, + { + com: Select({ + label: "人员范围", + viewAttr: 3, + options: [ + { key: "ORGANIZATION", showname: "内部人员" }, { key: "EXT_EMPLOYEE", showname: "非系统人员" }], + value: baseInfo.personArea, + onChange: (data) => { + this.setState({ baseInfo: { ...baseInfo, personArea: data.selected } }); + } + }) + } + ]; + const insider = [{ + com: Browser({ + label: "人员", + viewAttr: 3, + onChange: (employee) => { + this.setState({ baseInfo: { ...baseInfo, employee } }); + } + }) + }]; + const noSysPerson = [ + { + com: InputCus({ + label: "姓名", + viewAttr: 2, + onChange: (username) => { + this.setState({ baseInfo: { ...baseInfo, username } }); + } + }) + }, + { + com: InputCus({ + label: "身份证号码", + viewAttr: 3, + onChange: (idcard) => { + this.setState({ baseInfo: { ...baseInfo, idcard } }); + } + }) + } + ]; + + return ( +
+ + { + getSearchs(form, condition, 2) + } + 若此员工数据已存在在同期列表中,则当前数据保存后会覆盖列表数据 +
+ ); + } +} + +export default AddItems; + +export const Browser = payload => { + const { label, onChange, viewAttr = 3 } = payload; + return ( + + + + ); +}; +export const InputCus = payload => { + const { label, onChange, value, viewAttr = 3 } = payload; + return ( + + + + ); +}; +export const Tips = payload => { + const { children } = payload; + return ( +
+
小提示
+
{children}
+
+ ); +}; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js index df2c591c..fed2a7cb 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js @@ -1,148 +1,220 @@ export const columns = [ - { - title: "姓名", - dataIndex: 'title', - key: 'title', - }, - { - title: "个税扣缴义务人", - dataIndex: 'title', - key: 'title', - }, - { - title: "部门", - dataIndex: 'title', - key: 'title', - }, - { - title: "手机号", - dataIndex: 'title', - key: 'title', - }, - { - title: "工号", - dataIndex: 'title', - key: 'title', - }, - { - title: "证件号码", - dataIndex: 'title', - key: 'title', - }, - { - title: "入职日期", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计子女教育", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计继续教育", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计住房贷款利息", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计住房租金", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计赡养老人", - dataIndex: 'title', - key: 'title', - }, - { - title: "操作", - dataIndex: 'title', - key: 'title', - } -] + { + title: "姓名", + dataIndex: "title", + key: "title" + }, + { + title: "个税扣缴义务人", + dataIndex: "title", + key: "title" + }, + { + title: "部门", + dataIndex: "title", + key: "title" + }, + { + title: "手机号", + dataIndex: "title", + key: "title" + }, + { + title: "工号", + dataIndex: "title", + key: "title" + }, + { + title: "证件号码", + dataIndex: "title", + key: "title" + }, + { + title: "入职日期", + dataIndex: "title", + key: "title" + }, + { + title: "累计子女教育", + dataIndex: "title", + key: "title" + }, + { + title: "累计继续教育", + dataIndex: "title", + key: "title" + }, + { + title: "累计住房贷款利息", + dataIndex: "title", + key: "title" + }, + { + title: "累计住房租金", + dataIndex: "title", + key: "title" + }, + { + title: "累计赡养老人", + dataIndex: "title", + key: "title" + }, + { + title: "操作", + dataIndex: "title", + key: "title" + } +]; export const modalColumns = [ - { - title: "姓名", - dataIndex: 'username', - key: 'username', - }, - { - title: "个税扣缴义务人", - dataIndex: 'taxAgentName', - key: 'taxAgentName', - }, - { - title: "部门", - dataIndex: 'departmentName', - key: 'departmentName', - }, - { - title: "手机号", - dataIndex: 'mobile', - key: 'mobile', - }, - { - title: "工号", - dataIndex: 'jobNum', - key: 'jobNum', - }, - { - title: "证件号码", - dataIndex: 'idNo', - key: 'idNo', - }, - { - title: "入职日期", - dataIndex: 'hiredate', - key: 'hiredate', - }, - { - title: "累计子女教育", - dataIndex: 'addUpChildEducation', - key: 'addUpChildEducation', - }, - { - title: "累计继续教育", - dataIndex: 'addUpContinuingEducation', - key: 'addUpContinuingEducation', - }, - { - title: "累计住房贷款利息", - dataIndex: 'addUpHousingLoanInterest', - key: 'addUpHousingLoanInterest', - }, - { - title: "累计住房租金", - dataIndex: 'addUpHousingRent', - key: 'addUpHousingRent', - }, - { - title: "累计赡养老人", - dataIndex: 'addUpSupportElderly', - key: 'addUpSupportElderly', - }, - { - title: "累计婴幼儿照护", - dataIndex: 'addUpInfantCare', - key: 'addUpInfantCare', - }, - { - title: "累计大病医疗", - dataIndex: 'addUpIllnessMedical', - key: 'addUpIllnessMedical' - } -] + { + title: "姓名", + dataIndex: "username", + key: "username" + }, + { + title: "个税扣缴义务人", + dataIndex: "taxAgentName", + key: "taxAgentName" + }, + { + title: "部门", + dataIndex: "departmentName", + key: "departmentName" + }, + { + title: "手机号", + dataIndex: "mobile", + key: "mobile" + }, + { + title: "工号", + dataIndex: "jobNum", + key: "jobNum" + }, + { + title: "证件号码", + dataIndex: "idNo", + key: "idNo" + }, + { + title: "入职日期", + dataIndex: "hiredate", + key: "hiredate" + }, + { + title: "累计子女教育", + dataIndex: "addUpChildEducation", + key: "addUpChildEducation" + }, + { + title: "累计继续教育", + dataIndex: "addUpContinuingEducation", + key: "addUpContinuingEducation" + }, + { + title: "累计住房贷款利息", + dataIndex: "addUpHousingLoanInterest", + key: "addUpHousingLoanInterest" + }, + { + title: "累计住房租金", + dataIndex: "addUpHousingRent", + key: "addUpHousingRent" + }, + { + title: "累计赡养老人", + dataIndex: "addUpSupportElderly", + key: "addUpSupportElderly" + }, + { + title: "累计婴幼儿照护", + dataIndex: "addUpInfantCare", + key: "addUpInfantCare" + }, + { + title: "累计大病医疗", + dataIndex: "addUpIllnessMedical", + key: "addUpIllnessMedical" + } +]; export const dataSource = []; +export const dataCollectCondition = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["addUpChildEducation"], + fieldcol: 14, + label: "累计子女教育", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpContinuingEducation"], + fieldcol: 14, + label: "累计继续教育", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpHousingLoanInterest"], + fieldcol: 14, + label: "累计住房贷款利息", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpHousingRent"], + fieldcol: 14, + label: "累计住房租金", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpSupportElderly"], + fieldcol: 14, + label: "累计赡养老人", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpIllnessMedical"], + fieldcol: 14, + label: "累计大病医疗", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpInfantCare"], + fieldcol: 14, + label: "累计婴幼儿照护", + labelcol: 8, + value: "", + viewAttr: 2 + } + ], + title: '数据采集', + defaultshow: true + } +]; + diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js similarity index 100% rename from pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/editSlideContent.js rename to pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/editSlideContent.less b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.less similarity index 100% rename from pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/editSlideContent.less rename to pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.less diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index de9baa19..95631d17 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -1,17 +1,18 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; -import { Button, Col, Dropdown, Menu, message, Row } from "antd"; +import { Button, Col, Dropdown, Menu, message, Modal, Row } from "antd"; import { WeaDatePicker, WeaHelpfulTip, WeaRightMenu, WeaSelect, WeaSlideModal, WeaTab, WeaTable, WeaTop } from "ecCom"; import moment from "moment"; -import { getSearchs, renderNoright } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 +import { getSearchs, renderLoading } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import ImportModal from "../../../components/importModal"; -import { modalColumns } from "./columns"; +import { dataCollectCondition, modalColumns } from "./columns"; import { optionAddAll } from "../../../util/options"; +import SlideModalTitle from "../../../components/slideModalTitle"; +import EditSlideContent from "./components/editSlideContent"; +import AddItems from "../addItems"; import "./index.less"; -import SlideModalTitle from "../../../components/slideModalTitle"; -import EditSlideContent from "./editSlideContent"; @inject("cumDeductStore", "taxAgentStore") @observer @@ -19,6 +20,7 @@ export default class CumDeduct extends React.Component { constructor(props) { super(props); this.state = { + addVisible: false, value: "", selectedKey: [], slideSelectedKey: [], //详情表格的选中项 @@ -37,9 +39,10 @@ export default class CumDeduct extends React.Component { componentWillMount() { // 初始化渲染页面 const { - cumDeductStore: { doInit }, + cumDeductStore: { doInit, addForm }, taxAgentStore: { fetchTaxAgentOption, getTaxAgentSelectListAsAdmin } } = this.props; + addForm.initFormFields(dataCollectCondition); doInit({ declareMonth: [this.state.monthValue], taxAgentId: "" }); getTaxAgentSelectListAsAdmin(); fetchTaxAgentOption().then((res) => { @@ -264,14 +267,14 @@ export default class CumDeduct extends React.Component { } render() { - const { modalParam, slideSelectedKey, monthValue, taxAgentId } = this.state; + const { modalParam, slideSelectedKey, monthValue, taxAgentId, addVisible } = this.state; const { cumDeductStore, taxAgentStore } = this.props; const { loading, dataSource, columns, pageObj, - hasRight, + addForm, form, condition, tableStore, @@ -298,10 +301,6 @@ export default class CumDeduct extends React.Component { const selectedRowKeys = toJS(tableStore.selectedRowKeys) || []; const detailSelectedRowKeys = toJS(slideTableStore.selectedRowKeys) || []; - if (!hasRight && !loading) { - // 无权限处理 - return renderNoright(); - } const rightMenu = [ // 右键菜单 @@ -335,14 +334,8 @@ export default class CumDeduct extends React.Component { }; const handleButtonClick = () => { - // const { - // cumDeductStore: { exportCumDeductList }, - // } = this.props; - // exportCumDeductList(); - const { selectedKey } = this.state; const url = `${window.location - .origin}/api/bs/hrmsalary/addUpDeduction/export?ids=&declareMonth=${this.state.monthValue}&taxAgentId=${this.state - .taxAgentId == "All" + .origin}/api/bs/hrmsalary/addUpDeduction/export?ids=&declareMonth=${this.state.monthValue}&taxAgentId=${this.state.taxAgentId == "All" ? "" : this.state.taxAgentId}`; window.open(url, "_self"); @@ -356,15 +349,10 @@ export default class CumDeduct extends React.Component { const url = `${window.location .origin}/api/bs/hrmsalary/addUpDeduction/export?ids=${this.state.selectedKey.join( "," - )}&declareMonth=${this.state.monthValue}&taxAgentId=${this.state - .taxAgentId == "All" + )}&declareMonth=${this.state.monthValue}&taxAgentId=${this.state.taxAgentId == "All" ? "" : this.state.taxAgentId}`; window.open(url, "_self"); - // const { - // cumDeductStore: { exportCumDeductList }, - // } = this.props; - // exportCumDeductList(this.state.selectedKey.join(",")); }; const handleBtnImport = () => { @@ -392,6 +380,25 @@ export default class CumDeduct extends React.Component { } type="ghost"> 导出全部 + , + , + + 删除所选 + + } + type="ghost"> + 一键清空 ]; @@ -497,7 +504,9 @@ export default class CumDeduct extends React.Component { return { ...item, width: 150 }; } }); - + if (_.isEmpty(newColumns)) { + return renderLoading(); + } return (
+ buttons={showOperateBtn ? btns : []} + >
setShowSearchAd(bool)} //高级搜索面板受控 searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据 @@ -573,37 +583,59 @@ export default class CumDeduct extends React.Component { /> )} - {slideVisiable && ( + {(slideVisiable || addVisible) && ( { - this.state.currentOperate == "add" ? doSave() : doUpdate(); + const { baseInfo } = this.addItemRef.state; + const bool = _.every(baseInfo, v => !_.isEmpty(v)); + if (!bool) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + console.log(baseInfo); }} - editable={false} + editable={!!addVisible} showOperateBtn={showOperateBtn} - customOperate={showOperateBtn ? renderBtns() : []} + customOperate={(showOperateBtn && !addVisible) ? renderBtns() : []} /> } content={ - - this.setState({ slideSelectedKey: val }) - } - /> + addVisible ? + this.addItemRef = dom} taxAgentOption={taxAgentOption} form={addForm} + condition={dataCollectCondition}/> : + + this.setState({ slideSelectedKey: val }) + } + /> } - onClose={() => setSlideVisiable(false)} + onClose={() => { + setSlideVisiable(false); + this.setState({ + addVisible: false + }); + }} showMask={true} - closeMaskOnClick={() => setSlideVisiable(false)} + closeMaskOnClick={() => { + setSlideVisiable(false); + this.setState({ + addVisible: false + }); + }} /> )}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js index 4fe10b63..93f13900 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js @@ -1,194 +1,293 @@ export const columns = [ - { - title: "姓名", - dataIndex: 'title', - key: 'title', - }, - { - title: "个税扣缴义务人", - dataIndex: 'title', - key: 'title', - }, - { - title: "部门", - dataIndex: 'title', - key: 'title', - }, - { - title: "手机号", - dataIndex: 'title', - key: 'title', - }, - { - title: "工号", - dataIndex: 'title', - key: 'title', - }, - { - title: "证件号码", - dataIndex: 'title', - key: 'title', - }, - { - title: "入职日期", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计子女教育", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计继续教育", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计住房贷款利息", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计住房租金", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计赡养老人", - dataIndex: 'title', - key: 'title', - }, - { - title: "操作", - dataIndex: 'title', - key: 'title', - } -] + { + title: "姓名", + dataIndex: "title", + key: "title" + }, + { + title: "个税扣缴义务人", + dataIndex: "title", + key: "title" + }, + { + title: "部门", + dataIndex: "title", + key: "title" + }, + { + title: "手机号", + dataIndex: "title", + key: "title" + }, + { + title: "工号", + dataIndex: "title", + key: "title" + }, + { + title: "证件号码", + dataIndex: "title", + key: "title" + }, + { + title: "入职日期", + dataIndex: "title", + key: "title" + }, + { + title: "累计子女教育", + dataIndex: "title", + key: "title" + }, + { + title: "累计继续教育", + dataIndex: "title", + key: "title" + }, + { + title: "累计住房贷款利息", + dataIndex: "title", + key: "title" + }, + { + title: "累计住房租金", + dataIndex: "title", + key: "title" + }, + { + title: "累计赡养老人", + dataIndex: "title", + key: "title" + }, + { + title: "操作", + dataIndex: "title", + key: "title" + } +]; export const modalColumns = [ - { - title: "姓名", - dataIndex: 'username', - key: 'username', - }, - { - title: "个税扣缴义务人", - dataIndex: 'taxAgentName', - key: 'taxAgentName', - }, - { - title: "部门", - dataIndex: 'departmentName', - key: 'departmentName', - }, - { - title: "手机号", - dataIndex: 'mobile', - key: 'mobile', - }, - { - title: "工号", - dataIndex: 'jobNum', - key: 'jobNum', - }, - { - title: "证件号码", - dataIndex: 'idNo', - key: 'idNo', - }, - { - title: "入职日期", - dataIndex: 'hiredate', - key: 'hiredate', - }, - { - title: "累计收入额", - dataIndex: 'addUpIncome', - key: 'addUpIncome', - }, - { - title: "累计减除费用", - dataIndex: 'addUpSubtraction', - key: 'addUpSubtraction', - }, - { - title: "累计社保个人合计", - dataIndex: 'addUpSocialSecurityTotal', - key: 'addUpSocialSecurityTotal', - }, - { - title: "累计公积金个人合计", - dataIndex: 'addUpAccumulationFundTotal', - key: 'addUpAccumulationFundTotal', - }, - { - title: "累计子女教育", - dataIndex: 'addUpChildEducation', - key: 'addUpChildEducation', - }, - { - title: "累计继续教育", - dataIndex: 'addUpContinuingEducation', - key: 'addUpContinuingEducation', - }, - { - title: "累计住房贷款利息", - dataIndex: 'addUpHousingLoanInterest', - key: 'addUpHousingLoanInterest', - }, - { - title: "累计住房租金", - dataIndex: 'addUpHousingRent', - key: 'addUpHousingRent', - }, - { - title: "累计赡养老人", - dataIndex: 'addUpSupportElderly', - key: 'addUpSupportElderly', - }, - { - title: "累计企业(职业)年金及其他福利", - dataIndex: 'addUpEnterpriseAndOther', - key: 'addUpEnterpriseAndOther', - }, - { - title: "累计其他免税扣除", - dataIndex: 'addUpOtherDeduction', - key: 'addUpOtherDeduction', - }, - { - title: "累计免税收入", - dataIndex: 'addUpTaxExemptIncome', - key: 'addUpTaxExemptIncome', - }, - { - title: "累计准予扣除的捐赠额", - dataIndex: 'addUpAllowedDonation', - key: 'addUpAllowedDonation', - }, - { - title: "累计减免税额", - dataIndex: 'addUpTaxSavings', - key: 'addUpTaxSavings', - }, - { - title: "累计已预扣预缴税额", - dataIndex: 'addUpAdvanceTax', - key: 'addUpAdvanceTax', - }, - { - title: "累计婴幼儿照护", - dataIndex: 'addUpInfantCare', - key: 'addUpInfantCare', - }, - { - title: "累计大病医疗", - dataIndex: 'addUpIllnessMedical', - key: 'addUpIllnessMedical', - } + { + title: "姓名", + dataIndex: "username", + key: "username" + }, + { + title: "个税扣缴义务人", + dataIndex: "taxAgentName", + key: "taxAgentName" + }, + { + title: "部门", + dataIndex: "departmentName", + key: "departmentName" + }, + { + title: "手机号", + dataIndex: "mobile", + key: "mobile" + }, + { + title: "工号", + dataIndex: "jobNum", + key: "jobNum" + }, + { + title: "证件号码", + dataIndex: "idNo", + key: "idNo" + }, + { + title: "入职日期", + dataIndex: "hiredate", + key: "hiredate" + }, + { + title: "累计收入额", + dataIndex: "addUpIncome", + key: "addUpIncome" + }, + { + title: "累计减除费用", + dataIndex: "addUpSubtraction", + key: "addUpSubtraction" + }, + { + title: "累计社保个人合计", + dataIndex: "addUpSocialSecurityTotal", + key: "addUpSocialSecurityTotal" + }, + { + title: "累计公积金个人合计", + dataIndex: "addUpAccumulationFundTotal", + key: "addUpAccumulationFundTotal" + }, + { + title: "累计子女教育", + dataIndex: "addUpChildEducation", + key: "addUpChildEducation" + }, + { + title: "累计继续教育", + dataIndex: "addUpContinuingEducation", + key: "addUpContinuingEducation" + }, + { + title: "累计住房贷款利息", + dataIndex: "addUpHousingLoanInterest", + key: "addUpHousingLoanInterest" + }, + { + title: "累计住房租金", + dataIndex: "addUpHousingRent", + key: "addUpHousingRent" + }, + { + title: "累计赡养老人", + dataIndex: "addUpSupportElderly", + key: "addUpSupportElderly" + }, + { + title: "累计企业(职业)年金及其他福利", + dataIndex: "addUpEnterpriseAndOther", + key: "addUpEnterpriseAndOther" + }, + { + title: "累计其他免税扣除", + dataIndex: "addUpOtherDeduction", + key: "addUpOtherDeduction" + }, + { + title: "累计免税收入", + dataIndex: "addUpTaxExemptIncome", + key: "addUpTaxExemptIncome" + }, + { + title: "累计准予扣除的捐赠额", + dataIndex: "addUpAllowedDonation", + key: "addUpAllowedDonation" + }, + { + title: "累计减免税额", + dataIndex: "addUpTaxSavings", + key: "addUpTaxSavings" + }, + { + title: "累计已预扣预缴税额", + dataIndex: "addUpAdvanceTax", + key: "addUpAdvanceTax" + }, + { + title: "累计婴幼儿照护", + dataIndex: "addUpInfantCare", + key: "addUpInfantCare" + }, + { + title: "累计大病医疗", + dataIndex: "addUpIllnessMedical", + key: "addUpIllnessMedical" + } -] +]; export const dataSource = []; + +export const dataCollectCondition = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["addUpIncome"], + fieldcol: 14, + label: "累计收入额", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpSubtraction"], + fieldcol: 14, + label: "累计减除费用", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpSocialSecurityTotal"], + fieldcol: 14, + label: "累计社保个人合计", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpAccumulationFundTotal"], + fieldcol: 14, + label: "累计公积金个人合计", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpEnterpriseAndOther"], + fieldcol: 14, + label: "累计企业(职业)年金及其他福利", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpOtherDeduction"], + fieldcol: 14, + label: "累计其他免税扣除", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpTaxExemptIncome"], + fieldcol: 14, + label: "累计免税收入", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpAllowedDonation"], + fieldcol: 14, + label: "累计准予扣除的捐赠额", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpTaxSavings"], + fieldcol: 14, + label: "累计减免税额", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpAdvanceTax"], + fieldcol: 14, + label: "累计已预扣预缴税额", + labelcol: 8, + value: "", + viewAttr: 2 + }, + ], + title: "数据采集", + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index d324b500..26f64f75 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -1,17 +1,17 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; -import { Button, Col, Dropdown, Menu, message, Row } from "antd"; +import { Button, Col, Dropdown, Menu, message, Modal, Row } from "antd"; import { WeaDatePicker, WeaHelpfulTip, WeaRightMenu, WeaSelect, WeaSlideModal, WeaTab, WeaTable, WeaTop } from "ecCom"; import moment from "moment"; -import { getSearchs, renderNoright } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 +import { getSearchs, renderLoading } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import ImportModal from "../../../components/importModal"; -import { modalColumns } from "./columns"; +import { dataCollectCondition, modalColumns } from "./columns"; import { optionAddAll } from "../../../util/options"; -import "./index.less"; - import SlideModalTitle from "../../../components/slideModalTitle"; import EditSlideContent from "./editSlideContent"; +import AddItems from "../addItems"; +import "./index.less"; @inject("cumSituationStore", "taxAgentStore") @@ -20,6 +20,7 @@ export default class CumSituation extends React.Component { constructor(props) { super(props); this.state = { + addVisible: false, value: "", selectedKey: [], slideSelectedKey: [], //详情表格的选中项 @@ -36,9 +37,10 @@ export default class CumSituation extends React.Component { componentWillMount() { // 初始化渲染页面 const { - cumSituationStore: { doInit }, + cumSituationStore: { doInit, addForm }, taxAgentStore: { fetchTaxAgentOption } } = this.props; + addForm.initFormFields(dataCollectCondition); doInit({ year: this.state.monthValue, taxAgentId: "" }); fetchTaxAgentOption().then(() => { this.setState({ @@ -242,7 +244,7 @@ export default class CumSituation extends React.Component { render() { const { cumSituationStore, taxAgentStore } = this.props; - const { slideSelectedKey } = this.state; + const { slideSelectedKey, addVisible } = this.state; const { loading, dataSource, @@ -250,6 +252,7 @@ export default class CumSituation extends React.Component { pageObj, hasRight, form, + addForm, condition, tableStore, showSearchAd, @@ -275,11 +278,6 @@ export default class CumSituation extends React.Component { const selectedRowKeys = toJS(tableStore.selectedRowKeys) || []; const { modalParam, monthValue, taxAgentId } = this.state; const detailSelectedRowKeys = toJS(slideTableStore.selectedRowKeys) || []; - if (!hasRight && !loading) { - // 无权限处理 - return renderNoright(); - } - const rightMenu = [ // 右键菜单 // { @@ -373,6 +371,25 @@ export default class CumSituation extends React.Component { } type="ghost"> 导出全部 + , + , + + 删除所选 + + } + type="ghost"> + 一键清空 ]; @@ -476,13 +493,15 @@ export default class CumSituation extends React.Component { return { ...item, width: 150 }; } }); - + if (_.isEmpty(newColumns)) { + return renderLoading(); + } return (
} // 左侧图标 + icon={} // 左侧图标 iconBgcolor="#F14A2D" // 左侧图标背景色 showDropIcon={false} // 是否显示下拉按钮 dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同) @@ -542,36 +561,62 @@ export default class CumSituation extends React.Component { this.handleCancel(); }} />} - {slideVisiable && + {(slideVisiable || addVisible) && { - this.state.currentOperate == "add" ? doSave() : doUpdate(); + const { baseInfo } = this.addItemRef.state; + const bool = _.every(baseInfo, v => !_.isEmpty(v)); + if (!bool) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + console.log(baseInfo); }} - editable={false} + editable={!!addVisible} showOperateBtn={showOperateBtn} - customOperate={showOperateBtn ? renderBtns() : []} + customOperate={(showOperateBtn && !addVisible) ? renderBtns() : []} /> } content={ - - this.setState({ slideSelectedKey: val })} - /> + addVisible ? + this.addItemRef = dom} + taxAgentOption={taxAgentOption} + form={addForm} + isCum + condition={dataCollectCondition}/> : + + this.setState({ slideSelectedKey: val })} + /> } - onClose={() => setSlideVisiable(false)} + onClose={() => { + setSlideVisiable(false); + this.setState({ + addVisible: false + }); + }} showMask={true} - closeMaskOnClick={() => setSlideVisiable(false)} + closeMaskOnClick={() => { + setSlideVisiable(false); + this.setState({ + addVisible: false + }); + }} />}
); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/index.less new file mode 100644 index 00000000..fab55464 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/index.less @@ -0,0 +1,21 @@ +.tipWrapper{ + display: flex; + flex-direction: column; + margin: 0 25px; + border: 1px solid #e5e5e5; + .title{ + border-bottom: 1px solid #e5e5e5; + height: 40px; + line-height: 40px; + padding-left: 16px; + background: #f6f6f6; + font-size: 14px; + } + .content{ + width: 100%; + display: flex; + flex-direction: column; + padding: 10px 16px; + color: #999; + } +} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js index e8eb6995..2d1dfb19 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js @@ -1,132 +1,177 @@ export const columns = [ - { - title: "姓名", - dataIndex: 'title', - key: 'title', - }, - { - title: "个税扣缴义务人", - dataIndex: 'title', - key: 'title', - }, - { - title: "部门", - dataIndex: 'title', - key: 'title', - }, - { - title: "手机号", - dataIndex: 'title', - key: 'title', - }, - { - title: "工号", - dataIndex: 'title', - key: 'title', - }, - { - title: "证件号码", - dataIndex: 'title', - key: 'title', - }, - { - title: "入职日期", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计子女教育", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计继续教育", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计住房贷款利息", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计住房租金", - dataIndex: 'title', - key: 'title', - }, - { - title: "累计赡养老人", - dataIndex: 'title', - key: 'title', - }, - { - title: "操作", - dataIndex: 'title', - key: 'title', - } -] + { + title: "姓名", + dataIndex: "title", + key: "title" + }, + { + title: "个税扣缴义务人", + dataIndex: "title", + key: "title" + }, + { + title: "部门", + dataIndex: "title", + key: "title" + }, + { + title: "手机号", + dataIndex: "title", + key: "title" + }, + { + title: "工号", + dataIndex: "title", + key: "title" + }, + { + title: "证件号码", + dataIndex: "title", + key: "title" + }, + { + title: "入职日期", + dataIndex: "title", + key: "title" + }, + { + title: "累计子女教育", + dataIndex: "title", + key: "title" + }, + { + title: "累计继续教育", + dataIndex: "title", + key: "title" + }, + { + title: "累计住房贷款利息", + dataIndex: "title", + key: "title" + }, + { + title: "累计住房租金", + dataIndex: "title", + key: "title" + }, + { + title: "累计赡养老人", + dataIndex: "title", + key: "title" + }, + { + title: "操作", + dataIndex: "title", + key: "title" + } +]; export const modalColumns = [ - { - title: "姓名", - dataIndex: 'username', - key: 'username', - }, - { - title: "个税扣缴义务人", - dataIndex: 'taxAgentName', - key: 'taxAgentName', - }, - { - title: "部门", - dataIndex: 'departmentName', - key: 'departmentName', - }, - { - title: "手机号", - dataIndex: 'mobile', - key: 'mobile', - }, - { - title: "工号", - dataIndex: 'jobNum', - key: 'jobNum', - }, - { - title: "证件号码", - dataIndex: 'idNo', - key: 'idNo', - }, - { - title: "入职日期", - dataIndex: 'hiredate', - key: 'hiredate', - }, - { - title: "商业健康保险", - dataIndex: 'businessHealthyInsurance', - key: 'businessHealthyInsurance', - }, - { - title: "税延养老保险", - dataIndex: 'taxDelayEndowmentInsurance', - key: 'taxDelayEndowmentInsurance', - }, - { - title: "其他", - dataIndex: 'otherDeduction', - key: 'otherDeduction', - }, - { - title: "准予扣除的捐赠额", - dataIndex: 'deductionAllowedDonation', - key: 'deductionAllowedDonation', - } -] + { + title: "姓名", + dataIndex: "username", + key: "username" + }, + { + title: "个税扣缴义务人", + dataIndex: "taxAgentName", + key: "taxAgentName" + }, + { + title: "部门", + dataIndex: "departmentName", + key: "departmentName" + }, + { + title: "手机号", + dataIndex: "mobile", + key: "mobile" + }, + { + title: "工号", + dataIndex: "jobNum", + key: "jobNum" + }, + { + title: "证件号码", + dataIndex: "idNo", + key: "idNo" + }, + { + title: "入职日期", + dataIndex: "hiredate", + key: "hiredate" + }, + { + title: "商业健康保险", + dataIndex: "businessHealthyInsurance", + key: "businessHealthyInsurance" + }, + { + title: "税延养老保险", + dataIndex: "taxDelayEndowmentInsurance", + key: "taxDelayEndowmentInsurance" + }, + { + title: "其他", + dataIndex: "otherDeduction", + key: "otherDeduction" + }, + { + title: "准予扣除的捐赠额", + dataIndex: "deductionAllowedDonation", + key: "deductionAllowedDonation" + } +]; export const dataSource = []; +export const dataCollectCondition = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["businessHealthyInsurance"], + fieldcol: 14, + label: "商业健康保险", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["taxDelayEndowmentInsurance"], + fieldcol: 14, + label: "税延养老保险", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["otherDeduction"], + fieldcol: 14, + label: "其他", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["deductionAllowedDonation"], + fieldcol: 14, + label: "准予扣除的捐赠额", + labelcol: 8, + value: "", + viewAttr: 2 + } + ], + title: "数据采集", + defaultshow: true + } +]; + diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index 4a191171..c5aeb54d 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -1,17 +1,17 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; -import { Button, Col, Dropdown, Menu, message, Row } from "antd"; +import { Button, Col, Dropdown, Menu, message, Modal, Row } from "antd"; import { WeaDatePicker, WeaHelpfulTip, WeaRightMenu, WeaSelect, WeaSlideModal, WeaTab, WeaTable, WeaTop } from "ecCom"; import moment from "moment"; -import { getSearchs, renderNoright } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 +import { getSearchs, renderLoading } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import ImportModal from "../../../components/importModal"; -import { modalColumns } from "./columns"; -import "./index.less"; - +import { dataCollectCondition, modalColumns } from "./columns"; +import AddItems from "../addItems"; import SlideModalTitle from "../../../components/slideModalTitle"; import EditSlideContent from "./editSlideContent"; import { optionAddAll } from "../../../util/options"; +import "./index.less"; @inject("otherDeductStore", "taxAgentStore") @@ -20,6 +20,7 @@ export default class OtherDeduct extends React.Component { constructor(props) { super(props); this.state = { + addVisible: false, value: "", selectedKey: [], slideSelectedKey: [], //详情表格的选中项 @@ -36,9 +37,10 @@ export default class OtherDeduct extends React.Component { componentWillMount() { // 初始化渲染页面 const { - otherDeductStore: { doInit }, + otherDeductStore: { doInit, addForm }, taxAgentStore: { fetchTaxAgentOption } } = this.props; + addForm.initFormFields(dataCollectCondition); doInit({ declareMonth: [this.state.monthValue], taxAgentId: "" }); fetchTaxAgentOption().then(() => { this.setState({ @@ -251,7 +253,8 @@ export default class OtherDeduct extends React.Component { doSearch, setShowSearchAd, previewImport, - importFile + importFile, + addForm } = otherDeductStore; const { taxAgentOption, showOperateBtn } = taxAgentStore; const { @@ -267,13 +270,9 @@ export default class OtherDeduct extends React.Component { setPageObj } = otherDeductStore; const selectedRowKeys = toJS(tableStore.selectedRowKeys) || []; - const { modalParam, monthValue, taxAgentId, slideSelectedKey } = this.state; + const { modalParam, monthValue, taxAgentId, slideSelectedKey, addVisible } = this.state; const detailSelectedRowKeys = toJS(slideTableStore.selectedRowKeys) || []; - if (!hasRight && !loading) { - // 无权限处理 - return renderNoright(); - } const rightMenu = [ // 右键菜单 @@ -364,6 +363,25 @@ export default class OtherDeduct extends React.Component { } type="ghost"> 导出全部 + , + , + + 删除所选 + + } + type="ghost"> + 一键清空 ]; @@ -468,6 +486,9 @@ export default class OtherDeduct extends React.Component { return { ...item }; } }); + if (_.isEmpty(newColumns)) { + return renderLoading(); + } return (
@@ -538,36 +559,58 @@ export default class OtherDeduct extends React.Component { this.handleCancel(); }} />} - {slideVisiable && + {(slideVisiable || addVisible) && { - this.state.currentOperate == "add" ? doSave() : doUpdate(); + const { baseInfo } = this.addItemRef.state; + const bool = _.every(baseInfo, v => !_.isEmpty(v)); + if (!bool) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + console.log(baseInfo); }} - editable={false} + editable={!!addVisible} showOperateBtn={showOperateBtn} - customOperate={showOperateBtn ? renderBtns() : []} + customOperate={(showOperateBtn && !addVisible) ? renderBtns() : []} /> } content={ - - this.setState({ slideSelectedKey: val })} - /> + addVisible ? + this.addItemRef = dom} taxAgentOption={taxAgentOption} form={addForm} + condition={dataCollectCondition}/> : + + this.setState({ slideSelectedKey: val })} + /> } - onClose={() => setSlideVisiable(false)} + onClose={() => { + setSlideVisiable(false); + this.setState({ + addVisible: false + }); + }} showMask={true} - closeMaskOnClick={() => setSlideVisiable(false)} + closeMaskOnClick={() => { + setSlideVisiable(false); + this.setState({ + addVisible: false + }); + }} />}
); diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.js b/pc4mobx/hrmSalary/pages/ruleConfig/index.js index 301fe673..bafd5e0f 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.js @@ -277,11 +277,11 @@ class Index extends Component { export default Index; -const Select = payload => { - const { label, onChange, value, options = [] } = payload; +export const Select = payload => { + const { label, onChange, value, options = [], viewAttr=3 } = payload; return ( - onChange({ type: label, selected })}/> ); diff --git a/pc4mobx/hrmSalary/stores/cumDeduct.js b/pc4mobx/hrmSalary/stores/cumDeduct.js index 6efa21bd..b276dd0b 100644 --- a/pc4mobx/hrmSalary/stores/cumDeduct.js +++ b/pc4mobx/hrmSalary/stores/cumDeduct.js @@ -10,7 +10,8 @@ const { TableStore } = WeaTableNew; export class CumDeductStore { @observable tableStore = new TableStore(); // new table @observable slideTableStore = new TableStore(); - @observable form = new WeaForm(); // nrew 一个form + @observable form = new WeaForm(); // new 一个form + @observable addForm = new WeaForm(); // 新增form @observable condition = []; // 存储后台得到的form数据 @observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据 @observable showSearchAd = false; // 高级搜索面板显示 diff --git a/pc4mobx/hrmSalary/stores/cumSituation.js b/pc4mobx/hrmSalary/stores/cumSituation.js index 57bfbc50..082c6d3b 100644 --- a/pc4mobx/hrmSalary/stores/cumSituation.js +++ b/pc4mobx/hrmSalary/stores/cumSituation.js @@ -10,7 +10,8 @@ const { TableStore } = WeaTableNew; export class CumSituationStore { @observable tableStore = new TableStore(); // new table @observable slideTableStore = new TableStore(); - @observable form = new WeaForm(); // nrew 一个form + @observable form = new WeaForm(); // new 一个form + @observable addForm = new WeaForm(); // 新增form @observable condition = []; // 存储后台得到的form数据 @observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据 @observable showSearchAd = false; // 高级搜索面板显示 diff --git a/pc4mobx/hrmSalary/stores/otherDeduct.js b/pc4mobx/hrmSalary/stores/otherDeduct.js index b922e168..91457537 100644 --- a/pc4mobx/hrmSalary/stores/otherDeduct.js +++ b/pc4mobx/hrmSalary/stores/otherDeduct.js @@ -11,7 +11,8 @@ const { TableStore } = WeaTableNew; export class OtherDeductStore { @observable tableStore = new TableStore(); // new table @observable slideTableStore = new TableStore(); - @observable form = new WeaForm(); // nrew 一个form + @observable form = new WeaForm(); // new 一个form + @observable addForm = new WeaForm(); // 新增form @observable condition = []; // 存储后台得到的form数据 @observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据 @observable showSearchAd = false; // 高级搜索面板显示 From 8008c0855aafb5c6731a8867de64df646641b2a4 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Mon, 31 Oct 2022 13:55:49 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?= =?UTF-8?q?=E6=8E=A5=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/cumDeduct.js | 19 ++ pc4mobx/hrmSalary/apis/cumSituation.js | 17 ++ pc4mobx/hrmSalary/apis/otherDeduct.js | 18 ++ .../pages/dataAcquisition/addItems.js | 39 ++-- .../pages/dataAcquisition/cumDeduct/index.js | 169 ++++++++++++++-- .../dataAcquisition/cumDeduct/index.less | 49 +++-- .../dataAcquisition/cumSituation/index.js | 155 ++++++++++++++- .../dataAcquisition/cumSituation/index.less | 59 ++++-- .../dataAcquisition/otherDeduct/index.js | 180 +++++++++++++++--- .../dataAcquisition/otherDeduct/index.less | 51 +++-- pc4mobx/hrmSalary/pages/ruleConfig/index.js | 2 +- pc4mobx/hrmSalary/stores/otherDeduct.js | 1 - 12 files changed, 662 insertions(+), 97 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/cumDeduct.js b/pc4mobx/hrmSalary/apis/cumDeduct.js index ada3f3b9..f7a094e6 100644 --- a/pc4mobx/hrmSalary/apis/cumDeduct.js +++ b/pc4mobx/hrmSalary/apis/cumDeduct.js @@ -1,4 +1,5 @@ import { WeaTools } from "ecCom"; +import { postFetch } from '../util/request'; //数据采集-累计专项附加扣除列表 export const getCumDeductList = (params) => { @@ -100,3 +101,21 @@ export const importCumDeductPreview = (params) => { body: JSON.stringify(params), }).then((res) => res.json()); }; + + +//新增累计专项附加扣除 +export const createAddUpDeduction = (params) => { + return postFetch('/api/bs/hrmsalary/addUpDeduction/createAddUpDeduction', params); +} +//编辑累计专项附加扣除 +export const editAddUpDeduction = (params) => { + return postFetch('/api/bs/hrmsalary/addUpDeduction/editAddUpDeduction', params); +} +//批量删除累计专项附加扣除 +export const deleteSelectAddUpDeduction = (params) => { + return postFetch('/api/bs/hrmsalary/addUpDeduction/deleteSelectAddUpDeduction', params); +} +//一键清空累计专项附加扣除 +export const deleteAllAddUpDeduction = (params) => { + return postFetch('/api/bs/hrmsalary/addUpDeduction/deleteAllAddUpDeduction', params); +} diff --git a/pc4mobx/hrmSalary/apis/cumSituation.js b/pc4mobx/hrmSalary/apis/cumSituation.js index 237d81ac..d8f84017 100644 --- a/pc4mobx/hrmSalary/apis/cumSituation.js +++ b/pc4mobx/hrmSalary/apis/cumSituation.js @@ -1,4 +1,5 @@ import { WeaTools } from "ecCom"; +import { postFetch } from '../util/request'; //数据采集-累计情况列表 export const getCumSituationList = (params) => { @@ -100,3 +101,19 @@ export const importCumSituationPreview = (params) => { body: JSON.stringify(params), }).then((res) => res.json()); }; +//新建往期累计情况 +export const createAddUpSituation = (params) => { + return postFetch('/api/bs/hrmsalary/addUpSituation/createAddUpSituation', params); +} +//编辑往期累计情况 +export const editAddUpSituation = (params) => { + return postFetch('/api/bs/hrmsalary/addUpSituation/editAddUpSituation', params); +} +//删除所选往期累计情况 +export const deleteSelectAddUpSituation = (params) => { + return postFetch('/api/bs/hrmsalary/addUpSituation/deleteSelectAddUpSituation', params); +} +//一键清空往期累计情况 +export const deleteAllAddUpSituation = (params) => { + return postFetch('/api/bs/hrmsalary/addUpSituation/deleteAllAddUpSituation', params); +} diff --git a/pc4mobx/hrmSalary/apis/otherDeduct.js b/pc4mobx/hrmSalary/apis/otherDeduct.js index 972c641a..4b8fa0a9 100644 --- a/pc4mobx/hrmSalary/apis/otherDeduct.js +++ b/pc4mobx/hrmSalary/apis/otherDeduct.js @@ -1,4 +1,5 @@ import { WeaTools } from "ecCom"; +import { postFetch } from '../util/request'; //数据采集-其他免税扣除列表 export const getOtherDeductList = (params) => { @@ -105,3 +106,20 @@ export const importOtherDeductionPreview = (params) => { body: JSON.stringify(params), }).then((res) => res.json()); }; + +//新增其他免税扣除 +export const createData = (params) => { + return postFetch('/api/bs/hrmsalary/otherDeduction/createData', params); +} +//编辑其他免税扣除 +export const editData = (params) => { + return postFetch('/api/bs/hrmsalary/otherDeduction/editData', params); +} +//批量删除其他免税扣除 +export const deleteSelectData = (params) => { + return postFetch('/api/bs/hrmsalary/otherDeduction/deleteSelectData', params); +} +//一键清空其他免税扣除 +export const deleteAllData = (params) => { + return postFetch('/api/bs/hrmsalary/otherDeduction/deleteAllData', params); +} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js index bca10c14..a9ee5124 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js @@ -15,9 +15,10 @@ class AddItems extends Component { super(props); this.state = { baseInfo: { - taxablePeriod: "", - taxAgentor: "", - employee: "", + declareMonth: "", + taxAgentId: "", + taxAgentName: "", + employeeId: "", personArea: "", username: "", idcard: "" @@ -25,6 +26,10 @@ class AddItems extends Component { }; } + componentDidMount() { + console.log('123',this.props.editId); + } + render() { const { taxAgentOption = [], form, condition = [], isCum } = this.props; const { baseInfo } = this.state; @@ -36,9 +41,9 @@ class AddItems extends Component { labelCol: { span: 6 }, wrapperCol: { span: 18 }, format: "YYYY-MM", - value: baseInfo.taxablePeriod, + value: baseInfo.declareMonth, onChange: (data) => { - this.setState({ baseInfo: { ...baseInfo, taxablePeriod: data.date } }); + this.setState({ baseInfo: { ...baseInfo, declareMonth: data.date } }); } }) }, @@ -47,9 +52,9 @@ class AddItems extends Component { label: "个税扣缴义务人", viewAttr: 3, options: taxAgentOption, - value: baseInfo.taxAgentor, + value: baseInfo.taxAgentId, onChange: (data) => { - this.setState({ baseInfo: { ...baseInfo, taxAgentor: data.selected } }); + this.setState({ baseInfo: { ...baseInfo, taxAgentId: data.selected, taxAgentName: data.showName } }); } }) }, @@ -57,8 +62,8 @@ class AddItems extends Component { com: Browser({ label: "人员", viewAttr: 3, - onChange: (employee) => { - this.setState({ baseInfo: { ...baseInfo, employee } }); + onChange: (employeeId) => { + this.setState({ baseInfo: { ...baseInfo, employeeId } }); } }) } @@ -71,9 +76,9 @@ class AddItems extends Component { labelCol: { span: 6 }, wrapperCol: { span: 18 }, format: "YYYY-MM", - value: baseInfo.taxablePeriod, + value: baseInfo.declareMonth, onChange: (data) => { - this.setState({ baseInfo: { ...baseInfo, taxablePeriod: data.date } }); + this.setState({ baseInfo: { ...baseInfo, declareMonth: data.date } }); } }) }, @@ -82,9 +87,9 @@ class AddItems extends Component { label: "个税扣缴义务人", viewAttr: 3, options: taxAgentOption, - value: baseInfo.taxAgentor, + value: baseInfo.taxAgentId, onChange: (data) => { - this.setState({ baseInfo: { ...baseInfo, taxAgentor: data.selected } }); + this.setState({ baseInfo: { ...baseInfo, taxAgentId: data.selected, taxAgentName: data.showName } }); } }) }, @@ -93,7 +98,9 @@ class AddItems extends Component { label: "人员范围", viewAttr: 3, options: [ - { key: "ORGANIZATION", showname: "内部人员" }, { key: "EXT_EMPLOYEE", showname: "非系统人员" }], + { key: "ORGANIZATION", showname: "内部人员" }, + // { key: "EXT_EMPLOYEE", showname: "非系统人员" } + ], value: baseInfo.personArea, onChange: (data) => { this.setState({ baseInfo: { ...baseInfo, personArea: data.selected } }); @@ -105,8 +112,8 @@ class AddItems extends Component { com: Browser({ label: "人员", viewAttr: 3, - onChange: (employee) => { - this.setState({ baseInfo: { ...baseInfo, employee } }); + onChange: (employeeId) => { + this.setState({ baseInfo: { ...baseInfo, employeeId } }); } }) }]; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 95631d17..2b2ab785 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -1,7 +1,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; -import { Button, Col, Dropdown, Menu, message, Modal, Row } 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中 @@ -11,6 +11,7 @@ import { optionAddAll } from "../../../util/options"; import SlideModalTitle from "../../../components/slideModalTitle"; import EditSlideContent from "./components/editSlideContent"; import AddItems from "../addItems"; +import * as API from "../../../apis/cumDeduct"; import "./index.less"; @@ -21,6 +22,8 @@ export default class CumDeduct extends React.Component { super(props); this.state = { addVisible: false, + editId: "", + saveLoading: false, value: "", selectedKey: [], slideSelectedKey: [], //详情表格的选中项 @@ -253,7 +256,7 @@ export default class CumDeduct extends React.Component { }); }; - handleSearch() { + handleSearch = () => { const { cumDeductStore: { getTableDatas } } = this.props; const { monthValue, taxAgentId } = this.state; let params = {}; @@ -264,10 +267,123 @@ export default class CumDeduct extends React.Component { params.taxAgentId = taxAgentId; } getTableDatas(params); - } + }; + + //新功能 + createAddUpDeduction = (payload) => { + this.setState({ saveLoading: true }); + API.createAddUpDeduction(payload).then(({ status }) => { + this.setState({ saveLoading: false }); + if (status) { + message.success("新增成功"); + this.setState({ + addVisible: false + }, () => { + const { cumDeductStore: { doSearch, addForm } } = this.props; + const { monthValue, taxAgentId } = this.state; + doSearch({ + declareMonth: [monthValue], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + addForm.resetForm(); + }); + } else { + message.error("新增失败"); + } + }); + }; + deleteSelectAddUpDeduction = () => { + const { monthValue: declareMonth, taxAgentId, selectedKey } = this.state; + const { cumDeductStore: { doSearch } } = this.props; + if (selectedKey.length === 0) { + message.warning("未选择条目"); + return; + } + const payload = { + declareMonth, + ids: selectedKey + }; + Modal.confirm({ + title: "信息确认", + content: "确定删除所选数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。", + onOk: () => { + API.deleteSelectAddUpDeduction(payload).then(({ status }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error("删除失败"); + } + }); + }, + onCancel: () => { + } + }); + + }; + deleteAllAddUpDeduction = () => { + const { monthValue: declareMonth, taxAgentId } = this.state; + const { cumDeductStore: { doSearch } } = this.props; + const payload = { + declareMonth, + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }; + Modal.confirm({ + title: "信息确认", + content: `确定清空税款所属期为${declareMonth}的所有累计专项附加扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, + onOk: () => { + API.deleteAllAddUpDeduction(payload).then(({ status }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error("删除失败"); + } + }); + } + }); + }; + handleOperate = ({ key }, row) => { + const { monthValue: declareMonth, taxAgentId } = this.state; + const { cumDeductStore: { doSearch } } = this.props; + if (key === "edit") { + this.setState({ + addVisible: true, + editId: row.id + }); + } else if (key === "delete") { + const payload = { + declareMonth, + ids: [row.id] + }; + Modal.confirm({ + title: "信息确认", + content: `确定删除${row.departmentName}${row.username}(税款所属期:${declareMonth})的累计专项附加扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, + onOk: () => { + API.deleteSelectAddUpDeduction(payload).then(({ status }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error("删除失败"); + } + }); + } + }); + } + }; render() { - const { modalParam, slideSelectedKey, monthValue, taxAgentId, addVisible } = this.state; + const { modalParam, slideSelectedKey, monthValue, taxAgentId, addVisible, editId, saveLoading } = this.state; const { cumDeductStore, taxAgentStore } = this.props; const { loading, @@ -385,15 +501,16 @@ export default class CumDeduct extends React.Component { type="primary" onClick={() => { this.setState({ - addVisible: true + addVisible: true, + editId: "" }); }}> 新建 , + 删除所选 } @@ -497,6 +614,18 @@ export default class CumDeduct extends React.Component { this.onEdit(record)}> 查看明细 + { + showOperateBtn && + this.handleOperate(e, record)}> + 编辑 + 删除 + } title=""> + + + }
) }; @@ -594,10 +723,11 @@ export default class CumDeduct extends React.Component { measure="%" title={ { const { baseInfo } = this.addItemRef.state; - const bool = _.every(baseInfo, v => !_.isEmpty(v)); + const bool = _.every(_.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId"]), v => !_.isEmpty(v)); if (!bool) { Modal.warning({ title: "信息确认", @@ -605,7 +735,11 @@ export default class CumDeduct extends React.Component { }); return; } - console.log(baseInfo); + const payload = { + ..._.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId", "taxAgentName"]), + ...addForm.getFormParams() + }; + this.createAddUpDeduction(payload); }} editable={!!addVisible} showOperateBtn={showOperateBtn} @@ -614,8 +748,13 @@ export default class CumDeduct extends React.Component { } content={ addVisible ? - this.addItemRef = dom} taxAgentOption={taxAgentOption} form={addForm} - condition={dataCollectCondition}/> : + this.addItemRef = dom} + taxAgentOption={taxAgentOption} + form={addForm} + editId={editId} + condition={dataCollectCondition} + /> : @@ -626,14 +765,16 @@ export default class CumDeduct extends React.Component { onClose={() => { setSlideVisiable(false); this.setState({ - addVisible: false + addVisible: false, + editId: "" }); }} showMask={true} closeMaskOnClick={() => { setSlideVisiable(false); this.setState({ - addVisible: false + addVisible: false, + editId: "" }); }} /> diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.less index d6caad16..dc458e34 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.less +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.less @@ -37,6 +37,11 @@ .linkWapper { a { color: #4d7ad8; + margin-right: 8px; + } + + i { + cursor: pointer; } a:hover { @@ -45,6 +50,26 @@ } } +.moreIconWrapper { + .ant-popover-inner { + min-width: 106px + } + + .ant-popover-inner-content { + padding: 0; + + .ant-menu { + .ant-menu-item { + border-right: none; + height: 30px; + line-height: 30px; + text-align: center; + padding: 0; + } + } + } +} + .wea-new-table { .ant-table-tbody { tr { @@ -56,30 +81,32 @@ } } -.slideOuterWrapper{ - .wea-slide-modal-title{ +.slideOuterWrapper { + .wea-slide-modal-title { height: initial; line-height: initial; text-align: left; } - .rodal-close{ + + .rodal-close { z-index: 99; - top: 10px!important; + top: 10px !important; } } -@media (min-width: 1260px){ - .slideOuterWrapper{ - .reqTopWrapper .wea-new-top-req-title>div:first-child>div{ - max-width: 100%!important; +@media (min-width: 1260px) { + .slideOuterWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: 100% !important; } } } + @media screen and (min-width: 1060px) and (max-width: 1260px) { - .slideOuterWrapper{ - .reqTopWrapper .wea-new-top-req-title>div:first-child>div{ - max-width: calc(100% - 96px)!important; + .slideOuterWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: calc(100% - 96px) !important; } } } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index 26f64f75..265385d2 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -1,7 +1,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; -import { Button, Col, Dropdown, Menu, message, Modal, Row } from "antd"; +import { Button, Col, Dropdown, Menu, message, Modal, Row, Popover } from "antd"; import { WeaDatePicker, WeaHelpfulTip, WeaRightMenu, WeaSelect, WeaSlideModal, WeaTab, WeaTable, WeaTop } from "ecCom"; import moment from "moment"; import { getSearchs, renderLoading } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 @@ -11,6 +11,7 @@ import { optionAddAll } from "../../../util/options"; import SlideModalTitle from "../../../components/slideModalTitle"; import EditSlideContent from "./editSlideContent"; import AddItems from "../addItems"; +import * as API from "../../../apis/cumSituation"; import "./index.less"; @@ -20,7 +21,9 @@ export default class CumSituation extends React.Component { constructor(props) { super(props); this.state = { + saveLoading: false, addVisible: false, + editId: "", value: "", selectedKey: [], slideSelectedKey: [], //详情表格的选中项 @@ -229,7 +232,7 @@ export default class CumSituation extends React.Component { }; // 搜索 - handleSearch() { + handleSearch = () => { const { cumSituationStore: { getTableDatas } } = this.props; const { monthValue, taxAgentId } = this.state; let params = {}; @@ -240,11 +243,124 @@ export default class CumSituation extends React.Component { params.taxAgentId = taxAgentId; } getTableDatas(params); + }; + //新功能 + createAddUpSituation= (payload)=>{ + 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 + }); + addForm.resetForm(); + }); + } else { + message.error("新增失败"); + } + }); } + handleOperate = ({ key }, row) => { + const { monthValue: declareMonth, taxAgentId } = this.state; + const { cumSituationStore: { doSearch } } = this.props; + if (key === "edit") { + this.setState({ + addVisible: true, + editId: row.id + }); + } else if (key === "delete") { + const payload = { + declareMonth, + ids: [row.id] + }; + Modal.confirm({ + title: "信息确认", + content: `确定删除${row.departmentName}${row.username}(税款所属期:${declareMonth})的往期累计情况数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, + onOk: () => { + API.deleteSelectAddUpSituation(payload).then(({ status }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error("删除失败"); + } + }); + } + }); + } + }; + deleteSelectAddUpSituation = () => { + const { monthValue: declareMonth, taxAgentId, selectedKey } = this.state; + const { cumSituationStore: { doSearch } } = this.props; + if (selectedKey.length === 0) { + message.warning("未选择条目"); + return; + } + const payload = { + declareMonth, + ids: selectedKey + }; + Modal.confirm({ + title: "信息确认", + content: "确定删除所选数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。", + onOk: () => { + API.deleteSelectAddUpSituation(payload).then(({ status }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error("删除失败"); + } + }); + }, + onCancel: () => { + } + }); + + }; + deleteAllAddUpSituation = () => { + const { monthValue: declareMonth, taxAgentId } = this.state; + const { cumSituationStore: { doSearch } } = this.props; + const payload = { + declareMonth, + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }; + Modal.confirm({ + title: "信息确认", + content: `确定清空税款所属期为${declareMonth}的所有往期累计情况的数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, + onOk: () => { + API.deleteAllAddUpSituation(payload).then(({ status }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error("删除失败"); + } + }); + } + }); + }; render() { const { cumSituationStore, taxAgentStore } = this.props; - const { slideSelectedKey, addVisible } = this.state; + const { slideSelectedKey, addVisible, editId, saveLoading } = this.state; const { loading, dataSource, @@ -382,9 +498,9 @@ export default class CumSituation extends React.Component { 新建 , + 删除所选 } @@ -487,6 +603,18 @@ export default class CumSituation extends React.Component { this.onEdit(record)}> 查看明细 + { + showOperateBtn && + this.handleOperate(e, record)}> + 编辑 + 删除 + } title=""> + + + } }; } else { @@ -572,10 +700,11 @@ export default class CumSituation extends React.Component { measure="%" title={ { const { baseInfo } = this.addItemRef.state; - const bool = _.every(baseInfo, v => !_.isEmpty(v)); + const bool = _.every(_.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId"]), v => !_.isEmpty(v)); if (!bool) { Modal.warning({ title: "信息确认", @@ -583,7 +712,11 @@ export default class CumSituation extends React.Component { }); return; } - console.log(baseInfo); + const payload = { + ..._.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId", "taxAgentName"]), + ...addForm.getFormParams() + }; + this.createAddUpSituation(payload); }} editable={!!addVisible} showOperateBtn={showOperateBtn} @@ -607,14 +740,16 @@ export default class CumSituation extends React.Component { onClose={() => { setSlideVisiable(false); this.setState({ - addVisible: false + addVisible: false, + editId: "" }); }} showMask={true} closeMaskOnClick={() => { setSlideVisiable(false); this.setState({ - addVisible: false + addVisible: false, + editId: "" }); }} />} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.less index 8049f9cb..833b1df9 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.less +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.less @@ -1,27 +1,64 @@ -.slideOuterWrapper{ - .wea-slide-modal-title{ +.slideOuterWrapper { + .wea-slide-modal-title { height: initial; line-height: initial; text-align: left; } - .rodal-close{ + + .rodal-close { z-index: 99; - top: 10px!important; + top: 10px !important; + } + + .linkWapper { + a { + color: #4d7ad8; + margin-right: 8px; + } + + i { + cursor: pointer; + } + + a:hover { + text-decoration: none; + } } } -@media (min-width: 1260px){ - .slideOuterWrapper{ - .reqTopWrapper .wea-new-top-req-title>div:first-child>div{ - max-width: 100%!important; +.moreIconWrapper { + .ant-popover-inner { + min-width: 106px + } + + .ant-popover-inner-content { + padding: 0; + + .ant-menu { + .ant-menu-item { + border-right: none; + height: 30px; + line-height: 30px; + text-align: center; + padding: 0; + } } } } + +@media (min-width: 1260px) { + .slideOuterWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: 100% !important; + } + } +} + @media screen and (min-width: 1060px) and (max-width: 1260px) { - .slideOuterWrapper{ - .reqTopWrapper .wea-new-top-req-title>div:first-child>div{ - max-width: calc(100% - 96px)!important; + .slideOuterWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: calc(100% - 96px) !important; } } } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index c5aeb54d..9728b74d 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -1,7 +1,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; -import { Button, Col, Dropdown, Menu, message, Modal, Row } 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中 @@ -11,7 +11,9 @@ import AddItems from "../addItems"; import SlideModalTitle from "../../../components/slideModalTitle"; import EditSlideContent from "./editSlideContent"; import { optionAddAll } from "../../../util/options"; +import * as API from "../../../apis/otherDeduct"; import "./index.less"; +import { deleteAllData, deleteSelectData } from "../../../apis/otherDeduct"; @inject("otherDeductStore", "taxAgentStore") @@ -20,7 +22,9 @@ export default class OtherDeduct extends React.Component { constructor(props) { super(props); this.state = { + saveLoading: false, addVisible: false, + editId: "", value: "", selectedKey: [], slideSelectedKey: [], //详情表格的选中项 @@ -224,7 +228,7 @@ export default class OtherDeduct extends React.Component { }); }; - handleSearch() { + handleSearch = () => { const { otherDeductStore: { getTableDatas } } = this.props; const { monthValue, taxAgentId } = this.state; let params = {}; @@ -235,7 +239,121 @@ export default class OtherDeduct extends React.Component { params.taxAgentId = taxAgentId; } getTableDatas(params); - } + }; + + //新功能 + createData = (payload) => { + this.setState({ saveLoading: true }); + API.createData(payload).then(({ status }) => { + this.setState({ saveLoading: false }); + if (status) { + message.success("新增成功"); + this.setState({ + addVisible: false, + editId: "" + }, () => { + const { otherDeductStore: { doSearch, addForm } } = this.props; + const { monthValue, taxAgentId } = this.state; + doSearch({ + declareMonth: [monthValue], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + addForm.resetForm(); + }); + } else { + message.error("新增失败"); + } + }); + }; + handleOperate = ({ key }, row) => { + const { monthValue: declareMonth, taxAgentId } = this.state; + const { otherDeductStore: { doSearch } } = this.props; + if (key === "edit") { + this.setState({ + addVisible: true, + editId: row.id + }); + } else if (key === "delete") { + const payload = { + declareMonth, + ids: [row.id] + }; + Modal.confirm({ + title: "信息确认", + content: `确定删除${row.departmentName}${row.username}(税款所属期:${declareMonth})的其他免税扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, + onOk: () => { + API.deleteSelectData(payload).then(({ status }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error("删除失败"); + } + }); + } + }); + } + }; + deleteSelectData = () => { + const { monthValue: declareMonth, taxAgentId, selectedKey } = this.state; + const { otherDeductStore: { doSearch } } = this.props; + if (selectedKey.length === 0) { + message.warning("未选择条目"); + return; + } + const payload = { + declareMonth, + ids: selectedKey + }; + Modal.confirm({ + title: "信息确认", + content: "确定删除所选数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。", + onOk: () => { + API.deleteSelectData(payload).then(({ status }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error("删除失败"); + } + }); + }, + onCancel: () => { + } + }); + + }; + deleteAllData = () => { + const { monthValue: declareMonth, taxAgentId } = this.state; + const { otherDeductStore: { doSearch } } = this.props; + const payload = { + declareMonth, + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }; + Modal.confirm({ + title: "信息确认", + content: `确定清空税款所属期为${declareMonth}的所有其他免税扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, + onOk: () => { + API.deleteAllData(payload).then(({ status }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error("删除失败"); + } + }); + } + }); + }; render() { const { otherDeductStore, taxAgentStore } = this.props; @@ -270,7 +388,7 @@ export default class OtherDeduct extends React.Component { setPageObj } = otherDeductStore; const selectedRowKeys = toJS(tableStore.selectedRowKeys) || []; - const { modalParam, monthValue, taxAgentId, slideSelectedKey, addVisible } = this.state; + const { modalParam, monthValue, taxAgentId, slideSelectedKey, addVisible, editId, saveLoading } = this.state; const detailSelectedRowKeys = toJS(slideTableStore.selectedRowKeys) || []; @@ -368,15 +486,16 @@ export default class OtherDeduct extends React.Component { type="primary" onClick={() => { this.setState({ - addVisible: true + addVisible: true, + editId: "" }); }}> 新建 , + 删除所选 } @@ -455,8 +574,6 @@ export default class OtherDeduct extends React.Component { if (item.dataIndex === "username") { return { ...item, - width: 100, - fixed: "left", render: (text, record) =>
this.onEdit(record)}> @@ -466,20 +583,28 @@ export default class OtherDeduct extends React.Component { }; } else if (item.dataIndex === "taxAgentName") { return { - ...item, - width: 180, - fixed: "left" + ...item }; } else if (item.dataIndex === "operate") { return { ...item, - width: 100, - fixed: "right", render: (text, record) =>
this.onEdit(record)}> 查看明细 + { + showOperateBtn && + this.handleOperate(e, record)}> + 编辑 + 删除 + } title=""> + + + }
}; } else { @@ -522,7 +647,6 @@ export default class OtherDeduct extends React.Component { dataSource={dataSource} pagination={pagination} loading={loading} - scroll={{ x: 1300 }} /> @@ -570,10 +694,10 @@ export default class OtherDeduct extends React.Component { measure="%" title={ { const { baseInfo } = this.addItemRef.state; - const bool = _.every(baseInfo, v => !_.isEmpty(v)); + const bool = _.every(_.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId"]), v => !_.isEmpty(v)); if (!bool) { Modal.warning({ title: "信息确认", @@ -581,8 +705,13 @@ export default class OtherDeduct extends React.Component { }); return; } - console.log(baseInfo); + const payload = { + ..._.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId", "taxAgentName"]), + ...addForm.getFormParams() + }; + this.createData(payload); }} + loading={saveLoading} editable={!!addVisible} showOperateBtn={showOperateBtn} customOperate={(showOperateBtn && !addVisible) ? renderBtns() : []} @@ -590,8 +719,13 @@ export default class OtherDeduct extends React.Component { } content={ addVisible ? - this.addItemRef = dom} taxAgentOption={taxAgentOption} form={addForm} - condition={dataCollectCondition}/> : + this.addItemRef = dom} + taxAgentOption={taxAgentOption} + form={addForm} + editId={editId} + condition={dataCollectCondition} + /> : @@ -601,14 +735,16 @@ export default class OtherDeduct extends React.Component { onClose={() => { setSlideVisiable(false); this.setState({ - addVisible: false + addVisible: false, + editId: "" }); }} showMask={true} closeMaskOnClick={() => { setSlideVisiable(false); this.setState({ - addVisible: false + addVisible: false, + editId: "" }); }} />} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.less index eba96b4d..081d0280 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.less +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.less @@ -2,6 +2,11 @@ .linkWapper { a { color: #4d7ad8; + margin-right: 8px; + } + + i { + cursor: pointer; } a:hover { @@ -9,30 +14,54 @@ } } } -.slideOuterWrapper{ - .wea-slide-modal-title{ + +.moreIconWrapper { + .ant-popover-inner { + min-width: 106px + } + + .ant-popover-inner-content { + padding: 0; + + .ant-menu { + .ant-menu-item { + border-right: none; + height: 30px; + line-height: 30px; + text-align: center; + padding: 0; + } + } + } +} + + +.slideOuterWrapper { + .wea-slide-modal-title { height: initial; line-height: initial; text-align: left; } - .rodal-close{ + + .rodal-close { z-index: 99; - top: 10px!important; + top: 10px !important; } } -@media (min-width: 1260px){ - .slideOuterWrapper{ - .reqTopWrapper .wea-new-top-req-title>div:first-child>div{ - max-width: 100%!important; +@media (min-width: 1260px) { + .slideOuterWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: 100% !important; } } } + @media screen and (min-width: 1060px) and (max-width: 1260px) { - .slideOuterWrapper{ - .reqTopWrapper .wea-new-top-req-title>div:first-child>div{ - max-width: calc(100% - 96px)!important; + .slideOuterWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: calc(100% - 96px) !important; } } } diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.js b/pc4mobx/hrmSalary/pages/ruleConfig/index.js index bafd5e0f..590aebc4 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.js @@ -282,7 +282,7 @@ export const Select = payload => { return ( onChange({ type: label, selected })}/> + onChange={(selected, showName) => onChange({ type: label, selected, showName })}/> ); }; diff --git a/pc4mobx/hrmSalary/stores/otherDeduct.js b/pc4mobx/hrmSalary/stores/otherDeduct.js index 91457537..2f413560 100644 --- a/pc4mobx/hrmSalary/stores/otherDeduct.js +++ b/pc4mobx/hrmSalary/stores/otherDeduct.js @@ -4,7 +4,6 @@ import { WeaForm, WeaTableNew } from "comsMobx"; import { removePropertyCondition } from "../util/response"; import * as API from "../apis/otherDeduct"; // 引入API接口文件 -import * as TaxAgentApi from "../apis/taxAgent"; const { TableStore } = WeaTableNew; From d4ecfb3a1e7373cdfa6562ee172fecdef5db469a Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Mon, 31 Oct 2022 17:35:21 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/cumDeduct.js | 4 + pc4mobx/hrmSalary/apis/otherDeduct.js | 4 + .../pages/dataAcquisition/addItems.js | 52 ++++++++--- .../cumDeduct/components/editSlideContent.js | 2 +- .../pages/dataAcquisition/cumDeduct/index.js | 90 ++++++++++++------ .../dataAcquisition/cumSituation/index.js | 14 +-- .../otherDeduct/editSlideContent.js | 2 +- .../dataAcquisition/otherDeduct/index.js | 93 ++++++++++++------- 8 files changed, 173 insertions(+), 88 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/cumDeduct.js b/pc4mobx/hrmSalary/apis/cumDeduct.js index f7a094e6..18ddb1a5 100644 --- a/pc4mobx/hrmSalary/apis/cumDeduct.js +++ b/pc4mobx/hrmSalary/apis/cumDeduct.js @@ -107,6 +107,10 @@ export const importCumDeductPreview = (params) => { export const createAddUpDeduction = (params) => { return postFetch('/api/bs/hrmsalary/addUpDeduction/createAddUpDeduction', params); } +//查看信息 +export const getAddUpDeduction = (params) => { + return postFetch('/api/bs/hrmsalary/addUpDeduction/getAddUpDeduction', params); +} //编辑累计专项附加扣除 export const editAddUpDeduction = (params) => { return postFetch('/api/bs/hrmsalary/addUpDeduction/editAddUpDeduction', params); diff --git a/pc4mobx/hrmSalary/apis/otherDeduct.js b/pc4mobx/hrmSalary/apis/otherDeduct.js index 4b8fa0a9..b7f2ad31 100644 --- a/pc4mobx/hrmSalary/apis/otherDeduct.js +++ b/pc4mobx/hrmSalary/apis/otherDeduct.js @@ -111,6 +111,10 @@ export const importOtherDeductionPreview = (params) => { export const createData = (params) => { return postFetch('/api/bs/hrmsalary/otherDeduction/createData', params); } +//查看信息 +export const getData = (params) => { + return postFetch('/api/bs/hrmsalary/otherDeduction/getData', params); +} //编辑其他免税扣除 export const editData = (params) => { return postFetch('/api/bs/hrmsalary/otherDeduction/editData', params); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js index a9ee5124..5ed7b58a 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js @@ -19,6 +19,7 @@ class AddItems extends Component { taxAgentId: "", taxAgentName: "", employeeId: "", + employeeName: "", personArea: "", username: "", idcard: "" @@ -26,18 +27,37 @@ class AddItems extends Component { }; } - componentDidMount() { - console.log('123',this.props.editId); + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.editId !== this.props.editId) { + this.setState({ + baseInfo: { + ...this.state.baseInfo, + declareMonth: nextProps.editId.declareMonth, + taxAgentId: nextProps.editId.taxAgentId, + taxAgentName: nextProps.editId.taxAgentName, + employeeId: nextProps.editId.employeeId, + employeeName: nextProps.editId.username, + } + }); + const fields= _.map(nextProps.condition[0].items, it =>{ + return it.domkey[0] + }) + fields.map(item => { + nextProps.form.updateFields({ + [item]: nextProps.editId[item] + }) + }) + } } render() { - const { taxAgentOption = [], form, condition = [], isCum } = this.props; + const { taxAgentOption = [], form, condition = [], isCum, editId } = this.props; const { baseInfo } = this.state; const items = [ { com: PickDate({ label: "税款所属期", - viewAttr: 3, + viewAttr: _.isEmpty(editId) ? 3 : 1, labelCol: { span: 6 }, wrapperCol: { span: 18 }, format: "YYYY-MM", @@ -50,7 +70,7 @@ class AddItems extends Component { { com: Select({ label: "个税扣缴义务人", - viewAttr: 3, + viewAttr: _.isEmpty(editId) ? 3 : 1, options: taxAgentOption, value: baseInfo.taxAgentId, onChange: (data) => { @@ -61,9 +81,11 @@ class AddItems extends Component { { com: Browser({ label: "人员", - viewAttr: 3, - onChange: (employeeId) => { - this.setState({ baseInfo: { ...baseInfo, employeeId } }); + viewAttr: _.isEmpty(editId) ? 3 : 1, + value: baseInfo.employeeId, + valueSpan: baseInfo.employeeName, + onChange: ({ids, names}) => { + this.setState({ baseInfo: { ...baseInfo, employeeId: ids, employeeName: names } }); } }) } @@ -98,7 +120,7 @@ class AddItems extends Component { label: "人员范围", viewAttr: 3, options: [ - { key: "ORGANIZATION", showname: "内部人员" }, + { key: "ORGANIZATION", showname: "内部人员" } // { key: "EXT_EMPLOYEE", showname: "非系统人员" } ], value: baseInfo.personArea, @@ -112,8 +134,8 @@ class AddItems extends Component { com: Browser({ label: "人员", viewAttr: 3, - onChange: (employeeId) => { - this.setState({ baseInfo: { ...baseInfo, employeeId } }); + onChange: ({ids, names}) => { + this.setState({ baseInfo: { ...baseInfo, employeeId: ids, employeeName: names } }); } }) }]; @@ -142,7 +164,7 @@ class AddItems extends Component {
{ getSearchs(form, condition, 2) @@ -156,13 +178,15 @@ class AddItems extends Component { export default AddItems; export const Browser = payload => { - const { label, onChange, viewAttr = 3 } = payload; + const { label, onChange, viewAttr = 3, value, valueSpan } = payload; return ( + value={value} + valueSpan={valueSpan} + onChange={(ids, names)=> onChange({ids, names})}/> ); }; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js index 63f96c64..becf4328 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js @@ -144,7 +144,7 @@ export default class EditSlideContent extends React.Component { {currentRecord.username} - 申报月份 + 税款所属期
- 申报月份: + 税款所属期: { + handleSaveDeduction = (payload) => { + const { editId } = this.state; this.setState({ saveLoading: true }); - API.createAddUpDeduction(payload).then(({ status }) => { - this.setState({ saveLoading: false }); - if (status) { - message.success("新增成功"); - this.setState({ - addVisible: false - }, () => { - const { cumDeductStore: { doSearch, addForm } } = this.props; - const { monthValue, taxAgentId } = this.state; - doSearch({ - declareMonth: [monthValue], - taxAgentId: taxAgentId === "All" ? "" : taxAgentId + if (!_.isEmpty(editId)) { + API.editAddUpDeduction({ ...payload, id: editId.id }).then(({ status }) => { + this.setState({ saveLoading: false }); + if (status) { + message.success("编辑成功"); + this.setState({ + addVisible: false, + editId: {} + }, () => { + const { cumDeductStore: { doSearch, addForm } } = this.props; + const { monthValue, taxAgentId } = this.state; + doSearch({ + declareMonth: [monthValue], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + addForm.resetForm(); }); - addForm.resetForm(); - }); - } else { - message.error("新增失败"); - } - }); + } else { + message.error("编辑成功"); + } + }); + } else { + API.createAddUpDeduction(payload).then(({ status }) => { + this.setState({ saveLoading: false }); + if (status) { + message.success("新增成功"); + this.setState({ + addVisible: false, + editId: {} + }, () => { + const { cumDeductStore: { doSearch, addForm } } = this.props; + const { monthValue, taxAgentId } = this.state; + doSearch({ + declareMonth: [monthValue], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + addForm.resetForm(); + }); + } else { + message.error("新增失败"); + } + }); + } }; deleteSelectAddUpDeduction = () => { const { monthValue: declareMonth, taxAgentId, selectedKey } = this.state; @@ -354,8 +379,13 @@ export default class CumDeduct extends React.Component { const { cumDeductStore: { doSearch } } = this.props; if (key === "edit") { this.setState({ - addVisible: true, - editId: row.id + addVisible: true + }, () => { + API.getAddUpDeduction({ id: row.id }).then(({ status, data }) => { + if (status) { + this.setState({ editId: data }); + } + }); }); } else if (key === "delete") { const payload = { @@ -502,8 +532,8 @@ export default class CumDeduct extends React.Component { onClick={() => { this.setState({ addVisible: true, - editId: "" - }); + editId: {} + },()=>addForm.resetForm()); }}> 新建 , @@ -723,12 +753,12 @@ export default class CumDeduct extends React.Component { measure="%" 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: "必要信息不完整,红色*为必填项!" @@ -739,7 +769,7 @@ export default class CumDeduct extends React.Component { ..._.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId", "taxAgentName"]), ...addForm.getFormParams() }; - this.createAddUpDeduction(payload); + this.handleSaveDeduction(payload); }} editable={!!addVisible} showOperateBtn={showOperateBtn} @@ -766,7 +796,7 @@ export default class CumDeduct extends React.Component { setSlideVisiable(false); this.setState({ addVisible: false, - editId: "" + editId: {} }); }} showMask={true} @@ -774,7 +804,7 @@ export default class CumDeduct extends React.Component { setSlideVisiable(false); this.setState({ addVisible: false, - editId: "" + editId: {} }); }} /> diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index 265385d2..bd4241e2 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -30,6 +30,7 @@ export default class CumSituation extends React.Component { visiable: false, inited: false, monthValue: moment(new Date()).format("YYYY"), + taxYearMonth: moment(new Date()).format("YYYY-MM"), taxAgentId: "All", modalParam: { taxYearMonth: "" @@ -202,14 +203,6 @@ export default class CumSituation extends React.Component { setStep(0); } - onOperatesClick = (record, index, operate, flag) => { - switch (operate.index.toString()) { - case "0": // 查看明细 - this.onEdit(record); - break; - } - }; - showColumn = () => { const { cumSituationStore: { tableStore } } = this.props; tableStore.setColSetVisible(true); @@ -360,7 +353,7 @@ export default class CumSituation extends React.Component { render() { const { cumSituationStore, taxAgentStore } = this.props; - const { slideSelectedKey, addVisible, editId, saveLoading } = this.state; + const { slideSelectedKey, addVisible, editId, saveLoading, taxYearMonth } = this.state; const { loading, dataSource, @@ -713,7 +706,8 @@ export default class CumSituation extends React.Component { return; } const payload = { - ..._.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId", "taxAgentName"]), + taxYearMonth: baseInfo.declareMonth, + ..._.pick(baseInfo, ["taxAgentId", "employeeId", "taxAgentName"]), ...addForm.getFormParams() }; this.createAddUpSituation(payload); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js index 96d3f6b4..dcb1709d 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js @@ -144,7 +144,7 @@ export default class EditSlideContent extends React.Component { {currentRecord.username} - 申报月份 + 税款所属期
- 申报月份: + 税款所属期: { + handleCreateData = (payload) => { + const { editId }= this.state; this.setState({ saveLoading: true }); - API.createData(payload).then(({ status }) => { - this.setState({ saveLoading: false }); - if (status) { - message.success("新增成功"); - this.setState({ - addVisible: false, - editId: "" - }, () => { - const { otherDeductStore: { doSearch, addForm } } = this.props; - const { monthValue, taxAgentId } = this.state; - doSearch({ - declareMonth: [monthValue], - taxAgentId: taxAgentId === "All" ? "" : taxAgentId + if (!_.isEmpty(editId)) { + API.editData({ ...payload, id: editId.id }).then(({ status }) => { + this.setState({ saveLoading: false }); + if (status) { + message.success("编辑成功"); + this.setState({ + addVisible: false, + editId: {} + }, () => { + const { otherDeductStore: { doSearch, addForm } } = this.props; + const { monthValue, taxAgentId } = this.state; + doSearch({ + declareMonth: [monthValue], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + addForm.resetForm(); }); - addForm.resetForm(); - }); - } else { - message.error("新增失败"); - } - }); + } else { + message.error("编辑失败"); + } + }); + } else { + API.createData(payload).then(({ status }) => { + this.setState({ saveLoading: false }); + if (status) { + message.success("新增成功"); + this.setState({ + addVisible: false, + editId: {} + }, () => { + const { otherDeductStore: { doSearch, addForm } } = this.props; + const { monthValue, taxAgentId } = this.state; + doSearch({ + declareMonth: [monthValue], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + addForm.resetForm(); + }); + } else { + message.error("新增失败"); + } + }); + } }; handleOperate = ({ key }, row) => { const { monthValue: declareMonth, taxAgentId } = this.state; const { otherDeductStore: { doSearch } } = this.props; if (key === "edit") { this.setState({ - addVisible: true, - editId: row.id + addVisible: true + },()=>{ + API.getData({ id: row.id }).then(({ status, data }) => { + if (status) { + this.setState({ editId: data }); + } + }); }); } else if (key === "delete") { const payload = { @@ -487,8 +516,8 @@ export default class OtherDeduct extends React.Component { onClick={() => { this.setState({ addVisible: true, - editId: "" - }); + editId: {} + },()=>addForm.resetForm()); }}> 新建 , @@ -694,11 +723,11 @@ export default class OtherDeduct extends React.Component { measure="%" 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: "必要信息不完整,红色*为必填项!" @@ -709,7 +738,7 @@ export default class OtherDeduct extends React.Component { ..._.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId", "taxAgentName"]), ...addForm.getFormParams() }; - this.createData(payload); + this.handleCreateData(payload); }} loading={saveLoading} editable={!!addVisible} @@ -736,7 +765,7 @@ export default class OtherDeduct extends React.Component { setSlideVisiable(false); this.setState({ addVisible: false, - editId: "" + editId: {} }); }} showMask={true} @@ -744,7 +773,7 @@ export default class OtherDeduct extends React.Component { setSlideVisiable(false); this.setState({ addVisible: false, - editId: "" + editId: {} }); }} />} From 8a964d7e40af4e068493bcdf0fb4ebe660cb8352 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Tue, 1 Nov 2022 14:06:06 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?= =?UTF-8?q?=E6=8E=A5=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") From bd0923e3a6f199913ae0c3655d740652a5a8af01 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Tue, 1 Nov 2022 17:18:41 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=93=8D=E4=BD=9C=E5=88=97=E8=A1=A8=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js | 2 +- pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 717910dd..b345f310 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -637,7 +637,7 @@ export default class CumDeduct extends React.Component { } else if (item.dataIndex === "operate") { return { ...item, - width: 100, + width: 120, fixed: "right", render: (text, record) => (
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index 82849f06..be8a4c86 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -620,7 +620,7 @@ export default class CumSituation extends React.Component { } else if (item.dataIndex === "operate") { return { ...item, - width: 100, + width: 120, fixed: "right", render: (text, record) =>
From 794cfc1615b5a0fc8986a1670335e5b0aff2b850 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Wed, 2 Nov 2022 09:28:27 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=93=8D=E4=BD=9C=E5=88=97=E8=A1=A8=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/dataAcquisition/attendance/index.js | 4 +- .../cumDeduct/components/editSlideContent.js | 42 ++++++----------- .../cumSituation/editSlideContent.js | 45 ++++++------------- .../otherDeduct/editSlideContent.js | 12 +---- 4 files changed, 30 insertions(+), 73 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js index e568b84a..8bc844d2 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js @@ -815,7 +815,7 @@ export default class Attendance extends React.Component { setFieldSettingAttendList(value); }} items={fieldSettingAttendList} - title={"考勤模块"} + title="考勤模块" /> { @@ -872,7 +872,7 @@ export default class Attendance extends React.Component { className="slideOuterWrapper" visible={slideVisiable} top={0} - width={40} + width={60} height={100} direction={"right"} measure={"%"} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js index becf4328..37ea5920 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js @@ -1,13 +1,7 @@ import React from "react"; -import { Row, Col, Table, DatePicker } from "antd"; +import { Col, DatePicker, Row } from "antd"; import { inject, observer } from "mobx-react"; -import { - WeaInput, - WeaTextarea, - WeaSearchGroup, - WeaSelect, - WeaTable, -} from "ecCom"; +import { WeaTable } from "ecCom"; import "./editSlideContent.less"; import moment from "moment"; @@ -21,7 +15,7 @@ let emptyItem = { taxableIncomeLl: "0.00", taxableIncomeUl: "0.00", taxRate: "0.00", - taxDeduction: "0.00", + taxDeduction: "0.00" }; @inject("cumDeductStore", "taxAgentStore") @@ -34,21 +28,21 @@ export default class EditSlideContent extends React.Component { startDate: "", endDate: "", editable: - this.props.editable === undefined ? "true" : this.props.editable, + this.props.editable === undefined ? "true" : this.props.editable }; } componentWillMount() { // 初始化渲染页面 const { - taxAgentStore: { fetchTaxAgentOption }, + taxAgentStore: { fetchTaxAgentOption } } = this.props; fetchTaxAgentOption(); } addItem() { const { - taxRateStore: { setDataSource }, + taxRateStore: { setDataSource } } = this.props; let dataSource = [...this.props.taxRateStore.dataSource]; let indexNum = 1; @@ -78,7 +72,7 @@ export default class EditSlideContent extends React.Component { declareMonth.push(endDate); } let item = { - taxAgentId: taxAgentId, + taxAgentId: taxAgentId }; if (declareMonth.length != 0) { item.declareMonth = declareMonth; @@ -93,7 +87,7 @@ export default class EditSlideContent extends React.Component { render() { const { - taxAgentStore: { taxAgentOption }, + taxAgentStore: { taxAgentOption } } = this.props; const { cumDeductStore } = this.props; const { @@ -103,7 +97,7 @@ export default class EditSlideContent extends React.Component { slidePageObj, slideTableDataSource, setSlidePageObj, - slideLoading, + slideLoading } = cumDeductStore; const { startDate, endDate, taxAgentId } = this.state; @@ -118,24 +112,14 @@ export default class EditSlideContent extends React.Component { setSlidePageObj({ ...slidePageObj, current, - pageSize: slidePageObj.pageSize, + pageSize: slidePageObj.pageSize }); - }, - }; - const newColumns = _.map([...slideColumns], (item) => { - if (item.dataIndex === "declareMonth") { - return { - ...item, - width: 120, - fixed: "left", - }; - } else { - return { ...item }; } - }); + }; + const newColumns = _.map([...slideColumns], (item) => ({ ...item })); const rowSelection = { selectedRowKeys: this.props.slideSelectedKey, - onChange: this.onSelectChange, + onChange: this.onSelectChange }; return (
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/editSlideContent.js index 584278c1..0c374c99 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/editSlideContent.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/editSlideContent.js @@ -1,14 +1,7 @@ import React from "react"; -import { Row, Col, Table, DatePicker } from "antd"; +import { Col, DatePicker, Row } from "antd"; import { inject, observer } from "mobx-react"; -import { - WeaInput, - WeaTextarea, - WeaSearchGroup, - WeaSelect, - WeaTable, -} from "ecCom"; -import { slideColumns } from "./columns"; +import { WeaTable } from "ecCom"; import "./editSlideContent.less"; import moment from "moment"; @@ -22,7 +15,7 @@ let emptyItem = { taxableIncomeLl: "0.00", taxableIncomeUl: "0.00", taxRate: "0.00", - taxDeduction: "0.00", + taxDeduction: "0.00" }; @inject("cumSituationStore", "taxAgentStore") @@ -35,21 +28,21 @@ export default class EditSlideContent extends React.Component { startDate: "", endDate: "", editable: - this.props.editable === undefined ? "true" : this.props.editable, + this.props.editable === undefined ? "true" : this.props.editable }; } componentWillMount() { // 初始化渲染页面 const { - taxAgentStore: { fetchTaxAgentOption }, + taxAgentStore: { fetchTaxAgentOption } } = this.props; fetchTaxAgentOption(); } addItem() { const { - taxRateStore: { setDataSource }, + taxRateStore: { setDataSource } } = this.props; let dataSource = [...this.props.taxRateStore.dataSource]; let indexNum = 1; @@ -79,7 +72,7 @@ export default class EditSlideContent extends React.Component { declareMonth.push(endDate); } let item = { - taxAgentId: taxAgentId, + taxAgentId: taxAgentId }; if (declareMonth.length != 0) { item.taxYearMonth = declareMonth; @@ -94,7 +87,7 @@ export default class EditSlideContent extends React.Component { render() { const { - taxAgentStore: { taxAgentOption }, + taxAgentStore: { taxAgentOption } } = this.props; const { cumSituationStore } = this.props; const { @@ -104,7 +97,7 @@ export default class EditSlideContent extends React.Component { slidePageObj, slideTableDataSource, setSlidePageObj, - slideLoading, + slideLoading } = cumSituationStore; const { startDate, endDate, taxAgentId } = this.state; @@ -119,24 +112,14 @@ export default class EditSlideContent extends React.Component { setSlidePageObj({ ...slidePageObj, current, - pageSize: slidePageObj.pageSize, + pageSize: slidePageObj.pageSize }); - }, - }; - const newColumns = _.map([...slideColumns], (item) => { - if (item.dataIndex === "declareMonth") { - return { - ...item, - width: 120, - fixed: "left", - }; - } else { - return { ...item }; } - }); + }; + const newColumns = _.map([...slideColumns], (item) => ({ ...item })); const rowSelection = { selectedRowKeys: this.props.slideSelectedKey, - onChange: this.onSelectChange, + onChange: this.onSelectChange }; return (
@@ -213,7 +196,7 @@ export default class EditSlideContent extends React.Component { dataSource={slideTableDataSource} pagination={pagination} loading={slideLoading} - scroll={{ x: newColumns ? newColumns.length * 150 : 900}} + scroll={{ x: newColumns ? newColumns.length * 150 : 900 }} />
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js index dcb1709d..3079fa7b 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js @@ -122,17 +122,7 @@ export default class EditSlideContent extends React.Component { }); }, }; - const newColumns = _.map([...slideColumns], (item) => { - if (item.dataIndex === "declareMonth") { - return { - ...item, - width: 120, - fixed: "left", - }; - } else { - return { ...item }; - } - }); + const newColumns = _.map([...slideColumns], (item) => ({ ...item })); const rowSelection = { selectedRowKeys: this.props.slideSelectedKey, onChange: this.onSelectChange, From d09230b2ca7fc125d8799f33c7897685c25e7347 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Wed, 2 Nov 2022 09:49:03 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=8E=A5=E5=8F=A3=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/dataAcquisition/addItems.js | 2 +- .../dataAcquisition/cumSituation/columns.js | 63 +++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js index 751934a9..836fb1a8 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js @@ -44,7 +44,7 @@ class AddItems extends Component { }) fields.map(item => { nextProps.form.updateFields({ - [item]: nextProps.editId[item] + [item]: nextProps.editId[item] || '' }) }) } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js index ce99e24c..0f825cfd 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js @@ -231,6 +231,60 @@ export const dataCollectCondition = [ value: "", viewAttr: 2 }, + { + conditionType: "INPUT", + domkey: ["addUpChildEducation"], + fieldcol: 14, + label: "累计子女教育", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpContinuingEducation"], + fieldcol: 14, + label: "累计继续教育", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpHousingLoanInterest"], + fieldcol: 14, + label: "累计住房贷款利息", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpHousingRent"], + fieldcol: 14, + label: "累计住房租金", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpSupportElderly"], + fieldcol: 14, + label: "累计赡养老人", + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpIllnessMedical"], + fieldcol: 14, + label: "累计大病医疗", + labelcol: 8, + value: "", + viewAttr: 2 + }, { conditionType: "INPUT", domkey: ["addUpEnterpriseAndOther"], @@ -284,6 +338,15 @@ export const dataCollectCondition = [ labelcol: 8, value: "", viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["addUpInfantCare"], + fieldcol: 14, + label: "累计婴幼儿照护", + labelcol: 8, + value: "", + viewAttr: 2 } ], title: "数据采集", From 66debb47087afcbdaa062623820f7edbe7c645a6 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Wed, 2 Nov 2022 10:41:12 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BC=96=E8=BE=91=E9=94=99=E8=AF=AF=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=20=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/dataAcquisition/cumDeduct/index.js | 22 +++++++++---------- .../dataAcquisition/cumSituation/columns.js | 4 ---- .../dataAcquisition/cumSituation/index.js | 20 ++++++++--------- .../dataAcquisition/otherDeduct/index.js | 20 ++++++++--------- 4 files changed, 31 insertions(+), 35 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index b345f310..f3861c66 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -274,7 +274,7 @@ export default class CumDeduct extends React.Component { const { editId } = this.state; this.setState({ saveLoading: true }); if (!_.isEmpty(editId)) { - API.editAddUpDeduction({ ...payload, id: editId.id }).then(({ status }) => { + API.editAddUpDeduction({ ...payload, id: editId.id }).then(({ status, errormsg }) => { this.setState({ saveLoading: false }); if (status) { message.success("编辑成功"); @@ -291,11 +291,11 @@ export default class CumDeduct extends React.Component { addForm.resetForm(); }); } else { - message.error("编辑成功"); + message.error(errormsg || "编辑失败"); } }); } else { - API.createAddUpDeduction(payload).then(({ status }) => { + API.createAddUpDeduction(payload).then(({ status, errormsg }) => { this.setState({ saveLoading: false }); if (status) { message.success("新增成功"); @@ -312,7 +312,7 @@ export default class CumDeduct extends React.Component { addForm.resetForm(); }); } else { - message.error("新增失败"); + message.error(errormsg || "新增失败"); } }); } @@ -332,7 +332,7 @@ export default class CumDeduct extends React.Component { title: "信息确认", content: "确定删除所选数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。", onOk: () => { - API.deleteSelectAddUpDeduction(payload).then(({ status }) => { + API.deleteSelectAddUpDeduction(payload).then(({ status, errormsg }) => { if (status) { message.success("删除成功"); doSearch({ @@ -340,7 +340,7 @@ export default class CumDeduct extends React.Component { taxAgentId: taxAgentId === "All" ? "" : taxAgentId }); } else { - message.error("删除失败"); + message.error(errormsg || "删除失败"); } }); }, @@ -360,7 +360,7 @@ export default class CumDeduct extends React.Component { title: "信息确认", content: `确定清空税款所属期为${declareMonth}的所有累计专项附加扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, onOk: () => { - API.deleteAllAddUpDeduction(payload).then(({ status }) => { + API.deleteAllAddUpDeduction(payload).then(({ status, errormsg }) => { if (status) { message.success("删除成功"); doSearch({ @@ -368,7 +368,7 @@ export default class CumDeduct extends React.Component { taxAgentId: taxAgentId === "All" ? "" : taxAgentId }); } else { - message.error("删除失败"); + message.error(errormsg || "删除失败"); } }); } @@ -396,7 +396,7 @@ export default class CumDeduct extends React.Component { title: "信息确认", content: `确定删除${row.departmentName}${row.username}(税款所属期:${declareMonth})的累计专项附加扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, onOk: () => { - API.deleteSelectAddUpDeduction(payload).then(({ status }) => { + API.deleteSelectAddUpDeduction(payload).then(({ status, errormsg }) => { if (status) { message.success("删除成功"); doSearch({ @@ -404,7 +404,7 @@ export default class CumDeduct extends React.Component { taxAgentId: taxAgentId === "All" ? "" : taxAgentId }); } else { - message.error("删除失败"); + message.error(errormsg || "删除失败"); } }); } @@ -533,7 +533,7 @@ export default class CumDeduct extends React.Component { this.setState({ addVisible: true, editId: {} - },()=>addForm.resetForm()); + }, () => addForm.resetForm()); }}> 新建 , diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js index 0f825cfd..45fab4e4 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js @@ -355,10 +355,6 @@ export const dataCollectCondition = [ ]; export const taxOptions = [ - { - key: "", - showname: "" - }, { key: "01", showname: "一月", diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index be8a4c86..98a90fa4 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -265,7 +265,7 @@ export default class CumSituation extends React.Component { const { editId } = this.state; this.setState({ saveLoading: true }); if (!_.isEmpty(editId)) { - API.editAddUpSituation({ ...payload, id: editId.id }).then(({ status }) => { + API.editAddUpSituation({ ...payload, id: editId.id }).then(({ status, errormsg }) => { this.setState({ saveLoading: false }); if (status) { message.success("编辑成功"); @@ -278,11 +278,11 @@ export default class CumSituation extends React.Component { addForm.resetForm(); }); } else { - message.error("编辑失败"); + message.error(errormsg || "编辑失败"); } }); } else { - API.createAddUpSituation(payload).then(({ status }) => { + API.createAddUpSituation(payload).then(({ status, errormsg }) => { this.setState({ saveLoading: false }); if (status) { message.success("新增成功"); @@ -295,7 +295,7 @@ export default class CumSituation extends React.Component { addForm.resetForm(); }); } else { - message.error("新增失败"); + message.error(errormsg || "新增失败"); } }); } @@ -321,12 +321,12 @@ export default class CumSituation extends React.Component { title: "信息确认", content: `确定删除${row.departmentName}${row.username}(税款所属期:${declareMonth})的往期累计情况数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, onOk: () => { - API.deleteSelectAddUpSituation(payload).then(({ status }) => { + API.deleteSelectAddUpSituation(payload).then(({ status, errormsg }) => { if (status) { message.success("删除成功"); this.handleSearch(); } else { - message.error("删除失败"); + message.error(errormsg || "删除失败"); } }); } @@ -347,12 +347,12 @@ export default class CumSituation extends React.Component { title: "信息确认", content: "确定删除所选数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。", onOk: () => { - API.deleteSelectAddUpSituation(payload).then(({ status }) => { + API.deleteSelectAddUpSituation(payload).then(({ status, errormsg }) => { if (status) { message.success("删除成功"); this.handleSearch(); } else { - message.error("删除失败"); + message.error(errormsg || "删除失败"); } }); }, @@ -370,12 +370,12 @@ export default class CumSituation extends React.Component { title: "信息确认", content: `确定清空税款所属期为${declareMonth}的所有往期累计情况的数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, onOk: () => { - API.deleteAllAddUpSituation(payload).then(({ status }) => { + API.deleteAllAddUpSituation(payload).then(({ status, errormsg }) => { if (status) { message.success("删除成功"); this.handleSearch(); } else { - message.error("删除失败"); + message.error(errormsg || "删除失败"); } }); } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index ca12c043..4534eafa 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -245,7 +245,7 @@ export default class OtherDeduct extends React.Component { const { editId }= this.state; this.setState({ saveLoading: true }); if (!_.isEmpty(editId)) { - API.editData({ ...payload, id: editId.id }).then(({ status }) => { + API.editData({ ...payload, id: editId.id }).then(({ status, errormsg }) => { this.setState({ saveLoading: false }); if (status) { message.success("编辑成功"); @@ -262,11 +262,11 @@ export default class OtherDeduct extends React.Component { addForm.resetForm(); }); } else { - message.error("编辑失败"); + message.error(errormsg || "编辑失败"); } }); } else { - API.createData(payload).then(({ status }) => { + API.createData(payload).then(({ status, errormsg }) => { this.setState({ saveLoading: false }); if (status) { message.success("新增成功"); @@ -283,7 +283,7 @@ export default class OtherDeduct extends React.Component { addForm.resetForm(); }); } else { - message.error("新增失败"); + message.error(errormsg || "新增失败"); } }); } @@ -310,7 +310,7 @@ export default class OtherDeduct extends React.Component { title: "信息确认", content: `确定删除${row.departmentName}${row.username}(税款所属期:${declareMonth})的其他免税扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, onOk: () => { - API.deleteSelectData(payload).then(({ status }) => { + API.deleteSelectData(payload).then(({ status, errormsg }) => { if (status) { message.success("删除成功"); doSearch({ @@ -318,7 +318,7 @@ export default class OtherDeduct extends React.Component { taxAgentId: taxAgentId === "All" ? "" : taxAgentId }); } else { - message.error("删除失败"); + message.error(errormsg || "删除失败"); } }); } @@ -340,7 +340,7 @@ export default class OtherDeduct extends React.Component { title: "信息确认", content: "确定删除所选数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。", onOk: () => { - API.deleteSelectData(payload).then(({ status }) => { + API.deleteSelectData(payload).then(({ status, errormsg }) => { if (status) { message.success("删除成功"); doSearch({ @@ -348,7 +348,7 @@ export default class OtherDeduct extends React.Component { taxAgentId: taxAgentId === "All" ? "" : taxAgentId }); } else { - message.error("删除失败"); + message.error(errormsg || "删除失败"); } }); }, @@ -368,7 +368,7 @@ export default class OtherDeduct extends React.Component { title: "信息确认", content: `确定清空税款所属期为${declareMonth}的所有其他免税扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, onOk: () => { - API.deleteAllData(payload).then(({ status }) => { + API.deleteAllData(payload).then(({ status, errormsg }) => { if (status) { message.success("删除成功"); doSearch({ @@ -376,7 +376,7 @@ export default class OtherDeduct extends React.Component { taxAgentId: taxAgentId === "All" ? "" : taxAgentId }); } else { - message.error("删除失败"); + message.error(errormsg || "删除失败"); } }); }