index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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}}{{$t('scancodeenter.strip')}}</u-td>
  9. <u-td class="u-td">{{$t('scancodeenter.delivery')}}</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">{{$t('scanningconfirm.number')}}</u-th>
  16. <u-th class="u-th">{{$t('scanningconfirm.failreason')}}</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">{{$t('scanningconfirm.stateA')}}</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">{{$t('scanningconfirm.stateB')}}</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">{{$t('scanningconfirm.notincluded')}}</u-td>
  29. </u-tr>
  30. <view style="width: 100%;height: 42rpx;margin-top: 30rpx;margin-bottom: 10rpx;text-align: center;">奖励合计</view>
  31. <u-table border-color="#f2f2f2">
  32. <u-tr class="u-tr">
  33. <u-td class="u-td">{{$t('scanningconfirm.reward')}}:{{rewardMoney}}{{$t('scanningconfirm.yuan')}}</u-td>
  34. <u-td class="u-td">{{$t('scanningconfirm.integral')}}:{{rewardIntegral}}{{$t('scanningconfirm.one')}}</u-td>
  35. </u-tr>
  36. </u-table>
  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>{{$t('scanningconfirm.number_s')}}</view>
  44. <view>{{$t('scanningconfirm.materiel')}}</view>
  45. <view>{{$t('scanningconfirm.estimatereward')}}</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}}{{$t('scanningconfirm.yuan')}}</view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <u-toast ref="repeat" position="bottom" />
  57. <view class="tail" @click="location">
  58. {{$t('scanningconfirm.confirm')}}
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import {
  64. request
  65. } from '../../../common/request/request'
  66. require("promise.prototype.finally").shim()
  67. export default {
  68. data() {
  69. return {
  70. datalist: [],
  71. total: 0,
  72. show: false,
  73. successCount: '', //成功条数
  74. notBelongStoreBrandTyreNumbers: [], //非门店经营品牌胎号
  75. nonRegularTyreNumbers: [], //非正规胎号
  76. notScanInTyres: [], //未入库胎号
  77. longitude:'', //经度
  78. latitude:'' ,//纬度
  79. degree:'',
  80. address_s:'',
  81. whole:'',
  82. dalist:[],
  83. rewardIntegral:'',
  84. rewardMoney:''
  85. }
  86. },
  87. created() {
  88. uni.setNavigationBarTitle({
  89. title: this.$t('scanningconfirm.titleOut')
  90. });
  91. uni.$on('update', data => {
  92. //渲染页面
  93. // this.datalist = data.materialList
  94. console.log(this.datalist)
  95. request({
  96. url: '/storeScan/getTyreReword',
  97. method: 'Post',
  98. data: {
  99. storeId: this.$store.state.storeInfo.storeId,
  100. userId: this.$store.state.storeInfo.userId,
  101. materialList: data.materialList,
  102. scanType:'2'
  103. }
  104. }).then(res => {
  105. console.log(res)
  106. this.dalist = res.data.data
  107. // if (res.data.code == 0) {
  108. // console.log(res)
  109. // this.dalist = res.data.data
  110. // for (let i = 0; i < this.dalist.length; i++) {
  111. // this.total += parseInt(this.dalist[i].rewardMoney)
  112. // }
  113. // return this.total
  114. // } else {
  115. // uni.showToast({
  116. // icon: 'none',
  117. // title: this.$t('unified.error')
  118. // })
  119. // }
  120. }).catch(err => {
  121. uni.showToast({
  122. icon: 'none',
  123. title: this.$t('unified.networkstate')
  124. })
  125. }).finally(() => {
  126. // Loading.close()
  127. })
  128. this.whole = data
  129. // return this.datalist
  130. })
  131. },
  132. onBackPress(options) {
  133. if (options.from == 'backbutton') {
  134. this.$u.route({
  135. url: 'pages/home/scancode/scancodeout'
  136. })
  137. uni.$emit('data', {
  138. lisi: this.datalist
  139. })
  140. }
  141. return true;
  142. },
  143. methods: {
  144. confirm() {
  145. this.$u.route({
  146. type:'redirectTo',
  147. url: 'pages/me/Delivery-details/index'
  148. })
  149. this.datalist = ''
  150. },
  151. location(){
  152. let this_s = this
  153. console.log(this.whole)
  154. this_s.Submit()
  155. },
  156. Submit() {
  157. this.show = true;
  158. request({
  159. url: '/storeScan/storeScanOutTyres',
  160. method: 'Post',
  161. data: {
  162. storeId:this.$store.state.storeInfo.storeId,
  163. userId:this.$store.state.storeInfo.userId,
  164. scanAddress: this.whole.address, //地址
  165. longitude: this.whole.degree.x,
  166. latitude: this.whole.degree.y,
  167. materialList: this.dalist
  168. }
  169. }).then(res => {
  170. console.log(res)
  171. this.rewardMoney = res.data.data.rewardMoney
  172. this.rewardIntegral = res.data.data.rewardIntegral
  173. if (res.data.code == 500) {
  174. this.$refs.repeat.show({
  175. title: res.data.msg,
  176. type: 'default',
  177. position: 'bottom'
  178. })
  179. }
  180. this.notBelongStoreBrandTyreNumbers = res.data.data.notBelongStoreBrandTyreNumbers //非门店经营品牌胎号
  181. this.successCount = res.data.data.successCount //成功条数
  182. this.nonRegularTyreNumbers = res.data.data.nonRegularTyreNumbers //非正规胎号
  183. this.notScanInTyres = res.data.data.notScanInTyres //未入库轮胎号
  184. this.datalist = ''
  185. }).catch(err => {
  186. uni.showToast({
  187. icon: 'none',
  188. title: this.$t('scanningconfirm.networkstate'),
  189. position: "bottom"
  190. })
  191. }).finally(() => {
  192. // Loading.close()
  193. })
  194. }
  195. },
  196. }
  197. </script>
  198. <style lang="scss" scoped>
  199. .behind {
  200. width: 100%;
  201. height: 230rpx;
  202. margin-bottom: -200rpx;
  203. background-color: #0094FE;
  204. }
  205. .header {
  206. width: 100%;
  207. }
  208. .content {
  209. width: 711rpx;
  210. // height: 852rpx;
  211. background: #FFFFFF;
  212. box-shadow: 0rpx 0rpx 24rpx 0rpx rgba(101, 176, 249, 0.41);
  213. border-radius: 20rpx;
  214. padding-top: 10rpx;
  215. padding-bottom: 10rpx;
  216. margin: 0 auto;
  217. }
  218. .content-one {
  219. display: flex;
  220. justify-content: space-between;
  221. }
  222. .content-one:nth-child(1) {
  223. margin-left: 90rpx;
  224. margin-right: 20rpx;
  225. font-weight: bold;
  226. margin-top: 30rpx;
  227. // background-color: #19BE6B;
  228. }
  229. .content-two {
  230. display: flex;
  231. justify-content: space-between;
  232. margin-top: 30rpx;
  233. line-height: 115rpx;
  234. width: 666rpx;
  235. margin: 0 auto;
  236. color: #9c9c9c;
  237. font-size: 28rpx;
  238. border-bottom: 1rpx solid #E8E8E8;
  239. }
  240. .content-two>view:nth-child(2) {
  241. padding-top: 28rpx;
  242. width: 350rpx;
  243. line-height: 53rpx;
  244. text-align: center;
  245. }
  246. .content-two>view:nth-child(3) {
  247. color: #149EE2;
  248. margin-right: 10rpx;
  249. }
  250. .tail {
  251. width: 678rpx;
  252. line-height: 83rpx;
  253. background: #0095FF;
  254. color: #fff;
  255. text-align: center;
  256. margin: 0 auto;
  257. margin-top: 60rpx;
  258. border-radius: 15rpx;
  259. }
  260. .content-four {
  261. color: #acacac;
  262. font-size: 24rpx;
  263. margin-top: 30rpx;
  264. margin-left: 20rpx;
  265. margin-bottom: 50rpx;
  266. }
  267. </style>