communicationList.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view>
  3. <cu-custom bgColor="bg-luohu" :isBack="true">
  4. <block slot="backText">返回</block>
  5. <block slot="content">沟通列表</block>
  6. <block slot="right">
  7. <view @click="getGo('')">添加</view>
  8. </block>
  9. </cu-custom>
  10. <view class="cu-bar bg-white search fixed" :style="[{top:CustomBar + 'px'}]">
  11. <view class="search-form round">
  12. <text class="cuIcon-search"></text>
  13. <input type="text" v-model="keyword" placeholder="输入搜索的关键词" confirm-type="search"
  14. @confirm="search"></input>
  15. </view>
  16. <view class="action">
  17. <button class="cu-btn bg-gradual-blue shadow-blur round" @tap="search">搜索</button>
  18. </view>
  19. </view>
  20. <block v-if="list.length > 0">
  21. <view v-for="(item,index) in list" :key="index" style="margin: 10rpx 20rpx;position: relative;"
  22. :style="[{top:'calc('+ CustomBar + 'px + 20rpx)'}]">
  23. <uni-section :title="'表单编号:'+item.biao_dan_bian_hao" type="line" padding>
  24. <view class="sectionBox">
  25. <view class="left">联系人:</view>
  26. <view>{{item.ke_hu_lian_xi_ren}} </view>
  27. </view>
  28. <view class="sectionBox">
  29. <view class="left">委托单号:</view>
  30. <view>{{item.weiTuoBianHao}} </view>
  31. </view>
  32. <view class="sectionBox">
  33. <view class="left">编制日期:</view>
  34. <view>{{item.bian_zhi_shi_jian}} </view>
  35. </view>
  36. <view class="sectionBox">
  37. <view class="left">状态:</view>
  38. <view>{{item.shi_fou_guo_shen_ == '1' ? '已完成' : item.shi_fou_guo_shen_}} </view>
  39. </view>
  40. <view style=" width: 100%; text-align: right; padding-top: 5rpx;padding-bottom: 0rpx;"
  41. v-if="item.chu_li_jie_guo_sh == '已通知' && item.shi_fou_guo_shen_ == '已反馈'">
  42. <u-button type="warning" size="mini" @click="getGo(item.id_)">签名</u-button>
  43. </view>
  44. <view style=" width: 100%; text-align: right; padding-top: 5rpx;padding-bottom: 0rpx;">
  45. <u-button type="warning" size="mini" class="btn-back-color" @click="getGo(item.id_)">查阅
  46. </u-button>
  47. </view>
  48. </uni-section>
  49. </view>
  50. </block>
  51. </view>
  52. </template>
  53. <script>
  54. import {
  55. ACCESS_TOKEN,
  56. USER_NAME,
  57. USER_INFO
  58. } from "@/common/util/constants" // 拉取登录token,userName,userInfo
  59. export default {
  60. data() {
  61. return {
  62. CustomBar: this.CustomBar,
  63. keyword: '',
  64. list: [],
  65. current: 0
  66. }
  67. },
  68. // 下拉刷新
  69. onPullDownRefresh() {
  70. this.getInit()
  71. },
  72. // 上拉加载
  73. onReachBottom() {
  74. let _self = this
  75. uni.showNavigationBarLoading()
  76. if (this.ReachBottomShow) {
  77. this.getData()
  78. }
  79. },
  80. created() {
  81. this.getInit()
  82. },
  83. methods: {
  84. getInit() {
  85. this.current = 0
  86. this.list = []
  87. this.getData(this.keyword)
  88. },
  89. /**
  90. * 模糊查询
  91. */
  92. search() {
  93. this.current = 0
  94. this.resdata = []
  95. this.getData(this.keyword)
  96. },
  97. //获取列表数据
  98. getData(keyword) {
  99. uni.showLoading({
  100. mask: true,
  101. title: 'loading'
  102. });
  103. let info = uni.getStorageSync(USER_INFO);
  104. let useId = info.user.id
  105. var page = 0
  106. if (this.current == 0) {
  107. page = 0
  108. } else {
  109. page = this.current * 10
  110. }
  111. let sql =
  112. `select a.*,b.wei_tuo_bian_hao_ as weiTuoBianHao from t_khgtjlb a left join t_lhwtsqb b on a.wei_tuo_dan_hao_ = b.id_ where a.ke_hu_dan_wei_min = '${useId}' and biao_dan_bian_hao like'%${keyword}%' ORDER BY a.create_time_ desc LIMIT ${page},10`
  113. let requestData = this.$sig(sql)
  114. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  115. if (res.data.state == 200) {
  116. const data = res.data.variables.data
  117. this.list.push(...data)
  118. uni.stopPullDownRefresh();
  119. if (data.length > 10) {
  120. this.ReachBottomShow = false
  121. } else {
  122. this.current++
  123. }
  124. uni.hideLoading()
  125. }
  126. })
  127. },
  128. getGo(id) {
  129. uni.navigateTo({
  130. url: './communication?id=' + id
  131. })
  132. }
  133. }
  134. }
  135. </script>
  136. <style lang="scss" scoped>
  137. .sectionBox {
  138. display: flex;
  139. align-items: center;
  140. margin-bottom: 5rpx;
  141. .left {
  142. width: 150rpx;
  143. }
  144. }
  145. </style>