index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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="Submit">
  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. Submit() {
  127. uni.getLocation({
  128. type: 'wgs84', // 返回国测局坐标
  129. geocode: true,
  130. success: function(res) {
  131. console.log(res);
  132. this.longitude = res.longitude
  133. this.latitude = res.latitude
  134. this.address = res.address.country + res.address.province + res.address.city + res.address.district + res.address.street
  135. },
  136. fail: function(e) {
  137. uni.showToast({
  138. icon: 'none',
  139. title: '获取地址失败, 请检查是否开启定位权限~~'
  140. })
  141. }
  142. })
  143. this.show = true;
  144. request({
  145. url: '/storeScan/storeScanTyres',
  146. method: 'Post',
  147. data: {
  148. storeId:this.$store.state.storeInfo.storeId,
  149. userId:this.$store.state.storeInfo.userId,
  150. scanAddress: this.address,
  151. longitude: this.longitude,
  152. latitude: this.latitude,
  153. materialList: this.datalist
  154. }
  155. }).then(res => {
  156. console.log(res.data.msg)
  157. if (res.data.code == 500) {
  158. this.$refs.repeat.show({
  159. title: res.data.msg,
  160. type: 'default',
  161. position: 'bottom'
  162. })
  163. }
  164. this.notBelongStoreBrandTyreNumbers = res.data.data.notBelongStoreBrandTyreNumbers //非门店经营品牌胎号
  165. this.successCount = res.data.data.successCount //成功条数
  166. this.nonRegularTyreNumbers = res.data.data.nonRegularTyreNumbers //非正规胎号
  167. this.alreadyExistsTyreNumbers = res.data.data.alreadyExistsTyreNumbers //库存中已存在轮胎号
  168. this.rewardMoney = res.data.data.rewardMoney //奖励金额
  169. this.rewardIntegral = res.data.data.rewardIntegral //奖励积分
  170. console.log(res)
  171. }).catch(err => {
  172. console.log(err.data.msg)
  173. }).finally(() => {
  174. // Loading.close()
  175. })
  176. }
  177. },
  178. }
  179. </script>
  180. <style lang="scss" scoped>
  181. .behind {
  182. width: 100%;
  183. height: 230rpx;
  184. margin-bottom: -200rpx;
  185. background-color: #0094FE;
  186. }
  187. .header {
  188. width: 100%;
  189. }
  190. .content {
  191. width: 711rpx;
  192. // height: 852rpx;
  193. background: #FFFFFF;
  194. box-shadow: 0rpx 0rpx 24rpx 0rpx rgba(101, 176, 249, 0.41);
  195. border-radius: 20rpx;
  196. padding-top: 10rpx;
  197. padding-bottom: 10rpx;
  198. margin: 0 auto;
  199. }
  200. .content-one {
  201. display: flex;
  202. justify-content: space-between;
  203. }
  204. .content-one:nth-child(1) {
  205. margin-left: 90rpx;
  206. margin-right: 50rpx;
  207. font-weight: bold;
  208. margin-top: 30rpx;
  209. }
  210. .content-two {
  211. display: flex;
  212. justify-content: space-between;
  213. margin-top: 30rpx;
  214. line-height: 115rpx;
  215. width: 666rpx;
  216. margin: 0 auto;
  217. color: #9c9c9c;
  218. font-size: 28rpx;
  219. border-bottom: 1rpx solid #E8E8E8;
  220. }
  221. .content-two>view:nth-child(2) {
  222. width: 240rpx;
  223. line-height: 53rpx;
  224. text-align: center;
  225. margin-right: 100rpx;
  226. }
  227. .content-two>view:nth-child(3) {
  228. color: #149EE2;
  229. margin-right: 50rpx;
  230. }
  231. .tail {
  232. width: 678rpx;
  233. line-height: 83rpx;
  234. background: #0095FF;
  235. color: #fff;
  236. text-align: center;
  237. margin: 0 auto;
  238. margin-top: 60rpx;
  239. border-radius: 15rpx;
  240. }
  241. .content-three>view:nth-child(1) {
  242. margin-left: 500rpx;
  243. line-height: 80rpx;
  244. font-weight: bolder;
  245. }
  246. .content-four {
  247. color: #acacac;
  248. font-size: 24rpx;
  249. margin-top: 30rpx;
  250. margin-left: 20rpx;
  251. margin-bottom: 50rpx;
  252. }
  253. </style>