index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <zj-page-container>
  3. <zj-page-fill class="neibuview">
  4. <zj-form-container>
  5. <zj-form-module title="通话记录">
  6. <zj-table
  7. :columns="evaluationColumns"
  8. :table-data="evaluationData"
  9. :table-attributes="{
  10. border: true
  11. }"
  12. />
  13. </zj-form-module>
  14. </zj-form-container>
  15. </zj-page-fill>
  16. </zj-page-container>
  17. </template>
  18. <script>
  19. import { unCallListOrder } from '@/api/cloudCall.js'
  20. import { tableDataParsing } from '@/utils/common.js'
  21. export default {
  22. props: {
  23. id: {
  24. type: [String, Number],
  25. default: null
  26. }
  27. },
  28. data() {
  29. return {
  30. evaluationData: [],
  31. evaluationColumns: []
  32. }
  33. },
  34. mounted() {
  35. this.getOrderQualityLis2()
  36. },
  37. methods: {
  38. getOrderQualityLis2() {
  39. unCallListOrder({
  40. pageNum: 1,
  41. pageSize: -1,
  42. params: [{ param: 'a.order_base_id', compare: 'like', value: this.id }]
  43. }).then(res => {
  44. this.evaluationColumns = tableDataParsing(
  45. res.fieldBeans.filter(item => !~['orderFlags', 'orderType'].indexOf(item.jname))
  46. ).map(item => {
  47. if (item.columnAttributes.prop == 'fileUrl') {
  48. item.columnAttributes['min-width'] = 360
  49. item.render = (h, { row, index, column }) => {
  50. return (
  51. <div style="padding:0 6px;cursor: pointer;">
  52. {row.fileUrl ? (
  53. <div style="margin:13px 0 0 0">
  54. <audio controls>
  55. <source src={row.fileUrl} type="audio/ogg" contentEditable="true" />
  56. <source src={row.fileUrl} type="audio/mpeg" contentEditable="true" />
  57. </audio>
  58. </div>
  59. ) : null}
  60. </div>
  61. )
  62. }
  63. }
  64. return item
  65. })
  66. this.$nextTick(() => {
  67. this.evaluationData = res.data.records.map(item => {
  68. Object.keys(item).map(key => {
  69. var val = JSON.parse(res?.fieldBeans?.find(val => val.jname == key)?.enumMap || '{}')[item[key]]
  70. if (val) item[key] = val
  71. })
  72. return item
  73. })
  74. })
  75. })
  76. }
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .neibuview {
  82. box-sizing: border-box;
  83. padding-left: 16px;
  84. ::v-deep & > .zj-page-fill-scroll {
  85. box-sizing: border-box;
  86. padding-right: 16px;
  87. & > div:nth-child(1) {
  88. margin-top: 20px;
  89. }
  90. }
  91. }
  92. </style>