warehouse-mini-warehouse.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>小分仓-创业帮</title>
  6. <meta name="keywords" content="小分仓-创业帮">
  7. <meta name="description" content="小分仓-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="小分仓-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. </head>
  17. <body class="pb0 ovh pt0">
  18. <div class="warehouse-mini" id="app" v-cloak style="height:100vh;background-color: #F6F6F6;">
  19. <van-nav-bar class="user_rank_explan_title user_title_normal titlef16 rightc333" left-arrow title="小分仓" v-if="toptitleisshow" @click-left="goback">
  20. <template #left><img src="./static/images/left.png" alt=""></template>
  21. </van-nav-bar>
  22. <van-search class="top_search" v-model="searchContent" show-action placeholder="请输入创客编号或机具SN号后8位搜索" @search="onSearch">
  23. <template #action>
  24. <div class="df">
  25. <div class="searchcolor mr12" @click="onSearch">搜索</div>
  26. </div>
  27. </template>
  28. </van-search>
  29. <div class="ovh-x" ref="wrapper1">
  30. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height:100%;min-height:10vh;">
  31. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="!isdata"></van-empty>
  32. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="true" v-else>
  33. <div class="infoBox bgcfff" v-for="creator,creind in creatorList" v-if="creator.BrandList.length !== 0">
  34. <div class="userpanel df aic">
  35. <div class="imgbox tc mr12 df aic fl-dr-col"><img class="headportrait" :src="creator.HeadPhoto ? showHost + creator.HeadPhoto : 'http://ap.kexiaoshuang.com/default.png'" alt=""><img class="grade_rank" :src="gradephoto[creator.UserLevel-1]" alt=""></div>
  36. <div class="userinfo jcsb df fl-dr-col">
  37. <div class="name f14"> <span class="mr12">{{creator.UserName}}</span><span>{{creator.MakerCode}}</span></div>
  38. <div class="phonenumber f12 c999">{{creator.phoneNum}}</div>
  39. </div>
  40. <button class="c333 leftbtn f12" @click="takephone(creator.Mobile)">联系TA</button>
  41. </div>
  42. <div class="df jcsb fl-dr-col c000 mb6" v-for="(item,index) in creator.BrandList" :key="index">
  43. <div class="df aic"><img class="mr8 brandimg" :src="'./static/images/product-short'+item.Id+'.png'" alt="">
  44. <div class="f14 c333">{{item.Name}}</div>
  45. </div>
  46. <div class="df jcsb aic" v-for="i,ind in item.SnList" :key="i.Id">
  47. <div class="f12" style="width:4.1rem">{{i.SnNo}}</div>
  48. <div class="sendStatus" :class="{active : i.Status,'not-active': !i.Status}">{{i.Status ? '已确认' : '待确认'}}</div>
  49. <div class="btn f12" @click="withdraw(i,index,creind)">撤回</div>
  50. </div>
  51. </div>
  52. </div>
  53. </van-list>
  54. </van-pull-refresh>
  55. </div>
  56. </div>
  57. <script src="./static/js/klm-vv.min.js"></script>
  58. <script src="./static/js/appfunc.min.js"></script>
  59. <script src="./static/js/klm-axios-config.js"></script>
  60. <script src="./static/js/publicfn.js"></script>
  61. <script>
  62. Vue.use(vant.Lazyload);
  63. let app = new Vue({
  64. el: '#app',
  65. data(){
  66. return{
  67. toptitleisshow,
  68. searchContent:'',
  69. refreshing:false,
  70. finished:false,
  71. loading:false,
  72. pageinfo:{
  73. PageSize:10,
  74. PageNum:1
  75. },
  76. gradephoto:[
  77. './static/images/grade-k1.png',
  78. './static/images/grade-k2.png',
  79. './static/images/grade-k3.png',
  80. './static/images/grade-k4.png',
  81. './static/images/grade-k5.png',
  82. './static/images/grade-k6.png',
  83. './static/images/grade-k7.png',
  84. './static/images/grade-k8.png',
  85. './static/images/grade-k9.png',
  86. ],
  87. creatorList:[
  88. ],
  89. isdata:false,
  90. }
  91. },
  92. created(){
  93. this.getminiWarehouse()
  94. },
  95. beforeUpdate(){
  96. this.$nextTick(()=>{
  97. this.$refs.wrapper1.style.height = `${document.documentElement.clientHeight - 50}px`;
  98. })
  99. },
  100. methods:{
  101. goback(){
  102. PublicLib.GoBack({Level:1});
  103. },
  104. takephone(phonenum){
  105. PublicLib.PhoneCall(phonenum);
  106. },
  107. onLoad(){
  108. this.pageinfo.PageNum++;
  109. this.getminiWarehouse('onload');
  110. this.refreshing = false;
  111. },
  112. onRefresh(){
  113. this.loading = true;
  114. this.finished = false;
  115. this.pageinfo.PageNum = 1;
  116. this.getminiWarehouse();
  117. this.refreshing = false;
  118. },
  119. //获取列表
  120. async getminiWarehouse(type='refresh'){
  121. const that = this;
  122. let UserId = PublicLib.getCookieInfo('userId');
  123. let {PageSize,PageNum} = this.pageinfo
  124. const res = await getRequest('api/v1/pos/smallstorehouse/list?t='+Math.random(6),JSON.stringify({UserId,SearchKey:this.searchContent,PageSize,PageNum}));
  125. if(res.status !== '1') return tips('请求失败!请重试')
  126. if(res.status === '1'){
  127. if(res.data.length < PageSize){
  128. this.finished = true
  129. };
  130. if(type === 'onload'){
  131. this.creatorList = [...this.creatorList,...res.data];
  132. this.loading = false;
  133. };
  134. if(type === 'refresh'){
  135. this.creatorList = res.data;
  136. let isall = false;
  137. res.data.forEach(item=>{
  138. if(item.BrandList.length !== 0){
  139. isall = true;
  140. };
  141. });
  142. if(isall){
  143. that.isdata = true;
  144. }else{
  145. that.isdata = false;
  146. }
  147. };
  148. };
  149. },
  150. onSearch(){
  151. this.getminiWarehouse()
  152. },
  153. //撤回
  154. withdraw:undebounce(async function(item,index,creind){
  155. let delIndex = this.creatorList[creind].BrandList[index].SnList.findIndex((i)=> i.Id == item.Id);
  156. let UserId = PublicLib.getCookieInfo('userId');
  157. const res = await postRequest('api/v1/pos/presendstockdetail/cancel?t='+Math.random(6),JSON.stringify({UserId,SnId:item.Id}));
  158. if(res.status !== '1') return tips('操作失败!请重试');
  159. if(res.status === '1'){
  160. this.creatorList[creind].BrandList[index].SnList.splice(delIndex,1);
  161. tips('撤回成功!');
  162. this.pageinfo.PageNum = 1;
  163. this.getminiWarehouse();
  164. };
  165. }),
  166. },
  167. })
  168. </script>
  169. </body>
  170. </html>