/** * 前置佣金经纪人转账管理列表查询 */ import ApiModel from '@comprehensive/serve/core/ApiModel' // 表单信息 const formList = [ { type: 'select', label: '项目名称', value: '', options: [], name: 'projectSerialno', attrs: ['collapse-tags', 'filterable', 'clearable'] }, { type: 'input', label: '经纪公司名称', value: '', name: 'agencyName' }, { type: 'dateRange', label: '支付时间', value: [], name: 'declaration', names: ['trxDateLeft', 'trxDateRight'] }, // { // type: 'select', // label: '是否有项目剩余额度', // value: '', // name: 'hasRestQuota', // options: [ // { // label: '是', // value: '1' // }, // { // label: '否', // value: '0' // }, // ] // }, ] // 表格信息 const tableList = [ { prop: 'projectName', label: '项目名称', width: '320px', }, { prop: 'agencyName', label: '经纪公司名称', width: '320px' }, { prop: 'agencyAccount', label: '经纪公司账户', width: '320px', }, { prop: 'trxAmt', label: '支付金额', width: '320px', }, { prop: 'trxDate', label: '支付时间', width: '320px', }, // { // prop: "lastAction", // label: "操作", // width: "160px", // type: "buttons", // fixed: "right" // } ] export default options => { // 接口地址,required const api = '/server/qryHouseholdBagAgencyFlowList' return new ApiModel({ api, formList, tableList, request(params) { return this.post(params) }, computedItem(item) { // 表格部分字段特殊处理 return { ...item } }, computedValue(val, name, list) { // 表单部分字段特殊处理(这里为:多选项按接口要求转换为拼接字符串) const { formList } = this if (typeof list === 'undefined') { list = [...formList] } if ( formList.some( ({ attrs = [], name: findName }) => attrs.includes('multiple') && findName === name ) ) { return Array.isArray(val) ? val.join(',') : val } return val } // computedValues(values = {}) { // const { formList } = this // return Object.keys(values).reduce((pre, curr) => { // // let { name, value } = curr // let value = values[curr] // const findItem = formList.find( // item => // item.name === curr && // (Array.isArray(item.attrs) && item.attrs.includes('multiple')) // ) // if (findItem && Array.isArray(value)) { // value = value.join(',') // } // pre[curr] = value // return pre // }, {}) // } }) }