123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>仓库管理-划拨-创业帮</title>
- <meta name="keywords" content="仓库管理-划拨-创业帮">
- <meta name="description" content="仓库管理-划拨-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="仓库管理-划拨-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- <style>
- .mall-bottom{padding:0 .3733rem;height:54px;}
- .mall-bottom button{border-radius:999px !important; height:80% !important;}
- </style>
- </head>
- <body class="vh100 pt0 pb0 ovh" style="padding-top:0;">
- <div class="warehouse rel h100p" id="app" v-cloak>
- <van-nav-bar class="user_rank_explan_title user_title_normal titlef16 rightc333" left-arrow :title="type === 0 ? '逐台划拨':'整箱划拨'" v-if="toptitleisshow" @click-left="goback">
- <template #left><img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <van-notice-bar v-if="type === 0" wrapable color="#eea75b" :scrollable="false" text="提示:可输入SN号后8位或者扫描条形码进行搜索"></van-notice-bar>
- <van-notice-bar v-if="type === 1" wrapable color="#eea75b" :scrollable="false" text="请输入或者扫描整箱机具的首台SN号,自动叠加整箱数"></van-notice-bar>
- <van-search class="top_search" v-model="searchContent" show-action @search="onSearch">
- <template #action>
- <div class="df searchbtn">
- <div class="searchcolor" @click="onSearch">搜索</div>
- <van-icon class="f16 searchicon" name="scan" @click="scanning"></van-icon>
- </div>
- </template>
- </van-search>
- <div class="f16 n transfer">
- <van-cell clickable v-if="snlist.length !== 0 && type !== 0" @click="checkall">
- <template #title>
- <div class="f14 c333">全选</div>
- </template>
- <template #icon>
- <van-checkbox class="mr16" v-model="ischeckall" ref="checkboxes" checked-color="#FF5A32"></van-checkbox>
- </template>
- </van-cell>
- <div class="ovh-x" ref="wrapper1">
- <div class="undatatips tc c999" v-if="snlist.length === 0">暂无任何数据</div>
- <van-checkbox-group v-else v-model="result">
- <van-cell class="warehousecell" v-for="(item, index) in snlist" :key="item.Id" :value="item.ProductType" clickable @click="toggle(index)">
- <template #title>
- <div class="f14 c333"><span class="vm">SN:</span><span class="vm pr6" :id="'sn'+index">{{item.PosSn}}</span><span class="dib vm copyicon" :data-clipboard-text="item.PosSn" data-clipboard-action="copy" :data-clipboard-target="'#sn'+index" :ref="'copy'+index" @click.stop="copySN(index)" @mouseenter="copySN(index)"><img src="./static/images/icon-copy.png" alt="" width="14" height="14"></span></div>
- </template>
- <template #icon>
- <van-checkbox class="mr16" :name="item" ref="checkboxes" checked-color="#FF5A32"></van-checkbox>
- </template>
- </van-cell>
- </van-checkbox-group>
- </div>
- </div>
- <van-goods-action class="mall-bottom">
- <van-goods-action-button class="kxs-btn" type="default" color="#FFD500" :text="'确定 共'+result.length+'个'" @click="surebtn"></van-goods-action-button>
- </van-goods-action>
- </div>
- <script src="./static/js/clipboard.min.js"></script>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script>
- function OnStart(){
- allSearchContent = PublicLib.getCookieInfo("ScanContent");
- PublicLib.putCookieInfo('ScanContent', '');
- //- 拿到扫描结果进行赋值传输
- if(allSearchContent === undefined){
- return;
- };
- if(allSearchContent !== ''){
- app.getonlysearchresult(allSearchContent);
- };
- };
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- toptitleisshow:false,
- type:1,
- searchContent:'',
- //- 下拉刷新
- loading: false,
- finished: false,
- refreshing: false,
- result: [],
- snlist:[
- ],
- ischeckall:false,
- pageinfo:{
- PageSize:100,
- PageNum:1
- },
- flag:false,
- };
- },
- created() {
- this.toptitleisshow = toptitleisshow;
- this.type = PublicLib.getCookieInfo('transferType') === '逐台划拨' ? 0 : 1;
- PublicLib.SetTitle({Title:PublicLib.getCookieInfo('transferType')});
- },
- beforeUpdate(){
- this.$nextTick(() => {
- this.$refs.wrapper1.style.height = `${document.documentElement.clientHeight - 180}px`;
- });
- },
- methods: {
- giveToast(str){
- vant.Toast(str);
- },
- onSearch(){
- if(this.searchContent.length < 8) return tips('请最少输入8位SN号');
- if(this.searchContent === '') return tips('请先输入SN号或者扫描','top');
- this.flag = true;
- this.getonlysearchresult()
- //- this.searchContent='';
- },
- copySN(index){
- const that = this;
- this.$nextTick(() => {
- that.copyBtn = new ClipboardJS(this.$refs['copy'+index][0]);
-
- const clipboard = that.copyBtn;
- clipboard.on('success', function(e) {
- that.giveToast('复制成功');
- });
- clipboard.on('error', function(e) {
- that.giveToast('复制失败,请手动选择复制!');
- });
- });
- },
- checkall(){
- const that = this;
- that.ischeckall = !that.ischeckall;
- if(that.ischeckall){
- that.result = that.snlist;
- }else{
- that.result = [];
- };
- },
- toggle(index) {
- const that = this;
- this.$refs.checkboxes[index].toggle();
- setTimeout(() => {
- if(that.result.length == that.snlist.length){
- that.ischeckall = true;
- }else{
- that.ischeckall = false;
- };
- }, 100);
- },
- async scanning(){
- PublicLib.ScanQRCode();
- },
- goback(){
- PublicLib.GoBack({Level:1});
- },
- async getonlysearchresult(info){
- if(info){
- this.searchContent = info;
- };
- let Url = '';
- switch(this.type){
- case 0:
- Url = 'api/v1/pos/posmachines/onesearch?t='+Math.random(6);
- break;
- case 1:
- Url = 'api/v1/pos/posmachines/wholesearch?t='+Math.random(6);
- break;
- };
- PublicLib.ShowLoading({Message:''});
- const StoreId = PublicLib.getCookieInfo('warehouseId');
- const BrandId = PublicLib.getCookieInfo('brandId');
- const res = await getRequest(Url,JSON.stringify({...this.pageinfo,SearchKey:this.searchContent,StoreId,BrandId}));
- if(res.status !== '1') return tips('搜索订单详情失败');
- PublicLib.HideLoading();
- switch(this.type){
- case 0:
- if(res.data.length === 0) return tips('仓库暂无该机具!')
- this.snlist.forEach(item=>{
- if(item.Id === res.data[0].Id){
- this.flag = false;
- tips('请输入不同SN号进行搜索!')
- };
- });
- if(this.flag){
- this.snlist.push(...res.data);
- };
- break;
- case 1:
- this.snlist = res.data;
- break;
- };
- },
- surebtn(){
- if(this.result.length === 0) return tips('请选择SN号');
- PublicLib.putCookieInfo('warehouseisback', 'true');
- PublicLib.putCookieInfo('warehouseSnList', JSON.stringify(this.result));
- PublicLib.ShowLoading({Message:'请稍后...'});
- setTimeout(()=>{
- PublicLib.HideLoading();
- PublicLib.GoBack({Level:1});
- },1500);
- }
- }
- });
- </script>
- </body>
- </html>
|