rukutongji_body.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <!DOCTYPE html>
  2. <html class="">
  3. <!--STATUS OK-->
  4. <head>
  5. <meta name="referrer" content="always" />
  6. <meta charset='utf-8' />
  7. <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="x-dns-prefetch-control" content="on">
  9. <meta name="description" content="">
  10. <meta name="format-detection" content="telephone=no" />
  11. <link rel="stylesheet" type="text/css" href="css/vant-ui.css" />
  12. <link rel="stylesheet" type="text/css" href="css/iconfont.css">
  13. <link rel="stylesheet" type="text/css" href="css/main.css" />
  14. <script src="js/vue.js"></script>
  15. <script src="js/vant-ui.js"></script>
  16. <script src="js/main.js"></script>
  17. <title></title>
  18. </head>
  19. <style>
  20. .couponleft {
  21. width: 2.4rem;
  22. color: #fff;
  23. height: 2rem;
  24. background: url(./img/images/youhuijuanLeft.png) no-repeat;
  25. background-size: 100% 100%;
  26. font-size: 0.7rem;
  27. padding-top: 0.4rem;
  28. padding-right: 0.2rem;
  29. }
  30. .mescroll {
  31. position: relative;
  32. height: 90%;
  33. top: 1rem
  34. }
  35. </style>
  36. <body>
  37. <div id="app" v-cloak>
  38. <div class="pageView chukujilu flex col" style="overflow-y:scroll">
  39. <!-- <div class="header flex a-center j-center">
  40. <i class="iconfont icon-back" onclick="history.go(-1)"></i>
  41. 入库统计
  42. </div>-->
  43. <!-- <div class="leiji flex a-center j-center">
  44. 入库码:<h4>202004041613617225</h4>
  45. </div>-->
  46. <div class="boxs" style="padding-left: 0; padding-right: 0; padding-bottom: 1.4rem;">
  47. <div class="rukuTongji">
  48. <!--<div class="rukuTongjiTitle flex a-center j-center">
  49. 规格统计
  50. </div>
  51. <div class="rukuTongjiHead flex j-center">
  52. <div class="item flex a-center j-center">
  53. 规格
  54. </div>
  55. <div class="item flex a-center j-center">
  56. 数量
  57. </div>
  58. </div>
  59. <div class="rukuTongjiBody">
  60. <div class="item flex a-center j-center">
  61. <div class="fx1">
  62. 165/60r14 75h
  63. <br/>
  64. bh15bgbl
  65. </div>
  66. <div class="fx1">
  67. SL12
  68. </div>
  69. </div>
  70. <div class="item flex a-center j-center">
  71. <div class="fx1">
  72. 165/60r14 75h
  73. <br/>
  74. bh15bgbl
  75. </div>
  76. <div class="fx1">
  77. SL12
  78. </div>
  79. </div>
  80. </div>-->
  81. <div class="rukuTongjiTitle flex a-center j-center" style="margin-top: 0rem;">
  82. 明细统计
  83. </div>
  84. <div class="rukuTongjiHead flex j-center">
  85. <div class="item flex a-center j-center">
  86. 胎号
  87. </div>
  88. <div class="item flex a-center j-center">
  89. 物料
  90. </div>
  91. <div class="item flex a-center j-center">
  92. 奖励
  93. </div>
  94. <div class="item flex a-center j-center">
  95. 优惠券
  96. </div>
  97. </div>
  98. <div class="rukuTongjiBody">
  99. <div class="item flex a-center j-center" v-for="(s,index) in store">
  100. <div class="fx1">
  101. {{ s.tireNumber }}
  102. </div>
  103. <div class="fx1">
  104. {{ s.maktx }}
  105. </div>
  106. <div class="fx1">
  107. {{ s.reward }}元
  108. </div>
  109. <div class="fx1" style="color: #4CB4FF;" v-on:click="showPopups(s)">
  110. {{s.couponName}}
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <div class="rukuTongjiFoot flex a-center j-center" v-if="canClick" v-on:click="doneChoose">
  116. 扫码确认
  117. </div>
  118. <div class="rukuTongjiFoot flex a-center j-center" style="background-color : #ccc;color:#fff"
  119. v-if="!canClick">
  120. 扫码确认
  121. </div>
  122. </div>
  123. <van-popup v-model="showPopup" round position="bottom" closeable close-icon="close"
  124. v-bind:style="{ height: '80%' }">
  125. <div style="height:90%;" class="mescroll-touch-y mescroll">
  126. <div class="flex" v-for="(item,index) in couponList" :key="index">
  127. <div class="flex" style="margin: 0.1rem 0;" v-on:click="selected(item)">
  128. <div class="couponleft">
  129. <div class="flex a-end j-center">
  130. <div>¥</div>
  131. <div>{{item.bonus}}</div>
  132. </div>
  133. </div>
  134. <div class="flex col"
  135. style="justify-content: space-between;border-top:1px solid #dadada;border-right:1px solid #dadada;border-bottom:1px solid #dadada;height:2rem;width: 5.1rem;">
  136. <div class="flex"
  137. style="justify-content: space-between;margin: auto 0;padding-left: 0.1rem;">
  138. <div>
  139. <div style="font-size: 0.5rem;">{{item.bonus}}元优惠券</div>
  140. <div style="font-size: 0.25rem;color: #888;">失效时间:{{item.expireTime}}</div>
  141. </div>
  142. <div style="margin: auto 0;padding-right: 0.1rem;">
  143. <van-checkbox v-model="item.checked"></van-checkbox>
  144. </div>
  145. </div>
  146. <div class="flex"
  147. style="border-top:1px dashed #dadada;height: .4rem;align-items: center;padding-left: 0.1rem;">
  148. <div style="font-size: 0.18rem;">适用范围:{{item.couponDescribe}}</div>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. </van-popup>
  155. </div>
  156. </div>
  157. </body>
  158. <link rel="stylesheet" href="./mescroll/mescroll.min.css">
  159. <script type="text/javascript" src="../script/aui-scroll.js"></script>
  160. <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
  161. <script type="text/javascript" src="../script/jquery-1.11.0.min.js"></script>
  162. <script type="text/javascript" src="../script/api.js"></script>
  163. <script type="text/javascript" src="../script/httpRequest.js"></script>
  164. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  165. <script type="text/javascript">
  166. apiready = function () {
  167. var store = api.pageParam.store;
  168. var type = api.pageParam.type;
  169. new Vue({
  170. el: '#app',
  171. data: {
  172. store: JSON.parse(store),
  173. address: '', // 经纬度 + 地址
  174. lonlat: '',
  175. userid: '',
  176. type: type,
  177. canClick: true,
  178. showPopup: false,
  179. couponList: [],
  180. couponNum: "",
  181. addd: [],
  182. checkNum: 0
  183. },
  184. created: function () {
  185. this.store.map(function (item) {
  186. item.couponName = "选择优惠券";
  187. item.couponId = ""
  188. })
  189. },
  190. methods: {
  191. init: function () {
  192. var _this = this;
  193. this.userid = $api.getStorage('userid');
  194. this.map = api.require('bMap');
  195. if (api.systemType == 'ios') {
  196. this.map.initMapSDK(function (ret) {
  197. if (ret.status) { }
  198. });
  199. }
  200. this.ifHasPrme('location', function (ret1) {
  201. if (ret1 == true) {
  202. // 获取当前位置和当前经纬度
  203. _this.map.getLocation(function (ret2, err) {
  204. if (ret2.status) {
  205. _this.lonlat = ret2;
  206. _this.map.getNameFromCoords({
  207. lon: ret2.lon,
  208. lat: ret2.lat
  209. }, function (ret3, err) {
  210. if (ret3.status) {
  211. _this.address = ret3;
  212. } else {
  213. }
  214. });
  215. } else { }
  216. });
  217. }
  218. })
  219. this.residueCoupon()
  220. },
  221. //查看可以优惠券数量
  222. residueCoupon: function () {
  223. var data = {
  224. "storeId": this.userid,
  225. "type": 'body',
  226. "url": 'json'
  227. }
  228. var url = "residueCoupon",
  229. _this = this;
  230. this.$post(url, data, function (ret) {
  231. if (ret.code == 0) {
  232. _this.couponNum = ret.data
  233. }
  234. })
  235. },
  236. /**
  237. * 扫码入库
  238. */
  239. showPopups: function (item) {
  240. if(this.checkNum>=this.couponNum){
  241. api.toast({
  242. msg: "最多使用" + this.couponNum + "张优惠券"
  243. });
  244. return
  245. }
  246. this.showPopup = true
  247. var data = {
  248. "storeId": this.userid,
  249. "brand": item.brand,
  250. "specs": item.specs,
  251. "pattern": item.pattern,
  252. "matnr": item.matnr,
  253. "maktx": item.maktx,
  254. "type": 'body',
  255. "url": 'json'
  256. }
  257. var url = "storeCouponMessage",
  258. _this = this;
  259. this.selectedData = item
  260. this.$post(url, data, function (ret) {
  261. if (ret.code == 0) {
  262. ret.data.map(function (e) {
  263. e.checked = false;
  264. })
  265. _this.couponList = ret.data
  266. }
  267. })
  268. },
  269. selected: function (a) {
  270. this.selectedData
  271. var _this = this;
  272. this.store
  273. .filter(function (e) {
  274. return e.tirenumber == _this.selectedData.tirenumber
  275. })
  276. .forEach(function (e) {
  277. e.couponName = "-¥" + a.bonus;
  278. e.couponId = a.id;
  279. // e.checked=true
  280. })
  281. this.checkNum = 0
  282. this.store.map(function (cart, index) {
  283. if (cart.couponName != "选择优惠券") {
  284. _this.checkNum += 1
  285. }
  286. })
  287. this.showPopup = false
  288. },
  289. doneChoose: function () {
  290. if (!this.address.lat || !this.address.lon) {
  291. api.toast({
  292. msg: '正在获取定位,请稍候',
  293. });
  294. this.init();
  295. return;
  296. }
  297. var data = {
  298. "scanAddress": this.address.district,
  299. "latitude": this.address.lat == '' ? '' : this.address.lat.toString().substring(0, 11),
  300. "longitude": this.address.lon == '' ? '' : this.address.lon.toString().substring(0, 11),
  301. "storeId": this.userid,
  302. "province": this.address.province,
  303. "city": this.address.city,
  304. "district": this.address.district,
  305. "rewardType": "2",
  306. "materialList": this.store,
  307. "result": this.store.length,
  308. "type": 'body',
  309. "url": 'json'
  310. }
  311. var url = "sacaCodeIn",
  312. _this = this;
  313. this.canClick = false;
  314. this.$post(url, data, function (ret) {
  315. _this.canClick = true;
  316. if (ret.code == 0) {
  317. if (!ret.message) {
  318. _this.sendEvent('refushku');
  319. api.alert({
  320. title: '入库提示',
  321. msg: ret.msg,
  322. }, function (ret, err) {
  323. if (ret) {
  324. _this.goWin('intoNode_win', 'intoNode_win.html', '');
  325. }
  326. });
  327. } else {
  328. api.toast({
  329. msg: ret.message
  330. });
  331. }
  332. }
  333. })
  334. }
  335. },
  336. mounted: function () {
  337. this.init();
  338. }
  339. })
  340. }
  341. </script>
  342. </html>