index.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="频次" prop="frequency">
  5. <el-input
  6. v-model="queryParams.frequency"
  7. placeholder="请输入频次"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="是否解决" prop="isResolve">
  14. <el-select v-model="queryParams.isResolve" placeholder="请选择" clearable size="small" style="width: 180px">
  15. <el-option label="是" :value="1" />
  16. <el-option label="否" :value="0" />
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item>
  20. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  21. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  22. </el-form-item>
  23. </el-form>
  24. <el-row :gutter="10" class="mb8">
  25. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  26. </el-row>
  27. <el-table border v-loading="loading" :data="fastGptChatQuestionStatisticsList" @selection-change="handleSelectionChange">
  28. <el-table-column type="selection" width="55" align="center" />
  29. <el-table-column label="ID" align="center" prop="id" width="80" />
  30. <el-table-column label="所属类别" align="center" prop="questionCategory" />
  31. <!-- <el-table-column label="来源" align="center" prop="source" />-->
  32. <el-table-column label="内容摘要" align="center" prop="contentSummary" />
  33. <el-table-column label="频次" align="center" prop="frequency" width="90" />
  34. <el-table-column label="是否解决" align="center" prop="isResolve" width="100">
  35. <template slot-scope="scope">
  36. <span>{{ scope.row.isResolve === 1 ? '是' : (scope.row.isResolve === 0 ? '否' : '-') }}</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="创建时间" align="center" prop="createTime" width="170" />
  40. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  41. <template slot-scope="scope">
  42. <el-button
  43. size="mini"
  44. type="text"
  45. icon="el-icon-document"
  46. @click="handleDetail(scope.row)"
  47. >详情</el-button>
  48. <el-button
  49. size="mini"
  50. type="text"
  51. icon="el-icon-delete"
  52. @click="handleDelete(scope.row)"
  53. v-hasPermi="['fastGpt:fastGptChatQuestionStatistics:remove']"
  54. >删除</el-button>
  55. </template>
  56. </el-table-column>
  57. </el-table>
  58. <pagination
  59. v-show="total>0"
  60. :total="total"
  61. :page.sync="queryParams.pageNum"
  62. :limit.sync="queryParams.pageSize"
  63. @pagination="getList"
  64. />
  65. <!-- 详情弹窗(问题明细) -->
  66. <el-dialog :title="detailTitle" :visible.sync="detailOpen" width="1100px" append-to-body>
  67. <el-table border v-loading="detailLoading" :data="detailList">
  68. <!-- <el-table-column label="分类内容摘要" prop="user_content" min-width="160" />-->
  69. <el-table-column label="所属公司" prop="companyName" min-width="140" />
  70. <el-table-column label="所属销售" prop="companyUserNickName" min-width="120" />
  71. <el-table-column label="客户昵称" prop="nickName" min-width="120" />
  72. <el-table-column label="客户内容" prop="userContent" min-width="180" />
  73. <el-table-column label="销售回复内容" prop="companyUserContent" min-width="180" />
  74. <el-table-column label="创建时间" prop="createTime" width="170" />
  75. <el-table-column label="操作" width="110" align="center">
  76. <template slot-scope="scope">
  77. <el-button size="mini" type="text" @click="handleSalesReply(scope.row)">销售回复</el-button>
  78. </template>
  79. </el-table-column>
  80. </el-table>
  81. <pagination
  82. v-show="detailTotal > 0"
  83. :total="detailTotal"
  84. :page.sync="detailQuery.pageNum"
  85. :limit.sync="detailQuery.pageSize"
  86. @pagination="getDetailList"
  87. />
  88. <div slot="footer" class="dialog-footer">
  89. <el-button @click="detailOpen = false">关 闭</el-button>
  90. </div>
  91. </el-dialog>
  92. </div>
  93. </template>
  94. <script>
  95. import { listFastGptChatQuestionStatistics, delFastGptChatQuestionStatistics, listFastGptChatQuestionStatisticsDetail, saveFastGptChatQuestionStatisticsSalesReply } from "@/api/fastGpt/fastGptChatQuestionStatistics";
  96. export default {
  97. name: "fastGptChatQuestionStatistics",
  98. data() {
  99. return {
  100. // 遮罩层
  101. loading: true,
  102. // 选中数组
  103. ids: [],
  104. // 非单个禁用
  105. single: true,
  106. // 非多个禁用
  107. multiple: true,
  108. // 显示搜索条件
  109. showSearch: true,
  110. // 总条数
  111. total: 0,
  112. // 高频聊天问题统计表格数据
  113. fastGptChatQuestionStatisticsList: [],
  114. // 查询参数
  115. queryParams: {
  116. pageNum: 1,
  117. pageSize: 10,
  118. frequency: null,
  119. isResolve: null,
  120. },
  121. detailOpen: false,
  122. detailTitle: "问题明细",
  123. detailLoading: false,
  124. detailTotal: 0,
  125. detailQuery: {
  126. questionStatisticsId: null,
  127. pageNum: 1,
  128. pageSize: 10
  129. },
  130. detailList: []
  131. };
  132. },
  133. created() {
  134. this.getList();
  135. },
  136. methods: {
  137. /** 查询高频聊天问题统计列表 */
  138. getList() {
  139. this.loading = true;
  140. listFastGptChatQuestionStatistics(this.queryParams).then(response => {
  141. this.fastGptChatQuestionStatisticsList = response.rows;
  142. this.total = response.total;
  143. this.loading = false;
  144. });
  145. },
  146. /** 搜索按钮操作 */
  147. handleQuery() {
  148. this.queryParams.pageNum = 1;
  149. this.getList();
  150. },
  151. /** 重置按钮操作 */
  152. resetQuery() {
  153. this.resetForm("queryForm");
  154. this.handleQuery();
  155. },
  156. // 多选框选中数据
  157. handleSelectionChange(selection) {
  158. this.ids = selection.map(item => item.id)
  159. this.single = selection.length!==1
  160. this.multiple = !selection.length
  161. },
  162. /** 删除按钮操作 */
  163. handleDelete(row) {
  164. const ids = row.id || this.ids;
  165. this.$confirm('是否确认删除高频聊天问题统计编号为"' + ids + '"的数据项?', "警告", {
  166. confirmButtonText: "确定",
  167. cancelButtonText: "取消",
  168. type: "warning"
  169. }).then(function() {
  170. return delFastGptChatQuestionStatistics(ids);
  171. }).then(() => {
  172. this.getList();
  173. this.msgSuccess("删除成功");
  174. }).catch(() => {});
  175. },
  176. handleDetail(row) {
  177. this.detailQuery.questionStatisticsId = row.id || null;
  178. this.detailQuery.pageNum = 1;
  179. this.detailQuery.pageSize = 10;
  180. this.detailOpen = true;
  181. this.detailTitle = `问题明细`;
  182. this.getDetailList();
  183. },
  184. getDetailList() {
  185. this.detailLoading = true;
  186. listFastGptChatQuestionStatisticsDetail(this.detailQuery).then(res => {
  187. this.detailList = res.rows || res.data || [];
  188. this.detailTotal = res.total != null ? res.total : 0;
  189. }).finally(() => {
  190. this.detailLoading = false;
  191. });
  192. },
  193. handleSalesReply(detailRow) {
  194. this.$prompt('请输入销售回复内容', '销售回复', {
  195. confirmButtonText: '保存',
  196. cancelButtonText: '取消',
  197. inputType: 'textarea',
  198. inputValue: detailRow.companyUserContent || ''
  199. }).then(({ value }) => {
  200. return saveFastGptChatQuestionStatisticsSalesReply({
  201. id: detailRow.id,
  202. companyUserContent: value,
  203. questionStatisticsId:detailRow.questionStatisticsId
  204. });
  205. }).then(() => {
  206. this.msgSuccess("保存成功");
  207. this.getDetailList();
  208. }).catch(() => {});
  209. }
  210. }
  211. };
  212. </script>