Commit 1763b236 authored by 耿迪迪's avatar 耿迪迪

借支统计

parent 14ccd941
......@@ -65,6 +65,14 @@ public class TBorrowingApplyForController extends BaseController
return getDataTableT(list,permission);
}
@GetMapping("/borrowingList")
public TableDataInfo borrowingList(TBorrowingApplyFor tBorrowingApplyFor)
{
startPage();
List<TBorrowingApplyFor> list = tBorrowingApplyForService.selectTBorrowingApplyForList(tBorrowingApplyFor);
return getDataTable(list);
}
/**
* 导出借支申请列表
*/
......
......@@ -41,8 +41,8 @@ public class TStatisticsController extends BaseController {
* @param tBorrowingApplyFor 借支实体
* @return
*/
@PostMapping("/borrowingStatistics")
public AjaxResult borrowingStatistics(@RequestBody TBorrowingApplyFor tBorrowingApplyFor){
@GetMapping("/borrowingStatistics")
public AjaxResult borrowingStatistics(TBorrowingApplyFor tBorrowingApplyFor){
return AjaxResult.success(itStatisticsService.borrowingStatistics(tBorrowingApplyFor));
}
......@@ -51,7 +51,7 @@ public class TStatisticsController extends BaseController {
* @param tPurchase 采购实体
* @return
*/
@PostMapping("/purchaseStatistics")
@GetMapping("/purchaseStatistics")
public AjaxResult purchaseStatistics(TPurchase tPurchase){
return AjaxResult.success(itStatisticsService.purchaseStatistics(tPurchase));
}
......
......@@ -78,6 +78,10 @@ public class TBorrowingApplyFor extends BaseEntity
@Excel(name = "登记日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date approvalTime;
private Date registrationBeginDate;
private Date registrationEndDate;
public Date getApprovalTime() {
return approvalTime;
......@@ -101,6 +105,8 @@ public class TBorrowingApplyFor extends BaseEntity
private String ApprovedUserIdName;
private String sortType;
public String getHandledByUserIdName() {
return handledByUserIdName;
}
......@@ -246,6 +252,30 @@ public class TBorrowingApplyFor extends BaseEntity
return isDel;
}
public Date getRegistrationBeginDate() {
return registrationBeginDate;
}
public void setRegistrationBeginDate(Date registrationBeginDate) {
this.registrationBeginDate = registrationBeginDate;
}
public Date getRegistrationEndDate() {
return registrationEndDate;
}
public void setRegistrationEndDate(Date registrationEndDate) {
this.registrationEndDate = registrationEndDate;
}
public String getSortType() {
return sortType;
}
public void setSortType(String sortType) {
this.sortType = sortType;
}
@Override
public String toString() {
return "TBorrowingApplyFor{" +
......
......@@ -6,7 +6,7 @@ public class TBorrowingStatistics {
private String borrowingDeptName;
private String handledByUserName;
private String userName;
private int countNum;
......@@ -14,7 +14,7 @@ public class TBorrowingStatistics {
private Long borrowingDeptId;
private Long handledByUserId;
private Long userId;
public String getBorrowingDeptName() {
return borrowingDeptName;
......@@ -24,12 +24,12 @@ public class TBorrowingStatistics {
this.borrowingDeptName = borrowingDeptName;
}
public String getHandledByUserName() {
return handledByUserName;
public String getUserName() {
return userName;
}
public void setHandledByUserName(String handledByUserName) {
this.handledByUserName = handledByUserName;
public void setUserName(String userName) {
this.userName = userName;
}
public int getCountNum() {
......@@ -56,11 +56,11 @@ public class TBorrowingStatistics {
this.borrowingDeptId = borrowingDeptId;
}
public Long getHandledByUserId() {
return handledByUserId;
public Long getUserId() {
return userId;
}
public void setHandledByUserId(Long handledByUserId) {
this.handledByUserId = handledByUserId;
public void setHandledByUserId(Long userId) {
this.userId = userId;
}
}
......@@ -24,11 +24,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap id="TBorrowingStatisticsMap" type="TBorrowingStatistics">
<result property="borrowingDeptName" column="borrowing_dept_name"/>
<result property="handledByUserName" column="handled_by_user_name"/>
<result property="userName" column="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"/>
<result property="userId" column="user_id"/>
</resultMap>
<resultMap id="TPurchaseStatisticsMap" type="TPurchaseStatistics">
......@@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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,
us.nick_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,
......@@ -78,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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,
us.nick_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,
......@@ -109,24 +109,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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,
us.nick_name AS 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
bor.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
LEFT JOIN sys_user us ON us.user_id = bor.user_id
<where>
<if test="borrowingDeptId != null">and bor.borrowing_dept_id = #{borrowingDeptId}</if>
<if test="userIdName != null "> and us.nick_name like concat('%', #{userIdName}, '%')</if>
<if test="feeName != null and feeName != ''"> and bor.fee_name like concat('%', #{feeName}, '%')</if>
<if test="registrationBeginDate != null and registrationEndDate != null">and bor.registration_date between #{registrationBeginDate} and #{registrationEndDate}</if>
<if test="approvalStatus != null">and bor.approval_status = #{approvalStatus}</if>
</where>
<if test="sortType != null and sortType == 0">
GROUP BY bor.borrowing_dept_id
</if>
<if test="sortType == null or sortType == 1">
GROUP BY bor.borrowing_dept_id,bor.user_id
</if>
</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,
us.nick_name AS handled_by_user_name,
uh.nick_name AS user_name,
count(1) AS count_num,
ROUND(IFNULL(sum(pur.total),0),2) AS total_purchase,
pur.purchase_dept_id,
......
......@@ -22,7 +22,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="approvalStatus" column="approval_status" />
<result property="approvalTime" column="approval_time" />
</resultMap>
<sql id="selectTBorrowingApplyForVo">
......@@ -30,10 +29,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectTBorrowingApplyForList" parameterType="TBorrowingApplyFor" resultMap="TBorrowingApplyForResult">
SELECT a.*,b.nick_name handledByUserIdName,c.nick_name userIdName,d.nick_name ApprovedUserIdName FROM t_borrowing_apply_for a
SELECT a.*,b.nick_name handledByUserIdName,c.nick_name userIdName,d.nick_name ApprovedUserIdName,e.dept_name deptName FROM t_borrowing_apply_for a
left join sys_user b on a.handled_by_user_id=b.user_id
left join sys_user c on a.user_id=c.user_id
left join sys_user d on a.approved_user_id=d.user_id
left join sys_dept e on a.borrowing_dept_id=e.dept_id
<where>
a.is_del='0'
<if test="feeName != null and feeName != ''"> and a.fee_name like concat('%', #{feeName}, '%')</if>
......
......@@ -9,6 +9,14 @@ export function listFor(query) {
})
}
export function borrowingList(query) {
return request({
url: '/system/for/borrowingList',
method: 'get',
params: query
})
}
//查询部门余额是否足够
export function getDepartmentBalance(data) {
return request({
......
......@@ -19,19 +19,19 @@ export function tradeExpensesStatistics(query) {
}
//借支统计
export function borrowingStatistics(data) {
export function borrowingStatistics(query) {
return request({
url: '/statistics/borrowingStatistics',
method: 'post',
data: data
method: 'get',
params: query
})
}
//采购统计
export function purchaseStatistics(data) {
export function purchaseStatistics(query) {
return request({
url: '/statistics/purchaseStatistics',
method: 'post',
data: data
method: 'get',
params: query
})
}
<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="borrowingDeptId">
<div style="width: 160px">
<treeselect
v-model="queryParams.borrowingDeptId"
:options="deptOptions"
:show-count="true"
placeholder="请选择卖方部门"
/>
</div>
</el-form-item>
<el-form-item label="使用人" prop="userIdName">
<el-input
v-model="queryParams.userIdName"
placeholder="请输入使用人"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="费用名称" prop="feeName">
<el-input
v-model="queryParams.feeName"
placeholder="请输入费用名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="申请时间">
<el-date-picker
v-model="registrationDate"
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="approvalStatus">
<el-select
v-model="queryParams.approvalStatus"
placeholder="请选择项目状态"
clearable
size="small"
>
<el-option label="待核算部审批" value="1"/>
<el-option label="完成" value="2"/>
<el-option label="驳回" value="3"/>
</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>
<TableList ref="tableList" :param="queryParams"/>
</div>
</template>
<script>
import TableList from "../components/TableList";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "borrowing-calculate-index",
components:{
TableList,
Treeselect
},
created(){
this.getTreeselect();
},
data(){
return{
queryParams: {
feeName: null,
userIdName: null,
borrowingDeptId: null,
applicationDescription: null,
registrationDate: null,
registrationBeginDate: null,
registrationEndDate: null,
approvalStatus: null,
sortType: '0'
},
deptOptions: [],
registrationDate: []
}
},
methods:{
/** 搜索按钮操作 */
handleQuery() {
this.$refs.tableList.getBorrowingList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.registrationBeginDate = null;
this.queryParams.registrationEndDate = null;
this.registrationDate = [];
this.handleQuery();
},
//时间切换
timeChange(value) {
if (value) {
this.queryParams.registrationBeginDate = value[0];
this.queryParams.registrationEndDate = value[1];
}
},
getTreeselect() {
treeselect().then((response) => {
this.deptOptions = response.data;
});
},
sortChange(){
this.handleQuery();
},
}
}
</script>
<style scoped>
</style>
<template>
<div class="tableInfo">
<el-table v-loading="loading" :data="borrowingList">
<el-table-column label="部门" align="center" prop="borrowingDeptName" />
<el-table-column label="使用人" align="center" prop="userName" 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="totalFigures" />
</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="borrowingDetail">
<el-table-column label="部门" align="center" prop="deptName" :show-overflow-tooltip="true" width="120px"/>
<el-table-column label="使用人" align="center" prop="userIdName"/>
<el-table-column label="费用名称" align="center" prop="feeName" :show-overflow-tooltip="true" width="120px"/>
<el-table-column label="借支金额" align="center" prop="totalFigures" :show-overflow-tooltip="true"/>
<el-table-column label="申请时间" align="center" prop="registrationDate" width="150px"/>
<el-table-column label="状态" align="center" prop="approvalStatus" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.approvalStatus == null">-</span>
<span v-if="scope.row.approvalStatus == 1">待核算部审批</span>
<span v-if="scope.row.approvalStatus == 2">完成</span>
<span v-if="scope.row.approvalStatus == 3">驳回</span>
</template>
</el-table-column>
<el-table-column label="审批人" align="center" prop="approvedUserIdName" >
<template slot-scope="scope">
<span v-if="scope.row.approvedUserIdName == null">-</span>
<span>{{scope.row.approvedUserIdName}}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="detailParam.pageNum"
:limit.sync="detailParam.pageSize"
@pagination="detailBorrowingList"
/>
</el-dialog>
</div>
</template>
<script>
import { borrowingStatistics } from "@/api/transaction/statistics.js";
import { borrowingList } from "@/api/system/for";
export default {
name: "table-list",
props:{
param:{
type: Object
}
},
data(){
return{
borrowingList: [],
borrowingDetail: [],
loading: false,
open: false,
total: 0,
detailParam: {
pageNum: 1,
pageSize: 10,
}
}
},
created(){
this.getBorrowingList();
},
methods:{
getBorrowingList(){
this.loading = true;
borrowingStatistics(this.param).then(res =>{
if(res.code == 200){
this.loading = false;
this.borrowingList = res.data;
}
})
},
detail(row){
this.detailParam = { ...this.param };
this.detailParam.borrowingDeptId = row.borrowingDeptId;
if(this.param.sortType != '0'){
this.detailParam.userId = row.userId;
}
this.detailParam.pageNum = 1;
this.detailParam.pageSize = 10;
this.open = true;
this.detailBorrowingList();
},
detailBorrowingList(){
this.loading = true;
borrowingList(this.detailParam).then(res =>{
if(res.code == 200){
this.loading = false;
this.total = res.total;
this.borrowingDetail = res.rows;
}
})
}
}
}
</script>
<style scoped lang="scss">
.tableInfo{
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;
}
}
.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="feeName">
<el-input
v-model="queryParams.feeName"
placeholder="请输入费用名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="申请时间">
<el-date-picker
v-model="registrationDate"
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="approvalStatus">
<el-select
v-model="queryParams.approvalStatus"
placeholder="请选择项目状态"
clearable
size="small"
>
<el-option label="待核算部审批" value="1"/>
<el-option label="完成" value="2"/>
<el-option label="驳回" value="3"/>
</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>
<TableList ref="tableList" :param="queryParams"/>
</div>
</template>
<script>
import TableList from "./components/TableList";
export default {
name: "borrowing-index",
components:{
TableList,
},
created(){
},
data(){
return{
queryParams: {
feeName: null,
userIdName: null,
borrowingDeptId: this.$store.state.user.deptId,
applicationDescription: null,
registrationDate: null,
registrationBeginDate: null,
registrationEndDate: null,
approvalStatus: null
},
deptOptions: [],
registrationDate: []
}
},
methods:{
/** 搜索按钮操作 */
handleQuery() {
this.$refs.tableList.getBorrowingList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.registrationBeginDate = null;
this.queryParams.registrationEndDate = null;
this.registrationDate = [];
this.queryParams.sortType = '0';
this.handleQuery();
},
//时间切换
timeChange(value) {
if (value) {
this.queryParams.registrationBeginDate = value[0];
this.queryParams.registrationEndDate = value[1];
}
}
}
}
</script>
<style scoped>
</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