48 lines
2.3 KiB
JavaScript
48 lines
2.3 KiB
JavaScript
/*YuO8szH0cVixePu/Bt+mG6B82aSbGhMosB18vg69kDk=*/
|
|
import {ajax,toast,cardCache} from 'nc-lightapp-front';
|
|
import { tableId, searchId,dataSource} from '../constants';
|
|
let {setDefData, getDefData } = cardCache;
|
|
import { loginContext, getContext, loginContextKeys } from '../../../../public/components/arapInitInfo/loginContext';
|
|
|
|
//点击查询,获取查询区数据
|
|
export default function clickSearchBtn(props,searchVal) {
|
|
if(searchVal&&searchVal.conditions&&searchVal.conditions.length>0){
|
|
let transtype = getContext(loginContextKeys.transtype);
|
|
let pageInfo = props.table.getTablePageInfo(this.tableId);
|
|
let queryInfo = props.search.getQueryInfo(this.searchId);
|
|
queryInfo.pageInfo = pageInfo;
|
|
let data = {
|
|
pageId: props.getSearchParam('p'),
|
|
queryInfo:queryInfo,
|
|
tradeType:transtype
|
|
};
|
|
setDefData(searchId, dataSource, data);//放入缓存
|
|
ajax({
|
|
url: '/nccloud/arap/paybill/queryscheme.do',
|
|
data: data,
|
|
success: (res) => {
|
|
let { success, data } = res;
|
|
if (success) {
|
|
if(data){
|
|
let num = data[this.tableId]?data[this.tableId].allpks:data['bodys'].allpks;//第二种场景是浏览器刷新props.getSearchParam('p')获取异常
|
|
let tableDate = data[this.tableId]?data[this.tableId]:data['bodys'];
|
|
toast({ color: 'success', content: this.state.json['paybill-000015']+num.length+this.state.json['paybill-000016'] });/* 国际化处理: 查询成功,共,条*/
|
|
this.props.table.setAllTableData(this.tableId, tableDate);
|
|
|
|
this.props.table.selectAllRows(this.tableId, false)
|
|
|
|
setDefData(this.tableId, dataSource, data);//放入缓存
|
|
this.onSelected()
|
|
}else{
|
|
toast({ color: 'warning', content: this.state.json['paybill-000017'] });/* 国际化处理: 未查询出符合条件的数据*/
|
|
this.props.table.setAllTableData(this.tableId, {rows:[]});
|
|
}
|
|
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
};
|
|
|
|
/*YuO8szH0cVixePu/Bt+mG6B82aSbGhMosB18vg69kDk=*/ |