/** * 查询返现开发商转账流水信息 */ import ApiModel from '@comprehensive/serve/core/ApiModel' // 表单信息 const formList = [ { type: 'select', label: '项目名称', value: '', options: [], name: 'projectSerialNo', attrs: ['collapse-tags', 'filterable', 'clearable'] }, { type: 'select', label: '省份', value: '', name: 'projectProvince', }, { type: 'select', label: '城市', value: '', name: 'projectCity', }, // { // type: 'dateRange', // label: '交易时间', // value: [], // name: 'declaration', // names: ['transDateLeft', 'transDateRight'] // }, // { // type: 'select', // label: '是否有项目剩余额度', // value: '', // name: 'hasRestQuota', // options: [ // { // label: '是', // value: '1' // }, // { // label: '否', // value: '0' // }, // ] // }, ] // 表格信息 const tableList = [ { prop: 'projectProvinceDesc', label: '省份', width: '120px' }, { prop: 'projectCityDesc', label: '城市', width: '120px' }, { prop: 'projectName', label: '项目名称', width: '200px', }, { prop: 'totalEarningsAmt', label: '客户支付金额', width: '160px' }, { prop: 'bagCostAmt', label: '家电包支付金额', width: '160px', }, { prop: 'serviceAmt', label: '服务费用', width: '160px', }, { prop: 'guaranteeAmt', label: '保证金', width: '140px', }, { prop: 'taxMakeupAmt', label: '税额差补金额', width: '160px', }, { prop: 'developAvailAmt', label: '项目收入金额', width: '160px', }, { prop: 'developOccupyAmt', label: '已支付金额', width: '160px', }, { prop: 'developRestAmt', label: '剩余可用金额', width: '160px', }, { prop: "lastAction", label: "操作", width: "160px", type: "buttons", fixed: "right" } ] export default options => { // 接口地址,required const api = '/server/qryHouseholdBagProjectList' 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 // }, {}) // } }) }