Add.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div>
  3. <header class="mui-bar mui-bar-nav">
  4. <h1 class="mui-title">扫码放行</h1>
  5. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  6. </header>
  7. <div class="mui-content vongi-fklist">
  8. <div class="vongi-clasadmin">
  9. <h4>{{info.companyName}}</h4>
  10. <div class="vongi-clasadmin-list">
  11. <div class="vongi-clasadmin-ma mui-col-xs-12">
  12. <p class="mui-ellipsis">{{queryDate}}</p>
  13. <span class="color999"><span class="colorFF7100">{{info.appointmentNum}}</span> / <span class="colorFF7100">{{info.passNum}}</span></span>
  14. <p class="mui-ellipsis color999">今日预约 / 已核验放行</p>
  15. </div>
  16. </div>
  17. <div class="vongi-btn">
  18. <button class="mui-btn mui-btn-primary" @click="scan">
  19. 扫码核验<span class="iconfont icon-saoyisao"></span>
  20. </button>
  21. </div>
  22. </div>
  23. <div class="vongi-smhy-list">
  24. <div class="vongi-smhy-tit">放行记录</div>
  25. <ul class="mui-table-view mui-content-padded">
  26. <template v-if="info.map&&info.map.data">
  27. <li class="mui-table-view-cell mui-media" v-for="item,i in info.map.data" @click="gotoItem(item.id)">
  28. <a href="javascript:;" class="mui-navigate-right">
  29. 申请人:{{item.personName}}
  30. </a>
  31. <p class="mui-ellipsis flew-sp">
  32. 出厂时间:{{showtime(item.releaseTime)}}
  33. <span>核验人:{{item.releasePerson}} {{item.releaseCompany}}</span>
  34. </p>
  35. </li>
  36. </template>
  37. <li class="mui-table-view-cell mui-media">
  38. <a @click="gotoUrl" class="vongi-smhy-more" >查看全部记录</a>
  39. </li>
  40. </ul>
  41. </div>
  42. </div>
  43. </div>
  44. </template>
  45. <script>
  46. import * as API from '@/apis-xsy/scan'
  47. import * as WxJsApi from '$project/utils/wxJsApi'
  48. import Common from '$project/components/Common.vue'
  49. import Loading from '$project/components/Loading.vue'
  50. import TopHeader from '$project/components/TopHeader.vue'
  51. import {
  52. currentTimeStamp,
  53. parseUnixTime
  54. } from '$project/utils'
  55. import wx from "weixin-js-sdk";
  56. export default {
  57. name: '',
  58. components: {
  59. Common,
  60. Loading,
  61. TopHeader
  62. },
  63. data() {
  64. return {
  65. pageTitle: '申请调班',
  66. info:{},
  67. isLoading: false,
  68. queryDate:'',
  69. }
  70. },
  71. created() {
  72. this.queryDate = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}');
  73. },
  74. methods: {
  75. scan(){
  76. var _this= this;
  77. wx.scanQRCode({
  78. needResult: 1,
  79. scanType: ["qrCode"],
  80. success: function (res) {
  81. var url = res.resultStr;
  82. _this.checkForm(url)
  83. },faile: function(res) {
  84. mui.toast("扫码失败");
  85. },
  86. complete() {
  87. }
  88. })
  89. //_this.checkForm('http://xpgj.xiaoxinda.com/#/guest/to/info?id=60304478-a8ff-4095-b20b-a66633bd87f7')
  90. },
  91. showtime(time){
  92. if(time){
  93. time=time.substring(5)
  94. }
  95. return time;
  96. },
  97. checkForm(url) {
  98. window.location.href=url+"&scan=scan"
  99. },
  100. gotoUrl(){
  101. this.$router.push({
  102. name: "XsyScanList",
  103. })
  104. },
  105. gotoItem(id){
  106. this.$router.push({
  107. name: "XsyScanInfo",
  108. query:{id:id,
  109. scan:'scan'
  110. }
  111. })
  112. },
  113. getRemainingAmount(){
  114. this.isLoading = true;
  115. API.indexData().then(response => {
  116. this.info=response;
  117. this.isLoading = false;
  118. }).catch(error => {
  119. this.isLoading = false;
  120. mui.toast(error);
  121. })
  122. },
  123. asynCallBack() {
  124. },
  125. },
  126. mounted() {
  127. WxJsApi.getWxConfig();
  128. this.getRemainingAmount();
  129. },
  130. destroyed() {},
  131. }
  132. </script>
  133. <style src="$project/assets/css/iconfont.css"></style>
  134. <style scoped src="$project/assets/css/xpwyfyy.css"></style>
  135. <style src="$project/assets/css/xsy.css"></style>
  136. <style>
  137. </style>