store-check-scan.vue 5.5 KB

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