From b94af53ed430815d24873d3188248af7d2fcf49c Mon Sep 17 00:00:00 2001 From: MustangDeng <670124965@qq.com> Date: Mon, 6 Jun 2022 14:31:20 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 3 + .../pages/dataAcquisition/cumDeduct/index.js | 39 +++- .../dataAcquisition/cumSituation/index.js | 40 ++++- .../dataAcquisition/otherDeduct/index.js | 39 +++- .../pages/ledger/step3/previewSalaryModal.js | 17 +- .../hrmSalary/pages/mobilePayroll/index.js | 168 ++++++++++++++++++ .../hrmSalary/pages/mySalary/payrollModal.js | 1 + .../standingBook/index.js | 2 +- .../standingBookDetail/components/normal.js | 26 +-- .../standingBookDetail/index.js | 10 +- pc4mobx/hrmSalary/stores/archives.js | 2 +- 11 files changed, 307 insertions(+), 40 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/mobilePayroll/index.js diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 806319b1..b85aba70 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -26,6 +26,7 @@ import CompareDetail from "./pages/calculateDetail/compareDetail"; import GenerateDeclarationDetail from "./pages/declare/generateDeclarationDetail"; import BaseForm from "./components"; import TemplatePreview from "./pages/payroll/templatePreview"; +import MobilePayroll from './pages/mobilePayroll' import stores from "./stores"; import "./style/index"; @@ -65,6 +66,7 @@ const DataAcquisition = (props) => props.children; // generateDeclarationDetail 个税单详情 // taxRate 个税税率表 // taxAgent 个税扣缴义务人 +// mobilepayroll 移动端工资单 const Routes = ( + ); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index f2ca818f..bb0a7a07 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -69,7 +69,16 @@ export default class CumDeduct extends React.Component { width={200} onChange={v => { this.setState({monthValue: v}) - getTableDatas({declareMonth: [v], taxAgentId}) + let params = {} + if(taxAgentId == "All") { + params.taxAgentId = "" + } else { + params.taxAgentId = taxAgentId + } + if(v != null && v != "") { + params.declareMonth = [v] + } + getTableDatas(params) }} /> @@ -92,13 +101,17 @@ export default class CumDeduct extends React.Component { options={optionAddAll(taxAgentOption)} value={taxAgentId} onChange={v => { - this.setState({taxAgentId: v}) + let params = {} if(v == "All") { - getTableDatas({taxAgentId: "", declareMonth: [monthValue]}) + params.taxAgentId = "" } else { - getTableDatas({taxAgentId: v, declareMonth: [monthValue]}) + params.taxAgentId = v } - + if(monthValue != null && monthValue != "") { + params.declareMonth = [monthValue] + } + getTableDatas(params) + this.setState({taxAgentId: v}) }} /> } @@ -163,7 +176,6 @@ export default class CumDeduct extends React.Component { } return newColumn; }); - console.log("newColumns:", newColumns) return newColumns; } @@ -197,6 +209,19 @@ export default class CumDeduct extends React.Component { setImportResult({}) } + handleSearch() { + const { cumDeductStore:{getTableDatas} } = this.props; + const { monthValue, taxAgentId } = this.state; + let params = {} + if(monthValue != null && monthValue !== "") { + params.declareMonth = [monthValue] + } + if(taxAgentId != null && taxAgentId !== "" && taxAgentId !== "All") { + params.taxAgentId = taxAgentId + } + getTableDatas(params) + } + render() { const { modalParam } = this.state; const { cumDeductStore, taxAgentStore } = this.props; @@ -312,7 +337,7 @@ export default class CumDeduct extends React.Component { setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控 searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据 buttonsAd={adBtn} // 高级搜索内部按钮 - onSearch={getTableDatas} // 点搜索按钮时的回调 + onSearch={() => this.handleSearch()} // 点搜索按钮时的回调 searchsAdQuick={this.getSearchsAdQuick()} onSearchChange={v => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值 searchsBaseValue={form.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步 diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index cf26e00e..ba6f15b5 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -67,7 +67,16 @@ export default class CumSituation extends React.Component { width={200} onChange={v => { this.setState({monthValue: v}) - getTableDatas({ taxYearMonth: [v], taxAgentId }) + let params = {} + if(taxAgentId == "All") { + params.taxAgentId = "" + } else { + params.taxAgentId = taxAgentId + } + if(v != null && v != "") { + params.taxYearMonth = [v] + } + getTableDatas(params) }} /> @@ -89,12 +98,17 @@ export default class CumSituation extends React.Component { options={optionAddAll(taxAgentOption)} value={taxAgentId} onChange={v => { - this.setState({taxAgentId: v}) - let taxAgentId = v; + let params = {} if(v == "All") { - taxAgentId = "" + params.taxAgentId = "" + } else { + params.taxAgentId = v } - getTableDatas({ taxAgentId: v, taxYearMonth: [monthValue]}) + if(monthValue != null && monthValue != "") { + params.taxYearMonth = [monthValue] + } + getTableDatas(params) + this.setState({taxAgentId: v}) }} /> } @@ -184,6 +198,20 @@ export default class CumSituation extends React.Component { setImportResult({}) } + // 搜索 + handleSearch() { + const { cumSituationStore:{getTableDatas} } = this.props; + const { monthValue, taxAgentId } = this.state; + let params = {} + if(monthValue != null && monthValue !== "") { + params.taxYearMonth = [monthValue] + } + if(taxAgentId != null && taxAgentId !== "" && taxAgentId !== "All") { + params.taxAgentId = taxAgentId + } + getTableDatas(params) + } + render() { const { cumSituationStore, taxAgentStore } = this.props; const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd, previewImport, importFile } = cumSituationStore; @@ -306,7 +334,7 @@ export default class CumSituation extends React.Component { setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控 searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据 buttonsAd={adBtn} // 高级搜索内部按钮 - onSearch={getTableDatas} // 点搜索按钮时的回调 + onSearch={() => this.handleSearch()} // 点搜索按钮时的回调 searchsAdQuick={this.getSearchsAdQuick()} onSearchChange={v => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值 searchsBaseValue={form.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步 diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index 270cd2cd..ef7eb43f 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -67,7 +67,16 @@ export default class OtherDeduct extends React.Component { width={200} onChange={v => { this.setState({monthValue: v}) - getTableDatas({ declareMonth: [v], taxAgentId }) + let params = {} + if(taxAgentId == "All") { + params.taxAgentId = "" + } else { + params.taxAgentId = taxAgentId + } + if(v != null && v != "") { + params.declareMonth = [v] + } + getTableDatas(params) }} /> @@ -89,12 +98,17 @@ export default class OtherDeduct extends React.Component { options={optionAddAll(taxAgentOption)} value={taxAgentId} onChange={v => { - this.setState({taxAgentId: v}) - let taxAgentId = v + let params = {} if(v == "All") { - taxAgentId = "" + params.taxAgentId = "" + } else { + params.taxAgentId = v } - getTableDatas({ taxAgentId: v, declareMonth: [monthValue]}) + if(monthValue != null && monthValue != "") { + params.declareMonth = [monthValue] + } + getTableDatas(params) + this.setState({taxAgentId: v}) }} /> } @@ -179,6 +193,19 @@ export default class OtherDeduct extends React.Component { setImportResult({}) } + handleSearch() { + const { otherDeductStore:{getTableDatas} } = this.props; + const { monthValue, taxAgentId } = this.state; + let params = {} + if(monthValue != null && monthValue !== "") { + params.declareMonth = [monthValue] + } + if(taxAgentId != null && taxAgentId !== "" && taxAgentId !== "All") { + params.taxAgentId = taxAgentId + } + getTableDatas(params) + } + render() { const { otherDeductStore, taxAgentStore } = this.props; const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd, previewImport, importFile } = otherDeductStore; @@ -302,7 +329,7 @@ export default class OtherDeduct extends React.Component { setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控 searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据 buttonsAd={adBtn} // 高级搜索内部按钮 - onSearch={getTableDatas} // 点搜索按钮时的回调 + onSearch={() => this.handleSearch()} // 点搜索按钮时的回调 searchsAdQuick={this.getSearchsAdQuick()} onSearchChange={v => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值 searchsBaseValue={form.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步 diff --git a/pc4mobx/hrmSalary/pages/ledger/step3/previewSalaryModal.js b/pc4mobx/hrmSalary/pages/ledger/step3/previewSalaryModal.js index fccd0e33..3e19f9f4 100644 --- a/pc4mobx/hrmSalary/pages/ledger/step3/previewSalaryModal.js +++ b/pc4mobx/hrmSalary/pages/ledger/step3/previewSalaryModal.js @@ -9,12 +9,15 @@ export default class PreviewSalaryModal extends React.Component { getColumns() { const { ledgerStore: { empFields, itemGroups }} = this.props; let columns = [] + let length = 0 empFields.map(item => { columns.push({ title: item.fieldName, - key: item.fieldId + key: item.fieldId, + width: 150 }) + length ++ }) itemGroups.map(item => { @@ -24,8 +27,10 @@ export default class PreviewSalaryModal extends React.Component { children: item.items.map(i => { return { title: i.name, - key: i.id + key: i.id, + width: 150 } + length ++ }) } columns.push(columnItem ) @@ -37,13 +42,15 @@ export default class PreviewSalaryModal extends React.Component { item.items.map(i => { columns.push({ title: i.name, - key: i.id + key: i.id, + width: 150 }) + length ++ }) } }) - return columns; + return {columns, length}; } render() { return ( @@ -54,7 +61,7 @@ export default class PreviewSalaryModal extends React.Component { onCancel={() => {this.props.onCancel()}} footer={null} > - + ) } diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js new file mode 100644 index 00000000..4bc9f127 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -0,0 +1,168 @@ +import React from 'react' +import { Modal, Row, Col } from 'antd' +import { inject, observer } from 'mobx-react'; +import { getQueryString } from '../../util/url' + +@inject('mySalaryStore') +@observer +export default class MobilePayroll extends React.Component { + constructor(props) { + super(props) + this.id = ""; + this.state = { + type: 'phone' + } + } + + componentWillMount() { + let id = getQueryString("id"); + let type = getQueryString("type"); + this.setState({type}) + this.id = id; + const { mySalaryStore: {getMySalaryBill}} = this.props; + getMySalaryBill(this.id) + } + + render() { + const { mySalaryStore: { mySalaryBill }} = this.props; + const { type } = this.state + return ( +
+ {/* 标题 */} +
+ { mySalaryBill.salaryTemplate && mySalaryBill.salaryTemplate.theme } +
+ { + mySalaryBill.salaryTemplate && mySalaryBill.salaryTemplate.background && mySalaryBill.salaryTemplate.background !== "" + &&
+ +
+ } + + {/* 员工信息 */} +
+
+ { + mySalaryBill.employeeInformation && + {mySalaryBill.employeeInformation.groupName} + + } + + { + mySalaryBill.employeeInformation && mySalaryBill.employeeInformation.items.map((item, index) => ( + + {item.name} + {item.salaryItemValue} + + )) + } + +
+
+ + { + mySalaryBill.salaryGroups && mySalaryBill.salaryGroups.length > 0 && + mySalaryBill.salaryGroups.map(group => ( +
+
+ { + mySalaryBill.employeeInformation && + {group.groupName} + + } + + { + group.items && group.items.map((item, index) => ( + + 3 ? "1px solid #f2f2f2" : "none", + overflow: "hidden", + textOverflow: "ellipsis", + whiteSpace: "nowrap", + height: "35px" + }}>{item.name} + 3 ? "1px solid #f2f2f2" : "none", + overflow: "hidden", + textOverflow: "ellipsis", + whiteSpace: "nowrap", + height: "35px" + }} + >{item.salaryItemValue} + + )) + } + +
+
+ )) + } +
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/mySalary/payrollModal.js b/pc4mobx/hrmSalary/pages/mySalary/payrollModal.js index 5e5d09c1..187d64af 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/payrollModal.js +++ b/pc4mobx/hrmSalary/pages/mySalary/payrollModal.js @@ -7,6 +7,7 @@ import { inject, observer } from 'mobx-react'; export default class PayrollModal extends React.Component { componentWillMount() { const { mySalaryStore: {getMySalaryBill}} = this.props; + console.log("this.props.id", this.props.id) getMySalaryBill(this.props.id) } render() { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js index 938e7433..eed1c2be 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js @@ -171,7 +171,7 @@ export default class StandingBook extends React.Component { handleGoDetail = (billMonth) => { window.open( - `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?billMonth=${billMonth}` + `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?type=detail&billMonth=${billMonth}` ); setTimeout(() => { this.getCommonList({ diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index 750261a9..f3911563 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -310,15 +310,21 @@ export default class NormalIndex extends Component { )}
- - - - - - + { + this.props.type !== "detail" ? + + + + + + + + : + } + {addProps.visible && ( */} - {selectedKey === "1" && } + {selectedKey === "1" && this.props.type !== "detail" && } {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js index af73da19..298937e7 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js @@ -20,8 +20,9 @@ class StandingBookDetail extends Component { selectedKey: '', tabList: [], remarks: '', - billMonth: '' + billMonth: '', } + this.type = "" } componentDidMount() { @@ -31,6 +32,7 @@ class StandingBookDetail extends Component { getTabList = (payload = {}) => { const { getTabList } = this.props.standingBookStore; const billMonth = this.props.location.query.billMonth; + this.type = this.props.location.query.type; getTabList({ billMonth }).then(({ data }) => { const { tabList, remarks, billMonth } = data; let newTabList = tabList.filter(item => item.id != "2") @@ -56,15 +58,15 @@ class StandingBookDetail extends Component { /> { (selectedKey === '1' || selectedKey === '3') && - + } { selectedKey === '2' && - + } { selectedKey === '4' && - + } ); diff --git a/pc4mobx/hrmSalary/stores/archives.js b/pc4mobx/hrmSalary/stores/archives.js index 6b12044f..d53f89ff 100644 --- a/pc4mobx/hrmSalary/stores/archives.js +++ b/pc4mobx/hrmSalary/stores/archives.js @@ -111,7 +111,7 @@ export class ArchivesStore { // 渲染table数据 @action - getTableDatas = (params) => { + getTableDatas = (params = {}) => { this.loading = true; const formParams = this.form.getFormParams() || {}; params = {...formParams, ...params};