list.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view>
  3. <uni-card>
  4. <uni-search-bar :radius="100" @confirm="search" placeholder="请输入身份证号或手机号搜索" v-model="form.lrZjhm"></uni-search-bar>
  5. <uni-list>
  6. <uni-swipe-action>
  7. <!-- 刷脸激活:['0','3','4','6','9'];无刷脸激活:['1','2','5','7','8']-->
  8. <uni-swipe-action-item v-for="(item,index) in dataList" :key="index" :right-options="options"
  9. :disabled="['1','2','5','7','8'].includes(item.lzzt)||isShow" @click="swipeClick(item.id)">
  10. <uni-list-item :to="'/pages/lr/info?id='+ item.id" :title="item.lrXm"
  11. :thumb="item.lrTx ? config.baseUrl+item.lrTx : config.baseUrl+config.head" :note="item.lrCydh" thumbSize="lg" :showArrow="false">
  12. <template v-slot:footer>
  13. <view v-if="item.lzzt == '0'" class="item-right">
  14. <text v-if="item.jssj">{{item.jssj.substring(0,8) }}</text>
  15. <text v-else>{{item.createTime.substring(0,8) }}</text>
  16. <image class="item-img" src="@/static/images/caogao.png" mode=""></image>
  17. <!-- <text>{{item.lrSpyj || '无'}}</text> -->
  18. </view>
  19. <view v-else-if="['1','2','5','7','8'].includes(item.lzzt)" class="item-right">
  20. <text v-if="item.jssj">{{item.jssj.substring(0,8) }}</text>
  21. <text v-else>{{item.createTime.substring(0,8) }}</text>
  22. <image class="item-img" src="@/static/images/daishenhe.png" mode=""></image>
  23. </view>
  24. <view v-else-if="item.lzzt == '3'" class="item-right">
  25. <text v-if="item.jssj">{{item.jssj.substring(0,8) }}</text>
  26. <text v-else>{{item.createTime.substring(0,8) }}</text>
  27. <image class="item-img" src="@/static/images/tongguo.png" mode=""></image>
  28. </view>
  29. <view v-else-if="item.lzzt == '4' || item.lzzt == '9'" class="item-right">
  30. <text v-if="item.jssj">{{item.jssj.substring(0,8) }}</text>
  31. <text v-else>{{item.createTime.substring(0,8) }}</text>
  32. <image class="item-img" src="@/static/images/jujue.png" mode=""></image>
  33. </view>
  34. </template>
  35. </uni-list-item>
  36. </uni-swipe-action-item>
  37. </uni-swipe-action>
  38. </uni-list>
  39. <uni-load-more status="status" @clickLoadMore="clickLoadMore"></uni-load-more>
  40. </uni-card>
  41. </view>
  42. </template>
  43. <script>
  44. import {
  45. getToken,
  46. getUser
  47. } from '@/common/auth.js'
  48. import { ListKhjbxx, GetUrl, CheckReturn } from '@/api/kh.js'
  49. import {
  50. decryptRowData_ECB
  51. } from '@/common/sm4.js'
  52. export default {
  53. components: {},
  54. data() {
  55. return {
  56. status: 'more',
  57. isShow:false,
  58. form: {
  59. pageNum: 1,
  60. pageSize: 8,
  61. },
  62. dataList: [],
  63. options: [
  64. {
  65. text: '刷脸激活',
  66. style: {
  67. backgroundColor: '#28d87d'
  68. }
  69. }
  70. ],
  71. total: 0,
  72. }
  73. },
  74. onLoad: function(options) {
  75. if (options.id) {
  76. this.form.pageNum = 1
  77. this.form.pageSize = 8
  78. this.form.id = options.id
  79. }
  80. this.userInfo = getUser()
  81. console.log(this.userInfo,'<----this.userInfo');
  82. if (['04', '07'].includes(this.userInfo.userType)) {
  83. this.form.createUserId = this.userInfo.userId
  84. }
  85. if(['04'].includes(this.userInfo.userType)&&this.userInfo.lrzptype)
  86. {
  87. if(this.userInfo.lrzptype=='1')
  88. {
  89. this.isShow=true;
  90. }
  91. }
  92. this.getList()
  93. },
  94. onPullDownRefresh() {
  95. this.dataList = []
  96. this.form.pageNum = 1
  97. this.form.pageSize = 10
  98. if (this.userInfo.userType != '07') {
  99. this.form.id = null
  100. } else {
  101. this.form.id = this.userInfo.userId
  102. }
  103. this.getList()
  104. },
  105. onReachBottom() {
  106. if (this.dataList.length < this.total) {
  107. this.form.pageNum += 1
  108. this.getList()
  109. }
  110. },
  111. methods: {
  112. swipeClick(id) {
  113. let param = {
  114. id: id,
  115. url: this.config.redirectUrl + id,
  116. }
  117. uni.showLoading({
  118. title: '加载中...',
  119. mask: true,
  120. })
  121. GetUrl(param).then(res => {
  122. uni.hideLoading();
  123. if (res.code == 200) {
  124. window.open(res.data.url, '_self');
  125. } else {
  126. toast('该功能暂未开放')
  127. // uni.navigateBack()
  128. }
  129. })
  130. },
  131. search() {
  132. this.dataList = []
  133. this.form.pageNum = 1
  134. this.form.pageSize = 10
  135. this.getList()
  136. },
  137. clickLoadMore(e) {
  138. this.status = 'loading'
  139. if (this.dataList.length < this.total) {
  140. this.form.pageNum += 1
  141. this.getList()
  142. } else {
  143. this.status = 'no-more'
  144. }
  145. },
  146. getList() {
  147. console.log(this.form);
  148. console.log(this.userInfo.userType,'this.userInfo.userType');
  149. console.log(this.userInfo.lrzptype,'this.userInfo.lrzptype');
  150. console.log(this.userInfo,'this.userInfo');
  151. let parm={}
  152. // 当前为员工并且lrzptype为可以录入照片且输入身份证号时 才传mchnt
  153. if(['04'].includes(this.userInfo.userType)&&this.userInfo.lrzptype&&this.userInfo.lrzptype!='2'&&this.form.lrZjhm)
  154. {
  155. parm={
  156. ...this.form,createUserId:'',mchnt:this.userInfo.mchnt
  157. }
  158. }else{
  159. parm={
  160. ...this.form,createUserId:this.form.lrZjhm?'':this.form.createUserId,
  161. }
  162. }
  163. ListKhjbxx(parm).then(res => {
  164. if (res.code == 200) {
  165. this.total = res.total
  166. let list = decryptRowData_ECB(res.rows, ["lrZjhm", "lrXm", "lrHjbcxx", "lrXjdzBcxx",
  167. "lrCydh", "lrPoxm", "lrPoZjmh", "jhrXm", "jhrSjhm", "zlrXm", "zlrDh", "cjzh",
  168. "yhzh", "khmc"
  169. ], [2, 1, 4, 4, 3, 1, 2, 1, 2, 1, 3, 5, 5, 5])
  170. this.dataList.push(...list)
  171. uni.stopPullDownRefresh();
  172. if (this.dataList.length < this.total) {
  173. this.status = 'more'
  174. } else if (this.dataList.length == this.total) {
  175. this.status = 'no-more'
  176. }
  177. }
  178. })
  179. }
  180. },
  181. watch: {},
  182. }
  183. </script>
  184. <style lang="scss" scoped>
  185. .item-right {
  186. width: 60px;
  187. display: flex;
  188. flex-direction: column;
  189. background-position: left;
  190. background-size: 58px 58px;
  191. background-repeat: no-repeat;
  192. position: relative;
  193. font-size: 14px;
  194. .item-img {
  195. position: absolute;
  196. right: -5px;
  197. bottom: -10px;
  198. height: 40px;
  199. width: 40px;
  200. }
  201. }
  202. </style>