This commit is contained in:
18652063575 2022-09-19 13:36:36 +08:00
parent 3808d0b625
commit 85441a1f69
2 changed files with 120 additions and 74 deletions

View File

@ -309,6 +309,10 @@
.wea-select{
display: inline-block;
position: relative;
.wea-required-e9{
top: 0;
right: 0;
}
}
.ant-select-selection{
height: 30px;

View File

@ -1,6 +1,6 @@
import React from "react";
import { Button, Col, Row } from "antd";
import { WeaBrowser, WeaDialog, WeaSelect } from "ecCom";
import { WeaBrowser, WeaDialog, WeaError, WeaSelect } from "ecCom";
import "../ledger/index.less";
export default class AddTaxAgentModal extends React.Component {
@ -28,6 +28,19 @@ export default class AddTaxAgentModal extends React.Component {
targetId: it
}))
};
if(_.isEmpty(ids) && _.isEmpty(checkboxValue)){
this.refs.weaError.showError();
this.refs.weaError1.showError();
return
}
if(_.isEmpty(ids)){
this.refs.weaError.showError();
return
}
if(_.isEmpty(checkboxValue)){
this.refs.weaError1.showError();
return
}
onTaxAgentSave && onTaxAgentSave(payload);
};
@ -46,7 +59,7 @@ export default class AddTaxAgentModal extends React.Component {
return (
<WeaDialog
visible={visible}
onCancel={()=>{
onCancel={() => {
this.handleReset();
onCancel();
}}
@ -68,7 +81,7 @@ export default class AddTaxAgentModal extends React.Component {
<Col span={16}>
<div style={{ display: "inline-block", marginRight: 12 }}>
<WeaSelect
style={{ height: "30px"}}
style={{ height: "30px" }}
options={_.map(targetTypeList, (it) => ({
...it,
key: it.id,
@ -81,75 +94,98 @@ export default class AddTaxAgentModal extends React.Component {
}}
/>
</div>
<div style={{ display: "inline-block", verticalAlign: "middle" }}>
<div style={{ display: "inline-block", verticalAlign: "middle",lineHeight: 0 }}>
{this.state.selectedKey == "EMPLOYEE" && (
<WeaBrowser
type={17}
viewAttr={3}
value={this.state.ids}
title={"人员选择"}
isSingle={false}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
<WeaError tipPosition="bottom"
style={{ width: "100%" }}
ref="weaError"
error="请选择人员">
<WeaBrowser
type={17}
viewAttr={3}
value={this.state.ids}
title={"人员选择"}
isSingle={false}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
</WeaError>
)}
{this.state.selectedKey == "DEPT" && (
<WeaBrowser
type={57}
title={"部门选择"}
tabs={[
{
dataParams: null,
dataURL: null,
isSearch: false,
key: "2",
name: "组织结构",
selected: false,
showOrder: 0
},
{
dataParams: { list: "1" },
dataURL: null,
isSearch: true,
key: "1",
name: "按列表",
selected: false,
showOrder: 0
}
]}
isSingle={false}
inputStyle={{ width: 200 }}
value={this.state.ids}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
<WeaError tipPosition="bottom"
style={{ width: "100%" }}
ref="weaError"
error="请选择部门">
<WeaBrowser
type={57}
viewAttr={3}
title={"部门选择"}
tabs={[
{
dataParams: null,
dataURL: null,
isSearch: false,
key: "2",
name: "组织结构",
selected: false,
showOrder: 0
},
{
dataParams: { list: "1" },
dataURL: null,
isSearch: true,
key: "1",
name: "按列表",
selected: false,
showOrder: 0
}
]}
isSingle={false}
inputStyle={{ width: 200 }}
value={this.state.ids}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
</WeaError>
)}
{this.state.selectedKey == "SUBCOMPANY" && (
<WeaBrowser
type={164}
title={"分部选择"}
isSingle={false}
inputStyle={{ width: 200 }}
value={this.state.ids}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
<WeaError tipPosition="bottom"
style={{ width: "100%" }}
ref="weaError"
error="请选择分部">
<WeaBrowser
type={164}
viewAttr={3}
title={"分部选择"}
isSingle={false}
inputStyle={{ width: 200 }}
value={this.state.ids}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
</WeaError>
)}
{this.state.selectedKey == "POSITION" && (
<WeaBrowser
type={278}
title={"岗位选择"}
isSingle={false}
value={this.state.ids}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
<WeaError tipPosition="bottom"
style={{ width: "100%" }}
ref="weaError"
error="请选择岗位">
<WeaBrowser
type={278}
viewAttr={3}
title={"岗位选择"}
isSingle={false}
value={this.state.ids}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
</WeaError>
)}
</div>
</Col>
@ -157,15 +193,21 @@ export default class AddTaxAgentModal extends React.Component {
<Row style={{ lineHeight: "40px" }}>
<Col span={8}>选择员工状态</Col>
<Col span={16}>
<WeaSelect
detailtype={2}
options={_.map(employeeStatus, (it) => ({
showname: it.name,
key: it.id
}))}
value={this.state.checkboxValue}
onChange={(value) => this.onCheckboxChange(value)}
/>
<WeaError tipPosition="bottom"
style={{ width: "100%" }}
ref="weaError1"
error="请选择员工状态">
<WeaSelect
viewAttr={3}
detailtype={2}
options={_.map(employeeStatus, (it) => ({
showname: it.name,
key: it.id
}))}
value={this.state.checkboxValue}
onChange={(value) => this.onCheckboxChange(value)}
/>
</WeaError>
</Col>
</Row>
</div>