index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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">
  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 alreadyExistsTyreNumbers" :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. <view style="width: 100%;height: 42rpx;margin-top: 30rpx;margin-bottom: 10rpx;text-align: center;">奖励明细</view>
  32. <u-table border-color="#f2f2f2">
  33. <u-tr class="u-tr">
  34. <u-td class="u-td">{{rewardMoney}}奖励</u-td>
  35. <u-td class="u-td">{{rewardIntegral}}积分</u-td>
  36. </u-tr>
  37. </u-table>
  38. </u-modal>
  39. <view class="header">
  40. <view class="behind"></view>
  41. <view class="content">
  42. <view class="content-one">
  43. <view>胎号</view>
  44. <view>物料</view>
  45. <view>预计奖励</view>
  46. </view>
  47. <view v-for="(item,index) in dalist" :key="index">
  48. <view class="content-two">
  49. <view>{{item.tireNumber}}</view>
  50. <view>{{item.maktx}}</view>
  51. <view>{{item.rewardMoney}}元</view>
  52. </view>
  53. </view>
  54. <view class="content-three">
  55. <view>
  56. 合计:{{total}}元
  57. </view>
  58. </view>
  59. </view>
  60. <view class="content-four">
  61. 注:请完善请完善请完善请完善请完善请完善请完善
  62. </view>
  63. </view>
  64. <u-toast ref="repeat" position="bottom" />
  65. <view class="tail" @click="location">
  66. 扫码确认
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import {
  72. request
  73. } from '../../../common/request/request'
  74. require("promise.prototype.finally").shim()
  75. export default {
  76. data() {
  77. return {
  78. dalist: [],
  79. total: 0,
  80. show: false,
  81. successCount: '', //成功条数
  82. notBelongStoreBrandTyreNumbers: [], //非门店经营品牌胎号
  83. nonRegularTyreNumbers: [], //非正规胎号
  84. alreadyExistsTyreNumbers: [], //库存中已存在轮胎号
  85. rewardMoney: '', //奖励金额
  86. rewardIntegral: '' ,//奖励积分
  87. longitude:'', //经度
  88. latitude:'', //纬度
  89. address: '' //中文地址
  90. }
  91. },
  92. created() {
  93. this.getDatalist()
  94. },
  95. methods: {
  96. confirm() {
  97. this.$u.route({
  98. type:'redirectTo',
  99. url: 'pages/me/Warehousing-details/index'
  100. })
  101. },
  102. getDatalist() {
  103. uni.$on('update', data => {
  104. this.datalist = data.materialList
  105. request({
  106. url: '/storeScan/getTyreReword',
  107. method: 'Post',
  108. data: {
  109. storeId:this.$store.state.storeInfo.storeId,
  110. userId:this.$store.state.storeInfo.userId,
  111. materialList: this.datalist
  112. }
  113. }).then(res => {
  114. this.dalist = res.data.data
  115. for (let i = 0; i < this.dalist.length; i++) {
  116. this.total += parseInt(this.dalist[i].rewardMoney)
  117. }
  118. return this.total
  119. }).catch(err => {
  120. console.log(err)
  121. }).finally(() => {
  122. // Loading.close()
  123. })
  124. })
  125. },
  126. location(){
  127. let this_s = this
  128. uni.getLocation({
  129. type: 'wgs84', // 返回国测局坐标
  130. geocode: true,
  131. success: function(res) {
  132. console.log(res);
  133. this_s.longitude = res.longitude
  134. this_s.latitude = res.latitude
  135. this_s.address = res.address.city + res.address.district + res.address.poiName
  136. this_s.Submit()
  137. },
  138. fail: function(e) {
  139. uni.showToast({
  140. icon: 'none',
  141. title: '获取地址失败, 请检查是否开启定位权限~~'
  142. })
  143. }
  144. })
  145. },
  146. Submit() {
  147. this.show = true;
  148. request({
  149. url: '/storeScan/storeScanTyres',
  150. method: 'Post',
  151. data: {
  152. storeId:this.$store.state.storeInfo.storeId,
  153. userId:this.$store.state.storeInfo.userId,
  154. // scanAddress: '青岛市市北区橡胶谷-B栋', //地址
  155. // longitude: 120.3898355082192, //纬度
  156. // latitude: 36.14788760436011, //经度
  157. scanAddress: this.address, //地址
  158. longitude: this.longitude, //纬度
  159. latitude: this.latitude, //经度
  160. materialList: this.datalist //轮胎参数
  161. }
  162. }).then(res => {
  163. console.log(res)
  164. console.log(res.data.msg)
  165. if (res.data.code == 500) {
  166. this.$refs.repeat.show({
  167. title: res.data.msg,
  168. type: 'default',
  169. position: 'bottom'
  170. })
  171. }
  172. this.notBelongStoreBrandTyreNumbers = res.data.data.notBelongStoreBrandTyreNumbers //非门店经营品牌胎号
  173. this.successCount = res.data.data.successCount //成功条数
  174. this.nonRegularTyreNumbers = res.data.data.nonRegularTyreNumbers //非正规胎号
  175. this.alreadyExistsTyreNumbers = res.data.data.alreadyExistsTyreNumbers //库存中已存在轮胎号
  176. this.rewardMoney = res.data.data.rewardMoney //奖励金额
  177. this.rewardIntegral = res.data.data.rewardIntegral //奖励积分
  178. console.log(res)
  179. }).catch(err => {
  180. console.log(err.data.msg)
  181. }).finally(() => {
  182. // Loading.close()
  183. })
  184. }
  185. },
  186. }
  187. </script>
  188. <style lang="scss" scoped>
  189. .behind {
  190. width: 100%;
  191. height: 230rpx;
  192. margin-bottom: -200rpx;
  193. background-color: #0094FE;
  194. }
  195. .header {
  196. width: 100%;
  197. }
  198. .content {
  199. width: 711rpx;
  200. // height: 852rpx;
  201. background: #FFFFFF;
  202. box-shadow: 0rpx 0rpx 24rpx 0rpx rgba(101, 176, 249, 0.41);
  203. border-radius: 20rpx;
  204. padding-top: 10rpx;
  205. padding-bottom: 10rpx;
  206. margin: 0 auto;
  207. }
  208. .content-one {
  209. display: flex;
  210. justify-content: space-between;
  211. }
  212. .content-one:nth-child(1) {
  213. margin-left: 90rpx;
  214. margin-right: 50rpx;
  215. font-weight: bold;
  216. margin-top: 30rpx;
  217. }
  218. .content-two {
  219. display: flex;
  220. justify-content: space-between;
  221. margin-top: 30rpx;
  222. line-height: 115rpx;
  223. width: 666rpx;
  224. margin: 0 auto;
  225. color: #9c9c9c;
  226. font-size: 28rpx;
  227. border-bottom: 1rpx solid #E8E8E8;
  228. }
  229. .content-two>view:nth-child(2) {
  230. width: 240rpx;
  231. line-height: 53rpx;
  232. text-align: center;
  233. margin-right: 100rpx;
  234. }
  235. .content-two>view:nth-child(3) {
  236. color: #149EE2;
  237. margin-right: 50rpx;
  238. }
  239. .tail {
  240. width: 678rpx;
  241. line-height: 83rpx;
  242. background: #0095FF;
  243. color: #fff;
  244. text-align: center;
  245. margin: 0 auto;
  246. margin-top: 60rpx;
  247. border-radius: 15rpx;
  248. }
  249. .content-three>view:nth-child(1) {
  250. margin-left: 500rpx;
  251. line-height: 80rpx;
  252. font-weight: bolder;
  253. }
  254. .content-four {
  255. color: #acacac;
  256. font-size: 24rpx;
  257. margin-top: 30rpx;
  258. margin-left: 20rpx;
  259. margin-bottom: 50rpx;
  260. }
  261. </style>