agent-charge.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <div class="hc-agent-charge border-10">
  3. <div class="active-menus">
  4. <div class="active-item" :class="{ 'active-select': activeIndex === 1 }" @click="handleSelect(1)">
  5. <img :src="activeIndex === 1 ? frame254 : frame257" alt="">
  6. <div style="margin-top:5px;">
  7. <el-badge :value="tags1" :hidden="!tags1" class="item">
  8. <span class="font-bold">我的代办工单&nbsp; </span>
  9. </el-badge>
  10. </div>
  11. </div>
  12. <div class="triangle-bottomleft" :class="{ 'b-b-b-w': activeIndex === 1 }" />
  13. <div class="active-item" :class="{ 'active-select': activeIndex === 2 }" @click="handleSelect(2)">
  14. <img :src="activeIndex === 2 ? frame256 : frame255" alt="">
  15. <div style="margin-top:5px;">
  16. <el-badge :value="tags2" :hidden="!tags2" class="item">
  17. <span class="font-bold">所有代办工单&nbsp; </span>
  18. </el-badge>
  19. </div>
  20. </div>
  21. <div class="triangle-bottomleft" :class="{ 'b-b-b-w': activeIndex === 2 }" />
  22. </div>
  23. <div v-loading="isLoading" class="active-body border-bottom-10 relative h-[250px] bg-white p-3">
  24. <el-scrollbar>
  25. <div class="border-bottom-10">
  26. <div v-if="tableData.length <= 0">
  27. <hc-no-data tip="没有找到代办工单~" />
  28. </div>
  29. <div v-for="(item, index) in tableData" v-else :key="index" class="info-item">
  30. <div class="frame-warning">
  31. <img class="h-[14px] w-[14px]" :src="frameWarning" alt="">
  32. </div>
  33. <div class="frame-content">
  34. <span class="title-common">来自</span>
  35. <span class="title-text">{{ item.projectContract }}</span>
  36. <span class="title-common"></span>
  37. <span class="title-text">{{ item.roleUser }}</span>
  38. <span class="title-common"></span>
  39. <span v-if="item.manageUser === '您'" class="title-common"></span>
  40. <span v-else class="title-text">{{ item.manageUser }}</span>
  41. <span class="title-common">反馈</span>
  42. <span class="title-red">{{ item.title }}</span>
  43. </div>
  44. <div class="frame-time is-more">{{ item.time }}</div>
  45. <!-- v-if="(activeIndex === 2 && item.operation) || activeIndex === 1" -->
  46. <div class="frame-more">
  47. <el-dropdown>
  48. <span class="el-dropdown-link">
  49. <el-link icon="el-icon-more" :underline="false" style="transform:rotate(90deg)" />
  50. </span>
  51. <template #dropdown>
  52. <el-dropdown-menu>
  53. <el-dropdown-item @click="openPreview(item)">立即处理</el-dropdown-item>
  54. <el-dropdown-item @click="ignore(index)">忽略</el-dropdown-item>
  55. </el-dropdown-menu>
  56. </template>
  57. </el-dropdown>
  58. </div>
  59. </div>
  60. <div v-if="tableData.length === 1" class="text-align-c" style="color:#CCD0DE;line-height:200px">没有更多数据了~</div>
  61. </div>
  62. </el-scrollbar>
  63. </div>
  64. </div>
  65. </template>
  66. <script setup>
  67. import { onMounted, ref, watch } from 'vue'
  68. import frame254 from '~ass/home/Frame254.png'
  69. import frame257 from '~ass/home/Frame257.png'
  70. import frame256 from '~ass/home/Frame256.png'
  71. import frame255 from '~ass/home/Frame255.png'
  72. import frameWarning from '~ass/home/warning.png'
  73. import { getArrValue, getObjValue } from 'js-fast-way'
  74. import mainApi from '~api/home/index'
  75. const props = defineProps({
  76. active: {
  77. type: [Number, String],
  78. default: 1,
  79. },
  80. })
  81. //事件
  82. const emit = defineEmits(['load'])
  83. //工单数量
  84. const tags1 = ref(0)
  85. const tags2 = ref(0)
  86. //代办工单
  87. const activeIndex = ref(1)
  88. //工单数据
  89. const tableData = ref([])
  90. //监听数据
  91. watch(() => props.active, (active) => {
  92. activeIndex.value = active ?? 1
  93. }, { immediate: true, deep: true })
  94. //渲染完成
  95. onMounted(() => {
  96. getLoadData()
  97. })
  98. //工单类型被切换
  99. const handleSelect = (val) => {
  100. if (activeIndex.value === val) return
  101. activeIndex.value = val
  102. getLoadData(false)
  103. }
  104. //获取数据
  105. const isLoading = ref(false)
  106. const getLoadData = (first = true) => {
  107. isLoading.value = true
  108. emit('load', activeIndex.value, first, async ({ tag, data }) => {
  109. tableData.value = getArrValue(data)
  110. const { tag1, tag2 } = getObjValue(tag)
  111. tags1.value = tag1 ?? 0
  112. tags2.value = tag2 ?? 0
  113. isLoading.value = false
  114. })
  115. }
  116. //立即处理
  117. const openPreview = async (item) => {
  118. const { data } = await mainApi.queryOpinionDetails({
  119. userOpinionId : item.userOpinionId,
  120. })
  121. console.log(data)
  122. //this.curRow = row;
  123. //this.imgVisible = true;
  124. }
  125. //忽略
  126. const ignore = (val) => {
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. .hc-agent-charge {
  131. position: relative;
  132. .active-menus {
  133. flex: 1;
  134. height: 62px;
  135. display: flex;
  136. background-color: #F8F8F8;
  137. border-radius: 10px 10px 0 0;
  138. }
  139. .active-item {
  140. padding: 10px;
  141. display: flex;
  142. cursor: pointer;
  143. }
  144. .active-select {
  145. background-color: #FFFFFF;
  146. border-radius: 10px 0 0 0 ;
  147. }
  148. .triangle-bottomleft {
  149. width: 0;
  150. height: 0;
  151. border-bottom: 64px solid #F8F8F8;
  152. border-right: 30px solid transparent;
  153. }
  154. .b-b-b-w {
  155. border-bottom-color: #FFFFFF;
  156. }
  157. .active-body {
  158. overflow: hidden;
  159. }
  160. .info-item{
  161. position: relative;
  162. padding: 10px;
  163. color: #50545E;
  164. margin-bottom: 10px;
  165. background-color: #F8FAFF;
  166. border: 1px solid #EEEEEE;
  167. border-radius: 10px;
  168. .frame-warning {
  169. position: absolute;
  170. top: 0;
  171. left: 10px;
  172. bottom: 0;
  173. display: flex;
  174. align-items: center;
  175. justify-content: center;
  176. }
  177. .frame-content {
  178. position: relative;
  179. font-size: 14px;
  180. padding-left: 24px;
  181. width: calc(100% - 220px);
  182. line-height: 1.5;
  183. .title-common{
  184. color: #838791;
  185. }
  186. .title-text{
  187. color: #50545E;
  188. }
  189. .title-red{
  190. margin-left: 6px;
  191. color: #EB4D3D;
  192. }
  193. }
  194. .frame-time {
  195. position: absolute;
  196. top: 0;
  197. bottom: 0;
  198. right: 10px;
  199. color: #838791;
  200. font-size: 14px;
  201. display: flex;
  202. align-items: center;
  203. }
  204. .frame-time.is-more {
  205. margin-right: 20px;
  206. }
  207. .frame-more {
  208. position: absolute;
  209. top: 0;
  210. bottom: 0;
  211. right: 10px;
  212. display: flex;
  213. align-items: center;
  214. }
  215. }
  216. }
  217. .border-bottom-10 {
  218. border-radius: 0 0 10px 10px;
  219. }
  220. </style>
  221. <style lang="scss">
  222. .hc-agent-charge .active-body {
  223. .hc-no-data-box .no-data-c {
  224. width: 200px;
  225. }
  226. .el-scrollbar__bar.is-vertical {
  227. right: -9px;
  228. }
  229. }
  230. </style>