|
@@ -22,7 +22,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <el-select v-model="param.content.dateType" class="inline-16" size="small" @change="listData" :popper-append-to-body="false">
|
|
|
+ <el-select v-model="param.content.dateType" class="inline-16" size="small" @change="dateTypeChange" :popper-append-to-body="false">
|
|
|
<el-option :label="$t('去年')" value="去年"></el-option>
|
|
|
<el-option :label="$t('本年')" value="本年"></el-option>
|
|
|
<el-option :label="$t('本季')" value="本季"></el-option>
|
|
@@ -97,8 +97,11 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <div id="salesPanelChart"></div>
|
|
|
+ <div style="margin-top: 1.042vw">
|
|
|
+ <div style="display:flex;justify-content: right">
|
|
|
+ <datePicker ref="pickerRef" type="year" @selectTime="pickerChange" format="yyyy" value_format="yyyy"></datePicker>
|
|
|
+ </div>
|
|
|
+ <div id="salesPanelChart" style="height: 14.5vw"></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</borderTemplate>
|
|
@@ -108,9 +111,10 @@
|
|
|
<script>
|
|
|
import borderTemplate from '../components/borderTemplate'
|
|
|
import {DualAxes} from "@antv/g2plot";
|
|
|
+import datePicker from "../components/datePicker";
|
|
|
export default {
|
|
|
name: "salesPanel",
|
|
|
- components:{borderTemplate},
|
|
|
+ components:{borderTemplate,datePicker},
|
|
|
data(){
|
|
|
return {
|
|
|
typeSelect:'订单',
|
|
@@ -148,26 +152,43 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
- async listData(){
|
|
|
+ async listData(init,time){
|
|
|
const res = await this.$api.requested(this.param)
|
|
|
this.list = res.data
|
|
|
this.percentage = Math.round(this.list.wcamount * 100 * 100) / 100;
|
|
|
console.log(this.list,'销售看板')
|
|
|
- this.renderPie()
|
|
|
+ if (init){
|
|
|
+ this.renderPie()
|
|
|
+ }else {
|
|
|
+ if (time){
|
|
|
+ this.queryModel()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dateTypeChange(){
|
|
|
+ this.listData(false,false)
|
|
|
+ },
|
|
|
+ pickerChange(val){
|
|
|
+ this.paramChart.content.year = val
|
|
|
+ this.listData(false,true)
|
|
|
},
|
|
|
typeChange(val){
|
|
|
if (val == '订单'){
|
|
|
this.typeSelect = '订单'
|
|
|
this.param.content.datatype = 1
|
|
|
+ this.paramChart.content.datatype = 1
|
|
|
}else if (val == '出货'){
|
|
|
this.typeSelect = '出货'
|
|
|
this.param.content.datatype = 2
|
|
|
+ this.paramChart.content.datatype = 2
|
|
|
}else if (val == '开票'){
|
|
|
this.typeSelect = '开票'
|
|
|
this.param.content.datatype = 3
|
|
|
+ this.paramChart.content.datatype = 3
|
|
|
}else if (val == '回款'){
|
|
|
this.typeSelect = '回款'
|
|
|
this.param.content.datatype = 4
|
|
|
+ this.paramChart.content.datatype = 4
|
|
|
}
|
|
|
this.listData()
|
|
|
},
|