diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index 8cf65377..360c8b62 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -1,4 +1,5 @@ import { WeaTools } from 'ecCom'; +import { postFetch } from '../util/request'; //个税申报表-个税申报表列表 export const getDeclareList = params => { @@ -7,7 +8,7 @@ export const getDeclareList = params => { mode: 'cors', headers: { 'Content-Type': 'application/json' - }, + }, body: JSON.stringify(params) }).then(res => res.json()) } @@ -24,7 +25,7 @@ export const saveDeclare = params => { mode: 'cors', headers: { 'Content-Type': 'application/json' - }, + }, body: JSON.stringify(params) }).then(res => res.json()) } @@ -41,7 +42,7 @@ export const getDetailList = params => { mode: 'cors', headers: { 'Content-Type': 'application/json' - }, + }, body: JSON.stringify(params) }).then(res => res.json()) } @@ -52,13 +53,16 @@ export const exportSalaryArchive = (id = "") => { fetch('/api/bs/hrmsalary/taxdeclaration/export?taxDeclarationId=' + id).then(res => res.blob().then(blob => { var filename=`个税申报表.xlsx` var a = document.createElement('a'); - var url = window.URL.createObjectURL(blob); + var url = window.URL.createObjectURL(blob); a.href = url; a.download = filename; a.click(); window.URL.revokeObjectURL(url); })) } - +//个税申报表-撤回申报 +export const withDrawTaxDeclaration = (params) => { + return postFetch('/api/bs/hrmsalary/taxdeclaration/withDrawTaxDeclaration', params); +} diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index e133c537..1f9b1d64 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -367,6 +367,14 @@ export const getAvailableSalaryItemSet = (params) => { export const salaryBillSendSum = (params) => { return postFetch("/api/bs/hrmsalary/salaryBill/send/sum", params); }; +//工资单发放-发送短信验证码 +export const sendMobileCode = (params) => { + return postFetch("/api/bs/hrmsalary/salaryBill/sendMobileCode", params); +}; +//工资单-验证方式 +export const payrollCheckType = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/payrollCheckType", "GET", params); +}; // 工资单基础设置-获取设置列表 export const getSalaryBillBaseSetForm = (id) => { diff --git a/pc4mobx/hrmSalary/components/captchaModal/index.js b/pc4mobx/hrmSalary/components/captchaModal/index.js new file mode 100644 index 00000000..35661772 --- /dev/null +++ b/pc4mobx/hrmSalary/components/captchaModal/index.js @@ -0,0 +1,94 @@ +/* + * Author: 黎永顺 + * name: 验证码弹框 + * Description: + * Date: 2023/6/16 + */ +import React, { Component } from "react"; +import { WeaDialog, WeaError, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { sendMobileCode } from "../../apis/payroll"; +import { Button } from "antd"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + captcha: "", + time: 60 + }; + this.timeRef = null; + } + + componentWillUnmount() { + clearInterval(this.timeRef); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + clearInterval(this.timeRef); + this.setState({ captcha: "", time: 60 }); + } + } + + handleSendCaptcha = () => { + sendMobileCode({ id: this.props.id }).then(({ status, data }) => { + if (status) { + console.log(data); + this.timeRef = setInterval(() => { + const { time } = this.state; + this.setState({ time: time - 1 }, () => { + if (this.state.time === -1) { + clearInterval(this.timeRef); + this.setState({ time: 60 }); + } + }); + }, 1000); + } + }); + }; + handleConfirm = () => { + if (!this.state.captcha) { + this.refs.weaError.showError(); + // return + } + this.props.onCancel(); + this.props.onConfirm(); + }; + + render() { + const { captcha, time } = this.state; + return ( + {getLabel(826, "确定")} + ]} + > + + + +
+ this.setState({ captcha })}/> + +
+
+
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/captchaModal/index.less b/pc4mobx/hrmSalary/components/captchaModal/index.less new file mode 100644 index 00000000..4f8d23b7 --- /dev/null +++ b/pc4mobx/hrmSalary/components/captchaModal/index.less @@ -0,0 +1,29 @@ +.captchaWrapper { + .wea-dialog-body { + padding: 30px 20px; + + .wea-form-item-wrapper { + .wea-error { + width: 100%; + + .captchaInputBox { + display: flex; + align-items: center; + + .wea-input-normal { + flex: 1; + } + + button { + padding: 8px 10px; + border-radius: 0; + min-width: 80px; + text-align: center; + height: 30px; + line-height: 15px; + } + } + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/declare/generateModal.js b/pc4mobx/hrmSalary/pages/declare/generateModal.js index a8f41b37..cde3f435 100644 --- a/pc4mobx/hrmSalary/pages/declare/generateModal.js +++ b/pc4mobx/hrmSalary/pages/declare/generateModal.js @@ -1,9 +1,19 @@ import React from "react"; -import { WeaDatePicker, WeaDialog, WeaError, WeaFormItem, WeaHelpfulTip, WeaSelect } from "ecCom"; +import { + WeaDatePicker, + WeaDialog, + WeaError, + WeaFormItem, + WeaHelpfulTip, + WeaLocaleProvider, + WeaSelect, + WeaTextarea +} from "ecCom"; import { Button } from "antd"; import { inject, observer } from "mobx-react"; import "./index.less"; +const getLabel = WeaLocaleProvider.getLabel; @inject("declareStore", "taxAgentStore") @observer export default class GenerateModal extends React.Component { @@ -12,6 +22,7 @@ export default class GenerateModal extends React.Component { this.state = { date: "", taxAgentId: "", + description: "", loading: false }; } @@ -19,7 +30,7 @@ export default class GenerateModal extends React.Component { // 生成申报表 handleGenerate = () => { const { declareStore: { saveDeclare } } = this.props; - const { date, taxAgentId } = this.state; + const { date, taxAgentId, description } = this.state; if (_.isEmpty(date) && _.isEmpty(taxAgentId)) { this.refs.weaError.showError(); this.refs.weaError1.showError(); @@ -36,7 +47,7 @@ export default class GenerateModal extends React.Component { return; } this.setState({ loading: true }); - saveDeclare({ salaryMonthStr: date, taxAgentId }).then(() => { + saveDeclare({ salaryMonthStr: date, taxAgentId, description }).then(() => { this.setState({ loading: false }); this.props.onGenerate(); }).catch(() => { @@ -116,13 +127,23 @@ export default class GenerateModal extends React.Component { }} /> + + this.setState({ description })} + /> + ); diff --git a/pc4mobx/hrmSalary/pages/declare/index.js b/pc4mobx/hrmSalary/pages/declare/index.js index b56d1f1a..57e37c37 100644 --- a/pc4mobx/hrmSalary/pages/declare/index.js +++ b/pc4mobx/hrmSalary/pages/declare/index.js @@ -1,13 +1,15 @@ import React from "react"; import { inject, observer } from "mobx-react"; -import { Button, DatePicker } from "antd"; -import { WeaNewScroll, WeaTop } from "ecCom"; +import { Button, DatePicker, message, Modal } from "antd"; +import { WeaLocaleProvider, WeaNewScroll, WeaTop } from "ecCom"; import CustomTab from "../../components/customTab"; import CustomTable from "../../components/customTable"; import GenerateModal from "./generateModal"; -import { getDeclareList } from "../../apis/declare"; +import { getDeclareList, withDrawTaxDeclaration } from "../../apis/declare"; +import { sysConfCodeRule } from "../../apis/ruleconfig"; import moment from "moment"; +const getLabel = WeaLocaleProvider.getLabel; const { MonthPicker } = DatePicker; @inject("taxAgentStore") @observer @@ -15,6 +17,7 @@ export default class Declare extends React.Component { constructor(props) { super(props); this.state = { + showWithDrawBtn: false, declarationModalVisible: false, startDate: moment(new Date()).startOf("year").format("YYYY-MM"), endDate: moment(new Date()).startOf("month").format("YYYY-MM"), @@ -32,6 +35,7 @@ export default class Declare extends React.Component { componentWillMount() { const { taxAgentStore: { getTaxAgentSelectListAsAdmin } } = this.props; this.getDeclareList(); + this.sysConfCodeRule(); getTaxAgentSelectListAsAdmin(); } @@ -56,7 +60,21 @@ export default class Declare extends React.Component { } }).catch(() => this.setState({ loading: false })); }; - + sysConfCodeRule = () => { + sysConfCodeRule({ code: "WITHDRAW_TAX_DECLARATION" }).then(({ status, data }) => { + if (status && data === "1") this.setState({ showWithDrawBtn: data === "1" }); + }); + }; + withDrawTaxDeclaration = (taxDeclarationId) => { + withDrawTaxDeclaration({ taxDeclarationId }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "撤回成功")); + this.getDeclareList(); + } else { + message.error(errormsg || getLabel(111, "撤回失败")); + } + }); + }; // 日期区间改变事件 handleRangePickerChange = (type, value) => { this.setState({ @@ -81,7 +99,7 @@ export default class Declare extends React.Component { render() { const { taxAgentStore: { showOperateBtn } } = this.props; - const { loading, columns, dataSource, pageInfo } = this.state; + const { loading, columns, dataSource, pageInfo, showWithDrawBtn } = this.state; const renderRightOperation = () => { const { startDate, endDate } = this.state; return ( @@ -135,15 +153,32 @@ export default class Declare extends React.Component { dataIndex: "operate", render: (text, record) => { return ( - { - window.open( - "/spa/hrmSalary/static/index.html#/main/hrmSalary/generateDeclarationDetail?id=" + - record.id - ); - }}> - 查看 - + + { + window.open( + "/spa/hrmSalary/static/index.html#/main/hrmSalary/generateDeclarationDetail?id=" + + record.id + ); + }}> + 查看 + + { + showWithDrawBtn && + { + Modal.confirm({ + title: getLabel(111, "信息确认"), + content: getLabel(111, "确认撤回该条数据吗?"), + onOk: () => this.withDrawTaxDeclaration(record.id) + }); + }} + > + {getLabel(111, "撤回")} + + } + ); } } diff --git a/pc4mobx/hrmSalary/pages/declare/index.less b/pc4mobx/hrmSalary/pages/declare/index.less index d83fc525..81e72b6f 100644 --- a/pc4mobx/hrmSalary/pages/declare/index.less +++ b/pc4mobx/hrmSalary/pages/declare/index.less @@ -15,7 +15,7 @@ .wea-select { .ant-select { - width: 90% !important; + width: 100% !important; .ant-select-selection { border-radius: 0 !important; diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index 1978860a..bf310e92 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -8,7 +8,9 @@ import ComputerTemplate from "../payroll/templatePreview/computerTemplate"; import PhoneTemplate from "../payroll/templatePreview/phoneTemplate"; import "../payroll/templatePreview/index.less"; import * as API from "../../apis/mySalaryBenefits"; +import { payrollCheckType } from "../../apis/payroll"; import "./index.less"; +import CaptchaModal from "../../components/captchaModal"; @inject("mySalaryStore") @observer @@ -17,6 +19,7 @@ export default class MobilePayroll extends React.Component { super(props); this.state = { visible: false, + captchaVisible: false, authCode: "", mySalaryBillData: { employeeInformation: {}, @@ -26,13 +29,20 @@ export default class MobilePayroll extends React.Component { this.id = ""; } - componentWillMount() { + async componentWillMount() { const type = getQueryString("type"); this.id = getQueryString("id"); const { mySalaryStore: { init } } = this.props; - type !== "phone" && init(false); - type === "phone" && this.initMobile(); this.getMySalaryBill(this.id); + const { data, status } = await payrollCheckType(); + if (type !== "phone") { + if (status && data === "PWD") { + init(false); + } else { + this.setState({ captchaVisible: true }); + } + } + type === "phone" && this.initMobile(); } initMobile = () => { @@ -96,7 +106,7 @@ export default class MobilePayroll extends React.Component { render() { const { mySalaryStore: { clearLoading } } = this.props; - const { mySalaryBillData, visible } = this.state; + const { mySalaryBillData, visible, captchaVisible } = this.state; const type = getQueryString("type"); const employeeInformation = mySalaryBillData.employeeInformation ? mySalaryBillData.employeeInformation : {}; const salaryGroups = mySalaryBillData.salaryGroups ? mySalaryBillData.salaryGroups : []; @@ -148,6 +158,11 @@ export default class MobilePayroll extends React.Component { } + this.setState({ captchaVisible: false })} + onConfirm={() => this.props.mySalaryStore.setInitEmVerify()} + /> ); } diff --git a/pc4mobx/hrmSalary/pages/mySalary/index.js b/pc4mobx/hrmSalary/pages/mySalary/index.js index 97ce00b8..3b7ad55d 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/index.js +++ b/pc4mobx/hrmSalary/pages/mySalary/index.js @@ -6,7 +6,6 @@ import { renderNoright } from "../../util"; // 渲染form数据的方法:因 import CustomTab from "../../components/customTab"; import moment from "moment"; import PayrollModal from "./payrollModal"; -import Authority from "./authority"; import CustomPaginationTable from "../../components/customPaginationTable"; import "./index.less"; @@ -29,9 +28,9 @@ export default class MySalary extends React.Component { this.historyPageInfo = { current: 1, pageSize: 10 }; } - componentWillMount() { - const { mySalaryStore: { init } } = this.props; - init(); + componentDidMount() { + const { mySalaryStore: { mySalaryBillList } } = this.props; + mySalaryBillList([moment().startOf("year").format("YYYY-MM"), moment().format("YYYY-MM")]); } // 查看工资单 @@ -114,7 +113,6 @@ export default class MySalary extends React.Component { myBillPageInfo } = mySalaryStore; const { salaryBillVisible, salaryInfoId, salaryRange } = this.state; - if (!hasRight && !loading) return renderNoright(); const topTab = [ { @@ -141,64 +139,62 @@ export default class MySalary extends React.Component { }; return (
- - } // 左侧图标 - iconBgcolor="#F14A2D" // 左侧图标背景色 - showDropIcon={false} // 是否显示下拉按钮 - > - { - this.handleTabChange(v); - this.setState({ selectedKey: v }); - }} - /> -
- - { - this.state.selectedKey === "0" && - { - this.pageInfo.current = value; - this.handlePageChange(); - }} - onShowSizeChange={(current, pageSize) => { - this.pageInfo = { current, pageSize }; - this.handlePageChange(); - }} - /> - } - { - this.state.selectedKey === "2" && - { - this.historyPageInfo.current = value; - this.handleHistoryPageChange(); - }} - onShowSizeChange={(current, pageSize) => { - this.historyPageInfo = { current, pageSize }; - this.handleHistoryPageChange(); - }} - /> - } - -
-
-
+ } // 左侧图标 + iconBgcolor="#F14A2D" // 左侧图标背景色 + showDropIcon={false} // 是否显示下拉按钮 + > + { + this.handleTabChange(v); + this.setState({ selectedKey: v }); + }} + /> +
+ + { + this.state.selectedKey === "0" && + { + this.pageInfo.current = value; + this.handlePageChange(); + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = { current, pageSize }; + this.handlePageChange(); + }} + /> + } + { + this.state.selectedKey === "2" && + { + this.historyPageInfo.current = value; + this.handleHistoryPageChange(); + }} + onShowSizeChange={(current, pageSize) => { + this.historyPageInfo = { current, pageSize }; + this.handleHistoryPageChange(); + }} + /> + } + +
+
{ salaryBillVisible && -
- -
-
+ + +
+
+ +
+
+
+ this.setState({ captchaVisible: false })} + onConfirm={() => mySalaryStore.setInitEmVerify()} + /> +
); } } diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index 49b2c419..f094e5b0 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -247,7 +247,7 @@ class Index extends Component { }); queryList(payload, searchItemsValue, url).then(({ data, status }) => { this.setState({ loading: { ...loading, query: false } }); - if (status) { + if (status && selectedKey === _.lowerCase(data.listType)) { const { pageInfo: paganition } = data; const { list: dataSource, total, pageNum: current, pageSize } = paganition; this.setState({ diff --git a/pc4mobx/hrmSalary/pages/reportView/index.js b/pc4mobx/hrmSalary/pages/reportView/index.js index 2031c1c5..c315ae53 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.js +++ b/pc4mobx/hrmSalary/pages/reportView/index.js @@ -31,9 +31,9 @@ class Index extends Component { } componentDidMount() { - const { taxAgentStore: { getTaxAgentSelectListAsAdmin } } = this.props; + const { taxAgentStore: { fetchTaxAgentOption } } = this.props; this.reportGetForm(); - getTaxAgentSelectListAsAdmin(); + fetchTaxAgentOption(); } reportGetForm = () => { @@ -98,7 +98,7 @@ class Index extends Component { render() { const { report, dimensionList, statisticalPayload } = this.state; - const { attendanceStore: { settingForm }, taxAgentStore: { taxAgentAdminOption } } = this.props; + const { attendanceStore: { settingForm }, taxAgentStore: { taxAgentOption } } = this.props; return ( { if (this.reportRef.state.loading) { - message.info(getLabel(111, "列表正在加载中,请稍后")) + message.info(getLabel(111, "列表正在加载中,请稍后")); } else { this.setState({ statisticalPayload: { visible: true, id: report.id, dimension: report.dimensionId } @@ -150,7 +150,7 @@ class Index extends Component { {/*统计数据范围及规则设置弹框*/} this.setState({ statisticalPayload: { visible: false, id: "", dimension: "" } }, () => isRefresh && this.reportRef.reportStatisticsReportGetData(report.id, report.dimensionId))} diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.js b/pc4mobx/hrmSalary/pages/ruleConfig/index.js index 3d3ac81f..16c8b786 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.js @@ -5,13 +5,15 @@ * Date: 2022-09-19 18:15:32 */ import React, { Component } from "react"; -import { WeaFormItem, WeaNewScroll, WeaSearchGroup, WeaSelect, WeaTop } from "ecCom"; +import { WeaFormItem, WeaLocaleProvider, WeaNewScroll, WeaSearchGroup, WeaSelect, WeaTop } from "ecCom"; import { CheckBox } from "../appConfig"; -import { Button, message, Modal } from "antd"; +import { message, Modal } from "antd"; import * as API from "../../apis/ruleconfig"; import "./index.less"; import ProgressModal from "../../components/progressModal"; +const { getLabel } = WeaLocaleProvider; + class Index extends Component { constructor(props) { super(props); @@ -54,7 +56,7 @@ class Index extends Component { com: Select({ label: "排序字段", onChange: this.handleChane, - value: sysOrderRule.data.orderRule, + value: sysOrderRule.data.orderRule || orderOptions[0].value, options: orderOptions }) }, @@ -62,7 +64,7 @@ class Index extends Component { com: Select({ label: "正序/倒序", onChange: this.handleChane, - value: sysOrderRule.data.ascOrDesc, + value: sysOrderRule.data.ascOrDesc || ascOptions[0].value, options: ascOptions }) } @@ -72,7 +74,7 @@ class Index extends Component { com: Select({ label: "人员字段", onChange: this.handleChane, - value: sysConfCodeRule.data, + value: sysConfCodeRule.data || employeeOptions[0].value, options: employeeOptions }) } @@ -97,9 +99,9 @@ class Index extends Component { ], saveParams: { ...this.state.saveParams, - orderRule: sysOrderRule.data.orderRule, - ascOrDesc: sysOrderRule.data.ascOrDesc, - rule: sysConfCodeRule.data, + orderRule: sysOrderRule.data.orderRule || orderOptions[0].value, + ascOrDesc: sysOrderRule.data.ascOrDesc || ascOptions[0].value, + rule: sysConfCodeRule.data || employeeOptions[0].value, enctry: queryAppsetting.data.isOpenEncrypt, operateTaxDeclaration: queryAppsetting.data.isOpenTaxDeclaration } @@ -136,119 +138,122 @@ class Index extends Component { handleSave = (type) => { const { saveParams } = this.state; if (type === "ORDER") { - if (_.isEmpty(saveParams.orderRule) || _.isEmpty(saveParams.ascOrDesc)) { - Modal.warning({ - title: "信息确认", - content: "必要信息不完整,红色*为必填项!" - }); - return; - } - this.setState({ loading: { ...this.state.loading, order: true } }); - API.updateOrderRule(_.pick(saveParams, ["orderRule", "ascOrDesc"])).then(({ status, errormsg }) => { - this.setState({ loading: { ...this.state.loading, order: false } }); - if (status) { - message.success("保存成功!"); - let sysSetting = this.getSysSetting(); - } else { - message.error(errormsg || "保存失败!"); - } - }); + + // if (_.isEmpty(saveParams.orderRule) || _.isEmpty(saveParams.ascOrDesc)) { + // Modal.warning({ + // title: "信息确认", + // content: "必要信息不完整,红色*为必填项!" + // }); + // return; + // } + // this.setState({ loading: { ...this.state.loading, order: true } }); + // API.updateOrderRule(_.pick(saveParams, ["orderRule", "ascOrDesc"])).then(({ status, errormsg }) => { + // this.setState({ loading: { ...this.state.loading, order: false } }); + // if (status) { + // message.success("保存成功!"); + // let sysSetting = this.getSysSetting(); + // } else { + // message.error(errormsg || "保存失败!"); + // } + // }); + + } else if (type === "EMPLOYEE") { - if (_.isEmpty(saveParams.rule)) { - Modal.warning({ - title: "信息确认", - content: "必要信息不完整,红色*为必填项!" - }); - return; - } - this.setState({ loading: { ...this.state.loading, employee: true } }); - API.saveMatchEmployeeModeRule(_.pick(saveParams, ["rule"])).then(({ status, errormsg }) => { - this.setState({ loading: { ...this.state.loading, employee: false } }); - if (status) { - message.success("保存成功!"); - let sysSetting = this.getSysSetting(); - } else { - message.error(errormsg || "保存失败!"); - } - }); + // if (_.isEmpty(saveParams.rule)) { + // Modal.warning({ + // title: "信息确认", + // content: "必要信息不完整,红色*为必填项!" + // }); + // return; + // } + // this.setState({ loading: { ...this.state.loading, employee: true } }); + // API.saveMatchEmployeeModeRule(_.pick(saveParams, ["rule"])).then(({ status, errormsg }) => { + // this.setState({ loading: { ...this.state.loading, employee: false } }); + // if (status) { + // message.success("保存成功!"); + // let sysSetting = this.getSysSetting(); + // } else { + // message.error(errormsg || "保存失败!"); + // } + // }); } else if (type === "ENCRYTION") { - 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 || "保存失败!"); - } - }); - }, 1000); - }); - } - }); - }, - onCancel: () => { - } - }); + // 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 || "保存失败!"); + // } + // }); + // }, 1000); + // }); + // } + // }); + // }, + // onCancel: () => { + // } + // }); } else if (type === "DECLARATION") { - this.setState({ loading: { ...this.state.loading, declare: true } }); - API.operateTaxDeclarationFunction(_.pick(saveParams, ["operateTaxDeclaration"])).then(({ status, errormsg }) => { - this.setState({ loading: { ...this.state.loading, declare: false } }); - if (status) { - message.success("保存成功!"); - let sysSetting = this.getSysSetting(); - } else { - message.error(errormsg || "保存失败!"); - } - }); + // this.setState({ loading: { ...this.state.loading, declare: true } }); + // API.operateTaxDeclarationFunction(_.pick(saveParams, ["operateTaxDeclaration"])).then(({ status, errormsg }) => { + // this.setState({ loading: { ...this.state.loading, declare: false } }); + // if (status) { + // message.success("保存成功!"); + // let sysSetting = this.getSysSetting(); + // } else { + // message.error(errormsg || "保存失败!"); + // } + // }); } }; @@ -257,22 +262,161 @@ class Index extends Component { if (type === "排序字段") { this.setState({ saveParams: { ...this.state.saveParams, orderRule: selected } + }, () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确认要保存吗?"), + onOk: () => { + API.updateOrderRule(_.pick(this.state.saveParams, ["orderRule", "ascOrDesc"])) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(22619, "保存成功!")); + let sysSetting = this.getSysSetting(); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }); + }, + onCancel: () => { + } + }); }); } else if (type === "正序/倒序") { this.setState({ saveParams: { ...this.state.saveParams, ascOrDesc: selected } + }, () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确认要保存吗?"), + onOk: () => { + API.updateOrderRule(_.pick(this.state.saveParams, ["orderRule", "ascOrDesc"])) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(22619, "保存成功!")); + let sysSetting = this.getSysSetting(); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }); + }, + onCancel: () => { + } + }); }); } else if (type === "人员字段") { this.setState({ saveParams: { ...this.state.saveParams, rule: selected } + }, () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确认要保存吗?"), + onOk: () => { + API.saveMatchEmployeeModeRule(_.pick(this.state.saveParams, ["rule"])).then(({ status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, employee: false } }); + if (status) { + message.success(getLabel(22619, "保存成功!")); + let sysSetting = this.getSysSetting(); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }); + }, + onCancel: () => { + } + }); }); } else if (type === "加密设置") { this.setState({ saveParams: { ...this.state.saveParams, enctry: selected } + }, () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(543354, "开启/关闭加密前请做好数据库备份!!!逆向解密会花费几分钟时间,请耐心等待!!!"), + onOk: () => { + API.saveEncryptSetting({ isOpenEncrypt: this.state.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 || getLabel(22620, "保存失败!")); + 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(getLabel(22619, "保存成功!")); + } 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 || getLabel(22620, "保存失败!")); + } + }); + }, 1000); + }); + } + }); + }, + onCancel: () => { + } + }); }); } else if (type === "个税申报") { this.setState({ saveParams: { ...this.state.saveParams, operateTaxDeclaration: selected } + }, () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确认要保存吗?"), + onOk: () => { + API.operateTaxDeclarationFunction(_.pick(this.state.saveParams, ["operateTaxDeclaration"])) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(22619, "保存成功!")); + let sysSetting = this.getSysSetting(); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }); + }, + onCancel: () => { + } + }); }); } }; @@ -292,15 +436,17 @@ class Index extends Component { title={
排序规则 - + + {/**/}
} showGroup center items={items}/> 人员校验规则 - + + {/**/} } showGroup center items={importItems}/> { @@ -309,8 +455,9 @@ class Index extends Component { title={
加密规则 - + + {/**/}
} showGroup center items={enctryItems}/> } @@ -318,8 +465,9 @@ class Index extends Component { title={
报税规则 - + + {/**/}
} showGroup center items={declareItems}/> { @@ -354,7 +502,7 @@ export const Select = payload => { } = payload; return ( - { setCustomSelectkey(v); - this.customBenefitsTableRef.getCustomCategoryList({ curren: 1, welfareTypeEnum: v }); + this.customBenefitsTableRef.getCustomCategoryList({ current: 1, welfareTypeEnum: v }); }} />} diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index d197db2e..38fa966d 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -147,7 +147,7 @@ export class TaxAgentStore { this.setSalaryItemBtn((isOpenDevolution && (isChief || isAdminEnable))); //薪酬统计报表权限 this.setStatisticsReportBtn(!isOpenDevolution ? true : !!(isAdminEnable || isChief)); - this.setPayrollPermission(isAdminEnable && isOpenDevolution); + this.setPayrollPermission(isAdminEnable && isOpenDevolution || !isOpenDevolution); resolve({ status, data }); } else { reject();