Visit-detail.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927
  1. <template>
  2. <el-dialog
  3. v-model="state.dialogVisible"
  4. draggable
  5. :title="dialogTitle"
  6. ref="dialogRef"
  7. @mouseup="mouseup"
  8. :style="'transform: ' + state.transform + ';'"
  9. @close="close"
  10. destroy-on-close
  11. modal-class="modal_class"
  12. class="visit_dialog_no_modal"
  13. :modal="false"
  14. >
  15. <el-collapse v-model="state.collapseArr" class="collapse-box" v-loading="state.loading">
  16. <!-- 工单信息 -->
  17. <el-collapse-item name="1">
  18. <template #title>
  19. <p class="pl20">
  20. <b class="font14">工单信息</b>
  21. </p>
  22. </template>
  23. <div class="collapse-container">
  24. <el-form label-width="100px" class="show-info-form">
  25. <el-row :gutter="10">
  26. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  27. <el-form-item label="工单编码" class="mb5"> {{ state.orderDetail.no }} </el-form-item>
  28. </el-col>
  29. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  30. <el-form-item label="受理时间" class="mb5">
  31. <span>{{ formatDate(state.orderDetail.startTime, 'YYYY-mm-dd HH:MM:SS') }}</span></el-form-item
  32. >
  33. </el-col>
  34. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  35. <el-form-item label="受理人" class="mb5">
  36. <span>{{ state.orderDetail?.acceptorName }}</span>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  40. <el-form-item label="来源渠道" class="mb5"> {{ state.orderDetail.sourceChannel }} </el-form-item>
  41. </el-col>
  42. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  43. <el-form-item label="受理类型" class="mb5"> {{ state.orderDetail.acceptType }} </el-form-item>
  44. </el-col>
  45. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  46. <el-form-item label="热点分类" class="mb5"> {{ state.orderDetail.hotspotName }} </el-form-item>
  47. </el-col>
  48. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  49. <el-form-item label="工单标题" class="mb5"> {{ state.orderDetail.title }} </el-form-item>
  50. </el-col>
  51. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  52. <el-form-item label="工单内容" class="formatted-text mb5"> {{ state.orderDetail.content }} </el-form-item>
  53. </el-col>
  54. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  55. <el-form-item label="办理结果" class="formatted-text mb5"> {{ state.orderDetail.fileOpinion }} </el-form-item>
  56. </el-col>
  57. </el-row>
  58. </el-form>
  59. </div>
  60. </el-collapse-item>
  61. <el-collapse-item name="2">
  62. <template #title>
  63. <p class="pl20">
  64. <b class="font14">来电人信息</b>
  65. </p>
  66. </template>
  67. <div class="collapse-container">
  68. <el-form label-width="100px" class="show-info-form">
  69. <el-row :gutter="10">
  70. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  71. <el-form-item label="来电人姓名"> {{ state.orderDetail.fromName }} </el-form-item>
  72. </el-col>
  73. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="state.orderDetail.fromPhone">
  74. <el-form-item label="来电号码" class="mb5">
  75. {{ state.orderDetail.fromPhone }}
  76. <el-button
  77. plain
  78. title="人工回访录音"
  79. size="small"
  80. type="primary"
  81. class="ml8"
  82. @click="recordFile"
  83. v-if="['ZiGong'].includes(themeConfig.appScope) ? state.recordingAbsolutePath && userInfos.isCenter : state.recordingAbsolutePath"
  84. >人工回访录音</el-button
  85. >
  86. </el-form-item>
  87. </el-col>
  88. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  89. <el-form-item label="来电人性别" class="mb5"> {{ state.orderDetail.fromGenderText }} </el-form-item>
  90. </el-col>
  91. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  92. <el-form-item label="联系电话">
  93. {{ state.orderDetail.contact }}
  94. <el-button plain title="呼叫" size="small" type="primary" class="ml8" @click="callPhone(state.orderDetail.contact)" v-if="!disabled"
  95. >外呼</el-button
  96. >
  97. <el-checkbox-group
  98. v-model="prefixOptions"
  99. :max="1"
  100. v-if="['ZiGong', 'LuZhou'].includes(themeConfig.appScope) && !disabled"
  101. class="checkbox ml5"
  102. >
  103. <el-checkbox value="add">加0</el-checkbox>
  104. <el-checkbox value="remove">减0</el-checkbox>
  105. </el-checkbox-group>
  106. </el-form-item>
  107. </el-col>
  108. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  109. <el-form-item label="联系地址"> {{ state.orderDetail.address }} </el-form-item>
  110. </el-col>
  111. </el-row>
  112. </el-form>
  113. </div>
  114. </el-collapse-item>
  115. <el-collapse-item name="3">
  116. <template #title>
  117. <p class="pl20">
  118. <b class="font14">回访信息</b>
  119. </p>
  120. </template>
  121. <div class="collapse-container">
  122. <el-form label-width="120px" ref="ruleFormRef" :model="state.ruleForm" label-position="left">
  123. <!-- 详情 -->
  124. <template v-if="disabled">
  125. <el-row :gutter="10" class="show-info-form">
  126. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  127. <el-form-item label="当前回访人">
  128. {{ state.orderVisitModel.employeeName }}
  129. <el-button plain title="智能回访录音" size="small" type="primary" class="ml8" @click="onSmartRecord" v-if="state.smartRecord"
  130. >智能回访录音
  131. </el-button>
  132. <el-button
  133. plain
  134. title="人工回访录音"
  135. size="small"
  136. type="primary"
  137. class="ml8"
  138. @click="recordFile"
  139. v-if="
  140. ['ZiGong'].includes(themeConfig.appScope) ? state.recordingAbsolutePath && userInfos.isCenter : state.recordingAbsolutePath
  141. "
  142. >人工回访录音</el-button
  143. >
  144. </el-form-item>
  145. </el-col>
  146. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="visitCount">
  147. <el-form-item label="当前工单已回访次数" label-width="140px"> {{ visitCount }}次 </el-form-item>
  148. </el-col>
  149. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  150. <el-form-item label="回访时间"> {{ formatDate(state.orderVisitModel.visitTime, 'YYYY-mm-dd HH:MM:SS') }} </el-form-item>
  151. </el-col>
  152. <!-- <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  153. <el-form-item label="回访标签">
  154. <span v-if="state.ruleForm.isPutThrough !== null">{{ state.ruleForm.isPutThrough ? '已接通' : '未接通' }}</span>
  155. </el-form-item>
  156. </el-col>-->
  157. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  158. <el-row v-for="item in state.ruleForm.visitDetails" :key="item.id" :gutter="10">
  159. <!-- 务员评价 -->
  160. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12" v-if="['ZiGong'].includes(themeConfig.appScope) && item.visitTarget === 10">
  161. <el-form-item label="语音评价"> {{ item.voiceEvaluateText }} </el-form-item>
  162. </el-col>
  163. <template v-if="item.visitTarget === 10 && isTelSource">
  164. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
  165. <el-form-item label="话务员评价">
  166. {{ item.seatEvaluateText }}
  167. </el-form-item>
  168. </el-col>
  169. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  170. <el-form-item label="话务员回访内容">
  171. {{ item.visitContent }}
  172. </el-form-item>
  173. </el-col>
  174. </template>
  175. <!-- 部门评价 -->
  176. <template v-if="item.visitTarget === 20">
  177. <el-divider content-position="left">
  178. <el-text tag="b" size="large" type="primary"> {{ item.visitOrgName }} </el-text>
  179. </el-divider>
  180. <template v-if="['YiBin'].includes(themeConfig.appScope)">
  181. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  182. <el-form-item label="部门是否联系">
  183. {{ item.isContact === null ? '' : item.isContact === true ? '是' : '否' }}
  184. </el-form-item>
  185. </el-col>
  186. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  187. <el-form-item label="处理结果">
  188. {{ item.volved === null ? '' : item.volved === true ? '已得到解决' : '未得到解决' }}
  189. </el-form-item>
  190. </el-col>
  191. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" v-if="item.volveConent">
  192. <el-form-item label="备注" class="formatted-text mb5">
  193. {{ item.volveConent }}
  194. </el-form-item>
  195. </el-col>
  196. </template>
  197. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
  198. <el-form-item label="部门办件结果">
  199. {{ item.orgProcessingResults?.dicDataName }}
  200. </el-form-item>
  201. </el-col>
  202. <!-- 不满意才会选择不满意原因 -->
  203. <el-col
  204. :xs="24"
  205. :sm="24"
  206. :md="24"
  207. :lg="12"
  208. :xl="12"
  209. v-if="item.orgNoSatisfiedReason && item.orgNoSatisfiedReason.length && item.orgProcessingResults?.value === '不满意'"
  210. >
  211. <el-form-item label="不满意原因">
  212. {{ item.orgNoSatisfiedReason.map((item) => item.dicDataName).join(',') }}
  213. </el-form-item>
  214. </el-col>
  215. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12" v-if="['ZiGong'].includes(themeConfig.appScope)">
  216. <el-form-item label="部门办件态度">
  217. {{ item.orgHandledAttitude?.dicDataName }}
  218. </el-form-item>
  219. </el-col>
  220. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  221. <el-form-item label="部门回访内容">
  222. {{ item.visitContent }}
  223. </el-form-item>
  224. </el-col>
  225. </template>
  226. </el-row>
  227. </el-col>
  228. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" v-if="state.orderVisitModel.orgJudge || state.orderVisitModel.seatJudge">
  229. <el-form-item label="扭转满意度">
  230. <el-tag v-if="state.orderVisitModel.orgJudge" class="mr10">扭转部门满意度</el-tag>
  231. <el-tag v-if="state.orderVisitModel.seatJudge">扭转坐席满意度</el-tag>
  232. </el-form-item>
  233. </el-col>
  234. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" v-if="state.orderVisitModel.judgeStateText">
  235. <el-form-item label="评判结果">
  236. <span>{{ state.orderVisitModel.judgeStateText }}</span>
  237. </el-form-item>
  238. </el-col>
  239. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" v-if="state.orderVisitModel.judgeContent">
  240. <el-form-item label="评判内容" class="formatted-text mb5">
  241. <span>{{ state.orderVisitModel.judgeContent }}</span>
  242. </el-form-item>
  243. </el-col>
  244. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" v-if="['ZiGong'].includes(themeConfig.appScope)">
  245. <el-form-item label="历史回访记录" class="w100">
  246. <div class="w100">
  247. <vxe-table
  248. border
  249. :loading="state.loading"
  250. :data="state.histories"
  251. :column-config="{ resizable: true }"
  252. :row-config="{ isCurrent: true, isHover: true, height: 30, useKey: true }"
  253. show-overflow
  254. :scrollY="{ enabled: true, gt: 100 }"
  255. max-height="300px"
  256. >
  257. <vxe-column field="voiceEvaluateTxt" title="语音评价" width="110"></vxe-column>
  258. <vxe-column field="seatEvaluateTxt" title="话务员评价" width="110"></vxe-column>
  259. <vxe-column field="visitOrgName" title="部门名称" width="140"></vxe-column>
  260. <vxe-column field="orgProcessingResultsValue" title="部门办件结果" width="110"></vxe-column>
  261. <vxe-column field="orgHandledAttitudeValue" title="部门办件态度" width="110"></vxe-column>
  262. <vxe-column field="visitContent" title="部门评价内容" width="110"></vxe-column>
  263. <vxe-column field="visitTime" title="回访时间" width="160">
  264. <template #default="{ row }">
  265. {{ formatDate(row.visitTime, 'YYYY-mm-dd HH:MM:SS') }}
  266. </template>
  267. </vxe-column>
  268. <vxe-column title="回访录音" fixed="right" width="90" align="center">
  269. <template #default="{ row }">
  270. <el-button link type="primary" @click="onPlayRecord(row)" title="回访录音" v-if="row.callId"> 回访录音 </el-button>
  271. </template>
  272. </vxe-column>
  273. </vxe-table>
  274. </div>
  275. </el-form-item>
  276. </el-col>
  277. </el-row>
  278. </template>
  279. <!-- 编辑 -->
  280. <template v-else>
  281. <el-row :gutter="10">
  282. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  283. <el-form-item label="当前回访人">
  284. {{ userInfos.name }}
  285. <el-button plain title="智能回访录音" size="small" type="primary" class="ml8" @click="onSmartRecord" v-if="state.smartRecord"
  286. >智能回访录音
  287. </el-button>
  288. <el-button
  289. plain
  290. title="人工回访录音"
  291. size="small"
  292. type="primary"
  293. class="ml8"
  294. @click="recordFile"
  295. v-if="
  296. ['ZiGong'].includes(themeConfig.appScope) ? state.recordingAbsolutePath && userInfos.isCenter : state.recordingAbsolutePath
  297. "
  298. >人工回访录音</el-button
  299. >
  300. </el-form-item>
  301. </el-col>
  302. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  303. <el-form-item label="当前工单已回访次数" label-width="140px"> {{ visitCount }}次 </el-form-item>
  304. </el-col>
  305. <!-- <el-col :span="24">
  306. <el-form-item label="回访标签" prop="isPutThrough" :rules="[{ required: false, message: '请选择回访标签', trigger: 'change' }]">
  307. <el-checkbox v-model="state.ruleForm.isPutThrough">未接通</el-checkbox>
  308. </el-form-item>
  309. </el-col>-->
  310. <el-col :span="24">
  311. <el-row v-for="(item, index) in state.ruleForm.visitDetails" :key="item.id" :gutter="10">
  312. <!-- 务员评价 -->
  313. <template v-if="item.visitTarget === 10 && isTelSource">
  314. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" v-if="['ZiGong'].includes(themeConfig.appScope)">
  315. <el-form-item
  316. label="语音评价"
  317. :prop="`visitDetails.${index}.voiceEvaluate`"
  318. :rules="[{ required: true, message: '请选择语音评价', trigger: 'change' }]"
  319. >
  320. <el-radio-group v-model="item.voiceEvaluate" disabled>
  321. <el-radio v-for="items in viceEvaluate" :key="items.key" :label="items.value" :value="items.key">{{
  322. items.value
  323. }}</el-radio>
  324. </el-radio-group>
  325. </el-form-item>
  326. </el-col>
  327. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  328. <el-form-item
  329. label="话务员评价"
  330. :prop="`visitDetails.${index}.seatEvaluate`"
  331. :rules="[{ required: true, message: '请选择话务员评价', trigger: 'change' }]"
  332. >
  333. <el-radio-group v-model="item.seatEvaluate">
  334. <el-radio v-for="items in seatEvaluate" :key="items.key" :label="items.value" :value="items.key">{{
  335. items.value
  336. }}</el-radio>
  337. </el-radio-group>
  338. </el-form-item>
  339. </el-col>
  340. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  341. <el-form-item
  342. label="话务员回访内容"
  343. :prop="`visitDetails.${index}.visitContent`"
  344. :rules="[{ required: true, message: '请填写话务员回访内容', trigger: 'blur' }]"
  345. >
  346. <common-advice
  347. @chooseAdvice="chooseAdvice($event, index)"
  348. v-model="item.visitContent"
  349. placeholder="请填写话务员回访内容"
  350. :loading="state.loading"
  351. :commonEnum="commonEnum.ReturnVisit"
  352. :minRows="5"
  353. :maxRows="10"
  354. drawerWidth="40%"
  355. />
  356. </el-form-item>
  357. </el-col>
  358. </template>
  359. <!-- 部门评价 -->
  360. <template v-if="item.visitTarget === 20">
  361. <el-divider content-position="left">
  362. <el-text tag="b" size="large"> {{ item.visitOrgName }} </el-text>
  363. </el-divider>
  364. <template v-if="['YiBin'].includes(themeConfig.appScope)">
  365. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  366. <el-form-item
  367. label="部门是否联系"
  368. :prop="`visitDetails.${index}.isContact`"
  369. :rules="[{ required: true, message: '请选择部门是否联系', trigger: 'change' }]"
  370. >
  371. <el-radio-group v-model="item.isContact">
  372. <el-radio :value="true">是</el-radio>
  373. <el-radio :value="false">否</el-radio>
  374. </el-radio-group>
  375. </el-form-item>
  376. </el-col>
  377. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  378. <el-form-item
  379. label="处理结果"
  380. :prop="`visitDetails.${index}.volved`"
  381. :rules="[{ required: true, message: '请选择处理结果', trigger: 'change' }]"
  382. >
  383. <el-radio-group v-model="item.volved">
  384. <el-radio :value="true">已得到解决</el-radio>
  385. <el-radio :value="false">未得到解决</el-radio>
  386. </el-radio-group>
  387. </el-form-item>
  388. </el-col>
  389. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" v-if="item.volved === false">
  390. <el-form-item
  391. label=""
  392. :prop="`visitDetails.${index}.volveConent`"
  393. :rules="[{ required: false, message: '请填写备注', trigger: 'blur' }]"
  394. >
  395. <common-advice
  396. @chooseAdvice="chooseAdvice($event, index)"
  397. v-model="item.volveConent"
  398. placeholder="请填写备注"
  399. :loading="state.loading"
  400. :commonEnum="commonEnum.ReturnVisit"
  401. :minRows="5"
  402. :maxRows="10"
  403. drawerWidth="40%"
  404. />
  405. </el-form-item>
  406. </el-col>
  407. </template>
  408. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
  409. <el-form-item
  410. label="部门办件结果"
  411. :prop="`visitDetails.${index}.orgProcessingResults`"
  412. :rules="[{ required: true, message: '请选择部门办件结果', trigger: 'change' }]"
  413. >
  414. <el-select
  415. v-model="item.orgProcessingResults"
  416. placeholder="请选择部门办件结果"
  417. class="w100"
  418. value-key="dicDataValue"
  419. @change="
  420. (val:any) => {
  421. item.orgProcessingResults.value = val?.dicDataName;
  422. item.orgProcessingResults.key = val?.dicDataValue;
  423. item.orgNoSatisfiedReason = [];
  424. }
  425. "
  426. >
  427. <el-option v-for="items in visitSatisfaction" :key="items.dicDataValue" :label="items.dicDataName" :value="items" />
  428. </el-select>
  429. </el-form-item>
  430. </el-col>
  431. <!-- 不满意才会选择不满意原因 -->
  432. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12" v-if="['1', '2'].includes(item.orgProcessingResults?.key)">
  433. <el-form-item
  434. label="不满意原因"
  435. :prop="`visitDetails.${index}.orgNoSatisfiedReason`"
  436. :rules="[{ required: true, message: '请选择不满意原因', trigger: 'change' }]"
  437. >
  438. <el-select
  439. v-model="item.orgNoSatisfiedReason"
  440. placeholder="请选择不满意原因"
  441. class="w100"
  442. value-key="dicDataValue"
  443. multiple
  444. collapse-tags
  445. collapse-tags-tooltip
  446. @change="selectReason($event, index)"
  447. clearable
  448. >
  449. <el-option v-for="items in dissatisfiedReason" :key="items.dicDataValue" :label="items.dicDataName" :value="items" />
  450. </el-select>
  451. </el-form-item>
  452. </el-col>
  453. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12" v-if="['ZiGong'].includes(themeConfig.appScope)">
  454. <el-form-item
  455. label="部门办件态度"
  456. :prop="`visitDetails.${index}.orgHandledAttitude`"
  457. :rules="[{ required: true, message: '请选择部门办件态度', trigger: 'change' }]"
  458. >
  459. <el-select
  460. v-model="item.orgHandledAttitude"
  461. placeholder="请选择部门办件态度"
  462. class="w100"
  463. value-key="dicDataValue"
  464. @change="
  465. (val:any) => {
  466. item.orgHandledAttitude.value = val.dicDataName;
  467. item.orgHandledAttitude.key = val.dicDataValue;
  468. }
  469. "
  470. >
  471. <el-option v-for="items in visitManner" :key="items.dicDataValue" :label="items.dicDataName" :value="items" />
  472. </el-select>
  473. </el-form-item>
  474. </el-col>
  475. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  476. <el-form-item
  477. label="部门回访内容"
  478. :prop="`visitDetails.${index}.visitContent`"
  479. :rules="[{ required: true, message: '请填写部门回访内容', trigger: 'blur' }]"
  480. >
  481. <common-advice
  482. @chooseAdvice="chooseAdvice($event, index)"
  483. v-model="item.visitContent"
  484. d
  485. placeholder="请填写部门回访内容"
  486. :loading="state.loading"
  487. :commonEnum="commonEnum.ReturnVisit"
  488. :minRows="5"
  489. :maxRows="10"
  490. drawerWidth="40%"
  491. />
  492. </el-form-item>
  493. </el-col>
  494. </template>
  495. </el-row>
  496. </el-col>
  497. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  498. <el-form-item label="扭转满意度" prop="orgJudge" :rules="[{ required: false, message: '请选择扭转满意度', trigger: 'change' }]">
  499. <el-checkbox v-model="state.ruleForm.orgJudge">扭转部门满意度</el-checkbox>
  500. <el-checkbox v-model="state.ruleForm.seatJudge">扭转坐席满意度</el-checkbox>
  501. </el-form-item>
  502. </el-col>
  503. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" v-if="['ZiGong'].includes(themeConfig.appScope)">
  504. <el-form-item label="历史回访记录">
  505. <div class="w100">
  506. <vxe-table
  507. border
  508. :loading="state.loading"
  509. :data="state.histories"
  510. :column-config="{ resizable: true }"
  511. :row-config="{ isCurrent: true, isHover: true, height: 30, useKey: true }"
  512. show-overflow
  513. :scrollY="{ enabled: true, gt: 100 }"
  514. max-height="300px"
  515. >
  516. <vxe-column field="voiceEvaluateTxt" title="语音评价" width="110"></vxe-column>
  517. <vxe-column field="seatEvaluateTxt" title="话务员评价" width="110"></vxe-column>
  518. <vxe-column field="visitOrgName" title="部门名称" width="140"></vxe-column>
  519. <vxe-column field="orgProcessingResultsValue" title="部门办件结果" width="110"></vxe-column>
  520. <vxe-column field="orgHandledAttitudeValue" title="部门办件态度" width="110"></vxe-column>
  521. <vxe-column field="visitContent" title="部门评价内容" width="110"></vxe-column>
  522. <vxe-column field="visitTime" title="回访时间" width="160">
  523. <template #default="{ row }">
  524. {{ formatDate(row.visitTime, 'YYYY-mm-dd HH:MM:SS') }}
  525. </template>
  526. </vxe-column>
  527. <vxe-column title="回访录音" fixed="right" width="90" align="center">
  528. <template #default="{ row }">
  529. <el-button link type="primary" @click="onPlayRecord(row)" title="回访录音" v-if="row.callId"> 回访录音 </el-button>
  530. </template>
  531. </vxe-column>
  532. </vxe-table>
  533. </div>
  534. </el-form-item>
  535. </el-col>
  536. </el-row>
  537. </template>
  538. </el-form>
  539. </div>
  540. </el-collapse-item>
  541. </el-collapse>
  542. <template #footer v-if="disabled">
  543. <span class="dialog-footer">
  544. <el-button @click="closeDialog" class="default-button">关 闭</el-button>
  545. </span>
  546. </template>
  547. <template #footer v-else>
  548. <span class="dialog-footer">
  549. <el-button @click="closeDialog" class="default-button">取 消</el-button>
  550. <template v-if="['ZiGong', 'LuZhou'].includes(themeConfig.appScope)">
  551. <el-popconfirm title="您确定将当前回访设置为未接通?" @confirm="notConnected" width="260" v-auth="'business:visit:notConnected'">
  552. <template #reference>
  553. <el-button type="primary" :loading="state.loading">设为未接通</el-button>
  554. </template>
  555. </el-popconfirm>
  556. </template>
  557. <el-button
  558. type="primary"
  559. @click="onRedo"
  560. :loading="state.loading"
  561. v-auth="'business:visit:redo'"
  562. v-if="['ZiGong', 'LuZhou'].includes(themeConfig.appScope)"
  563. >重办</el-button
  564. >
  565. <el-button type="primary" @click="onSubmit(ruleFormRef)" :loading="state.loading">保存</el-button>
  566. </span>
  567. </template>
  568. </el-dialog>
  569. <!-- 播放录音 -->
  570. <play-record ref="playRecordRef" />
  571. <!-- 回访重办 -->
  572. <visit-redo ref="visitRedoRef" @updateList="onRedoSuccess" />
  573. </template>
  574. <script setup lang="tsx" name="orderFollowUpDetail">
  575. import { computed, defineAsyncComponent, reactive, ref } from 'vue';
  576. import { ElMessage, FormInstance } from 'element-plus';
  577. import { commonEnum, getNowDateTime } from '@/utils/constants';
  578. import { storeToRefs } from 'pinia';
  579. import { useUserInfo } from '@/stores/userInfo';
  580. import { visitDetailBaseData, visitOrder, visitSetUnconnected } from '@/api/business/visit';
  581. import mittBus from '@/utils/mitt';
  582. import { callCenterOutbound } from '@/utils/callCenter';
  583. import { useThemeConfig } from '@/stores/themeConfig';
  584. import { formatDate } from '@/utils/formatTime';
  585. import { specialApplyBase } from '@/api/business/special';
  586. import { submitLog } from '@/api/public/log';
  587. import { Local, Session } from '@/utils/storage';
  588. // 引入组件
  589. const CommonAdvice = defineAsyncComponent(() => import('@/components/CommonAdvice/index.vue')); // 常用意见
  590. const PlayRecord = defineAsyncComponent(() => import('@/components/PlayRecord/index.vue')); // 播放录音
  591. const VisitRedo = defineAsyncComponent(() => import('@/views/business/visit/components/Visit-redo.vue')); // 回访重办
  592. // 定义子组件向父组件传值/事件
  593. const emit = defineEmits(['updateList']);
  594. // 定义变量内容
  595. const state = reactive<any>({
  596. collapseArr: ['1', '2', '3'], // 折叠面板
  597. dialogVisible: false, // 是否显示弹窗
  598. loading: false, // 是否显示加载
  599. transform: 'translate(0px, 0px)', // 附件弹窗位置
  600. smartRecord: null,
  601. ruleForm: {
  602. visitDetails: {},
  603. orgJudge: false, // 扭转部门满意度
  604. seatJudge: false, // 扭转坐席满意度
  605. },
  606. orderDetail: {}, // 工单详情
  607. orderVisitModel: {}, // 回访详情
  608. recordingAbsolutePath: '', // 录音文件
  609. histories: [], //回访记录列表
  610. });
  611. const ruleFormRef = ref<RefType>();
  612. const storesUserInfo = useUserInfo();
  613. const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
  614. const visitCount = ref<number>(0); // 回访次数
  615. const seatEvaluate = ref<EmptyArrayType>(); // 话务员评价
  616. const viceEvaluate = ref<EmptyArrayType>(); // 语音评价
  617. const dissatisfiedReason = ref<EmptyArrayType>(); // 不满意原因
  618. const visitManner = ref<EmptyArrayType>(); // 部门办件态度
  619. const visitSatisfaction = ref<EmptyArrayType>(); // 部门办件结果
  620. const visitId = ref<string>(''); // 回访id
  621. const dialogTitle = ref<string>('回访'); // 弹窗标题
  622. const aiVisitVoiceBaseUrl = ref(''); // 智能回访录音前缀
  623. const storesThemeConfig = useThemeConfig();
  624. const { themeConfig } = storeToRefs(storesThemeConfig);
  625. const getBaseData = async (id: string) => {
  626. state.loading = true;
  627. try {
  628. const { result } = await visitDetailBaseData(id);
  629. visitCount.value = result?.visitCount ?? 0;
  630. seatEvaluate.value = result?.seatEvaluate ?? [];
  631. viceEvaluate.value = result?.viceEvaluate ?? [];
  632. dissatisfiedReason.value = result?.dissatisfiedReason ?? [];
  633. visitManner.value = result?.visitManner ?? [];
  634. visitSatisfaction.value = result?.visitSatisfaction ?? [];
  635. visitId.value = result?.orderVisitModel?.id ?? '';
  636. state.orderDetail = result?.orderVisitModel?.order ?? {};
  637. state.orderVisitModel = result?.orderVisitModel ?? {};
  638. state.recordingAbsolutePath = result?.recordingAbsolutePath ?? '';
  639. state.smartRecord = result?.orderVisitModel.recordUrl ?? '';
  640. aiVisitVoiceBaseUrl.value = result.aiVisitVoiceBaseUrl;
  641. state.histories = result?.histories ?? []; // 回访记录列表
  642. /* if (result?.orderVisitModel?.isPutThrough !== null) {
  643. state.ruleForm.isPutThrough = !result?.orderVisitModel?.isPutThrough ?? false;
  644. } else {
  645. state.ruleForm.isPutThrough = false;
  646. }*/
  647. state.ruleForm.visitDetails = result?.orderVisitModel?.orderVisitDetails ?? {};
  648. for (let i of state.ruleForm.visitDetails) {
  649. if (i.visitTarget === 20) {
  650. if (i.orgProcessingResults) {
  651. i.orgProcessingResults = {
  652. ...i.orgProcessingResults,
  653. dicDataName: i.orgProcessingResults.value,
  654. dicDataValue: i.orgProcessingResults.key,
  655. };
  656. }
  657. if (i.orgNoSatisfiedReason) {
  658. i.orgNoSatisfiedReason = i.orgNoSatisfiedReason.map((item: any) => {
  659. return {
  660. ...item,
  661. dicDataName: item.value,
  662. dicDataValue: item.key,
  663. };
  664. });
  665. } else {
  666. i.orgNoSatisfiedReason = [];
  667. }
  668. if (i.orgHandledAttitude) {
  669. i.orgHandledAttitude = {
  670. ...i.orgHandledAttitude,
  671. dicDataName: i.orgHandledAttitude.value,
  672. dicDataValue: i.orgHandledAttitude.key,
  673. };
  674. }
  675. }
  676. }
  677. state.loading = false;
  678. } catch (error) {
  679. console.log(error);
  680. state.loading = false;
  681. }
  682. };
  683. /*const notGetThrough = ref(false);
  684. watch(
  685. () => state.ruleForm.isPutThrough,
  686. (val) => {
  687. notGetThrough.value = !val;
  688. },
  689. { immediate: true, deep: true }
  690. );*/
  691. // 判断当前工单是否是电话来源
  692. const isTelSource = computed(() => {
  693. return state.orderDetail?.sourceChannelCode === 'RGDH';
  694. });
  695. // 记录日志
  696. const submitLogFn = async (request: any) => {
  697. try {
  698. await submitLog(request);
  699. Local.remove('telNo');
  700. } catch (error) {
  701. console.log(`${getNowDateTime()}:日志记录失败,${error}`);
  702. }
  703. };
  704. // 打开弹窗
  705. const callId = ref<string>('');
  706. const openDialog = (row: any, type: string = '回访') => {
  707. const callIdSession = Session.get(row.id);
  708. if (callIdSession) callId.value = callIdSession;
  709. mittBus.on('outboundConnect', (data) => {
  710. console.log(data, '外呼已经接通辣');
  711. // 判断联系号码和消息的号码 前面加0和去0时是否是相同的
  712. if (data.callNumber === state.orderDetail.contact || data.callNumber === '0' + state.orderDetail.contact) {
  713. callId.value = data.callId;
  714. Session.set(row.id, callId.value);
  715. }
  716. const request = {
  717. creationTime: new Date(),
  718. name: `回访外呼已经接通`,
  719. remark: JSON.stringify({ ...data, visitId: row.id }),
  720. executeUrl: themeConfig.value.callCenterSocketUrl,
  721. ipUrl: row.id,
  722. };
  723. submitLogFn(request);
  724. });
  725. if (!row.id || !row) {
  726. ElMessage.warning('传入回访ID不正确');
  727. return;
  728. }
  729. state.dialogVisible = true;
  730. getBaseData(row.id);
  731. dialogTitle.value = type;
  732. };
  733. const disabled = computed(() => {
  734. return ['回访明细', '回访详情'].includes(dialogTitle.value);
  735. });
  736. // 设置抽屉
  737. const dialogRef = ref<RefType>(); // 弹窗ref
  738. const mouseup = () => {
  739. state.transform = dialogRef.value.dialogContentRef.$el.style.transform;
  740. };
  741. // 关闭弹窗
  742. const closeDialog = () => {
  743. state.dialogVisible = false;
  744. };
  745. // 查看人工回访录音文件
  746. const playRecordRef = ref<RefType>();
  747. const recordFile = () => {
  748. playRecordRef.value.playRecord(state.orderVisitModel.callId);
  749. };
  750. // 查看智能回访录音
  751. const onSmartRecord = () => {
  752. playRecordRef.value.playRecordPath(aiVisitVoiceBaseUrl.value + state.smartRecord);
  753. };
  754. // 呼叫
  755. const prefixOptions = ref<EmptyArrayType>([]);
  756. const callPhone = (phoneNumber: string) => {
  757. let finalNumber = phoneNumber;
  758. // 处理加0
  759. if (prefixOptions.value.includes('add')) {
  760. finalNumber = '0' + finalNumber;
  761. }
  762. // 处理减0
  763. if (prefixOptions.value.includes('remove')) {
  764. finalNumber = finalNumber.startsWith('0') ? finalNumber.slice(1) : finalNumber;
  765. }
  766. // 移除号码中的非数字字符
  767. finalNumber = finalNumber.replace(/\D/g, '');
  768. if (['YiBin'].includes(themeConfig.value.appScope)) {
  769. callCenterOutbound(phoneNumber);
  770. } else {
  771. callCenterOutbound(finalNumber);
  772. }
  773. };
  774. // 选择不满意原因
  775. const selectReason = (val: any, index: number | string) => {
  776. state.ruleForm.visitDetails[index].orgNoSatisfiedReason = val.map((item: any) => {
  777. return {
  778. ...item,
  779. value: item.dicDataName,
  780. key: item.dicDataValue,
  781. };
  782. });
  783. console.log(state.ruleForm.visitDetails[index].orgNoSatisfiedReason);
  784. };
  785. const close = () => {
  786. ruleFormRef.value?.clearValidate();
  787. ruleFormRef.value?.resetFields();
  788. callId.value = '';
  789. mittBus.off('outboundConnect');
  790. };
  791. // 提交
  792. const onSubmit = (formEl: FormInstance | undefined) => {
  793. if (!formEl) return;
  794. formEl.validate((valid: boolean) => {
  795. if (!valid) return;
  796. state.loading = true;
  797. let request = {
  798. ...state.ruleForm,
  799. // isPutThrough: !state.ruleForm.isPutThrough,
  800. ...state.visitDetails,
  801. id: visitId.value,
  802. };
  803. if (callId.value) {
  804. request.callId = callId.value;
  805. }
  806. visitOrder(request)
  807. .then(() => {
  808. ElMessage.success('操作成功');
  809. Session.remove(visitId.value);
  810. state.loading = false;
  811. closeDialog();
  812. emit('updateList');
  813. })
  814. .catch(() => {
  815. state.loading = false;
  816. });
  817. });
  818. };
  819. // 选中常用意见
  820. const chooseAdvice = (item: any, index: number | string) => {
  821. if (state.ruleForm.visitDetails[index].visitContent === null) {
  822. state.ruleForm.visitDetails[index].visitContent = '';
  823. }
  824. state.ruleForm.visitDetails[index].visitContent += item.content;
  825. };
  826. // 重办
  827. const visitRedoRef = ref<RefType>();
  828. const onRedo = async () => {
  829. state.loading = true;
  830. try {
  831. const { result } = await specialApplyBase(state.orderDetail.workflowId);
  832. if (result.isTerminate) {
  833. ElMessage.warning('该工单已终止,无法重办');
  834. state.loading = false;
  835. return;
  836. }
  837. visitRedoRef.value.openDialog(state.orderDetail);
  838. state.loading = false;
  839. } catch (e) {
  840. console.log(e);
  841. state.loading = false;
  842. }
  843. };
  844. // 重办成功
  845. const onRedoSuccess = () => {
  846. closeDialog();
  847. emit('updateList');
  848. };
  849. // 设为未接通
  850. const notConnected = () => {
  851. state.loading = true;
  852. visitSetUnconnected({ id: visitId.value })
  853. .then(() => {
  854. state.loading = false;
  855. ElMessage.success('设置未接通成功');
  856. closeDialog();
  857. emit('updateList');
  858. })
  859. .catch(() => {
  860. state.loading = false;
  861. });
  862. };
  863. // 回访历史播放录音
  864. const onPlayRecord = (row: any) => {
  865. playRecordRef.value.playRecord(row.callId);
  866. };
  867. defineExpose({
  868. openDialog,
  869. closeDialog,
  870. });
  871. </script>
  872. <style lang="scss" scoped>
  873. .collapse-box {
  874. .el-radio {
  875. margin-right: 10px;
  876. }
  877. :deep(.el-collapse-item__header) {
  878. background-color: var(--hotline-bg-main-color);
  879. height: 40px;
  880. border-radius: var(--el-border-radius-base);
  881. }
  882. :deep(.el-collapse-item__content) {
  883. padding-bottom: 10px !important;
  884. }
  885. .collapse-container {
  886. padding: 10px;
  887. .plug-container {
  888. border: var(--el-border);
  889. border-radius: var(--el-border-radius-base);
  890. margin-bottom: 15px;
  891. &:last-child {
  892. margin-bottom: 0;
  893. }
  894. .plug-container-title {
  895. padding: 10px 15px;
  896. font-weight: bold;
  897. border-bottom: var(--el-border);
  898. font-size: var(--el-font-size-medium);
  899. }
  900. }
  901. }
  902. }
  903. </style>
  904. <style lang="scss" scoped>
  905. .demo-tabs-form {
  906. .title {
  907. font-size: var(--el-font-size-medium);
  908. padding: 10px 15px 20px 15px;
  909. }
  910. }
  911. .checkbox {
  912. :deep(.el-checkbox) {
  913. margin-right: 5px;
  914. }
  915. }
  916. </style>
  917. <style lang="scss">
  918. .visit_dialog_no_modal {
  919. pointer-events: auto;
  920. margin: 0 !important;
  921. position: absolute;
  922. bottom: 5vh;
  923. left: 25%;
  924. }
  925. </style>