From aebb43b4616bc79fb52e71ab1550037d5530fced Mon Sep 17 00:00:00 2001 From: MustangDeng <670124965@qq.com> Date: Thu, 9 Jun 2022 18:30:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=E5=88=86?= =?UTF-8?q?=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/standingBook.js | 10 +++ .../standingBook/components/accountDialog.js | 14 ++++- .../standingBook/index.js | 62 ++++++++++++++----- .../standingBookDetail/components/normal.js | 37 +++++------ .../standingBookDetail/components/overView.js | 6 +- .../standingBookDetail/index.js | 11 ++-- pc4mobx/hrmSalary/stores/StandingBook.js | 15 +++++ 7 files changed, 112 insertions(+), 43 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 2cdf3063..8909abfe 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -170,3 +170,13 @@ export const commonAccount = (params) => { body: JSON.stringify(params), }).then((res) => res.json()); }; + + +// 获取当前管理员下的所有的个税扣缴义务人 +export const getAdminTaxAgentList = () => { + return WeaTools.callApi( + "/api/bs/hrmsalary/siaccount/getAdminTaxAgentList", + "get", + {} + ); +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js index bd43372c..b8e1ef96 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js @@ -6,7 +6,7 @@ */ import React, { Component } from "react"; import { Button, Form, Input } from "antd"; -import { WeaDatePicker, WeaDialog } from "ecCom"; +import { WeaDatePicker, WeaDialog, WeaSelect } from "ecCom"; const createForm = Form.create; const FormItem = Form.Item; @@ -56,6 +56,18 @@ class Accountdialog extends Component { })} /> + { + this.props.isAdmin && + + + } { + if(status) { + console.log("data:", data); + this.setState({adminData : data}) + if(data.isAdminEnable) { + getAdminTaxAgentList().then((data) => { + let taxAgentList = data.map(item => { + let result = {} + result.showname = item.name + result.key = item.id + "" + result.selected = false + return result + }) + this.setState({dialogProps: { + ...dialogProps, + options: taxAgentList, + isAdmin: true + }}) + }) + } + this.getCommonList({ ...this.state.tableParams, current }); + } + }) } getCommonList = (payload = {}) => { @@ -71,7 +98,7 @@ export default class StandingBook extends React.Component { this.handleGoDetail(billMonth)}> + onClick={() => this.handleGoDetail(billMonth, "detail", r.paymentOrganizationId)}> {text} ); @@ -85,7 +112,7 @@ export default class StandingBook extends React.Component { list, columns: [ ...columns, - { + (!this.state.adminData.isDefaultOpen || (this.state.adminData.isDefaultOpen && this.state.adminData.isAdminEnable)) ? { title: "操作", dataIndex: "action", key: "action", @@ -97,7 +124,7 @@ export default class StandingBook extends React.Component { this.handleGoDetail(billMonth)}> + onClick={() => this.handleGoDetail(billMonth, "", r.paymentOrganizationId)}> {" "} 核算{" "} @@ -107,7 +134,7 @@ export default class StandingBook extends React.Component { overlay={ - this.handleOperate({ key, billMonth }) + this.handleOperate({ key, billMonth, paymentOrganizationId: r.paymentOrganizationId }) }> 归档 {/* 异常详情 */} @@ -123,7 +150,7 @@ export default class StandingBook extends React.Component { overlay={ - this.handleOperate({ key, billMonth }) + this.handleOperate({ key, billMonth, paymentOrganizationId: r.paymentOrganizationId}) }> 查看 {/* 操作日志 */} @@ -135,7 +162,7 @@ export default class StandingBook extends React.Component { ); }, - }, + } : {}, ], total, }, @@ -171,14 +198,14 @@ export default class StandingBook extends React.Component { }); } - handleGoDetail = (billMonth, detail) => { + handleGoDetail = (billMonth, detail, paymentOrganization) => { if(detail) { window.open( - `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?type=${detail}&billMonth=${billMonth}` + `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?type=${detail}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}` ); } else { window.open( - `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?billMonth=${billMonth}` + `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}` ); } @@ -192,7 +219,7 @@ export default class StandingBook extends React.Component { handleOperate = (payload) => { const { siaccountFile, siaccountDelete, deleteLoading } = this.props.standingBookStore; - const { key, billMonth } = payload; + const { key, billMonth, paymentOrganizationId } = payload; switch (key) { case "archive": Modal.confirm({ @@ -235,7 +262,7 @@ export default class StandingBook extends React.Component { }); break; case "view": - this.handleGoDetail(billMonth, "detail"); + this.handleGoDetail(billMonth, "detail", paymentOrganizationId); break; default: break; @@ -244,6 +271,7 @@ 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, @@ -255,7 +283,7 @@ export default class StandingBook extends React.Component { ...this.state.tableParams, current: this.state.current, }); - this.handleGoDetail(moment(billMonth).format("YYYY-MM")); + this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : ""); }); }; @@ -325,7 +353,7 @@ export default class StandingBook extends React.Component { return renderNoright(); } - const rightBtns = [ + const rightBtns = (!this.state.adminData.isDefaultOpen || this.state.adminData.isDefaultOpen && this.state.adminData.isAdminEnable) ? [ // 右键菜单 - ]; + ] : []; const rightMenu = [ // 右键菜单 { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index f3911563..ec2fdbb5 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -36,36 +36,36 @@ export default class NormalIndex extends Component { } componentDidMount() { - const { billMonth, selectedKey } = this.props; + const { billMonth, selectedKey, paymentOrganization } = this.props; const { current } = this.state; selectedKey === "1" - ? this.getNormalList({ billMonth, current }) - : this.getSupplementaryList({ billMonth, current }); + ? this.getNormalList({ billMonth, current, paymentOrganization }) + : this.getSupplementaryList({ billMonth, current, paymentOrganization }); } componentWillReceiveProps(nextProps) { if (nextProps.selectedKey != this.props.selectedKey) { - const { billMonth } = nextProps; + const { billMonth, paymentOrganization } = nextProps; const { current } = this.state; nextProps.selectedKey === "1" - ? this.getNormalList({ billMonth, current }) - : this.getSupplementaryList({ billMonth, current }); + ? this.getNormalList({ billMonth, current, paymentOrganization }) + : this.getSupplementaryList({ billMonth, current, paymentOrganization }); } } handleSearch(value) { - const { billMonth, selectedKey } = this.props; + const { billMonth, selectedKey, paymentOrganization } = this.props; const { current } = this.state; selectedKey === "1" - ? this.getNormalList({ billMonth, current, userName:value }) - : this.getSupplementaryList({ billMonth, current, userName:value }); + ? this.getNormalList({ billMonth, current, paymentOrganization, userName:value }) + : this.getSupplementaryList({ billMonth, current, paymentOrganization, userName:value }); } handleSave = () => { const { siaccountCommonSave, siaccountSupplementarySave, form } = this.props.standingBookStore; - const { billMonth, selectedKey } = this.props; + const { billMonth, selectedKey, paymentOrganization } = this.props; if (selectedKey === "1") { const { includes, excludes } = form.getFormParams(); const payload = { @@ -75,7 +75,7 @@ export default class NormalIndex extends Component { }; siaccountCommonSave(payload).then(() => { message.success("添加成功"); - this.getNormalList({ billMonth, current: this.state.current }); + this.getNormalList({ billMonth, paymentOrganization, current: this.state.current }); this.setState({ addProps: { ...this.state.addProps, @@ -206,7 +206,7 @@ export default class NormalIndex extends Component { const { siaccountCommonDelete } = this.props.standingBookStore; const { list } = this.state.tableData; const { selectedRowKeys } = this.state; - const { billMonth, selectedKey } = this.props; + const { billMonth, selectedKey, paymentOrganization } = this.props; if (_.isEmpty(selectedRowKeys)) { message.warning("未勾选数据!"); } else { @@ -222,10 +222,11 @@ export default class NormalIndex extends Component { message.success("删除成功"); this.setState({ selectedRowKeys: [] }); selectedKey === "1" - ? this.getNormalList({ billMonth, current: this.state.current }) + ? this.getNormalList({ billMonth, paymentOrganization, current: this.state.current }) : this.getSupplementaryList({ billMonth, current: this.state.current, + paymentOrganization }); }); }, @@ -253,15 +254,15 @@ export default class NormalIndex extends Component { // 核算按钮点击 handleCommonAccountClick() { - const { remarks, billMonth, selectedKey } = this.props; + const { remarks, billMonth, selectedKey, paymentOrganization } = this.props; const { commonAccount } = this.props.standingBookStore; commonAccount({ billMonth, includes: [] }).then(() => { selectedKey === "1" - ? this.getNormalList({ billMonth, current: this.state.current }) - : this.getSupplementaryList({ billMonth, current: this.state.current }); + ? this.getNormalList({ billMonth, paymentOrganization, current: this.state.current }) + : this.getSupplementaryList({ billMonth, paymentOrganization, current: this.state.current }); }) } render() { @@ -311,7 +312,7 @@ export default class NormalIndex extends Component { )}
{ - this.props.type !== "detail" ? + this.props.type !== "detail" && this.props.selectedKey == "3" ? */} - {selectedKey === "1" && this.props.type !== "detail" && } + {/* {selectedKey === "1" && this.props.type !== "detail" && } */} {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js index f89bcef0..11068edf 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js @@ -26,8 +26,8 @@ export default class OverViewIndex extends Component { } componentDidMount() { - const { billMonth } = this.props; - this.getOverViewList({ billMonth }); + const { billMonth, paymentOrganization } = this.props; + this.getOverViewList({ billMonth, paymentOrganization }); } getOverViewList = (payload = {}) => { @@ -63,7 +63,7 @@ export default class OverViewIndex extends Component { ); }; render() { - const { remarks, billMonth, selectedKey } = this.props; + const { remarks, billMonth, selectedKey, paymentOrganization } = this.props; const { selectedRowKeys } = this.state; const { loading } = this.props.standingBookStore; let { list, columns, total } = this.state.tableData; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js index 298937e7..c89f124c 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js @@ -23,17 +23,20 @@ class StandingBookDetail extends Component { billMonth: '', } this.type = "" + this.paymentOrganization = "" } componentDidMount() { + this.getTabList(); } getTabList = (payload = {}) => { const { getTabList } = this.props.standingBookStore; const billMonth = this.props.location.query.billMonth; + this.paymentOrganization = this.props.location.query.paymentOrganization; this.type = this.props.location.query.type; - getTabList({ billMonth }).then(({ data }) => { + getTabList({ billMonth, paymentOrganization: this.paymentOrganization }).then(({ data }) => { const { tabList, remarks, billMonth } = data; let newTabList = tabList.filter(item => item.id != "2") this.setState({ @@ -58,15 +61,15 @@ class StandingBookDetail extends Component { /> { (selectedKey === '1' || selectedKey === '3') && - + } { selectedKey === '2' && - + } { selectedKey === '4' && - + } ); diff --git a/pc4mobx/hrmSalary/stores/StandingBook.js b/pc4mobx/hrmSalary/stores/StandingBook.js index d39e57e0..959874e9 100644 --- a/pc4mobx/hrmSalary/stores/StandingBook.js +++ b/pc4mobx/hrmSalary/stores/StandingBook.js @@ -364,4 +364,19 @@ export class StandingBookStore { }) } + + // 获取当前管理员下的所有个税扣缴义务人 + @action + getAdminTaxAgentList = () => { + return new Promise((resolve, reject) => { + API.getAdminTaxAgentList().then(res => { + if(res.status) { + resolve(res.data); + } else { + message.error(res.errormsg || "接口调用失败!") + reject(); + } + }) + }) + } }