list.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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" @confirm="search"></input>
  11. </view>
  12. <view class="action">
  13. <button class="cu-btn bg-gradual-blue shadow-blur round" @tap="search">搜索</button>
  14. </view>
  15. </view>
  16. <view v-for="(item,i) in resdata" :key="i" style="margin: 10rpx 20rpx;position: relative;" :style="[{top:'calc('+ CustomBar + 'px + 20rpx)'}]">
  17. <uni-section :title="'样品编号:'+item.yang_pin_bian_hao" :subTitle="'检测委托单号:'+item.wei_tuo_bian_hao_" type="line" padding subTitleColor="rgb(51, 51, 51)" subTitleFontSize="14px">
  18. <view>
  19. <view>
  20. <view style="display: flex;line-height: 50rpx;">
  21. <view class="title">样品名称:</view>
  22. <view> {{item.yang_pin_ming_che}} </view>
  23. </view>
  24. <view style="display: flex;line-height: 50rpx;">
  25. <view class="title">送样批号:</view>
  26. <view> {{item.song_jian_pi_hao_}} </view>
  27. </view>
  28. <view style="display: flex;line-height: 50rpx;">
  29. <view class="title">收样时间:</view>
  30. <view> {{item.shou_yang_ri_qi_}} </view>
  31. </view>
  32. <view style="display: flex;line-height: 50rpx;">
  33. <view>验收结果:</view>
  34. <view style="color: #5E00FF;" v-if="item.yan_shou_jie_guo_"> {{item.yan_shou_jie_guo_}}
  35. </view>
  36. </view>
  37. <view style="display: flex;line-height: 50rpx;">
  38. <view>付款状态:</view>
  39. <view v-if="item.fu_kuan_zhuang_ta=='已结清'">
  40. <view style="color: #7349ff;"> 已结清 </view>
  41. </view>
  42. <view v-else>
  43. <view style="color: #7349ff;"> 未结清 </view>
  44. </view>
  45. </view>
  46. <view style="display: flex;line-height: 50rpx;">
  47. <view>样品接收备注:</view>
  48. <view> {{item.bei_zhu_ || '无'}}</view>
  49. </view>
  50. </view>
  51. <!-- v-if="item.zhuang_tai_ && (item.zhuang_tai_ == '待运营中心审核' || item.zhuang_tai_ == '待检测中心审核' || item.zhuang_tai_ == '待财务审核' || item.zhuang_tai_ == '待样品接收')" -->
  52. <view class="btnList">
  53. <u-button class="u-m-r-15 btn-back-color" type="success" size="mini" @click="goto(item.id_,item.wei_tuo_bian_hao_)" v-if="item.wei_tuo_zhuang_ta && (item.wei_tuo_zhuang_ta == '待审核' ||item.wei_tuo_zhuang_ta == '已编制')">
  54. 样品修改</u-button>
  55. <u-button type="success" size="mini" class="m-r-15" @click="getTag(item.id_)">样品标签</u-button>
  56. <u-button type="success" size="mini" @click="goBaogao(item.yang_pin_bian_hao)">查看报告</u-button>
  57. </view>
  58. </view>
  59. </uni-section>
  60. </view>
  61. <view v-if="resdata.length==0" style="margin-top: 350rpx">
  62. <u-empty text="暂无样品数据" mode="list"></u-empty>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import {
  68. ACCESS_TOKEN,
  69. USER_NAME,
  70. USER_INFO
  71. } from "@/common/util/constants" // 拉取登录token,userName,userInfo
  72. import md5 from "@/common/util/md5.js"
  73. import http from "@/common/service/http.js"
  74. export default {
  75. components: {},
  76. // 初始化
  77. data() {
  78. return {
  79. keyword: '',
  80. CustomBar: this.CustomBar,
  81. url: http.apiHosp +
  82. '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_=',
  83. resdata: [],
  84. current: 0,
  85. total: 10,
  86. pageSize: 10,
  87. ReachBottomShow: true
  88. }
  89. },
  90. // 页面加载
  91. onLoad: function() {
  92. this.getData(this.keyword)
  93. // this.getData(this.current, this.pageSize, this.total);
  94. },
  95. // 下拉刷新
  96. onPullDownRefresh() {
  97. this.current = 0
  98. this.resdata = []
  99. this.getData(this.keyword)
  100. },
  101. // 上拉加载
  102. onReachBottom() {
  103. let _self = this
  104. uni.showNavigationBarLoading()
  105. if (this.ReachBottomShow) {
  106. this.getData(this.keyword)
  107. }
  108. },
  109. methods: {
  110. /**
  111. * 模糊查询
  112. */
  113. search() {
  114. this.current = 0
  115. this.resdata = []
  116. this.getData(this.keyword)
  117. },
  118. add() {
  119. this.total += 10
  120. },
  121. reset() {
  122. this.total = 0
  123. this.current = 1
  124. },
  125. change(e) {
  126. this.getData(this.current, this.pageSize, this.total);
  127. this.current = e.current
  128. },
  129. // 拉取列表数据
  130. getData(keyworks) {
  131. uni.showLoading({
  132. mask: true,
  133. title: '加载中'
  134. });
  135. let info = uni.getStorageSync(USER_INFO);
  136. let useId = info.user.id
  137. var page = 0
  138. if (this.current == 0) {
  139. page = 0
  140. } else {
  141. page = this.current * 10
  142. }
  143. let sql =
  144. `select a.id_,a.create_time_,a.yang_pin_ming_che,a.song_jian_pi_hao_,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_ ` +
  145. `from t_lhypb a ` +
  146. `left join t_lhwtsqb c on a.parent_id_ = c.id_ ` +
  147. `left join t_bjd d on c.he_tong_id_ = d.id_ ` +
  148. `left join t_lhypdjb b on a.yang_pin_bian_hao = b.yang_ben_bian_hao ` +
  149. ` 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}%') and c.wei_tuo_lei_xing_ = '客户委托' ORDER BY a.create_time_ desc limit ${page},10`
  150. let requestData = this.$sig(sql)
  151. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  152. if (res.data.state == 200) {
  153. const data = res.data.variables.data
  154. this.resdata.push(...data)
  155. uni.stopPullDownRefresh();
  156. if (data.length > 10) {
  157. this.ReachBottomShow = false
  158. } else {
  159. this.current++
  160. }
  161. uni.hideLoading()
  162. } else {
  163. this.$methCommon.getPrompt('服务器异常', 'error')
  164. uni.hideLoading()
  165. }
  166. }).catch(error => {
  167. this.$methCommon.getPrompt('服务器异常', 'error')
  168. uni.hideLoading()
  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?reportId=' + 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 scoped lang="scss">
  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>