Commit af328873 authored by godwithdh's avatar godwithdh

tiip_form

parent 24810931
<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>
......@@ -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({});
......
......@@ -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,47 +113,77 @@ 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.chartData1=[]
this.chartData2=[]
this.chartData3=[]
// 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();
}
// 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=[]
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();
}
})
},
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){
......
......@@ -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