Karlis 进行的变更

main
yang.yongquan 2022-12-27 14:11:33 +08:00
parent 45818588e9
commit 7c21780a92
2 changed files with 101 additions and 39 deletions

View File

@ -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;
}
}

View File

@ -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,7 +102,28 @@ 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="headBar">
<div className="simpleSearchBar" style={{display: "flex", justifyContent: "space-evenly"}}>
<Search className="simpleSearch"
addonBefore={<Dropdown
@ -127,6 +150,45 @@ class InvoiceSearch extends React.Component<any, any> {
</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>
)
}
}