123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347 |
- <!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>
- .van-field__right-icon i{
- transform:rotate(90deg);
- }
- .warehouse-application .head .center{margin:.2133rem 0;}
- .warehouse-application .head .center2{margin:.16rem 0 .3467rem 0;}
- .count{font-size:.5333rem;}
- .warehouse-application .topline{border-top:1px solid #f2f2f2;}
- .van-goods-action{height:1.5467rem;}
- .b{font-weight:500;}
- .warehouse-application .tips{bottom:1.5467rem;}
-
- </style>
- </head>
- <body class="pb0 ovh pt0" style="padding-top:0;">
- <div class="warehouse rel merchant-verification warehouse-application" id="app" v-cloak style="height:100vh;background-color:#f6f6f6">
- <van-nav-bar class="user_rank_explan_title user_title_normal titlef16 rightc333" left-arrow title="申请补货" right-text="申请记录" @click-right="onClickRight" v-if="toptitleisshow" @click-left="goback">
- <template #left><img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <div class="head tc rel topline">
- <van-icon class="abs rule" name="info-o" size="14" color="#FE5A32" @click="showRule = true">申请规则</van-icon>
- <div class="total df fl-dir-col jc-cen">
- <div class="f17 c333 b">可用额度</div>
- <div class="center" :class="{heighligt:Amount < 0}"><span class="f16" v-if="Amount < 0">已超额</span><span class="f16">¥</span><span class="f28" style="font-weight:bold;">{{abs(Math.abs(Amount))}}</span></div>
- <div class="f12 c999"> <span>总额度</span><span>¥</span><span>{{abs(totalQuota)}} </span></div>
- </div>
- <div class="rol-line m0a"></div>
- <div class="bottom df jcar">
- <div class="left c333 df fl-dir-col jc-cen">
- <div class="f17 b">本月固定额度</div>
- <div class="f12 center2"><span>¥</span><span>{{abs(FixedAmount)}}</span></div>
- <div class="f13 c999">{{arriveTime}} 到期</div>
- </div>
- <div class="right c333 df fl-dir-col jc-cen">
- <div class="f17 b">临时额度</div>
- <div class="f12 center2"><span>¥</span><span>{{abs(TempAmount)}}</span></div>
- <div class="df jcsb">
- <div @click="addQuota"><span class="heighligt">增加临额 </span>
- <van-icon name="arrow" color="#FE5A32"> </van-icon>
- </div>
- <div @click="reductQuota"><span class="heighligt">减少临额</span>
- <van-icon name="arrow" color="#FE5A32"> </van-icon>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="foot mt8">
- <div class="title f17 df jcsb aic c333">
- <div class="b">机具类型</div>
- <div class="b">申请数量(台)</div>
- </div>
- <div class="scoll-warp ovh-x">
- <div class="list df jcsb aic" v-for="(item,index) in jijuList">
- <div class="c999 f15">{{item.BrandName}}</div>
- <van-stepper v-model="item.ApplyNum" theme="round" button-size="22" disable-input min="0" step="10"></van-stepper>
- </div>
- </div>
- <div class="van-goods-action">
- <div class="f14 tc" style="width:40%;flex:1;"><span class="f14 c333">所需额度:</span><span class="heighligt ml4 b">¥</span><span class="heighligt b count">{{needPay}}</span></div>
- <van-goods-action-button color="#FDD500" text="购买额度" v-if="needPay > Amount" @click="showPicker = true"></van-goods-action-button>
- <van-goods-action-button color="#FDD500" text="确认申请" :disabled="needPay === 0" v-else @click="apply"></van-goods-action-button>
- <div class="tips df aic" v-show="needPay > Amount" @click="showRule = true">
- <van-icon name="warning-o" color="#FE5A32" size="16"></van-icon>
- <div class="f14 c333 ml6">可用额度不足,请先增加临时额度</div>
- </div>
- </div>
- </div>
- <van-action-sheet v-model="showRule" title="申请规则">
- <div v-html="rules"></div>
- </van-action-sheet>
- <van-popup v-model="showPicker" position="bottom" round>
- <van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="showPicker = false" title="增加临额"></van-picker>
- </van-popup>
- <van-popup v-model="applicationFaild" style="border-radius:.4267rem;width:83%;">
- <div class="warp-box" style="height:4.8533rem">
- <div class="f16 c333 tc b">申请失败</div>
- <div class="f14 mt8 c333">{{errInfo}}</div>
- <van-button class="btn" round color="#FDD500" block @click="applicationFaild = false">确定</van-button>
- </div>
- </van-popup>
- <van-popup v-model="applicationSuccess" style="border-radius:.4267rem;width:83%;">
- <div class="warp-box" style="height:4.4133rem">
- <div class="f16 c333 tc b">申请成功</div>
- <van-button class="btn" round color="#FDD500" block @click="applicationSuccess = false">好的</van-button>
- </div>
- </van-popup>
- </div>
- <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>
- Vue.use(vant.Lazyload);
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data(){
- return{
- TempAmount:0,
- FixedAmount:0,
- Amount:0,
- needPay:0,
- arriveTime:'',
- topheight:0,
- rules:'',
- jijuList:[
- //- {
- //- BrandName:'金控电签',
- //- ApplyNum:0,
- //- Price:200,
- //- },
- //- {
- //- BrandName:'金控大POS',
- //- ApplyNum:0,
- //- Price:200,
- //- },
- //- {
- //- BrandName:'立刷',
- //- ApplyNum:0,
- //- Price:200,
- //- },
- //- {
- //- BrandName:'金控电签',
- //- ApplyNum:0,
- //- Price:200,
- //- },
- //- {
- //- BrandName:'金控大POS',
- //- ApplyNum:0,
- //- Price:200,
- //- },
- //- {
- //- BrandName:'立刷',
- //- ApplyNum:0,
- //- Price:200,
- //- },
- //- {
- //- BrandName:'金控电签',
- //- ApplyNum:0,
- //- Price:200,
- //- },
- //- {
- //- BrandName:'金控大POS',
- //- ApplyNum:0,
- //- Price:200,
- //- },
- //- {
- //- BrandName:'立刷',
- //- ApplyNum:0,
- //- Price:200,
- //- },
- ],
- showRule:false,
- showPicker:false,
- toptitleisshow,
- applicationFaild:false,
- applicationSuccess:false,
- columns:[
- '2000元额度',
- '10000元额度',
- '20000元额度'
- ],
- //- increaseQuota:0,
- rules:``,
- initInfo:{
- mustTai:0,
- mustXiang:0,
- many:0,
- },
- formInfo:{
- type:'',
- factor:0,
- Id:'',
- },
- errInfo:'',
-
- }
- },
- computed:{
- totalQuota:function(){
- return this.TempAmount + this.FixedAmount
- },
- },
- watch:{
- jijuList:{
- handler(val){
- let res = 0
- val.forEach((item,index)=>{
- res += item.ApplyNum * item.Price
- })
- this.needPay = res
- },
- immediate: true,
- deep:true
- }
- },
- created(){
- this.getMyamount();
- this.getRules();
- this.getProductList();
- let date = new Date()
- let year = date.getFullYear()
- let month = date.getMonth()+2
- if(month>12){
- year = year + 1
- month = 1
- }
- this.arriveTime = `${year} - ${fillzero(month)} - 01`
- },
- mounted(){
- //- const type = browsertype.versions.ios ? 'ios' : 'android';
- //- if(type === 'ios'){
- //- if(isFringe()){
- //- this.topheight = 48;
- //- }else{
- //- this.topheight = 20;
- //- };
- //- }else{
- //- this.topheight = PublicLib.getStatusBarHeight();
- //- };
- this.$nextTick(() => {
- setTimeout(()=>{
- const y1 = document.getElementsByClassName('title')[0].getBoundingClientRect().bottom
- const y2 = document.getElementsByClassName('van-goods-action')[0].getBoundingClientRect().height
- document.getElementsByClassName('scoll-warp')[0].style.height = `calc(100vh - ${ y1 + y2 }px)`
- },100)
- });
- },
- methods:{
- addQuota(){
- this.showPicker = true
- },
- reductQuota(){
- //- if(this.TempAmount > 0){
- PublicLib.putCookieInfo('Amount',this.TempAmount)
- PublicLib.Goto({Url:'warehouse-application-adjustQuota'});
- //- }else{
- //- return tips('不可降低临额!')
- //- }
- },
- onClickRight(){
- PublicLib.Goto({Url:'warehouse-application-record'});
- },
- goback(){
- PublicLib.GoBack({Level:1});
- },
- onConfirm(value) {
- //- this.increaseQuota = value
- //- console.log()
- this.showPicker = false
- this.toBuy(value)
- },
- toBuy(value){
- let mallinfo = {};
- switch(value){
- case '2000元额度':
- mallinfo = {cartMessages: {},goodsId: 30, messages: {}, selectedNum: 1,selectedSkuComb:{id:'',price: 1000,stock_num: 100000,property_price: 0}};
- break;
- case '10000元额度':
- mallinfo = {cartMessages: {},goodsId: 31, messages: {}, selectedNum: 1,selectedSkuComb:{id:'',price: 5000,stock_num: 100000,property_price: 0}};
- break;
- case '20000元额度':
- mallinfo = {cartMessages: {},goodsId: 32, messages: {}, selectedNum: 1,selectedSkuComb:{id:'',price: 10000,stock_num: 100000,property_price: 0}};
- break;
- };
- PublicLib.putCookieInfo('checkmallInfo', JSON.stringify(mallinfo));
- PublicLib.Goto({Url:'mall-deal-check-coupon'});
- },
- apply(){
- vant.Dialog.confirm({
- title: '确认申请',
- message: '申请后不可撤销',
- })
- .then(() => {
- const UserId = PublicLib.getCookieInfo('userId');
- const NeedPay = this.needPay
- const filterList = this.jijuList.filter(item => item.ApplyNum > 0)
- const ApplyList = [];
- filterList.forEach(item=>{
- ApplyList.push({ApplyNum:item.ApplyNum,BrandId:item.BrandId})
- });
- postRequest('api/v1/storemachineapply/confirmapply',JSON.stringify({ApplyList,NeedPay,UserId}))
- .then((res)=>{
- if(res.status !== '1'){
- this.applicationFaild = true;
- this.errInfo = res.info
- }
- if(res.status === '1'){
- this.applicationSuccess = true
- this.getMyamount();
- }
- })
- })
- },
- async getMyamount(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/useraccount/myamount?='+Math.random(6),JSON.stringify({UserId}));
- if(res.status === '1'){
- this.TempAmount = res.data.TempAmount
- this.FixedAmount = res.data.FixedAmount
- this.Amount = res.data.Amount
-
- }else{
- tips('初始化失败!请重试')
- }
- },
- async getProductList(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/StoreMachineApply/ProductList?t='+Math.random(6),JSON.stringify({UserId}));
- if(res.status === '1'){
- res.data.forEach((item)=>{
- item.ApplyNum = 0
- })
- this.jijuList = res.data
- //- console.log(res.data)
- }else{
- tips('获取数据失败,请重试!')
- }
- },
- //获取规则
- async getRules(){
- const res = await getRequest('api/v1/pageinfo/detail?t='+Math.random(6),JSON.stringify({Id:8}));
- if(res.status !== '1')return tips('规则获取失败!');
- this.rules = res.data.Contents
- },
-
- },
- })
- </script>
- </body>
- </html>
|