index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <div class="common-container">
  3. <TitleBar></TitleBar>
  4. <!-- 搜索栏与表格区域 -->
  5. <div class="main-container">
  6. <div class="search-container TableSelectMain">
  7. <el-form class="table-select-main" :model="searchForm" label-position="left">
  8. <el-row :gutter="15">
  9. <el-col :span="4">
  10. <el-form-item>
  11. <el-input placeholder="请输入发起人" v-model="searchForm.originator"></el-input>
  12. </el-form-item>
  13. </el-col>
  14. <el-col :span="4">
  15. <el-form-item>
  16. <el-input placeholder="请输入品牌" v-model="searchForm.brandName"></el-input>
  17. </el-form-item>
  18. </el-col>
  19. <el-col :span="4">
  20. <el-form-item>
  21. <el-input placeholder="请输入专家" v-model="searchForm.chargeName"></el-input>
  22. </el-form-item>
  23. </el-col>
  24. <el-col :span="4">
  25. <el-form-item>
  26. <el-cascader placeholder="请选择诊单状态" :options="statuzData" v-model="statuz"></el-cascader>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="4">
  30. <el-form-item>
  31. <el-button type="primary" round @click="querySearch">查询</el-button>
  32. <el-button type="info" plain round @click="reset">重置</el-button>
  33. </el-form-item>
  34. </el-col>
  35. </el-row>
  36. </el-form>
  37. </div>
  38. <div class="SearchTitle">
  39. 已选择
  40. <span class="subject-color">{{tableSelection.length}}</span> 项
  41. </div>
  42. <div class="MaintenanceTable">
  43. <el-table
  44. ref="multipleTable"
  45. :data="tableData"
  46. style="width: 100%"
  47. tooltip-effect="dark"
  48. @selection-change="selectColumn"
  49. class="OutTable"
  50. border
  51. v-loading="listLoading"
  52. >
  53. <el-table-column type="selection"></el-table-column>
  54. <el-table-column prop="name" label="发起人"></el-table-column>
  55. <el-table-column prop="dataTable" label="诊单类型">
  56. <template slot-scope="scope">
  57. <span>{{scope.row.dataTable | diagnosisPipe}}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column prop="statuz" label="诊单状态">
  61. <template slot-scope="scope">
  62. <span v-if="scope.row.colorGrade == 1 && scope.row.acceptStatus == 0" style="color:#ff9999">{{scope.row.statuz | caseStatusPipe(scope.row.dataTable)}}</span>
  63. <span v-else-if="scope.row.colorGrade == 2 && scope.row.acceptStatus == 0" style="color:#ff6666">{{scope.row.statuz | caseStatusPipe(scope.row.dataTable)}}</span>
  64. <span v-else-if="scope.row.colorGrade == 3 && scope.row.acceptStatus == 0" style="color:#ff1a1a">{{scope.row.statuz | caseStatusPipe(scope.row.dataTable)}}</span>
  65. <span v-else-if="scope.row.colorGrade >= 4 && scope.row.acceptStatus == 0" style="color:#e60000">{{scope.row.statuz | caseStatusPipe(scope.row.dataTable)}}</span>
  66. <span v-else >{{scope.row.statuz | caseStatusPipe(scope.row.dataTable)}}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column prop="customerName" label="接单客服"></el-table-column>
  70. <el-table-column prop="totalCost" label="总金额">
  71. <template slot-scope="scope">
  72. <span>{{scope.row.totalCost | pricePipe(2, '¥', true)}}</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column prop="payCost" label="实付金额">
  76. <template slot-scope="scope">
  77. <span>{{scope.row.payCost | pricePipe(2, '¥', true)}}</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column prop="chargeName" label="专家" :show-overflow-tooltip="true"></el-table-column>
  81. <el-table-column prop="brandName" label="品牌" :show-overflow-tooltip="true"></el-table-column>
  82. <el-table-column prop="expression" label="问题描述" :show-overflow-tooltip="true"></el-table-column>
  83. <el-table-column prop="updateTime" label="发起时间">
  84. <template slot-scope="scope">
  85. <span>{{scope.row.updateTime | formatTimePipe}}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="操作" min-width="140px;">
  89. <template slot-scope="scope">
  90. <el-button
  91. size="mini"
  92. type="primary"
  93. plain
  94. round
  95. @click="enterChatRoom(scope.row)"
  96. >聊天室</el-button>
  97. <el-button
  98. size="mini"
  99. type="success"
  100. plain
  101. round
  102. @click="showDetailDialog(scope.row)"
  103. >详情</el-button>
  104. </template>
  105. </el-table-column>
  106. </el-table>
  107. <div class="pagenation">
  108. <PageComponent
  109. :total="total"
  110. @pagination="handlePagination"
  111. :pageSize.sync="page.pageSize"
  112. :pageNum.sync="page.pageNum"
  113. ></PageComponent>
  114. </div>
  115. </div>
  116. </div>
  117. <!-- 详情弹层 -->
  118. <DetailsDialog ref="detailsDialog"></DetailsDialog>
  119. </div>
  120. </template>
  121. <script>
  122. import TitleBar from '@/apps/mobile/components/common/TitleBar';
  123. import DetailsDialog from './components/detailsDialog';
  124. import { queryLiftCasesList, updateCustomerServiceId } from '@/apps/mobile/api/monitoring-center/index';
  125. export default {
  126. components: {
  127. TitleBar,
  128. DetailsDialog,
  129. },
  130. data() {
  131. return {
  132. searchForm: {},
  133. tableData: [],
  134. page: {
  135. pageNum: 1,
  136. pageSize: 5,
  137. },
  138. total: 10,
  139. listLoading: false,
  140. tableSelection: [],
  141. detailsDialogVisible: false,
  142. detailsDialogForm: {},
  143. userId: null,
  144. statuz: null,
  145. statuzData: [{
  146. value: '1',
  147. label: '问诊',
  148. children: [{
  149. value: '0',
  150. label: '待付款'
  151. },{
  152. value: '1',
  153. label: '已付款'
  154. },{
  155. value: '2',
  156. label: '已接单'
  157. },{
  158. value: '3',
  159. label: '专家确认完成'
  160. },{
  161. value: '4',
  162. label: '用户确认完成'
  163. },{
  164. value: '5',
  165. label: '待归档'
  166. },{
  167. value: '6',
  168. label: '已完成'
  169. },{
  170. value: '7',
  171. label: '申诉中'
  172. },{
  173. value: '8',
  174. label: '拒绝接单'
  175. }]
  176. }, {
  177. value: '2',
  178. label: '出诊',
  179. children: [{
  180. value: '0',
  181. label: '待接单'
  182. },{
  183. value: '1',
  184. label: '已接单'
  185. },{
  186. value: '2',
  187. label: '待付款'
  188. },{
  189. value: '3',
  190. label: '已付款'
  191. },{
  192. value: '4',
  193. label: '专家确认完成'
  194. },{
  195. value: '5',
  196. label: '用户确认完成'
  197. },{
  198. value: '6',
  199. label: '已完成'
  200. },{
  201. value: '7',
  202. label: '申诉中'
  203. },{
  204. value: '8',
  205. label: '拒绝接单'
  206. }]
  207. }],
  208. timer: ''
  209. };
  210. },
  211. created() {
  212. this.queryListData();
  213. this.userId = this.$userId();
  214. },
  215. mounted() {
  216. this.timer = setInterval(this.queryListData, 60000);
  217. },
  218. beforeDestroy() {
  219. clearInterval(this.timer);
  220. },
  221. methods: {
  222. queryListData() {
  223. this.listLoading = true;
  224. let obj = {
  225. ...this.page,
  226. ...this.searchForm,
  227. type: 'BACKQUERY',
  228. sort: {
  229. order: 'desc',
  230. // orderBy: 'create_time',
  231. orderBy: 'update_time',
  232. },
  233. userType: 2
  234. };
  235. if(this.statuz){
  236. if(this.statuz[0] == "1"){
  237. obj.statuz1 = this.statuz[1];
  238. }
  239. else{
  240. obj.statuz2 = this.statuz[1];
  241. }
  242. }
  243. queryLiftCasesList(obj)
  244. .then(res => {
  245. console.log(res);
  246. this.tableData = res.data.records || [];
  247. this.total = res.data.total;
  248. this.listLoading = false;
  249. })
  250. .catch(() => {
  251. this.listLoading = false;
  252. });
  253. },
  254. querySearch() {
  255. this.queryListData();
  256. },
  257. reset() {
  258. this.searchForm = {};
  259. this.page.pageNum = 1;
  260. this.statuz = null;
  261. this.queryListData();
  262. },
  263. selectColumn(selection) {
  264. this.tableSelection = selection;
  265. },
  266. // 页码变化时
  267. handlePagination(val) {
  268. this.page = val;
  269. this.queryListData();
  270. },
  271. showDetailDialog(data) {
  272. let _data = Object.assign({}, data);
  273. this.$refs.detailsDialog.open(_data);
  274. },
  275. enterChatRoom(data) {
  276. if (data.customerServiceId) {
  277. if (data.customerServiceId === this.userId) {
  278. this.chatRoomRouter(data);
  279. } else {
  280. this.$message.warning('非专属客服无法进入!');
  281. return false;
  282. }
  283. } else {
  284. let obj = {
  285. id: data.id,
  286. chargerId: data.chargerId ? data.chargerId : null,
  287. customerServiceId: this.userId,
  288. };
  289. updateCustomerServiceId(obj)
  290. .then(res => {
  291. console.log(res);
  292. this.chatRoomRouter(data);
  293. })
  294. .catch();
  295. }
  296. },
  297. chatRoomRouter(data) {
  298. this.$router.push({
  299. path: '/chat-room',
  300. query: {
  301. id: data.id,
  302. customerServiceId: this.userId,
  303. sessionId: data.sessionId,
  304. name: data.name,
  305. dataTable: data.dataTable
  306. },
  307. });
  308. },
  309. },
  310. };
  311. </script>
  312. <style lang="stylus" scoped>
  313. .TableSelectMain .el-date-editor.el-input.el-input--prefix.el-input--suffix.el-date-editor--date {
  314. width: 95%;
  315. }
  316. </style>