specimen.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view>
  3. <cu-custom bgColor="bg-luohu" :isBack="true">
  4. <block slot="backText">返回</block>
  5. <block slot="content">样品查询</block>
  6. </cu-custom>
  7. <view class="box" v-if="specimen.length > 0">
  8. <view class="sinList" v-for="(item,index) in specimen" :key="index">
  9. <view class="title">样品编号:{{item.yang_pin_bian_hao}}</view>
  10. <view class="title">样品名称:{{item.yang_pin_ming_che}}</view>
  11. <view class="title">收养日期:{{item.shou_yang_ri_qi_}}</view>
  12. <view class="title">收养数量:{{item.shou_yang_shu_lia}}</view>
  13. <view class="title">是否留样:{{item.shi_fou_liu_yang_}}</view>
  14. <view class="title">留样期限至:{{item.liu_yang_qi_xian_}}</view>
  15. <view class="title">联系人:{{item.lian_xi_ren_}}</view>
  16. <view class="title">
  17. 电话:{{item.dian_hua_}}
  18. <image src="../../static/dianhua.png"
  19. style="width: 30rpx;height: 30rpx;margin-left: 15rpx;position: relative;top: 5rpx;"
  20. @click="makePhoneCall(item.dian_hua_)">
  21. </image>
  22. </view>
  23. <view class="title">报告状态:<text style="color: #7349ff;">{{item.liu_zhuan_zhuang_}}</text></view>
  24. </view>
  25. </view>
  26. <view v-else>
  27. <uni-card is-full :is-shadow="false">
  28. <text class="">暂无报告</text>
  29. </uni-card>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import md5 from "@/common/util/md5.js"
  35. export default {
  36. data() {
  37. return {
  38. specimen: []
  39. }
  40. },
  41. onLoad(option) {
  42. if (option.id) {
  43. this.getList(option.id)
  44. }
  45. },
  46. methods: {
  47. /**
  48. * @param {Object} id
  49. * 根据委托单的id查询样品列表
  50. */
  51. getList(id) {
  52. uni.showLoading({
  53. mask: true,
  54. title: 'loading'
  55. });
  56. let sql =
  57. `{"sql":"select * from t_mjypdjb where wei_tuo_bian_hao_= '${id}' ORDER BY CREATE_TIME_ desc"}`
  58. let md5 = this.sig(sql) //加密, 获取md5密文
  59. let requestData = sql.slice(0, 1) + '"sig":"' + md5 + '",' + sql.slice(1) //结果拼接
  60. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  61. if (res.data.state == 200) {
  62. const data = res.data.variables.data
  63. this.specimen = data
  64. uni.hideLoading()
  65. }
  66. })
  67. },
  68. /**
  69. * @param {Object} item
  70. * 调用手机的电话
  71. */
  72. makePhoneCall(item) {
  73. uni.makePhoneCall({
  74. phoneNumber: item
  75. })
  76. },
  77. sig(sql) {
  78. let rul = (sql.length + 9) * 12 * 3 + 168
  79. let salt = "JinYuanXinTong"
  80. return md5(rul + '' + salt)
  81. },
  82. }
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. .box {
  87. padding: 20rpx;
  88. .sinList {
  89. padding: 20rpx;
  90. margin-bottom: 20rpx;
  91. width: 100%;
  92. background: #fff;
  93. border-radius: 8rpx;
  94. .title {
  95. line-height: 48rpx;
  96. }
  97. .btn {
  98. display: flex;
  99. justify-content: flex-end;
  100. }
  101. }
  102. }
  103. </style>