index.vue 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view class="handlecase">
  3. <!-- <view class="" v-if="sysType == 2">
  4. <button type="primary" @tap="newlyAddedCases" v-if="checkPermi(['caseManagement:list:add'])">新增案件</button>
  5. </view> -->
  6. <List class="caseList" @pDeleteCase='deleteCase' v-for="(item,index) in caseList" :defalutVal='item'
  7. :buttonList='buttonList' :key="index" :sysType='sysType'>
  8. </List>
  9. <view class="emptyBox" v-if="caseList.length == 0">
  10. <luanqing-empty :show="true" textColor="#000"></luanqing-empty>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import List from './component/list.vue'
  16. import {
  17. respondentList,
  18. caseApplicationTj,
  19. queryCaseFlowInfo
  20. } from '../../api/handlecase/index.js'
  21. import LuanqingEmpty from "@/components/luanqing-empty.vue"
  22. export default {
  23. components: {
  24. List,
  25. 'luanqing-empty': LuanqingEmpty,
  26. },
  27. data() {
  28. return {
  29. caseList: [],
  30. pageNum: 1,
  31. pageSize: 50,
  32. sysType: null,
  33. total: null,
  34. buttonList: []
  35. }
  36. },
  37. methods: {
  38. /**查询按钮列表 */
  39. getButtonList() {
  40. queryCaseFlowInfo({
  41. pageNum: 1,
  42. pageSize: 100000
  43. }).then(res => {
  44. res.rows.forEach(item => {
  45. if (item.id != 11 && item.id != 17) {
  46. this.buttonList.push(item)
  47. }
  48. });
  49. })
  50. },
  51. getList(parms) {
  52. console.log(111)
  53. this.caseList = [];
  54. if (this.sysType == 1) {
  55. respondentList(parms).then(res => {
  56. // this.caseList = res.rows;
  57. if (res.data) {
  58. this.caseList = [...this.caseList, ...res.data];
  59. } else {
  60. this.caseList = []
  61. }
  62. })
  63. } else if (this.sysType == 2) {
  64. parms.miniProgressFlag = 1;
  65. caseApplicationTj(parms).then(res => {
  66. this.total = res.total;
  67. if (res.rows) {
  68. this.caseList = [...this.caseList, ...res.rows];
  69. } else {
  70. this.caseList = []
  71. }
  72. })
  73. }
  74. },
  75. // 新增案件
  76. newlyAddedCases() {
  77. uni.navigateTo({
  78. url: `/pages/handlecase/component/newlyAddedCase?title=新增案件`
  79. })
  80. },
  81. // 触底
  82. onReachBottom() {
  83. if (this.caseList.length < 1) {
  84. return
  85. } else if (this.total == this.caseList.length) {
  86. uni.showToast({
  87. title: '没有数据啦',
  88. icon: 'none',
  89. duration: 1000
  90. })
  91. return
  92. } else if (this.caseList.length < 10) {
  93. uni.showToast({
  94. title: '没有数据啦',
  95. icon: 'none',
  96. duration: 1000
  97. })
  98. return
  99. }
  100. this.pageNum++;
  101. let obj = {};
  102. if (this.sysType == 1) {
  103. obj = {
  104. pageNum: this.pageNum,
  105. pageSize: this.pageSize,
  106. caseStatus: 4
  107. }
  108. } else if (this.sysType == 2) {
  109. obj = {
  110. pageNum: this.pageNum,
  111. pageSize: this.pageSize,
  112. }
  113. }
  114. this.getList(obj)
  115. },
  116. },
  117. onShow() {
  118. this.buttonList = []
  119. this.sysType = uni.getStorageSync('sysType');
  120. let obj = {}
  121. if (this.sysType == 1) {
  122. obj = {
  123. pageNum: this.pageNum,
  124. pageSize: this.pageSize,
  125. caseStatus: 4
  126. }
  127. } else if (this.sysType == 2) {
  128. obj = {
  129. pageNum: this.pageNum,
  130. pageSize: this.pageSize,
  131. caseFlowId:this.caseFlowId
  132. }
  133. this.getButtonList();
  134. }
  135. this.getList(obj)
  136. // this.getButtonList()
  137. },
  138. onLoad(data) {
  139. this.caseFlowId = data.caseFlowId
  140. // let obj = {
  141. // pageNum: this.pageNum,
  142. // pageSize: this.pageSize,
  143. // caseStatus:4
  144. // }
  145. // this.getList(obj)
  146. },
  147. onUnload(){
  148. uni.reLaunch({
  149. url: '/pages/work/index'
  150. })
  151. }
  152. }
  153. </script>
  154. <style lang="scss">
  155. .handlecase {
  156. .caseList {
  157. // height: 360rpx;
  158. // background-color: #ffffff;
  159. // border-radius: 30rpx;
  160. // margin-top: 20rpx;
  161. }
  162. }
  163. </style>