/* * @Author: lixiong * @Date: 2019-08-21 14:35:07 * @Last Modified by: zheng * @Last Modified time: 2021-06-09 09:52:31 */ /** * 查询返现开发商转账流水信息 */ import ApiModel from '@comprehensive/serve/core/ApiModel' // 表单信息 const formList = [ { type: 'select', label: '开发商名称', value: '', options: [], name: 'developerId', attrs: ['collapse-tags', 'filterable'] }, { type: 'select', label: '项目名称', value: '', options: [], name: 'projectId', attrs: ['collapse-tags', 'filterable'] }, { 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: 'serialno', label: '流水号', width: '140px', }, { prop: 'developerName', label: '开发商名称', width: '180px' }, { prop: 'projectName', label: '项目名称', width: '150px', }, { prop: 'projectAlias', label: '项目别名', width: '150px', }, { prop: 'transDate', label: '交易时间', width: '120px', }, { prop: 'transAmt', label: '交易金额', width: '100px', }, { prop: 'projectServiceRateDesc', label: '项目服务费率', width: '120px', }, { prop: 'customerServiceRateDesc', label: '客户服务费率', width: '120px', }, { prop: 'bankFlowNo', label: '银行流水', width: '140px', }, { prop: 'taxiSourceName', label: '园区名称', width: '160px', }, { prop: 'busModelName', label: '业务模式', width: '100px', }, { prop: 'restProjectAmt', label: '剩余项目金额', width: '120px', }, { prop: 'restAvailAmt', label: '剩余可返现金额', width: '120px', }, { prop: 'refundAmt', label: '退款金额', width: '100px', }, { prop: 'updateTime', label: '最近更新时间', width: '160px', }, { prop: 'statusName', label: '流水状态', width: '100px', }, { prop: "lastAction", label: "操作管理", width: "130px", type: "buttons", fixed: "right" } ] export default options => { // 接口地址,required const api = '/server/queryCommissionTransferFlow' return new ApiModel({ api, formList, tableList, request(params) { return this.post(params) }, computedItem(item) { // 表格部分字段特殊处理 let {busModel, status, customerServiceRate, projectServiceRate} = item item.statusName = status == '1' ? '挂起' : '正常' // 1园区直营,2杉英直营 item.busModelName = busModel == '1' ? '园区直营' : '杉英直营' item.customerServiceRateDesc = customerServiceRate!=""&&customerServiceRate!=null&&customerServiceRate!=undefined || customerServiceRate == 0 ? `${customerServiceRate}%` : '' item.projectServiceRateDesc = projectServiceRate!=""&&projectServiceRate!=null&&projectServiceRate!=undefined || projectServiceRate == 0 ? `${projectServiceRate}%` : '' 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 // }, {}) // } }) }