From 8f7fc389bab56f0d92a7f665b146391f20d69f51 Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期一, 24 二月 2025 10:52:50 +0800 Subject: [PATCH] 客户满意度搬迁 --- src/views/CNAS/systemManagement/customerSatisfaction/components/formDialog.vue | 256 +++++++++++++++++++ src/assets/styles/index.scss | 3 src/views/CNAS/systemManagement/customerSatisfaction/index.vue | 410 +++++++++++++++++++++++++++++++ src/api/cnas/systemManagement/customerSatisfaction.js | 56 ++++ 4 files changed, 725 insertions(+), 0 deletions(-) diff --git a/src/api/cnas/systemManagement/customerSatisfaction.js b/src/api/cnas/systemManagement/customerSatisfaction.js new file mode 100644 index 0000000..5368a4c --- /dev/null +++ b/src/api/cnas/systemManagement/customerSatisfaction.js @@ -0,0 +1,56 @@ +// 瀹㈡埛婊℃剰搴︾浉鍏虫帴鍙� +import request from "@/utils/request"; + +//瀹㈡埛婊℃剰搴﹁皟鏌ュ垪琛� +export function pageClientSatisfaction(query) { + return request({ + url: "/clientSatisfaction/pageClientSatisfaction", + method: "get", + params: query, + }); +} + +//鏌ヨ瀹㈡埛鍒嗘瀽闄勪欢 +export function pageAnalyseFile(query) { + return request({ + url: "/clientSatisfaction/pageAnalyseFile", + method: "get", + params: query, + }); +} + +//鍒犻櫎鏂板瀹㈡埛婊℃剰搴﹁皟鏌� +export function delClientSatisfaction(query) { + return request({ + url: "/clientSatisfaction/delClientSatisfaction", + method: "delete", + params: query, + }); +} + +//鍒犻櫎瀹㈡埛鍒嗘瀽闄勪欢 +export function delAnalyseFile(query) { + return request({ + url: "/clientSatisfaction/delAnalyseFile", + method: "delete", + params: query, + }); +} + +// 鏂板瀹㈡埛婊℃剰搴﹁皟鏌� +export function addClientSatisfaction(data) { + return request({ + url: "/clientSatisfaction/addClientSatisfaction", + method: "post", + data: data, + }); +} + +// 淇敼鏂板瀹㈡埛婊℃剰搴﹁皟鏌� +export function updateClientSatisfaction(data) { + return request({ + url: "/clientSatisfaction/updateClientSatisfaction", + method: "post", + data: data, + }); +} diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 541cff9..4e3522c 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -195,3 +195,6 @@ .required-span { color: red; } +table { + border-collapse: collapse; /* 鍏抽敭灞炴�э細鍚堝苟杈规 */ +} diff --git a/src/views/CNAS/systemManagement/customerSatisfaction/components/formDialog.vue b/src/views/CNAS/systemManagement/customerSatisfaction/components/formDialog.vue new file mode 100644 index 0000000..13e5d6d --- /dev/null +++ b/src/views/CNAS/systemManagement/customerSatisfaction/components/formDialog.vue @@ -0,0 +1,256 @@ +<template> + <div> + <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="formDia" title="瀹㈡埛婊℃剰搴﹁皟鏌ヨ〃" + width="70%" @close="closeFormDia"> + <table border="1" cellspacing="10" class="tables"> + <tr> + <td class="td-title"> + <p>鍗曚綅鍚嶇О锛�</p> + </td> + <td class="td-info" colspan="2"> + <el-input v-model="form.unitName" placeholder="璇疯緭鍏ュ唴瀹�" size="small"> + </el-input> + </td> + <td class="td-title"> + <p>鏃ユ湡锛�</p> + </td> + <td class="td-info" colspan="2"> + <el-date-picker v-model="form.fillDate" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small" type="date" + value-format="yyyy-MM-dd"> + </el-date-picker> + </td> + </tr> + <tr> + <td class="td-title"> + <p>濮撳悕锛�</p> + </td> + <td class="td-info"> + <el-input v-model="form.userName" placeholder="璇疯緭鍏ュ唴瀹�" size="small"> + </el-input> + </td> + <td class="td-title"> + <p>閮ㄩ棬锛�</p> + </td> + <td class="td-info"> + <el-input v-model="form.department" placeholder="璇疯緭鍏ュ唴瀹�" size="small"> + </el-input> + </td> + <td class="td-title"> + <p>鑱旂郴鐢佃瘽锛�</p> + </td> + <td class="td-info"> + <el-input v-model="form.contactNumber" placeholder="璇疯緭鍏ュ唴瀹�" size="small"> + </el-input> + </td> + </tr> + <tr> + <td class="td-title"> + <p>鏈嶅姟鎬佸害锛�</p> + </td> + <td class="td-info" colspan="2"> + <el-radio-group v-model="form.serviceAttitude" v-removeAriaHidden> + <el-radio :label="0">婊℃剰</el-radio> + <el-radio :label="1">涓�鑸�</el-radio> + <el-radio :label="2">涓嶆弧鎰�</el-radio> + </el-radio-group> + </td> + <td class="td-title"> + <p>寤鸿锛�</p> + </td> + <td class="td-info" colspan="2"> + <el-input v-model="form.serviceAttitudeSuggestion" placeholder="璇疯緭鍏ュ唴瀹�" size="small"> + </el-input> + </td> + </tr> + <tr> + <td class="td-title"> + <p>鎶�鏈兘鍔涳細</p> + </td> + <td class="td-info" colspan="2"> + <el-radio-group v-model="form.technicalCompetence" v-removeAriaHidden> + <el-radio :label="0">婊℃剰</el-radio> + <el-radio :label="1">涓�鑸�</el-radio> + <el-radio :label="2">涓嶆弧鎰�</el-radio> + </el-radio-group> + </td> + <td class="td-title"> + <p>寤鸿锛�</p> + </td> + <td class="td-info" colspan="2"> + <el-input v-model="form.technicalCompetenceSuggestion" placeholder="璇疯緭鍏ュ唴瀹�" size="small"> + </el-input> + </td> + </tr> + <tr> + <td class="td-title"> + <p>妫�娴嬪伐浣滐細</p> + </td> + <td class="td-info" colspan="2"> + <el-radio-group v-model="form.inspectionWork" v-removeAriaHidden> + <el-radio :label="0">婊℃剰</el-radio> + <el-radio :label="1">涓�鑸�</el-radio> + <el-radio :label="2">涓嶆弧鎰�</el-radio> + </el-radio-group> + </td> + <td class="td-title"> + <p>寤鸿锛�</p> + </td> + <td class="td-info" colspan="2"> + <el-input v-model="form.inspectionWorkSuggestion" placeholder="璇疯緭鍏ュ唴瀹�" size="small"> + </el-input> + </td> + </tr> + <tr> + <td class="td-title"> + <p>鏀惰垂鍚堢悊鎬э細</p> + </td> + <td class="td-info" colspan="2"> + <el-radio-group v-model="form.reasonableFees" v-removeAriaHidden> + <el-radio :label="0">婊℃剰</el-radio> + <el-radio :label="1">涓�鑸�</el-radio> + <el-radio :label="2">涓嶆弧鎰�</el-radio> + </el-radio-group> + </td> + <td class="td-title"> + <p>寤鸿锛�</p> + </td> + <td class="td-info" colspan="2"> + <el-input v-model="form.reasonableFeesSuggestion" placeholder="璇疯緭鍏ュ唴瀹�" size="small"> + </el-input> + </td> + </tr> + <tr> + <td class="td-title"> + <p>鎮ㄥ鎴戜滑鐨勫笇鏈涳細</p> + </td> + <td class="td-info" colspan="5"> + <el-input v-model="form.remark" :rows="4" placeholder="璇疯緭鍏ュ唴瀹�" size="small" type="textarea"> + </el-input> + </td> + </tr> + </table> + <span slot="footer" class="dialog-footer"> + <el-button @click="closeFormDia">鍙� 娑�</el-button> + <el-button :loading="editLoad" type="primary" @click="handleEdit">鎻� 浜�</el-button> + </span> + </el-dialog> + </div> +</template> + +<script> +import { + addClientSatisfaction, + updateClientSatisfaction +} from '@/api/cnas/systemManagement/customerSatisfaction.js' +export default { + name: 'formDialog', + // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� + components: {}, + data() { + // 杩欓噷瀛樻斁鏁版嵁 + return { + formDia: false, + form: { + unitName: '', + fillDate: '', + userName: '', + department: '', + contactNumber: '', + serviceAttitude: '', + technicalCompetence: '', + technicalCompetenceSuggestion: '', + inspectionWork: '', + inspectionWorkSuggestion: '', + reasonableFees: '', + reasonableFeesSuggestion: '', + remark: '', + clientSatisfactionId: '', + }, + operationType: '', + editLoad: false, + + }; + }, + // 鏂规硶闆嗗悎 + methods: { + openDia(type, row) { + this.formDia = true; + this.operationType = type + if (this.operationType === 'edit') { + this.form = { ...row } + } + }, + handleEdit() { + if (!this.form.unitName) { + this.$message.warning('璇峰~鍐欏崟浣嶅悕绉�') + return + } + if (!this.form.department) { + this.$message.warning('璇峰~鍐欓儴闂�') + return + } + this.editLoad = true + if (this.operationType === 'add') { + addClientSatisfaction(this.form).then(res => { + this.editLoad = false + if (res.code === 201) return + this.$message.success('鎻愪氦鎴愬姛') + this.closeFormDia() + }).catch(err => { + console.log('err---', err); + this.editLoad = false + }) + } else { + updateClientSatisfaction(this.form).then(res => { + this.editLoad = false + if (res.code === 201) return + this.$message.success('鎻愪氦鎴愬姛') + this.closeFormDia() + }).catch(err => { + console.log('err---', err); + this.editLoad = false + }) + } + }, + closeFormDia() { + this.formDia = false; + this.$emit('closeFormDia') + }, + } +}; +</script> + +<style scoped> +>>>.el-dialog { + margin: 10vh auto 50px !important; +} + +.tables { + table-layout: fixed; + width: 100%; + margin-top: 10px; +} + +.td-title { + height: 40px; + width: 170px; + text-align: center; + font-size: 14px; + word-wrap: break-word; + white-space: normal; + padding: 6px; +} + +.td-info { + padding: 6px; +} + +.td-info1 { + display: inline-block; + width: 100%; + text-align: left; + font-size: 14px; + word-wrap: break-word; + white-space: normal; +} +</style> diff --git a/src/views/CNAS/systemManagement/customerSatisfaction/index.vue b/src/views/CNAS/systemManagement/customerSatisfaction/index.vue new file mode 100644 index 0000000..3a898cd --- /dev/null +++ b/src/views/CNAS/systemManagement/customerSatisfaction/index.vue @@ -0,0 +1,410 @@ +<template> + <div> + <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="small" @click="resetSearchForm">閲� 缃�</el-button> + <el-button size="small" type="primary" @click="searchList">鏌� 璇�</el-button> + </span> + <div class="btn"> + <el-button v-if="tabIndex === '0'" size="small" 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> + </div> + </div> + <div class="table"> + <div class="table-tab"> + <el-radio-group v-model="tabIndex" @change="searchList" size="small"> + <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> + <limsTable :column="tableColumn" :height="'calc(100vh - 22em)'" :table-data="tableData" + :table-loading="tableLoading" style="padding: 0 15px;margin-bottom: 16px" @pagination="pagination"> + </limsTable> + </template> + </TableCard> + </div> + <div v-if="tabIndex === '1'"> + <TableCard :showForm="false" :showTitle="false"> + <template v-slot:table> + <limsTable :column="tableColumn1" :height="'calc(100vh - 22em)'" :table-data="tableData1" + :table-loading="tableLoading1" style="padding: 0 15px;margin-bottom: 16px" @pagination="pagination0"> + </limsTable> + </template> + </TableCard> + </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 '@/components/TableCard/index.vue'; +import limsTable from "@/components/Table/lims-table.vue"; +import FormDialog from './components/formDialog.vue'; +import filePreview from '@/components/Preview/filePreview.vue' +import { + pageClientSatisfaction, + pageAnalyseFile, + delClientSatisfaction, + delAnalyseFile, +} from '@/api/cnas/systemManagement/customerSatisfaction.js' +import { getToken } from "@/utils/auth"; + +export default { + name: 'a8-customer-satisfaction', + // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� + components: { filePreview, FormDialog, limsTable, 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 + pageClientSatisfaction({ ...entity, ...page }).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 + pageAnalyseFile({ ...entity, ...page }).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 + 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 + 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: '宸插彇娑堝垹闄�' + }); + }); + }, + // 鍒嗛〉 + pagination({ page, limit }) { + this.page.current = page; + this.page.size = limit; + this.searchList(); + }, + // 鍒嗛〉 + pagination0({ page, limit }) { + this.page.current = page; + this.page.size = limit; + this.searchList(); + }, + }, + // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭� + computed: { + headers() { + return { + 'Authorization': "Bearer " + getToken() + } + }, + action() { + return this.javaApi + '/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; + position: relative; +} + +.search-group { + display: flex; + align-items: center; + margin: 0 20px; +} + +.table { + background-color: #ffffff; +} + +.table-tab { + margin: 0 20px 20px 20px; +} + +.btn { + position: absolute; + top: 16px; + right: 20px; +} +</style> -- Gitblit v1.9.3