|
@@ -31,15 +31,28 @@
|
|
|
style="width: 100%"
|
|
|
></user-com>
|
|
|
</template>
|
|
|
+ <template slot="goodsNameSearch">
|
|
|
+ <goods-select
|
|
|
+ v-model="search.goodsName"
|
|
|
+ @valueName="(value) => valueName(value)"
|
|
|
+ :configuration="configuration"
|
|
|
+ >
|
|
|
+ </goods-select>
|
|
|
+ </template>
|
|
|
<template slot="menuLeft">
|
|
|
<el-button size="small"
|
|
|
type="primary"
|
|
|
- :loading="exportLoading"
|
|
|
- @click.stop="downFile"
|
|
|
+ @click.stop="statement"
|
|
|
>报表
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
+ <report-dialog
|
|
|
+ :switchDialog="switchDialog"
|
|
|
+ :searchValue="statementData"
|
|
|
+ :reportName="'进口贸易-提成统计表'"
|
|
|
+ @onClose="onClose()"
|
|
|
+ ></report-dialog>
|
|
|
</basic-container>
|
|
|
</template>
|
|
|
|
|
@@ -47,12 +60,12 @@
|
|
|
import option from "./config/mainList.json";
|
|
|
import { getCommission } from "@/api/statisticAnalysis/profit";
|
|
|
import { contrastList } from "@/util/contrastData";
|
|
|
+ import reportDialog from "@/components/report-dialog/main";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
loading : false,
|
|
|
- exportLoading:false,
|
|
|
form: {},
|
|
|
search:{},
|
|
|
show:true,
|
|
@@ -62,6 +75,8 @@
|
|
|
position:0,
|
|
|
parentId:0,
|
|
|
dataList: [],
|
|
|
+ statementData:[],
|
|
|
+ switchDialog:false,
|
|
|
page: {
|
|
|
pageSize: 10,
|
|
|
pagerCount: 5,
|
|
@@ -80,6 +95,9 @@
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
+ components:{
|
|
|
+ reportDialog
|
|
|
+ },
|
|
|
async created() {
|
|
|
// this.option = await this.getColumnData(this.getColumnName(66), option);
|
|
|
},
|
|
@@ -87,44 +105,47 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ valueName(value){
|
|
|
+ this.search.goodsId = value.id
|
|
|
+ },
|
|
|
addReceipt(){
|
|
|
console.log('1')
|
|
|
},
|
|
|
editOpen(){
|
|
|
console.log('1')
|
|
|
},
|
|
|
- rowspan() {
|
|
|
- //记录原始
|
|
|
- let oldList = [this.dataList[0].userName]
|
|
|
- this.dataList.forEach((item,index)=>{
|
|
|
- let newList = [item.userName]
|
|
|
- if(index===0){
|
|
|
- this.spanArr.push(1)
|
|
|
- this.position=0;
|
|
|
- }else{
|
|
|
- //如果循环数据与原始数据相等 那么合并
|
|
|
- if(!contrastList(oldList,newList)){
|
|
|
- this.spanArr[this.position] +=1;
|
|
|
- this.spanArr.push(0)
|
|
|
- }else{
|
|
|
- //如果不等 更新原始数据 循环在比较
|
|
|
- oldList = newList
|
|
|
- this.spanArr.push(1)
|
|
|
- this.position = index
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- spanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
- if (column.property === "userName") {
|
|
|
- const _row=this.spanArr[rowIndex];
|
|
|
- const _col=_row>0?1:0;
|
|
|
- return {
|
|
|
- rowspan:_row,
|
|
|
- colspan:_col
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
+ // rowspan() {
|
|
|
+ // //记录原始
|
|
|
+ // let oldList = [this.dataList[0].userName]
|
|
|
+ // this.dataList.forEach((item,index)=>{
|
|
|
+ // let newList = [item.userName]
|
|
|
+ // if(index===0){
|
|
|
+ // this.spanArr.push(1)
|
|
|
+ // this.position=0;
|
|
|
+ // }else{
|
|
|
+ // //如果循环数据与原始数据相等 那么合并
|
|
|
+ // if(!contrastList(oldList,newList)){
|
|
|
+ // this.spanArr[this.position] +=1;
|
|
|
+ // this.spanArr.push(0)
|
|
|
+ // }else{
|
|
|
+ // //如果不等 更新原始数据 循环在比较
|
|
|
+ // oldList = newList
|
|
|
+ // this.spanArr.push(1)
|
|
|
+ // this.position = index
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // spanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
+ // if (column.property === "userName") {
|
|
|
+ // const _row=this.spanArr[rowIndex];
|
|
|
+ // const _col=_row>0?1:0;
|
|
|
+ // return {
|
|
|
+ // rowspan:_row,
|
|
|
+ // colspan:_col
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
//点击搜索按钮触发
|
|
|
searchChange(params, done) {
|
|
|
this.query = params;
|
|
@@ -147,24 +168,45 @@
|
|
|
refreshChange() {
|
|
|
this.onLoad(this.page);
|
|
|
},
|
|
|
+ statement(){
|
|
|
+ this.statementData = this.paramsAdjustment(this.search)
|
|
|
+ this.switchDialog =! this.switchDialog;
|
|
|
+ },
|
|
|
+ onClose(val) {
|
|
|
+ this.switchDialog = val;
|
|
|
+ },
|
|
|
paramsAdjustment(params) {
|
|
|
params = Object.assign({}, this.search);
|
|
|
- // if (params.createTime && params.createTime.length !==0 ) { //发货
|
|
|
- // params.startTime = params.createTime[0]+ " " + "00:00:00";
|
|
|
- // params.endTime = params.createTime[1] + " " + "23:59:59";
|
|
|
- // this.$delete(params,'createTime')
|
|
|
- // }
|
|
|
- if(!params.userType){
|
|
|
- params.userType = "业务"
|
|
|
+
|
|
|
+ if(params.year && params.year !== '2022'){
|
|
|
+ params.year = params.year.getFullYear()
|
|
|
}
|
|
|
return params
|
|
|
},
|
|
|
onLoad(page, params) {
|
|
|
- this.loading = true;
|
|
|
params = this.paramsAdjustment(params)
|
|
|
+ if(!params.goodsId){
|
|
|
+ this.$message.warning("请先选择商品!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!params.userType){
|
|
|
+ this.$message.warning("请先选择提成类型!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!params.quarter){
|
|
|
+ this.$message.warning("请先选择季度!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!params.year){
|
|
|
+ this.$message.warning("请先选择年份!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.loading = true;
|
|
|
getCommission(page.currentPage, page.pageSize,params).then(res=>{
|
|
|
- this.dataList = res.data.data.records
|
|
|
- this.page.total = res.data.data.total
|
|
|
+ this.dataList = res.data.data
|
|
|
+ if (res.data.data) {
|
|
|
+ this.option.height = window.innerHeight - 240;
|
|
|
+ }
|
|
|
// this.rowspan()
|
|
|
}).finally(()=>{
|
|
|
this.loading = false;
|