账套公式,个税申报表
This commit is contained in:
parent
9bb84614c7
commit
bd21135a22
|
|
@ -341,6 +341,18 @@ export const reAccounting = (params) => {
|
|||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
// 薪资结果-编辑表单保存
|
||||
export const saveAcctResult = (params) => {
|
||||
return fetch('/api/bs/hrmsalary/salaryacct/acctresult/save', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,14 @@ import { WeaTools } from 'ecCom';
|
|||
|
||||
//个税申报表-个税申报表列表
|
||||
export const getDeclareList = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/taxdeclaration/list', 'POST', params);
|
||||
return fetch('/api/bs/hrmsalary/taxdeclaration/list', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
//个税申报表-个税申报表表单
|
||||
|
|
@ -12,10 +19,46 @@ export const getDeclareForm = params => {
|
|||
|
||||
//个税申报表-个税申报表生成
|
||||
export const saveDeclare = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/taxdeclaration/save', 'POST', params);
|
||||
return fetch('/api/bs/hrmsalary/taxdeclaration/save', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
//个税申报表-个税申报表相关信息
|
||||
export const getDeclareInfo = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationInfo', 'get', params);
|
||||
}
|
||||
}
|
||||
|
||||
// 个税申报表详情列表
|
||||
export const getDetailList = params => {
|
||||
return fetch('/api/bs/hrmsalary/taxdeclaration/detail/list', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
|
||||
// 个税申报表导出
|
||||
export const exportSalaryArchive = (id = "") => {
|
||||
fetch('/api/bs/hrmsalary/taxdeclaration/export?taxDeclarationId=' + id).then(res => res.blob().then(blob => {
|
||||
var filename=`个税申报表.xlsx`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -147,4 +147,10 @@ export const saveFormual = params => {
|
|||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
// 根据id获取formual
|
||||
export const detailFormual = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/formula/detail', 'GET', params);
|
||||
}
|
||||
|
||||
|
||||
// *** 公式 end ***
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react'
|
||||
import { WeaHelpfulTip } from "ecCom"
|
||||
import { WeaHelpfulTip, WeaInput } from "ecCom"
|
||||
import { Row, Col } from 'antd'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import "./index.less"
|
||||
|
|
@ -11,8 +11,33 @@ export default class EditSalaryDetail extends React.Component {
|
|||
const { calculateStore: {acctresultDetail}} = this.props;
|
||||
acctresultDetail(this.props.id)
|
||||
}
|
||||
|
||||
handleItemValueChange(field, value, isInput) {
|
||||
const { calculateStore: { acctresultDetailForm, setAcctresultDetailForm }} = this.props;
|
||||
let form = {...acctresultDetailForm}
|
||||
if(isInput) {
|
||||
form.inputItems = acctresultDetailForm.inputItems.map(item => {
|
||||
item = {...item}
|
||||
if(item.salaryItemName == field) {
|
||||
item.resultValue = value
|
||||
}
|
||||
return item;
|
||||
})
|
||||
} else {
|
||||
form.formulaItems = acctresultDetailForm.formulaItems.map(item => {
|
||||
item = {...item}
|
||||
if(item.salaryItemName == field) {
|
||||
item.resultValue = value
|
||||
}
|
||||
return item;
|
||||
})
|
||||
}
|
||||
setAcctresultDetailForm(form)
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const { calculateStore: { acctresultDetail }} = this.props;
|
||||
const { calculateStore: { acctresultDetailForm }} = this.props;
|
||||
return (
|
||||
<div className="editSalaryDetail">
|
||||
<div className="detailItemWrapper">
|
||||
|
|
@ -29,63 +54,17 @@ export default class EditSalaryDetail extends React.Component {
|
|||
<div className="itemContent">
|
||||
<Row classsName="itemRow">
|
||||
{
|
||||
acctresultDetail.employeeInfos.map(item => {
|
||||
acctresultDetailForm.employeeInfos && acctresultDetailForm.employeeInfos.map(item => {
|
||||
return (
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>{item.fieldName}</Col>
|
||||
{/* <Col span={12}>{item.}</Col> */}
|
||||
</Row>
|
||||
|
||||
<Col span={12}>{item.fieldValue}</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
)
|
||||
})
|
||||
}
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>姓名</Col>
|
||||
<Col span={12}>张三</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>部门</Col>
|
||||
<Col span={12}>研发</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
||||
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>岗位</Col>
|
||||
<Col span={12}>开发</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row className="itemRow">
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>入职日期</Col>
|
||||
<Col span={12}>2020-10-20</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>手机号</Col>
|
||||
<Col span={12}>18888888888</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
||||
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>个税扣缴义务人</Col>
|
||||
<Col span={12}>义务人一</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -97,50 +76,21 @@ export default class EditSalaryDetail extends React.Component {
|
|||
|
||||
<div className="itemContent">
|
||||
<Row className="itemRow">
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>基本工资</Col>
|
||||
<Col span={12}>25,000</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
{
|
||||
acctresultDetailForm.inputItems && acctresultDetailForm.inputItems.map(item => {
|
||||
return (
|
||||
<Col span={8}>
|
||||
<Row style={{paddingLeft:"10px", paddingRight: "10px"}}>
|
||||
<Col span={12}>{item.salaryItemName}</Col>
|
||||
<Col span={12}><WeaInput value={item.resultValue} onChange={(value) => {
|
||||
this.handleItemValueChange(item.salaryItemName, value, true)
|
||||
}}/></Col>
|
||||
</Row>
|
||||
</Col>
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>用餐补贴</Col>
|
||||
<Col span={12}>25,000</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
||||
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>住房补贴</Col>
|
||||
<Col span={12}>25,000</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row className="itemRow">
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>话费补贴</Col>
|
||||
<Col span={12}>5,000</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>岗位津贴</Col>
|
||||
<Col span={12}>5,000</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>高温补贴</Col>
|
||||
<Col span={12}>5,000</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -159,50 +109,20 @@ export default class EditSalaryDetail extends React.Component {
|
|||
|
||||
<div className="itemContent">
|
||||
<Row className="itemRow">
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>基本工资</Col>
|
||||
<Col span={12}>25,000</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>用餐补贴</Col>
|
||||
<Col span={12}>25,000</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
||||
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>住房补贴</Col>
|
||||
<Col span={12}>25,000</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row className="itemRow">
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>话费补贴</Col>
|
||||
<Col span={12}>5,000</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>岗位津贴</Col>
|
||||
<Col span={12}>5,000</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={12}>高温补贴</Col>
|
||||
<Col span={12}>5,000</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
{
|
||||
acctresultDetailForm.formulaItems && acctresultDetailForm.formulaItems.map(item => {
|
||||
return (
|
||||
<Col span={8}>
|
||||
<Row style={{paddingLeft:"10px", paddingRight: "10px"}}>
|
||||
<Col span={12}>{item.salaryItemName}</Col>
|
||||
<Col span={12}><WeaInput value={item.resultValue} onChange={(value) => {
|
||||
this.handleItemValueChange(item.salaryItemName, value, false)
|
||||
}}/></Col>
|
||||
</Row>
|
||||
</Col>
|
||||
)
|
||||
})
|
||||
}
|
||||
</Row>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -30,10 +30,12 @@ export default class SalaryDetail extends React.Component {
|
|||
})
|
||||
}
|
||||
this.recordId = ""
|
||||
this.id = ""
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
let id = getQueryString("id")
|
||||
this.id = id;
|
||||
const { calculateStore: { acctResultList, getSalarySobCycle } } = this.props;
|
||||
acctResultList(id)
|
||||
getSalarySobCycle(id)
|
||||
|
|
@ -76,6 +78,15 @@ export default class SalaryDetail extends React.Component {
|
|||
})
|
||||
}
|
||||
|
||||
// 侧边栏保存
|
||||
handleEditSlideSave() {
|
||||
const {calculateStore } = this.props;
|
||||
const { saveAcctResult, acctResultList } = calculateStore;
|
||||
saveAcctResult(this.recordId).then(() => {
|
||||
acctResultList(this.id)
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const { slideVisiable } = this.state;
|
||||
const { calculateStore } = this.props;
|
||||
|
|
@ -114,6 +125,7 @@ export default class SalaryDetail extends React.Component {
|
|||
<SlideModalTitle
|
||||
subtitle={"编辑薪资"}
|
||||
editable={true}
|
||||
onSave={() => this.handleEditSlideSave()}
|
||||
/>
|
||||
}
|
||||
content={<EditSalaryDetail id={this.recordId}/>}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,49 @@
|
|||
import React from 'react'
|
||||
import CustomTab from '../../components/customTab'
|
||||
import { Button, Table } from "antd"
|
||||
import { WeaTable } from 'ecCom'
|
||||
import { declarationColumns, dataSource} from './columns'
|
||||
import "./index.less"
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { getQueryString } from '../../util/url'
|
||||
|
||||
@inject('declareStore')
|
||||
@observer
|
||||
export default class GenerateDeclarationDetail extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.id = getQueryString("id")
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { declareStore: { getDetailList, getDeclareInfo }} = this.props;
|
||||
getDetailList(this.id)
|
||||
getDeclareInfo(this.id)
|
||||
}
|
||||
|
||||
// 导出
|
||||
handleExport() {
|
||||
const { declareStore: {exportSalaryArchive}} = this.props;
|
||||
exportSalaryArchive(this.id)
|
||||
}
|
||||
|
||||
getColumns() {
|
||||
const { declareStore: {datailColumns}} = this.props;
|
||||
let columns = [...datailColumns]
|
||||
return columns.map(item => {
|
||||
item = {...item}
|
||||
item.width = "150px"
|
||||
return item;
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const { declareStore: { detailDataSource, detailTableStore, declareInfo, datailColumns }} = this.props;
|
||||
|
||||
const renderRightOperation = () => {
|
||||
return (
|
||||
<div style={{display: "inline-block"}}>
|
||||
<Button type="primary">导出</Button>
|
||||
<Button type="primary" onClick={() => {this.handleExport()}}>导出</Button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -17,8 +51,8 @@ export default class GenerateDeclarationDetail extends React.Component {
|
|||
const renderLeftOperation = () => {
|
||||
return (
|
||||
<div style={{display: "inline-block", lineHeight: '47px'}}>
|
||||
<span>薪资所属月:2021-11</span>
|
||||
<span style={{marginLeft: "10px"}}>个税扣缴义务人:上海泛微</span>
|
||||
<span>薪资所属月:{declareInfo.salaryMonth && declareInfo.salaryMonth.year} - {declareInfo.salaryMonth && declareInfo.salaryMonth.monthValue}</span>
|
||||
<span style={{marginLeft: "10px"}}>个税扣缴义务人:{declareInfo.taxAgentName}</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -33,7 +67,7 @@ export default class GenerateDeclarationDetail extends React.Component {
|
|||
}
|
||||
/>
|
||||
<div>
|
||||
<Table dataSource={dataSource} columns={declarationColumns}/>
|
||||
<WeaTable dataSource={detailDataSource} columns={this.getColumns()} scroll={{x: 2300}}/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import React from 'react'
|
||||
import { WeaHelpfulTip, WeaDatePicker, WeaInput } from 'ecCom';
|
||||
import { Modal, Row, Col } from 'antd'
|
||||
|
||||
import { Modal, Row, Col, Button } from 'antd'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
|
||||
@inject('declareStore')
|
||||
@observer
|
||||
export default class GenerateModal extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
|
@ -10,9 +12,21 @@ export default class GenerateModal extends React.Component {
|
|||
date: ""
|
||||
}
|
||||
}
|
||||
|
||||
// 生成申报表
|
||||
handleGenerate() {
|
||||
const { declareStore: { saveDeclare }} = this.props;
|
||||
saveDeclare(this.state.date).then(() => {
|
||||
this.props.onGenerate()
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Modal visible={this.props.visible} onCancel={() => this.props.onCancel()} width={800}>
|
||||
<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
|
||||
|
|
@ -22,23 +36,18 @@ export default class GenerateModal extends React.Component {
|
|||
placement="topLeft"
|
||||
/>
|
||||
</div>
|
||||
<div style={{marginTop: '10px'}}>
|
||||
<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}>
|
||||
<WeaInput style={{width: "200px"}} />
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -12,10 +12,11 @@ import ContentWrapper from '../../components/contentWrapper';
|
|||
|
||||
import { columns, dataSource } from './columns';
|
||||
import GenerateModal from './generateModal'
|
||||
import moment from 'moment'
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
@inject('baseTableStore')
|
||||
@inject('declareStore')
|
||||
@observer
|
||||
export default class Declare extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -23,21 +24,82 @@ export default class Declare extends React.Component {
|
|||
this.state = {
|
||||
value: "",
|
||||
selectedKey: "0",
|
||||
declarationModalVisible: false
|
||||
declarationModalVisible: false,
|
||||
startDate: moment(new Date()).format("YYYY-MM"),
|
||||
endDate: moment(new Date()).format("YYYY-MM")
|
||||
}
|
||||
columns.map(item => {
|
||||
if(item.dataIndex == "cz") {
|
||||
item.render =() => {
|
||||
item.render =(text, record) => {
|
||||
return (
|
||||
<a onClick={() => {window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/generateDeclarationDetail")}}>查看</a>
|
||||
<a onClick={() => {window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/generateDeclarationDetail?id=" + record.id)}}>查看</a>
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
this.handleSearch()
|
||||
}
|
||||
|
||||
// 开始月份改变
|
||||
handleStartDateChange(value) {
|
||||
this.setState({
|
||||
startDate: value
|
||||
})
|
||||
const { declareStore } = this.props;
|
||||
const { getDeclareList } = declareStore
|
||||
getDeclareList({
|
||||
fromSalaryMonthStr: value,
|
||||
endSalaryMonthStr: this.state.endDate
|
||||
})
|
||||
}
|
||||
|
||||
// 结束月份改变
|
||||
handleEndDateChange(value) {
|
||||
this.setState({
|
||||
endDate: value
|
||||
})
|
||||
const { declareStore } = this.props;
|
||||
const { getDeclareList } = declareStore
|
||||
getDeclareList({
|
||||
fromSalaryMonthStr: this.state.startDate,
|
||||
endSalaryMonthStr: value
|
||||
})
|
||||
}
|
||||
|
||||
// 查询列表
|
||||
handleSearch() {
|
||||
const { declareStore } = this.props;
|
||||
const { getDeclareList } = declareStore
|
||||
getDeclareList({
|
||||
fromSalaryMonthStr: this.state.startDate,
|
||||
endSalaryMonthStr: this.state.endDate
|
||||
})
|
||||
}
|
||||
|
||||
getColumns() {
|
||||
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>
|
||||
)
|
||||
}
|
||||
})
|
||||
return columns;
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const { baseTableStore } = this.props;
|
||||
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = baseTableStore;
|
||||
const { declareStore } = this.props;
|
||||
const { loading, hasRight, form, condition,
|
||||
tableStore, showSearchAd, getTableDatas, doSearch,
|
||||
setShowSearchAd, listDataSource, listColumns } = declareStore;
|
||||
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
return renderNoright();
|
||||
|
|
@ -72,13 +134,13 @@ export default class Declare extends React.Component {
|
|||
<WeaDatePicker
|
||||
format="yyyy-MM"
|
||||
value={this.state.startDate}
|
||||
onChange={value => this.setState({startDate: value})}
|
||||
onChange={value => this.handleStartDateChange(value)}
|
||||
/>
|
||||
<span className="between"> 至 </span>
|
||||
<WeaDatePicker
|
||||
format="yyyy-MM"
|
||||
value={this.state.endDate}
|
||||
onChange={value => this.setState({endDate: value})}
|
||||
onChange={value => this.handleEndDateChange(value)}
|
||||
/>
|
||||
|
||||
<Button type="primary" style={{marginLeft: "10px"}} onClick={() => {
|
||||
|
|
@ -109,11 +171,12 @@ export default class Declare extends React.Component {
|
|||
renderRightOperation()
|
||||
}
|
||||
/>
|
||||
<WeaTable columns={columns} dataSource={dataSource}/>
|
||||
<WeaTable columns={this.getColumns()} dataSource={listDataSource}/>
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
{
|
||||
this.state.declarationModalVisible && <GenerateModal
|
||||
onGenerate={() => {this.handleSearch()}}
|
||||
visible={this.state.declarationModalVisible}
|
||||
onCancel={() => {this.setState({declarationModalVisible: false})}}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ export const slideStep3Columns = [
|
|||
},
|
||||
{
|
||||
title: "规则",
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
dataIndex: 'formulaContent',
|
||||
key: 'formulaContent'
|
||||
},
|
||||
{
|
||||
title: "个税申请表对应字段",
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
import React from 'react'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { Modal, Button, message, Switch } from 'antd'
|
||||
import { WeaInputSearch } from 'ecCom'
|
||||
import { WeaInputSearch, WeaTable } from 'ecCom'
|
||||
import { WeaTableNew } from "comsMobx"
|
||||
import { toJS } from 'mobx'
|
||||
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
|
||||
@inject('ledgerStore')
|
||||
@observer
|
||||
|
|
@ -13,7 +12,8 @@ export default class AddSalaryItemModal extends React.Component {
|
|||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
searchValue: ""
|
||||
searchValue: "",
|
||||
selectedRowKeys:[]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -24,6 +24,9 @@ export default class AddSalaryItemModal extends React.Component {
|
|||
|
||||
// 增加编辑功能,重写columns绑定事件
|
||||
getColumns = (columns) => {
|
||||
if(!columns) {
|
||||
return []
|
||||
}
|
||||
let newColumns = '';
|
||||
newColumns = columns.map(column => {
|
||||
let newColumn = column;
|
||||
|
|
@ -42,17 +45,18 @@ export default class AddSalaryItemModal extends React.Component {
|
|||
return newColumns;
|
||||
}
|
||||
|
||||
|
||||
handleAdd() {
|
||||
|
||||
const { ledgerStore } = this.props;
|
||||
const { salaryItemTableStore, addItemsToGroup, addExcludeIds } = ledgerStore
|
||||
const selectedRowKeys = toJS(salaryItemTableStore.selectedRowKeys) || [];
|
||||
const { addSalaryItemDataSource, addItemsToGroup, addExcludeIds } = ledgerStore
|
||||
const { selectedRowKeys } = this.state;
|
||||
if(selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目")
|
||||
}
|
||||
let selectItems = []
|
||||
|
||||
salaryItemTableStore.datas.map(item => {
|
||||
addSalaryItemDataSource.map(item => {
|
||||
selectedRowKeys.map(key => {
|
||||
if(item.id == key) {
|
||||
item.salaryItemId = item.id
|
||||
|
|
@ -60,8 +64,7 @@ export default class AddSalaryItemModal extends React.Component {
|
|||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
addItemsToGroup(this.props.title, selectItems)
|
||||
this.props.onCancel();
|
||||
}
|
||||
|
|
@ -71,10 +74,23 @@ export default class AddSalaryItemModal extends React.Component {
|
|||
listSalaryItem(value)
|
||||
}
|
||||
|
||||
|
||||
onSelectChange = selectedRowKeys => {
|
||||
this.setState({ selectedRowKeys });
|
||||
}
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
const { ledgerStore } = this.props;
|
||||
const { salaryItemTableStore } = ledgerStore
|
||||
const { searchValue } = this.state;
|
||||
const { addSalaryItemDataSource, addSalaryItemColumns } = ledgerStore
|
||||
const { searchValue, selectedRowKeys } = this.state;
|
||||
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange,
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
visible={this.props.visible} onCancel={() => {this.props.onCancel()}} width={800}
|
||||
|
|
@ -89,12 +105,18 @@ export default class AddSalaryItemModal extends React.Component {
|
|||
</div>
|
||||
|
||||
<div style={{margin: "10px"}}>
|
||||
<WeaTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
{/* <WeaTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={salaryItemTableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
getColumns={this.getColumns}
|
||||
// onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
/> */}
|
||||
|
||||
<WeaTable
|
||||
dataSource={addSalaryItemDataSource}
|
||||
columns={this.getColumns(addSalaryItemColumns)}
|
||||
rowSelection={rowSelection}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
|
|
|
|||
|
|
@ -3,18 +3,51 @@ import { Icon, Table, message, Modal } from 'antd'
|
|||
import { slideStep3Columns } from '../columns'
|
||||
import AddSalaryItemModal from './AddSalaryItemModal'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import FormalFormModal from '../../salaryItem/formalFormModal'
|
||||
|
||||
@inject('ledgerStore')
|
||||
@observer
|
||||
export default class CanMoveItem extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
let columns = slideStep3Columns.map(item => {
|
||||
item = {...item}
|
||||
if(item.key == "formulaContent") {
|
||||
item.render = (text, record) => {
|
||||
if(record.canEdit) {
|
||||
return (
|
||||
<a onClick={() => {
|
||||
this.handleFormulaClick(record.formulaId)
|
||||
}}>{text}</a>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<span>{text}</span>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
return item;
|
||||
})
|
||||
this.state = {
|
||||
addItemVisible: false,
|
||||
showContent: true,
|
||||
selectedRowKeys: []
|
||||
selectedRowKeys: [],
|
||||
columns,
|
||||
formalModalVisible: false
|
||||
}
|
||||
|
||||
this.formulaId = ""
|
||||
}
|
||||
|
||||
// 编辑公式
|
||||
handleFormulaClick(formulaId) {
|
||||
this.formulaId = formulaId
|
||||
this.setState({
|
||||
formalModalVisible: true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
handleTiggleContent() {
|
||||
this.setState({showContent: !this.state.showContent})
|
||||
|
|
@ -26,7 +59,6 @@ export default class CanMoveItem extends React.Component {
|
|||
|
||||
// 删除
|
||||
handleDelete = () => {
|
||||
|
||||
const { selectedRowKeys } = this.state;
|
||||
if(selectedRowKeys.length == 0) {
|
||||
message.warning("为选择任何条目")
|
||||
|
|
@ -44,13 +76,16 @@ export default class CanMoveItem extends React.Component {
|
|||
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 保存
|
||||
handleSaveFormal(data) {
|
||||
console.log("data: " + data);
|
||||
}
|
||||
|
||||
render() {
|
||||
const {ledgerStore: {setAddItemVisible, addItemVisible}} = this.props;
|
||||
const { selectedRowKeys } = this.state;
|
||||
const { selectedRowKeys, formalModalVisible } = this.state;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange,
|
||||
|
|
@ -67,7 +102,7 @@ export default class CanMoveItem extends React.Component {
|
|||
</span>
|
||||
</div>
|
||||
{
|
||||
this.state.showContent && <Table rowSelection={rowSelection} dataSource={this.props.dataSource} columns={slideStep3Columns} pagination={false}/>
|
||||
this.state.showContent && <Table rowSelection={rowSelection} dataSource={this.props.dataSource} columns={this.state.columns} pagination={false}/>
|
||||
}
|
||||
{
|
||||
this.state.addItemVisible && <AddSalaryItemModal
|
||||
|
|
@ -76,6 +111,20 @@ export default class CanMoveItem extends React.Component {
|
|||
onCancel={() => { this.setState({addItemVisible: false})}}
|
||||
/>
|
||||
}
|
||||
|
||||
{
|
||||
formalModalVisible &&
|
||||
<FormalFormModal
|
||||
formulaId={this.formulaId}
|
||||
visible={formalModalVisible}
|
||||
onSaveFormal={(data) => {
|
||||
this.handleSaveFormal(data)
|
||||
}}
|
||||
onCancel={() => this.setState({
|
||||
formalModalVisible: false
|
||||
})}
|
||||
/>
|
||||
}
|
||||
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
super(props)
|
||||
this.state = {
|
||||
showForm: false,
|
||||
formalModalVisible: false,
|
||||
formula: ""
|
||||
formalModalVisible: false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -29,17 +28,15 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
|
||||
// 保存公式成功回调
|
||||
handleSaveFormal(data) {
|
||||
this.handleChange({formulaId: data.id})
|
||||
this.setState({
|
||||
formula: data.formula
|
||||
})
|
||||
this.handleChange({formulaId: data.id, formulaContent: data.formula})
|
||||
}
|
||||
|
||||
render() {
|
||||
const { editable, request } = this.props;
|
||||
const { name, useDefault, useInEmployeeSalary, roundingMode, pattern, valueType, description, dataType } = request;
|
||||
const { name, useDefault, useInEmployeeSalary, roundingMode, pattern, valueType, description, dataType, formulaContent, formulaId } = request;
|
||||
const { formalModalVisible } = this.state;
|
||||
console.log("valueType: " + valueType);
|
||||
|
||||
console.log("request: ", request);
|
||||
return (
|
||||
<div className="customSalaryItemSlide">
|
||||
<div>
|
||||
|
|
@ -124,7 +121,7 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
<div style={{width: "100%", lineHeight: '30px', height: "30px", border: "1px solid rgb(217, 217, 217)"}}
|
||||
onClick={() => this.handleShowFormal()}
|
||||
>
|
||||
{this.state.formula}
|
||||
{formulaContent}
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
|
|
@ -141,6 +138,7 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
{
|
||||
formalModalVisible &&
|
||||
<FormalFormModal
|
||||
formulaId={formulaId}
|
||||
visible={formalModalVisible}
|
||||
onSaveFormal={(data) => {
|
||||
this.handleSaveFormal(data)
|
||||
|
|
|
|||
|
|
@ -18,10 +18,19 @@ export default class FormalFormModal extends React.Component {
|
|||
|
||||
componentWillMount() {
|
||||
const { salaryItemStore } = this.props;
|
||||
const { salaryAcctImportTemplateParam, setSearchFields } = salaryItemStore;
|
||||
const { salaryAcctImportTemplateParam, setSearchFields, detailFormual } = salaryItemStore;
|
||||
salaryAcctImportTemplateParam();
|
||||
setSearchFields([])
|
||||
if(this.props.formulaId) {
|
||||
detailFormual(this.props.formulaId).then(data => {
|
||||
this.setState({
|
||||
value: data.formula
|
||||
})
|
||||
this.parameters = data.parameters
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 多行文本编辑
|
||||
handleChange(value) {
|
||||
this.setState({
|
||||
|
|
|
|||
|
|
@ -77,9 +77,9 @@ export default class SalaryItem extends React.Component {
|
|||
case "name":
|
||||
return <a onClick={() => {this.onEditItem(record, false)}}>{text}</a>
|
||||
case "useInEmployeeSalary":
|
||||
return <Switch checked={text == 1}/>
|
||||
return <Switch checked={text == 1} disabled/>
|
||||
case "useDefault":
|
||||
return <Switch checked={text == 1}/>
|
||||
return <Switch checked={text == 1} disabled/>
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,8 +42,9 @@ export class calculateStore {
|
|||
@observable comparisonresultListColumns = [];//列
|
||||
|
||||
|
||||
|
||||
|
||||
// 编辑薪资表单数据
|
||||
@action
|
||||
setAcctresultDetailForm = (acctresultDetailForm) => {this.acctresultDetailForm = acctresultDetailForm}
|
||||
// 初始化操作
|
||||
@action
|
||||
doInit = () => {
|
||||
|
|
@ -347,4 +348,37 @@ export class calculateStore {
|
|||
|
||||
}
|
||||
|
||||
// 薪资结果-编辑表单保存
|
||||
@action
|
||||
saveAcctResult = (recordId) => {
|
||||
let inputItems = this.acctresultDetailForm.inputItems.map(item => {
|
||||
let record = {}
|
||||
record.salaryItemId = item.salaryItemId
|
||||
record.resultValue = item.resultValue
|
||||
return record;
|
||||
})
|
||||
|
||||
let formulaItems = this.acctresultDetailForm.formulaItems.map(item =>{
|
||||
let record = {}
|
||||
record.salaryItemId = item.salaryItemId
|
||||
record.resultValue = item.resultValue
|
||||
return record;
|
||||
})
|
||||
|
||||
let items = inputItems.concat(formulaItems)
|
||||
let params = {
|
||||
salaryAcctEmpId: recordId,
|
||||
items
|
||||
}
|
||||
API.saveAcctResult(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("保存成功")
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "保存失败")
|
||||
reject();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
import { observable, action, toJS } from 'mobx';
|
||||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
|
||||
import * as API from '../apis/declare'; // 引入API接口文件
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
export class DeclareStore {
|
||||
@observable tableStore = new TableStore(); // new table
|
||||
@observable form = new WeaForm(); // nrew 一个form
|
||||
@observable condition = []; // 存储后台得到的form数据
|
||||
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
|
||||
@observable showSearchAd = false; // 高级搜索面板显示
|
||||
@observable loading = true; // 数据加载状态
|
||||
|
||||
// 列表
|
||||
@observable listDataSource = [];
|
||||
@observable listColumns = [];
|
||||
|
||||
// 详情页
|
||||
@observable declareInfo = {}; // 详情基本信息
|
||||
@observable detailTableStore = new TableStore();
|
||||
@observable detailDataSource = [];
|
||||
@observable datailColumns = [];
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
doInit = () => {
|
||||
this.getCondition();
|
||||
this.getTableDatas();
|
||||
}
|
||||
|
||||
// 获得高级搜索表单数据
|
||||
@action
|
||||
getCondition = () => {
|
||||
API.getCondition().then(action(res => {
|
||||
if (res.api_status) { // 接口请求成功/失败处理
|
||||
this.condition = res.condition;
|
||||
this.form.initFormFields(res.condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.msg || '接口调用失败!')
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
// 渲染table数据
|
||||
@action
|
||||
getTableDatas = (params) => {
|
||||
this.loading = true;
|
||||
const formParams = this.form.getFormParams() || {};
|
||||
params = params || formParams;
|
||||
API.getTableDatas(params).then(action(res => {
|
||||
if (res.api_status) { // 接口请求成功/失败处理
|
||||
this.tableStore.getDatas(res.datas); // table 请求数据
|
||||
this.hasRight = res.hasRight;
|
||||
} else {
|
||||
message.error(res.msg || '接口调用失败!')
|
||||
}
|
||||
this.loading = false;
|
||||
}));
|
||||
}
|
||||
|
||||
@action
|
||||
setShowSearchAd = bool => this.showSearchAd = bool;
|
||||
|
||||
// 高级搜索 - 搜索
|
||||
@action doSearch = () => {
|
||||
this.getTableDatas();
|
||||
this.showSearchAd = false;
|
||||
}
|
||||
|
||||
//个税申报表-个税申报表列表
|
||||
@action
|
||||
getDeclareList = (params = {}) => {
|
||||
API.getDeclareList(params).then(res => {
|
||||
if(res.status) {
|
||||
this.listDataSource = res.data.list ? res.data.list: [];
|
||||
this.listColumns = res.data.columns
|
||||
} else {
|
||||
message.error(res.errormsg || '获取失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//个税申报表-个税申报表生成
|
||||
@action
|
||||
saveDeclare = (date) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.saveDeclare({salaryMonthStr: date}).then(res => {
|
||||
if(res.status) {
|
||||
message.success("生成成功")
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "生成失败")
|
||||
reject()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
//个税申报表-个税申报表相关信息
|
||||
@action
|
||||
getDeclareInfo = (taxDeclarationId) => {
|
||||
API.getDeclareInfo({taxDeclarationId}).then(res => {
|
||||
if(res.status) {
|
||||
this.declareInfo = res.data
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 个税申报表详情列表
|
||||
@action
|
||||
getDetailList = (taxDeclarationIdStr) => {
|
||||
API.getDetailList({taxDeclarationIdStr}).then(res => {
|
||||
if(res.status) {
|
||||
this.detailDataSource = res.data.pageInfo.list ? res.data.pageInfo.list : [];
|
||||
this.datailColumns = res.data.pageInfo.columns
|
||||
// this.detailTableStore.getDatas(res.data.dataKey.datas)
|
||||
} else {
|
||||
message.error(res.errrmsg || "获取失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 个税申报表导出
|
||||
@action
|
||||
exportSalaryArchive = (id) => {
|
||||
API.exportSalaryArchive(id)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@ import { ArchivesStore } from './archives'
|
|||
import { salaryFileStore } from './salaryFile';
|
||||
import { payrollStore } from './payroll';
|
||||
import { calculateStore } from './calculate';
|
||||
import { DeclareStore } from './declare';
|
||||
|
||||
module.exports = {
|
||||
baseFormStore: new BaseFormStore(),
|
||||
|
|
@ -32,6 +33,7 @@ module.exports = {
|
|||
archivesStore: new ArchivesStore(),
|
||||
salaryFileStore: new salaryFileStore(),
|
||||
payrollStore: new payrollStore(),
|
||||
calculateStore: new calculateStore()
|
||||
calculateStore: new calculateStore(),
|
||||
declareStore: new DeclareStore()
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ export class LedgerStore {
|
|||
@observable baseInfoRequest = {};
|
||||
@observable userSelectedList = [];
|
||||
|
||||
// ** 薪资项目 **
|
||||
// 添加薪资项目
|
||||
@observable addSalaryItemColumns = [];
|
||||
@observable addSalaryItemDataSource = [];
|
||||
|
||||
@action
|
||||
initSlideData = () => {
|
||||
this.salarySobId = "";
|
||||
|
|
@ -133,6 +138,7 @@ export class LedgerStore {
|
|||
item.items = item.items ? item.items.concat(list) : list
|
||||
}
|
||||
})
|
||||
|
||||
this.setItemGroups(itemGroups);
|
||||
}
|
||||
|
||||
|
|
@ -426,7 +432,13 @@ export class LedgerStore {
|
|||
})
|
||||
API.listSalaryItem({name:searchValue, excludeIds}).then(res => {
|
||||
if(res.status) {
|
||||
this.salaryItemTableStore.getDatas(res.data.datas);
|
||||
this.addSalaryItemDataSource = res.data.list.map(item => {
|
||||
item = {...item}
|
||||
item.key = item.id
|
||||
return item;
|
||||
});
|
||||
this.addSalaryItemColumns = res.data.columns;
|
||||
// this.salaryItemTableStore.getDatas(res.data.datas);
|
||||
} else {
|
||||
message.error(res.errormsg || "获取数据失败")
|
||||
}
|
||||
|
|
@ -452,7 +464,8 @@ export class LedgerStore {
|
|||
result.items = result.items.map((i,index) => (
|
||||
{
|
||||
salaryItemId: i.salaryItemId,
|
||||
sortedIndex: index + 1
|
||||
sortedIndex: index + 1,
|
||||
formulaId: i.formulaId
|
||||
}
|
||||
))
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ export class SalaryItemStore {
|
|||
@observable searchGroup = [];
|
||||
// 字段列表
|
||||
@observable searchFields = [];
|
||||
// 公式详情
|
||||
@observable formulaDetail = {};
|
||||
|
||||
// 设置字段列表
|
||||
@action
|
||||
|
|
@ -288,4 +290,21 @@ export class SalaryItemStore {
|
|||
})
|
||||
|
||||
}
|
||||
|
||||
// 根据id获取formual
|
||||
@action
|
||||
detailFormual = (formulaId) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.detailFormual({formulaId}).then(res => {
|
||||
if(res.status) {
|
||||
this.formulaDetail = res.data
|
||||
resolve(res.data)
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
reject()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue