Commit 14ccd941 authored by 耿迪迪's avatar 耿迪迪

交易项目统计

parent 756f552c
package com.zehong.web.controller.transaction;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.system.domain.TBorrowingApplyFor;
import com.zehong.system.domain.TPurchase;
import com.zehong.system.domain.TTradeProject;
import com.zehong.system.service.ITStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/statistics")
public class TStatisticsController extends BaseController {
@Autowired
private ITStatisticsService itStatisticsService;
/**
* 项目交易收入
* @param tTradeProject 交易实体
* @return
*/
@GetMapping("/tradeIncomeStatistics")
public AjaxResult tradeIncomeStatistics(TTradeProject tTradeProject){
return AjaxResult.success(itStatisticsService.tradeIncomeStatistics(tTradeProject));
}
/**
* 项目交易支出
* @param tTradeProject 交易实体
* @return
*/
@GetMapping("/tradeExpensesStatistics")
public AjaxResult tradeExpensesStatistics(TTradeProject tTradeProject){
return AjaxResult.success(itStatisticsService.tradeExpensesStatistics(tTradeProject));
}
/**
* 借支
* @param tBorrowingApplyFor 借支实体
* @return
*/
@PostMapping("/borrowingStatistics")
public AjaxResult borrowingStatistics(@RequestBody TBorrowingApplyFor tBorrowingApplyFor){
return AjaxResult.success(itStatisticsService.borrowingStatistics(tBorrowingApplyFor));
}
/**
* 采购统计
* @param tPurchase 采购实体
* @return
*/
@PostMapping("/purchaseStatistics")
public AjaxResult purchaseStatistics(TPurchase tPurchase){
return AjaxResult.success(itStatisticsService.purchaseStatistics(tPurchase));
}
}
......@@ -74,7 +74,7 @@ spring:
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
min-idle: 1
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
......
package com.zehong.system.domain;
import java.math.BigDecimal;
public class TBorrowingStatistics {
private String borrowingDeptName;
private String handledByUserName;
private int countNum;
private BigDecimal totalFigures;
private Long borrowingDeptId;
private Long handledByUserId;
public String getBorrowingDeptName() {
return borrowingDeptName;
}
public void setBorrowingDeptName(String borrowingDeptName) {
this.borrowingDeptName = borrowingDeptName;
}
public String getHandledByUserName() {
return handledByUserName;
}
public void setHandledByUserName(String handledByUserName) {
this.handledByUserName = handledByUserName;
}
public int getCountNum() {
return countNum;
}
public void setCountNum(int countNum) {
this.countNum = countNum;
}
public BigDecimal getTotalFigures() {
return totalFigures;
}
public void setTotalFigures(BigDecimal totalFigures) {
this.totalFigures = totalFigures;
}
public Long getBorrowingDeptId() {
return borrowingDeptId;
}
public void setBorrowingDeptId(Long borrowingDeptId) {
this.borrowingDeptId = borrowingDeptId;
}
public Long getHandledByUserId() {
return handledByUserId;
}
public void setHandledByUserId(Long handledByUserId) {
this.handledByUserId = handledByUserId;
}
}
package com.zehong.system.domain;
import java.math.BigDecimal;
public class TPurchaseStatistics {
private String purchaseDeptName;
private String handledByUserName;
private String userName;
private int countNum;
private BigDecimal totalPurchase;
private Long purchaseDeptId;
private Long userId;
private Long handledByUserId;
public String getPurchaseDeptName() {
return purchaseDeptName;
}
public void setPurchaseDeptName(String purchaseDeptName) {
this.purchaseDeptName = purchaseDeptName;
}
public String getHandledByUserName() {
return handledByUserName;
}
public void setHandledByUserName(String handledByUserName) {
this.handledByUserName = handledByUserName;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public int getCountNum() {
return countNum;
}
public void setCountNum(int countNum) {
this.countNum = countNum;
}
public BigDecimal getTotalPurchase() {
return totalPurchase;
}
public void setTotalPurchase(BigDecimal totalPurchase) {
this.totalPurchase = totalPurchase;
}
public Long getPurchaseDeptId() {
return purchaseDeptId;
}
public void setPurchaseDeptId(Long purchaseDeptId) {
this.purchaseDeptId = purchaseDeptId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getHandledByUserId() {
return handledByUserId;
}
public void setHandledByUserId(Long handledByUserId) {
this.handledByUserId = handledByUserId;
}
}
......@@ -124,6 +124,8 @@ public class TTradeProject extends BaseEntity
private Date createEndTime;
private String sortType;
public String getDealRemark() {
return dealRemark;
}
......@@ -432,6 +434,14 @@ public class TTradeProject extends BaseEntity
this.createEndTime = createEndTime;
}
public String getSortType() {
return sortType;
}
public void setSortType(String sortType) {
this.sortType = sortType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
package com.zehong.system.domain;
import java.math.BigDecimal;
public class TradeExpensesStatistics {
private String tradeDeptName;
private String tradeTransactorName;
private int countNum;
private BigDecimal totalDealPrice;
private Long tradeDeptId;
private Long tradeTransactor;
public String getTradeDeptName() {
return tradeDeptName;
}
public void setTradeDeptName(String tradeDeptName) {
this.tradeDeptName = tradeDeptName;
}
public String getTradeTransactorName() {
return tradeTransactorName;
}
public void setTradeTransactorName(String tradeTransactorName) {
this.tradeTransactorName = tradeTransactorName;
}
public int getCountNum() {
return countNum;
}
public void setCountNum(int countNum) {
this.countNum = countNum;
}
public BigDecimal getTotalDealPrice() {
return totalDealPrice;
}
public void setTotalDealPrice(BigDecimal totalDealPrice) {
this.totalDealPrice = totalDealPrice;
}
public Long getTradeDeptId() {
return tradeDeptId;
}
public void setTradeDeptId(Long tradeDeptId) {
this.tradeDeptId = tradeDeptId;
}
public Long getTradeTransactor() {
return tradeTransactor;
}
public void setTradeTransactor(Long tradeTransactor) {
this.tradeTransactor = tradeTransactor;
}
}
package com.zehong.system.domain;
import java.math.BigDecimal;
public class TradeIncomeStatistics {
private String applyDeptName;
private String applyName;
private int countNum;
private BigDecimal totalDealPrice;
private Long applyDeptId;
private Long applyId;
public String getApplyDeptName() {
return applyDeptName;
}
public void setApplyDeptName(String applyDeptName) {
this.applyDeptName = applyDeptName;
}
public String getApplyName() {
return applyName;
}
public void setApplyName(String applyName) {
this.applyName = applyName;
}
public int getCountNum() {
return countNum;
}
public void setCountNum(int countNum) {
this.countNum = countNum;
}
public BigDecimal getTotalDealPrice() {
return totalDealPrice;
}
public void setTotalDealPrice(BigDecimal totalDealPrice) {
this.totalDealPrice = totalDealPrice;
}
public Long getApplyDeptId() {
return applyDeptId;
}
public void setApplyDeptId(Long applyDeptId) {
this.applyDeptId = applyDeptId;
}
public Long getApplyId() {
return applyId;
}
public void setApplyId(Long applyId) {
this.applyId = applyId;
}
}
package com.zehong.system.mapper;
import com.zehong.system.domain.*;
import java.util.List;
/**
* @author geng
* 统计
*/
public interface TStatisticsMapper {
/**
* 项目交易收入
* @param tTradeProject 交易实体
* @return
*/
List<TradeIncomeStatistics> tradeIncomeStatistics(TTradeProject tTradeProject);
/**
* 项目交易支出
* @param tTradeProject 交易实体
* @return
*/
List<TradeExpensesStatistics> tradeExpensesStatistics(TTradeProject tTradeProject);
/**
* 借支
* @param tBorrowingApplyFor 借支实体
* @return
*/
List<TBorrowingStatistics> borrowingStatistics(TBorrowingApplyFor tBorrowingApplyFor);
/**
* 采购统计
* @param tPurchase 采购实体
* @return
*/
List<TPurchaseStatistics> purchaseStatistics(TPurchase tPurchase);
}
package com.zehong.system.service;
import com.zehong.system.domain.*;
import java.util.List;
public interface ITStatisticsService {
/**
* 项目交易收入
* @param tTradeProject 交易实体
* @return
*/
List<TradeIncomeStatistics> tradeIncomeStatistics(TTradeProject tTradeProject);
/**
* 项目交易支出
* @param tTradeProject 交易实体
* @return
*/
List<TradeExpensesStatistics> tradeExpensesStatistics(TTradeProject tTradeProject);
/**
* 借支
* @param tBorrowingApplyFor 借支实体
* @return
*/
List<TBorrowingStatistics> borrowingStatistics(TBorrowingApplyFor tBorrowingApplyFor);
/**
* 采购统计
* @param tPurchase 采购实体
* @return
*/
List<TPurchaseStatistics> purchaseStatistics(TPurchase tPurchase);
}
package com.zehong.system.service.impl;
import com.zehong.system.domain.*;
import com.zehong.system.mapper.TStatisticsMapper;
import com.zehong.system.service.ITStatisticsService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @author geng
* 统计
*/
@Service
public class ITStatisticsServiceImpl implements ITStatisticsService {
@Resource
private TStatisticsMapper tStatisticsMapper;
/**
* 项目交易收入
* @param tTradeProject 交易实体
* @return
*/
@Override
public List<TradeIncomeStatistics> tradeIncomeStatistics(TTradeProject tTradeProject) {
return tStatisticsMapper.tradeIncomeStatistics(tTradeProject);
}
/**
* 项目交易支出
* @param tTradeProject 交易实体
* @return
*/
@Override
public List<TradeExpensesStatistics> tradeExpensesStatistics(TTradeProject tTradeProject) {
return tStatisticsMapper.tradeExpensesStatistics(tTradeProject);
}
/**
* 借支
* @param tBorrowingApplyFor 借支实体
* @return
*/
@Override
public List<TBorrowingStatistics> borrowingStatistics(TBorrowingApplyFor tBorrowingApplyFor) {
return tStatisticsMapper.borrowingStatistics(tBorrowingApplyFor);
}
/**
* 采购统计
* @param tPurchase 采购实体
* @return
*/
@Override
public List<TPurchaseStatistics> purchaseStatistics(TPurchase tPurchase) {
return tStatisticsMapper.purchaseStatistics(tPurchase);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TStatisticsMapper">
<resultMap id="TradeIncomeStatisticsMap" type="TradeIncomeStatistics">
<result property="applyDeptName" column="apply_dept_name"/>
<result property="applyName" column="apply_name"/>
<result property="countNum" column="count_num"/>
<result property="totalDealPrice" column="total_deal_price"/>
<result property="applyDeptId" column="apply_dept_id"/>
<result property="applyId" column="apply_id"/>
</resultMap>
<resultMap id="TradeExpensesStatisticsMap" type="TradeExpensesStatistics">
<result property="tradeDeptName" column="trade_dept_name"/>
<result property="tradeTransactorName" column="trade_transactor_name"/>
<result property="countNum" column="count_num"/>
<result property="totalDealPrice" column="total_deal_price"/>
<result property="tradeDeptId" column="trade_dept_id"/>
<result property="tradeTransactor" column="trade_transactor"/>
</resultMap>
<resultMap id="TBorrowingStatisticsMap" type="TBorrowingStatistics">
<result property="borrowingDeptName" column="borrowing_dept_name"/>
<result property="handledByUserName" column="handled_by_user_name"/>
<result property="countNum" column="count_num"/>
<result property="totalFigures" column="total_figures"/>
<result property="borrowingDeptId" column="borrowing_dept_id"/>
<result property="handledByUserId" column="handled_by_user_id"/>
</resultMap>
<resultMap id="TPurchaseStatisticsMap" type="TPurchaseStatistics">
<result property="purchaseDeptName" column="purchase_dept_name"/>
<result property="handledByUserName" column="handled_by_user_name"/>
<result property="userName" column="user_name"/>
<result property="countNum" column="count_num"/>
<result property="totalPurchase" column="total_purchase"/>
<result property="purchaseDeptId" column="purchase_dept_id"/>
<result property="userId" column="user_id"/>
<result property="handledByUserId" column="handled_by_user_id"/>
</resultMap>
<!-- 项目交易收入 -->
<select id="tradeIncomeStatistics" parameterType="com.zehong.system.domain.TTradeProject" resultMap="TradeIncomeStatisticsMap">
SELECT
dept.dept_name AS apply_dept_name,
us.user_name AS apply_name,
count(1) AS count_num,
ROUND(IFNULL(sum(project.deal_price),0),2) AS total_deal_price,
project.apply_dept_id,
project.apply_id
FROM
t_trade_project project
LEFT JOIN sys_dept dept ON dept.dept_id = project.apply_dept_id
LEFT JOIN sys_user us ON us.user_id = project.apply_id
LEFT JOIN t_transaction_project trProject ON trProject.transaction_project_id = project.relation_transaction_project_id
<where>
<if test="applyName != null">and us.user_name like concat('%', #{applyName}, '%')</if>
<if test="createBeginTime != null and createEndTime != null">and project.create_time between #{createBeginTime} and #{createEndTime}</if>
<if test="applyDeptId != null">and project.apply_dept_id = #{applyDeptId}</if>
<if test="tradeDeptId != null">and project.trade_dept_id = #{tradeDeptId}</if>
<if test="transactionDetailName != null">and project.transaction_detail_name like concat('%', #{transactionDetailName}, '%')</if>
<if test="relationTransactionProjectName != null">and trProject.transaction_project_name like concat('%', #{relationTransactionProjectName}, '%')</if>
<if test="tradeStatus != null and tradeStatus != ''"> and project.trade_status = #{tradeStatus}</if>
</where>
<if test="sortType != null and sortType == 0">
GROUP BY project.apply_dept_id
</if>
<if test="sortType == null or sortType == 1">
GROUP BY project.apply_dept_id,project.apply_id
</if>
</select>
<!-- 项目交易支出 -->
<select id="tradeExpensesStatistics" parameterType="com.zehong.system.domain.TTradeProject" resultMap="TradeExpensesStatisticsMap">
SELECT
dept.dept_name AS trade_dept_name,
us.user_name AS trade_transactor_name,
count(1) AS count_num,
ROUND(IFNULL(sum(project.deal_price),0),2) AS total_deal_price,
project.trade_dept_id,
project.trade_transactor
FROM
t_trade_project project
LEFT JOIN sys_dept dept ON dept.dept_id = project.trade_dept_id
LEFT JOIN sys_user us ON us.user_id = project.trade_transactor
LEFT JOIN t_transaction_project trProject ON trProject.transaction_project_id = project.relation_transaction_project_id
<where>
<if test="applyName != null">and us.user_name like concat('%', #{applyName}, '%')</if>
<if test="createBeginTime != null and createEndTime != null">and project.create_time between #{createBeginTime} and #{createEndTime}</if>
<if test="applyDeptId != null">and project.apply_dept_id = #{applyDeptId}</if>
<if test="tradeDeptId != null">and project.trade_dept_id = #{tradeDeptId}</if>
<if test="transactionDetailName != null">and project.transaction_detail_name like concat('%', #{transactionDetailName}, '%')</if>
<if test="relationTransactionProjectName != null">and trProject.transaction_project_name like concat('%', #{relationTransactionProjectName}, '%')</if>
<if test="tradeStatus != null and tradeStatus != ''"> and project.trade_status = #{tradeStatus}</if>
</where>
<if test="sortType != null and sortType == 0">
GROUP BY project.trade_dept_id
</if>
<if test="sortType == null or sortType == 1">
GROUP BY project.trade_dept_id,project.trade_transactor
</if>
</select>
<!-- 借支 -->
<select id="borrowingStatistics" parameterType="com.zehong.system.domain.TBorrowingApplyFor" resultMap="TBorrowingStatisticsMap">
SELECT
dept.dept_name AS borrowing_dept_name,
us.user_name AS handled_by_user_name,
count(1) AS count_num,
ROUND(IFNULL(sum(bor.total_figures),0),2) AS total_figures,
bor.borrowing_dept_id,
bor.handled_by_user_id
FROM
t_borrowing_apply_for bor
LEFT JOIN sys_dept dept ON dept.dept_id = bor.borrowing_dept_id
LEFT JOIN sys_user us ON us.user_id = bor.handled_by_user_id
GROUP BY bor.borrowing_dept_id,bor.handled_by_user_id
</select>
<!-- 采购 -->
<select id="purchaseStatistics" parameterType="com.zehong.system.domain.TPurchase" resultMap="TPurchaseStatisticsMap">
SELECT
dept.dept_name AS purchase_dept_name,
us.user_name AS handled_by_user_name,
uh.user_name AS user_name,
count(1) AS count_num,
ROUND(IFNULL(sum(pur.total),0),2) AS total_purchase,
pur.purchase_dept_id,
pur.user_id,
pur.handled_by_user_id
FROM
t_purchase pur
LEFT JOIN sys_dept dept ON dept.dept_id = pur.purchase_dept_id
LEFT JOIN sys_user us ON us.user_id = pur.user_id
LEFT JOIN sys_user uh ON uh.user_id = pur.handled_by_user_id
GROUP BY pur.purchase_dept_id,pur.user_id,pur.handled_by_user_id
</select>
</mapper>
\ No newline at end of file
import request from '@/utils/request';
//交易项目收入统计
export function tradeIncomeStatistics(query) {
return request({
url: '/statistics/tradeIncomeStatistics',
method: 'get',
params: query
})
}
//交易项目支出统计
export function tradeExpensesStatistics(query) {
return request({
url: '/statistics/tradeExpensesStatistics',
method: 'get',
params: query
})
}
//借支统计
export function borrowingStatistics(data) {
return request({
url: '/statistics/borrowingStatistics',
method: 'post',
data: data
})
}
//采购统计
export function purchaseStatistics(data) {
return request({
url: '/statistics/purchaseStatistics',
method: 'post',
data: data
})
}
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="指定分类" prop="sortType">
<el-select v-model="queryParams.sortType" placeholder="请选择分类类型" clearable @change="sortChange">
<el-option label="按部门分类" value="0"/>
<el-option label="按经办人分类" value="1"/>
</el-select>
</el-form-item>
<el-form-item label="经办人" prop="applyName">
<el-input v-model="queryParams.applyName" placeholder="请输入经办人"/>
</el-form-item>
<el-form-item label="申请时间">
<el-date-picker
v-model="applyTime"
size="small"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="timeChange"
style="width: 340px"
>
</el-date-picker>
</el-form-item>
<el-form-item label="卖方部门" prop="applyDeptId" v-if="tab == '1'">
<div style="width: 160px">
<treeselect
v-model="queryParams.applyDeptId"
:options="deptOptions"
:show-count="true"
placeholder="请选择卖方部门"
/>
</div>
</el-form-item>
<el-form-item label="买方部门" prop="tradeDeptId" v-if="tab == '0'">
<div style="width: 160px">
<treeselect
v-model="queryParams.tradeDeptId"
:options="deptOptions"
:show-count="true"
placeholder="请选择买方部门"
/>
</div>
</el-form-item>
<el-form-item label="交易项目" prop="relationTransactionProjectName">
<el-input
v-model="queryParams.relationTransactionProjectName"
placeholder="请输入交易项目"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="交易细项名称" prop="transactionDetailName">
<el-input
v-model="queryParams.transactionDetailName"
placeholder="请输入交易细项名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="项目状态" prop="tradeStatus">
<el-select
v-model="queryParams.tradeStatus"
placeholder="请选择项目状态"
clearable
size="small"
>
<el-option
v-for="item in transactionProjectStatus"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-card class="box-card">
<div class="outer-div">
<header class="header">
<ul class="tab-tilte">
<li :class="{ active: tab == 0 }" @click="changeTab(0)">
交易收入
</li>
<li :class="{ active: tab == 1 }" @click="changeTab(1)">
交易支出
</li>
</ul>
</header>
<div class="tab-content">
<div v-if="tab == 0" :key="tab">
<IncomeTableList ref="income" :param="queryParams"/>
</div>
<div v-if="tab == 1" :key="tab">
<ExpensesTableList ref="expenses" :param="queryParams"/>
</div>
</div>
</div>
</el-card>
</div>
</template>
<script>
import IncomeTableList from "../components/IncomeTableList";
import ExpensesTableList from "../components/ExpensesTableList";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "tradeCalculateStatistics",
components:{
IncomeTableList,
ExpensesTableList,
Treeselect
},
data(){
return{
tab: 0,
queryParams: {
transactionDetailName: null,
applyDeptId: null,
tradeType: null,
tradeDeptId: null,
tradeStatus: null,
createTime: null,
queryApplyDeptId: null,
queryTradeDeptId: null,
relationTransactionProjectName: null,
createBeginTime: null,
createEndTime: null,
applyName: null,
sortType: "0"
},
applyTime: [],
deptOptions: [],
transactionProjectStatus: []
}
},
created(){
this.getTreeselect();
this.getDicts("t_transaction_project_status").then((response) => {
this.transactionProjectStatus = response.data;
});
},
methods:{
changeTab(tabNum){
this.tab = tabNum;
},
getTreeselect() {
treeselect().then((response) => {
this.deptOptions = response.data;
});
},
/** 搜索按钮操作 */
handleQuery() {
if('0' == this.tab){
this.$refs.income.getIncomeList();
}
if('1' == this.tab){
this.$refs.expenses.getExpensesList();
}
},
sortChange(){
this.handleQuery();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.createBeginTime = null;
this.queryParams.createEndTime = null;
this.applyTime = [];
this.queryParams.sortType = '0';
this.handleQuery();
},
//时间切换
timeChange(value) {
if (value) {
this.queryParams.createBeginTime = value[0];
this.queryParams.createEndTime = value[1];
}
}
}
}
</script>
<style scoped lang="scss">
.outer-div {
//padding: 24px;
margin: 0 auto;
}
.header {
height: 47px;
width: 100%;
//border-bottom: 1px solid #ebebeb;
//margin-bottom: 24px;
}
ul li {
margin: 0;
padding: 0;
list-style: none;
}
.tab-tilte {
font-family: PingFangSC-Semibold;
letter-spacing: 0;
width: 90%;
padding-left: 0;
}
.tab-tilte li {
float: left;
font-size: 16px;
color: #999999;
// line-height: 53px;
text-align: center;
margin-right: 30px;
cursor: pointer;
}
/* 点击对应的标题添加对应的背景颜色 */
.tab-tilte .active {
color: #3385ff;
// border-bottom: 2px solid #3385ff;
}
.tab-content{
height: 450px;
overflow-y: auto;
&::-webkit-scrollbar {
/* 设置滚动条宽度 */
width: 4px;
/* 设置滚动条背景色 */
//background: black;
}
//滚动条轨道
&::-webkit-scrollbar-track {
background-color:transparent;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius:2em;
}
//滚动条滑块
&::-webkit-scrollbar-thumb {
background-color: rgb(147,147,153,0.5);
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius:2em;
}
}
</style>
<template>
<div class="expenses">
<el-table v-loading="loading" :data="projectList">
<el-table-column label="部门" align="center" prop="tradeDeptName" />
<el-table-column label="经办人" align="center" prop="tradeTransactorName" v-if="param.sortType != '0'"/>
<el-table-column label="条数" align="center" prop="countNum">
<template slot-scope="scope">
<span class="detail" @click="detail(scope.row)">{{scope.row.countNum}}</span>
</template>
</el-table-column>
<el-table-column label="交易支出总额" align="center" prop="totalDealPrice" />
</el-table>
<el-dialog
title="明细信息"
:visible.sync="open"
width="900px"
append-to-body
:close-on-click-modal="false"
destroy-on-close
>
<el-table v-loading="loading" :data="projectDetail">
<el-table-column label="部门" align="center" prop="tradeDeptName" :show-overflow-tooltip="true" width="120px"/>
<el-table-column label="经办人" align="center" prop="tradeTransactorName"/>
<el-table-column label="卖方部门" align="center" prop="applyDeptName" :show-overflow-tooltip="true" width="120px"/>
<el-table-column label="交易项目" align="center" prop="relationTransactionProjectName" :show-overflow-tooltip="true"/>
<el-table-column label="交易细项名称" align="center" prop="transactionDetailName" :show-overflow-tooltip="true"width="100px">
<template slot-scope="scope">
<span v-if="scope.row.transactionDetailName">{{scope.row.transactionDetailName}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="申请时间" align="center" prop="createTime" width="150px"/>
<el-table-column label="项目状态" align="center" prop="tradeStatus" :formatter="getTradeStatus" :show-overflow-tooltip="true"/>
<el-table-column label="交易成交价" align="center" prop="dealPrice" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="detailParam.pageNum"
:limit.sync="detailParam.pageSize"
@pagination="detailProjectList"
/>
</el-dialog>
</div>
</template>
<script>
import { tradeExpensesStatistics } from "@/api/transaction/statistics.js";
import { listProject } from "@/api/transaction/tradeProject.js";
export default {
name: "expenses-table-list",
props:{
param:{
type: Object
}
},
data(){
return{
loading: false,
projectList: [],
open: false,
projectDetail: [],
total: 0,
detailParam: {
pageNum: 1,
pageSize: 10,
}
}
},
created(){
this.getExpensesList();
},
methods:{
getExpensesList(){
this.loading = true;
tradeExpensesStatistics(this.param).then(res =>{
if(res.code == 200){
this.loading = false;
this.projectList = res.data;
}
})
},
detail(row){
this.detailParam = { ...this.param };
this.detailParam.tradeDeptId = row.tradeDeptId;
if(this.param.sortType != '0'){
this.detailParam.tradeTransactor = row.tradeTransactor;
}
this.detailParam.pageNum = 1;
this.detailParam.pageSize = 10;
this.open = true;
this.detailProjectList();
},
detailProjectList(){
this.loading = true;
listProject(this.detailParam).then(res =>{
if(res.code == 200){
this.loading = false;
this.projectDetail = res.rows;
this.total = res.total;
}
})
},
//获取交易状态
getTradeStatus(row) {
return this.selectDictLabel(
this.$parent.$parent.transactionProjectStatus,
row.tradeStatus
);
},
}
}
</script>
<style scoped lang="scss">
.detail{
text-decoration: underline;
color: blue;
cursor:pointer;
}
</style>
<template>
<div>
<el-table v-loading="loading" :data="projectList">
<el-table-column label="部门" align="center" prop="applyDeptName" />
<el-table-column label="经办人" align="center" prop="applyName" v-if="param.sortType != '0'"/>
<el-table-column label="条数" align="center" prop="countNum">
<template slot-scope="scope">
<span class="detail" @click="detail(scope.row)">{{scope.row.countNum}}</span>
</template>
</el-table-column>
<el-table-column label="交易收入总额" align="center" prop="totalDealPrice" />
</el-table>
<el-dialog
title="明细信息"
:visible.sync="open"
width="900px"
append-to-body
:close-on-click-modal="false"
destroy-on-close
>
<el-table v-loading="loading" :data="projectDetail">
<el-table-column label="部门" align="center" prop="applyDeptName" :show-overflow-tooltip="true" width="120px"/>
<el-table-column label="经办人" align="center" prop="applyName"/>
<el-table-column label="买方部门" align="center" prop="tradeDeptName" :show-overflow-tooltip="true" width="120px"/>
<el-table-column label="交易项目" align="center" prop="relationTransactionProjectName" :show-overflow-tooltip="true"/>
<el-table-column label="交易细项名称" align="center" prop="transactionDetailName" :show-overflow-tooltip="true"width="100px">
<template slot-scope="scope">
<span v-if="scope.row.transactionDetailName">{{scope.row.transactionDetailName}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="申请时间" align="center" prop="createTime" width="150px"/>
<el-table-column label="项目状态" align="center" prop="tradeStatus" :formatter="getTradeStatus" :show-overflow-tooltip="true"/>
<el-table-column label="交易成交价" align="center" prop="dealPrice" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="detailParam.pageNum"
:limit.sync="detailParam.pageSize"
@pagination="detailProjectList"
/>
</el-dialog>
</div>
</template>
<script>
import { tradeIncomeStatistics } from "@/api/transaction/statistics.js";
import { listProject } from "@/api/transaction/tradeProject.js";
export default {
name: "income-table-list",
props:{
param:{
type: Object
}
},
data(){
return{
loading: false,
projectList: [],
open: false,
projectDetail: [],
total: 0,
detailParam: {
pageNum: 1,
pageSize: 10,
}
}
},
created(){
this.getIncomeList();
},
methods:{
getIncomeList(){
this.loading = true;
tradeIncomeStatistics(this.param).then(res =>{
if(res.code == 200){
this.loading = false;
this.projectList = res.data;
}
})
},
detail(row){
this.detailParam = { ...this.param };
this.detailParam.applyDeptId = row.applyDeptId;
if(this.param.sortType != '0'){
this.detailParam.applyId = row.applyId;
}
this.detailParam.pageNum = 1;
this.detailParam.pageSize = 10;
this.open = true;
this.detailProjectList();
},
detailProjectList(){
this.loading = true;
listProject(this.detailParam).then(res =>{
if(res.code == 200){
this.loading = false;
this.projectDetail = res.rows;
this.total = res.total;
}
})
},
//获取交易状态
getTradeStatus(row) {
return this.selectDictLabel(
this.$parent.$parent.transactionProjectStatus,
row.tradeStatus
);
},
}
}
</script>
<style scoped lang="scss">
.detail{
text-decoration: underline;
color: blue;
cursor:pointer;
}
</style>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="经办人" prop="applyName">
<el-input v-model="queryParams.applyName" placeholder="请输入经办人"/>
</el-form-item>
<el-form-item label="申请时间">
<el-date-picker
v-model="applyTime"
size="small"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="timeChange"
style="width: 340px"
>
</el-date-picker>
</el-form-item>
<el-form-item label="卖方部门" prop="applyDeptId" v-if="tab == '1'">
<div style="width: 160px">
<treeselect
v-model="queryParams.applyDeptId"
:options="deptOptions"
:show-count="true"
placeholder="请选择卖方部门"
/>
</div>
</el-form-item>
<el-form-item label="买方部门" prop="tradeDeptId" v-if="tab == '0'">
<div style="width: 160px">
<treeselect
v-model="queryParams.tradeDeptId"
:options="deptOptions"
:show-count="true"
placeholder="请选择买方部门"
/>
</div>
</el-form-item>
<el-form-item label="交易项目" prop="relationTransactionProjectName">
<el-input
v-model="queryParams.relationTransactionProjectName"
placeholder="请输入交易项目"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="交易细项名称" prop="transactionDetailName">
<el-input
v-model="queryParams.transactionDetailName"
placeholder="请输入交易细项名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="项目状态" prop="tradeStatus">
<el-select
v-model="queryParams.tradeStatus"
placeholder="请选择项目状态"
clearable
size="small"
>
<el-option
v-for="item in transactionProjectStatus"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-card class="box-card">
<div class="outer-div">
<header class="header">
<ul class="tab-tilte">
<li :class="{ active: tab == 0 }" @click="changeTab(0)">
交易收入
</li>
<li :class="{ active: tab == 1 }" @click="changeTab(1)">
交易支出
</li>
</ul>
</header>
<div class="tab-content">
<div v-if="tab == 0" :key="tab">
<IncomeTableList ref="income" :param="queryParams"/>
</div>
<div v-if="tab == 1" :key="tab">
<ExpensesTableList ref="expenses" :param="queryParams"/>
</div>
</div>
</div>
</el-card>
</div>
</template>
<script>
import IncomeTableList from "./components/IncomeTableList";
import ExpensesTableList from "./components/ExpensesTableList";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "tradeStatistics",
components:{
IncomeTableList,
ExpensesTableList,
Treeselect
},
data(){
return{
tab: 0,
queryParams: {
transactionDetailName: null,
applyDeptId: this.$store.state.user.deptId,
tradeType: null,
tradeDeptId: null,
tradeStatus: null,
createTime: null,
queryApplyDeptId: null,
queryTradeDeptId: null,
relationTransactionProjectName: null,
createBeginTime: null,
createEndTime: null,
applyName: null
},
applyTime: [],
deptOptions: [],
transactionProjectStatus: []
}
},
created(){
this.getTreeselect();
this.getDicts("t_transaction_project_status").then((response) => {
this.transactionProjectStatus = response.data;
});
},
methods:{
changeTab(tabNum){
this.tab = tabNum;
if('0' == tabNum){
this.queryParams.applyDeptId = this.$store.state.user.deptId;
this.queryParams.tradeDeptId = null;
}
if('1' == tabNum){
this.queryParams.applyDeptId = null;
this.queryParams.tradeDeptId = this.$store.state.user.deptId;
}
},
getTreeselect() {
treeselect().then((response) => {
this.deptOptions = response.data;
});
},
/** 搜索按钮操作 */
handleQuery() {
if('0' == this.tab){
this.$refs.income.getIncomeList();
}
if('1' == this.tab){
this.$refs.expenses.getExpensesList();
}
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.createBeginTime = null;
this.queryParams.createEndTime = null;
this.applyTime = [];
this.handleQuery();
},
//时间切换
timeChange(value) {
if (value) {
this.queryParams.createBeginTime = value[0];
this.queryParams.createEndTime = value[1];
}
}
}
}
</script>
<style scoped lang="scss">
.outer-div {
//padding: 24px;
margin: 0 auto;
}
.header {
height: 47px;
width: 100%;
//border-bottom: 1px solid #ebebeb;
//margin-bottom: 24px;
}
ul li {
margin: 0;
padding: 0;
list-style: none;
}
.tab-tilte {
font-family: PingFangSC-Semibold;
letter-spacing: 0;
width: 90%;
padding-left: 0;
}
.tab-tilte li {
float: left;
font-size: 16px;
color: #999999;
// line-height: 53px;
text-align: center;
margin-right: 30px;
cursor: pointer;
}
/* 点击对应的标题添加对应的背景颜色 */
.tab-tilte .active {
color: #3385ff;
// border-bottom: 2px solid #3385ff;
}
.tab-content{
height: 450px;
overflow-y: auto;
&::-webkit-scrollbar {
/* 设置滚动条宽度 */
width: 4px;
/* 设置滚动条背景色 */
//background: black;
}
//滚动条轨道
&::-webkit-scrollbar-track {
background-color:transparent;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius:2em;
}
//滚动条滑块
&::-webkit-scrollbar-thumb {
background-color: rgb(147,147,153,0.5);
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius:2em;
}
}
</style>
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