diff --git a/pc4mobx/hrmSalary/apis/cumDeduct.js b/pc4mobx/hrmSalary/apis/cumDeduct.js index ada3f3b9..18ddb1a5 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,25 @@ 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 getAddUpDeduction = (params) => { + return postFetch('/api/bs/hrmsalary/addUpDeduction/getAddUpDeduction', 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..512f3d14 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,23 @@ 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); +} +//查看信息 +export const getAddUpSituation = (params) => { + return postFetch('/api/bs/hrmsalary/addUpSituation/getAddUpSituation', params); +} diff --git a/pc4mobx/hrmSalary/apis/otherDeduct.js b/pc4mobx/hrmSalary/apis/otherDeduct.js index 972c641a..b7f2ad31 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,24 @@ 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 getData = (params) => { + return postFetch('/api/bs/hrmsalary/otherDeduction/getData', 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/apis/ruleconfig.js b/pc4mobx/hrmSalary/apis/ruleconfig.js index 09f8ebba..13f2e0eb 100644 --- a/pc4mobx/hrmSalary/apis/ruleconfig.js +++ b/pc4mobx/hrmSalary/apis/ruleconfig.js @@ -31,6 +31,10 @@ export const queryAppsetting = (params) => { export const saveEncryptSetting = (params) => { return postFetch('/api/bs/hrmsalary/sys/app/setting/saveEncryptSetting', params); } +//加密配置保存 +export const appSettingSave = (params) => { + return postFetch('/api/bs/hrmsalary/sys/app/setting/save', params); +} //获取加密进度条 export const getEncryptProgress = params => { return WeaTools.callApi('/api/bs/hrmsalary/sys/app/getEncryptProgress', 'GET', params); diff --git a/pc4mobx/hrmSalary/apis/welfareScheme.js b/pc4mobx/hrmSalary/apis/welfareScheme.js index b46fe837..d0e0b11c 100644 --- a/pc4mobx/hrmSalary/apis/welfareScheme.js +++ b/pc4mobx/hrmSalary/apis/welfareScheme.js @@ -25,7 +25,6 @@ export const createScheme = params => { }).then(res => res.json()) }; export const updateScheme = params => { - return fetch('/api/bs/hrmsalary/scheme/update', { method: 'POST', mode: 'cors', diff --git a/pc4mobx/hrmSalary/components/TipLabel/index.js b/pc4mobx/hrmSalary/components/TipLabel/index.js index 5d111c33..5671fb88 100644 --- a/pc4mobx/hrmSalary/components/TipLabel/index.js +++ b/pc4mobx/hrmSalary/components/TipLabel/index.js @@ -1,18 +1,18 @@ -import React from 'react'; -import "./index.less" +import React from "react"; +import "./index.less"; export default class TipLabel extends React.Component { - render() { - return ( -
-
- {this.props.title ? this.props.title : "小提示"} -
-
- {this.props.tipList && this.props.tipList.map(item =>
{item}
)} - {this.props.children} -
-
- ) - } -} \ No newline at end of file + render() { + return ( +
+
+ {this.props.title ? this.props.title : "小提示"} +
+
+ {this.props.tipList && this.props.tipList.map(item =>
{item}
)} + {this.props.children} +
+
+ ); + } +} diff --git a/pc4mobx/hrmSalary/components/TipLabel/index.less b/pc4mobx/hrmSalary/components/TipLabel/index.less index 7f8a20a0..addc7741 100644 --- a/pc4mobx/hrmSalary/components/TipLabel/index.less +++ b/pc4mobx/hrmSalary/components/TipLabel/index.less @@ -13,9 +13,7 @@ background-color: #f7fbfe; } .tipContentWrapper { - padding-bottom: 10px; - padding-left: 10px; - padding-right: 10px; + padding: 10px; } .tipContentItem { line-height: 20px; @@ -35,4 +33,4 @@ overflow: hidden; } -} \ No newline at end of file +} diff --git a/pc4mobx/hrmSalary/pages/appConfig/index.js b/pc4mobx/hrmSalary/pages/appConfig/index.js index 898308cb..a2b663c6 100644 --- a/pc4mobx/hrmSalary/pages/appConfig/index.js +++ b/pc4mobx/hrmSalary/pages/appConfig/index.js @@ -94,12 +94,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/calculate/baseFormModal.js b/pc4mobx/hrmSalary/pages/calculate/baseFormModal.js index 44761173..49f9c212 100644 --- a/pc4mobx/hrmSalary/pages/calculate/baseFormModal.js +++ b/pc4mobx/hrmSalary/pages/calculate/baseFormModal.js @@ -1,5 +1,5 @@ import React from "react"; -import { Button, Col, message, Row } from "antd"; +import { Button, Col, Row } from "antd"; import { inject, observer } from "mobx-react"; import { WeaDatePicker, WeaDialog, WeaError, WeaInput, WeaSelect } from "ecCom"; import { notNull } from "../../util/validate"; @@ -16,7 +16,8 @@ export default class baseFormModal extends React.Component { inited: false, selectOptions: [], salarySob: "", - description: "" + description: "", + loading: false }; } @@ -52,12 +53,15 @@ export default class baseFormModal extends React.Component { description: this.state.description }; const { calculateStore: { saveBasic } } = this.props; - + this.setState({ loading: true }); saveBasic(params).then((id) => { + this.setState({ loading: false }); this.props.onCancel(); this.props.onRefresh(); window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/calculateDetail?id=" + id); - }); + }).catch(()=>{ + this.setState({ loading: false }); + }) } validate() { @@ -77,7 +81,7 @@ export default class baseFormModal extends React.Component { } render() { - const { description } = this.state; + const { description, loading } = this.state; return ( { this.props.onCancel(); }} - buttons={[]} + buttons={[ + + ]} > 薪酬所属月 @@ -106,7 +116,7 @@ export default class baseFormModal extends React.Component { viewAttr={3} value={this.state.salaryMonthStr} onChange={value => { - if(value === '') this.refs.weaError.showError(); + if (value === "") this.refs.weaError.showError(); this.setState({ salaryMonthStr: value }); @@ -130,8 +140,8 @@ export default class baseFormModal extends React.Component { viewAttr={3} options={this.state.selectOptions} onChange={(value) => { - if(value === '') this.refs.weaError1.showError(); - this.handleSelectChange(value) + if (value === "") this.refs.weaError1.showError(); + this.handleSelectChange(value); }} value={this.state.salarySob} style={{ width: "100%" }}/> 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..836fb1a8 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js @@ -0,0 +1,211 @@ +/* + * 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: { + declareMonth: "", + taxAgentId: "", + taxAgentName: "", + employeeId: "", + employeeName: "", + personArea: "ORGANIZATION", + username: "", + idcard: "" + } + }; + } + + 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, editId } = this.props; + const { baseInfo } = this.state; + const items = [ + { + com: PickDate({ + label: "税款所属期", + viewAttr: _.isEmpty(editId) ? 3 : 1, + labelCol: { span: 6 }, + wrapperCol: { span: 18 }, + format: "YYYY-MM", + value: baseInfo.declareMonth, + onChange: (data) => { + this.setState({ baseInfo: { ...baseInfo, declareMonth: data.date } }); + } + }) + }, + { + com: Select({ + label: "个税扣缴义务人", + viewAttr: _.isEmpty(editId) ? 3 : 1, + options: taxAgentOption, + value: baseInfo.taxAgentId, + onChange: (data) => { + this.setState({ baseInfo: { ...baseInfo, taxAgentId: data.selected, taxAgentName: data.showName } }); + } + }) + }, + { + com: Browser({ + label: "人员", + viewAttr: _.isEmpty(editId) ? 3 : 1, + value: baseInfo.employeeId, + valueSpan: baseInfo.employeeName, + onChange: ({ids, names}) => { + this.setState({ baseInfo: { ...baseInfo, employeeId: ids, employeeName: names } }); + } + }) + } + ]; + const cumSituationitems = [ + { + com: PickDate({ + label: "税款所属期", + viewAttr: _.isEmpty(editId) ? 3 : 1, + labelCol: { span: 6 }, + wrapperCol: { span: 18 }, + format: "YYYY-MM", + value: baseInfo.declareMonth, + onChange: (data) => { + this.setState({ baseInfo: { ...baseInfo, declareMonth: data.date } }); + } + }) + }, + { + com: Select({ + label: "个税扣缴义务人", + viewAttr: _.isEmpty(editId) ? 3 : 1, + options: taxAgentOption, + value: baseInfo.taxAgentId, + onChange: (data) => { + this.setState({ baseInfo: { ...baseInfo, taxAgentId: data.selected, taxAgentName: data.showName } }); + } + }) + }, + { + com: Select({ + label: "人员范围", + viewAttr: _.isEmpty(editId) ? 3 : 1, + 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: _.isEmpty(editId) ? 3 : 1, + value: baseInfo.employeeId, + valueSpan: baseInfo.employeeName, + onChange: ({ids, names}) => { + this.setState({ baseInfo: { ...baseInfo, employeeId: ids, employeeName: names } }); + } + }) + }]; + 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, value, valueSpan } = payload; + return ( + + onChange({ids, names})}/> + + ); +}; +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/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js index d942b925..c0ea1200 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 }); } } @@ -604,7 +604,18 @@ export default class Attendance extends React.Component { // ) // } // }) - return newColumns; + return [ + { + title: "序号", + dataIndex: "index", + width: 80, + render: (text, record, index) => { + const { current, pageSize } = this.pageInfo; + return (current - 1) * pageSize + index + 1; + } + }, + ...newColumns + ]; }; // 保存回调 @@ -692,6 +703,7 @@ export default class Attendance extends React.Component { topTab={topTab} searchOperationItem={renderSearchOperationItem()} onChange={v => { + this.pageInfo = { current: 1, pageSize: 10 }; handleTabChange(v); }} /> @@ -725,6 +737,8 @@ export default class Attendance extends React.Component { onChange={v => { this.setState({ tabSelectedKey: v + },()=>{ + this.pageInfo = { current: 1, pageSize: 10 }; }); }} /> @@ -815,7 +829,7 @@ export default class Attendance extends React.Component { setFieldSettingAttendList(value); }} items={fieldSettingAttendList} - title={"考勤模块"} + title="考勤模块" /> { @@ -872,7 +886,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/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 87% rename from pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/editSlideContent.js rename to pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js index 63f96c64..37ea5920 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/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 (
@@ -144,7 +128,7 @@ export default class EditSlideContent extends React.Component { {currentRecord.username} - 申报月份 + 税款所属期
{ @@ -58,7 +64,7 @@ export default class CumDeduct extends React.Component { return (
- 申报月份: + 税款所属期: { const { cumDeductStore: { getTableDatas } } = this.props; const { monthValue, taxAgentId } = this.state; let params = {}; @@ -261,17 +267,160 @@ export default class CumDeduct extends React.Component { params.taxAgentId = taxAgentId; } getTableDatas(params); - } + }; + + //新功能 + handleSaveDeduction = (payload) => { + const { editId } = this.state; + this.setState({ saveLoading: true }); + if (!_.isEmpty(editId)) { + API.editAddUpDeduction({ ...payload, id: editId.id }).then(({ status, errormsg }) => { + 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(errormsg || "编辑失败"); + } + }); + } else { + API.createAddUpDeduction(payload).then(({ status, errormsg }) => { + 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(errormsg || "新增失败"); + } + }); + } + }; + 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, errormsg }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error(errormsg || "删除失败"); + } + }); + }, + 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, errormsg }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error(errormsg || "删除失败"); + } + }); + } + }); + }; + handleOperate = ({ key }, row) => { + const { monthValue: declareMonth, taxAgentId } = this.state; + const { cumDeductStore: { doSearch } } = this.props; + if (key === "edit") { + this.setState({ + addVisible: true + }, () => { + API.getAddUpDeduction({ id: row.id }).then(({ status, data }) => { + if (status) { + this.setState({ editId: data }); + } + }); + }); + } 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, errormsg }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error(errormsg || "删除失败"); + } + }); + } + }); + } + }; render() { - const { modalParam, slideSelectedKey, monthValue, taxAgentId } = this.state; + const { modalParam, slideSelectedKey, monthValue, taxAgentId, addVisible, editId, saveLoading } = this.state; const { cumDeductStore, taxAgentStore } = this.props; const { loading, dataSource, columns, pageObj, - hasRight, + addForm, form, condition, tableStore, @@ -298,10 +447,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 +480,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 +495,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 +526,26 @@ export default class CumDeduct extends React.Component { } type="ghost"> 导出全部 + , + , + + 删除所选 + + } + type="ghost"> + 一键清空 ]; @@ -483,13 +637,25 @@ export default class CumDeduct extends React.Component { } else if (item.dataIndex === "operate") { return { ...item, - width: 100, + width: 120, fixed: "right", render: (text, record) => (
this.onEdit(record)}> 查看明细 + { + showOperateBtn && + this.handleOperate(e, record)}> + 编辑 + 删除 + } title=""> + + + }
) }; @@ -497,7 +663,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 +742,71 @@ export default class CumDeduct extends React.Component { /> )} - {slideVisiable && ( + {(slideVisiable || addVisible) && ( { - this.state.currentOperate == "add" ? doSave() : doUpdate(); + const { baseInfo } = this.addItemRef.state; + const bool = _.every(_.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId"]), v => !_.isEmpty(v)); + if (!bool && _.isEmpty(editId)) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + const payload = { + ..._.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId", "taxAgentName"]), + ...addForm.getFormParams() + }; + this.handleSaveDeduction(payload); }} - 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} + editId={editId} + condition={dataCollectCondition} + /> : + + this.setState({ slideSelectedKey: val }) + } + /> } - onClose={() => setSlideVisiable(false)} + onClose={() => { + setSlideVisiable(false); + this.setState({ + addVisible: false, + editId: {} + }); + }} showMask={true} - closeMaskOnClick={() => setSlideVisiable(false)} + closeMaskOnClick={() => { + setSlideVisiable(false); + this.setState({ + addVisible: false, + editId: {} + }); + }} /> )}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.less index d6caad16..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; } @@ -37,6 +36,11 @@ .linkWapper { a { color: #4d7ad8; + margin-right: 8px; + } + + i { + cursor: pointer; } a:hover { @@ -45,6 +49,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 +80,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/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js index 4fe10b63..45fab4e4 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js @@ -1,194 +1,406 @@ 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: ["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"], + 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 + }, + { + conditionType: "INPUT", + domkey: ["addUpInfantCare"], + fieldcol: 14, + label: "累计婴幼儿照护", + labelcol: 8, + value: "", + viewAttr: 2 + } + ], + title: "数据采集", + defaultshow: true + } +]; + +export const taxOptions = [ + { + 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/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/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index d324b500..98a90fa4 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -1,18 +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, Popover, 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, taxOptions } from "./columns"; import { optionAddAll } from "../../../util/options"; -import "./index.less"; - import SlideModalTitle from "../../../components/slideModalTitle"; import EditSlideContent from "./editSlideContent"; - +import AddItems from "../addItems"; +import * as API from "../../../apis/cumSituation"; +import "./index.less"; @inject("cumSituationStore", "taxAgentStore") @observer @@ -20,12 +20,16 @@ export default class CumSituation extends React.Component { constructor(props) { super(props); this.state = { + saveLoading: false, + addVisible: false, + editId: {}, value: "", selectedKey: [], slideSelectedKey: [], //详情表格的选中项 visiable: false, inited: false, monthValue: moment(new Date()).format("YYYY"), + taxYearMonth: moment(new Date()).month() + 1 > 10 ? (moment(new Date()).month() + 1) + "" : "0" + (moment(new Date()).month() + 1), taxAgentId: "All", modalParam: { taxYearMonth: "" @@ -36,10 +40,15 @@ export default class CumSituation extends React.Component { componentWillMount() { // 初始化渲染页面 const { - cumSituationStore: { doInit }, + cumSituationStore: { doInit, addForm }, taxAgentStore: { fetchTaxAgentOption } } = this.props; - doInit({ year: this.state.monthValue, taxAgentId: "" }); + addForm.initFormFields(dataCollectCondition); + doInit({ + year: this.state.monthValue, + taxAgentId: "", + taxYearMonth: this.state.monthValue + "-" + this.state.taxYearMonth + }); fetchTaxAgentOption().then(() => { this.setState({ inited: true @@ -48,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 } @@ -61,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 && @@ -95,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 }); }} />} @@ -197,14 +226,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); @@ -227,9 +248,9 @@ export default class CumSituation extends React.Component { }; // 搜索 - handleSearch() { + 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; @@ -237,12 +258,133 @@ export default class CumSituation extends React.Component { if (taxAgentId != null && taxAgentId !== "" && taxAgentId !== "All") { params.taxAgentId = taxAgentId; } - getTableDatas(params); - } + getTableDatas({ ...params, taxYearMonth: monthValue + "-" + taxYearMonth }); + }; + //新功能 + handleCreateUpSituation = (payload) => { + const { editId } = this.state; + this.setState({ saveLoading: true }); + if (!_.isEmpty(editId)) { + API.editAddUpSituation({ ...payload, id: editId.id }).then(({ status, errormsg }) => { + 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(errormsg || "编辑失败"); + } + }); + } else { + API.createAddUpSituation(payload).then(({ status, errormsg }) => { + 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(errormsg || "新增失败"); + } + }); + } + }; + handleOperate = ({ key }, row) => { + const { monthValue: declareMonth, taxYearMonth } = this.state; + if (key === "edit") { + this.setState({ + addVisible: true + }, () => { + API.getAddUpSituation({ id: row.id }).then(({ status, data }) => { + if (status) { + this.setState({ editId: data }); + } + }); + }); + } else if (key === "delete") { + const payload = { + taxYearMonth: declareMonth + "-" + taxYearMonth, + ids: [row.id] + }; + Modal.confirm({ + title: "信息确认", + content: `确定删除${row.departmentName}${row.username}(税款所属期:${declareMonth})的往期累计情况数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, + onOk: () => { + API.deleteSelectAddUpSituation(payload).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.handleSearch(); + } else { + message.error(errormsg || "删除失败"); + } + }); + } + }); + } + }; + deleteSelectAddUpSituation = () => { + const { monthValue: declareMonth, selectedKey, taxYearMonth } = this.state; + if (selectedKey.length === 0) { + message.warning("未选择条目"); + return; + } + const payload = { + taxYearMonth: declareMonth + "-" + taxYearMonth, + ids: selectedKey + }; + Modal.confirm({ + title: "信息确认", + content: "确定删除所选数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。", + onOk: () => { + API.deleteSelectAddUpSituation(payload).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.handleSearch(); + } else { + message.error(errormsg || "删除失败"); + } + }); + }, + onCancel: () => { + } + }); + + }; + deleteAllAddUpSituation = () => { + const { monthValue: declareMonth, taxYearMonth } = this.state; + const payload = { + taxYearMonth: declareMonth + "-" + taxYearMonth + }; + Modal.confirm({ + title: "信息确认", + content: `确定清空税款所属期为${declareMonth}的所有往期累计情况的数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, + onOk: () => { + API.deleteAllAddUpSituation(payload).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.handleSearch(); + } else { + message.error(errormsg || "删除失败"); + } + }); + } + }); + }; render() { const { cumSituationStore, taxAgentStore } = this.props; - const { slideSelectedKey } = this.state; + const { slideSelectedKey, addVisible, editId, saveLoading } = this.state; const { loading, dataSource, @@ -250,6 +392,7 @@ export default class CumSituation extends React.Component { pageObj, hasRight, form, + addForm, condition, tableStore, showSearchAd, @@ -275,11 +418,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 = [ // 右键菜单 // { @@ -299,7 +437,7 @@ export default class CumSituation extends React.Component { }; const adBtn = [ // 高级搜索内部按钮 - , , + + 删除所选 + + } + type="ghost"> + 一键清空 ]; @@ -463,26 +620,40 @@ export default class CumSituation extends React.Component { } else if (item.dataIndex === "operate") { return { ...item, - width: 100, + width: 120, fixed: "right", render: (text, record) =>
this.onEdit(record)}> 查看明细 + { + showOperateBtn && + this.handleOperate(e, record)}> + 编辑 + 删除 + } title=""> + + + }
}; } else { return { ...item, width: 150 }; } }); - + if (_.isEmpty(newColumns)) { + return renderLoading(); + } return (
} // 左侧图标 + icon={} // 左侧图标 iconBgcolor="#F14A2D" // 左侧图标背景色 showDropIcon={false} // 是否显示下拉按钮 dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同) @@ -542,36 +713,71 @@ 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(_.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId"]), v => !_.isEmpty(v)); + if (!bool && _.isEmpty(editId)) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + const payload = { + taxYearMonth: baseInfo.declareMonth, + ..._.pick(baseInfo, ["taxAgentId", "employeeId", "taxAgentName"]), + ...addForm.getFormParams() + }; + this.handleCreateUpSituation(payload); }} - 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 + editId={!_.isEmpty(editId) ? { ...editId, declareMonth: editId.taxYearMonth } : editId} + condition={dataCollectCondition}/> : + + this.setState({ slideSelectedKey: val })} + /> } - onClose={() => setSlideVisiable(false)} + onClose={() => { + setSlideVisiable(false); + this.setState({ + addVisible: false, + editId: {} + }); + }} showMask={true} - closeMaskOnClick={() => setSlideVisiable(false)} + closeMaskOnClick={() => { + setSlideVisiable(false); + this.setState({ + 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/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/index.less new file mode 100644 index 00000000..b583068d --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/index.less @@ -0,0 +1,21 @@ +.tipWrapper{ + display: flex; + flex-direction: column; + margin: 0 25px 20px 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/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js index 96d3f6b4..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, @@ -144,7 +134,7 @@ export default class EditSlideContent extends React.Component { {currentRecord.username} - 申报月份 + 税款所属期
{ this.setState({ @@ -56,7 +61,7 @@ export default class OtherDeduct extends React.Component { return (
- 申报月份: + 税款所属期: { const { otherDeductStore: { getTableDatas } } = this.props; const { monthValue, taxAgentId } = this.state; let params = {}; @@ -233,7 +238,150 @@ export default class OtherDeduct extends React.Component { params.taxAgentId = taxAgentId; } getTableDatas(params); - } + }; + + //新功能 + handleCreateData = (payload) => { + const { editId }= this.state; + this.setState({ saveLoading: true }); + if (!_.isEmpty(editId)) { + API.editData({ ...payload, id: editId.id }).then(({ status, errormsg }) => { + 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(errormsg || "编辑失败"); + } + }); + } else { + API.createData(payload).then(({ status, errormsg }) => { + 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(errormsg || "新增失败"); + } + }); + } + }; + handleOperate = ({ key }, row) => { + const { monthValue: declareMonth, taxAgentId } = this.state; + const { otherDeductStore: { doSearch } } = this.props; + if (key === "edit") { + this.setState({ + addVisible: true + },()=>{ + API.getData({ id: row.id }).then(({ status, data }) => { + if (status) { + this.setState({ editId: data }); + } + }); + }); + } 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, errormsg }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error(errormsg || "删除失败"); + } + }); + } + }); + } + }; + 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, errormsg }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error(errormsg || "删除失败"); + } + }); + }, + 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, errormsg }) => { + if (status) { + message.success("删除成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error(errormsg || "删除失败"); + } + }); + } + }); + }; render() { const { otherDeductStore, taxAgentStore } = this.props; @@ -251,7 +399,8 @@ export default class OtherDeduct extends React.Component { doSearch, setShowSearchAd, previewImport, - importFile + importFile, + addForm } = otherDeductStore; const { taxAgentOption, showOperateBtn } = taxAgentStore; const { @@ -267,13 +416,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, editId, saveLoading } = this.state; const detailSelectedRowKeys = toJS(slideTableStore.selectedRowKeys) || []; - if (!hasRight && !loading) { - // 无权限处理 - return renderNoright(); - } const rightMenu = [ // 右键菜单 @@ -364,6 +509,26 @@ export default class OtherDeduct extends React.Component { } type="ghost"> 导出全部 + , + , + + 删除所选 + + } + type="ghost"> + 一键清空 ]; @@ -437,8 +602,6 @@ export default class OtherDeduct extends React.Component { if (item.dataIndex === "username") { return { ...item, - width: 100, - fixed: "left", render: (text, record) =>
this.onEdit(record)}> @@ -448,26 +611,37 @@ 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 { return { ...item }; } }); + if (_.isEmpty(newColumns)) { + return renderLoading(); + } return (
@@ -501,7 +675,6 @@ export default class OtherDeduct extends React.Component { dataSource={dataSource} pagination={pagination} loading={loading} - scroll={{ x: 1300 }} /> @@ -538,36 +711,70 @@ 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(_.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId"]), v => !_.isEmpty(v)); + if (!bool && _.isEmpty(editId)) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + const payload = { + ..._.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId", "taxAgentName"]), + ...addForm.getFormParams() + }; + this.handleCreateData(payload); }} - editable={false} + loading={saveLoading} + editable={!!addVisible} showOperateBtn={showOperateBtn} - customOperate={showOperateBtn ? renderBtns() : []} + customOperate={(showOperateBtn && !addVisible) ? renderBtns() : []} /> } content={ - - this.setState({ slideSelectedKey: val })} - /> + addVisible ? + this.addItemRef = dom} + taxAgentOption={taxAgentOption} + form={addForm} + editId={editId} + condition={dataCollectCondition} + /> : + + this.setState({ slideSelectedKey: val })} + /> } - onClose={() => setSlideVisiable(false)} + onClose={() => { + setSlideVisiable(false); + this.setState({ + addVisible: false, + editId: {} + }); + }} showMask={true} - closeMaskOnClick={() => setSlideVisiable(false)} + closeMaskOnClick={() => { + setSlideVisiable(false); + this.setState({ + 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/declare/generateModal.js b/pc4mobx/hrmSalary/pages/declare/generateModal.js index 5ae0e1e1..8bc9e95e 100644 --- a/pc4mobx/hrmSalary/pages/declare/generateModal.js +++ b/pc4mobx/hrmSalary/pages/declare/generateModal.js @@ -43,7 +43,8 @@ export default class GenerateModal extends React.Component { render() { const { - taxAgentStore: { taxAgentAdminOption } + taxAgentStore: { taxAgentAdminOption }, + declareStore: { loading } } = this.props; return ( { this.handleGenerate(); }}> diff --git a/pc4mobx/hrmSalary/pages/ledger/calcRulesForm.js b/pc4mobx/hrmSalary/pages/ledger/calcRulesForm.js index 4306a345..5958e987 100644 --- a/pc4mobx/hrmSalary/pages/ledger/calcRulesForm.js +++ b/pc4mobx/hrmSalary/pages/ledger/calcRulesForm.js @@ -5,6 +5,7 @@ import { slideStep4Columns } from "./columns"; import "./index.less"; import RuleEditModal from "./step4/RuleEditModal"; import { inject, observer } from "mobx-react"; +import { toJS } from 'mobx'; @inject("ledgerStore") @observer @@ -48,8 +49,13 @@ export default class CalRulesForm extends React.Component { } convertAdjustmentType(index) { - let nameList = ["取调整后薪资", "分段计薪", "取平均"]; - return nameList[Number(index) - 1]; + let nameList = { + 1: '取调薪前薪资', + 2: '取调薪后薪资', + 3: '平均值', + 4: '分段计薪', + }; + return nameList[Number(index)]; } getSalaryItemName(salaryItemId) { @@ -75,7 +81,6 @@ export default class CalRulesForm extends React.Component { rule: resultStr }; }); - } render() { diff --git a/pc4mobx/hrmSalary/pages/ledger/index.js b/pc4mobx/hrmSalary/pages/ledger/index.js index 5051c138..80474093 100644 --- a/pc4mobx/hrmSalary/pages/ledger/index.js +++ b/pc4mobx/hrmSalary/pages/ledger/index.js @@ -16,7 +16,6 @@ import SlideModalTitle from "../../components/slideModalTitle"; import CopyFormModal from "./copyFormModal"; import "./index.less"; - @inject("ledgerStore", "taxAgentStore") @observer export default class Ledger extends React.Component { diff --git a/pc4mobx/hrmSalary/pages/ledger/index.less b/pc4mobx/hrmSalary/pages/ledger/index.less index f735565b..219586a4 100644 --- a/pc4mobx/hrmSalary/pages/ledger/index.less +++ b/pc4mobx/hrmSalary/pages/ledger/index.less @@ -326,3 +326,7 @@ border-radius: 0; } } + +//.ant-modal-body { +// overflow: auto; +//} diff --git a/pc4mobx/hrmSalary/pages/ledger/slideRefereUser.js b/pc4mobx/hrmSalary/pages/ledger/slideRefereUser.js index 58645741..b55ed5a4 100644 --- a/pc4mobx/hrmSalary/pages/ledger/slideRefereUser.js +++ b/pc4mobx/hrmSalary/pages/ledger/slideRefereUser.js @@ -50,6 +50,7 @@ export default class SlideRefereUser extends React.Component { } = this.props; getLedgerPersonRangeInclude({ salarySobId: salarySobId }); if (edit) getLedgerBasicForm(); + // window.setLayoutWindow=window; } onSelectChange = selectedRowKeys => { diff --git a/pc4mobx/hrmSalary/pages/ledger/step4/RuleEditModal.js b/pc4mobx/hrmSalary/pages/ledger/step4/RuleEditModal.js index 5b5e28ff..bf8876cc 100644 --- a/pc4mobx/hrmSalary/pages/ledger/step4/RuleEditModal.js +++ b/pc4mobx/hrmSalary/pages/ledger/step4/RuleEditModal.js @@ -15,7 +15,7 @@ export default class RuleEditModal extends React.Component { this.state = { itemValue: "", effectiveDate: "", - beforeAdjustmentType: 1, + beforeAdjustmentType: 2, afterAdjustmentType: 1, initedSelect: false }; @@ -150,8 +150,8 @@ export default class RuleEditModal extends React.Component { { this.beforeAdjustmentTypeChange(value); }} value={beforeAdjustmentType}> - 取调整后薪资 - 分段计薪取调整后薪资 + 分段计薪 取调整前薪资 - 分段计薪分段计薪 { this.setState({ mySalaryBillData: result - }) - }) - } + }); + }); + }; render() { - const { mySalaryBillData }= this.state; + const { mySalaryBillData } = this.state; const type = getQueryString("type"); const employeeInformation = mySalaryBillData.employeeInformation ? mySalaryBillData.employeeInformation : {}; const salaryGroups = mySalaryBillData.salaryGroups ? mySalaryBillData.salaryGroups : []; @@ -64,7 +65,7 @@ export default class MobilePayroll extends React.Component { isPreview isMsgPreview salaryTemplateShowSet={JSON.stringify(mySalaryBillData.salaryTemplate)} - salaryItemSet={!_.isEmpty(salaryGroups) ? JSON.stringify([employeeInformation, ...salaryGroups]) : []} + salaryItemSet={!_.isEmpty(salaryGroups) ? JSON.stringify([employeeInformation, ...salaryGroups]) : JSON.stringify([])} /> }
diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js index b6ddd000..f1616003 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js @@ -73,9 +73,11 @@ export default class ComputerTemplate extends React.Component { const { salaryTemplateShowSet, salaryItemSet } = this.state; return (
-
- {salaryTemplateShowSet.theme.replace("${companyName}", "").replace("${salaryMonth}", moment(new Date()).format("YYYY-MM"))} -
+ {salaryTemplateShowSet.theme && +
+ {salaryTemplateShowSet.theme.replace("${companyName}", "").replace("${salaryMonth}", moment(new Date()).format("YYYY-MM"))} +
+ } { salaryTemplateShowSet.background &&
diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js index 04103886..74dd4b0e 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js @@ -21,7 +21,13 @@ class ImportMenu extends Component { } salaryArchivePreview = (params) => { - params.importType = this.state.importParams.importType; + if (this.state.importParams.importType === "init" || this.state.importParams.importType === "salaryItemAdjust") { + params.importType = this.state.importParams.importType; + params.listType = "FIXED"; + } else { + params.listType = this.state.importParams.importType; + params.importType = ''; + } API.salaryArchivePreview(params).then(({ status, data }) => { if (status) { const { headers, list } = data; @@ -77,16 +83,22 @@ class ImportMenu extends Component { handleInitModal = () => { // 清空列表数据 this.setState({ - previewDataSource:[], + previewDataSource: [], importParams: { ...this.state.importParams, - importResult:{}, + importResult: {} } }); }; // 导入档案 handleImportFile = (params) => { - params.importType = this.state.importParams.importType; + if (this.state.importParams.importType === "init" || this.state.importParams.importType === "salaryItemAdjust") { + params.importType = this.state.importParams.importType; + params.listType = "FIXED"; + } else { + params.importType = ''; + params.listType = this.state.importParams.importType; + } API.importSalaryArchive(params).then(({ status, data }) => { if (status) { data.errorData = data.errorNotice; @@ -103,6 +115,12 @@ class ImportMenu extends Component { render() { const { importType, refreshList } = this.props; const { importParams, previewColumns, previewDataSource } = this.state; + let params = ""; + if (importParams.importType === "init" || importParams.importType === "salaryItemAdjust") { + params = importParams.importType + "&listType=FIXED"; + } else { + params = "" + "&listType=" + importParams.importType; + } return ( @@ -134,8 +152,7 @@ class ImportMenu extends Component { previewImport={(params) => this.salaryArchivePreview(params)} importFile={(params) => this.handleImportFile(params)} templateLink={ - "/api/bs/hrmsalary/salaryArchive/downloadTemplate?importType=" + - importParams.importType + "/api/bs/hrmsalary/salaryArchive/downloadTemplate?importType=" + params } visiable={importParams.visible} onCancel={() => { diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index 5ee14399..bee13a3e 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -223,7 +223,7 @@ class Index extends Component { onOk: () => { API.allGotoFixed({}).then(({ status, data, errormsg }) => { if (status) { - const { msg }= data; + const { msg } = data; message.info(msg || "操作成功!"); this.query(); } else { @@ -293,20 +293,12 @@ class Index extends Component { const { taxAgentStore: { showOperateBtn } } = this.props; if (selectedKey === "pending" && showOperateBtn) { return [ - it.id !== "salaryItemAdjust")} - refreshList={() => { - this.query(); - this.setState({ selectedRowKeys: [] }); - }}/>}> - - , - }> - , + }> + @@ -328,13 +320,14 @@ class Index extends Component { this.setState({ selectedRowKeys: [] }); }}/> }> - , - }> - @@ -357,29 +350,20 @@ class Index extends Component { verticalAlign: "middle" }}/> , - , - it.id !== "salaryItemAdjust")} - refreshList={() => { - this.query(); - this.setState({ selectedRowKeys: [] }); - }}/> - }> - - , - }> - , + , + }> + @@ -396,13 +380,14 @@ class Index extends Component { }} /> }> - , - }> - @@ -415,29 +400,34 @@ class Index extends Component { const { pageInfo, selectedKey } = this.state; const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props; let columns = _.filter(toJS(tableStore.columns), (item) => item.display === "true"); - return _.map([{ - title: "序号", - dataIndex: "index", - align: "left", - oldWidth: 60, - render: (text, record, index) => { - const { current, pageSize } = pageInfo; - return (current - 1) * pageSize + index + 1; - } - }, ...columns], (item, index) => { + return _.map([ + // { + // title: "序号", + // dataIndex: "index", + // align: "left", + // oldWidth: 60, + // render: (text, record, index) => { + // const { current, pageSize } = pageInfo; + // return (current - 1) * pageSize + index + 1; + // } + // }, + ...columns], (item, index) => { if (index === 0) { - return { ...item, width: item.oldWidth, fixed: "left" }; + // , fixed: "left" + // , width: item.oldWidth + return { ...item }; } if (item.dataIndex === "operate") { return { - ...item, fixed: "right", - width: 150, + ...item, + // fixed: "right", + // width: 150, render: (text, record) => { - if(!showOperateBtn){ + if (!showOperateBtn) { return ; - }else{ + } else { if (selectedKey === "pending") { return
this.handleEdit(record)}>编辑 @@ -461,7 +451,7 @@ class Index extends Component { placement="bottomRight" content={ this.handleMenuClick(e, record.id)}> 停薪 - 删除待办 + {/*删除待办*/} } title=""> @@ -483,7 +473,8 @@ class Index extends Component { } }; } - return { ...item, width: item.oldWidth }; + // , width: item.oldWidth + return { ...item }; }); }; handleEdit = (record) => { @@ -563,7 +554,7 @@ class Index extends Component { handleSave = () => { const { paysetParams, selectedKey } = this.state; const { salaryFileStore: { adjustSalaryItems, detailForm } } = this.props; - if ((selectedKey === "pending" && _.isEmpty(paysetParams.payStartDate)) || (selectedKey !== "pending" && _.isEmpty(paysetParams.payEndDate))) { + if ((selectedKey === "pending" && _.isEmpty(paysetParams.payStartDate)) || (selectedKey === "suspend" && _.isEmpty(paysetParams.payEndDate))) { Modal.warning({ title: "信息确认", content: "必要信息不完整,红色*为必填项!" @@ -734,7 +725,7 @@ class Index extends Component { columns={this.getColumns()} dataSource={dataSource} pagination={pagination} // rowClassName={(record) => record.archiveStatus === "ARCHIVE" ? "archiveRow" : ""} rowSelection={rowSelection} - scroll={{ x: 1200 }} + // scroll={{ x: 1200 }} /> +
+ this.importRef = dom} + refreshList={() => { + this.query(); + this.setState({ selectedRowKeys: [] }); + }}/> +
{slideParams.visible && ( { - this.setState({ loading: { ...this.state.loading, encry: false } }); - if (status) { - const { isSuccess, progressId, msg } = data; - if(!isSuccess){ - message.error(errormsg || msg || "保存失败!"); - return - } - this.setState({ - progressVisible: true - }, () => { - let number=1 ; - this.timer && clearInterval(this.timer); - this.timer = setInterval(() => { - API.getEncryptProgress({ progressId }).then(({status, data, errormsg}) => { - const { progress_statue }= data; - if (progress_statue === "success" && this.timer) { - clearInterval(this.timer); - this.timer = null; - number=1; - this.setState({ - progressVisible: false, - progress: 100 + Modal.confirm({ + title: "信息确认", + content: "开启/关闭加密前请做好数据库备份!!!逆向解密会花费几分钟时间,请耐心等待!!!", + onOk: () => { + this.setState({ loading: { ...this.state.loading, encry: true } }); + API.saveEncryptSetting({ isOpenEncrypt: saveParams.enctry }).then(({ data, status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, encry: false } }); + if (status) { + const { isSuccess, progressId, msg } = data; + if (!isSuccess) { + message.error(errormsg || msg || "保存失败!"); + return; + } + this.setState({ + progressVisible: true, + progress: 0 + }, () => { + let number = 1; + this.timer && clearInterval(this.timer); + this.timer = setInterval(() => { + API.getEncryptProgress({ progressId }).then(({ status, data, errormsg }) => { + const { progress_statue } = data; + if (progress_statue === "success" && this.timer) { + clearInterval(this.timer); + this.timer = null; + number = 1; + this.setState({ + progress: 100 + }, () => { + this.setState({ + progressVisible: false + }); + }); + message.success("保存成功"); + } else if (progress_statue === "in_progress" && this.timer) { + if (this.state.progress >= 90) { + this.setState({ + progress: this.state.progress + (0.001 * this.state.progress) + }); + } else { + this.setState({ + progress: 10 * number + }, () => number++); + } + } else if (!status || (progress_statue === "fail" && this.timer)) { + clearInterval(this.timer); + this.timer = null; + number = 1; + this.setState({ + progress: 100 + }, () => { + this.setState({ + progressVisible: false + }); + }); + message.error(errormsg || "保存失败!"); + } }); - message.success("加密成功"); - } else if(progress_statue === "in_progress" && this.timer){ - this.setState({ - progress: 10 * number - }, ()=> number++ ); - }else if (!status || (progress_statue === "fail" && this.timer)) { - clearInterval(this.timer); - this.timer = null; - number=1; - this.setState({ - progressVisible: false, - progress: 100 - }); - message.error(errormsg || "加密失败!"); - } + }, 1000); }); - }, 1000); + } }); + }, + onCancel: () => { } }); } @@ -249,16 +270,17 @@ class Index extends Component { title={
人员校验规则 - +
} showGroup center items={importItems}/> - {/**/} - {/* 加密规则*/} - {/* */} - {/*
*/} - {/* } showGroup center items={enctryItems}/>*/} + + 加密规则 + +
+ } showGroup center items={enctryItems}/> { this.state.progressVisible && { - const { label, onChange, value, options = [] } = payload; +export const Select = payload => { + const { label, onChange, value, options = [], viewAttr=3 } = payload; return ( - onChange({ type: label, selected })}/> + onChange({ type: label, selected, showName })}/> ); }; diff --git a/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js b/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js index 70e498d8..0be1e741 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js @@ -95,7 +95,7 @@ export default class SalaryFileViewSlide extends React.Component { { com: PickDate({ label: "最后发薪日期", - viewAttr: selectedKey === "pending" ? 2 : selectedKey === "stop" ? 1 : 3, + viewAttr: (selectedKey === "pending" || selectedKey === "fixed") ? 2 : selectedKey === "stop" ? 1 : 3, value: paysetParams.payEndDate, onChange: handleSetpay }) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index 40210edd..34df10d7 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -205,7 +205,7 @@ export default class CustomSalaryItemSlide extends React.Component { }} onClick={() => { if (this.props.record.canEdit || isAdd) { - this.handleShowFormal(); + editable && this.handleShowFormal(); } }}> {formulaContent} diff --git a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js index 8d9cd46d..5b01e4b1 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js @@ -24,6 +24,7 @@ export default class FormalFormModal extends React.Component { this.field = {}; this.parameters = []; this.referenceType = ""; + this.timer = null; } componentWillMount() { @@ -73,6 +74,33 @@ export default class FormalFormModal extends React.Component { this.formulaDatasourceList(); } + componentWillUnmount() { + clearTimeout(this.timer); + } + + triggerKeyDown = (e) => { + let propsTextarea = this.contentProps.refs.textareaNormal.refs.input.refs.input; // 获取dom节点实例 + const { value } = this.state; + if (e.key === "Backspace" && value) { + const { end } = this.getPositionForTextArea(propsTextarea); + const str = value.substring(end - 1, end); + if (str === "}") { + e.preventDefault(); + const index = value.lastIndexOf("{", end - 1); + const currentValue = value.substring(index, end); + this.setState({ + value: value.replace(currentValue, "") + }, () => { + if (propsTextarea.setSelectionRange) { + this.timer = setTimeout(() => { + propsTextarea.setSelectionRange(index, index); + }, 0); + } + }); + } + } + }; + formulaDatasourceList = () => { const { salaryItemStore } = this.props; const { formulaDatasourceList } = salaryItemStore; @@ -271,9 +299,11 @@ export default class FormalFormModal extends React.Component { ref={(input) => this.contentProps = input} minRows={8} maxRows={8} - value={value} onChange={(value) => this.handleChange(value)} + value={value} + onChange={(value) => this.handleChange(value)} noResize={true} style={{ fontSize: "14px", lineHeight: 1.2 }} + onKeyDown={this.triggerKeyDown} />
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index eaa343a4..b1de5c9a 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -75,7 +75,7 @@ export default class SalaryItem extends React.Component { const { salaryItemStore: { deleteItemRequest, getTableDatas } } = this.props; Modal.confirm({ title: "信息确认", - content: "确认删除", + content: "确认删除该条数据吗?", onOk: () => { deleteItemRequest([record.id]).then(() => { getTableDatas({ ...this.state.searchParams }).then(res => { @@ -143,7 +143,7 @@ export default class SalaryItem extends React.Component { }}>删除 }> - + ); } else { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js index 0e1d8e91..85faec6e 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js @@ -1,7 +1,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; -import { Col, Row, Select } from "antd"; -import { WeaCheckbox, WeaDatePicker, WeaInput } from "ecCom"; +import { Col, Row } from "antd"; +import { WeaCheckbox, WeaDatePicker, WeaInput, WeaInputNumber, WeaSelect } from "ecCom"; import GroupCard from "../../../components/groupCard"; import cs from "classnames"; import "./index.less"; @@ -12,25 +12,27 @@ export default class AccumulationFundForm extends React.Component { componentWillMount() { const { archivesStore: { getBaseForm, getPaymentForm } } = this.props; - getBaseForm(this.props.employeeId, "ACCUMULATION_FUND"); - getPaymentForm(this.props.employeeId, "ACCUMULATION_FUND", this.props.record.fundSchemeId); + getBaseForm(this.props.employeeId, "ACCUMULATION_FUND", this.props.record.paymentOrganization); + getPaymentForm(this.props.employeeId, "ACCUMULATION_FUND", this.props.record.fundSchemeId, this.props.record.paymentOrganization); } // 表单变化 handleFormChange(params) { - const { archivesStore: { accumulationFundForm, setAccumulationFundForm, getPaymentForm } } = this.props; + const { archivesStore: { accumulationFundForm, setAccumulationFundForm }, onChangeRecordFundSchemeId } = this.props; const { data } = accumulationFundForm; let request = { ...data, ...params }; request.fundName = request.fundSchemeId; let form = { ...accumulationFundForm }; form.data = request; setAccumulationFundForm(form); + Object.keys(params).length>1 && + onChangeRecordFundSchemeId(params.fundSchemeId) } // 获取基数表单 handleFetchPaymentForm(fundName) { const { archivesStore: { getPaymentForm } } = this.props; - getPaymentForm(this.props.employeeId, "ACCUMULATION_FUND", fundName); + getPaymentForm(this.props.employeeId, "ACCUMULATION_FUND", fundName, this.props.record.paymentOrganization); } @@ -80,18 +82,20 @@ export default class AccumulationFundForm extends React.Component { 公积金方案名称: - { - this.handleFormChange({ underTake: value }); - }}> - { - items && items[0].items && items[0].items[2] && items[0].items[2].options.map(item => ( - - )) - } - + { + this.handleFormChange({ underTake: value }); + }} + /> {/**/} @@ -160,13 +161,14 @@ export default class AccumulationFundForm extends React.Component { className={cs("formItem", "borderR-none")}>{item.label}: - { - this.handlePaymentChange({ [item.domkey[0]]: value }); + this.handlePaymentChange({ [item.domkey[0]]: String(value) }); }} /> - diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js index 3ed6ced7..03be2c76 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js @@ -48,7 +48,7 @@ export default class BaseForm extends React.Component { {baseFormData.telephone} - 离职时间: + 合同到期日期: {baseFormData.dimissionDate} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index dddddc66..8dc5139c 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -12,6 +12,7 @@ import OtherForm from "./otherForm"; import { tabCondition } from "./config"; import * as API from "../../../apis/welfareArchive"; import ImportModal from "../../../components/importModal"; +import TipLabel from "../../../components/TipLabel"; import "./index.less"; @inject("archivesStore", "taxAgentStore") @@ -141,10 +142,10 @@ export default class Archives extends React.Component { { - if(key === "addMember"){ + content={ { + if (key === "addMember") { this.stayAddToPay([record.baseInfo]); - }else{ + } else { Modal.warning({ title: "信息确认", content: `确定要删除该条待办人员吗?`, @@ -175,7 +176,7 @@ export default class Archives extends React.Component { } }}> 减员 - 删除待办 + {/*删除待办*/} } title=""> @@ -200,23 +201,23 @@ export default class Archives extends React.Component { } // 保存 - handleEditSlideSave() { + handleEditSlideSave = () => { const { selectedTab } = this.state; const { archivesStore: { save } } = this.props; if (selectedTab == 1) { - save("SOCIAL_SECURITY"); + save("SOCIAL_SECURITY").then(() => { + this.query(); + }); } else if (selectedTab == 2) { - save("ACCUMULATION_FUND"); + save("ACCUMULATION_FUND").then(() => { + this.query(); + }); } else if (selectedTab == 3) { - save("OTHER"); + save("OTHER").then(() => { + this.query(); + }); } - } - - handlePageChnage(value) { - const { archivesStore: { form, getTableDatas } } = this.props; - this.pageInfo.current = value; - getTableDatas(this.pageInfo); - } + }; // 导入 handleBtnImport(runStatus) { @@ -284,6 +285,7 @@ export default class Archives extends React.Component { const { pageInfo } = this.state; this.setState({ selectedKey, + selectedRowKeys: [], editSlideVisible: false, pageInfo: { ...pageInfo, @@ -433,18 +435,67 @@ export default class Archives extends React.Component { }); }; + getTipChildren = () => { + const { selectedKey } = this.state; + let dom = null; + switch (selectedKey) { + case "pending": + dom =
+ {/*
1、新入职人员、返聘人员和个税扣缴义务人发生变更从【待减员】中减员操作的会进入【待增员】;
*/} + {/*
2、返聘人员默认返聘前的社保福利缴纳方案、缴纳账号、缴纳组织数据,其他数据会清空;
*/} +
1、个税扣缴义务人变更进入【待增员】的,保留所有最新版本数据;若修改了数据再增员则修改的数据作为新版本保存;
+
2、维护好员工的社保福利档案数据后,点击【增员】,数据会进入【在缴员工】;
+
3、若不需给该员工缴纳,可点击【删除待办】进入【停缴员工】;进入【停缴员工】后,可以点击【取消停缴】再次进入【待增员】;
+
4、不管起始缴纳月维护到哪个月,都可以进行增员,不影响核算判断;若维护了最后缴纳月,且小于等于当前月,则增员失败;
+
5、增员失败情况:①终止缴纳月小于等于当前月;②方案或起始缴纳月未维护;
+ {/* ②其他的个税扣缴义务人下的在缴员工中存在该员工,在缴员工未进入停缴员工;*/} +
; + break; + case "fixed": + dom =
+
1、需缴纳社保福利的员工维护在【在缴员工】;
+
2、可使用更新导入,调整档案数据;
+
3、若维护了最后缴纳月且小于等于当前月,则自动进入【待减员】;
+
4、核算人员范围为,【在缴员工】中的起始缴纳月和最后缴纳月区间包含当前月的人员;
+
; + break; + case "suspend": + dom =
+
1、数据进入【待减员】规则:①员工的人事状态属性从在职变成非在职,且在【在缴员工】里;②【在缴员工】里档案维护了缴纳终止月且小于等于当前月;③个税扣缴义务人发生调整;④某员工分权时在原个税扣缴义务人下处于【在缴员工】里但又将该员工添加到其他的个税扣缴义务人下的情况;
+
2、【待减员】为是否不再缴纳的待办状态,数据是从【在缴员工】中复制的,若不处理列表中的待办数据,也不影响社保福利核算;【待减员】维护的数据和【在缴员工】数据是同步的;
+
3、点击【减员】前先维护最后缴纳月,所有有起始缴纳月的福利项的最后缴纳月都小于等于当前月且无未归档的核算数据的档案才能减员成功,减员成功后数据进入【停缴员工】;
+ {/*
4、数据进入【待减员】规则的第四种情况下,若还需要在当前个税扣缴义务人下进行缴纳的话,当前该员工的【待减员】数据进行【删除待办】操作即可;若不在该个税扣缴义务人下继续缴纳,维护好最后缴纳月后进行【减员】操作,员工进入【停缴员工】;
*/} +
; + break; + default: + dom =
+
1、不需要缴纳社保福利的员工,保存在【停缴员工】;
+
2、【停缴员工】点击取消停缴,数据会回退到上次的位置(从【待减员】减员到停缴员工的,点击停缴返回到【在缴员工】,不返回到【待减员】);
+ {/*
3、若员工的社保福利从一个个税扣缴义务人下转到另一个个税扣缴义务人下去缴纳,则在转后的个税扣缴义务人的【待增员】中进行增员操作成功后,员工进入待【在缴员工】,而在原个税扣缴义务人下的【停缴员工】中,该员工数据将会被删除;是否开启分权员工的档案数据都只保存一份;
*/} +
; + break; + } + return dom; + }; + render() { const { archivesStore, taxAgentStore: { showOperateBtn } } = this.props; - const { selectedTab, selectedRowKeys, selectedKey, dataSource: dataSourceActive, pageInfo, tabCount } = this.state; const { - loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd, - previewCurDataColumns, previewCurDataDataSource, importResult, initImportParams + selectedTab, + selectedRowKeys, + selectedKey, + dataSource: dataSourceActive, + pageInfo, + tabCount, + loading + } = this.state; + const { + form, condition, showSearchAd, setShowSearchAd, + previewCurDataColumns, previewCurDataDataSource, importResult } = archivesStore; - const { dataSource } = archivesStore; if (_.isEmpty(this.getColumns())) { // 无权限处理 return renderLoading(); } - const rightMenu = [// 右键菜单 // { // key: 'BTN_COLUMN', @@ -484,7 +535,7 @@ export default class Archives extends React.Component { url = `${url}&runStatuses=3`; break; default: - url = `${url}&runStatuses=4`; + url = `${url}&runStatuses=4,5`; break; } window.open(url, "_self"); @@ -510,7 +561,7 @@ export default class Archives extends React.Component { url = `${url}&runStatuses=3`; break; default: - url = `${url}&runStatuses=4`; + url = `${url}&runStatuses=4,5`; break; } window.open(url, "_self"); @@ -658,6 +709,10 @@ export default class Archives extends React.Component { rowSelection={rowSelection} scroll={{ x: 1200 }} /> + { + !_.isEmpty(this.getColumns()) && + {this.getTipChildren()} + } { @@ -697,14 +752,14 @@ export default class Archives extends React.Component { } { selectedTab == 1 && - + this.record= {...this.record,siSchemeId}}/> } { selectedTab == 2 && - + this.record= {...this.record,fundSchemeId}}/> } { - selectedTab == 3 && + selectedTab == 3 && this.record= {...this.record,otherSchemeId}}/> }
} onClose={() => this.setState({ editSlideVisible: false }, () => { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js index ceff0bf9..c60da390 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js @@ -1,7 +1,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { Col, Row, Select } from "antd"; -import { WeaCheckbox, WeaDatePicker, WeaInput } from "ecCom"; +import { WeaCheckbox, WeaDatePicker, WeaInputNumber, WeaSelect } from "ecCom"; import GroupCard from "../../../components/groupCard"; import "./index.less"; @@ -19,24 +19,26 @@ export default class OtherForm extends React.Component { componentWillMount() { const { archivesStore: { getBaseForm, getPaymentForm } } = this.props; - getBaseForm(this.props.employeeId, "OTHER"); - getPaymentForm(this.props.employeeId, "OTHER", this.props.record.otherSchemeId); + getBaseForm(this.props.employeeId, "OTHER", this.props.record.paymentOrganization); + getPaymentForm(this.props.employeeId, "OTHER", this.props.record.otherSchemeId, this.props.record.paymentOrganization); } // 获取基数表单 handleFetchPaymentForm(value) { const { archivesStore: { getPaymentForm } } = this.props; - getPaymentForm(this.props.employeeId, "OTHER", value); + getPaymentForm(this.props.employeeId, "OTHER", value, this.props.record.paymentOrganization); } // 表单变化 handleFormChange(params) { - const { archivesStore: { otherForm, setOtherForm } } = this.props; + const { archivesStore: { otherForm, setOtherForm }, onChangeRecordOtherSchemeId } = this.props; const { data } = otherForm; let request = { ...data, ...params }; let form = { ...otherForm }; form.data = request; setOtherForm(form); + Object.keys(params).length>1 && + onChangeRecordOtherSchemeId(params.otherSchemeId) } //基数变化 @@ -86,18 +88,17 @@ export default class OtherForm extends React.Component { 其他福利方案名称: - + { + this.handleFormChange({ otherName: showname, otherSchemeId: value }); + this.handleFetchPaymentForm(value); + }}/> @@ -112,14 +113,14 @@ export default class OtherForm extends React.Component { 其他福利个人实际承担方: - + { + this.handleFormChange({ underTake: value }); + }} + /> {/**/} @@ -150,13 +151,14 @@ export default class OtherForm extends React.Component { {item.label}: - { - this.handlePaymentChange({ [item.domkey[0]]: value }); + this.handlePaymentChange({ [item.domkey[0]]: String(value) }); }} /> - diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js index 016cea47..8e4ab2fb 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js @@ -1,7 +1,7 @@ import React from "react"; import GroupCard from "../../../components/groupCard"; import { Col, Row, Select } from "antd"; -import { WeaCheckbox, WeaDatePicker, WeaInput } from "ecCom"; +import { WeaCheckbox, WeaDatePicker, WeaInput, WeaInputNumber, WeaSelect } from "ecCom"; import { inject, observer } from "mobx-react"; import cs from "classnames"; import "./index.less"; @@ -14,24 +14,26 @@ export default class SocialSecurityForm extends React.Component { componentWillMount() { const { archivesStore } = this.props; const { getBaseForm, getPaymentForm } = archivesStore; - getBaseForm(this.props.employeeId, "SOCIAL_SECURITY"); - getPaymentForm(this.props.employeeId, "SOCIAL_SECURITY", this.props.record.siSchemeId); + getBaseForm(this.props.employeeId, "SOCIAL_SECURITY", this.props.record.paymentOrganization); + getPaymentForm(this.props.employeeId, "SOCIAL_SECURITY", this.props.record.siSchemeId, this.props.record.paymentOrganization); } // 表单变化 handleFormChange(params) { - const { archivesStore: { socialSecurityForm, setSocialSecurityForm } } = this.props; + const { archivesStore: { socialSecurityForm, setSocialSecurityForm }, onChangeRecordSchemeId } = this.props; const { data } = socialSecurityForm; let request = { ...data, ...params }; let form = { ...socialSecurityForm }; form.data = request; setSocialSecurityForm(form); + Object.keys(params).length>1 && + onChangeRecordSchemeId(params.socialSchemeId) } // 获取基数表单 handleFetchPaymentForm(value) { const { archivesStore: { getPaymentForm } } = this.props; - getPaymentForm(this.props.employeeId, "SOCIAL_SECURITY", value); + getPaymentForm(this.props.employeeId, "SOCIAL_SECURITY", value, this.props.record.paymentOrganization); } //基数变化 @@ -84,21 +86,18 @@ export default class SocialSecurityForm extends React.Component { 社保方案名称: - + /> @@ -135,22 +134,14 @@ export default class SocialSecurityForm extends React.Component { {/**/} 社保个人实际承担方: - + onChange={(value) => { + this.handleFormChange({ underTake: value }); + }} + /> @@ -171,10 +162,12 @@ export default class SocialSecurityForm extends React.Component { "borderR-none": idx === 0 || idx === 2, "borderB-none": idx === 0 || idx === 2 || idx === 1 })}> - { - this.handlePaymentChange({ [item.domkey[0]]: value }); + this.handlePaymentChange({ [item.domkey[0]]: String(value) }); }} /> diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js index 349ea720..2f45ede4 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js @@ -1,144 +1,154 @@ // 社保 export const socialSecurityColumns = [{ - title: "方案名称", - dataIndex: 'title', - key: 'title', + title: "方案名称", + dataIndex: "title", + key: "title" }, { - title: '缴纳类型', - dataIndex: 'username', - key: 'username', + title: "缴纳类型", + dataIndex: "username", + key: "username" }, { - title: '缴纳范围', - dataIndex: 'projectName', - key: 'projectName', + title: "缴纳范围", + dataIndex: "projectName", + key: "projectName" }, { - title: '备注', - dataIndex: 'customer', - key: 'customer', + title: "备注", + dataIndex: "customer", + key: "customer" }, { - title: '操作', - dataIndex: 'customer', - key: 'customer', + title: "操作", + dataIndex: "customer", + key: "customer" }]; // 公积金 -export const accumulationFundColumns= [{ - title: "方案名称", - dataIndex: 'title', - key: 'title', +export const accumulationFundColumns = [{ + title: "方案名称", + dataIndex: "title", + key: "title" }, { - title: '缴纳类型', - dataIndex: 'username', - key: 'username', + title: "缴纳类型", + dataIndex: "username", + key: "username" }, { - title: '缴纳范围', - dataIndex: 'projectName', - key: 'projectName', + title: "缴纳范围", + dataIndex: "projectName", + key: "projectName" }, { - title: '备注', - dataIndex: 'customer', - key: 'customer', + title: "备注", + dataIndex: "customer", + key: "customer" }, { - title: '操作', - dataIndex: 'customer', - key: 'customer', -}] + title: "操作", + dataIndex: "customer", + key: "customer" +}]; // 企业年金及其他福利 export const otherBenefitsColumns = [ - { - 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 CustomBenefitsColumns = [ - { - 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 insertUpdateColumns = [ - { - title: "类型名称", - dataIndex: "insuranceName", - key: "insuranceName" - }, - { - title: "是否缴费", - dataIndex: "isPayment", - key: "isPayment" - }, - { - title: "缴纳对象", - dataIndex: "paymentScope", - key: "paymentScope" - }, - { - title: "缴纳比例%", - dataIndex: "paymentProportion", - key: "paymentProportion" - }, - { - title: "固定费用", - dataIndex: "fixedCost", - key: "fixedCost" - }, - { - title: "有效小数位", - dataIndex: "validNum", - key: "validNum" - }, - { - title: "进位规则", - dataIndex: "rententionRule", - key: "rententionRule" - }, -] + { + title: "类型名称", + dataIndex: "insuranceName", + key: "insuranceName" + }, + { + title: "是否缴费", + dataIndex: "isPayment", + key: "isPayment" + }, + { + title: "缴纳对象", + dataIndex: "paymentScope", + key: "paymentScope" + }, + { + title: "基数下限", + dataIndex: "lowerLimit", + key: "lowerLimit" + }, + { + title: "基数上限", + dataIndex: "upperLimit", + key: "upperLimit" + }, + { + title: "缴纳比例%", + dataIndex: "paymentProportion", + key: "paymentProportion" + }, + { + title: "固定费用", + dataIndex: "fixedCost", + key: "fixedCost" + }, + { + title: "有效小数位", + dataIndex: "validNum", + key: "validNum" + }, + { + title: "进位规则", + dataIndex: "rententionRule", + key: "rententionRule" + } +]; export const dataSource = []; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js index f3c77655..622e9929 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js @@ -1,6 +1,6 @@ import React from "react"; -import { WeaSelect, WeaInput, WeaTable } from "ecCom"; -import { Table, Row, Col, Switch } from "antd"; +import { WeaSelect, WeaInput, WeaTable, WeaInputNumber } from "ecCom"; +import { Row, Col, Switch } from "antd"; import { insertUpdateColumns } from "./columns"; import { inject, observer } from "mobx-react"; import SmallTab from "../../../components/smallTab"; @@ -104,7 +104,9 @@ export default class DefaultSlideForm extends React.Component { } else if (item.dataIndex == "paymentProportion") { item.render = (text, record) => { return ( - { this.updateDataSource(record, v, "paymentProportion"); @@ -115,7 +117,9 @@ export default class DefaultSlideForm extends React.Component { } else if (item.dataIndex == "fixedCost") { item.render = (text, record) => { return ( - { this.updateDataSource(record, v, "fixedCost"); @@ -123,6 +127,32 @@ export default class DefaultSlideForm extends React.Component { /> ); }; + } else if (item.dataIndex == "upperLimit") { + item.render = (text, record) => { + return ( + { + this.updateDataSource(record, v, "upperLimit"); + }} + /> + ); + }; + } else if (item.dataIndex == "lowerLimit") { + item.render = (text, record) => { + return ( + { + this.updateDataSource(record, v, "lowerLimit"); + }} + /> + ); + }; } }); } @@ -138,20 +168,35 @@ export default class DefaultSlideForm extends React.Component { } = this.props; let result = { ...record }; result[key] = e; - if (this.state.selectItem == "个人") { - let dataSource = [...defaultPersonDataSource]; + if(key === 'upperLimit' || key === 'lowerLimit'){ + let dataSource = [...defaultPersonDataSource], + dataSource_company = [...defaultCompanyDataSource]; dataSource = dataSource.map(item => { - if (item.id == result.id) return result; + if (item.insuranceName === result.insuranceName) return {...item, [key]: e, }; + else return item; + }); + dataSource_company = dataSource_company.map(item => { + if (item.insuranceName === result.insuranceName) return {...item, [key]: e }; else return item; }); setDefaultPersonDataSource(dataSource); - } else { - let dataSource = [...defaultCompanyDataSource]; - dataSource = dataSource.map(item => { - if (item.id == result.id) return result; - else return item; - }); - setDefaultCompanyDataSource(dataSource); + setDefaultCompanyDataSource(dataSource_company); + }else{ + if (this.state.selectItem == "个人") { + let dataSource = [...defaultPersonDataSource]; + dataSource = dataSource.map(item => { + if (item.id == result.id) return result; + else return item; + }); + setDefaultPersonDataSource(dataSource); + } else { + let dataSource = [...defaultCompanyDataSource]; + dataSource = dataSource.map(item => { + if (item.id == result.id) return result; + else return item; + }); + setDefaultCompanyDataSource(dataSource); + } } } @@ -167,10 +212,7 @@ export default class DefaultSlideForm extends React.Component { const { programmeStore, salaryFileStore, taxAgentStore } = this.props; const { userStatusList } = salaryFileStore; const { taxAgentAdminOption,getTaxAgentSelectListAsAdmin } = taxAgentStore; - const { - defaultPersonDataSource, - defaultCompanyDataSource, - } = programmeStore; + const { defaultPersonDataSource, defaultCompanyDataSource } = programmeStore; const options = [ { key: "", @@ -190,13 +232,9 @@ export default class DefaultSlideForm extends React.Component { ]; const handleSmallTabChange = item => { - // let paymentArea = item == "paymentArea" ? "1": "2" - // let requestParams = {...this.props.requestParams} - // requestParams.paymentArea = paymentArea this.setState({ selectItem: item.value }); - // this.props.onChange(requestParams) }; return ( diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js index 8f7c1585..c6deee37 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js @@ -94,7 +94,6 @@ export default class Programme extends React.Component { } }); newColumns.push({ - title: "", key: "moreOperate", dataIndex: "moreOperate", render: (text, record) => { @@ -121,7 +120,12 @@ export default class Programme extends React.Component { }> - + + + + ); } @@ -224,7 +228,7 @@ export default class Programme extends React.Component { } } - onCustomEdit=(record)=> { + onCustomEdit = (record) => { const { programmeStore: { getCustomForm, setCustomNewVisible, setCustomRequest }, taxAgentStore: { showOperateBtn } @@ -242,10 +246,10 @@ export default class Programme extends React.Component { insuranceName: record["insurance_name"], id: record.id, isUse: record.is_use, - paymentScope: record["payment_scope"].split(",").map(item => paymentScopeEnum[item]).join(','), + paymentScope: record["payment_scope"].split(",").map(item => paymentScopeEnum[item]).join(","), welfareType: welfareTypeEnum[record.welfare_type] }); - } + }; // 页面跳转 handlePageChange(value) { @@ -405,7 +409,6 @@ export default class Programme extends React.Component { ...defaultCompanyDataSource ] }; - if (currentOperate == "add") { createScheme(request).then(res => { if (res.status) this.setState({ slideVisiable: false }); @@ -538,7 +541,7 @@ export default class Programme extends React.Component { className="slideOuterWrapper" visible={this.state.slideVisiable} top={0} - width={50} + width={60} height={100} direction={"right"} measure={"%"} @@ -554,13 +557,14 @@ export default class Programme extends React.Component { /> } content={ - { - setRequestParams(requestParams); - }} - /> + this.state.slideVisiable ? + { + setRequestParams(requestParams); + }} + /> : null } onClose={() => { handleSlideClose(); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js index bbb547ad..3d2fa3ce 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js @@ -11,8 +11,7 @@ import AbnormalDrawer from "./components/abnormalDrawer"; import CustomPaginationTable from "../../../components/customPaginationTable"; import moment from "moment"; import _ from "lodash"; - -// import { columns, dataSource } from './columns'; +import ProgressModal from "../../../components/progressModal"; import "./index.less"; const MonthPicker = DatePicker.MonthPicker; @@ -49,7 +48,9 @@ export default class StandingBook extends React.Component { list: [], total: 0 }, - adminData: {} + adminData: {}, + progressVisible: false, + progress: 0 }; this.payload = {}; this.pageInfo = { current: 1, pageSize: 10 }; @@ -248,13 +249,6 @@ export default class StandingBook extends React.Component { `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}` ); } - - setTimeout(() => { - this.getCommonList({ - ...this.state.tableParams, - current: this.state.current - }); - }, 3000); }; handleOperate = (payload) => { const { siaccountFile, siaccountDelete, deleteLoading } = @@ -313,19 +307,36 @@ export default class StandingBook extends React.Component { handleOk = (formVal) => { const { save } = this.props.standingBookStore; const { billMonth, ...extra } = formVal; - console.log("extra:", extra); const payload = { billMonth: moment(billMonth).format("YYYY-MM"), ...extra }; save(payload).then(() => { - message.success("核算成功"); - this.handleClose(); - this.getCommonList({ - ...this.state.tableParams, - current: this.state.current + this.setState({ + progressVisible: true + }, () => { + this.timer = setInterval(() => { + if (this.state.progress !== 100) { + this.setState({ + progress: this.state.progress + 10 + }); + } else { + clearInterval(this.timer); + this.setState({ + progressVisible: false, + progress: 0 + },()=>{ + message.success("核算成功"); + this.handleClose(); + this.getCommonList({ + ...this.state.tableParams, + current: this.state.current + }); + this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : ""); + }); + } + }, 1000); }); - this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : ""); }); }; @@ -493,6 +504,17 @@ export default class StandingBook extends React.Component { loading={loading} /> )} + {/*核算进度条*/} + { + this.state.progressVisible && + { + this.setState({ progressVisible: false, progress: 0 }); + }} + progress={this.state.progress} + /> + } {drawerProps.visible && ( { + current: 1 + }, () => { const { current } = this.state; nextProps.selectedKey === "1" ? this.getNormalList({ billMonth, current, paymentOrganization }) @@ -75,7 +77,7 @@ export default class NormalIndex extends Component { current, paymentOrganization }); - }) + }); } } @@ -280,11 +282,11 @@ export default class NormalIndex extends Component { ? this.getNormalList({ billMonth, paymentOrganization, - current: calcPageNo(this.state.tableData.total,this.state.current, 10, includes.length) + current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length) }) : this.getSupplementaryList({ billMonth, - current: calcPageNo(this.state.tableData.total,this.state.current, 10, includes.length), + current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length), paymentOrganization }); }); @@ -493,7 +495,7 @@ export default class NormalIndex extends Component { selectedKey === "1" && } @@ -508,8 +510,11 @@ export default class NormalIndex extends Component { { this.props.type !== "detail" && - this.setState({ importParams: { ...importParams, visible: true } })}/> + this.setState({ importParams: { ...importParams, visible: true } })} + /> } {/*导入弹框*/} @@ -524,7 +529,7 @@ export default class NormalIndex extends Component { }); }} onCancel={() => { - this.setState({ importParams: { ...importParams, visible: false },fieldData: {} }, () => { + this.setState({ importParams: { ...importParams, visible: false }, fieldData: {} }, () => { const { billMonth, selectedKey, paymentOrganization } = this.props; const { current } = this.state; selectedKey === "1" @@ -538,8 +543,11 @@ export default class NormalIndex extends Component { } - + + paymentOrganization={this.paymentOrganization} location={this.props.location}/> } { selectedKey === "2" && diff --git a/pc4mobx/hrmSalary/pages/taxAgent/editModal.js b/pc4mobx/hrmSalary/pages/taxAgent/editModal.js index 34fd1bf0..687ca334 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/editModal.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/editModal.js @@ -103,7 +103,8 @@ export default class EditModal extends React.Component { saveloading, onClose, onChangeTab, - taxAgentStore + taxAgentStore, + isChief } = this.props; const { form } = taxAgentStore; return ( @@ -118,7 +119,8 @@ export default class EditModal extends React.Component {
{title}
- {editType !== "set" && ( + {/*总管理权限*/} + {(editType !== "set" && isChief) && (