Karlis 进行的变更
parent
45818588e9
commit
7c21780a92
|
@ -34,12 +34,12 @@ type Nullable<T> = T | undefined | null;
|
|||
export class InvoiceSearchOption{
|
||||
invoiceNo: Nullable<string>
|
||||
invoiceCode: Nullable<string>
|
||||
invoiceUploadTimeStart: Nullable<Date>
|
||||
invoiceUploadTimeEnd:Nullable<Date>
|
||||
invoiceUploadTimeStart: Nullable<string>
|
||||
invoiceUploadTimeEnd:Nullable<string>
|
||||
invoiceState:Nullable<number>
|
||||
invoiceKind:Nullable<string>
|
||||
invoiceDateStart:Nullable<Date>
|
||||
invoiceDateEnd:Nullable<Date>
|
||||
invoiceDateStart:Nullable<string>
|
||||
invoiceDateEnd:Nullable<string>
|
||||
invoiceNote:Nullable<string>
|
||||
invoiceUploader:Nullable<string>
|
||||
pageNum:number
|
||||
|
@ -75,16 +75,16 @@ export class InvoiceSearchOption{
|
|||
|
||||
toString(){
|
||||
let res="pageNum="+this.pageNum+"&pageSize="+this.pageSize
|
||||
res+=(this.invoiceNo===null||this.invoiceNo===""?"":("&invoiceNo="+this.invoiceNo));
|
||||
res+=(this.invoiceCode===null||this.invoiceCode===""?"":("&invoiceCode="+this.invoiceCode));
|
||||
res+=(this.invoiceUploadTimeStart===null?"":("&invoiceUploadTimeStart="+this.invoiceUploadTimeStart?.toDateString()));
|
||||
res+=(this.invoiceUploadTimeEnd===null?"":("&invoiceUploadTimeEnd="+this.invoiceUploadTimeEnd?.toDateString()));
|
||||
res+=(this.invoiceState===null?"":("&invoiceState="+this.invoiceState));
|
||||
res+=(this.invoiceKind===null?"":("&invoiceKind="+this.invoiceKind));
|
||||
res+=(this.invoiceDateStart===null?"":("&invoiceDateStart="+this.invoiceDateStart?.toDateString()));
|
||||
res+=(this.invoiceDateEnd===null?"":("&invoiceDateEnd="+this.invoiceDateEnd?.toDateString()));
|
||||
res+=(this.invoiceNote===null?"":("&invoiceNote="+this.invoiceNote));
|
||||
res+=(this.invoiceUploader===null?"":("&invoiceUploader="+this.invoiceUploader));
|
||||
res+=(this.invoiceNo===undefined||this.invoiceNo===null||this.invoiceNo===""?"":("&invoiceNo="+this.invoiceNo));
|
||||
res+=(this.invoiceCode===undefined||this.invoiceCode===null||this.invoiceCode===""?"":("&invoiceCode="+this.invoiceCode));
|
||||
res+=(this.invoiceUploadTimeStart===undefined||this.invoiceUploadTimeStart===null?"":("&invoiceUploadTimeStart="+this.invoiceUploadTimeStart));
|
||||
res+=(this.invoiceUploadTimeEnd===undefined||this.invoiceUploadTimeEnd===null?"":("&invoiceUploadTimeEnd="+this.invoiceUploadTimeEnd));
|
||||
res+=(this.invoiceState===undefined||this.invoiceState===null?"":("&invoiceState="+this.invoiceState));
|
||||
res+=(this.invoiceKind===undefined||this.invoiceKind===null?"":("&invoiceKind="+this.invoiceKind));
|
||||
res+=(this.invoiceDateStart===undefined||this.invoiceDateStart===null?"":("&invoiceDateStart="+this.invoiceDateStart));
|
||||
res+=(this.invoiceDateEnd===undefined||this.invoiceDateEnd===null?"":("&invoiceDateEnd="+this.invoiceDateEnd));
|
||||
res+=(this.invoiceNote===undefined||this.invoiceNote===null?"":("&invoiceNote="+this.invoiceNote));
|
||||
res+=(this.invoiceUploader===undefined||this.invoiceUploader===null?"":("&invoiceUploader="+this.invoiceUploader));
|
||||
return res;
|
||||
}
|
||||
}
|
|
@ -53,8 +53,10 @@ class InvoiceSearch extends React.Component<any, any> {
|
|||
console.log(this.state.invoiceSearchOption.toString())
|
||||
if (this.state.activatedOption === "发票代码") {
|
||||
this.state.invoiceSearchOption.invoiceCode = value;
|
||||
this.state.invoiceSearchOption.invoiceNo = null;
|
||||
} else {
|
||||
this.state.invoiceSearchOption.invoiceNo = value;
|
||||
this.state.invoiceSearchOption.invoiceCode = null;
|
||||
}
|
||||
|
||||
const {handleSearchData} = this.props
|
||||
|
@ -65,7 +67,7 @@ class InvoiceSearch extends React.Component<any, any> {
|
|||
console.log(response.data)
|
||||
//console.log(this.state)
|
||||
handleSearchData(response.data.records)
|
||||
//dispatch(this.props.handleSearchData(response.data.records))
|
||||
//dispatch(handleSearchData(response.data.records))
|
||||
//models.commit('setStaff', response.data.data)
|
||||
//navigate('/')
|
||||
}).catch(function (error) {
|
||||
|
@ -100,8 +102,29 @@ class InvoiceSearch extends React.Component<any, any> {
|
|||
</a>)
|
||||
}
|
||||
];
|
||||
const onValuesChange = (changedValues: any, allValues: any) => {
|
||||
this.state.invoiceSearchOption.clear()
|
||||
if (allValues['upload-time-picker'] !== null) {
|
||||
this.state.invoiceSearchOption.invoiceUploadTimeStart = allValues['upload-time-picker'][0].format('YYYY-MM-DDtHH:mm:ss')
|
||||
this.state.invoiceSearchOption.invoiceUploadTimeEnd = allValues['upload-time-picker'][1].format('YYYY-MM-DDtHH:mm:ss')
|
||||
}
|
||||
if (allValues['invoice-time-picker'] !== null) {
|
||||
this.state.invoiceSearchOption.invoiceDateStart = allValues['invoice-time-picker'][0].format('YYYY-MM-DD')
|
||||
this.state.invoiceSearchOption.invoiceDateEnd = allValues['invoice-time-picker'][1].format('YYYY-MM-DD')
|
||||
}
|
||||
if (allValues['invoice-state'] !== "全部") {
|
||||
this.state.invoiceSearchOption.invoiceState = allValues['invoice-state']
|
||||
}
|
||||
if (allValues['invoice-kind'] !== "全部") {
|
||||
this.state.invoiceSearchOption.invoiceKind = allValues['invoice-kind']
|
||||
}
|
||||
if (allValues['invoice-uploader'] !== null) {
|
||||
this.state.invoiceSearchOption.invoiceUploader = allValues['invoice-uploader'].trim()
|
||||
}
|
||||
}
|
||||
return (
|
||||
<div className="simpleSearchBar" style={{display:"flex",justifyContent: "space-evenly"}}>
|
||||
<div className="headBar">
|
||||
<div className="simpleSearchBar" style={{display: "flex", justifyContent: "space-evenly"}}>
|
||||
<Search className="simpleSearch"
|
||||
addonBefore={<Dropdown
|
||||
menu={{
|
||||
|
@ -113,20 +136,59 @@ class InvoiceSearch extends React.Component<any, any> {
|
|||
<Typography.Link>
|
||||
<Space>
|
||||
{this.state.activatedOption}
|
||||
<DownOutlined />
|
||||
<DownOutlined/>
|
||||
</Space>
|
||||
</Typography.Link>
|
||||
</Dropdown>}
|
||||
placeholder={this.state.searchContent}
|
||||
allowClear
|
||||
onSearch={(value)=>this.onSearch(value)}
|
||||
style={{ width: 304 }}
|
||||
onSearch={(value) => this.onSearch(value)}
|
||||
style={{width: 304}}
|
||||
enterButton
|
||||
/>
|
||||
<Button className="uploadButton" type="primary" icon={<UploadOutlined />} size="large">
|
||||
<Button className="uploadButton" type="primary" icon={<UploadOutlined/>} size="large">
|
||||
上传
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="complexSearchBar" hidden={!this.state.complexEnabled} style={{display: "flex"}}>
|
||||
<Form name="time_related_controls" {...formItemLayout} onValuesChange={onValuesChange}>
|
||||
<Form.Item name="upload-time-picker" label="发票上传时间" {...rangeConfig}>
|
||||
<RangePicker/>
|
||||
</Form.Item>
|
||||
<Form.Item name="invoice-time-picker" label="发票开票日期" {...rangeConfig}>
|
||||
<RangePicker/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name={`invoice-state`}
|
||||
label={`发票状态`}
|
||||
><Select defaultValue="全部">
|
||||
<Option value="全部">全部</Option>
|
||||
<Option value="0">未使用</Option>
|
||||
<Option value="1">报销中</Option>
|
||||
<Option value="2">已报销</Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name={`invoice-kind`}
|
||||
label={`发票类型`}
|
||||
><Select defaultValue="全部">
|
||||
<Option value="全部">全部</Option>
|
||||
<Option value="增值税普通发票">增值税普通发票</Option>
|
||||
<Option value="增值税专用发票">增值税专用发票</Option>
|
||||
<Option value="定额发票">定额发票</Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name={`invoice-uploader`}
|
||||
label={`上传者`}
|
||||
>
|
||||
<Input placeholder="任意上传者"/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue