news.vue 8.5 KB

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