bug修复

This commit is contained in:
MustangDeng 2022-06-06 14:31:20 +08:00
parent c9cda1fdfc
commit b94af53ed4
11 changed files with 307 additions and 40 deletions

View File

@ -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 = (
<Route
@ -128,6 +130,7 @@ const Routes = (
<Route key="taxRate" path="taxRate" component={TaxRate} />
<Route key="taxAgent" path="taxAgent" component={TaxAgent} />
<Route key="mobilepayroll" path="mobilepayroll" component={MobilePayroll} />
</Route>
);

View File

@ -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)
}}
/>
</div>
@ -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同步

View File

@ -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)
}}
/>
</div>
@ -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同步

View File

@ -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)
}}
/>
</div>
@ -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同步

View File

@ -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}
>
<WeaTable columns={this.getColumns()} dataSource={[]} scroll={{x: 1200}}/>
<WeaTable columns={this.getColumns().columns} dataSource={[]} scroll={{x: this.getColumns().length * 150}}/>
</Modal>
)
}

View File

@ -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 (
<div className="computerTemplate" style={{
backgroundColor: "rgb(246, 246, 246)",
minHeight: "600px",
height: "600px",
overflowY: "scroll",
paddingTop: "30px",
paddingBottom: "20px",
margin: "20px auto",
}}>
{/* 标题 */}
<div className="titleWrapper" style={{
textAlign: "center",
fontSize: "18px",
fontWeight: 700
}}>
{ mySalaryBill.salaryTemplate && mySalaryBill.salaryTemplate.theme }
</div>
{
mySalaryBill.salaryTemplate && mySalaryBill.salaryTemplate.background && mySalaryBill.salaryTemplate.background !== ""
&& <div className="background-wrapper" style={{
height: "200px",
margin: "10px"
}}>
<img className="background-img" src={mySalaryBill.salaryTemplate.background} style={{
width: "100%",
height: "200px"
}}/>
</div>
}
{/* 员工信息 */}
<div className="sobItemWrapper">
<div className="sobItem" style={{
margin: "10px",
backgroundColor: "#FFF",
padding: "10px",
lineHeight: "35px",
textAlign: "center"
}}>
{
mySalaryBill.employeeInformation && <Row className="titleRow" style={{
border: "1px solid #f2f2f2",
textAlign: "left"
}}>
<Col span={24} className="sobTitle" style={{
paddingLeft: "10px"
}}>{mySalaryBill.employeeInformation.groupName}</Col>
</Row>
}
<Row className="contentRow" style={{
borderLeft: "1px solid #f2f2f2",
borderBottom: "1px solid #f2f2f2",
borderRight: "1px solid #f2f2f2"
}}>
{
mySalaryBill.employeeInformation && mySalaryBill.employeeInformation.items.map((item, index) => (
<Col>
<Col span={ type == "phone" ? 12 : 4 } className="contentItem" style={{
borderRight: "1px solid #f2f2f2",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
height: "35px"
}}>{item.name}</Col>
<Col span={ type == "phone" ? 12 : 4 } className="contentItem"
style={{
borderRight: (index + 1) % 3 == 0 ? "none": "1px solid #f2f2f2",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
height: "35px"
}}
>{item.salaryItemValue}</Col>
</Col>
))
}
</Row>
</div>
</div>
{
mySalaryBill.salaryGroups && mySalaryBill.salaryGroups.length > 0 &&
mySalaryBill.salaryGroups.map(group => (
<div className="sobItemWrapper">
<div className="sobItem" style={{
margin: "10px",
backgroundColor: "#FFF",
padding: "10px",
lineHeight: "35px",
textAlign: "center"
}}>
{
mySalaryBill.employeeInformation && <Row className="titleRow" style={{
border: "1px solid #f2f2f2",
textAlign: "left"
}}>
<Col span={24} className="sobTitle" style={{
paddingLeft: "10px"
}}>{group.groupName}</Col>
</Row>
}
<Row className="contentRow" style={{
borderLeft: "1px solid #f2f2f2",
borderBottom: "1px solid #f2f2f2",
borderRight: "1px solid #f2f2f2"
}}>
{
group.items && group.items.map((item, index) => (
<Col>
<Col span={ type == "phone" ? 12 : 4 } className="contentItem" style={{
borderRight: "1px solid #f2f2f2",
borderBottom: (index + 1) > 3 ? "1px solid #f2f2f2" : "none",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
height: "35px"
}}>{item.name}</Col>
<Col span={ type == "phone" ? 12 : 4 } className="contentItem"
style={{
borderRight: (index + 1) % 3 == 0 ? "none": "1px solid #f2f2f2",
borderBottom: (index + 1) > 3 ? "1px solid #f2f2f2" : "none",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
height: "35px"
}}
>{item.salaryItemValue}</Col>
</Col>
))
}
</Row>
</div>
</div>
))
}
</div>
)
}
}

View File

@ -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() {

View File

@ -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({

View File

@ -310,15 +310,21 @@ export default class NormalIndex extends Component {
</div>
)}
<div className="tabOption">
<Tooltip title="批量删除">
<i
className="icon-coms-Batch-delete"
onClick={this.handleBatchDelete}
/>
</Tooltip>
<Tooltip title="添加该月正常缴纳人员">
<i className="icon-coms-Add-to" onClick={this.handleAdd} />
</Tooltip>
{
this.props.type !== "detail" ?
<span>
<Tooltip title="批量删除">
<i
className="icon-coms-Batch-delete"
onClick={this.handleBatchDelete}
/>
</Tooltip>
<Tooltip title="添加该月正常缴纳人员">
<i className="icon-coms-Add-to" onClick={this.handleAdd} />
</Tooltip>
</span> : <span></span>
}
{addProps.visible && (
<WeaDialog
{...addProps}
@ -351,7 +357,7 @@ export default class NormalIndex extends Component {
<Tooltip title="导出全部">
<i className="icon-coms02-coms2-export" />
</Tooltip> */}
{selectedKey === "1" && <Button type="primary" onClick={() => {this.handleCommonAccountClick()}}>核算</Button>}
{selectedKey === "1" && this.props.type !== "detail" && <Button type="primary" onClick={() => {this.handleCommonAccountClick()}}>核算</Button>}
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
</div>

View File

@ -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') &&
<NormalIndex selectedKey={selectedKey} remarks={remarks} billMonth={billMonth} />
<NormalIndex selectedKey={selectedKey} remarks={remarks} billMonth={billMonth} type={this.type}/>
}
{
selectedKey === '2' &&
<AbnormalListIndex billMonth={billMonth} />
<AbnormalListIndex billMonth={billMonth} type={this.type}/>
}
{
selectedKey === '4' &&
<OverViewIndex billMonth={billMonth} />
<OverViewIndex billMonth={billMonth} type={this.type}/>
}
</div>
);

View File

@ -111,7 +111,7 @@ export class ArchivesStore {
// 渲染table数据
@action
getTableDatas = (params) => {
getTableDatas = (params = {}) => {
this.loading = true;
const formParams = this.form.getFormParams() || {};
params = {...formParams, ...params};