kucunMy_body.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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. <link rel="stylesheet" href="./mescroll/mescroll.min.css">
  18. <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
  19. <title></title>
  20. </head>
  21. <style>
  22. .chukujilu {
  23. background-color: #fff !important;
  24. }
  25. .chukujilu .boxs {
  26. padding-top: 0px
  27. }
  28. .mescroll{
  29. position: relative;
  30. }
  31. </style>
  32. <body>
  33. <div id="app" v-cloak>
  34. <div class="pageView chukujilu flex col filterpage">
  35. <div class="leiji flex a-center j-center" style="background-color : #00a0ea !important;flex-wrap: wrap;">
  36. 库存总量:
  37. <h4> {{ totalStock }} </h4>
  38. </div>
  39. <div class="filterpage-container flex jlr">
  40. <div class="searchSpec">
  41. <div class="search flex a-center">
  42. <div class="searchbox">
  43. <svg t="1589079341958" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5394" width="22" height="22">
  44. <path d="M883.626667 823.04l-145.066667-144.64A337.92 337.92 0 0 0 810.666667 469.333333a341.333333 341.333333 0 1 0-341.333334 341.333334 337.92 337.92 0 0 0 209.066667-72.106667l144.64 145.066667a42.666667 42.666667 0 0 0 60.586667 0 42.666667 42.666667 0 0 0 0-60.586667zM213.333333 469.333333a256 256 0 1 1 256 256 256 256 0 0 1-256-256z" p-id="5395" fill="#bfbfbf"></path>
  45. </svg>
  46. <input type="search" placeholder="请输入轮胎规格" v-model="keyword">
  47. </div>
  48. </div>
  49. </div>
  50. <div class="item flex a-center j-center filter-text" v-on:click="chooseAndtion(2)" style="width:15%;padding-right: 10px;">
  51. {{ chooseHW.name || '花纹' }} <i class="iconfont icon-xia"></i>
  52. </div>
  53. </div>
  54. <div class="boxs mescroll-touch-y mescroll" style="padding-left: 0; padding-right: 0; padding-bottom:.5rem;" id="mescroll">
  55. <div class="rukuTongji" v-show="stockList.length > 0">
  56. <!-- flex j-center -->
  57. <div class="rukuTongjiHead flex j-center">
  58. <!-- flex a-center j-center -->
  59. <div class="item flex a-center j-center">物料</div>
  60. <div class="item flex a-center j-center">库存</div>
  61. <!-- 20201023微信下单功能 -->
  62. <!-- <div class="item flex a-center j-center">价格(元)</div>
  63. <div class="item flex a-center j-center" style="width:8rem;flex-shrink:0">是否开放<br/>微信下单</div> -->
  64. <!-- 20201023 -->
  65. </div>
  66. <div class="rukuTongjiBody">
  67. <!-- 20201023微信下单功能 -->
  68. <!-- @click="goSetting(item)" -->
  69. <div class="item flex a-center j-center" v-for="(item,index) in stockList">
  70. <div class="fx1">{{item.maktx}}</div>
  71. <div class="fx1">{{ item.stock }}</div>
  72. <!-- 20201023微信下单功能 -->
  73. <!-- <div class="fx1">{{item.price}}</div>
  74. <div class="fx1">{{ item.isopenwechatorder | formatIsopen }}</div> -->
  75. <!-- 20201023 -->
  76. </div>
  77. </div>
  78. </div>
  79. <div v-show="stockList.length == 0" style="text-align:center;overflow: auto;">
  80. <img src="./image/noData.png" style="margin:1rem auto" />
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </body>
  86. <script type="text/javascript" src="../script/api.js"></script>
  87. <script type="text/javascript" src="../script/httpRequest.js"></script>
  88. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  89. <script type="text/javascript">
  90. apiready = function() {
  91. new Vue({
  92. el: '#app',
  93. data: {
  94. userId: '', // 绑定的经销商kunnr
  95. brand: '', // 品牌
  96. spec: '', // 规格
  97. pattern: '', // 花纹
  98. starttime: '', // 开始时间
  99. endtime: '', // 结束时间
  100. page: 1,
  101. pagesize: 10,
  102. totalPages : 1,
  103. info: {}, // 包含总库存,筛选品牌,规格,库存
  104. stockList: [], // 库存列表
  105. userId : '',
  106. totalStock : 0,
  107. // 筛选查询
  108. mescroll: '',
  109. keyword: '',
  110. brandList: [],
  111. guigeList: [],
  112. huawenList: [],
  113. choosePP: {}, // 选择品牌
  114. chooseGG: {}, // 选择规格
  115. chooseHW: {}, // 选择花纹
  116. UIActionSelector: '',
  117. },
  118. filters : {
  119. amountToStr : function(val){
  120. if(parseInt(val) > 10){
  121. return '充足'
  122. }else if(parseInt(val) <= 10 && parseInt(val) > 1){
  123. return '紧张';
  124. }else {
  125. return '缺货';
  126. }
  127. },
  128. formatIsopen: function(params){
  129. switch (params) {
  130. case '1':
  131. return "是"
  132. break;
  133. default:
  134. return "否"
  135. }
  136. },
  137. },
  138. watch: {
  139. keyword: function(nw, od) {
  140. this.page = 1;
  141. this.getStockList();
  142. }
  143. },
  144. methods: {
  145. init: function() {
  146. var _this = this;
  147. this.UIActionSelector = api.require("UIActionSelector");
  148. this.userId = $api.getStorage('userid');
  149. this.getStockList();
  150. this.getWuliaoAntion();
  151. // 配置上拉加载下拉刷新
  152. this.configDownAndPull("mescroll",function(mescroll){
  153. _this.page = 1;
  154. _this.getStockList(mescroll);
  155. },function(mescroll){
  156. if(_this.page < _this.totalPages){
  157. _this.page = _this.page + 1;
  158. _this.getStockList(mescroll,1);
  159. }else{
  160. mescroll.endSuccess(_this.pagesize,false);
  161. }
  162. })
  163. },
  164. // 配置一下上拉和下拉
  165. configs: function() {
  166. var _this = this;
  167. this.frist = 2;
  168. this.configDownAndPull("mescroll", function(mescroll) {
  169. _this.mescroll = mescroll;
  170. _this.page = 1;
  171. _this.getStoreList(mescroll);
  172. }, function(mescroll) {
  173. if (_this.page < _this.totalPages) {
  174. _this.page = _this.page + 1;
  175. _this.getStockList(mescroll, 1);
  176. } else {
  177. mescroll.endSuccess(_this.size, false);
  178. }
  179. });
  180. },
  181. // 选择筛选条件
  182. chooseAndtion: function(type) {
  183. var types = ["brandList", "guigeList", "pattern"],
  184. _this = this;
  185. var data = eval('this.' + types[type]);
  186. this.chooseRegion(this.UIActionSelector, 1, data, function(ret) {
  187. if (ret.eventType == 'ok') {
  188. if (type == 0) {
  189. _this.choosePP = ret.selectedInfo[0]
  190. } else if (type == 1) {
  191. _this.chooseGG = ret.selectedInfo[0]
  192. } else {
  193. _this.chooseHW = ret.selectedInfo[0]
  194. }
  195. }
  196. _this.getStockList();
  197. })
  198. },
  199. // 获取筛选条件
  200. getWuliaoAntion: function() {
  201. var url = "getWuliaoAntionU",
  202. _this = this;
  203. var data = {
  204. storeId: this.userId,
  205. url: 'json',
  206. type: 'body'
  207. }
  208. this.$post(url, data, function(ret) {
  209. if (ret.code == 0 || ret.code == '0') {
  210. var brands = [{
  211. name: '全部'
  212. }],
  213. specs = [{
  214. name: '全部'
  215. }],
  216. pattern = [{
  217. name: '全部'
  218. }]
  219. ret.data.pingpaiList = ret.data.pingpaiList == null ? [] : ret.data.pingpaiList;
  220. ret.data.pingpaiList.map(function(pp, index) {
  221. brands.push({
  222. name: pp
  223. })
  224. })
  225. _this.brandList = brands;
  226. ret.data.guigeList = ret.data.guigeList == null ? [] : ret.data.guigeList;
  227. ret.data.guigeList.map(function(gg, index) {
  228. specs.push({
  229. name: gg
  230. })
  231. })
  232. _this.guigeList = specs;
  233. ret.data.huawenList = ret.data.huawenList == null ? [] : ret.data.huawenList;
  234. ret.data.huawenList.map(function(hw, index) {
  235. pattern.push({
  236. name: hw
  237. })
  238. })
  239. _this.pattern = pattern;
  240. if (_this.frist == 1) {
  241. _this.$nextTick(function() {
  242. _this.configs();
  243. })
  244. }
  245. }
  246. })
  247. },
  248. // 获取库存列表
  249. getStockList: function(mescroll) {
  250. var data = {
  251. "storeId": this.userId,
  252. "brand": this.brand,
  253. "specs": this.spec,
  254. "pattern": this.chooseHW.name == '全部' ? '' : this.chooseHW.name,//花纹
  255. "guige": this.keyword,//规格
  256. "startTime": this.starttime,
  257. "endTime": this.endtime,
  258. "size": this.page,
  259. "pageSize": this.pagesize,
  260. "url": "json",
  261. "type": "body"
  262. },
  263. _this = this,
  264. url = "searchKuCunU";
  265. this.$post(url, data, function(ret) {
  266. if (ret.code == 0 || ret.code == '0') {
  267. if(mescroll){
  268. mescroll.endSuccess(_this.pagesize,true);
  269. }
  270. _this.totalStock = ret.stock;
  271. _this.totalPages = ret.pageCount;
  272. var brand = new Array(),
  273. pattern = new Array(),
  274. spec = new Array();
  275. _this.stockList = ret.Data == null ? [] : ( _this.page == 1 ? ret.Data : _this.stockList.concat(ret.Data));
  276. }
  277. })
  278. },
  279. // 查看详情
  280. lookInfo: function() {
  281. this.goWin('kucunxiangqing_win', 'kucunxiangqing_win.html', '');
  282. },
  283. // 进入到轮胎信息配置页
  284. goSetting: function(params){
  285. this.goWin('tireInfoSetting_win', 'tireInfoSetting_win.html', {maktx:params.maktx,brand:params.brand,specs:params.specs,pattern:params.pattern});
  286. }
  287. },
  288. mounted: function() {
  289. var _this = this;
  290. this.init();
  291. this.addEvent("refreshPage",function(){
  292. _this.init();
  293. })
  294. }
  295. })
  296. }
  297. </script>
  298. </html>