<template>
|
<div>
|
<div>
|
<div class="view-title">
|
<span>客户满意度</span>
|
<span>
|
<el-button v-if="tabIndex === '0'" size="medium" type="primary" @click="openFormDia('add')">新 增</el-button>
|
<el-upload v-if="tabIndex === '1'" ref='upload'
|
:action="action"
|
:before-upload="beforeUpload" :headers="headers" :on-error="onError"
|
:on-success="handleSuccessUp" :show-file-list="false" accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'>
|
<el-button :loading="upLoading" size="small" type="primary">导入</el-button>
|
</el-upload>
|
</span>
|
</div>
|
<div class="search-background">
|
<span v-if="tabIndex === '0'" class="search-group">
|
<span style="width: 150px">单位名称:</span>
|
<el-input v-model="searchForm.unitName" clearable size="small"></el-input>
|
</span>
|
<span v-if="tabIndex === '1'" class="search-group">
|
<span style="width: 150px">文件名称:</span>
|
<el-input v-model="searchForm1.fileName" clearable size="small"></el-input>
|
</span>
|
<span class="search-group">
|
<el-button size="medium" @click="resetSearchForm">重 置</el-button>
|
<el-button size="medium" type="primary" @click="searchList">查 询</el-button>
|
</span>
|
</div>
|
<div class="table">
|
<div class="table-tab">
|
<el-radio-group v-model="tabIndex" @change="searchList">
|
<el-radio-button label="0">客户满意度</el-radio-button>
|
<el-radio-button label="1">综合分析</el-radio-button>
|
</el-radio-group>
|
</div>
|
<div v-if="tabIndex === '0'">
|
<TableCard :showForm="false" :showTitle="false">
|
<template v-slot:table>
|
<ZTTable
|
:column="tableColumn"
|
:height="'calc(100vh - 27em)'"
|
:table-data="tableData"
|
:table-loading="tableLoading"
|
style="padding: 0 15px;margin-bottom: 16px">
|
</ZTTable>
|
</template>
|
</TableCard>
|
<el-pagination :current-page="1" :page-size="page.size" :page-sizes="[10, 20, 30, 50, 100]"
|
:total="total" layout="->,total, sizes, prev, pager, next, jumper"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange">
|
</el-pagination>
|
</div>
|
<div v-if="tabIndex === '1'">
|
<TableCard :showForm="false" :showTitle="false">
|
<template v-slot:table>
|
<ZTTable
|
:column="tableColumn1"
|
:height="'calc(100vh - 27em)'"
|
:table-data="tableData1"
|
:table-loading="tableLoading1"
|
style="padding: 0 15px;margin-bottom: 16px">
|
</ZTTable>
|
</template>
|
</TableCard>
|
<el-pagination :current-page="1" :page-size="page.size" :page-sizes="[10, 20, 30, 50, 100]"
|
:total="total1" layout="->,total, sizes, prev, pager, next, jumper"
|
@size-change="handleSizeChange1"
|
@current-change="handleCurrentChange1">
|
</el-pagination>
|
</div>
|
</div>
|
</div>
|
<el-dialog
|
:visible.sync="lookDialogVisible"
|
fullscreen
|
title="查看附件" top="5vh" width="800px">
|
<filePreview v-if="lookDialogVisible" :currentFile="{}"
|
:fileUrl="javaApi+'/word/'+currentInfo.fileUrl" style="height: 90vh;overflow-y: auto;"/>
|
</el-dialog>
|
<FormDialog v-if="formDialog" ref="formDialog" @closeFormDia="closeFormDia"></FormDialog>
|
</div>
|
</template>
|
|
<script>
|
import TableCard from '../caorui/TableCard/index.vue';
|
import ZTTable from '../caorui/ZTTable/index.vue';
|
import FormDialog from '../do/a8-customer-satisfaction/formDialog.vue';
|
import filePreview from '../tool/file-preview.vue';
|
|
export default {
|
name: 'a8-customer-satisfaction',
|
// import 引入的组件需要注入到对象中才能使用
|
components: { filePreview, FormDialog, ZTTable, TableCard },
|
data() {
|
// 这里存放数据
|
return {
|
searchForm: {
|
unitName: '',
|
},
|
searchForm1: {
|
fileName: '',
|
},
|
tabIndex: '0',
|
tableColumn: [
|
{
|
label: '单位名称',
|
prop: 'unitName',
|
minWidth: '100'
|
},
|
{
|
label: '日期',
|
prop: 'fillDate',
|
minWidth: '100'
|
},
|
{
|
label: '姓名',
|
prop: 'userName',
|
minWidth: '100'
|
},
|
{
|
label: '部门',
|
prop: 'department',
|
minWidth: '100'
|
},
|
{
|
label: '联系电话',
|
prop: 'contactNumber',
|
minWidth: '100'
|
},
|
{
|
label: '创建日期',
|
prop: 'createTime',
|
minWidth: '100',
|
},
|
{
|
dataType: 'action',
|
minWidth: '80',
|
label: '操作',
|
operation: [
|
{
|
name: '编辑',
|
type: 'text',
|
clickFun: (row) => {
|
this.openFormDia('edit', row);
|
},
|
},
|
{
|
name: '删除',
|
type: 'text',
|
color: '#f56c6c',
|
clickFun: (row) => {
|
this.delPlan(row)
|
}
|
}
|
]
|
}
|
],
|
tableData: [],
|
tableLoading: false,
|
page: {
|
size: 20,
|
current: 1,
|
},
|
total: 0,
|
tableColumn1: [
|
{
|
label: '附件名称',
|
prop: 'fileName',
|
minWidth: '100'
|
},
|
{
|
label: '创建人',
|
prop: 'userName',
|
minWidth: '100'
|
},
|
{
|
label: '创建时间',
|
prop: 'createTime',
|
minWidth: '100'
|
},
|
{
|
dataType: 'action',
|
minWidth: '50',
|
label: '操作',
|
operation: [
|
{
|
name: '预览',
|
type: 'text',
|
clickFun: (row) => {
|
this.handleLook(row)
|
}
|
},
|
{
|
name: '下载',
|
type: 'text',
|
clickFun: (row) => {
|
this.upload(row);
|
},
|
},
|
{
|
name: '删除',
|
type: 'text',
|
color: '#f56c6c',
|
clickFun: (row) => {
|
this.delFile(row)
|
}
|
}
|
]
|
}
|
],
|
tableData1: [],
|
tableLoading1: false,
|
page1: {
|
size: 20,
|
current: 1,
|
},
|
total1: 0,
|
formDialog: false,
|
upLoading: false,
|
currentInfo:{},
|
lookDialogVisible: false,
|
};
|
},
|
mounted() {
|
this.searchList()
|
},
|
// 方法集合
|
methods: {
|
// 查询列表
|
searchList () {
|
const entity = this.tabIndex === '0' ? this.searchForm : this.searchForm1
|
const page = this.tabIndex === '0' ? this.page : this.page1
|
if (this.tabIndex === '0') {
|
this.tableLoading = true
|
this.$axios.post(this.$api.clientSatisfaction.pageClientSatisfaction, {entity, page}, {
|
headers: {
|
"Content-Type": "application/json"
|
},
|
noQs: true
|
}).then(res => {
|
this.tableLoading = false
|
if (res.code === 201) return
|
this.tableData = res.data.records
|
this.total = res.data.total
|
}).catch(err => {
|
console.log('err---', err);
|
this.tableLoading = false
|
})
|
} else {
|
this.tableLoading1 = true
|
this.$axios.post(this.$api.clientSatisfaction.pageAnalyseFile, {entity, page}, {
|
headers: {
|
"Content-Type": "application/json"
|
},
|
noQs: true
|
}).then(res => {
|
this.tableLoading1 = false
|
if (res.code === 201) return
|
this.tableData1 = res.data.records
|
this.total1 = res.data.total
|
}).catch(err => {
|
console.log('err---', err);
|
this.tableLoading1 = false
|
})
|
}
|
},
|
openFormDia (type, row) {
|
this.formDialog = true
|
this.$nextTick(() => {
|
this.$refs.formDialog.openDia(type, row);
|
})
|
},
|
closeFormDia () {
|
this.formDialog = false
|
this.searchList()
|
},
|
// 重置查询条件
|
resetSearchForm () {
|
this.searchForm.unitName = '';
|
this.searchForm1.fileName = '';
|
this.searchList()
|
},
|
// 导入流程
|
beforeUpload(file) {
|
if (file.size > 1024 * 1024 * 10) {
|
this.$message.error('上传文件不超过10M');
|
this.$refs.upload.clearFiles()
|
return false;
|
} else {
|
this.upLoading = true;
|
return true;
|
}
|
},
|
onError(err, file, fileList) {
|
this.$message.error('上传失败')
|
this.$refs.upload.clearFiles()
|
},
|
handleSuccessUp(response) {
|
this.upLoading = false;
|
if (response.code == 200) {
|
this.$message.success('上传成功');
|
this.searchList()
|
}
|
},
|
// 删除客户满意度
|
delPlan (row) {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.tableLoading = true
|
this.$axios.get(this.$api.clientSatisfaction.delClientSatisfaction + '?clientSatisfactionId=' + row.clientSatisfactionId).then(res => {
|
this.tableLoading = false
|
if (res.code === 201) return
|
this.$message.success('删除成功')
|
this.searchList()
|
}).catch(err => {
|
this.tableLoading = false
|
console.log('err---', err);
|
})
|
}).catch(() => {
|
this.$message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
// 查看文件
|
handleLook(row){
|
this.currentInfo = row
|
this.lookDialogVisible = true
|
},
|
// 下载客户福建
|
upload (row) {
|
let url = '';
|
if(row.type==1){
|
url = this.javaApi+'/img/'+row.fileUrl
|
file.downloadIamge(url,row.fileName)
|
}else{
|
url = this.javaApi+'/word/'+row.fileUrl
|
const link = document.createElement('a');
|
link.href = url;
|
link.download = row.fileName;
|
link.click();
|
}
|
},
|
// 删除客户分析附件
|
delFile (row) {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.tableLoading = true
|
this.$axios.get(this.$api.clientSatisfaction.delAnalyseFile + '?analyseFileId=' + row.analyseFileId).then(res => {
|
this.tableLoading = false
|
if (res.code === 201) return
|
this.$message.success('删除成功')
|
this.searchList()
|
}).catch(err => {
|
this.tableLoading = false
|
console.log('err---', err);
|
})
|
}).catch(() => {
|
this.$message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
// 分页
|
handleSizeChange(val) {
|
this.page.size = val;
|
this.searchList();
|
},
|
handleCurrentChange(val) {
|
this.page.current = val;
|
this.searchList();
|
},
|
//
|
// 分页
|
handleSizeChange1(val) {
|
this.page1.size = val;
|
this.searchList();
|
},
|
handleCurrentChange1(val) {
|
this.page1.current = val;
|
this.searchList();
|
},
|
//
|
},
|
// 用于上传文件的信息
|
computed: {
|
headers() {
|
return {
|
'token': sessionStorage.getItem('token')
|
}
|
},
|
action() {
|
return this.javaApi + this.$api.clientSatisfaction.uploadAnalyseFile
|
}
|
},
|
};
|
</script>
|
|
<style scoped>
|
.view-title {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
height: 60px;
|
padding-left: 20px;
|
}
|
|
.search-background {
|
width: 100%;
|
height: 80px;
|
line-height: 80px;
|
background-color: #ffffff;
|
display: flex;
|
}
|
|
.search-group {
|
display: flex;
|
align-items: center;
|
margin: 0 20px;
|
}
|
|
.table {
|
margin-top: 20px;
|
background-color: #ffffff;
|
padding-top: 20px;
|
}
|
.table-tab {
|
margin: 0 20px 20px 20px;
|
}
|
</style>
|