index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <!-- 进度查询-列表 -->
  2. <script>
  3. import Cookies from "js-cookie";
  4. import { ProblemList } from "@/api/business/as/after-sales";
  5. export default {
  6. name: "Progress",
  7. components: {
  8. ProgressDetail: () => import("./details.vue"),
  9. },
  10. data() {
  11. return {
  12. size: "mini",
  13. loading: false,
  14. title: "进度查询",
  15. imgUrl: require("../images/order.png"),
  16. dataList: [],
  17. checkedId: null,
  18. };
  19. },
  20. methods: {
  21. useBack() {
  22. this.$router.go(-1);
  23. },
  24. handleDetail(prop) {
  25. this.checkedId = prop.id;
  26. let { setVisible } = this.$refs.ProgressDetail;
  27. setVisible(true);
  28. },
  29. async getList() {
  30. try {
  31. this.loading = true;
  32. // const { id } = this.$store.state.salesUser;
  33. const userId = Cookies.get("salesId");
  34. let { code, rows } = await ProblemList({ userId });
  35. if (code === 200) {
  36. this.dataList = rows;
  37. }
  38. } catch (error) {
  39. } finally {
  40. this.loading = false;
  41. }
  42. },
  43. // 处理状态
  44. handleStatus(convert, solve) {
  45. // problemStateConvert 是否转工单 0 转工单 1 未转工单
  46. // problemStateSolve 是否解决 0 已解决 1 未解决
  47. if (convert == "0") {
  48. return solve == "0" ? "转工单-已解决" : "转工单-待解决";
  49. } else {
  50. return solve == "0" ? "已解决" : "待解决";
  51. }
  52. },
  53. },
  54. created() {
  55. this.getList();
  56. },
  57. };
  58. </script>
  59. <template>
  60. <el-card
  61. v-loading="loading"
  62. shadow="never"
  63. :body-style="{
  64. height: '100%',
  65. padding: 0,
  66. display: 'flex',
  67. 'flex-direction': 'column',
  68. 'align-items': 'center',
  69. }"
  70. >
  71. <van-sticky style="width: 100%">
  72. <van-nav-bar
  73. :title="title"
  74. left-text="返回"
  75. left-arrow
  76. @click-left="useBack"
  77. style="width: 100%"
  78. />
  79. </van-sticky>
  80. <el-row>
  81. <el-col
  82. v-for="data in dataList"
  83. :span="24"
  84. @click.native="handleDetail(data)"
  85. >
  86. <div class="mes_title">
  87. <div style="display: flex; align-items: center">
  88. <el-image
  89. style="width: 16px; height: 16px; margin-right: 12px"
  90. :src="imgUrl"
  91. fit="contain"
  92. ></el-image>
  93. <span>{{ data.problemCode }}</span>
  94. </div>
  95. <span>{{
  96. new Date(data.createTime.replace(/-/g, "/")).Format(
  97. "yyyy-MM-dd HH:mm"
  98. )
  99. }}</span>
  100. </div>
  101. <p
  102. class="van-ellipsis"
  103. style="color: #333; font-size: 14px; margin: 5px 0px"
  104. >
  105. <el-tag
  106. :size="size"
  107. style="margin-right: 8px"
  108. :type="
  109. data.processFlow[0].problemStateSolve == '0'
  110. ? 'success'
  111. : 'danger'
  112. "
  113. >{{
  114. handleStatus(
  115. data.processFlow[0].problemStateConvert,
  116. data.processFlow[0].problemStateSolve
  117. )
  118. }}</el-tag
  119. >
  120. <span>{{ data.processFlow[0].content }}</span>
  121. </p>
  122. <p class="van-ellipsis" style="margin: 0">
  123. 问题描述:{{ data.problemDescription }}
  124. </p>
  125. </el-col>
  126. </el-row>
  127. <progress-detail
  128. ref="ProgressDetail"
  129. v-model="checkedId"
  130. @refresh="getList"
  131. ></progress-detail>
  132. </el-card>
  133. </template>
  134. <style scoped lang="scss">
  135. .el-card {
  136. width: 100%;
  137. height: 100vh;
  138. overflow: hidden;
  139. background-color: #f7f7f7;
  140. }
  141. .el-row {
  142. width: 100%;
  143. height: calc(100vh - 46px);
  144. overflow-x: hidden;
  145. overflow-y: auto;
  146. padding: 16px;
  147. box-sizing: border-box;
  148. border-radius: 4px;
  149. .el-col {
  150. margin-bottom: 16px;
  151. background-color: #fff;
  152. padding: 12px;
  153. font-size: 12px;
  154. color: #9b9b9b;
  155. .mes_title {
  156. display: flex;
  157. align-items: center;
  158. justify-content: space-between;
  159. }
  160. span {
  161. align-self: center;
  162. }
  163. }
  164. }
  165. </style>