rukutongji_body.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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. <van-icon size="28px" name="checked" v-if="item.checked" color="#1989fa" />
  145. </div>
  146. </div>
  147. <div class="flex"
  148. style="border-top:1px dashed #dadada;height: .4rem;align-items: center;padding-left: 0.1rem;">
  149. <div style="font-size: 0.18rem;">适用范围:{{item.couponDescribe}}</div>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. </van-popup>
  156. </div>
  157. </div>
  158. </body>
  159. <link rel="stylesheet" href="./mescroll/mescroll.min.css">
  160. <script type="text/javascript" src="../script/aui-scroll.js"></script>
  161. <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
  162. <script type="text/javascript" src="../script/jquery-1.11.0.min.js"></script>
  163. <script type="text/javascript" src="../script/api.js"></script>
  164. <script type="text/javascript" src="../script/httpRequest.js"></script>
  165. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  166. <script type="text/javascript">
  167. apiready = function () {
  168. var store = api.pageParam.store;
  169. var type = api.pageParam.type;
  170. new Vue({
  171. el: '#app',
  172. data: {
  173. store: JSON.parse(store),
  174. address: '', // 经纬度 + 地址
  175. lonlat: '',
  176. userid: '',
  177. type: type,
  178. canClick: true,
  179. showPopup: false,
  180. couponList: [],
  181. couponNum: "",
  182. addd: [],
  183. checkNum: 0
  184. },
  185. created: function () {
  186. this.store.map(function (item) {
  187. item.couponName = "选择优惠券";
  188. item.couponId = ""
  189. })
  190. },
  191. methods: {
  192. init: function () {
  193. var _this = this;
  194. this.userid = $api.getStorage('userid');
  195. this.map = api.require('bMap');
  196. if (api.systemType == 'ios') {
  197. this.map.initMapSDK(function (ret) {
  198. if (ret.status) { }
  199. });
  200. }
  201. this.ifHasPrme('location', function (ret1) {
  202. if (ret1 == true) {
  203. // 获取当前位置和当前经纬度
  204. _this.map.getLocation(function (ret2, err) {
  205. if (ret2.status) {
  206. _this.lonlat = ret2;
  207. _this.map.getNameFromCoords({
  208. lon: ret2.lon,
  209. lat: ret2.lat
  210. }, function (ret3, err) {
  211. if (ret3.status) {
  212. _this.address = ret3;
  213. } else {
  214. }
  215. });
  216. } else { }
  217. });
  218. }
  219. })
  220. this.residueCoupon()
  221. },
  222. //查看可以优惠券数量
  223. residueCoupon: function () {
  224. var data = {
  225. "storeId": this.userid,
  226. "type": 'body',
  227. "url": 'json'
  228. }
  229. var url = "residueCoupon",
  230. _this = this;
  231. this.$post(url, data, function (ret) {
  232. if (ret.code == 0) {
  233. _this.couponNum = ret.data
  234. }
  235. })
  236. },
  237. /**
  238. * 扫码入库
  239. */
  240. showPopups: function (item) {
  241. if (this.checkNum >= this.couponNum) {
  242. api.toast({
  243. msg: "最多使用" + this.couponNum + "张优惠券"
  244. });
  245. return
  246. }
  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. _this.couponList = ret.data
  263. if (_this.couponList.length == 0) {
  264. api.toast({
  265. msg: '暂无优惠券',
  266. });
  267. } else {
  268. _this.showPopup = true
  269. }
  270. }
  271. })
  272. },
  273. selected: function (a) {
  274. this.selectedData
  275. var _this = this;
  276. if (a.checked == false && this.selectedData.couponId == "") {
  277. var data = {
  278. "id": a.id,
  279. "useType": 3,
  280. "type": 'body',
  281. "url": 'json'
  282. }
  283. this.store
  284. .filter(function (e) {
  285. return e.tirenumber == _this.selectedData.tirenumber
  286. })
  287. .forEach(function (e) {
  288. e.couponName = "¥" + a.bonus;
  289. e.couponId = a.id;
  290. })
  291. } else if (a.checked == true && this.selectedData.couponId == a.id) {
  292. var data = {
  293. "id": a.id,
  294. "useType": 1,
  295. "type": 'body',
  296. "url": 'json'
  297. }
  298. this.store
  299. .filter(function (e) {
  300. return e.tirenumber == _this.selectedData.tirenumber
  301. })
  302. .forEach(function (e) {
  303. e.couponName = "选择优惠券";
  304. e.couponId = "";
  305. })
  306. } else if (a.checked == true && this.selectedData.couponId != a.id) {
  307. api.toast({
  308. msg: '此优惠券已被选中,请选择其它优惠券',
  309. });
  310. return
  311. } else {
  312. api.toast({
  313. msg: '最多选一张',
  314. });
  315. return
  316. }
  317. var url = "Couponupdate",
  318. _this = this;
  319. this.$post(url, data, function (ret) {
  320. if (ret.code == 0) {
  321. }
  322. })
  323. this.checkNum = 0
  324. this.store.map(function (cart, index) {
  325. if (cart.couponName != "选择优惠券") {
  326. _this.checkNum += 1
  327. }
  328. })
  329. this.showPopup = false
  330. },
  331. doneChoose: function () {
  332. if (!this.address.lat || !this.address.lon) {
  333. api.toast({
  334. msg: '正在获取定位,请稍候',
  335. });
  336. this.init();
  337. return;
  338. }
  339. var data = {
  340. "scanAddress": this.address.district,
  341. "latitude": this.address.lat == '' ? '' : this.address.lat.toString().substring(0, 11),
  342. "longitude": this.address.lon == '' ? '' : this.address.lon.toString().substring(0, 11),
  343. "storeId": this.userid,
  344. "province": this.address.province,
  345. "city": this.address.city,
  346. "district": this.address.district,
  347. "rewardType": "2",
  348. "materialList": this.store,
  349. "result": this.store.length,
  350. "type": 'body',
  351. "url": 'json'
  352. }
  353. var url = "sacaCodeIn",
  354. _this = this;
  355. this.canClick = false;
  356. this.$post(url, data, function (ret) {
  357. _this.canClick = true;
  358. if (ret.code == 0) {
  359. if (!ret.message) {
  360. _this.sendEvent('refushku');
  361. api.alert({
  362. title: '入库提示',
  363. msg: ret.msg,
  364. }, function (ret, err) {
  365. if (ret) {
  366. _this.goWin('intoNode_win', 'intoNode_win.html', '');
  367. }
  368. });
  369. } else {
  370. api.toast({
  371. msg: ret.message
  372. });
  373. }
  374. }
  375. })
  376. }
  377. },
  378. mounted: function () {
  379. this.init();
  380. },
  381. })
  382. }
  383. </script>
  384. </html>