Commit 7a1680e5 authored by 张锡奇's avatar 张锡奇
parents f9d8163f 0bc510e4
<style lang="less">
#dateMonth{
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
margin: 10px;
border-radius: 3px;
>button{
padding: 10px;
position:relative;
overflow: hidden;
&:after{
content:" ";
width:0;
height:0;
left:50%;
top:50%;
position:absolute;
background:rgba(50, 125, 255, 0.4);
border-radius: 50%;
transform:translate(-50%,-50%);
}
&:active:after{
transition: all 0.4s;
width:100px;
height:100px;
}
}
}
</style>
<template>
<div id="dateMonth">
<button @click="setMonth(-1)">上个月</button>
<div @click="selectDate">{{month}}</div>
<button @click="setMonth(1)">下个月</button>
</div>
</template>
<script>
import Util from '@/libs/util.js'
import searchComponent from '@/components/search'
import { Datetime } from 'vux'
import { setTimeout } from 'timers';
export default {
name:"dateMonth",
components:{Datetime},
mounted(){
window.mon=this
this.$nextTick(()=>{
var date=new Date()
date.setDate(1)
this.start=new Date(date)
date.setMonth(date.getMonth()+1)
date.setDate(0)
this.end=new Date(date)
this.getMonth()
})
},
data(){
return{
start:"",
end:"",
isShow:false,
}
},
computed:{
month(){
return Util.dateFormat(this.end,"yyyy年MM月")
},
},
methods:{
selectDate(){
this.$vux.datetime.show({
value: Util.dateFormat(this.end,"yyy-MM-dd"), // 其他参数同 props
format:"YYYY-MM",
confirmText:"确认",
cancelText:"取消",
onConfirm:v=>{
var date=new Date(v)
this.start=new Date(date)
date.setMonth(date.getMonth()+1)
date.setDate(0)
this.end=new Date(date)
this.getMonth()
},
})
},
setMonth(val){
this.start.setMonth(this.start.getMonth()+val)
this.start=new Date(this.start)
this.end.setDate(1)
this.end.setMonth(this.end.getMonth()+val+1)
this.end.setDate(0)
this.end=new Date(this.end)
this.getMonth()
},
getMonth(){
this.$emit("month",Util.dateFormat(this.start,"yyyy-MM-dd"),Util.dateFormat(this.end,"yyyy-MM-dd"))
}
},
}
</script>
......@@ -64,6 +64,7 @@ const methodMap = {
/**
* tiip 小程序
* 智能报表
*/
getTiipTotalamount:{url:'/bianalysis/totalamount/',method:'get',host:"default"},
getTiipSellinfo:{url:'/bianalysis/sellinfo/',method:'get',host:"default"},
......@@ -72,6 +73,8 @@ const methodMap = {
getTiipReceiveinfo:{url:"/bianalysis/receiveinfo/",method:"get",host:"default"},
getTiipReceive:{url:"/bianalysis/receivemoney/",method:"get",host:"default"},
getTiipCost:{url:"/bianalysis/costanalysis/",method:"get",host:"default"},
getTiipLiabilities:{url:'/bianalysis/liabilities/',method:'get',host:'default'},
getTiipLiabilities:{url:'/bianalysis/liabilities/',method:'get',host:'default'},
//采购单进度
getTipProcessProgress:{url:"/pssubcontract/getlist/",method:"post",host:"default"},
......
......@@ -12,9 +12,9 @@ function urlFun(name){
/**
* 默认公司
*/
// default:`http://192.168.4.48:5001`,
default:`http://192.168.4.2:5001`,
// 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}`,
/**
* 基本地址
......
......@@ -19,7 +19,7 @@ import 'babel-polyfill'
import echarts from 'echarts'
import Calendar from 'vue-mobile-calendar/lib/install.js'
import F2 from '@antv/f2';
import { ConfirmPlugin,ToastPlugin } from 'vux'
import { ConfirmPlugin,ToastPlugin,DatetimePlugin } from 'vux'
import urlFun from './libs/host.js'
import Meta from 'vue-meta';
......@@ -33,6 +33,7 @@ Vue.use(Http);
Vue.use(Toast)
Vue.use(ConfirmPlugin);
Vue.use(ToastPlugin);
Vue.use(DatetimePlugin);
Vue.prototype.global = new Vue({});
......
......@@ -291,6 +291,11 @@ let tipRoutes = [
title:"智能报表"
},
},
{
path:"/tiip/liabilitiesDetail/:iCustomerId",
name:"tipLiabilitiesDetail",
component:()=>import("@/view/tiip/IntReportForms/liabilities_detail.vue")
}
]
},
{ //订单进度查询
......
......@@ -48,7 +48,7 @@
</style>
<template>
<div id="repayment">
<searchComponent :search='search' />
<dateMonth @month="searchData"/>
<div class="iCard">
<div class="head">
<div style="background:#3BA5EF">
......@@ -96,19 +96,14 @@
<script>
import Util from '@/libs/util.js'
import { Confirm } from 'vux'
import searchComponent from '@/components/search'
import dateMonth from '@/components/dateMonth'
import { setTimeout } from 'timers';
export default {
name:"repayment",
components:{searchComponent},
components:{dateMonth},
data(){
return{
search:{
dBeginDate:Util.dateFormat(new Date(),'yyyy-MM-01'),
dEndDate:Util.dateFormat(new Date(),'yyyy-MM-dd'),
},
value1:{},
value2:[],
option:{
......@@ -149,26 +144,20 @@ export default {
})
this.$nextTick(async ()=>{
this.chart=this.$echarts.init(this.$refs.chart)
await this.searchData()
})
this.global.$off('searchData');
this.global.$on('searchData',async ()=>{
this.value2=[]
this.value3=[]
await this.searchData()
})
},
methods:{
number(val){
return (Math.round((val||0)*100)/100).toLocaleString()
},
async searchData(){
async searchData(start,end){
this.value2=[]
this.value3=[]
var value=await this.request("getTiipReceive",{
data:{
dStartDate:this.search.dBeginDate,
dEndDate:this.search.dEndDate
dStartDate:start,
dEndDate:end
}
},"加载中",{})
value.set1[0]&&(this.value1=value.set1[0])
......
......@@ -21,7 +21,7 @@
</style>
<template>
<div id="cost">
<searchComponent :search="search" />
<dateMonth @month="searchData" />
<div class="iCard">
<div class="head">当月总费用进度情况(万)</div>
<div ref="chart1" :style="{height:'220px',opacity:value1.length>0?1:0}"/>
......@@ -47,16 +47,12 @@
</template>
<script>
import Util from '@/libs/util.js'
import searchComponent from '@/components/search'
import dateMonth from '@/components/dateMonth'
export default {
name:"cost",
components:{searchComponent},
components:{dateMonth},
data(){
return{
search:{
dBeginDate:Util.dateFormat(new Date(),'yyyy-MM-01'),
dEndDate:Util.dateFormat(new Date(),'yyyy-MM-dd'),
},
value1:[],
chart1:null,
......@@ -73,23 +69,17 @@ export default {
this.chart1=this.$echarts.init(this.$refs.chart1)
this.chart2=this.$echarts.init(this.$refs.chart2)
this.chart3=this.$echarts.init(this.$refs.chart3)
this.searchData()
})
this.global.$off('searchData');
this.global.$on('searchData',async ()=>{
this.value2=[]
this.value3=[]
await this.searchData()
})
},
methods:{
async searchData(){
async searchData(start,end){
this.value2=[]
this.value3=[]
var value=await this.request("getTiipCost",{
data:{
dStartDate:this.search.dBeginDate,
dEndDate:this.search.dEndDate,
dStartDate:start,
dEndDate:end,
}
},"加载中",{})
this.value1=value.set1||[]
......@@ -118,7 +108,7 @@ export default {
},
legend: {
data:title,
x: 'left'
x: 'left',
},
grid:{
left: '2%', // 与容器左侧的距离
......
......@@ -30,7 +30,7 @@
<template>
<div id="empAna">
<div class="HEADER">
<searchComponent :search="search" />
<dateMonth @month="searchData" />
</div>
<div class="CONTENT">
<div class="iCard" ref="chart1">
......@@ -59,20 +59,20 @@
</template>
<script>
import Util from '@/libs/util.js'
import searchComponent from "@/components/search"
import dateMonth from '@/components/dateMonth'
import { employees } from '@/view/shopVersion/form/empAna/mixins/employees'
import { receivable } from '@/view/shopVersion/form/empAna/mixins/receivable'
import { orderAmount } from '@/view/shopVersion/form/empAna/mixins/orderAmount'
import { setTimeout } from 'timers';
export default {
name:"empAna",
components:{searchComponent},
components:{dateMonth},
mixins: [employees,receivable,orderAmount],
data(){
return{
search:{
dBeginDate:Util.dateFormat(new Date(),"yyyy-MM-01"),
dEndDate:Util.dateFormat(new Date(),"yyyy-MM-dd"),
searchValue:{
dBeginDate:null,
dEndDate:null,
},
typeList:{time:true},
direction:'vertical',
......@@ -113,20 +113,51 @@ export default {
this.$nextTick(async ()=>{
this.renderResize();
await this.getData();
if(this.chartData1.length>0){
await this.renderChart1()
}
if(this.chartData2.length>0){
await this.renderChart2()
}
if(this.chartData3.length>0){
await this.renderChart3()
}
// await this.getData();
// if(this.chartData1.length>0){
// await this.renderChart1()
// }
// if(this.chartData2.length>0){
// await this.renderChart2()
// }
// if(this.chartData3.length>0){
// await this.renderChart3()
// }
})
this.global.$off("searchData");
this.global.$on("searchData",async ()=>{
// this.global.$off("searchData");
// this.global.$on("searchData",async ()=>{
// this.chartData1=[]
// this.chartData2=[]
// this.chartData3=[]
// if(this.chartData1.length > 0){
// await this.chart1.destroy();
// }
// if(this.chartData2.length > 0){
// await this.chart2.destroy();
// }
// if(this.chartData3.length > 0){
// await this.chart3.destroy();
// }
// await this.getData();
// if(this.chartData1.length > 0){
// await this.renderChart1();
// }
// if(this.chartData2.length > 0){
// await this.renderChart2();
// }
// if(this.chartData3.length > 0){
// await this.renderChart3();
// }
// });
},
methods:{
searchData(start,end){
this.searchValue.dBeginDate=start
this.searchValue.dEndDate=end
this.$nextTick(async ()=>{
this.chartData1=[]
this.chartData2=[]
this.chartData3=[]
......@@ -140,6 +171,7 @@ export default {
if(this.chartData3.length > 0){
await this.chart3.destroy();
}
await this.getData();
if(this.chartData1.length > 0){
await this.renderChart1();
......@@ -150,10 +182,8 @@ export default {
if(this.chartData3.length > 0){
await this.renderChart3();
}
});
})
},
methods:{
renderResize(){
let width = document.documentElement.clientWidth;
let height = document.documentElement.clientHeight;
......@@ -166,8 +196,8 @@ export default {
async getData(){
var res=await this.request("getTiipSalesinfo",{
data:{
dStartDate:this.search.dBeginDate,
dEndDate:this.search.dEndDate,
dStartDate:this.searchValue.dBeginDate,
dEndDate:this.searchValue.dEndDate,
}
},"加载中",{})
if(res.set1.length>0){
......
......@@ -128,8 +128,9 @@
<div class="TAB">
<button-tab class="buttonTab" :value="activeBtn" >
<button-tab-item @on-item-click="situation='salesStatistics'">销售统计</button-tab-item>
<button-tab-item @on-item-click="situation='empAna'">员工排行</button-tab-item>
<!-- <button-tab-item @on-item-click="situation='empAna'">员工排行</button-tab-item> -->
<button-tab-item @on-item-click="situation='revenue'">收支分析</button-tab-item>
<button-tab-item @on-item-click="situation='liabilities'">负债分析</button-tab-item>
<button-tab-item @on-item-click="situation='repayment'">回款额</button-tab-item>
<button-tab-item @on-item-click="situation='cost'">费用分析</button-tab-item>
</button-tab>
......@@ -148,9 +149,10 @@ import empAna from "./empAna"
import revenue from "./revenue"
import repayment from "./repayment"
import cost from "./cost"
import liabilities from "./liabilities"
export default {
name:"IntReportForms",
components:{Swiper,SwiperItem,ButtonTab, ButtonTabItem,salesStatistics,empAna,revenue,repayment,cost},
components:{Swiper,SwiperItem,ButtonTab, ButtonTabItem,salesStatistics,empAna,revenue,repayment,cost,liabilities},
data(){
return{
list:[],
......
<style lang="less">
@import url('../../../styles/common.less');
#liabilities{
background: #f6f5f9;
height:100%;
display: flex;
flex-direction: column;
.HEADER{
display:flex;
padding:10px;
>span{
flex-shrink: 0;
&.number{
color:#3BA5EF;
margin-left:5px;
flex-grow:1;
text-align: right;
}
}
>div{
margin: 0 10px;
background:#3BA5EF;
border-radius: 5px;
}
}
.Content{
height:100%;
height:1px;
flex-grow: 1;
overflow: auto;
-webkit-overflow-scrolling: touch;
margin-bottom:8px;
>div{
display:flex;
align-items: center;
&{
>div{
border-bottom:1px solid #ddd;
}
}
>div{
flex-grow:1;
padding:15px 0;
}
>span{
flex-shrink: 0;
padding: 0 13px;
&.num{
font-weight: bold;
color: #555;
font-size: 16px;
align-self: center;
}
}
>a{
flex-shrink: 0;
padding: 18px 13px;
&.iconfont{
border-bottom: 1px solid #ddd;
display: flex;
align-items: center;
color: #FF7601;
font-size: 20px;
}
}
}
}
.img{
width:100%;
display: flex;
justify-content: center;
img{
width:100%;
height:300px;
}
}
}
</style>
<template>
<div id="liabilities">
<div class="tabs">
<tab active-color="#708bf6">
<tab-item :selected="activeIndex=='客户'" @on-item-click="activeIndex='客户'">客户欠款</tab-item>
<tab-item :selected="activeIndex=='供应商'" @on-item-click="activeIndex='供应商'">欠供应商款</tab-item>
</tab>
</div>
<div class="HEADER iCard">
<span style="color:#777;margin-right:10rpx;">总负债额</span>
<div :style="{'width':rate+'%','background':color}"></div>
<span class="number">{{total}}</span>
</div>
<div class="Content iCard">
<div v-for="(v,k) in list" :key="k">
<span class="num">{{k+1}}</span>
<div @click="routerToDetail(v)">
<div style="margin-bottom:10px">{{v.sCustomerName}}</div>
<div style="font-size:12rpx;color:#777;">欠款: {{v.nAmount}}</div>
</div>
<a class="iconfont icon-dianhua" :href="`tel:${v.sTelephone01}`" v-if="activeIndex=='客户'" />
</div>
<div class="img" v-if="list.length<=0">
<img src="@/assets/noData.jpg" />
</div>
</div>
</div>
</template>
<script>
import Util from '@/libs/util.js';
import { Tab, TabItem } from 'vux'
export default {
name:"liabilities",
components:{Tab, TabItem },
data(){
return{
activeIndex:"客户",
list:[],
rate:0,
color:"",
total:0,
}
},
mounted(){
this.$nextTick(()=>{
this.getData()
})
},
methods:{
async getData(){
var value=await this.request("getTiipLiabilities",{
data:{
sCustomerType:this.activeIndex
}
},"加载中",{});
this.total=0
this.rate=0
if(value.length>0){
this.list=value.map(v=>{
this.total+=v.nAmount||0
this.tate+=v.nPercent||0
v.nAmount=(Math.round(v.nAmount*100)/100).toLocaleString()
return v;
})
this.total=(Math.round(this.total*100)/100).toLocaleString()
this.rate=Math.round(this.rate*10000)/100
this.rate>=30&&this.rate<60&&(this.color="yellow")
this.rate>=90&&(this.color="red")
}
},
routerToDetail(value){
this.$router.push({name:"tipLiabilitiesDetail",params:{iCustomerId:value.uGUID,sCustomerType:this.activeIndex}})
},
},
watch:{
activeIndex(n){
this.getData()
}
},
}
</script>
<style lang="less">
@import url('../../../styles/common.less');
#liabilitiesDetail{
}
</style>
<template>
<div id="liabilitiesDetail">
<div class="Table">
<customerTable :columns="columns" :list="list" :tableStyle="tableStyle" />
</div>
</div>
</template>
<script>
import Util from '@/libs/util.js';
import customerTable from '@/components/Table'
export default {
name:"liabilitiesDetail",
components:{customerTable},
data(){
return{
list:[],
columns:[
{
width:"50%",
name:"日期",
align:"center",
field:"dBillDate",
},
{
width:'50%',
name:'金额',
align:'center',
field:'应收',
}
],
tableStyle:{
theadBgColor:'rgba(223,238,253,1)',
complexTrBgColor:'white',
singleTrBgColor:'#eef4fe',
theadTdBorder:false,
tbodyTdBorder:false,
tbodyHeight:'calc(100vh)',
tbodyTrBorderBottom:'1px solid #dbe9f8',
width:'100%'
},
}
},
mounted(){
this.$nextTick(()=>{
this.getDetail();
})
},
methods:{
async getDetail(){
this.list=await this.request("getTiipLiabilities",{
params:{
iCustomerId:this.$route.params.iCustomerId,
sType:'Details',
sCustomerType:this.$route.params.sCustomerType,
}
},"加载中",{})
}
},
}
</script>
......@@ -53,7 +53,7 @@
<tab-item :selected="tabIndex=='getTiipReceiveinfo'" @on-item-click="tabIndex='getTiipReceiveinfo'">收入</tab-item>
<tab-item :selected="tabIndex=='getTiipPayinfo'" @on-item-click="tabIndex='getTiipPayinfo'">支出</tab-item>
</tab>
<searchComponent :search='search' />
<dateMonth @month="searchData"/>
<div class="iCard" style="margin-bottom:8px;">
<div ref='chart' style="width:100%;height:150px;"/>
<table class="DATA">
......@@ -76,20 +76,19 @@
<script>
import Util from '@/libs/util.js'
import { Confirm } from 'vux'
import searchComponent from '@/components/search'
import dateMonth from '@/components/dateMonth'
import { Tab, TabItem } from 'vux'
export default {
name:"revenue",
components:{searchComponent,Tab,TabItem},
components:{dateMonth,Tab,TabItem},
data(){
return{
tabIndex:"getTiipReceiveinfo",
search:{
dBeginDate:Util.dateFormat(new Date(),'yyyy-MM-01'),
dEndDate:Util.dateFormat(new Date(),'yyyy-MM-dd'),
dateValue:{
start:"",
end:""
},
chart:null,
list:[],
colorList:[],
......@@ -100,12 +99,6 @@ export default {
mounted(){
this.$nextTick(()=>{
this.init()
this.searchData()
})
this.global.$off('searchData');
this.global.$on('searchData',()=>{
this.searchData()
})
},
methods:{
......@@ -119,11 +112,16 @@ export default {
}
})
},
async searchData(){
async searchData(start,end){
this.dateValue={
start:start,
end:end
}
var value=await this.request(this.tabIndex,{
data:{
dStartDate:this.search.dBeginDate,
dEndDate:this.search.dEndDate
dStartDate:start,
dEndDate:end
}
},"加载中",{})
if(this.tabIndex=="getTiipReceiveinfo"){
......@@ -211,7 +209,7 @@ export default {
},
watch:{
tabIndex(){
this.searchData()
this.searchData(this.dateValue.start,this.dateValue.end)
},
},
}
......
......@@ -61,7 +61,7 @@
</style>
<template>
<div id="statistics">
<searchComponent :search='search' />
<dateMonth @month="searchData" />
<div class="Content">
<div class='double'>
<div class="card">
......@@ -105,7 +105,7 @@
</template>
<script>
import Util from '@/libs/util.js'
import searchComponent from '@/components/search'
import dateMonth from '@/components/dateMonth'
import { Confirm } from 'vux'
import { clearTimeout, setTimeout } from 'timers';
import { toUnicode } from 'punycode';
......@@ -113,13 +113,13 @@ import echarts from 'echarts';
export default {
name:"salesStatistics",
components:{searchComponent},
components:{dateMonth},
data(){
return{
search:{
dBeginDate:Util.dateFormat(new Date(),'yyyy-MM-01'),
dEndDate:Util.dateFormat(new Date(),'yyyy-MM-dd'),
},
// search:{
// dBeginDate:Util.dateFormat(new Date(),'yyyy-MM-01'),
// dEndDate:Util.dateFormat(new Date(),'yyyy-MM-dd'),
// },
chartData:{
nOrderSameRatio:0,
nOrderRingRatio:0,
......@@ -167,14 +167,14 @@ export default {
this.resize(this.chart6,1.35)
})
})
this.$nextTick(()=>{
this.searchData();
})
// this.$nextTick(()=>{
// this.searchData();
// })
this.global.$off('searchData');
this.global.$on('searchData',()=>{
this.searchData()
})
// this.global.$off('searchData');
// this.global.$on('searchData',()=>{
// this.searchData()
// })
},
methods:{
createChart(name,kield,isLinstener){
......@@ -225,15 +225,15 @@ export default {
chart.resize()
},
async searchData(){//搜索数据
await this.getChartData()
async searchData(start,end){//搜索数据
await this.getChartData(start,end)
this.showValue()
},
async getChartData(){
async getChartData(start,end){
var value =await this.request('getTiipSellinfo',{
params:{
dStartDate:this.search.dBeginDate,
dEndDate:this.search.dEndDate
dStartDate:start,
dEndDate:end
}
},"加载中",{iProjectId:this.iProjectId})
Object.assign(this.chartData,{
......
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