<template>
|
<div>
|
<div class="search-form">
|
<EditForm ref="form"
|
formType="search"
|
:inline="true"
|
:list="formList"
|
:buttons="buttons"
|
:isShowAll="isShowAll"
|
:formValues="formValues"
|
:formRules="formRules"
|
@buttonAction="buttonAction"
|
@updateValue="updateValue"></EditForm>
|
</div>
|
|
<p class="export-excle">
|
|
<el-button size="small"
|
type="primary"
|
@click="showAddComplainView">新增投诉事件</el-button>
|
<el-button size="small"
|
icon="el-icon-download"
|
@click="download(1)">导出Excel</el-button>
|
</p>
|
|
<div class="list-content">
|
<TableList :isAutoIndex="true"
|
:isPaddingRight="false"
|
:loading="loading"
|
:list="records"
|
:header="tableList"
|
:total="total"
|
:pageInfo="pageInfo"
|
@doAction="doAction"
|
@handleCurrentChange="handleCurrentChange"
|
@handleSizeChange="handleSizeChange"></TableList>
|
</div>
|
|
<!-- 客服投诉-编辑 -->
|
<CustomerComplainUpdate :isComplainFlag="true"
|
:dialogVisible="dialogComplainVisible"
|
:serialNo="serialNo"
|
:customerInfo="customerInfo"
|
@succ="addCustomerComplain"
|
@close="showAddComplainView" />
|
</div>
|
</template>
|
<script>
|
/**
|
* 查询客服投诉列表
|
*/
|
|
import EditForm from './components/EditForm';
|
import TableList from './components/TableList';
|
import qryComplainList from '@comprehensive/model/qryComplainList';
|
import getAllCityAreaList from '@comprehensive/model/getAllCityAreaList';
|
import { alert } from '@comprehensive/utils/comm';
|
import { MessageBox } from 'element-ui';
|
import {
|
cancelCommissionApply,
|
exportCommissionExcel,
|
exportCommissionBusAckExcel,
|
exportComplainTrack
|
} from '@comprehensive/serve/public';
|
import CustomerComplainUpdate from '@comprehensive/components/tabsComponent/CustomerComplainUpdate';
|
|
const queryFlag = '02';
|
|
export default {
|
name: 'LoanApply',
|
components: {
|
TableList,
|
EditForm,
|
CustomerComplainUpdate,
|
},
|
data() {
|
return {
|
// 是否显示详情页
|
isShowList: true,
|
dialogComplainVisible: false,
|
formList: [],
|
tableList: [],
|
formRules: {},
|
listModel: null,
|
query: {},
|
records: [],
|
pageInfo: {
|
currentPage: 1,
|
pageSize: 10,
|
},
|
total: 0,
|
serialNo: '',
|
objectType: '',
|
customerID: '',
|
loading: false,
|
uploading: false,
|
// 是否显示所有表单项
|
isShowAll: false,
|
buttons: [
|
{ text: '重置', type: '' },
|
{ text: '搜索' },
|
{ type: 'fold', text: '展开' },
|
],
|
uploadHeader: {
|
'Content-Type': 'multipart/form-data; boundary=ReaquestHeader',
|
},
|
customerInfo: {},
|
};
|
},
|
created() {
|
this.init();
|
},
|
methods: {
|
// 投诉事件-显隐
|
showAddComplainView() {
|
this.dialogComplainVisible = !this.dialogComplainVisible;
|
},
|
|
addCustomerComplain() {
|
this.dialogComplainVisible = false;
|
this.fetch();
|
},
|
// 页面初始化处理
|
init() {
|
const { query } = this.$route;
|
this.query = query;
|
const listModel = qryComplainList();
|
const formList = listModel.getFormList(query);
|
this.tableList = listModel.getTableList();
|
this.formRules = listModel.getFormRules();
|
this.formList = formList;
|
this.listModel = listModel;
|
|
this.fetch();
|
this.getAllCityAreaList();
|
},
|
// 表单按钮操作
|
buttonAction(index, button) {
|
let { listModel, isShowAll } = this;
|
if (index === 0) {
|
// 重置
|
// this.formList = listModel.getFormList()
|
this.init();
|
}
|
if (index === 1) {
|
// 搜索
|
this.pageInfo.currentPage = 1;
|
this.fetch();
|
}
|
if (index === 2) {
|
// 展开/收起
|
this.isShowAll = !isShowAll;
|
}
|
},
|
|
// 表单事件回调
|
doAction(name, item, { label }) {
|
if (name === 'lastAction') {
|
if (label == '详情') {
|
this.$router.push({
|
path: `/comprehensiveTransaction/complainListDetail/${item.id}`,
|
query: {},
|
});
|
}
|
}
|
},
|
// 导出excle
|
async download(type) {
|
let { formValues } = this;
|
const res = await exportComplainTrack({ ...formValues });
|
if (res.code == '00') {
|
alert('提交成功', res.msg, () => {});
|
}
|
},
|
// 取消申请
|
async onCancelCommissionApply(serialno) {
|
this.$confirm(
|
'取消后,本条记录将会失效,且客户可从公众号重新申请,请确认!!!',
|
'取消申请',
|
{
|
confirmButtonText: '确定取消',
|
cancelButtonText: '暂不取消',
|
center: true,
|
}
|
)
|
.then(async () => {
|
const res = await cancelCommissionApply({
|
serialno: serialno,
|
});
|
if (res.code == '00') {
|
this.fetch();
|
}
|
})
|
.catch(() => {});
|
},
|
// 业务城市下拉列表
|
async getAllCityAreaList() {
|
const res = await getAllCityAreaList().request({ queryFlag });
|
const { list } = res;
|
this.updateValue('businesscity', { options: list });
|
},
|
// 更新表单数据
|
updateValue(index, info) {
|
const { formList } = this;
|
if (isNaN(index)) {
|
// index is name
|
index = formList.findIndex(({ name }) => name === index);
|
}
|
if (!isNaN(index) && index > -1) {
|
const preInfo = formList[index];
|
this.$set(formList, index, { ...preInfo, ...info });
|
}
|
},
|
// 获取当前列表数据
|
async fetch() {
|
try {
|
this.loading = true;
|
let { pageInfo, listModel, formValues, query } = this;
|
const { customerPhone, from } = query;
|
const res = await listModel.request({ ...pageInfo, ...formValues });
|
this.loading = false;
|
const { list, total } = res;
|
this.records = list.reduce((pre, curr) => {
|
let arr = [];
|
arr.push({ label: '详情', disabled: false });
|
pre.push({
|
...curr,
|
buttons: [...arr],
|
});
|
|
return pre;
|
}, []);
|
this.total = total;
|
} catch (error) {
|
this.loading = false;
|
}
|
},
|
// 修改翻页条数
|
handleSizeChange(val) {
|
this.pageInfo.pageSize = val;
|
this.fetch();
|
},
|
// 修改翻页数
|
handleCurrentChange(val) {
|
this.pageInfo.currentPage = val;
|
this.fetch();
|
},
|
},
|
computed: {
|
// 表单值信息
|
formValues() {
|
const { listModel, formList } = this;
|
return listModel.getFormValues(formList);
|
},
|
},
|
// watch: {
|
// $route() {
|
// this.init()
|
// }
|
// }
|
};
|
</script>
|
<style lang="postcss" scoped>
|
.search-form {
|
padding-top: 16px;
|
}
|
.list-content {
|
font-size: 14px;
|
}
|
.export-excle {
|
margin: 0 0 20px 0;
|
}
|
.message {
|
font-size: 12px;
|
color: #666666;
|
padding: 10px 20px;
|
background-color: #fafafa;
|
}
|
.upload-demo {
|
display: inline-block;
|
margin-left: 10px;
|
}
|
</style>
|