fac_storage_body.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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> {{ inventory | amountToStr }} </h4>
  68. </div>
  69. <div class="typeFooter flex a-center j-center">
  70. <div class="item flex j-center a-center" v-on:click="chooseAndtion(0)">
  71. {{ choosePP.name || '品牌' }}
  72. </div><span></span>
  73. <div class="item flex j-center a-center" v-on:click="chooseAndtion(1)">
  74. {{ chooseGG.name || '规格' }}
  75. </div><span></span>
  76. <div class="item flex j-center a-center" v-on:click="chooseAndtion(2)">
  77. {{ chooseHW.name || '花纹' }}
  78. </div>
  79. </div>
  80. <div class="kucunList" v-show="list.length > 0">
  81. <div class="title flex a-center j-center">
  82. <div class="item flex a-center j-center">
  83. 物料描述
  84. </div>
  85. <div class="item flex a-center j-center">
  86. 库存
  87. </div>
  88. </div>
  89. <div class="srcollBox">
  90. <div class="ite flex a-center j-center list" v-for="(item,index) in list" :key="index">
  91. <div class="fx1 a-center">
  92. {{ item.maktx }}
  93. </div>
  94. <div class="fx1 a-center" style="text-align: center">
  95. {{ item.useablestock }}
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. <div v-show="list.length == 0" style="text-align:center">
  101. <img src="./image/noData.png" style="margin:2rem auto" />
  102. </div>
  103. </div>
  104. </div>
  105. </body>
  106. <link rel="stylesheet" href="./mescroll/mescroll.min.css">
  107. <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
  108. <script type="text/javascript" src="../script/api.js"></script>
  109. <script type="text/javascript" src="../script/httpRequest.js"></script>
  110. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  111. <script type="text/javascript">
  112. apiready = function() {
  113. new Vue({
  114. el: '#app',
  115. data: {
  116. UIActionSelector: '',
  117. token: '',
  118. list: [], // 查询到的库存
  119. brand: [], // 品牌
  120. specification: [], // 规格
  121. pattern: [], // 花纹
  122. // chooseAndtion: [], // 选中的条件
  123. inventory: 0,
  124. current: 1,
  125. size: 10,
  126. totalPages: 1,
  127. frist : 1,
  128. chooseGG : {},
  129. chooseHW : {},
  130. choosePP : {},
  131. },
  132. filters : {
  133. amountToStr : function(val){
  134. if(parseInt(val) > 10){
  135. return '充足'
  136. }else if(parseInt(val) <= 10 && parseInt(val) > 1){
  137. return '紧张';
  138. }else {
  139. return '缺货';
  140. }
  141. }
  142. },
  143. methods: {
  144. init: function() {
  145. var _this = this;
  146. this.UIActionSelector = api.require('UIActionSelector');
  147. this.token = $api.getStorage('token');
  148. this.getStore();
  149. },
  150. configs : function(){
  151. var _this = this;
  152. this.frist = 2;
  153. this.configDownAndPull("mescroll", function(mescroll) {
  154. _this.page = 1;
  155. _this.getStore(mescroll);
  156. }, function(mescroll) {
  157. if (_this.page < _this.totalPages) {
  158. _this.page = _this.page + 1;
  159. _this.getStore(mescroll, 1);
  160. } else {
  161. mescroll.endSuccess(_this.pageSize, false);
  162. }
  163. })
  164. },
  165. // 获取库存列表
  166. getStore: function(mescroll) {
  167. var url = "checkFactoryStoreUrl",
  168. _this = this,
  169. data = {
  170. token: this.token,
  171. brand : this.choosePP.name,
  172. page: this.page,
  173. pagesize: this.pagesize,
  174. specification : this.chooseGG.name,
  175. pattern : this.chooseHW.name,
  176. type: 'body',
  177. url: 'json'
  178. };
  179. this.$post(url, data, function(ret) {
  180. if (ret.code == 0 || ret.code == '0') {
  181. if (mescroll) {
  182. mescroll.endSuccess(_this.size, true);
  183. }
  184. if (ret.data.data != null) {
  185. _this.list = _this.current == 1 ? ret.data.data.material : _this.list.concat(ret.data.data.material);
  186. _this.inventory = ret.data.inventory;
  187. if(_this.frist == 1){
  188. _this.$nextTick(function(){
  189. _this.configs();
  190. })
  191. }
  192. var brand = new Array();
  193. ret.data.data.brand.map(function(item, index) {
  194. brand.push({
  195. name: item.brand
  196. })
  197. });
  198. _this.brand = brand;
  199. var specification = new Array();
  200. ret.data.data.specification.map(function(item, index) {
  201. specification.push({
  202. name: item
  203. })
  204. })
  205. _this.specification = specification;
  206. var pattern = new Array()
  207. ret.data.data.pattern.map(function(item, index) {
  208. pattern.push({
  209. name: item
  210. })
  211. });
  212. _this.pattern = pattern;
  213. } else {
  214. _this.list = [];
  215. _this.pattern = [];
  216. _this.specification = [];
  217. _this.pattern = [];
  218. }
  219. }
  220. })
  221. },
  222. // 开始筛选
  223. getStoreByAnnation: function(index) {
  224. var list = ["brand", "specification", "", "pattern"],
  225. _this = this;
  226. var chooseAn = eval("this." + list[index]);
  227. this.chooseRegion(this.UIActionSelector, 1, chooseAn, function(ret) {
  228. if (ret.eventType == 'ok') {
  229. _this.$set(_this.chooseAndtion, index, ret.level1);
  230. }
  231. })
  232. },
  233. // 查看详情
  234. lookInfo: function() {
  235. this.goWin('kucunxiangqing_win', 'kucunxiangqing_win.html', '');
  236. },
  237. chooseAndtion : function(type){
  238. var types = ["brand","specification","pattern"],_this = this;
  239. var data = eval('this.' + types[type]);
  240. this.chooseRegion(this.UIActionSelector,1,data,function(ret){
  241. if(ret.eventType == 'ok'){
  242. if(type == 0){
  243. _this.choosePP = ret.selectedInfo[0]
  244. }else if(type == 1){
  245. _this.chooseGG = ret.selectedInfo[0]
  246. }else{
  247. _this.chooseHW = ret.selectedInfo[0]
  248. }
  249. }
  250. _this.getStore();
  251. })
  252. }
  253. },
  254. mounted: function() {
  255. this.init();
  256. }
  257. })
  258. }
  259. </script>
  260. </html>