bug修改

This commit is contained in:
liyongshun 2022-06-07 18:24:05 +08:00
parent e552f34103
commit 9193e6b2e9
5 changed files with 274 additions and 168 deletions

View File

@ -122,7 +122,7 @@ export default class RefereAttendFormModal extends React.Component {
}
</Col>
</Row>
<Row style={{marginBottom: "10px"}}>
{/* <Row style={{marginBottom: "10px"}}>
<Col span={8}>添加账套外人员</Col>
<Col span={16}>
<WeaBrowser
@ -135,7 +135,7 @@ export default class RefereAttendFormModal extends React.Component {
isSingle={false}
/>
</Col>
</Row>
</Row> */}
<Row style={{marginBottom: "10px"}}>
<Col span={8}>备注</Col>
<Col span={16}>

View File

@ -1,55 +1,90 @@
import React from 'react'
import { WeaHelpfulTip, WeaDatePicker, WeaInput } from 'ecCom';
import { Modal, Row, Col, Button } from 'antd'
import { inject, observer } from 'mobx-react';
import React from "react";
import { WeaHelpfulTip, WeaDatePicker, WeaInput, WeaSelect } from "ecCom";
import { Modal, Row, Col, Button } from "antd";
import { inject, observer } from "mobx-react";
@inject('declareStore')
@inject("declareStore", "taxAgentStore")
@observer
export default class GenerateModal extends React.Component {
constructor(props) {
super(props)
this.state = {
date: ""
}
}
constructor(props) {
super(props);
this.state = {
date: "",
taxAgentId: "",
};
}
// 生成申报表
handleGenerate() {
const { declareStore: { saveDeclare }} = this.props;
saveDeclare(this.state.date).then(() => {
this.props.onGenerate()
})
}
// 生成申报表
handleGenerate() {
const {
declareStore: { saveDeclare },
} = this.props;
const { date, taxAgentId } = this.state;
saveDeclare({ salaryMonthStr: date, taxAgentId }).then(() => {
this.props.onGenerate();
});
}
render() {
return (
<Modal visible={this.props.visible} onCancel={() => this.props.onCancel()} width={800}
footer={
<Button type="primary" onClick={() => {this.handleGenerate()}}>生成申报表</Button>
}>
<div style={{height: "47px", lineHeight: "47px", borderBottom: "1px solid #eee"}}>
<span style={{fontSize: "14px", marginLeft: "20px"}}>申报</span>
<WeaHelpfulTip
style={{float: "right", marginRight: "40px"}}
width={200}
title="提示:一个薪资所属月下一个个税扣缴义务人的所有核算数据都归档后才可以申报"
placement="topLeft"
/>
</div>
<div style={{marginTop: '10px', padding: "20px"}}>
<Row style={{lineHeight: "40px"}}>
<Col span={8} >薪资所属月</Col>
<Col span={16}>
<WeaDatePicker
style={{width: "200px"}}
format="yyyy-MM"
value={this.state.date}
onChange={value => this.setState({date: value})}
/>
</Col>
</Row>
</div>
</Modal>
)
}
}
render() {
const {
taxAgentStore: { taxAgentOption },
} = this.props;
return (
<Modal
visible={this.props.visible}
onCancel={() => this.props.onCancel()}
width={800}
footer={
<Button
type="primary"
onClick={() => {
this.handleGenerate();
}}>
生成申报表
</Button>
}>
<div
style={{
height: "47px",
lineHeight: "47px",
borderBottom: "1px solid #eee",
}}>
<span style={{ fontSize: "14px", marginLeft: "20px" }}>申报</span>
<WeaHelpfulTip
style={{ float: "right", marginRight: "40px" }}
width={200}
title="提示:一个薪资所属月下一个个税扣缴义务人的所有核算数据都归档后才可以申报"
placement="topLeft"
/>
</div>
<div style={{ marginTop: "10px", padding: "20px" }}>
<Row style={{ lineHeight: "40px" }}>
<Col span={8}>薪资所属月</Col>
<Col span={16}>
<WeaDatePicker
style={{ width: "200px" }}
format="yyyy-MM"
value={this.state.date}
onChange={(value) => this.setState({ date: value })}
/>
</Col>
</Row>
<Row style={{ lineHeight: "40px" }}>
<Col span={8}>扣缴义务人</Col>
<Col span={16}>
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 200 }}
options={taxAgentOption}
value={this.state.taxAgentId}
onChange={(taxAgentId) => {
this.setState({ taxAgentId });
}}
/>
</Col>
</Row>
</div>
</Modal>
);
}
}

View File

@ -1,23 +1,30 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import { toJS } from 'mobx';
import React from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { Button, Table, DatePicker } from 'antd';
import { Button, Table, DatePicker } from "antd";
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaTable, WeaDatePicker } from 'ecCom';
import {
WeaTop,
WeaTab,
WeaRightMenu,
WeaRangePicker,
WeaTable,
WeaDatePicker,
} from "ecCom";
import { renderNoright, getSearchs } from '../../util'; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from '../../components/customTab';
import ContentWrapper from '../../components/contentWrapper';
import CustomTable from '../../components/customTable'
import { renderNoright, getSearchs } from "../../util"; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from "../../components/customTab";
import ContentWrapper from "../../components/contentWrapper";
import CustomTable from "../../components/customTable";
import { columns, dataSource } from './columns';
import GenerateModal from './generateModal'
import moment from 'moment'
import { columns, dataSource } from "./columns";
import GenerateModal from "./generateModal";
import moment from "moment";
const { RangePicker } = DatePicker;
@inject('declareStore')
@inject("declareStore", "taxAgentStore")
@observer
export default class Declare extends React.Component {
constructor(props) {
@ -26,136 +33,192 @@ export default class Declare extends React.Component {
value: "",
selectedKey: "0",
declarationModalVisible: false,
startDate: moment(new Date()).subtract(3,'months').startOf('month').format('YYYY-MM'),
endDate: moment(new Date()).subtract(-3,'months').startOf('month').format('YYYY-MM')
}
this.searchParams = {current: 1}
columns.map(item => {
if(item.dataIndex == "cz") {
item.render =(text, record) => {
startDate: moment(new Date())
.subtract(3, "months")
.startOf("month")
.format("YYYY-MM"),
endDate: moment(new Date())
.subtract(-3, "months")
.startOf("month")
.format("YYYY-MM"),
};
this.searchParams = { current: 1 };
columns.map((item) => {
if (item.dataIndex == "cz") {
item.render = (text, record) => {
return (
<a onClick={() => {window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/generateDeclarationDetail?id=" + record.id)}}>查看</a>
)
}
<a
onClick={() => {
window.open(
"/spa/hrmSalary/static/index.html#/main/hrmSalary/generateDeclarationDetail?id=" +
record.id
);
}}>
查看
</a>
);
};
}
})
});
}
componentWillMount() {
const { declareStore : {getDeclareList} } = this.props;
const {
taxAgentStore: { fetchTaxAgentOption },
declareStore: { getDeclareList },
} = this.props;
this.searchParams = {
fromSalaryMonthStr: this.state.startDate,
endSalaryMonthStr: this.state.endDate,
current: 1
}
getDeclareList(this.searchParams)
current: 1,
};
getDeclareList(this.searchParams);
fetchTaxAgentOption();
}
// 日期区间改变事件
handleRangePickerChange(value) {
let range = value.map(item => moment(item).format("YYYY-MM"))
const { declareStore : {getDeclareList} } = this.props;
let range = value.map((item) => moment(item).format("YYYY-MM"));
const {
declareStore: { getDeclareList },
} = this.props;
this.setState({
startDate: range[0],
endDate: range[1]
})
endDate: range[1],
});
getDeclareList({
fromSalaryMonthStr: range[0],
endSalaryMonthStr: range[1],
current: 1
})
current: 1,
});
}
// 查询列表
handleSearch() {
const { declareStore } = this.props;
const { getDeclareList } = declareStore
this.searchParams = {
fromSalaryMonthStr: this.state.startDate,
endSalaryMonthStr: this.state.endDate,
current: 1
}
getDeclareList(this.searchParams)
this.setState({ declarationModalVisible: false }, () => {
const { declareStore } = this.props;
const { getDeclareList } = declareStore;
this.searchParams = {
fromSalaryMonthStr: this.state.startDate,
endSalaryMonthStr: this.state.endDate,
current: 1,
};
getDeclareList(this.searchParams);
});
}
getColumns() {
const { declareStore: {listColumns}} = this.props;
let columns = [...listColumns]
const {
declareStore: { listColumns },
} = this.props;
let columns = [...listColumns];
columns.push({
title: "操作",
dataIndex: "operate",
render: (text, record) => {
return (
<a onClick={() => {window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/generateDeclarationDetail?id=" + record.id)}}>查看</a>
)
}
})
<a
onClick={() => {
window.open(
"/spa/hrmSalary/static/index.html#/main/hrmSalary/generateDeclarationDetail?id=" +
record.id
);
}}>
查看
</a>
);
},
});
return columns;
}
handleDataPageChange(value) {
const { declareStore : {getDeclareList} } = this.props;
const {
declareStore: { getDeclareList },
} = this.props;
this.searchParams = {
fromSalaryMonthStr: this.state.startDate,
endSalaryMonthStr: this.state.endDate,
current: value
}
getDeclareList(this.searchParams)
current: value,
};
getDeclareList(this.searchParams);
}
render() {
const { declareStore } = this.props;
const { loading, hasRight, form, condition,
tableStore, showSearchAd, getTableDatas, doSearch,
setShowSearchAd, listDataSource, listColumns, pageInfo } = declareStore;
const {
loading,
hasRight,
form,
condition,
tableStore,
showSearchAd,
getTableDatas,
doSearch,
setShowSearchAd,
listDataSource,
listColumns,
pageInfo,
} = declareStore;
if (!hasRight && !loading) { // 无权限处理
if (!hasRight && !loading) {
// 无权限处理
return renderNoright();
}
const rightMenu = [// 右键菜单
{
key: 'BTN_COLUMN',
icon: <i className='icon-coms-Custom' />,
content: '显示列定制',
onClick: this.showColumn
const rightMenu = [
// 右键菜单
{
key: "BTN_COLUMN",
icon: <i className="icon-coms-Custom" />,
content: "显示列定制",
onClick: this.showColumn,
},
];
const collectParams = { // 收藏功能配置
favname: '个税申报表',
const collectParams = {
// 收藏功能配置
favname: "个税申报表",
favouritetype: 1,
objid: 0,
link: 'wui/index.html#/ns_demo03/index',
link: "wui/index.html#/ns_demo03/index",
importantlevel: 1,
};
const adBtn = [ // 高级搜索内部按钮
<Button type="primary" onClick={doSearch}>搜索</Button>,
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>,
const adBtn = [
// 高级搜索内部按钮
<Button type="primary" onClick={doSearch}>
搜索
</Button>,
<Button type="ghost" onClick={() => form.resetForm()}>
重置
</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
取消
</Button>,
];
const topTab = [
];
const topTab = [];
const renderRightOperation = () => {
return <div style={{display: "inline-block"}}>
<RangePicker picker="month" format="yyyy-MM"
defaultValue={[this.state.startDate, this.state.endDate]}
onChange={(value) => this.handleRangePickerChange(value)}
/>
<Button type="primary" style={{marginLeft: "10px"}} onClick={() => {
this.setState({declarationModalVisible: true})
}}>生成申报单</Button>
</div>
}
return (
<div style={{ display: "inline-block" }}>
<RangePicker
picker="month"
format="yyyy-MM"
defaultValue={[this.state.startDate, this.state.endDate]}
onChange={(value) => this.handleRangePickerChange(value)}
/>
<Button
type="primary"
style={{ marginLeft: "10px" }}
onClick={() => {
this.setState({ declarationModalVisible: true });
}}>
生成申报单
</Button>
</div>
);
};
return (
<div className="mySalaryBenefitsWrapper">
@ -165,35 +228,40 @@ export default class Declare extends React.Component {
>
<WeaTop
title="个税申报表" // 文字
icon={<i className='icon-coms-meeting' />} // 左侧图标
iconBgcolor='#F14A2D' // 左侧图标背景色
icon={<i className="icon-coms-meeting" />} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
>
<CustomTab
searchOperationItem={
renderRightOperation()
}
/>
<CustomTable loading={loading} columns={this.getColumns()} dataSource={listDataSource}
pagination={{
onChange: (value) => {this.handleDataPageChange(value)},
total: pageInfo.total,
showTotal: (total) => `${total}`,
current: pageInfo.pageNum
}}
<CustomTab searchOperationItem={renderRightOperation()} />
<CustomTable
loading={loading}
columns={this.getColumns()}
dataSource={listDataSource}
pagination={{
onChange: (value) => {
this.handleDataPageChange(value);
},
total: pageInfo.total,
showTotal: (total) => `${total}`,
current: pageInfo.pageNum,
}}
/>
</WeaTop>
</WeaRightMenu>
{
this.state.declarationModalVisible && <GenerateModal
onGenerate={() => {this.handleSearch()}}
visible={this.state.declarationModalVisible}
onCancel={() => {this.setState({declarationModalVisible: false})}}
{this.state.declarationModalVisible && (
<GenerateModal
onGenerate={() => {
this.handleSearch();
}}
visible={this.state.declarationModalVisible}
onCancel={() => {
this.setState({ declarationModalVisible: false });
}}
/>
}
)}
</div>
)
);
}
}

View File

@ -394,11 +394,14 @@ export default class TaxAgent extends React.Component {
title={
<div className="titleWrapper">
<div className="title">个税扣缴义务人</div>
<i
className="icon-coms-Add-to"
title="新增"
onClick={() => this.showEditModal()}
/>
{/* 总管理员开启新增功能 */}
{permission.isChief && (
<i
className="icon-coms-Add-to"
title="新增"
onClick={() => this.showEditModal()}
/>
)}
</div>
}
showGroup>

View File

@ -89,9 +89,9 @@ export class DeclareStore {
//个税申报表-个税申报表生成
@action
saveDeclare = (date) => {
saveDeclare = (params) => {
return new Promise((resolve, reject) => {
API.saveDeclare({salaryMonthStr: date}).then(res => {
API.saveDeclare(params).then(res => {
if(res.status) {
message.success("生成成功")
resolve();