news.vue 7.6 KB

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