薪资账套复制添加个税扣缴义务人参数

This commit is contained in:
liyongshun 2022-06-17 17:12:21 +08:00
parent 78adb5cf0d
commit bbb4189700
3 changed files with 66 additions and 32 deletions

View File

@ -1,30 +1,63 @@
import React from 'react'
import { Modal, Button, Row, Col } from 'antd'
import { WeaInput } from 'ecCom'
import React from "react";
import { Modal, Button, Row, Col } from "antd";
import { WeaInput, WeaSelect } from "ecCom";
export default class CopyFormModal extends React.Component {
constructor(props) {
super(props)
this.state = {
name: ""
}
}
render() {
return (
<Modal
width={600}
visible={this.props.visible}
title="复制账套"
onCancel={() => this.props.onCancel()}
footer={<Button type="primary" onClick={() => {this.props.onSave(this.state.name)}}>保存</Button>}
>
<Row>
<Col span={6}>账套名称</Col>
<Col span={18}>
<WeaInput style={{width: "200px"}} value={this.state.name} onChange={(value) => {this.setState({name: value})}} />
</Col>
</Row>
</Modal>
)
}
}
constructor(props) {
super(props);
this.state = {
name: "",
taxAgentId: ""
};
}
render() {
const { taxAgentStore } = this.props;
const { taxAgentOption } = taxAgentStore;
return (
<Modal
width={600}
visible={this.props.visible}
title="复制账套"
onCancel={() => this.props.onCancel()}
footer={
<Button
type="primary"
onClick={() => {
this.props.onSave({
name: this.state.name,
taxAgentId: this.state.taxAgentId
});
}}>
保存
</Button>
}>
<Row style={{ display: "flex", alignItems: "center" }}>
<Col span={6}>账套名称</Col>
<Col span={18}>
<WeaInput
style={{ width: "200px" }}
value={this.state.name}
onChange={value => {
this.setState({ name: value });
}}
/>
</Col>
</Row>
<Row style={{ display: "flex", alignItems: "center" }}>
<Col span={6}>个税扣缴义务人</Col>
<Col span={18}>
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 200, marginTop: 10 }}
options={taxAgentOption}
value={this.state.taxAgentId}
onChange={value => {
this.setState({ taxAgentId: value });
}}
/>
</Col>
</Row>
</Modal>
);
}
}

View File

@ -200,7 +200,7 @@ export default class Ledger extends React.Component {
const {
ledgerStore: { doCopy },
} = this.props;
doCopy(this.state.currentReocrd.id, value).then(() => {
doCopy({id:this.state.currentReocrd.id, ...value}).then(() => {
this.setState({ copyFormVisible: false });
});
};
@ -214,7 +214,7 @@ export default class Ledger extends React.Component {
};
render() {
const { ledgerStore } = this.props;
const { ledgerStore, taxAgentStore } = this.props;
const {
loading,
dataSource,
@ -608,6 +608,7 @@ export default class Ledger extends React.Component {
{this.state.copyFormVisible && (
<CopyFormModal
taxAgentStore={taxAgentStore}
visible={this.state.copyFormVisible}
onSave={(value) => this.handleCopySave(value)}
onCancel={() => {

View File

@ -300,9 +300,9 @@ export class LedgerStore {
// 复制
@action
doCopy = (id, name) => {
doCopy = params => {
return new Promise((resolve, reject) => {
API.duplicateLedger({ id, name }).then(res => {
API.duplicateLedger({ ...params }).then(res => {
if (res.status) {
message.success("复制成功");
this.getTableDatas({});