agent_storage_body.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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. .kucunxiangqing,
  21. #app {
  22. overflow-y: scroll;
  23. }
  24. .kucunxiangqing .kucunList .srcollBox {
  25. overflow-y: scroll !important;
  26. }
  27. .kucunxiangqing .kucunList .title {
  28. position: static;
  29. }
  30. .kucunxiangqing .kucunList {
  31. position: static;
  32. padding-top: 0rem;
  33. }
  34. .kucunxiangqing {
  35. background-color: #fff !important;
  36. }
  37. .kucunxiangqing .typeFooter,
  38. .kucunxiangqing .leiji {
  39. background-color: #00a0ea !important;
  40. }
  41. .j-center {
  42. font-size: 0.3rem;
  43. }
  44. .list {
  45. padding: 0.2rem;
  46. border-bottom: 1px solid#e2e0e0;
  47. width: 96%;
  48. margin-left: 2%;
  49. }
  50. .top-center {
  51. margin: 0.1rem 0;
  52. }
  53. </style>
  54. <body>
  55. <div id="app" v-cloak>
  56. <div class="pageView kucunxiangqing col" id="mescroll">
  57. <!-- <div class="header flex a-center j-center">
  58. <i class="iconfont icon-back" onclick="history.go(-1)"></i>
  59. 库存查询
  60. <div class="toobla flex a-center">
  61. <div class="icon1"></div>
  62. <div class="icon2"></div>
  63. </div>
  64. </div>-->
  65. <div class="leiji flex a-center j-center">
  66. 库存总量:
  67. <h4>{{totalStock}}</h4>
  68. </div>
  69. <div class="typeFooter flex a-center j-center">
  70. <div class="item flex j-center a-center" v-on:click="getStoreByAnnation(0)">
  71. {{ chooseAndtion[0] || '品牌' }}
  72. </div><span></span>
  73. <div class="item flex j-center a-center" v-on:click="getStoreByAnnation(1)">
  74. {{ chooseAndtion[1] || '规格' }}
  75. </div><span></span>
  76. <!-- <div class="item flex j-center a-center" v-on:click="getStoreByAnnation(2)">
  77. {{ chooseAndtion[2] || '库存' }}
  78. </div><span></span> -->
  79. <div class="item flex j-center a-center" v-on:click="getStoreByAnnation(3)">
  80. {{ chooseAndtion[3] || '花纹' }}
  81. </div>
  82. </div>
  83. <div class="kucunList">
  84. <div class="title flex a-center 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="srcollBox" v-show="list.length > 0" >
  99. <div class="item flex a-center j-center" v-for="(item,index) in list" :key="index">
  100. <div class="fx1 flex a-center j-center">
  101. {{ item.maktx }}
  102. </div>
  103. <div class="fx1 flex a-center j-center">
  104. {{item.innumber}}
  105. </div>
  106. <div class="fx1 flex a-center j-center">
  107. {{item.outnumber}}
  108. </div>
  109. <div class="fx1 flex a-center j-center" v-on:click="lookInfo">
  110. {{ item.stock }}
  111. </div>
  112. </div>
  113. </div>
  114. <div v-show="list.length == 0" style="text-align:center">
  115. <img src="./image/nodata.png" style="margin:2rem auto;width:100%;height:100%" />
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </body>
  121. <link rel="stylesheet" href="./mescroll/mescroll.min.css">
  122. <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
  123. <script type="text/javascript" src="../script/api.js"></script>
  124. <script type="text/javascript" src="../script/httpRequest.js"></script>
  125. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  126. <script type="text/javascript">
  127. apiready = function() {
  128. new Vue({
  129. el: '#app',
  130. data: {
  131. UIActionSelector: '',
  132. kunnr: '',
  133. list: [], // 查询到的库存
  134. brand: [], // 品牌
  135. specification: [], // 规格
  136. pattern: [], // 花纹
  137. chooseAndtion: [], // 选中的条件
  138. totalStock: 0,
  139. page: 1,
  140. pagesize: '10',
  141. frist : 1,
  142. mescroll : '',
  143. },
  144. filters : {
  145. amountToStr : function(val){
  146. if(parseInt(val) > 10){
  147. return '充足'
  148. }else if(parseInt(val) <= 10 && parseInt(val) > 1){
  149. return '紧张';
  150. }else {
  151. return '缺货';
  152. }
  153. }
  154. },
  155. methods: {
  156. init: function() {
  157. this.UIActionSelector = api.require('UIActionSelector');
  158. this.kunnr = $api.getStorage('kunnr');
  159. this.getStore();
  160. },
  161. configs: function() {
  162. var _this = this;
  163. this.frist = 2;
  164. this.configDownAndPull("mescroll", function(mescroll) {
  165. _this.mescroll = mescroll;
  166. _this.page = 1;
  167. _this.getStore(mescroll);
  168. }, function(mescroll) {
  169. if (_this.page < _this.totalPages) {
  170. _this.page = _this.page + 1;
  171. _this.getStore(mescroll, 1);
  172. } else {
  173. mescroll.endSuccess(_this.pagesize, false);
  174. }
  175. })
  176. },
  177. // 获取库存列表
  178. getStore: function(mescroll) {
  179. var url = "checkStoreUrl",
  180. _this = this;
  181. var params = {
  182. kunnr: this.kunnr,
  183. page: this.page,
  184. pagesize: this.pagesize,
  185. brand: this.chooseAndtion[0] == '全部' ? '' : this.chooseAndtion[0],
  186. spec: this.chooseAndtion[1] == '全部' ? '' : this.chooseAndtion[1],
  187. pattern: this.chooseAndtion[3] == '全部' ? '' : this.chooseAndtion[3],
  188. type: 'body',
  189. url: 'json'
  190. };
  191. console.log(JSON.stringify(params));
  192. this.$post(url, params, function(ret) {
  193. if (ret.code == 0 || ret.code == '0') {
  194. if (ret.data.data != null) {
  195. _this.totalPages = ret.data.data.totalPage;
  196. _this.totalStock = ret.data.data.stock;
  197. _this.list = _this.page == 1 ? ret.data.data.list : _this.list.concat(ret.data.data.list);
  198. var brand = [{
  199. name: '全部'
  200. }];
  201. ret.data.data.brandList.map(function(item, index) {
  202. if (item != null) {
  203. brand.push({
  204. name: item
  205. })
  206. }
  207. });
  208. _this.brand = brand;
  209. var specification = [{
  210. name: '全部'
  211. }];
  212. ret.data.data.specList.map(function(item, index) {
  213. if (item != null) {
  214. specification.push({
  215. name: item
  216. })
  217. }
  218. })
  219. _this.specification = specification;
  220. var pattern = [{
  221. name: '全部'
  222. }];
  223. ret.data.data.patternList.map(function(item, index) {
  224. if (item != null) {
  225. pattern.push({
  226. name: item
  227. })
  228. }
  229. });
  230. _this.pattern = pattern;
  231. if (_this.frist == 1) {
  232. _this.$nextTick(function() {
  233. _this.configs();
  234. })
  235. }
  236. if (mescroll) {
  237. mescroll.endSuccess(_this.pagesize, true);
  238. }
  239. } else {
  240. _this.list = [];
  241. _this.pattern = [];
  242. _this.specification = [];
  243. _this.pattern = [];
  244. }
  245. }
  246. })
  247. },
  248. // 开始筛选
  249. getStoreByAnnation: function(index) {
  250. var list = ["brand", "specification", "", "pattern"],
  251. _this = this;
  252. this.page = 1;
  253. var chooseAn = eval("this." + list[index]);
  254. this.chooseRegion(this.UIActionSelector, 1, chooseAn, function(ret) {
  255. if (ret.eventType == 'ok') {
  256. _this.$set(_this.chooseAndtion, index, ret.level1);
  257. _this.getStore(_this.mescroll);
  258. }
  259. })
  260. },
  261. // 查看详情
  262. lookInfo: function() {
  263. // this.goWin('kucunxiangqing_win','kucunxiangqing_win.html','');
  264. }
  265. },
  266. mounted: function() {
  267. this.init();
  268. }
  269. })
  270. }
  271. </script>
  272. </html>