list.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view class="container">
  3. <cu-custom bgColor="bg-luohu" :isBack="true">
  4. <block slot="backText">返回</block>
  5. <block slot="content">我的样品</block>
  6. </cu-custom>
  7. <view class="cu-bar bg-white search fixed" :style="[{top:CustomBar + 'px'}]">
  8. <view class="search-form round">
  9. <text class="cuIcon-search"></text>
  10. <input type="text" v-model="keyword" placeholder="输入搜索的关键词" confirm-type="search"
  11. @confirm="search"></input>
  12. </view>
  13. <view class="action">
  14. <button class="cu-btn bg-gradual-blue shadow-blur round" @tap="search">搜索</button>
  15. </view>
  16. </view>
  17. <view v-for="(item,i) in resdata" :key="i" style="margin: 10rpx 20rpx;position: relative;"
  18. :style="[{top:'calc('+ CustomBar + 'px + 20rpx)'}]">
  19. <uni-section :title="'样品编号:'+item.yang_pin_bian_hao" :subTitle="'检测委托单号:'+item.wei_tuo_bian_hao_"
  20. type="line" padding>
  21. <view>
  22. <view>
  23. <view style="display: flex;line-height: 50rpx;">
  24. <view class="title">样品名称:</view>
  25. <view> {{item.yang_pin_ming_che}} </view>
  26. </view>
  27. <view style="display: flex;line-height: 50rpx;">
  28. <view class="title">收样时间:</view>
  29. <view> {{item.shou_yang_ri_qi_}} </view>
  30. </view>
  31. <view style="display: flex;line-height: 50rpx;">
  32. <view>验收结果:</view>
  33. <view style="color: #5E00FF;" v-if="item.yan_shou_jie_guo_"> {{item.yan_shou_jie_guo_}}
  34. </view>
  35. </view>
  36. <!-- <view>
  37. 付款单号: <view style="color: #5E00FF;">{{item.id_}}</view>
  38. </view><br> -->
  39. <view style="display: flex;line-height: 50rpx;">
  40. <view>付款状态:</view>
  41. <view v-if="item.fu_kuan_zhuang_ta=='已结清'">
  42. <view style="color: #7349ff;"> 已结清 </view>
  43. </view>
  44. <view v-else>
  45. <view style="color: #7349ff;"> 未结清 </view>
  46. </view>
  47. </view>
  48. <view style="display: flex;line-height: 50rpx;">
  49. <view>样品接收备注:</view>
  50. <view> {{item.bei_zhu_ || '无'}}</view>
  51. </view>
  52. </view>
  53. <!-- v-if="item.zhuang_tai_ && (item.zhuang_tai_ == '待运营中心审核' || item.zhuang_tai_ == '待检测中心审核' || item.zhuang_tai_ == '待财务审核' || item.zhuang_tai_ == '待样品接收')" -->
  54. <view class="btnList">
  55. <u-button class="u-m-r-15 btn-back-color" type="success" size="mini"
  56. @click="goto(item.id_,item.wei_tuo_bian_hao_)"
  57. v-if="item.wei_tuo_zhuang_ta && (item.wei_tuo_zhuang_ta == '待审核' ||item.wei_tuo_zhuang_ta == '已编制')">
  58. 样品修改</u-button>
  59. <u-button type="success" size="mini" class="m-r-15" @click="getTag(item.id_)">样品标签</u-button>
  60. <u-button type="success" size="mini" @click="goBaogao(item.yang_pin_bian_hao)">查看报告</u-button>
  61. </view>
  62. </view>
  63. </uni-section>
  64. </view>
  65. <view v-if="resdata.length==0">
  66. <uni-card is-full :is-shadow="false">
  67. <text class="">暂无数据</text>
  68. </uni-card>
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. import {
  74. ACCESS_TOKEN,
  75. USER_NAME,
  76. USER_INFO
  77. } from "@/common/util/constants" // 拉取登录token,userName,userInfo
  78. import md5 from "@/common/util/md5.js"
  79. import http from "@/common/service/http.js"
  80. export default {
  81. components: {},
  82. // 初始化
  83. data() {
  84. return {
  85. keyword: '',
  86. CustomBar: this.CustomBar,
  87. url: http.apiHosp +
  88. 'demo/reportJsp/pdfReport.jsp?rpx=%E4%B8%AD%E6%B1%87%E7%91%9E%E5%BE%B7%E6%A3%80%E6%B5%8B%E4%B8%AD%E5%BF%83/39%E6%A0%B7%E5%93%81%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/GDYR-CX11-R01A%20%E6%A3%80%E6%B5%8B%E5%A7%94%E6%89%98%E5%8D%95.rpx&id_=',
  89. resdata: [],
  90. current: 0,
  91. total: 10,
  92. pageSize: 10,
  93. ReachBottomShow: true
  94. }
  95. },
  96. // 页面加载
  97. onLoad: function() {
  98. this.getData(this.keyword)
  99. // this.getData(this.current, this.pageSize, this.total);
  100. },
  101. // 下拉刷新
  102. onPullDownRefresh() {
  103. this.current = 0
  104. this.resdata = []
  105. this.getData(this.keyword)
  106. },
  107. // 上拉加载
  108. onReachBottom() {
  109. let _self = this
  110. uni.showNavigationBarLoading()
  111. if (this.ReachBottomShow) {
  112. this.getData(this.keyword)
  113. }
  114. },
  115. methods: {
  116. /**
  117. * 模糊查询
  118. */
  119. search() {
  120. this.current = 0
  121. this.resdata = []
  122. this.getData(this.keyword)
  123. },
  124. add() {
  125. this.total += 10
  126. },
  127. reset() {
  128. this.total = 0
  129. this.current = 1
  130. },
  131. change(e) {
  132. this.getData(this.current, this.pageSize, this.total);
  133. this.current = e.current
  134. },
  135. // 拉取列表数据
  136. getData(keyworks) {
  137. uni.showLoading({
  138. mask: true,
  139. title: 'loading'
  140. });
  141. let info = uni.getStorageSync(USER_INFO);
  142. let useId = info.user.id
  143. var page = 0
  144. if (this.current == 0) {
  145. page = 0
  146. } else {
  147. page = this.current * 10
  148. }
  149. let sql =
  150. `select a.id_,a.create_time_,a.yang_pin_ming_che,a.yang_pin_bian_hao,c.fu_kuan_zhuang_ta,c.wei_tuo_bian_hao_,c.wei_tuo_zhuang_ta,b.shou_yang_ri_qi_,b.bei_zhu_,b.yan_shou_jie_guo_,d.ke_hu_zhang_hao_ ` +
  151. `from t_lhypb a ` +
  152. `left join t_lhwtsqb c on a.parent_id_ = c.id_ ` +
  153. `left join t_bjd d on c.he_tong_id_ = d.id_ ` +
  154. `left join t_lhypdjb b on a.yang_pin_bian_hao = b.yang_ben_bian_hao ` +
  155. ` where (a.create_by_= '${useId}' or d.ke_hu_zhang_hao_ = '${useId}') and (a.yang_pin_bian_hao like '%${keyworks}%' or a.wei_tuo_dan_hao_ like '%${keyworks}%') ORDER BY a.create_time_ desc limit ${page},10`
  156. let requestData = this.$sig(sql)
  157. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  158. if (res.data.state == 200) {
  159. const data = res.data.variables.data
  160. this.resdata.push(...data)
  161. uni.stopPullDownRefresh();
  162. if (data.length > 10) {
  163. this.ReachBottomShow = false
  164. } else {
  165. this.current++
  166. }
  167. uni.hideLoading()
  168. }
  169. })
  170. },
  171. /**
  172. * @param {Object} id
  173. * 修改样品跳转
  174. */
  175. goto(id, weiTuoBianHao) {
  176. uni.navigateTo({ // 跳转页面
  177. url: `/pages/jiance/list/specimen?id=${id}&weiTuoBianHao=${weiTuoBianHao}`
  178. })
  179. },
  180. goBaogao(option) {
  181. uni.navigateTo({ // 跳转页面
  182. url: '/pages/fileView/reportList?id=' + option
  183. })
  184. },
  185. /**
  186. * 样品标签页
  187. */
  188. getTag(id) {
  189. uni.navigateTo({ // 跳转页面
  190. url: '/pages/tag/sampleTag?id=' + id
  191. })
  192. },
  193. sig(sql) {
  194. let rul = (sql.length + 9) * 12 * 3 + 168
  195. let salt = "JinYuanXinTong"
  196. return md5(rul + '' + salt)
  197. },
  198. }
  199. }
  200. </script>
  201. <style>
  202. .chat-custom-right {
  203. flex: 1;
  204. /* #ifndef APP-NVUE */
  205. display: flex;
  206. /* #endif */
  207. flex-direction: column;
  208. justify-content: space-between;
  209. align-items: flex-end;
  210. }
  211. .chat-custom-text {
  212. font-size: 12px;
  213. /* color: #999; */
  214. color: black;
  215. }
  216. .title {
  217. width: 140rpx;
  218. }
  219. /deep/ .uni-section__content-sub {
  220. color: rgb(51, 51, 51);
  221. font-size: 28rpx;
  222. }
  223. /* ------------------------------------------------------------- */
  224. .btnList {
  225. width: 100%;
  226. text-align: right;
  227. padding-top: 15rpx;
  228. padding-bottom: 0rpx;
  229. }
  230. </style>