Commit b40afc44 authored by godwithdh's avatar godwithdh

refresh

parent a207c68c
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<option v-for="(item,index) in status" :key="index" :value="item.sStatus">{{item.sStatus}}</option> <option v-for="(item,index) in status" :key="index" :value="item.sStatus">{{item.sStatus}}</option>
</select> </select>
</div> </div>
<div class="_input" v-if="typeList.input"> <div :class="{_input:true,radius:!typeList.select}" v-if="typeList.input">
<input class="input" v-model="inputValue" :placeholder="placeholder" v-on:input="changeInput"/> <input class="input" v-model="inputValue" :placeholder="placeholder" v-on:input="changeInput"/>
<i class='iconfont icon-close' id="close" v-if="inputValue" @click='clearInputValue'></i> <i class='iconfont icon-close' id="close" v-if="inputValue" @click='clearInputValue'></i>
</div> </div>
...@@ -243,6 +243,9 @@ export default { ...@@ -243,6 +243,9 @@ export default {
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
background:rgba(255,255,525,0.3); background:rgba(255,255,525,0.3);
&.radius{
border-radius: 5px;
}
input{ input{
height:100%; height:100%;
width:100%; width:100%;
......
...@@ -12,7 +12,7 @@ function urlFun(name){ ...@@ -12,7 +12,7 @@ function urlFun(name){
/** /**
* 默认公司 * 默认公司
*/ */
// default:`http://192.168.4.51:5001`, // default:`http://192.168.4.25:5001`,
// default:`https://weixin.huansi.net/apiproxy/huansi/hszh_HSFabricTradeTest`, // default:`https://weixin.huansi.net/apiproxy/huansi/hszh_HSFabricTradeTest`,
// default:`https://weixin.huansi.net/apiproxy/huansi/service/proxy/${userID}`, // default:`https://weixin.huansi.net/apiproxy/huansi/service/proxy/${userID}`,
default:`https://weixin.huansi.net/apiproxy/huansi/Tip`, default:`https://weixin.huansi.net/apiproxy/huansi/Tip`,
......
...@@ -526,5 +526,18 @@ util.scrollToBottom = function(scrollDom){ ...@@ -526,5 +526,18 @@ util.scrollToBottom = function(scrollDom){
// } // }
// } // }
// } // }
util.delayedFun=function(call){
var queue=true
function run(){
queue=true
setTimeout(()=>{
if(queue){
call&&call()
queue=false
}
},300)
}
return run;
}
export default util; export default util;
\ No newline at end of file
This diff is collapsed.
...@@ -17,6 +17,46 @@ ...@@ -17,6 +17,46 @@
>.more{ >.more{
color:#35BAF6; color:#35BAF6;
} }
>.balance{
width:100%;
>.amount{
padding:10px;
font-size:18px;
>span:first-child{
color:red;
font-weight: 600;
margin-right:10px;
}
}
>.list{
display: flex;
background: #eee;
padding: 4px 8px;
align-items: center;
>span{
margin-right:5px;
flex-shrink: 0;
color:#FF6600;
}
>div{
flex-grow:1;
display:flex;
margin-right:20px;
>span{
flex-shrink: 0;
}
>span:nth-child(2){
flex-grow:1;
font-weight: 600;
text-align: right;
margin-right:3px;
}
}
&:not(:last-child){
margin-bottom:10px;
}
}
}
>.should{ >.should{
display: flex; display: flex;
text-align: center; text-align: center;
...@@ -63,6 +103,48 @@ ...@@ -63,6 +103,48 @@
</style> </style>
<template> <template>
<div class="Finance" :style="list.length==0&&'background:#fff;height:100%;'"> <div class="Finance" :style="list.length==0&&'background:#fff;height:100%;'">
<div class="card" v-if="balance.length>0">
<span class="title">资金余额</span>
<!-- <span class="more" @click="more(1,0)">更多</span> -->
<div class="balance">
<div class="amount">
<span>{{balanceAmount}}</span>
<span></span>
</div>
<div class="list">
<span class="iconfont icon-kehuguanli"/>
<div>
<span>客户欠款</span>
<span>{{(balance.filter(v=>v.sName.indexOf("客户欠款")>=0)||[{nAmount:0}])[0].nAmount}}</span>
<span></span>
</div>
</div>
<div class="list">
<span class="iconfont icon-pengyou"/>
<div>
<span>供应商欠款</span>
<span>{{(balance.filter(v=>v.sName.indexOf("供应商欠款")>=0)||[{nAmount:0}])[0].nAmount}}</span>
<span></span>
</div>
</div>
<div class="list">
<span class="iconfont icon-cardCode"/>
<div>
<span>银行余额</span>
<span>{{(balance.filter(v=>v.sName.indexOf("银行余额")>=0)||[{nAmount:0}])[0].nAmount}}</span>
<span></span>
</div>
</div>
<div class="list">
<span class="iconfont icon-yingfu"/>
<div>
<span>现金余额</span>
<span>{{(balance.filter(v=>v.sName.indexOf("现金余额")>=0)||[{nAmount:0}])[0].nAmount}}</span>
<span></span>
</div>
</div>
</div>
</div>
<div class="card" v-if="list.length>0"> <div class="card" v-if="list.length>0">
<span class="title">应收应付</span> <span class="title">应收应付</span>
<span class="more" @click="more(1,0)">更多</span> <span class="more" @click="more(1,0)">更多</span>
...@@ -93,7 +175,7 @@ ...@@ -93,7 +175,7 @@
</div> </div>
</div> </div>
</div> </div>
<img src="@/assets/noData.jpg" style="width:100%;" v-if="list.length==0"/> <img src="@/assets/noData.jpg" style="width:100%;" v-if="(list.length==0)&&(balance.length==0)"/>
</div> </div>
</template> </template>
<script> <script>
...@@ -109,7 +191,7 @@ export default { ...@@ -109,7 +191,7 @@ export default {
data(){ data(){
return{ return{
list:[], list:[],
color:[['#21AEE4','#74D3F7'],['#5E9AFE',"#A0C1FC"],['#9966CC',"#C190F7"],['#3EC9DE',"#A0F0FA"]], balance:[],
} }
}, },
watch:{ watch:{
...@@ -152,10 +234,32 @@ export default { ...@@ -152,10 +234,32 @@ export default {
showConfirmButton:false, showConfirmButton:false,
}) })
} }
var value=await this.request("getBoss",{
data:[{key:"url",value:"Financial Summary Hdr"}]
},"加载中",{})
if(value&&value.error_title){
this.$vux.confirm.show({
title:"提示",
content:value.error_title,
showConfirmButton:false,
})
}else{
this.balance=value
}
}, },
more(val,tabIndex){ more(val,tabIndex){
this.$router.push({name:"financeDetail",params:{mode:val,tabIndex:tabIndex,start:this.start,end:this.end}}) this.$router.push({name:"financeDetail",params:{mode:val,tabIndex:tabIndex,start:this.start,end:this.end}})
}, },
}, },
computed:{
balanceAmount(){
var amount=0
this.balance.forEach(v=>{
amount+=v.nAmount
})
return amount.toLocaleString();
}
}
} }
</script> </script>
<style lang="less"> <style lang="less">
.capital{ .capital{
>div.card{ >div.card{
margin: 15px; background: #fff;
background: linear-gradient(25deg, var(--color,#5180D4,#5180D4)); border-radius: 7px;
padding:15px; box-shadow: 1px 1px 3px #aaa;
border-radius: 5px; padding: 10px;
box-shadow: 2px 2px 3px rgba(94,154,254,0.5); margin: 10px;
color:#fff; >.amount{
display:flex; color:#5E9AFE;
min-height:130px; font-size:30px;
>div:first-child{ font-weight: 700;
flex-grow:1; padding:10px 0;
text-align: center;
}
>.budget{
display:flex;
>div{
flex-grow:1;
width:50%;
display:flex;
flex-direction: column;
align-items: center;
>span:first-child{
margin-bottom:5px;
}
>span:last-child{
font-weight: 600;
}
}
}
>.process{
margin:10px;
height:10px;
background:#949494;
overflow: hidden;
border-radius: 2px;
&:before{
content: " ";
background: #FF6633;
width: var(--percent,0%);
height: 100%;
display: block;
box-shadow: 2px 2px 3px rgba(255,0,0,0.3);
transition: all 0.5s;
}
} }
} }
} }
</style> </style>
<template> <template>
<div class="capital" :style="list.length==0&&'background:#fff;height:100%;'"> <div class="capital" :style="list.length==0&&'background:#fff;height:100%;'">
<div class="card" v-if="list.length>0" v-for="(v,i) in list" :key="i" :style="{'--color':color[i%6]}"> <div class="card">
<div> <span class="Dtitle">银行账户总览 (单位:万元)</span>
<div style="font-size:13px;margin-bottom:14px;">{{v.sName}}</div> <div class="amount">¥ {{nAmount('银行余额').toLocaleString()}}</div>
<div style="font-size: 28px;font-weight: 600;">{{Number(v.nAmount||0).toLocaleString()}}</div> <div class="budget">
<div>
<span>支出</span>
<span>¥ {{nAmount('银行支出').toLocaleString()}}</span>
</div>
<div>
<span>收入</span>
<span>¥ {{nAmount('银行收入').toLocaleString()}}</span>
</div>
</div> </div>
<div style="align-self: flex-end;" v-if="v.rate!=0&&dateMode<5"> <div class="process" :style="{'--percent':`${percent('银行支出','银行收入')}%`}"></div>
<div>{{v.rate>0?'↑':'↓'}}{{v.rate}}%</div> </div>
<div>{{dateModeName}}{{v.rate>0?'上升':'下降'}}</div> <div class="card">
<span class="Dtitle">现金账户总览 (单位:万元)</span>
<div class="amount">¥ {{nAmount('现金余额').toLocaleString()}}</div>
<div class="budget">
<div>
<span>支出</span>
<span>¥ {{nAmount('现金支出').toLocaleString()}}</span>
</div>
<div>
<span>收入</span>
<span>¥ {{nAmount('现金收入').toLocaleString()}}</span>
</div>
</div> </div>
<div class="process" :style="{'--percent':`${percent('现金支出','现金收入')}%`}"></div>
</div> </div>
<img src="@/assets/noData.jpg" style="width:100%;" v-if="list.length==0"/> <!-- <img src="@/assets/noData.jpg" style="width:100%;" v-if="list.length==0"/> -->
</div> </div>
</template> </template>
<script> <script>
...@@ -42,14 +95,6 @@ export default{ ...@@ -42,14 +95,6 @@ export default{
data(){ data(){
return{ return{
list:[], list:[],
color:[
"#ff9700, #fe777c",
"#0081ff, #1cbbb4",
"#fe5a9f,#ff5c40",
"#ca2af4,#8850ff",
"#ffd65b,#ff9833",
"#3b83f6, #24c2dd",
],
} }
}, },
watch:{ watch:{
...@@ -93,6 +138,16 @@ export default{ ...@@ -93,6 +138,16 @@ export default{
showConfirmButton:false, showConfirmButton:false,
}) })
} }
},
percent(expenditure,income){
var expenditureAmount=this.nAmount(expenditure)
var incomeAmount=this.nAmount(income)
if(expenditureAmount==0)return 0;
else if(expenditureAmount+incomeAmount==0)return 100;
else return expenditureAmount/(expenditureAmount+incomeAmount)*100;
},
nAmount(name){
return (this.list.filter(v=>v.sName.indexOf(name)>=0)[0]||{nAmount:0}).nAmount
} }
}, },
computed:{ computed:{
......
...@@ -89,12 +89,7 @@ export default { ...@@ -89,12 +89,7 @@ export default {
}, },
}, },
created(){ created(){
this.$nextTick(()=>{ this.search=util.delayedFun(async ()=>{
this.search()
})
},
methods:{
async search(){
var value= await this.request('getBoss',{ var value= await this.request('getBoss',{
data:[ data:[
{key:"url",value:"Operation gai"}, {key:"url",value:"Operation gai"},
...@@ -108,7 +103,13 @@ export default { ...@@ -108,7 +103,13 @@ export default {
}else{ }else{
this.list=[] this.list=[]
} }
}, })
this.$nextTick(()=>{
this.search()
})
},
methods:{
routerToOperateDetail(row){ routerToOperateDetail(row){
let data = util.deepClone(row); let data = util.deepClone(row);
data.begin_date = util.dateFormat(this.start,"yyyy-MM-dd"); data.begin_date = util.dateFormat(this.start,"yyyy-MM-dd");
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<template> <template>
<div id="varieties"> <div id="varieties">
<div class="search"> <div class="search">
<searchComponent :search="search" :status="[]"/> <searchComponent :search="search" :typeList="{input:true,select:false,btns:true,time:true}"/>
</div> </div>
<table align="center" v-if="list.length>0"> <table align="center" v-if="list.length>0">
<thead> <thead>
...@@ -145,14 +145,16 @@ export default { ...@@ -145,14 +145,16 @@ export default {
}) })
}, },
async searchData(){ async searchData(){
var data=[
{key:"url",value:"sMaterial"},
{key:"dStartDate",value:this.search.dBeginDate},
{key:"dEndDate",value:this.search.dEndDate},
{key:"sStoreNo",value:this.$route.query.sStoreNo},
{key:"sStockPlace",value:this.$route.query.sStockPlace},
]
this.search.searchvalue&&data.push({key:"searchvalue",value:this.search.searchvalue})
var value=await this.request("getTiipReceiveStorage",{ var value=await this.request("getTiipReceiveStorage",{
data:[ data:data
{key:"url",value:"sMaterial"},
{key:"dStartDate",value:this.search.dBeginDate},
{key:"dEndDate",value:this.search.dEndDate},
{key:"sStoreNo",value:this.$route.query.sStoreNo},
{key:"sStockPlace",value:this.$route.query.sStockPlace},
]
},"加载中",{}) },"加载中",{})
this.list=value this.list=value
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment