diff --git a/pc4mobx/hrmSalary/pages/declare/generateModal.js b/pc4mobx/hrmSalary/pages/declare/generateModal.js index 8157c487..bc0f5c45 100644 --- a/pc4mobx/hrmSalary/pages/declare/generateModal.js +++ b/pc4mobx/hrmSalary/pages/declare/generateModal.js @@ -58,7 +58,7 @@ export default class GenerateModal extends React.Component { this.setState({ loading: false }); this.props.onCancel(); message.destroy(); - message.loading(getLabel(22619, "正在生成中..."), 0); + message.loading(getLabel(111, "正在生成中..."), 0); this.timer = setInterval(async () => { const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data); const { status: rateStatus, finish, msg } = result; @@ -70,9 +70,12 @@ export default class GenerateModal extends React.Component { this.props.onGenerate(); } } else { + clearInterval(this.timer); + message.destroy(); message.warning(msg || getLabel(111, "生成申报表失败!")); + this.props.onGenerate(); } - }, 800); + }, 1000); }).catch(() => { message.destroy(); clearInterval(this.timer); diff --git a/pc4mobx/hrmSalary/pages/declareDetail/index.js b/pc4mobx/hrmSalary/pages/declareDetail/index.js index d4b0015c..c47d1fcc 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/index.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/index.js @@ -29,9 +29,9 @@ class Index extends Component { loading: { query: false, refresh: false, declare: false }, declareInfo: {}, pageInfo: { current: 0, pageSize: 10, total: 0 } }; + this.timer = null; } - componentDidMount() { const promise = this.init(); } @@ -96,44 +96,81 @@ class Index extends Component { taxdeclarationRefreshData({ taxDeclareRecordId: getQueryString("id") }).then(async ({ status, data, errormsg }) => { this.setState({ loading: { ...this.state.loading, refresh: false } }); if (status) { - const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data); - if (resStatus) { - const { status: rateStatus, msg } = result; - if (rateStatus) { - message.success(getLabel(111, "刷新数据成功!")); - const promise = this.init(); + message.destroy(); + message.loading(getLabel(111, "刷新中..."), 0); + this.timer = setInterval(async () => { + const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data); + const { status: rateStatus, finish, msg } = result; + if (resStatus && rateStatus) { + if (finish) { + clearInterval(this.timer); + message.destroy(); + message.success(getLabel(111, "刷新数据成功!")); + const promise = this.init(); + } } else { + clearInterval(this.timer); + message.destroy(); message.warning(msg || getLabel(111, "刷新数据失败!")); + const promise = this.init(); } - } + }, 1000); } else { + clearInterval(this.timer); + message.destroy(); message.warning(errormsg); } - }).catch(() => this.setState({ loading: { ...this.state.loading, refresh: false } })); + }).catch(() => { + message.destroy(); + clearInterval(this.timer); + this.setState({ loading: { ...this.state.loading, refresh: false } }); + }); }; taxdeclarationDeclare = () => { this.setState({ loading: { ...this.state.loading, declare: true } }); taxdeclarationDeclare({ taxDeclareRecordId: getQueryString("id") }).then(async ({ status, data, errormsg }) => { this.setState({ loading: { ...this.state.loading, declare: false } }); if (status) { - const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data); - if (resStatus) { - const { status: rateStatus, msg } = result; - if (rateStatus) { - message.success(getLabel(111, "在线申报成功!")); - const promise = this.declare(); + message.destroy(); + message.loading(getLabel(111, "申报中..."), 0); + this.timer = setInterval(async () => { + const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data); + const { status: rateStatus, finish, msg } = result; + if (resStatus && rateStatus) { + if (finish) { + clearInterval(this.timer); + message.destroy(); + message.success(getLabel(111, "在线申报成功!")); + const promise = this.declare(); + } } else { + clearInterval(this.timer); + message.destroy(); message.warning(msg || getLabel(111, "在线申报失败!")); + const promise = this.declare(); } - } + }, 1000); } else { + clearInterval(this.timer); + message.destroy(); message.warning(errormsg); } - }).catch(() => this.setState({ loading: { ...this.state.loading, declare: false } })); + }).catch(() => { + message.destroy(); + clearInterval(this.timer); + this.setState({ loading: { ...this.state.loading, declare: false } }); + }); }; render() { const { tabs, selectedKey, columns, pageInfo, dataSource, loading, declareInfo } = this.state; + let btns = [ + , + , + + ]; const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, @@ -151,19 +188,15 @@ class Index extends Component { }, () => this.getDetailList()); } }; + declareInfo.declareStatus === "DECLARING" && (btns.splice(1, 2, )); return (
{getLabel(17416, "导出")}, - , - - ]} + buttons={btns} /> { this.setState({ loading: { ...this.state.loading, refresh: false } }); if (status) { - const { status, data: result } = await employeedeclareGetRate({ index: data }); - const { msg } = result || {}; - (status && !msg) ? message.success(getLabel(111, "刷新成功!")) : message.warning(msg || getLabel(111, "刷新失败!")); - this.queryEmployeeList(); + message.destroy(); + message.loading(getLabel(111, "刷新中..."), 0); + this.timer = setInterval(async () => { + const { status: resStatus, data: result } = await employeedeclareGetRate({ index: data }); + const { status: rateStatus, finish, msg } = result; + if (resStatus && rateStatus) { + if (finish) { + clearInterval(this.timer); + message.destroy(); + message.success(getLabel(111, "刷新成功!")); + this.queryEmployeeList(); + } + } else { + clearInterval(this.timer); + message.destroy(); + message.warning(msg || getLabel(111, "刷新失败!")); + this.queryEmployeeList(); + } + }, 1000); } else { + clearInterval(this.timer); + message.destroy(); message.error(errormsg); } - }).catch(() => this.setState({ loading: { ...this.state.loading, refresh: false } })); + }).catch(() => { + clearInterval(this.timer); + message.destroy(); + this.setState({ loading: { ...this.state.loading, refresh: false } }); + }); }; /* * Author: 黎永顺 @@ -233,14 +255,35 @@ class Index extends Component { getDeclareFeedback(payload).then(async ({ status, data, errormsg }) => { this.setState({ loading: { ...this.state.loading, feedback: false } }); if (status) { - const { status, data: result } = await employeedeclareGetRate({ index: data }); - const { msg } = result || {}; - (status && !msg) ? message.success(getLabel(111, "获取报送结果成功!")) : message.warning(msg || ""); - this.queryEmployeeList(); + message.destroy(); + message.loading(getLabel(111, "获取报送中..."), 0); + this.timer = setInterval(async () => { + const { status: resStatus, data: result } = await employeedeclareGetRate({ index: data }); + const { status: rateStatus, finish, msg } = result; + if (resStatus && rateStatus) { + if (finish) { + clearInterval(this.timer); + message.destroy(); + message.success(getLabel(111, "获取报送结果成功!")); + this.queryEmployeeList(); + } + } else { + clearInterval(this.timer); + message.destroy(); + message.warning(msg || getLabel(111, "获取失败!")); + this.queryEmployeeList(); + } + }, 1000); } else { + clearInterval(this.timer); + message.destroy(); message.error(errormsg); } - }).catch(() => this.setState({ loading: { ...this.state.loading, feedback: false } })); + }).catch(() => { + clearInterval(this.timer); + message.destroy(); + this.setState({ loading: { ...this.state.loading, feedback: false } }); + }); }; /* * Author: 黎永顺 @@ -283,14 +326,35 @@ class Index extends Component { employeedeclareDeclare(payload).then(async ({ status, data, errormsg }) => { this.setState({ loading: { ...this.state.loading, declare: false } }); if (status) { - const { status, data: result } = await employeedeclareGetRate({ index: data }); - const { msg } = result || {}; - (status && !msg) ? message.success(getLabel(111, "全部报送成功!")) : message.warning(msg || ""); - this.queryEmployeeList(); + message.destroy(); + message.loading(getLabel(111, "报送中..."), 0); + this.timer = setInterval(async () => { + const { status: resStatus, data: result } = await employeedeclareGetRate({ index: data }); + const { status: rateStatus, finish, msg } = result; + if (resStatus && rateStatus) { + if (finish) { + clearInterval(this.timer); + message.destroy(); + message.success(getLabel(111, "全部报送成功!")); + this.queryEmployeeList(); + } + } else { + clearInterval(this.timer); + message.destroy(); + message.warning(msg || getLabel(111, "报送失败!")); + this.queryEmployeeList(); + } + }, 1000); } else { + clearInterval(this.timer); + message.destroy(); message.error(errormsg); } - }).catch(() => this.setState({ loading: { ...this.state.loading, declare: false } })); + }).catch(() => { + clearInterval(this.timer); + message.destroy(); + this.setState({ loading: { ...this.state.loading, declare: false } }); + }); }; handleAdd = () => { this.setState({ diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js index 5e4fc6c7..3191a63c 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/constants.js +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -37,12 +37,12 @@ export const fieldList = [ { key: "TAX_NET_PASSWORD", showname: "个税网报密码", - lanId: 111, + lanId: 111 }, { key: "REAL_NAME_PASSWORD", showname: "实名账号密码", - lanId: 111, + lanId: 111 } ] }, @@ -89,3 +89,121 @@ export const fieldList = [ viewAttr: 1 } ]; + +export const taxFillCondition = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxAgentName"], + fieldcol: 14, + label: "个税扣缴义务人", + lanId: 537996, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxCode"], + fieldcol: 14, + label: "登记序号", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxpayerStatus"], + fieldcol: 14, + label: "纳税人状态", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["legalPersonName"], + fieldcol: 14, + label: "法人姓名", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["mobile"], + fieldcol: 14, + label: "联系电话", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["businessAddress"], + fieldcol: 14, + label: "生产经营地址", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["industryName"], + fieldcol: 14, + label: "行业名称", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxAuthorities"], + fieldcol: 14, + label: "主管税务机关", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxBranch"], + fieldcol: 14, + label: "主管税务科所", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["divideFiling"], + fieldcol: 14, + label: "是否分部门备案", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + } + ], + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/salary/components/index.less b/pc4mobx/hrmSalary/pages/salary/components/index.less index 0743a792..d06ff96c 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/index.less +++ b/pc4mobx/hrmSalary/pages/salary/components/index.less @@ -96,3 +96,35 @@ border-radius: 0; } } + +.taxfillingDialog { + .ant-modal-title { + .text-elli { + color: #111; + font-weight: 700; + } + } + + .taxfillingDialogContent { + height: 100%; + padding: 16px; + background: #f6f6f6; + overflow-y: auto; + + .wea-search-group { + padding: 0; + background: #FFF; + border: 1px solid #e5e5e5; + border-bottom: 0; + + .ant-row, .wea-form-cell { + padding: 0; + } + + .wea-form-item { + padding: 5px 16px; + border-bottom: 1px solid #e5e5e5; + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js index e218995d..702ba603 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js @@ -13,6 +13,7 @@ import { decentralizationConditions, editConditions } from "../../taxAgent/editC import BaseSettings, { convertConditon } from "./baseSettings"; import PersonalScope from "./personalScope"; import TaxDeclarationInfo from "./taxDeclarationInfo"; +import TaxFilingInfoDialofg from "./taxFillingInfoDialog"; import * as API from "../../../apis/taxAgent"; import "./index.less"; @@ -28,7 +29,12 @@ class TaxAgentSlide extends Component { current: 0, loading: false, verifyLoading: false, - taxAgentId: "" + taxAgentId: "", + taxFilingInfoDialofg: { + visible: false, title: "", + isEdit: false, jumpAll: false, + taxAgentTaxReturnCheckFormDTO: {} + } }; this.taxInfoRef = null; } @@ -123,9 +129,9 @@ class TaxAgentSlide extends Component { }); }; handleSaveAndVerify = (jumpAll = false) => { - const { taxAgentId } = this.state; + const { isEdit } = this.props, { taxAgentId, taxFilingInfoDialofg } = this.state; const { fieldForm, fieldItem } = this.taxInfoRef.state; - const { city: cityVal, netPassword, realNamePassword, ...extra } = fieldForm; + const { city: cityStr, cityVal = [], netPassword, realNamePassword, ...extra } = fieldForm; const boolean = _.every(_.filter(fieldItem, item => item.viewAttr === 3), it => fieldForm[it.key]); if (!boolean) { Modal.warning({ @@ -134,18 +140,33 @@ class TaxAgentSlide extends Component { }); return; } - const [nation, province, city] = cityVal ? cityVal.split("-") : []; + const [nation, province, city] = cityStr ? cityStr.split("-") : []; + const proBool = _.every(cityStr ? cityStr.split("-") : [], it => it !== "undefined"); + if (!proBool) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "请展开选择报税所属区域!") + }); + return; + } // requestType: 1:保存并验证 2:保存 const payload = { ...extra, nation, province, city, - taxAgentId, requestType: 1, password: netPassword || realNamePassword + taxAgentId, requestType: 1, password: netPassword || realNamePassword, + cityname: !_.isEmpty(cityVal) ? _.head(cityVal).name : "" }; this.setState({ verifyLoading: true }); - API.saveAndCheck(_.omitBy(payload, val => _.isNil(val))).then(({ status, errormsg }) => { + API.saveAndCheck(_.omitBy(payload, val => _.isNil(val))).then(({ status, data, errormsg }) => { this.setState({ verifyLoading: false }); if (status) { message.success(getLabel(22619, "保存成功!")); - jumpAll ? this.props.onCancel(true) : this.props.onOk(); + this.setState({ + taxFilingInfoDialofg: { + ...taxFilingInfoDialofg, visible: true, + isEdit, jumpAll, title: fieldForm.name, + taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO + } + }); } else { message.error(errormsg || getLabel(22620, "保存失败!")); } @@ -186,9 +207,9 @@ class TaxAgentSlide extends Component { break; case 1: const tmpV = []; + onClick={() => this.handleSaveAndVerify(false)}>{getLabel(544343, "保存并验证")}]; const tmpJ = [ - , @@ -218,7 +239,7 @@ class TaxAgentSlide extends Component { { key: 2, title: getLabel(124810, "人员范围") } ]; const { isEdit, title, visible, onCancel, salaryOn, taxAgentStore: { showOperateBtn } } = this.props; - const { current, taxAgentId } = this.state; + const { current, taxAgentId, taxFilingInfoDialofg } = this.state; const tabData = !salaryOn ? _.filter(tabs, it => it.key !== 1) : tabs; return ( { + const { jumpAll } = taxFilingInfoDialofg; + this.setState({ + current: jumpAll ? this.state.current + 1 : this.state.current, + taxFilingInfoDialofg: { + ...taxFilingInfoDialofg, visible: false, + taxAgentTaxReturnCheckFormDTO: {} + } + }, () => jumpAll && this.props.onCancel(true)); + }} + />
} onClose={() => onCancel()} diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js index 708bf93a..219ea494 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js @@ -19,6 +19,7 @@ class TaxDeclarationInfo extends Component { name: "", taxCode: "", city: "", + cityVal: [], areaCode: null, passwordType: "TAX_NET_PASSWORD", account: "", @@ -52,20 +53,26 @@ class TaxDeclarationInfo extends Component { fieldForm: { ...fieldForm, ..._.reduce(_.keys(fieldForm), (pre, cur) => { - return { ...pre, [cur]: data[cur] }; + if (cur !== "city") { + return { ...pre, [cur]: data[cur] }; + } + return { + ...pre, + cityVal: [{ id: data[cur], name: data["cityname"] }], + [cur]: `${data["nation"]}-${data["province"]}-${data[cur]}` + }; }, {}) } }); } }); }; - handleChangeValue = (key, value) => { + handleChangeValue = (key, value, cityVal = []) => { const { fieldForm } = this.state; this.setState({ - fieldForm: { - ...fieldForm, - [key]: value - } + fieldForm: !_.isEmpty(cityVal) ? { + ...fieldForm, [key]: value, cityVal + } : { ...fieldForm, [key]: value } }, () => { if (key === "passwordType" && this.state.fieldForm.passwordType === "REAL_NAME_PASSWORD") { this.setState({ @@ -97,12 +104,16 @@ class TaxDeclarationInfo extends Component { } { type === "SELECT" && - { if (!_.isEmpty(datas)) { - this.handleChangeValue(key, `1-${datas[0].pid}-${datas[0].id}`); + this.handleChangeValue(key, `1-${datas[0].pid}-${datas[0].id}`, _.map(datas, it => ({ + id: it.id, + name: it.name + }))); } else { - this.handleChangeValue(key, ""); + this.handleChangeValue(key, "", []); } }} /> diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js b/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js new file mode 100644 index 00000000..e9b46e40 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js @@ -0,0 +1,63 @@ +/* + * Author: 黎永顺 + * name: 个税申报-异常、失败详情 + * Description: + * Date: 2023/8/18 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { Button } from "antd"; +import { taxFillCondition } from "./constants"; +import { getSearchs } from "../../../util"; + +const { getLabel } = WeaLocaleProvider; + +@inject("taxAgentStore") +@observer +class TaxFilingInfoDialofg extends Component { + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + const { taxAgentTaxReturnCheckFormDTO, taxAgentStore: { taxfillInfoForm } } = nextProps; + taxfillInfoForm.initFormFields(taxFillCondition); + const fields = _.map(taxFillCondition[0].items, it => { + return it.domkey[0]; + }); + fields.map(item => { + taxfillInfoForm.updateFields({ + [item]: taxAgentTaxReturnCheckFormDTO[item] || "" + }); + }); + } + } + + render() { + const { taxAgentStore: { taxfillInfoForm } } = this.props; + return ( + {getLabel(111, "知道了")} + ]} + style={{ + width: 850, + height: 606.6, + minHeight: 200, + minWidth: 380, + maxHeight: "50%", + maxWidth: "50%", + overflow: "hidden", + transform: "translate(0px, 0px)" + }} + > +
+ {getSearchs(taxfillInfoForm, taxFillCondition, 1)} +
+
+ ); + } +} + +export default TaxFilingInfoDialofg; diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index 49ad295f..a62d5c57 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -10,6 +10,7 @@ const { TableStore } = WeaTableNew; export class TaxAgentStore { @observable salarytaxAgentForm = new WeaForm(); //新版个税扣缴义务人表单实体 + @observable taxfillInfoForm = new WeaForm(); //报税信息查看form