index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <!-- 扫码出库确认页面 -->
  3. <view>
  4. <u-modal v-model="show" :show-title="false" @confirm="confirm">
  5. <view style="width: 100%;height: 42rpx;margin-top: 30rpx;margin-bottom: 10rpx;text-align: center;">成功信息</view>
  6. <u-table border-color="#f2f2f2">
  7. <u-tr class="u-tr">
  8. <u-td class="u-td" style="font-size: 24rpx;">{{successCount}}</u-td>
  9. <u-td class="u-td">成功出库轮胎</u-td>
  10. </u-tr>
  11. </u-table>
  12. <view style="width: 100%;height: 42rpx;margin-top: 30rpx;margin-bottom: 10rpx;text-align: center;">失败信息</view>
  13. <u-table border-color="#f2f2f2" font-size="20rpx">
  14. <u-tr class="u-tr">
  15. <u-th class="u-th">轮胎胎号</u-th>
  16. <u-th class="u-th">失败原因</u-th>
  17. </u-tr>
  18. <u-tr class="u-tr" v-for="(item,index) in notBelongStoreBrandTyreNumbers" :key="index">
  19. <u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
  20. <u-td class="u-td">非门店经营品牌</u-td>
  21. </u-tr>
  22. <u-tr class="u-tr" v-for="(item,index) in nonRegularTyreNumbers" :key="index">
  23. <u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
  24. <u-td class="u-td">非正规胎号</u-td>
  25. </u-tr>
  26. <u-tr class="u-tr" v-for="(item,index) in notScanInTyres" :key="index">
  27. <u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
  28. <u-td class="u-td">未入库轮胎</u-td>
  29. </u-tr>
  30. </u-table>
  31. </u-modal>
  32. <view class="header">
  33. <view class="behind"></view>
  34. <view class="content">
  35. <view class="content-one">
  36. <view>胎号</view>
  37. <view>物料</view>
  38. </view>
  39. <view v-for="(item,index) in datalist" :key="index">
  40. <view class="content-two">
  41. <view>{{item.tireNumber}}</view>
  42. <view>{{item.maktx}}</view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="content-four">
  47. 注:请完善请完善请完善请完善请完善请完善请完善
  48. </view>
  49. </view>
  50. <u-toast ref="repeat" position="bottom" />
  51. <view class="tail" @click="location">
  52. 扫码确认
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import {
  58. request
  59. } from '../../../common/request/request'
  60. require("promise.prototype.finally").shim()
  61. export default {
  62. data() {
  63. return {
  64. datalist: [],
  65. total: 0,
  66. show: false,
  67. successCount: '', //成功条数
  68. notBelongStoreBrandTyreNumbers: [], //非门店经营品牌胎号
  69. nonRegularTyreNumbers: [], //非正规胎号
  70. notScanInTyres: [], //未入库胎号
  71. longitude:'', //经度
  72. latitude:'' //纬度
  73. }
  74. },
  75. created() {
  76. uni.$on('update', data => {
  77. this.datalist = data.materialList
  78. return this.datalist
  79. })
  80. },
  81. methods: {
  82. confirm() {
  83. this.$u.route({
  84. type:'redirectTo',
  85. url: 'pages/me/Delivery-details/index'
  86. })
  87. },
  88. location(){
  89. let this_s = this
  90. uni.getLocation({
  91. type: 'wgs84', // 返回国测局坐标
  92. geocode: true,
  93. success: function(res) {
  94. console.log(res);
  95. this_s.longitude = res.longitude
  96. this_s.latitude = res.latitude
  97. this_s.address = res.address.city + res.address.district + res.address.poiName
  98. this_s.Submit()
  99. },
  100. fail: function(e) {
  101. uni.showToast({
  102. icon: 'none',
  103. title: '获取地址失败, 请检查是否开启定位权限~~'
  104. })
  105. }
  106. })
  107. },
  108. Submit() {
  109. this.show = true;
  110. request({
  111. url: '/storeScan/storeScanOutTyres',
  112. method: 'Post',
  113. data: {
  114. storeId:this.$store.state.storeInfo.storeId,
  115. userId:this.$store.state.storeInfo.userId,
  116. scanAddress: this.address,
  117. longitude: this.longitude,
  118. latitude: this.latitude,
  119. materialList: this.datalist
  120. }
  121. }).then(res => {
  122. console.log(res.data.msg)
  123. if (res.data.code == 500) {
  124. this.$refs.repeat.show({
  125. title: res.data.msg,
  126. type: 'default',
  127. position: 'bottom'
  128. })
  129. }
  130. this.notBelongStoreBrandTyreNumbers = res.data.data.notBelongStoreBrandTyreNumbers //非门店经营品牌胎号
  131. this.successCount = res.data.data.successCount //成功条数
  132. this.nonRegularTyreNumbers = res.data.data.nonRegularTyreNumbers //非正规胎号
  133. this.notScanInTyres = res.data.data.notScanInTyres //未入库轮胎号
  134. console.log(res)
  135. }).catch(err => {
  136. console.log(err.data.msg)
  137. }).finally(() => {
  138. // Loading.close()
  139. })
  140. }
  141. },
  142. }
  143. </script>
  144. <style lang="scss" scoped>
  145. .behind {
  146. width: 100%;
  147. height: 230rpx;
  148. margin-bottom: -200rpx;
  149. background-color: #0094FE;
  150. }
  151. .header {
  152. width: 100%;
  153. }
  154. .content {
  155. width: 711rpx;
  156. // height: 852rpx;
  157. background: #FFFFFF;
  158. box-shadow: 0rpx 0rpx 24rpx 0rpx rgba(101, 176, 249, 0.41);
  159. border-radius: 20rpx;
  160. padding-top: 10rpx;
  161. padding-bottom: 10rpx;
  162. margin: 0 auto;
  163. }
  164. .content-one {
  165. display: flex;
  166. justify-content: space-between;
  167. }
  168. .content-one:nth-child(1) {
  169. margin-left: 90rpx;
  170. margin-right: 150rpx;
  171. font-weight: bold;
  172. margin-top: 30rpx;
  173. }
  174. .content-two {
  175. display: flex;
  176. justify-content: space-between;
  177. margin-top: 30rpx;
  178. line-height: 115rpx;
  179. width: 666rpx;
  180. margin: 0 auto;
  181. color: #9c9c9c;
  182. font-size: 28rpx;
  183. border-bottom: 1rpx solid #E8E8E8;
  184. }
  185. .content-two>view:nth-child(2) {
  186. padding-top: 28rpx;
  187. width: 350rpx;
  188. line-height: 53rpx;
  189. text-align: center;
  190. }
  191. .content-two>view:nth-child(3) {
  192. color: #149EE2;
  193. margin-right: 50rpx;
  194. }
  195. .tail {
  196. width: 678rpx;
  197. line-height: 83rpx;
  198. background: #0095FF;
  199. color: #fff;
  200. text-align: center;
  201. margin: 0 auto;
  202. margin-top: 60rpx;
  203. border-radius: 15rpx;
  204. }
  205. .content-four {
  206. color: #acacac;
  207. font-size: 24rpx;
  208. margin-top: 30rpx;
  209. margin-left: 20rpx;
  210. margin-bottom: 50rpx;
  211. }
  212. </style>