day-check-scan.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <!-- 每日盘点扫描 -->
  2. <template>
  3. <view class="container-wrap">
  4. <uni-nav-bar :title="isReading ? '扫描中' : '扫描结果'" :status-bar="true" background-color="#3F92F9" color="#FFF">
  5. <view slot="left">
  6. <u-icon name="account-fill" color="#FFF" size="35"></u-icon>
  7. <span style="padding: 0 5rpx;color: #FFFFFF;">{{ userInfo.name }}</span>
  8. </view>
  9. <view slot="right" @tap="$utils.back()">
  10. <span style="color: #FFFFFF;">返回</span>
  11. </view>
  12. </uni-nav-bar>
  13. <view class="container">
  14. <!-- 扫描rfid -->
  15. <view class="reading">
  16. <u-image height="300rpx" mode="aspectFit" src="../../../static/images/rfid.png"></u-image>
  17. <view class="title" v-if="isReading">扫描中...</view>
  18. <view class="title" v-if="!isReading">扫描结果</view>
  19. </view>
  20. <!-- 扫描到RFID标签时,打开质检结果 -->
  21. <view v-if="!isReading" class="info">
  22. <view class="row flex-start">
  23. <view class="label">
  24. 物料编码:
  25. </view>
  26. <view class="value">
  27. {{ data.materialCode }}
  28. </view>
  29. </view>
  30. <view class="row flex-start">
  31. <view class="label">
  32. 物料名称:
  33. </view>
  34. <view class="value">
  35. {{ data.materialName }}
  36. </view>
  37. </view>
  38. <view class="row flex-start">
  39. <view class="label">
  40. 物料类型:
  41. </view>
  42. <view class="value">
  43. {{ data.categoryName }}
  44. </view>
  45. </view>
  46. <view class="row flex-start">
  47. <view class="label">
  48. 所在仓库:
  49. </view>
  50. <view class="value">
  51. {{ data.stockHouseName }}
  52. </view>
  53. </view>
  54. <view class="row flex-start">
  55. <view class="label">
  56. 旋转区域:
  57. </view>
  58. <view class="value">
  59. {{ data.stockArea }}
  60. </view>
  61. </view>
  62. <view class="row flex-start">
  63. <view class="label">
  64. 库存数量:
  65. </view>
  66. <view class="value">
  67. {{ data.quantity }}
  68. </view>
  69. </view>
  70. <view class="row" style="align-items: center;justify-content: flex-start;">
  71. <view class="col" style="align-items: center;">
  72. <view class="label">
  73. 盘点结果:
  74. </view>
  75. <view class="value">
  76. <u-input v-model="quantity" type="number" :border="true"/>
  77. </view>
  78. <span style="margin-left: 10rpx;">米</span>
  79. </view>
  80. <view class="col"></view>
  81. </view>
  82. <view class="btn flex-column-center" v-if="!isReading">
  83. <view class="row">
  84. <u-button throttleTime="300" type="primary" style="width: 100%;border-radius: 0;" @click="bind">完成并继续</u-button>
  85. </view>
  86. <view class="row">
  87. <view class="col" style="margin-right: 10rpx;">
  88. <u-button throttleTime="300" type="warning" style="width: 100%;border-radius: 0;" @click="$utils.back()">返回</u-button>
  89. </view>
  90. <view class="col">
  91. <u-button throttleTime="300" type="error" style="width: 100%;border-radius: 0;" @click="returnOrder">退货申请</u-button>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </template>
  99. <script>
  100. // #ifdef APP-PLUS
  101. // #endif
  102. export default {
  103. data() {
  104. return {
  105. quantity: 0,
  106. isReading: true,
  107. data: {},
  108. rfidCode: ''
  109. };
  110. },
  111. methods: {
  112. bind() {
  113. this.$http.RfidCompleteCheck({
  114. rfidCode: this.rfidCode,
  115. quantity: this.quantity,
  116. type: 1
  117. }).then(res => {
  118. if(res.code === 0) {
  119. this.$msg.showToast(res.msg || '操作成功!')
  120. uni.$emit('getlist')
  121. this.isReading = true
  122. this.scanRfid()
  123. } else {
  124. this.isReading = true
  125. this.scanRfid()
  126. }
  127. })
  128. },
  129. /* 退货申请 */
  130. returnOrder() {
  131. this.$utils.open('/pages/store-out-manage/return-apply/return-apply')
  132. },
  133. /* rfid获取绑定物料信息 */
  134. getList() {
  135. this.$http.ScanRfidCodeStockTag({
  136. rfidCode: this.rfidCode,
  137. checkRfidType: 1
  138. }).then(res => {
  139. console.log(res)
  140. if(res.code === 0) {
  141. this.isReading = false
  142. this.data = res.result
  143. this.quantity = this.data.quantity
  144. } else {
  145. this.isReading = true
  146. setTimeout(() => {
  147. this.scanRfid()
  148. }, 1000)
  149. }
  150. })
  151. },
  152. scanRfid() {
  153. this.$pda.uhfScan().then(res => {
  154. console.log(res)
  155. this.rfidCode = res[0].epc
  156. this.getList()
  157. console.log(this.rfidCode)
  158. }).catch(() => {
  159. this.$msg.showToast('未识别到有效RFID标签!')
  160. setTimeout(() => {
  161. this.$utils.back()
  162. }, 1000)
  163. })
  164. }
  165. },
  166. onLoad(option) {
  167. this.scanRfid()
  168. },
  169. onUnload() {
  170. this.$pda.uhfStop()
  171. }
  172. }
  173. </script>
  174. <style lang="scss" scoped>
  175. .container-wrap {
  176. overflow: hidden;
  177. .container {
  178. padding: 0 10rpx;
  179. height: calc(100vh - var(--status-bar-height) - 44px);
  180. overflow: auto;
  181. .title {
  182. padding: 20rpx 0;
  183. font-size: 36rpx;
  184. font-weight: bold;
  185. text-align: center;
  186. }
  187. .reading {
  188. padding: 40rpx 0;
  189. }
  190. .info {
  191. background-color: #FFFFFF;
  192. padding: 20rpx 60rpx;
  193. border-radius: 10rpx ;
  194. .row {
  195. align-items: flex-start;
  196. .label {
  197. font-size: 32rpx;
  198. width: 160rpx;
  199. }
  200. .value {
  201. font-size: 32rpx;
  202. flex: 1;
  203. overflow: hidden;
  204. word-wrap: break-word;
  205. }
  206. }
  207. }
  208. .btn {
  209. height: 180rpx;
  210. .row {
  211. padding: 0;
  212. padding-bottom: 10rpx;
  213. width: 100%;
  214. &:last-child {
  215. padding-bottom: 0;
  216. }
  217. }
  218. }
  219. }
  220. }
  221. </style>