移动端
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

arbitrationProcessList.vue 5.7 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <div>
  3. <van-nav-bar
  4. left-arrow
  5. title="纠纷处理"
  6. fixed
  7. placeholder
  8. @click-left="$router.back()"
  9. >
  10. <template #right>
  11. <van-icon name="add" size="20" @click="addArbitrationProcess" v-if="allowCUD"/>
  12. </template>
  13. </van-nav-bar>
  14. <van-pull-refresh v-model="refreshing" @refresh="getList()">
  15. <van-list
  16. v-model="loading"
  17. :finished="finished"
  18. :immediate-check="false"
  19. finished-text="没有更多了"
  20. @load="getList('+1')"
  21. >
  22. <van-swipe-cell v-for="(item,index) in list" :key="index" class="delegate">
  23. <van-cell :title="item.disputes" center @click="viewItem(item)">
  24. <template #label>
  25. <p style="font-weight: bold;">{{item.handleTime}}</p>
  26. </template>
  27. <template #title>
  28. <p style="font-weight: bold;">{{item.handlerName}}</p>
  29. </template>
  30. <template #right-icon>
  31. <p :style="{'font-weight': 'bold',
  32. color: {
  33. '1': '#00FF00',
  34. '2': '#FF0000',
  35. }[item.handlerType],
  36. }">{{formatDict(options.handler_type, item.handlerType)}}</p>
  37. </template>
  38. </van-cell>
  39. <template #right>
  40. <van-row style="height: 100%;">
  41. <van-col style="height: 100%;">
  42. <van-button square text="编辑" type="info" style="height: 100%;" @click="editItem(item)" v-if="allowCUD"/>
  43. </van-col>
  44. <van-col style="height: 100%;">
  45. <van-button square text="删除" type="danger" style="height: 100%;" @click="removeItem(item)" v-if="allowCUD"/>
  46. </van-col>
  47. </van-row>
  48. </template>
  49. </van-swipe-cell>
  50. </van-list>
  51. </van-pull-refresh>
  52. <!-- <onlineHomeIndex :current="1"></onlineHomeIndex>-->
  53. </div>
  54. </template>
  55. <script>
  56. import {getArbitrationProcessList, removeArbitrationProcess} from "@/api/onlineHome/homestead/arbitration";
  57. import FieldSelect from "@/components/form/FieldSelect";
  58. import { formatDate } from "element-ui/src/utils/date-util.js"
  59. import {Dialog, ImagePreview, Notify} from 'vant';
  60. import onlineHomeIndex from "@/views/onlineHomeIndex";
  61. import FieldDatePicker from "@/components/form/FieldDatePicker";
  62. export default {
  63. components: {FieldSelect, onlineHomeIndex, FieldDatePicker},
  64. name: "ArbitrationProcessList",
  65. data() {
  66. return {
  67. list: [],
  68. total: 0,
  69. queryParams: {
  70. arbitrationId: null,
  71. pageNum: 1,
  72. pageSize: 10,
  73. orderByColumn: 'createTime',
  74. isAsc: 'desc',
  75. },
  76. refreshing: false,
  77. loading: false,
  78. finished: false,
  79. options: {
  80. handler_type: [],
  81. },
  82. }
  83. },
  84. created() {
  85. this.initOptions();
  86. this.getList();
  87. },
  88. computed: {
  89. allowCUD: function () {
  90. return this.$store.getters.businessLevel == '2' || true;
  91. },
  92. },
  93. methods: {
  94. getList(target) {
  95. let type = typeof (target);
  96. console.log(type, target);
  97. if (target === 0) {
  98. this.refreshing = true;
  99. this.finished = true;
  100. this.total = 0;
  101. this.queryParams.pageNum = 1;
  102. this.list = [];
  103. this.filterVisible = false;
  104. }
  105. else if (type === 'number')
  106. this.queryParams.pageNum = target;
  107. else if (type === 'string') {
  108. this.queryParams.pageNum = eval(this.queryParams.pageNum + target)
  109. }
  110. else
  111. {
  112. this.refreshing = true;
  113. this.finished = true;
  114. this.total = 0;
  115. this.queryParams.pageNum = 1;
  116. this.list = []
  117. }
  118. getArbitrationProcessList(this.queryParams).then((response) => {
  119. console.log(response)
  120. if (response.rows.length === 0) {
  121. this.finished = true;
  122. return;
  123. }
  124. response.rows.forEach((e) => {
  125. this.list.push(e);
  126. });
  127. this.total += response.rows.length;
  128. this.finished = this.total >= response.total;
  129. }).catch(() => {
  130. this.finished = true;
  131. }).finally(() => {
  132. this.loading = false;
  133. this.refreshing = false;
  134. });
  135. },
  136. viewItem(item) {
  137. this.$router.push({name:'arbitrationProcessDetail', query: {
  138. type: 'view',
  139. id: item.id,
  140. }});
  141. },
  142. editItem(item) {
  143. this.$router.push({name:'arbitrationProcessDetail', query: {
  144. type: 'modify',
  145. id: item.id,
  146. }});
  147. },
  148. removeItem(item) {
  149. Dialog.confirm({
  150. title: '警告',
  151. message: '确定删除?',
  152. })
  153. .then(() => {
  154. removeArbitrationProcess(item.id).then((response) => {
  155. this.notify("删除成功", 'success');
  156. this.getList();
  157. }).catch((e) => {
  158. this.notify("删除失败!", 'danger');
  159. }).finally(() => {
  160. });
  161. })
  162. .catch(() => {
  163. });
  164. },
  165. notify(message, type) {
  166. Notify.clear();
  167. Notify({ type: type || 'primary', message: message });
  168. },
  169. initOptions() {
  170. this.queryParams.arbitrationId = this.$route.query.arbitrationId;
  171. for(let k in this.options)
  172. {
  173. this.houseGetDicts(k).then((res) => {
  174. this.options[k] = res.data;
  175. });
  176. }
  177. },
  178. formatDict(dict, value) {
  179. return this.selectDictLabel(dict, value);
  180. },
  181. addArbitrationProcess() {
  182. this.$router.push({name:'arbitrationProcessDetail', query: {
  183. arbitrationId: this.queryParams.arbitrationId,
  184. }});
  185. },
  186. },
  187. }
  188. </script>
  189. <style scoped>
  190. .delegate {
  191. width: 96%;
  192. margin: 3% 2% 3% 2%;
  193. border-radius: 0.18rem;
  194. overflow: hidden;
  195. box-shadow: 0.1rem 0.1rem 0.15rem 0.02rem rgba(0,0,0,0.16);
  196. }
  197. </style>