index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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. </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>{{$t('scanningconfirm.number_s')}}</view>
  37. <view>{{$t('scanningconfirm.materiel')}}</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>
  47. <u-toast ref="repeat" position="bottom" />
  48. <view class="tail" @click="location">
  49. {{$t('scanningconfirm.confirm')}}
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import {
  55. request
  56. } from '../../../common/request/request'
  57. require("promise.prototype.finally").shim()
  58. export default {
  59. data() {
  60. return {
  61. datalist: [],
  62. total: 0,
  63. show: false,
  64. successCount: '', //成功条数
  65. notBelongStoreBrandTyreNumbers: [], //非门店经营品牌胎号
  66. nonRegularTyreNumbers: [], //非正规胎号
  67. notScanInTyres: [], //未入库胎号
  68. longitude:'', //经度
  69. latitude:'' ,//纬度
  70. degree:'',
  71. address_s:'',
  72. whole:''
  73. }
  74. },
  75. created() {
  76. uni.setNavigationBarTitle({
  77. title: this.$t('scanningconfirm.titleOut')
  78. });
  79. uni.$on('update', data => {
  80. this.datalist = data.materialList
  81. console.log(data)
  82. this.whole = data
  83. return this.datalist
  84. })
  85. },
  86. onBackPress(options) {
  87. if (options.from == 'backbutton') {
  88. this.$u.route({
  89. url: 'pages/home/scancode/scancodeout'
  90. })
  91. uni.$emit('data', {
  92. lisi: this.datalist
  93. })
  94. }
  95. return true;
  96. },
  97. methods: {
  98. confirm() {
  99. this.$u.route({
  100. type:'redirectTo',
  101. url: 'pages/me/Delivery-details/index'
  102. })
  103. this.datalist = ''
  104. },
  105. location(){
  106. let this_s = this
  107. console.log(this.whole)
  108. this_s.Submit()
  109. },
  110. Submit() {
  111. this.show = true;
  112. request({
  113. url: '/storeScan/storeScanOutTyres',
  114. method: 'Post',
  115. data: {
  116. storeId:this.$store.state.storeInfo.storeId,
  117. userId:this.$store.state.storeInfo.userId,
  118. scanAddress: this.whole.address, //地址
  119. longitude: this.whole.degree.x,
  120. latitude: this.whole.degree.y,
  121. materialList: this.datalist
  122. }
  123. }).then(res => {
  124. console.log(res)
  125. if (res.data.code == 500) {
  126. this.$refs.repeat.show({
  127. title: res.data.msg,
  128. type: 'default',
  129. position: 'bottom'
  130. })
  131. }
  132. this.notBelongStoreBrandTyreNumbers = res.data.data.notBelongStoreBrandTyreNumbers //非门店经营品牌胎号
  133. this.successCount = res.data.data.successCount //成功条数
  134. this.nonRegularTyreNumbers = res.data.data.nonRegularTyreNumbers //非正规胎号
  135. this.notScanInTyres = res.data.data.notScanInTyres //未入库轮胎号
  136. this.datalist = ''
  137. }).catch(err => {
  138. uni.showToast({
  139. icon: 'none',
  140. title: this.$t('scanningconfirm.networkstate'),
  141. position: "bottom"
  142. })
  143. }).finally(() => {
  144. // Loading.close()
  145. })
  146. }
  147. },
  148. }
  149. </script>
  150. <style lang="scss" scoped>
  151. .behind {
  152. width: 100%;
  153. height: 230rpx;
  154. margin-bottom: -200rpx;
  155. background-color: #0094FE;
  156. }
  157. .header {
  158. width: 100%;
  159. }
  160. .content {
  161. width: 711rpx;
  162. // height: 852rpx;
  163. background: #FFFFFF;
  164. box-shadow: 0rpx 0rpx 24rpx 0rpx rgba(101, 176, 249, 0.41);
  165. border-radius: 20rpx;
  166. padding-top: 10rpx;
  167. padding-bottom: 10rpx;
  168. margin: 0 auto;
  169. }
  170. .content-one {
  171. display: flex;
  172. justify-content: space-between;
  173. }
  174. .content-one:nth-child(1) {
  175. margin-left: 90rpx;
  176. margin-right: 150rpx;
  177. font-weight: bold;
  178. margin-top: 30rpx;
  179. }
  180. .content-two {
  181. display: flex;
  182. justify-content: space-between;
  183. margin-top: 30rpx;
  184. line-height: 115rpx;
  185. width: 666rpx;
  186. margin: 0 auto;
  187. color: #9c9c9c;
  188. font-size: 28rpx;
  189. border-bottom: 1rpx solid #E8E8E8;
  190. }
  191. .content-two>view:nth-child(2) {
  192. padding-top: 28rpx;
  193. width: 350rpx;
  194. line-height: 53rpx;
  195. text-align: center;
  196. }
  197. .content-two>view:nth-child(3) {
  198. color: #149EE2;
  199. margin-right: 50rpx;
  200. }
  201. .tail {
  202. width: 678rpx;
  203. line-height: 83rpx;
  204. background: #0095FF;
  205. color: #fff;
  206. text-align: center;
  207. margin: 0 auto;
  208. margin-top: 60rpx;
  209. border-radius: 15rpx;
  210. }
  211. .content-four {
  212. color: #acacac;
  213. font-size: 24rpx;
  214. margin-top: 30rpx;
  215. margin-left: 20rpx;
  216. margin-bottom: 50rpx;
  217. }
  218. </style>