| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456 |
- <template>
- <basic-container>
- <avue-crud
- :option="option"
- :table-loading="loading"
- :data="data"
- :page="page"
- ref="crud"
- v-model="form"
- :permission="permissionList"
- @row-update="rowUpdate"
- @row-save="rowSave"
- @row-del="rowDel"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad"
- >
- <template slot="menuLeft">
- <el-button
- type="primary"
- size="small"
- icon="el-icon-plus"
- v-if="permission.complaint_add"
- @click="handleAdd"
- >
- 新增投诉
- </el-button>
- <el-button
- type="warning"
- size="small"
- icon="el-icon-edit"
- :disabled="selectionList.length !== 1"
- v-if="permission.complaint_edit"
- @click="handleBatchStatus"
- >
- 批量处理
- </el-button>
- </template>
- <template slot="status" slot-scope="{row}">
- <el-tag
- :type="getComplaintStatusType(row.status)"
- size="small"
- >
- {{ getComplaintStatusLabel(row.status) }}
- </el-tag>
- </template>
- <template slot="replyStatus" slot-scope="{row}">
- <el-tag
- :type="getReplyStatusType(row.replyStatus)"
- size="small"
- >
- {{ getReplyStatusLabel(row.replyStatus) }}
- </el-tag>
- </template>
- <template slot="complainantType" slot-scope="{row}">
- <el-tag
- :type="getComplainantTypeType(row.complainantType)"
- size="small"
- >
- {{ getComplainantTypeLabel(row.complainantType) }}
- </el-tag>
- </template>
- <template slot="menu" slot-scope="{row}">
- <el-button
- type="text"
- size="small"
- icon="el-icon-view"
- @click="handleDetail(row)"
- >
- 详情
- </el-button>
- <el-button
- type="text"
- size="small"
- icon="el-icon-chat-line-round"
- @click="handleReplyList(row)"
- >
- 回复列表
- </el-button>
- <el-button
- type="text"
- size="small"
- icon="el-icon-edit"
- v-if="permission.complaint_edit && isComplaintEditable(row.status)"
- @click="handleEdit(row)"
- >
- 编辑
- </el-button>
- <el-button
- type="text"
- size="small"
- icon="el-icon-check"
- v-if="isComplaintProcessable(row.status)"
- @click="handleProcess(row)"
- >
- 修改状态
- </el-button>
- <el-button
- type="text"
- size="small"
- icon="el-icon-close"
- v-if="permission.complaint_edit && isComplaintClosable(row.status)"
- @click="handleClose(row)"
- >
- 关闭
- </el-button>
- </template>
- </avue-crud>
- <!-- 投诉详情对话框 -->
- <el-dialog
- title="投诉详情"
- :visible.sync="detailVisible"
- width="800px"
- append-to-body
- :close-on-click-modal="false"
- :destroy-on-close="true"
- class="complaint-detail-dialog"
- >
- <div v-if="detailData" class="complaint-detail">
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="detail-item">
- <label>投诉单号:</label>
- <span>{{ detailData.complaintNo }}</span>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="detail-item">
- <label>投诉标题:</label>
- <span>{{ detailData.title }}</span>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="detail-item">
- <label>投诉人类型:</label>
- <span>{{ getComplainantTypeLabel(detailData.complainantType) }}</span>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="detail-item">
- <label>投诉类型:</label>
- <span>{{ detailData.complaintType }}</span>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="detail-item">
- <label>联系人:</label>
- <span>{{ detailData.contactName }}</span>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="detail-item">
- <label>联系电话:</label>
- <span>{{ detailData.contactPhone }}</span>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="20" v-if="detailData.customerName">
- <el-col :span="12">
- <div class="detail-item">
- <label>客户名称:</label>
- <span>{{ detailData.customerName }}</span>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="detail-item">
- <label>客户编码:</label>
- <span>{{ detailData.customerCode }}</span>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="detail-item">
- <label>投诉状态:</label>
- <el-tag :type="getComplaintStatusType(detailData.status)" size="small">
- {{ getComplaintStatusLabel(detailData.status) }}
- </el-tag>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="detail-item">
- <label>回复状态:</label>
- <el-tag :type="detailData.replyStatus === 1 ? 'success' : 'info'" size="small">
- {{ detailData.replyStatus === 1 ? '已回复' : '未回复' }}
- </el-tag>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="24">
- <div class="detail-item">
- <label>投诉内容:</label>
- <div class="content-text">{{ detailData.content }}</div>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="20" v-if="detailData.closeReason">
- <el-col :span="24">
- <div class="detail-item">
- <label>关闭原因:</label>
- <div class="content-text">{{ detailData.closeReason }}</div>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="detail-item">
- <label>提交时间:</label>
- <span>{{ detailData.submitTime }}</span>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="detail-item">
- <label>更新时间:</label>
- <span>{{ detailData.updateTime }}</span>
- </div>
- </el-col>
- </el-row>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="detailVisible = false">关闭</el-button>
- </div>
- </el-dialog>
- <!-- 回复列表对话框 -->
- <el-dialog
- title="回复列表"
- :visible.sync="replyListVisible"
- width="1000px"
- append-to-body
- :close-on-click-modal="false"
- :destroy-on-close="true"
- class="reply-list-dialog"
- >
- <div class="reply-list-header">
- <el-button
- type="primary"
- size="small"
- icon="el-icon-plus"
- v-if="currentComplaintStatus !== COMPLAINT_STATUS.CLOSED && currentComplaintStatus !== COMPLAINT_STATUS.CANCELLED"
- @click="handleAddReply"
- >
- 新增回复
- </el-button>
- </div>
- <el-table
- :data="replyList"
- v-loading="replyListLoading"
- border
- stripe
- style="margin-top: 15px;"
- >
- <el-table-column label="回复类型" width="100" align="center">
- <template slot-scope="scope">
- <el-tag
- :type="getReplyTypeType(scope.row.replyType)"
- size="small"
- >
- {{ getReplyTypeLabel(scope.row.replyType) }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column label="回复内容" prop="replyContent" min-width="300">
- <template slot-scope="scope">
- <div class="reply-content">
- {{ scope.row.replyContent }}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="回复人" prop="replierName" width="120" align="center"></el-table-column>
- <el-table-column label="回复时间" prop="replyTime" width="160" align="center"></el-table-column>
- <el-table-column label="创建时间" prop="createTime" width="160" align="center"></el-table-column>
- </el-table>
- <el-pagination
- v-if="replyTotal > 0"
- @size-change="handleReplyPageSizeChange"
- @current-change="handleReplyPageChange"
- :current-page="replyPage.current"
- :page-sizes="[10, 20, 50, 100]"
- :page-size="replyPage.size"
- layout="total, sizes, prev, pager, next, jumper"
- :total="replyTotal"
- style="margin-top: 15px; text-align: right;"
- >
- </el-pagination>
- <div slot="footer" class="dialog-footer">
- <el-button @click="replyListVisible = false">关闭</el-button>
- </div>
- </el-dialog>
- <!-- 新增回复对话框 -->
- <el-dialog
- title="新增回复"
- :visible.sync="addReplyVisible"
- width="600px"
- append-to-body
- :close-on-click-modal="false"
- :destroy-on-close="true"
- >
- <el-form
- :model="replyForm"
- :rules="replyRules"
- ref="replyForm"
- label-width="100px"
- >
- <el-form-item label="回复类型" prop="replyType">
- <el-select v-model="replyForm.replyType" placeholder="请选择回复类型" style="width: 100%">
- <el-option
- v-for="item in replyTypeOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="回复内容" prop="replyContent">
- <el-input
- type="textarea"
- :rows="5"
- v-model="replyForm.replyContent"
- placeholder="请输入回复内容"
- maxlength="1000"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item label="附件URL" prop="replyAttachUrl">
- <el-input
- v-model="replyForm.replyAttachUrl"
- placeholder="请输入附件URL(可选)"
- ></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="addReplyVisible = false">取消</el-button>
- <el-button type="primary" @click="confirmAddReply" :loading="addReplyLoading">确定</el-button>
- </div>
- </el-dialog>
- <!-- 状态处理对话框 -->
- <el-dialog
- :title="statusDialogTitle"
- :visible.sync="statusVisible"
- append-to-body
- width="500px"
- :close-on-click-modal="false"
- >
- <el-form :model="statusForm" :rules="statusRules" ref="statusForm" label-width="100px">
- <el-form-item label="新状态" prop="status">
- <el-select v-model="statusForm.status" placeholder="请选择状态" style="width: 100%">
- <el-option label="待处理" :value="0"></el-option>
- <el-option label="处理中" :value="1"></el-option>
- <el-option label="已回复" :value="2"></el-option>
- <el-option label="已关闭" :value="3"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="关闭原因" prop="closeReason" v-if="statusForm.status === COMPLAINT_STATUS.CLOSED">
- <el-input
- type="textarea"
- :rows="3"
- v-model="statusForm.closeReason"
- placeholder="请输入关闭原因"
- ></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="statusVisible = false">取消</el-button>
- <el-button type="primary" @click="confirmStatusUpdate" :loading="statusLoading">确定</el-button>
- </div>
- </el-dialog>
- </basic-container>
- </template>
- <script>
- import complaintMixin from './complaintMixin';
- export default {
- mixins: [complaintMixin],
- }
- </script>
- <style lang="scss" scoped>
- .complaint-detail {
- .detail-item {
- margin-bottom: 15px;
- label {
- font-weight: bold;
- color: #606266;
- margin-right: 10px;
- }
- .content-text {
- margin-top: 5px;
- padding: 10px;
- background-color: #f5f7fa;
- border-radius: 4px;
- line-height: 1.6;
- white-space: pre-wrap;
- }
- }
- }
- .reply-list-dialog {
- .reply-list-header {
- display: flex;
- justify-content: flex-end;
- margin-bottom: 10px;
- }
- .reply-content {
- word-break: break-word;
- line-height: 1.5;
- max-height: 100px;
- overflow-y: auto;
- }
- .el-table {
- font-size: 14px;
- .el-table__cell {
- padding: 12px 0;
- }
- }
- }
- ::v-deep .el-col-md-8 {
- width: 24.33333%;
- }
- </style>
|