/* * @Author: lixiong * @Date: 2019-08-21 14:35:07 * @Last Modified by: zheng * @Last Modified time: 2021-06-02 15:14:50 */ /** * 查询前置佣金申请列表 */ import ApiModel from '@comprehensive/serve/core/ApiModel' // 表单信息 const formList = [ { type: 'input', // input, select, date, rangeDate label: '订单号', value: '', name: 'serialno' }, { type: 'select', label: '项目名称', value: '', options: [], name: 'projectSerialno', attrs: ['collapse-tags', 'filterable', 'clearable'] }, { type: 'input', label: '客户名称', value: '', name: 'customerName' }, { type: 'dateRange', label: '签约日期', value: [], name: 'declaration', names: ['dealDateLeft', 'dealDateRight', 'clearable'] }, { type: 'select', label: '省份', value: '', name: 'projectProvince', }, { type: 'select', label: '城市', value: '', name: 'projectCity', }, { type: 'select', label: '状态', value: '', options: [ { label: '初始化', value: '0' }, { label: '部分支付', value: '1' }, { label: '已支付', value: '2' }, { label: '已退款', value: '4' }, ], name: 'status', attrs: ['collapse-tags', 'filterable', 'clearable'] }, ] // 表格信息 const tableList = [ { prop: 'serialno', label: '订单号', width: '200px', // type: 'link', // link, button, buttons }, { prop: 'projectProvinceDesc', label: '省份', width: '120px' }, { prop: 'projectCityDesc', label: '城市', width: '120px' }, { prop: 'projectName', label: '项目名称', width: '120px' }, { prop: 'customername', label: '客户姓名', width: '120px' }, { prop: 'serviceTypeDesc', label: '服务包类型', width: '120px' }, { prop: 'serviceCategory', label: '服务包类目', width: '120px' }, { prop: 'customerFeeAmt', label: '服务包金额', width: '120px' }, { prop: 'bagCostAmt', label: '家电包成本', width: '100px' }, { prop: 'serviceFeeAmt', label: '服务费', width: '100px' }, { prop: 'guaranteeAmt', label: '保证金', width: '100px' }, { prop: 'taxMakeupAmt', label: '税额差补', width: '100px' }, { prop: 'refundAmt', label: '退款金额', width: '100px' }, { prop: 'developAvailAmt', label: '项目分配可用金额', width: '150px' }, { prop: 'dealDate', label: '签约日期', width: '150px' }, { prop: 'guaranteeUnfreezeDate', label: '保证金解冻日期', width: '150px' }, { prop: 'statusName', label: '状态', width: '80px' }, { prop: 'updateTime', label: '更新日期', width: '180px' }, { prop: "action", label: "操作管理", width: "200px", type: "buttons", fixed: "right", } ] export default options => { // 接口地址,required const api = 'server/qryHouseholdBagApplyList' return new ApiModel({ api, formList, tableList, request(params) { return this.post(params) }, computedItem(item) { // 表格部分字段特殊处理 let { status } = item let statusName = '' switch (status) { case '0': statusName = '初始化' break; case '1': statusName = '部分支付' break; case '2': statusName = '已支付' break; case '3': statusName = '部分退款' break; case '4': statusName = '已退款' break; case '5': statusName = '已取消' break; default: break; } return { ...item, statusName } }, 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 // }, {}) // } }) }