news.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <basic-container>
  3. <el-menu
  4. :default-active="activeIndex"
  5. mode="horizontal"
  6. @select="handleSelect"
  7. >
  8. <el-menu-item index="1">我的消息</el-menu-item>
  9. <el-menu-item index="2">所有消息</el-menu-item>
  10. </el-menu>
  11. <avue-crud
  12. :data="data"
  13. :option="option"
  14. :table-loading="showLoading"
  15. :page.sync="page"
  16. :permission="permissionList"
  17. @size-change="sizeChange"
  18. @current-change="currentChange"
  19. >
  20. <template
  21. slot="imageUrl"
  22. slot-scope="scope"
  23. >
  24. <el-button
  25. v-if="scope.row.imageUrl.length>0"
  26. size="small"
  27. @click="openPreview(scope.row.imageUrl,scope.$index)"
  28. >图片</el-button>
  29. </template>
  30. <!-- 提交进度 -->
  31. <template
  32. slot="cz"
  33. slot-scope="scope"
  34. >
  35. <el-button
  36. size="small"
  37. @click="changeProgres(scope.row)"
  38. >提交进度</el-button>
  39. </template>
  40. <!-- 处理状态 -->
  41. <template
  42. slot="isCurrent"
  43. slot-scope="scope"
  44. >
  45. <div class="icon-font">
  46. <i
  47. class="el-icon-success text-success"
  48. v-if="scope.row.isCurrent"
  49. ></i>
  50. <i
  51. class="el-icon-warning text-warning"
  52. v-if="!scope.row.isCurrent"
  53. ></i>
  54. </div>
  55. </template>
  56. </avue-crud>
  57. <el-dialog
  58. :visible.sync="dialogVisible"
  59. width="600px"
  60. append-to-body
  61. :close-on-click-modal="false"
  62. >
  63. <div class="flex jc-al-c">
  64. <span class="mg-r-20 titl-font">提交进度</span>
  65. <el-select
  66. v-model="curRow.currentLinkId"
  67. placeholder="请选择"
  68. >
  69. <el-option
  70. label="已解决"
  71. :value="3"
  72. ></el-option>
  73. <el-option
  74. label="进入人工预处理环境"
  75. :value="2"
  76. ></el-option>
  77. </el-select>
  78. </div>
  79. <span
  80. slot="footer"
  81. class="dialog-footer"
  82. >
  83. <el-button @click="dialogVisible = false">取 消</el-button>
  84. <el-button
  85. type="primary"
  86. @click="SubmissionProgress"
  87. >确 定</el-button>
  88. </span>
  89. </el-dialog>
  90. </basic-container>
  91. </template>
  92. <script>
  93. import { queryBusinessUserOpinionList, manageUserOperationStatus, queryBusinessUserOpinionListAll } from "@/api/news/news.js";
  94. import { mapGetters } from "vuex";
  95. export default {
  96. data () {
  97. return {
  98. activeIndex: "1",
  99. curRow: {},
  100. dialogVisible: false,
  101. page: {
  102. total: 1,
  103. currentPage: 1,
  104. pageSize: 10
  105. },
  106. showLoading: false,
  107. data: [],
  108. option: {
  109. border: true,
  110. align: 'center',
  111. menuAlign: 'center',
  112. menu: false,
  113. column: [
  114. {
  115. label: '时间',
  116. prop: 'createTime',
  117. },
  118. {
  119. label: '剩余反馈用户时间(分钟)',
  120. prop: 'timeRemaining'
  121. },
  122. {
  123. label: '项目',
  124. prop: 'projectName',
  125. },
  126. {
  127. label: '合同段',
  128. prop: 'contractName',
  129. },
  130. {
  131. label: '消息类型',
  132. prop: 'problemType',
  133. },
  134. {
  135. label: '问题描述',
  136. prop: 'opinionContent',
  137. },
  138. {
  139. label: '图片',
  140. prop: 'imageUrl',
  141. slot: true,
  142. },
  143. {
  144. label: '操作',
  145. prop: 'cz',
  146. slot: true,
  147. },
  148. {
  149. label: '处理状态',
  150. prop: 'isCurrent',
  151. slot: true,
  152. },
  153. ]
  154. }
  155. };
  156. },
  157. computed: {
  158. ...mapGetters(["userInfo"]),
  159. permissionList () {
  160. return {
  161. addBtn: false,
  162. viewBtn: false,
  163. delBtn: false,
  164. editBtn: false
  165. };
  166. },
  167. },
  168. created () {
  169. this.init();
  170. //console.log(this.userInfo)
  171. },
  172. methods: {
  173. init () {
  174. this.queryBusinessUserOpinionList()
  175. },
  176. openPreview (imageUrl, index) {
  177. let imageUrls = []
  178. imageUrl.forEach(val => {
  179. imageUrls.push({ url: val })
  180. });
  181. this.$ImagePreview(imageUrls, index, {
  182. closeOnClickModal: true,
  183. // beforeClose:()=>{
  184. // this.$message.success('关闭回调')
  185. // }
  186. });
  187. },
  188. changeProgres (row) {
  189. this.curRow = { ...row }
  190. this.dialogVisible = true;
  191. },
  192. handleSelect (key) {//消息分类菜单激活回调
  193. this.activeIndex = key
  194. },
  195. async SubmissionProgress () {//提交进度弹框保存按钮事件
  196. await this.manageUserOperationStatus({
  197. currentLinkId: this.curRow.currentLinkId,
  198. newNumber: this.curRow.newNumber,
  199. userOpinionId: this.curRow.userOpinionId
  200. })
  201. },
  202. //#region 分页
  203. currentChange (val) {
  204. this.page.currentPage = val
  205. if (this.activeIndex == 1) {
  206. this.queryBusinessUserOpinionList()
  207. } else {
  208. this.queryBusinessUserOpinionListAll()
  209. }
  210. },
  211. sizeChange (val) {
  212. this.page.pageSize = val
  213. if (this.activeIndex == 1) {
  214. this.queryBusinessUserOpinionList()
  215. } else {
  216. this.queryBusinessUserOpinionListAll()
  217. }
  218. },
  219. async queryBusinessUserOpinionList () {//获取分配给当前登录用户的工单记录
  220. const { data: res } = await queryBusinessUserOpinionList({
  221. current: this.page.currentPage,
  222. size: this.page.pageSize
  223. })
  224. console.log(res);
  225. if (res.code == 200) {
  226. this.data = res.data.records
  227. this.page.total = res.data.total
  228. }
  229. },
  230. async manageUserOperationStatus (da) {//业务人员提交环节操作
  231. const { data: res } = await manageUserOperationStatus(da)
  232. console.log(res);
  233. if (res.code == 200) {
  234. this.dialogVisible = false
  235. }
  236. },
  237. async queryBusinessUserOpinionListAll () {//所有工单处理列表
  238. const { data: res } = await queryBusinessUserOpinionListAll({
  239. current: this.page.currentPage,
  240. size: this.page.pageSize
  241. })
  242. console.log(res);
  243. if (res.code == 200) {
  244. this.data = res.data.records
  245. this.page.total = res.data.total
  246. }
  247. }
  248. //#endregion
  249. },
  250. watch: {
  251. 'activeIndex' (value) {
  252. this.page.currentPage = 1
  253. this.page.pageSize = 10
  254. if (value == 1) {
  255. this.queryBusinessUserOpinionList()
  256. } else {
  257. this.queryBusinessUserOpinionListAll()
  258. }
  259. }
  260. }
  261. };
  262. </script>
  263. <style scoped lang="scss">
  264. .icon-font[class^="icon-"] {
  265. font-size: 26px !important;
  266. }
  267. .titl-font {
  268. font-size: 32px;
  269. }
  270. </style>