123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <!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="pt0 pb0" 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="title" v-if="toptitleisshow" @click-left="goback">
- <template #left> <img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <van-notice-bar wrapable color="#eea75b" :scrollable="false" text="请仔细与包装盒或者整箱机具的SN号进行对比,确认无误再划拨"></van-notice-bar>
- <div class="van-tabs__content pl16 pr16 mt16">
- <div class="option df f14">
- <div class="c333">划拨方式</div>
- <button class="bgcfff" @click="transfer('逐台划拨')">逐台发货</button>
- <button class="bgcfff" @click="transfer('整箱划拨')">批量发货</button>
- </div>
- <div class="snlist f16">
- <div class="undatatips tc c999" v-if="snlist.length === 0">暂无SN数据</div>
- <van-cell-group>
- <van-cell v-for="(item, index) in snlist" :key="item.Id" clickable :title="`SN码: ${item.PosSn}`"></van-cell>
- </van-cell-group>
- </div>
- </div>
- <van-goods-action class="mall-bottom">
- <van-goods-action-button class="kxs-btn" type="default" color="#FFD500" text="确认发货" @click="posttransfer"></van-goods-action-button>
- </van-goods-action>
- <van-overlay :show="nextshow" @click="closenextshow">
- <div class="unbindpop cm">
- <div class="unbindcard tc" @click.stop>
- <div class="f12 tc c666 title">总共划拨{{snlist.length}}台,请仔细核对SN号及姓名是否正确</div>
- <input type="text" v-model="createercode" placeholder="请输入创客编号" @focus="inputbtn">
- <div class="f10" v-if="isget" style="color:#D43030;">{{errinfo}}</div>
- <div class="f12 tc c333 title" v-if="createrinfo.RealName !== ''">姓名:{{createrinfo.RealName}}</div>
- <div class="f12 tc c333 title" v-if="createrinfo.RealName !== ''">该创客已有{{sncount}}台预发机</div>
- <div class="nextbutton cfff cm mt16 f14" @click="diaolignextbtn" style="color:#333;">{{createrinfo.RealName === ''? '下一步' : '确认无误划拨'}}</div>
- </div>
- </div>
- </van-overlay>
- </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(){
- app.onstartfn();
- };
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- nextshow:false,
- toptitleisshow:false,
- title:'',
- active: 1,
- //- 下拉刷新
- loading: false,
- finished: false,
- refreshing: false,
- show:false,
- userinfo:{},
- createercode:'',
- errinfo:'',
- isget:false,
- sncount:0,
- createrinfo:{
- RealName:'',
- Id:'',
- },
- snlist: [
- ],
- };
- },
- async created() {
- this.title = PublicLib.getCookieInfo('warehouseName');
- this.toptitleisshow = toptitleisshow;
- PublicLib.SetTitle({Title:PublicLib.getCookieInfo('warehouseName')});
- this.onstartfn();
- },
- methods: {
- diaolignextbtn:undebounce(async function(){
- this.isget = false;
- if(this.createercode === '') return tips('请输入创客编号');
- if(this.createrinfo.RealName === '') {
- const res = await getRequest('api/v1/users/forcode?t='+Math.random(6),JSON.stringify({MakerCode:this.createercode}));
- if(res.status !== '1')return tips(res.info);
- this.createrinfo = res.data;
- const FromUserId = PublicLib.getCookieInfo('userId');
- const FromStoreId = PublicLib.getCookieInfo('warehouseId');
- const sncount = await getRequest('api/v1/pos/smallstorehouse/detail?t='+Math.random(6),JSON.stringify({MakerCode:this.createercode,FromUserId,FromStoreId}));
- this.sncount = sncount.data.TotalNum;
- } else{
- if(!this.createrinfo.RealName){
- return tips('请输入正确的创客编号!');
- };
- const FromStoreId = PublicLib.getCookieInfo('warehouseId');
- const BrandId = PublicLib.getCookieInfo('brandId');
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await postRequest('/api/v1/pos/presendstockdetail/send?t='+Math.random(6),JSON.stringify({UserId,FromStoreId,SnIds:this.snnolist(),ToUserId:this.createrinfo.Id,BrandId}));
- if(res.status !== '1'){this.isget = true;return this.errinfo = res.info;};
- tips('预发机发货成功,请提醒创客签收');
- this.nextshow = false;
- this.createrinfo = {RealName:'',Id:''};
- this.createercode = '';
- this.errinfo = '';
- setTimeout(()=>{
- this.goback();
- },2000);
- }
- }),
- inputbtn(){
- this.createrinfo.RealName = '';
- },
- closenextshow(){
- this.nextshow = false;
- this.createercode = '';
- this.createrinfo.RealName = '';
- this.errinfo = '';
- },
- async onstartfn(){
- if(PublicLib.getCookieInfo('transferType') === '逐台划拨' && PublicLib.getCookieInfo('warehouseisback') === 'true'){
- PublicLib.putCookieInfo('warehouseisback', '');
- this.snlist = JSON.parse(PublicLib.getCookieInfo('warehouseSnList'));
- }else if(PublicLib.getCookieInfo('transferType') === '整箱划拨' && PublicLib.getCookieInfo('warehouseisback') === 'true'){
- PublicLib.putCookieInfo('warehouseisback', '');
- this.snlist = JSON.parse(PublicLib.getCookieInfo('warehouseSnList'));
- };
- const num = 0;
- this.snlist.splice( 10 , this.snlist.length - 10);
- PublicLib.putCookieInfo('warehouseSnList', JSON.stringify([]));
- },
- giveToast(str){
- vant.Toast(str);
- },
- copyinfo(){
- const that = this;
- const clipboard = new ClipboardJS(this.$refs.copy);
- clipboard.on('success', function(e) {
- that.giveToast('复制成功');
- });
- clipboard.on('error', function(e) {
- that.giveToast('复制失败,请手动选择复制!');
- });
- },
- goback(){
- PublicLib.GoBack({Level:1});
- },
- //- 跳转划拨搜索
- transfer(type){
- PublicLib.putCookieInfo('transferType', type);
- PublicLib.Goto({Url:'warehouse-deliver-transfer'});
- },
- snnolist(){
- return this.snlist.map(item=>item.Id).join(',');
- },
- backOrder(){
- this.show = true
- },
- //- 确认发货
- async posttransfer(){
- if(this.snlist.length === 0) return tips('请先选择SN');
- this.nextshow = true;
- },
-
-
- }
- });
- </script>
- </body>
- </html>
|