index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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="Submit">
  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. Submit() {
  89. uni.getLocation({
  90. type: 'wgs84', // 返回国测局坐标
  91. geocode: true,
  92. success: function(res) {
  93. console.log(res);
  94. this.longitude = res.longitude
  95. this.latitude = res.latitude
  96. this.address = res.address.country + res.address.province + res.address.city + res.address.district + res.address.street
  97. },
  98. fail: function(e) {
  99. uni.showToast({
  100. icon: 'none',
  101. title: '获取地址失败, 请检查是否开启定位权限~~'
  102. })
  103. }
  104. })
  105. this.show = true;
  106. request({
  107. url: '/storeScan/storeScanOutTyres',
  108. method: 'Post',
  109. data: {
  110. storeId:this.$store.state.storeInfo.storeId,
  111. userId:this.$store.state.storeInfo.userId,
  112. scanAddress: this.address,
  113. longitude: this.longitude,
  114. latitude: this.latitude,
  115. materialList: this.datalist
  116. }
  117. }).then(res => {
  118. console.log(res.data.msg)
  119. if (res.data.code == 500) {
  120. this.$refs.repeat.show({
  121. title: res.data.msg,
  122. type: 'default',
  123. position: 'bottom'
  124. })
  125. }
  126. this.notBelongStoreBrandTyreNumbers = res.data.data.notBelongStoreBrandTyreNumbers //非门店经营品牌胎号
  127. this.successCount = res.data.data.successCount //成功条数
  128. this.nonRegularTyreNumbers = res.data.data.nonRegularTyreNumbers //非正规胎号
  129. this.notScanInTyres = res.data.data.notScanInTyres //未入库轮胎号
  130. console.log(res)
  131. }).catch(err => {
  132. console.log(err.data.msg)
  133. }).finally(() => {
  134. // Loading.close()
  135. })
  136. }
  137. },
  138. }
  139. </script>
  140. <style lang="scss" scoped>
  141. .behind {
  142. width: 100%;
  143. height: 230rpx;
  144. margin-bottom: -200rpx;
  145. background-color: #0094FE;
  146. }
  147. .header {
  148. width: 100%;
  149. }
  150. .content {
  151. width: 711rpx;
  152. // height: 852rpx;
  153. background: #FFFFFF;
  154. box-shadow: 0rpx 0rpx 24rpx 0rpx rgba(101, 176, 249, 0.41);
  155. border-radius: 20rpx;
  156. padding-top: 10rpx;
  157. padding-bottom: 10rpx;
  158. margin: 0 auto;
  159. }
  160. .content-one {
  161. display: flex;
  162. justify-content: space-between;
  163. }
  164. .content-one:nth-child(1) {
  165. margin-left: 90rpx;
  166. margin-right: 150rpx;
  167. font-weight: bold;
  168. margin-top: 30rpx;
  169. }
  170. .content-two {
  171. display: flex;
  172. justify-content: space-between;
  173. margin-top: 30rpx;
  174. line-height: 115rpx;
  175. width: 666rpx;
  176. margin: 0 auto;
  177. color: #9c9c9c;
  178. font-size: 28rpx;
  179. border-bottom: 1rpx solid #E8E8E8;
  180. }
  181. .content-two>view:nth-child(2) {
  182. padding-top: 28rpx;
  183. width: 350rpx;
  184. line-height: 53rpx;
  185. text-align: center;
  186. }
  187. .content-two>view:nth-child(3) {
  188. color: #149EE2;
  189. margin-right: 50rpx;
  190. }
  191. .tail {
  192. width: 678rpx;
  193. line-height: 83rpx;
  194. background: #0095FF;
  195. color: #fff;
  196. text-align: center;
  197. margin: 0 auto;
  198. margin-top: 60rpx;
  199. border-radius: 15rpx;
  200. }
  201. .content-four {
  202. color: #acacac;
  203. font-size: 24rpx;
  204. margin-top: 30rpx;
  205. margin-left: 20rpx;
  206. margin-bottom: 50rpx;
  207. }
  208. </style>