123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652 |
- <!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>
- .allnum{padding:8px 15px 8px 0;border-bottom:1px solid #eee;margin-left:15px;}
- .van-tab__pane .ovh-x{padding-bottom:50px; box-sizing:border-box;}
- .cfff-btn .van-button__text{color:#fff !important;}
- .pb0{padding-bottom:0px !important;}
- .van-list{min-height:50vh;}
- .mall-bottom{padding:0 .3733rem;height:54px;}
- .mall-bottom .button{border-radius:999px !important; height:80% !important;width:100%;}
- </style>
- </head>
- <body class="pb0 pt0 ovh" style="padding-top:0;background-color:#f6f6f6;height:100vh;">
- <div class="warehouse rel" id="app" v-cloak>
- <van-nav-bar class="user_rank_explan_title user_title_normal titlef16 rightc333" left-arrow title="仓库管理" v-if="toptitleisshow" right-text="小分仓" @click-left="goback" @click-right="gorecord">
- <template #left><img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <van-tabs class="tabs_btn warehouse-tab" v-model="active1" swipeable @change="changetoptab" animated line-width="20" line-height="2" :ellipsis="false" sticky>
- <van-tab v-for="product,index in productTypes" :title="product.ProductName" v-if="product.ProductName">
- <van-search class="top_search" v-model="searchContent" show-action placeholder="根据收货人姓名或电话号码搜索订单" @search="onSearch">
- <template #action>
- <div class="df">
- <div class="searchcolor" @click="onSearch">搜索</div>
- </div>
- </template>
- </van-search>
- <van-tabs class="type-tab df" v-model="active" line-width="30" @change="changetab">
- <van-tab>
- <template #title><span class="f12">未发货</span><span class="f12">({{uncount}})</span></template>
- <div class="ovh-x pb0" ref="wrapper1" v-if="active === 0">
- <div class="nodata c999 f12 tc mt16" v-if="loading">加载中...</div>
- <div class="nodata c999 f12 tc mt16" v-if="productinfo.length === 0 && !loading">暂无任何记录</div>
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height:100%;min-height:10vh;">
- <van-list @load="onLoad" v-model="loading" :finished="finished" finished-text="没有更多数据了" :immediate-check="false" v-if="active === 0 && productinfo.length !== 0">
- <div class="panel bgcfff rel pt16 pb16 bottom_line" v-for="item,index in productinfo">
- <div class="info f12 c333">
- <div class="item title bottom_line df aic jcsb" style="justify-content:space-between;align-items:center">
- <div class="df"><span class="f14 c33 mb">{{item.ProductName}}*{{item.BuyCount}}</span><span class="ml4 kind df">{{item.OrderKind}}</span></div>
- <div class="df" style="justify-content:flex-end;">
- <button class="undelive r9 f12" @click="delivergoods(item.Id)">点我发货</button>
- </div>
- </div>
- <div class="item mt8 df jcsb mt16" style="justify-content:space-between;">
- <div class="c999 f12">申请时间:</div>
- <div class="ml4 c333">{{item.CreateDate}}</div>
- </div>
- <div class="item mt8 df jcsb pt4" style="justify-content:space-between;">
- <div class="c999 f12">申请人:</div>
- <div class="ml4 c333">{{item.OrderRealName}} {{item.OrderMakerCode}}</div>
- </div>
- <div class="item mt8 df jcsb pt4" style="justify-content:space-between;">
- <div class="c999 f12">订单号:</div>
- <div class="ml4 c333">{{item.OrderNo}}</div>
- </div>
- </div>
- </div>
- </van-list>
- </van-pull-refresh>
- </div>
- </van-tab>
- <van-tab>
- <template #title><span class="f12">已发货</span></template>
- <div class="ovh-x pb0" ref="wrapper1" v-if="active === 1">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height:100%;min-height:10vh;">
- <div class="nodata c999 f12 tc mt16" v-if="loading">加载中...</div>
- <div class="nodata c999 f12 tc mt16" v-if="shippedlist.length === 0 && !loading">暂无任何记录</div>
- <van-list @load="onLoad" v-model="loading" :finished="finished" finished-text="没有更多数据了" :immediate-check="false" v-if="active === 1 && shippedlist.length !== 0">
- <div class="panel bgcfff rel pt16 pb16 bottom_line" v-for="item,index in shippedlist">
- <div class="info f12 c333">
- <div class="df bottom_line" style="justify-content:space-between;">
- <div class="item title df aic" style="margin-bottom:0;align-items:center"><span class="f14 c33 mb">{{item.ProductName}}*{{item.BuyCount}}</span><span class="ml4 kind df">{{item.OrderKind}}</span></div>
- <div><span class="c999 f12" v-if="item.SendStatus === 1">已完成</span></div>
- </div>
- <div class="item mt8 df jcsb mt16" style="justify-content:space-between;">
- <div class="c999 f12">申请时间:</div>
- <div class="ml4 c333">{{item.CreateDate}}</div>
- </div>
- <div class="item mt8 df jcsb pt4" style="justify-content:space-between;">
- <div class="c999 f12">申请人:</div>
- <div class="ml4 c333">{{item.OrderRealName}} {{item.OrderMakerCode}}</div>
- </div>
- <div class="item mt8 df jcsb pt4" style="justify-content:space-between;">
- <div class="c999 f12">订单号:</div>
- <div class="ml4 c333">{{item.OrderNo}}</div>
- </div>
- <div class="bgcfff f12 tr df jcsb spline" style="justify-content:space-between;" v-show="index !== openindex" @click="lookdetail(item,index)"> <span>详情</span>
- <van-icon name="arrow-down" color="#999"></van-icon>
- </div>
- <div class="bgcfff f12 tr df jcsb spline" style="justify-content:space-between;" v-show="index === openindex" @click="openindex = -1"> <span>收起</span>
- <van-icon name="arrow-up" color="#999"></van-icon>
- </div>
- <transition name="van-fade" leave-active-class="van-leave-active-class">
- <div class="isshow rel" v-show="index === openindex">
- <div class="item mt8 df jcsb pt4" style="justify-content:space-between;">
- <div class="c999 f12">收货人:</div>
- <div class="ml4 c333">{{item.RealName}} {{item.Mobile}}</div>
- </div>
- <div class="item mt8 df jcsb pt4" style="justify-content:space-between;">
- <div class="c999 f12">收货地址:</div>
- <div class="ml4 c333" :id="'place'+index">
- <div class="tr">{{item.Areas}}</div>
- <div class="tr">{{item.Address}}</div>
- </div>
- </div>
- <div class="item mt8 df jcsb pt4" style="justify-content:space-between;">
- <div class="c999 f12">提货方式:</div>
- <div class="ml4 c333">{{item.DeliveryType === 2 ? '上门自提' : '邮寄到付'}}</div>
- </div>
- <div class="item mt8 df jcsb pt4" style="justify-content:space-between;">
- <div class="c999 f12">SN号:</div>
- <div>
- <div class="ml4 c333" v-for="No in item.SnNos">{{No}}</div>
- </div>
- </div>
- <div class="df pt4" style="justify-content:flex-end;">
- <div class="btn bgcfff f12 tc" style="width:2.6667rem;top:.5rem;" :data-clipboard-text="item.Areas + item.Address" data-clipboard-action="copy" :data-clipboard-target="'#place'+index" :ref="'copy'+index" @click="copyPLACE(index)" @mouseenter="copyPLACE(index)">复制收货地址</div>
- </div>
- </div>
- </transition>
- </div>
- </div>
- </van-list>
- </van-pull-refresh>
- </div>
- </van-tab>
- <van-tab>
- <template #title><span class="f12">全部订单</span></template>
- <div class="ovh-x pb0" ref="wrapper1" v-if="active === 2">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height:100%;min-height:10vh;">
- <div class="nodata c999 f12 tc mt16" v-if="loading">加载中...</div>
- <div class="nodata c999 f12 tc mt16" v-if="alllist.length === 0 && !loading">暂无任何记录</div>
- <van-list @load="onLoad" v-model="loading" :finished="finished" finished-text="没有更多数据了" :immediate-check="false" v-if="active === 2 && alllist.length !== 0">
- <div class="panel bgcfff rel pt16 pb16 bottom_line ovh" v-for="item,index in alllist">
- <div class="info f12 c333">
- <div class="df bottom_line title" style="justify-content:space-between;">
- <div class="item df aic jcsb" style="margin-bottom:0;justify-content:space-between;align-items:center"><span class="f14 c33 mb">{{item.ProductName}}*{{item.BuyCount}}</span><span class="ml4 kind df">{{item.OrderKind}}</span></div>
- <div class="df" style="justify-content:flex-end;" v-if="item.SendStatus !== 1">
- <button class="undelive r9 f12 r16" @click="delivergoods(item.Id)" v-if="item.SendStatus !== 1">点我发货</button>
- </div>
- <div v-if="item.SendStatus === 1"><span class="c999 f12">已完成</span></div>
- </div>
- <div class="item mt8 df jcsb mt16" style="justify-content:space-between;">
- <div class="c999 f12">申请时间:</div>
- <div class="ml4 c333">{{item.CreateDate}}</div>
- </div>
- <div class="item mt8 df jcsb pt4" style="justify-content:space-between;">
- <div class="c999 f12">申请人:</div>
- <div class="ml4 c333">{{item.OrderRealName}} {{item.OrderMakerCode}}</div>
- </div>
- <div class="item mt8 df jcsb pt4" style="justify-content:space-between;">
- <div class="c999 f12">订单号:</div>
- <div class="ml4 c333 f12">{{item.OrderNo}}</div>
- </div>
- <div class="bgcfff f12 tr df jcsb spline" style="justify-content:space-between;" v-show="index !== openindex && item.SendStatus === 1" @click="lookdetail(item,index)"> <span>详情</span>
- <van-icon name="arrow-down" color="#999"></van-icon>
- </div>
- <div class="bgcfff f12 tr df jcsb spline" style="justify-content:space-between;" v-show="index === openindex && item.SendStatus === 1" @click="openindex = -1"> <span>收起</span>
- <van-icon name="arrow-up" color="#999"></van-icon>
- </div>
- <transition name="van-fade" leave-active-class="van-leave-active-class">
- <div class="isshow rel" v-show="index === openindex">
- <div class="item mt8 df jcsb pt4" style="justify-content:space-between;">
- <div class="c999 f12">收货人:</div>
- <div class="ml4 c333">{{item.RealName}} {{item.Mobile}}</div>
- </div>
- <div class="item mt8 df jcsb pt4" style="justify-content:space-between;">
- <div class="c999 f12">收货地址:</div>
- <div class="ml4 c333" :id="'place'+index">
- <div class="tr">{{item.Areas}}</div>
- <div class="tr">{{item.Address}}</div>
- </div>
- </div>
- <div class="item mt8 df jcsb pt4" style="justify-content:space-between;">
- <div class="c999 f12">提货方式:</div>
- <div class="ml4 c333">{{item.DeliveryType === 2 ? '上门自提' : '邮寄到付'}}</div>
- </div>
- <div class="item mt8 df jcsb pt4" style="justify-content:space-between;">
- <div class="c999 f12">SN号:</div>
- <div>
- <div class="ml4 c333" v-for="No in item.SnNos">{{No}}</div>
- </div>
- </div>
- <div class="df pt4" style="justify-content:flex-end;">
- <div class="btn bgcfff f12 tc" style="width:2.6667rem;top:.5rem;" :data-clipboard-text="item.Areas + item.Address" data-clipboard-action="copy" :data-clipboard-target="'#place'+index" :ref="'copy'+index" @click="copyPLACE(index)" @mouseenter="copyPLACE(index)">复制收货地址</div>
- </div>
- </div>
- </transition>
- </div>
- </div>
- </van-list>
- </van-pull-refresh>
- </div>
- </van-tab>
- <van-tab>
- <template #title><span class="f12">库存</span><span class="f12">({{productTypes[active1].LaveNum}})</span></template>
- <div class="ovh-x bgcfff pb0" ref="wrapper1" v-if="active === 3">
- <div class="nodata c999 f12 tc mt16" v-if="loading">加载中...</div>
- <div class="nodata c999 f12 tc mt16" v-if="stocklist.length === 0 && !loading">暂无任何记录</div>
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height:30vh;">
- <van-list @load="onLoad" v-model="loading" :finished="finished" finished-text="没有更多数据了" :immedisate-check="false" v-if="active === 3 && stocklist.length !== 0">
- <div>
- <div class="allnum bgcfff" v-for="item,index in stocklist" :key="index">
- <div class="f14 c333">{{item.PosSn}}</div>
- <div class="f12 c999 pt4">{{item.CreateDate}}</div>
- </div>
- </div>
- </van-list>
- </van-pull-refresh>
- </div>
- </van-tab>
- </van-tabs>
- </van-tab>
- </van-tabs>
- <van-goods-action class="mall-bottom">
- <div class="button df ovh">
- <van-goods-action-button class="kxs-btn cfff-btn" type="default" color="#EB6540" text="申请补货" @click="transfer"></van-goods-action-button>
- <van-goods-action-button class="kxs-btn" type="default" color="#FFD500" text="预发货到小分仓" @click="getset"></van-goods-action-button>
- </div>
- </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>
- async function OnStart(){
- await app.getallwarehouselist();
- app.backgetwarehouselist();
- };
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- active1:0,
- toptitleisshow,
- active: 0,
- lastactive:0,
- //- overisshow:false,
- loading: true,
- finished: false,
- refreshing: false,
- searchContent:'',
- openindex:-1,
- choosebtnindex:0,
- productinfo:[],
- stocklist:[],
- alllist:[],
- shippedlist:[],
- showDate: false,
- minDate: new Date(2020, 0, 1),
- maxDate: new Date(2025, 10, 1),
- currentDate: new Date(),
- startDate: '',
- endDate: '',
- pageinfo:{
- PageSize:20,
- PageNum:1
- },
- NoList:'',
- productTypes:[
- ],
- uncount:0,
- flag:0,
- browsernum:'',
- };
- },
- watch:{
- choosebtnindex(){
- const currentmouth = new Date().getMonth()+1;
- const currentyear = new Date().getFullYear();
- switch(this.choosebtnindex){
- case 0:
- this.startDate = '';
- this.endDate = '';
- break;
- case 1:
- this.startDate = currentyear + '-' + currentmouth + '-' + 1;
- this.endDate = currentyear + '-' + currentmouth + '-' + new Date().getDate();
- break;
- case 2:
- this.startDate = currentyear + '-' + (currentmouth -1) + '-' + 1;
- this.endDate = currentyear + '-' + (currentmouth - 1) + '-' + new Date(currentyear,currentmouth - 1,0).getDate();
- break;
- case 3:
- this.startDate = currentyear + '-' + (currentmouth -2) + '-' + (new Date().getDate()+1);
- this.endDate = currentyear + '-' + currentmouth + '-' + new Date().getDate();
- break;
- }
- }
- },
- async created() {
- await this.getallwarehouselist();
- this.getwarehouselist();
- this.browsernum = PublicLib.GetAppVersion();
- },
- beforeUpdate() {
- this.$refs.wrapper1.forEach(item=>{
- item.style.height = `${document.documentElement.clientHeight - 118}px`;
- });
- },
- methods: {
- //- 预发货
- getset(){
- PublicLib.putCookieInfo('warehouseId', this.productTypes[this.active1].Id);
- PublicLib.putCookieInfo('brandId', this.productTypes[this.active1].BrandId);
- PublicLib.putCookieInfo('warehouseSnList', JSON.stringify([]));
- PublicLib.putCookieInfo('warehouseName', this.productTypes[this.active1].ProductName);
- PublicLib.Goto({Url:'warehouse-deliver-goods-getset'});
- },
- transfer(){
- PublicLib.Goto({Url:'warehouse-application'});
- },
- //- 获取仓库入口
- async getallwarehouselist(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/storehouse/indexlist?t='+Math.random(6),JSON.stringify({UserId,PageSize:15,PageNum:1}));
- if(res.status === '1') {
- const arr = [];
- res.data.forEach((item,index)=>{
- if(item.BrandId){
- arr.push(item)
- };
- });
- const productlist = [];
- const list = PublicLib.getCookieInfo('productCenterList') ? PublicLib.getCookieInfo('productCenterList') : '[]';
- const testarr = JSON.parse(list) ? JSON.parse(list) : [];
- const productsnum = arr.length - testarr.length;
- if(productsnum !== 0){
- for(let i = productsnum; i > 0; i--){
- testarr.push(arr[arr.length - i].BrandId);
- };
- };
- testarr.forEach((num)=>{
- arr.forEach((item,index)=>{
- if(Number(item.BrandId) === Number(num)){
- productlist.push(item);
- };
- });
- });
- this.productTypes = productlist;
- };
- },
- //- 切换顶部tab
- changetoptab(){
- this.productinfo = [];
- this.stocklist = [];
- this.alllist = [];
- this.shippedlist = [];
- this.pageinfo.PageNum = 1;
- this.active = 0;
- this.lastactive = 0;
- this.finished = false;
- this.loading = true;
- this.backgetwarehouselist();
- },
- changetab(){
- if(this.lastactive === this.active) return;
- this.lastactive = this.active;
- this.loading = true;
- this.pageinfo.PageNum = 1;
- this.openindex = -1;
- this.finished = false;
- this.backgetwarehouselist();
- },
- giveToast(str){
- this.$toast(str);
- },
- onLoad() {
- this.pageinfo.PageNum++;
- this.getwarehouselist();
- },
- onRefresh() {
- //- this.productinfo = [];
- //- this.stocklist = [];
- //- this.alllist = [];
- //- this.shippedlist = [];
- this.pageinfo.PageNum = 1;
- this.finished = false;
- this.loading = true;
- this.refreshing = false;
- this.backgetwarehouselist('refresh');
- },
- //- 点击搜索
- onSearch(){
- if(this.searchContent === '')return;
- this.productinfo = [];
- this.pageinfo.PageNum = 1;
- this.getwarehouselist();
- },
- //- 详情
- lookdetail(item,index){
- item.detailShow = true;
- this.openindex = index;
- },
- //- 复制地址
- copyPLACE(index){
- const that = this;
- const clipboard = new ClipboardJS(this.$refs['copy'+index][0]);
- clipboard.on('success', function(e) {
- that.giveToast('复制成功');
- });
- clipboard.on('error', function(e) {
- that.giveToast('复制失败,请手动选择复制!');
- });
- },
- //- 限制选择时间
- onConfirmDate(isStartDate) {
- this.choosebtnindex = -1;
- this.showDate = false;
- if(isStartDate){
- this.startDate = this.currentDate.getFullYear() + '-' + (this.currentDate.getMonth() + 1) + '-' + this.currentDate.getDate();
- this.minDate = new Date(this.startDate);
- this.maxDate = new Date(2025, 10, 1);
- }else{
- this.endDate = this.currentDate.getFullYear() + '-' + (this.currentDate.getMonth() + 1) + '-' + this.currentDate.getDate();
- this.maxDate = new Date(this.endDate);
- this.minDate = new Date(2020, 0, 1);
- };
- },
- //- 格式化显示时间
- formatter(type, val) {
- if (type === 'year') {
- return `${val}年`;
- } else if (type === 'month') {
- return `${val}月`;
- } else if (type === 'day') {
- return `${val}日`;
- };
- return val;
- },
- //- 时间参数转换
- onParamsDate(date){
- if(date === '') return '';
- return formatDate(new Date(date).getFullYear(),new Date(date).getMonth() + 1,new Date(date).getDate());
- },
- //- 判断是否为开始时间
- onShowDate(isStartDate){
- this.isStartDate = isStartDate ? true : false;
- this.showDate = !this.showDate;
- },
- //- 取消弹出层
- cancelbtn(){
- setTimeout(()=>{
- this.choosebtnindex = 0;
- this.startDate = '';
- this.endDate = '';
- },200);
- this.overisshow = false;
- },
- //- 确认弹出层
- surebtn(){
- setTimeout(()=>{
- this.choosebtnindex = 0;
- this.startDate = '';
- this.endDate = '';
- },200);
- this.searchContent = '';
- this.overisshow = false;
- this.productinfo = [];
- this.pageinfo.PageNum = 1;
- this.getwarehouselist();
- },
- //- 获取仓库列表
- async getwarehouselist (){
- //- cancelAxios.clearPending()
- let StoreId = this.productTypes[this.active1].Id;
- let Status = '';
- switch(this.active){
- case 0:
- Status = 2;
- break;
- case 1:
- Status = 1;
- break;
- case 2:
- Status = 0;
- break;
- };
- if(this.active === 3){
- const OutStoreId = StoreId;
- const res = await getRequest('api/v1/ApplyMachine/StoreStockList?t='+Math.random(6),JSON.stringify({...this.pageinfo,StoreId}));
- if(res.status !== '1') return tips('获取库存列表失败');
- if(res.data.length < this.pageinfo.PageSize) {
- this.finished = true;
- };
- this.loading = false;
- res.data.forEach(item=>{
- item.CreateDate = item.CreateDate.replace('T',' ')
- });
- this.stocklist.push(...res.data);
- }else{
- const StartDate = this.onParamsDate(this.startDate);
- const EndDate = this.onParamsDate(this.endDate);
- const res = await getRequest('api/v1/orders/storeorderlist?t='+Math.random(6),JSON.stringify({...this.pageinfo,StoreId,SearchKey:this.searchContent,Status,StartDate,EndDate}));
- if(res.status !== '1') return tips('获取仓库列表失败');
- if(res.data.length < this.pageinfo.PageSize) {
- this.finished = true;
- };
- this.loading = false;
- if(this.active !== 0){
- res.data.forEach(item=>{
- if(item.SnNos){
- item.SnNos = item.SnNos.split(',');
- };
- });
- };
- if(this.productTypes[this.active1].Id !== StoreId) return;
- if(this.active === 2){
- if(Status !== 0) return;
- this.alllist.push(...res.data);
- }else if(this.active === 1){
- if(Status !== 1) return;
- this.shippedlist.push(...res.data);
- }else if(this.active === 0){
- if(Status !== 2) return;
- this.productinfo.push(...res.data);
- }
- if(this.pageinfo.PageNum === 1 && this.active === 0){
- this.uncount = res.other.count;
- };
- //- this.productinfo.push(...res.data);
- }
- },
- backgetwarehouselist:undebounce(async function(type='load'){
- if(type === 'load'){
- if(this.active === 3 && this.stocklist.length !== 0){
- this.loading = false;
- return;
- }else if (this.active === 2 && this.alllist.length !== 0){
- this.loading = false;
- return;
- }else if (this.active === 1 && this.shippedlist.length !== 0){
- this.loading = false;
- return;
- }else if (this.active === 0 && this.productinfo.length !== 0){
- this.loading = false;
- return;
- };
- }
- //- cancelAxios.clearPending()
- let StoreId = this.productTypes[this.active1].Id;
- let Status = '';
- switch(this.active){
- case 0:
- Status = 2;
- break;
- case 1:
- Status = 1;
- break;
- case 2:
- Status = 0;
- break;
- };
- if(this.active === 3){
- const OutStoreId = StoreId;
- //- 库存接口
- //- const res = await getRequest('api/v1/pos/machinechange/orderlist?t='+Math.random(6),JSON.stringify({...this.pageinfo,OutStoreId}));
- const res = await getRequest('api/v1/ApplyMachine/StoreStockList?t='+Math.random(6),JSON.stringify({...this.pageinfo,StoreId}));
- if(res.status !== '1') return tips('获取库存列表失败');
- if(res.data.length < this.pageinfo.PageSize) {
- this.finished = true;
- };
- res.data.forEach(item=>{
- item.CreateDate = item.CreateDate.replace('T',' ')
- });
- this.stocklist = res.data;
- this.loading = false;
- }else{
- const StartDate = this.onParamsDate(this.startDate);
- const EndDate = this.onParamsDate(this.endDate);
- const res = await getRequest('api/v1/orders/storeorderlist?t='+Math.random(6),JSON.stringify({...this.pageinfo,StoreId,SearchKey:this.searchContent,Status,StartDate,EndDate}));
- if(res.status !== '1') return tips('获取仓库列表失败');
- if(res.data.length < this.pageinfo.PageSize) {
- this.finished = true;
- };
- if(this.active !== 0){
- res.data.forEach(item=>{
- if(item.SnNos){
- item.SnNos = item.SnNos.split(',');
- };
- });
- };
- if(this.productTypes[this.active1].Id !== StoreId) return;
- if(this.active === 2){
- if(Status !== 0) return;
- this.alllist = res.data;
- }else if(this.active === 1){
- if(Status !== 1) return;
- this.shippedlist = res.data;
- }else if(this.active === 0){
- if(Status !== 2) return;
- this.productinfo = res.data;
- }
- if(this.pageinfo.PageNum === 1 && this.active === 0){
- this.uncount = res.other.count;
- };
- //- this.productinfo = res.data;
- this.loading = false;
- }
- },300),
- goback(){
- PublicLib.GoBack({Level:1});
- },
- //- 申请记录
- warehouserecord(){
- PublicLib.Goto({Url:'warehouse-record'});
- },
- //- 点击发货
- delivergoods(id){
- PublicLib.putCookieInfo('warehouseId', this.productTypes[this.active1].Id);
- PublicLib.putCookieInfo('brandId', this.productTypes[this.active1].BrandId);
- PublicLib.putCookieInfo('warehouseSnList', JSON.stringify([]));
- PublicLib.putCookieInfo('orderId', id);
- PublicLib.putCookieInfo('warehouseName', this.productTypes[this.active1].ProductName);
- PublicLib.Goto({Url:'warehouse-deliver-goods'});
- },
- //- 点击售后发货
- async delivergoodssale(id){
- const StoreId = PublicLib.getCookieInfo('warehouseId');
- const res = await getRequest('api/v1/StoreStockChange/TransferForCheck?t='+Math.random(6),JSON.stringify({StoreId}));
- if(res.status !== '1')return tips('审核单数已满10条,请联系总仓审核!')
- PublicLib.putCookieInfo('warehouseSnList', JSON.stringify([]));
- PublicLib.putCookieInfo('orderId', id);
- PublicLib.Goto({Url:'warehouse-deliver-goods-afterSale'});
- },
- gorecord(){
- PublicLib.Goto({Url:'warehouse-mini-warehouse'});
- },
- }
- });
- </script>
- </body>
- </html>
|