index.vue 6.0 KB

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