| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- <template>
- <div class="div-box-new-margin" style="margin-bottom: 16px" >
- <div class="div-border-box" id="financialCollectionFull">
- <div class="out">
- <div>
- <div class="div-line div-line-right"></div>
- <div class="title" style="min-width: 220px;">{{$t(`财务回款分析`)}}</div>
- </div>
- <div class="in">
- <div class="inline-16 mt-10">
- <departmentSalesperson ref="departmentSalesperson" placement="left-start" @depSelect="depSelect" @personSelect="personSelect" :isFull="isFull" :is-new-dep="true"></departmentSalesperson>
- </div>
- <div class="mt-10 inline-16">
- <p class="search__label">{{$t('状态')}}:</p>
- <el-select v-model="param.content.where.isleave" clearable style="margin-right:10px" size="small" :placeholder="$t('请选择状态')" @change="tableData(param.content.dataid,param.content.where.isleave,'状态');queryModel(param.content.dataid,param.content.where.isleave,'状态')" >
- <el-option :label="$t('在职')" value="1"></el-option>
- <el-option :label="$t('离职')" value="2"></el-option>
- </el-select>
- </div>
- <div class="inline-15 mt-10">
- <exportFileInfo :param="exportParam" :oldParam="tableParam" :columns="tool.tabelCol(this.$route.name).financialCollectioDetailTable.tablecols" fileName="财务回款分析明细" btnTitle="导出明细"></exportFileInfo>
- </div>
- <div class="inline-15 mt-10">
- <exportFile :param="tableParam" :columns="tablecols" fileName="财务回款分析" :dataid="tableParam.content.dataid"></exportFile>
- </div>
- <fullScreen domId="financialCollectionFull" @onFull="onFull" @backFull="backFull" :scrollHeight="scrollHeight"></fullScreen>
- </div>
- </div>
- <div class="chart">
- <div id="financialCollectionAnalysisChart" :style="{height:heightChart}" ref="chartRef"></div>
- </div>
- <div style="font-size: 16px;margin: 10px 0 10px 0">{{$t(tableParam.content.unwriteoffamounttype?tableParam.content.unwriteoffamounttype:'')}}</div>
- <div :style="{height: heightTable}" >
- <tableTemplate ref="table" :layout="tablecols" :data="list" :opwidth="200" :custom="true" height="356px" fixedName="operation" :height="height">
- <template v-slot:customcol="scope">
- <p v-if="scope.column.columnname === 'total'">
- ¥{{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
- </p>
- <p v-else-if="scope.column.columnname === 'zerotothree'">
- ¥{{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
- </p>
- <p v-else-if="scope.column.columnname === 'threetosix'">
- ¥{{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
- </p>
- <p v-else-if="scope.column.columnname === 'sixtotwelve'">
- ¥{{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
- </p>
- <p v-else-if="scope.column.columnname === 'twelveup'">
- ¥{{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
- </p>
- <p v-else-if="scope.column.columnname === 'operation'"></p>
- <p v-else>{{scope.column.data[scope.column.columnname]?$t(scope.column.data[scope.column.columnname]):'--'}}</p>
- </template>
- <template v-slot:opreation="scope">
- <financialCollectionDetail :dataid="param.content.dataid" :type="param.content.type" :isFull="isFull" :sys_enterpriseid="scope.data.sys_enterpriseid" :data="scope.data" :unwriteoffamounttype="tableParam.content.unwriteoffamounttype"></financialCollectionDetail>
- </template>
- </tableTemplate>
- <div class="container normal-panel" style="text-align:right;float: right;">
- <el-pagination
- background
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :pager-count="7"
- :page-sizes="[20, 50,100, 200]"
- :page-size="20"
- layout="total,sizes, prev, pager, next, jumper"
- :total="total">
- </el-pagination>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import departmentSalesperson from "@/views/salesData/components/departmentSalesperson";
- import financialCollectionDetail from "@/views/salesData/components/financialCollectionDetail";
- import fullScreen from "@/views/salesData/components/fullScreen";
- import tableTemplate from '@/views/salesData/components/table';
- import exportFile from '@/components/export_file/index'
- import exportFileInfo from '@/components/export_file/index7'
- import {Bar, G2} from "@antv/g2plot";
- const G = G2.getEngine('canvas');
- export default {
- name: "financialCollectionAnalysis",
- props:['scrollHeight','windowWidth'],
- components:{
- departmentSalesperson,
- tableTemplate,
- financialCollectionDetail,
- fullScreen,
- exportFile,
- exportFileInfo
- },
- data(){
- return {
- chartBar:null,
- param:{
- "id": 20231016211904,
- "content": {
- "type": 0,
- "dataid": 54,
- "where":{
- "isleave":"1"
- }
- }
- },
- tableParam:{
- "id": 20231017084504,
- "content": {
- "type": 0,
- "dataid": '',
- "unwriteoffamounttype": "订单",
- "pageNumber": 1,
- "pageSize": 20,
- "where":{
- "isleave":""
- }
- }
- },
- chartData:[],
- list:[],
- currentPage:0,
- total:0,
- tablecols:[],
- hoverData:[],
- heightChart:'98%',
- heightTable:'403px',
- height:'356px',
- isFull:false,
- exportParam:{
- "id": 2025033114042802,
- "content": {
- "type": 1,
- "dataid": 58,
- "unwriteoffamounttype": "订单",
- "pageNumber": 1,
- "pageSize": 20,
- "where": {
- "isleave": "1"
- }
- },
- }
- }
- },
- methods:{
- async listData(val){
- this.renderPie(val)
- this.tableData(val,this.param.content.where.isleave)
- },
- async queryModel(val,isleave,state){
- if (state == '状态'){
- this.$refs.departmentSalesperson.person = ''
- this.param.content.type = 1
- this.param.content.dataid = this.$refs.departmentSalesperson.depment ? this.$refs.departmentSalesperson.depment : -1
- }else {
- this.param.content.dataid = val?val : this.dataid
- }
- this.param.content.where.isleave = isleave
- const res = await this.$api.requested(this.param)
- this.chartData = res.data.map(item=>{
- let value = this.tool.unitConversion(item.value,10000)
- return {
- key: this.$t(item.key) + '(' + this.$t('万元') + ')',
- type: this.$t(item.type),
- value: value
- }
- })
- this.chartBar.changeData(this.chartData)
- state == '状态' ? this.personData(this.$refs.departmentSalesperson.depment) : ''
- },
- renderPie(val){
- this.chartBar = new Bar('financialCollectionAnalysisChart',{
- data:this.chartData,
- isStack: true,
- xField: 'value',
- yField: 'type',
- seriesField: 'key',
- label:{
- formatter: (datum) =>{
- return '¥'+this.tool.formatAmount(datum.value,2)
- }
- },
- tooltip: {
- formatter: (datum) => {
- return {
- name:datum.key,
- value:'¥'+this.tool.formatAmount(datum.value,2)
- }
- }
- }
- })
- this.chartBar.render()
- this.chartBar.on('tooltip:change',ev=>{
- this.hoverData = ev.data.items[0]
- })
- this.chartBar.on('plot:click',ev=>{
- this.tableParam.content.unwriteoffamounttype = this.hoverData.data.type
- this.tableParam.content.pageNumber = 1
- this.tableData(this.param.content.dataid,this.param.content.where.isleave)
- })
- this.queryModel(val,this.param.content.where.isleave)
- },
- async tableData(val,isleave,state){
- if (state == '状态'){
- this.tableParam.content.type = 1
- this.tableParam.content.dataid = this.$refs.departmentSalesperson.depment ? this.$refs.departmentSalesperson.depment : -1
- }else {
- this.tableParam.content.dataid = val?val : this.dataid
- }
- this.tableParam.content.where.isleave = isleave
- const res = await this.$api.requested(this.tableParam)
- this.list = res.data
- this.total = res.total
- this.currentPage = res.pageNumber
- },
- /*选择部门*/
- depSelect(val){
- this.param.content.type = 1
- this.param.content.dataid = val?val:-1
- this.tableParam.content.type = 1
- this.personData(this.param.content.dataid)
- this.queryModel(this.param.content.dataid,this.param.content.where.isleave)
- this.tableData(this.param.content.dataid,this.param.content.where.isleave)
- },
- /*选择业务员*/
- personSelect(val){
- if (val || this.$refs.departmentSalesperson.depment){
- this.param.content.type = val?0:1
- this.param.content.dataid = val?val:this.$refs.departmentSalesperson.depment
- this.tableParam.content.type = val?0:1
- }else {
- this.param.content.type = 1
- this.param.content.dataid = -1
- this.tableParam.content.type = 1
- }
- this.queryModel(this.param.content.dataid,this.param.content.where.isleave)
- this.tableData(this.param.content.dataid,this.param.content.where.isleave)
- },
- /*获取新的业务员列表*/
- async personData(depid){
- let param = {
- id: 20230620102004,
- content: {
- isleave:this.param.content.where.isleave,
- depid:depid
- },
- }
- const res = await this.$api.requested(param)
- this.$refs.departmentSalesperson.personnelList = res.data.hr
- },
- handleSizeChange(val) {
- // console.log(`每页 ${val} 条`);
- this.tableParam.content.pageSize = val
- this.tableData(this.param.content.dataid,this.param.content.where.isleave)
- },
- handleCurrentChange(val) {
- // console.log(`当前页: ${val}`);
- this.tableParam.content.pageNumber = val
- this.tableData(this.param.content.dataid,this.param.content.where.isleave)
- },
- /*全屏*/
- onFull(){
- this.heightChart = '98%'
- /*this.heightTable = '883px'
- this.height = '886px'*/
- this.heightTable = 'calc(100vh - 800px)'
- this.height = 'calc(100vh - 555px)'
- this.isFull = true
- },
- /*退出全屏*/
- backFull(val){
- this.heightChart = '98%'
- this.heightTable = '403px'
- this.height = '356px'
- this.isFull = false
- this.$emit('backFull',val)
- }
- },
- created() {
- this.tablecols = this.tool.tabelCol(this.$route.name).financialCollectioTable.tablecols
- }
- }
- </script>
- <style scoped>
- </style>
|