123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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.rows) {
  58. this.caseList = [...this.caseList, ...res.rows];
  59. } else {
  60. this.caseList = []
  61. }
  62. console.log(res.rows,this.caseList)
  63. })
  64. } else if (this.sysType == 2) {
  65. parms.miniProgressFlag = 1;
  66. caseApplicationTj(parms).then(res => {
  67. this.total = res.total;
  68. if (res.rows) {
  69. this.caseList = [...this.caseList, ...res.rows];
  70. } else {
  71. this.caseList = []
  72. }
  73. })
  74. }
  75. },
  76. // 新增案件
  77. newlyAddedCases() {
  78. uni.navigateTo({
  79. url: `/pages/handlecase/component/newlyAddedCase?title=新增案件`
  80. })
  81. },
  82. // 触底
  83. onReachBottom() {
  84. if (this.caseList.length < 1) {
  85. return
  86. } else if (this.total == this.caseList.length) {
  87. uni.showToast({
  88. title: '没有数据啦',
  89. icon: 'none',
  90. duration: 1000
  91. })
  92. return
  93. } else if (this.caseList.length < 10) {
  94. uni.showToast({
  95. title: '没有数据啦',
  96. icon: 'none',
  97. duration: 1000
  98. })
  99. return
  100. }
  101. this.pageNum++;
  102. let obj = {};
  103. if (this.sysType == 1) {
  104. obj = {
  105. pageNum: this.pageNum,
  106. pageSize: this.pageSize,
  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. }
  126. } else if (this.sysType == 2) {
  127. obj = {
  128. pageNum: this.pageNum,
  129. pageSize: this.pageSize,
  130. caseFlowId:this.caseFlowId
  131. }
  132. this.getButtonList();
  133. }
  134. this.getList(obj)
  135. // this.getButtonList()
  136. },
  137. onLoad(data) {
  138. this.caseFlowId = data.caseFlowId
  139. // let obj = {
  140. // pageNum: this.pageNum,
  141. // pageSize: this.pageSize,
  142. // caseStatus:4
  143. // }
  144. // this.getList(obj)
  145. },
  146. onUnload(){
  147. uni.reLaunch({
  148. url: '/pages/work/index'
  149. })
  150. }
  151. }
  152. </script>
  153. <style lang="scss">
  154. .handlecase {
  155. .caseList {
  156. // height: 360rpx;
  157. // background-color: #ffffff;
  158. // border-radius: 30rpx;
  159. // margin-top: 20rpx;
  160. }
  161. }
  162. </style>