index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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. }
  90. },
  91. created() {
  92. this.getDatalist()
  93. },
  94. methods: {
  95. confirm() {
  96. this.$u.route({
  97. type:'redirectTo',
  98. url: 'pages/me/Warehousing-details/index'
  99. })
  100. },
  101. getDatalist() {
  102. uni.$on('update', data => {
  103. this.datalist = data.materialList
  104. request({
  105. url: '/storeScan/getTyreReword',
  106. method: 'Post',
  107. data: {
  108. storeId:this.$store.state.storeInfo.storeId,
  109. userId:this.$store.state.storeInfo.userId,
  110. materialList: this.datalist
  111. }
  112. }).then(res => {
  113. this.dalist = res.data.data
  114. for (let i = 0; i < this.dalist.length; i++) {
  115. this.total += parseInt(this.dalist[i].rewardMoney)
  116. }
  117. return this.total
  118. }).catch(err => {
  119. console.log(err)
  120. }).finally(() => {
  121. // Loading.close()
  122. })
  123. })
  124. },
  125. Submit() {
  126. uni.getLocation({
  127. type: 'wgs84',
  128. geocode:true,
  129. success: function(res) {
  130. console.log(res, "当前位置");
  131. console.log(res.longitude);
  132. console.log(res.latitude);
  133. this.longitude = res.longitude
  134. this.latitude = res.latitude
  135. },
  136. });
  137. this.show = true;
  138. request({
  139. url: '/storeScan/storeScanTyres',
  140. method: 'Post',
  141. data: {
  142. storeId:this.$store.state.storeInfo.storeId,
  143. userId:this.$store.state.storeInfo.userId,
  144. scanAddress: '中国',
  145. longitude: this.longitude,
  146. latitude: this.latitude,
  147. materialList: this.datalist
  148. }
  149. }).then(res => {
  150. console.log(res.data.msg)
  151. if (res.data.code == 500) {
  152. this.$refs.repeat.show({
  153. title: res.data.msg,
  154. type: 'default',
  155. position: 'bottom'
  156. })
  157. }
  158. this.notBelongStoreBrandTyreNumbers = res.data.data.notBelongStoreBrandTyreNumbers //非门店经营品牌胎号
  159. this.successCount = res.data.data.successCount //成功条数
  160. this.nonRegularTyreNumbers = res.data.data.nonRegularTyreNumbers //非正规胎号
  161. this.alreadyExistsTyreNumbers = res.data.data.alreadyExistsTyreNumbers //库存中已存在轮胎号
  162. this.rewardMoney = res.data.data.rewardMoney //奖励金额
  163. this.rewardIntegral = res.data.data.rewardIntegral //奖励积分
  164. console.log(res)
  165. }).catch(err => {
  166. console.log(err.data.msg)
  167. }).finally(() => {
  168. // Loading.close()
  169. })
  170. }
  171. },
  172. }
  173. </script>
  174. <style lang="scss" scoped>
  175. .behind {
  176. width: 100%;
  177. height: 230rpx;
  178. margin-bottom: -200rpx;
  179. background-color: #0094FE;
  180. }
  181. .header {
  182. width: 100%;
  183. }
  184. .content {
  185. width: 711rpx;
  186. // height: 852rpx;
  187. background: #FFFFFF;
  188. box-shadow: 0rpx 0rpx 24rpx 0rpx rgba(101, 176, 249, 0.41);
  189. border-radius: 20rpx;
  190. padding-top: 10rpx;
  191. padding-bottom: 10rpx;
  192. margin: 0 auto;
  193. }
  194. .content-one {
  195. display: flex;
  196. justify-content: space-between;
  197. }
  198. .content-one:nth-child(1) {
  199. margin-left: 90rpx;
  200. margin-right: 50rpx;
  201. font-weight: bold;
  202. margin-top: 30rpx;
  203. }
  204. .content-two {
  205. display: flex;
  206. justify-content: space-between;
  207. margin-top: 30rpx;
  208. line-height: 115rpx;
  209. width: 666rpx;
  210. margin: 0 auto;
  211. color: #9c9c9c;
  212. font-size: 28rpx;
  213. border-bottom: 1rpx solid #E8E8E8;
  214. }
  215. .content-two>view:nth-child(2) {
  216. width: 240rpx;
  217. line-height: 53rpx;
  218. text-align: center;
  219. margin-right: 100rpx;
  220. }
  221. .content-two>view:nth-child(3) {
  222. color: #149EE2;
  223. margin-right: 50rpx;
  224. }
  225. .tail {
  226. width: 678rpx;
  227. line-height: 83rpx;
  228. background: #0095FF;
  229. color: #fff;
  230. text-align: center;
  231. margin: 0 auto;
  232. margin-top: 60rpx;
  233. border-radius: 15rpx;
  234. }
  235. .content-three>view:nth-child(1) {
  236. margin-left: 500rpx;
  237. line-height: 80rpx;
  238. font-weight: bolder;
  239. }
  240. .content-four {
  241. color: #acacac;
  242. font-size: 24rpx;
  243. margin-top: 30rpx;
  244. margin-left: 20rpx;
  245. margin-bottom: 50rpx;
  246. }
  247. </style>