kucunchaxun_body.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  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. .kucunxiangqing,
  23. #app {
  24. overflow-y: scroll;
  25. }
  26. .kucunxiangqing .kucunList .srcollBox {
  27. overflow-y: scroll !important;
  28. }
  29. .kucunxiangqing .kucunList .title {
  30. position: static;
  31. }
  32. .kucunxiangqing .kucunList {
  33. position: static;
  34. padding-top: 0rem;
  35. }
  36. .kucunxiangqing {
  37. background-color: #fff !important;
  38. }
  39. .kucunxiangqing .typeFooter,
  40. .kucunxiangqing .leiji {
  41. background-color: #00a0ea !important;
  42. }
  43. .j-center {
  44. font-size: 0.3rem;
  45. }
  46. .list {
  47. padding: 0.2rem;
  48. border-bottom: 1px solid#e2e0e0;
  49. width: 96%;
  50. margin-left: 2%;
  51. }
  52. .top-center {
  53. margin: 0.1rem 0;
  54. }
  55. .searchSpec {
  56. z-index: 1111;
  57. width:85%;
  58. height: 1rem;
  59. }
  60. .search {
  61. top: 0rem;
  62. }
  63. .search {
  64. width: 100%;
  65. background: #00a0ea;
  66. height: 1rem;
  67. padding-left: 0.36rem;
  68. padding-right: 0.36rem;
  69. }
  70. .search .searchbox input {
  71. width: 100%;
  72. font-size: 0.3rem;
  73. display: block;
  74. color: #999;
  75. height: 100%;
  76. position: relative;
  77. padding-left: 5%;
  78. padding-right: 5%;
  79. background: none;
  80. border: 0;
  81. outline: none;
  82. margin-top: 0.1rem;
  83. }
  84. .searchbox {
  85. background-color: #fff;
  86. display: flex;
  87. padding: 0.1rem;
  88. width: 100%;
  89. border-radius: 5px;
  90. }
  91. .gouwuche .caigouBg .caigouBgPix {
  92. padding: 0;
  93. }
  94. .caigouBgPix {
  95. background: #00a0ea;
  96. }
  97. .line1 {
  98. width:100px;
  99. overflow: hidden;
  100. text-overflow:ellipsis;
  101. text-align: center;
  102. white-space: nowrap;
  103. }
  104. .mescroll{
  105. position: relative;
  106. height: 85%;
  107. }
  108. </style>
  109. <body>
  110. <div id="app" v-cloak>
  111. <div class="pageView kucunxiangqing col">
  112. <!-- <div class="header flex a-center j-center">
  113. <i class="iconfont icon-back" onclick="history.go(-1)"></i>
  114. 库存查询
  115. <div class="toobla flex a-center">
  116. <div class="icon1"></div>
  117. <div class="icon2"></div>
  118. </div>
  119. </div>-->
  120. <div class="leiji flex a-center j-center">
  121. 库存总量:
  122. <h4> {{ info.stock | amountToStr }} </h4>
  123. </div>
  124. <div class="caigouBgPix flex a-center" style="flex-wrap: wrap;">
  125. <div class="searchSpec">
  126. <div class="search flex a-center">
  127. <div class="searchbox">
  128. <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">
  129. <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>
  130. </svg>
  131. <input type="search" placeholder="请输入轮胎规格" v-model="keyword">
  132. </div>
  133. </div>
  134. </div>
  135. <!-- <div class="item flex a-center j-center" v-on:click="chooseAntion(0)" style="width:20%;color:#fff;">
  136. <p class="line1">{{ chooseAndtion[0] || '品牌' }} </p><i class="iconfont icon-xia" style="margin-left:5px"></i>
  137. </div> -->
  138. <div class="item flex a-center j-center line1" v-on:click="chooseAntion(1)" style="width:15%;color:#fff">
  139. {{ chooseAndtion[1] || '花纹' }} <i class="iconfont icon-xia" style="margin-left:5px"></i>
  140. </div>
  141. <!-- <div class="item flex a-center j-center">
  142. {{ choosePPone || '品牌' }}
  143. </div>
  144. <div class="fgx"></div> -->
  145. <!-- <div class="item flex a-center j-center" v-on:click="chooseAndtion(1)">
  146. {{ chooseGG.name || '规格' }} <i class="iconfont icon-xia"></i>
  147. </div>
  148. <div class="fgx"></div> -->
  149. <!-- <div class="item flex a-center j-center" v-on:click="chooseAndtion(2)">
  150. {{ chooseHW.name || '花纹' }} <i class="iconfont icon-xia"></i>
  151. </div> -->
  152. </div>
  153. <!-- <div class="typeFooter flex a-center j-center">
  154. <div class="item flex j-center a-center" v-on:click="chooseAntion(0)">
  155. {{ chooseAndtion[0] || '品牌' }}
  156. </div><span></span>
  157. <div class="item flex j-center a-center" v-on:click="chooseAntion(1)">
  158. {{ chooseAndtion[1] || '花纹' }}
  159. </div><span></span>
  160. <div class="item flex j-center a-center" v-on:click="chooseAntion(2)">
  161. {{ chooseAndtion[2] || '规格' }}
  162. </div>
  163. </div> -->
  164. <div class="mescroll-touch-y mescroll" id="mescroll">
  165. <div class="kucunList" v-show="stockList.length > 0">
  166. <!-- <div class="title flex a-center j-center"> -->
  167. <!-- <div class="item flex a-center j-center">
  168. 物料描述
  169. </div>
  170. <div class="item flex a-center j-center">
  171. 月入库
  172. </div>
  173. <div class="item flex a-center j-center">
  174. 月出库
  175. </div>
  176. <div class="item flex a-center j-center">
  177. 库存
  178. </div>
  179. </div> -->
  180. <!-- -->
  181. <div class="srcollBox">
  182. <div class="ite a-center j-center list" v-for="(item,index) in stockList" :key="index">
  183. <div class="fx1 flex a-center">
  184. {{ item.maktx }}
  185. </div>
  186. <!-- <div class="fx1 flex a-center top-center">
  187. <p style="flex:1">月入库:{{ item.innumber }}</p>
  188. <p style="flex:1">月出库:{{ item.outnumber }}</p>
  189. </div> -->
  190. <div class="fx1 flex a-center">
  191. <p>库存:{{ item.stock | amountToStr }}</p>
  192. </div>
  193. </div>
  194. </div>
  195. </div>
  196. <div v-show="stockList.length == 0" style="text-align:center">
  197. <img src="./image/noData.png" style="margin:2rem auto" />
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202. </body>
  203. <script type="text/javascript" src="../script/api.js"></script>
  204. <script type="text/javascript" src="../script/httpRequest.js"></script>
  205. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  206. <script type="text/javascript">
  207. apiready = function() {
  208. new Vue({
  209. el: '#app',
  210. data: {
  211. kunnr: '', // 绑定的经销商kunnr
  212. brand: '', // 品牌
  213. spec: '', // 规格
  214. pattern: '', // 花纹
  215. starttime: '', // 开始时间
  216. endtime: '', // 结束时间
  217. page: 1,
  218. pagesize: 10,
  219. totalPages: 1,
  220. info: {}, // 包含总库存,筛选品牌,规格,库存
  221. stockList: [], // 库存列表
  222. userid: '',
  223. chooseAndtion: [],
  224. UIActionSelector: '',
  225. keyword : '',
  226. },
  227. watch : {
  228. keyword : function(nw,ow){
  229. this.page = 1;
  230. this.chooseAndtion[2] = nw;
  231. this.getStockList();
  232. }
  233. },
  234. filters: {
  235. amountToStr: function(val) {
  236. if (parseInt(val) > 10) {
  237. return '充足'
  238. } else if (parseInt(val) <= 10 && parseInt(val) > 1) {
  239. return '紧张';
  240. } else {
  241. return '缺货';
  242. }
  243. }
  244. },
  245. methods: {
  246. init: function() {
  247. var _this = this;
  248. this.kunnr = $api.getStorage('kunnr');
  249. this.userid = $api.getStorage('userid');
  250. this.UIActionSelector = api.require("UIActionSelector");
  251. this.getStockList();
  252. // 配置上拉加载下拉刷新
  253. this.configDownAndPull("mescroll", function(mescroll) {
  254. _this.page = 1;
  255. _this.getStockList(mescroll);
  256. }, function(mescroll) {
  257. if (_this.page < _this.totalPages) {
  258. _this.page = _this.page + 1;
  259. _this.getStockList(mescroll, 1);
  260. } else {
  261. mescroll.endSuccess(_this.pagesize, false);
  262. }
  263. })
  264. },
  265. // 获取库存列表
  266. getStockList: function(mescroll) {
  267. var data = {
  268. "storeId": this.userid,
  269. "brand": this.chooseAndtion[0] == '全部' ? '' : this.chooseAndtion[0],
  270. "spec": this.chooseAndtion[2] == '全部' ? '' : this.chooseAndtion[2],
  271. "pattern": this.chooseAndtion[1] == '全部' ? '' : this.chooseAndtion[1],
  272. "page": this.page,
  273. "pagesize": this.pagesize,
  274. "url": "json",
  275. "type": "body"
  276. },
  277. _this = this,
  278. url = "getStockListU";
  279. this.$post(url, data, function(ret) {
  280. if (ret.code == 0 || ret.code == '0') {
  281. if (mescroll) {
  282. mescroll.endSuccess(_this.pagesize, true);
  283. }
  284. _this.totalPages = ret.data.data.totalPage;
  285. var brand = [{
  286. name: '全部'
  287. }],
  288. pattern = [{
  289. name: '全部'
  290. }],
  291. spec = [{
  292. name: '全部'
  293. }];
  294. ret.data.data.brandList.map(function(b, index) {
  295. if (b != null) {
  296. brand.push({
  297. name: b
  298. })
  299. }
  300. })
  301. ret.data.data.patternList.map(function(p, index) {
  302. if (p != null) {
  303. pattern.push({
  304. name: p
  305. })
  306. }
  307. })
  308. ret.data.data.specList.map(function(s, index) {
  309. if (s != null) {
  310. spec.push({
  311. name: s
  312. })
  313. }
  314. })
  315. _this.info = {
  316. stock: ret.data.data.stock,
  317. brand: brand,
  318. pattern: pattern,
  319. spec: spec
  320. }
  321. _this.stockList = _this.page == 1 ? ret.data.data.list : _this.stockList.concat(ret.data.data.list);
  322. }
  323. })
  324. },
  325. // 查看详情
  326. lookInfo: function() {
  327. this.goWin('kucunxiangqing_win', 'kucunxiangqing_win.html', '');
  328. },
  329. // 点击选择
  330. chooseAntion: function(index) {
  331. var list = ["brand", "pattern", "spec"],
  332. _this = this;
  333. this.page = 1;
  334. var chooseAn = eval("this.info." + list[index]);
  335. this.chooseRegion(this.UIActionSelector, 1, chooseAn, function(ret) {
  336. if (ret.eventType == 'ok') {
  337. _this.$set(_this.chooseAndtion, index, ret.level1);
  338. _this.getStockList();
  339. }
  340. })
  341. }
  342. },
  343. mounted: function() {
  344. this.init();
  345. }
  346. })
  347. }
  348. </script>
  349. </html>