Commit 32154f62 authored by 纪泽龙's avatar 纪泽龙

Merge branch 'jzl'

parents a0e5855f 885c6b3c
/*
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2023-06-12 10:49:16
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-06-13 16:19:48
* @FilePath: /precision-effect-web/src/api/account/account.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import request from '@/utils/request' import request from '@/utils/request'
// 查询账户列表 // 查询账户列表
...@@ -9,6 +17,15 @@ export function listAccount(query) { ...@@ -9,6 +17,15 @@ export function listAccount(query) {
}) })
} }
// 应收应付金额列表
export function getIncomeOrPayableList (query) {
return request({
url: '/trade/project/getIncomeOrPayableList',
method: 'get',
params: query
})
}
// 查询账户详细 // 查询账户详细
export function getAccount(accountId) { export function getAccount(accountId) {
return request({ return request({
......
...@@ -324,3 +324,6 @@ ...@@ -324,3 +324,6 @@
.flex{ .flex{
display: flex; display: flex;
} }
.cup{
cursor: pointer;
}
\ No newline at end of file
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2023-06-13 15:40:04
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-06-13 17:18:43
* @FilePath: /precision-effect-web/src/views/account/component/table.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div>
<!-- 交易项目、卖方、申请人、买方、买方经办人、应付/应收金额 -->
<el-table :data="tableData" v-loading="moneyLoading">
<el-table-column
label="交易项目"
align="center"
prop="a"
:formatter="formatter"
/>
<el-table-column label="卖方" align="center" prop="tradeTransactorName" />
<el-table-column label="申请人" align="center" prop="applyName" />
<el-table-column label="买方" align="center" prop="applyDeptName" />
<el-table-column label="买方经办人" align="center" prop="tradeDeptName" />
<template v-if="or === 'income'">
<el-table-column
label="应收金额"
align="center"
prop="pendingPayment"
/>
</template>
<template v-else>
<el-table-column
label="应付金额"
align="center"
prop="pendingPayment"
/>
</template>
</el-table>
<pagination
v-show="tableData.length > 0"
:total="total"
:page.sync="queryAccountDetailParams.pageNum"
:limit.sync="queryAccountDetailParams.pageSize"
@pagination="getOperateList"
/>
</div>
</template>
<script>
export default {
name: "",
props: {
moneyLoading: {
type: Boolean,
},
tableData: {
type: Array,
default: () => {
return [];
},
},
or: {
type: String,
default: "tableOr",
},
total: {
tyle: Number,
},
deptId: {
tyle: Number,
},
},
data() {
return {
queryAccountDetailParams: {
pageNum: 1,
pageSize: 10,
},
};
},
methods: {
getOperateList() {
this.$parent.getIncomeOrPayableList(
{
...queryAccountDetailParams,
deptId: this.deptId,
},
or
);
},
formatter(row, column, cellValue, index) {
return cellValue ? cellValue : "-";
},
},
};
</script>
<style lang="scss" scoped></style>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="部门" prop="deptId"> <el-form-item label="部门" prop="deptId">
<div style="width: 200px"> <div style="width: 200px">
<treeselect v-model="queryParams.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" :disabled="disabled"/> <treeselect
v-model="queryParams.deptId"
:options="deptOptions"
:show-count="true"
placeholder="请选择归属部门"
:disabled="disabled"
/>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item>
</el-form> </el-form>
...@@ -60,12 +80,49 @@ ...@@ -60,12 +80,49 @@
</el-row>--> </el-row>-->
<el-table v-loading="loading" :data="accountList"> <el-table v-loading="loading" :data="accountList">
<el-table-column label="部门" align="center" prop="deptName" :show-overflow-tooltip="true"/> <el-table-column
<el-table-column label="账户总额" align="center" prop="totalAmount"/> label="部门"
align="center"
prop="deptName"
:show-overflow-tooltip="true"
/>
<el-table-column label="账户总额" align="center" prop="totalAmount" />
<el-table-column label="可用金额" align="center" prop="ableAmount" /> <el-table-column label="可用金额" align="center" prop="ableAmount" />
<el-table-column label="应收总额" align="center" prop="incomeAbleTotalAmount"/> <el-table-column
<el-table-column label="应付总额" align="center" prop="payableTotalAmount"/> label="应收总额"
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> align="center"
prop="incomeAbleTotalAmount"
>
<template v-slot="scope">
<el-button
size="mini"
type="text"
@click="moneyDialog(scope.row, 'income')"
>
{{ scope.row.incomeAbleTotalAmount }}
</el-button>
</template>
</el-table-column>
<el-table-column
label="应付总额"
align="center"
prop="payableTotalAmount"
>
<template v-slot="scope">
<el-button
size="mini"
type="text"
@click="moneyDialog(scope.row, 'pay')"
>
{{ scope.row.payableTotalAmount }}
</el-button>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope"> <template slot-scope="scope">
<!--<el-button <!--<el-button
size="mini" size="mini"
...@@ -81,13 +138,15 @@ ...@@ -81,13 +138,15 @@
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:account:remove']" v-hasPermi="['system:account:remove']"
>删除</el-button>--> >删除</el-button>-->
<el-button size="mini" type="text" @click="accountDetail(scope.row)">账户详情</el-button> <el-button size="mini" type="text" @click="accountDetail(scope.row)"
>账户详情</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
...@@ -110,27 +169,50 @@ ...@@ -110,27 +169,50 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 应收应付弹框 -->
<el-dialog
:title="tableOr === 'pay' ? '应付金额' : '应收金额'"
:visible.sync="moneyOpen"
append-to-body
destroy-on-close
>
<MoneyTable
:tableData="ableTotalAmountData"
:or="tableOr"
:deptId="deptId"
:total="ableTotalAmounTotal"
:moneyLoading="moneyLoading"
/>
</el-dialog>
<!-- 账户详情 --> <!-- 账户详情 -->
<el-dialog title="账户详情" :visible.sync="operateOpen" width="800px" append-to-body> <el-dialog
title="账户详情"
:visible.sync="operateOpen"
width="800px"
append-to-body
>
<el-table :data="cashOperateList"> <el-table :data="cashOperateList">
<el-table-column label="序号" width="50px" align="center"> <el-table-column label="序号" width="50px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + 1 }} {{ scope.$index + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作部门" align="center" prop="operateDeptName"/> <el-table-column
label="操作部门"
align="center"
prop="operateDeptName"
/>
<el-table-column label="操作类型" align="center" prop="operateType"> <el-table-column label="操作类型" align="center" prop="operateType">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.operateType == '1'">借贷</span> <span v-if="scope.row.operateType == '1'">借贷</span>
<span v-if="scope.row.operateType == '2'">借支</span> <span v-if="scope.row.operateType == '2'">借支</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="金额" align="center" prop="operateAmount"/> <el-table-column label="金额" align="center" prop="operateAmount" />
<el-table-column label="操作时间" align="center" prop="operateTime"/> <el-table-column label="操作时间" align="center" prop="operateTime" />
</el-table> </el-table>
<pagination <pagination
v-show="operateListTotal>0" v-show="operateListTotal > 0"
:total="operateListTotal" :total="operateListTotal"
:page.sync="queryAccountDetailParams.pageNum" :page.sync="queryAccountDetailParams.pageNum"
:limit.sync="queryAccountDetailParams.pageSize" :limit.sync="queryAccountDetailParams.pageSize"
...@@ -141,15 +223,26 @@ ...@@ -141,15 +223,26 @@
</template> </template>
<script> <script>
import { listAccount, getAccount, delAccount, addAccount, updateAccount, exportAccount } from "@/api/account/account"; import {
listAccount,
getIncomeOrPayableList,
getAccount,
delAccount,
addAccount,
updateAccount,
exportAccount,
} from "@/api/account/account";
import { treeselect } from "@/api/system/dept"; import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { listOperate } from "@/api/account/operate"; import { listOperate } from "@/api/account/operate";
import MoneyTable from "./component/MoneyTable";
export default { export default {
name: "Account", name: "Account",
components: { components: {
Treeselect Treeselect,
MoneyTable,
}, },
data() { data() {
return { return {
...@@ -171,14 +264,24 @@ export default { ...@@ -171,14 +264,24 @@ export default {
accountList: [], accountList: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 总额弹框
moneyOpen: false,
moneyLoading:true,
// 应收还是应付 income / pay
tableOr: "income",
ableTotalAmountData: [],
ableTotalAmounTotal: 0,
deptId: null,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
deptId: null, deptId: null,
ableAmount: null ableAmount: null,
}, },
queryAccountDetailParams: { queryAccountDetailParams: {
pageNum: 1, pageNum: 1,
...@@ -188,20 +291,19 @@ export default { ...@@ -188,20 +291,19 @@ export default {
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {},
},
// 部门树选项 // 部门树选项
deptOptions: [], deptOptions: [],
disabled: false, disabled: false,
operateOpen: false, operateOpen: false,
cashOperateList: [], cashOperateList: [],
operateListTotal: 0 operateListTotal: 0,
}; };
}, },
created() { created() {
console.log("userId===",this.$store.state.user.userId); console.log("userId===", this.$store.state.user.userId);
console.log("deptId===",this.$store.state.user.deptId); console.log("deptId===", this.$store.state.user.deptId);
if(this.$store.state.user.userId != 1){ if (this.$store.state.user.userId != 1) {
this.queryParams.deptId = this.$store.state.user.deptId; this.queryParams.deptId = this.$store.state.user.deptId;
this.disabled = true; this.disabled = true;
} }
...@@ -212,12 +314,26 @@ export default { ...@@ -212,12 +314,26 @@ export default {
/** 查询账户列表 */ /** 查询账户列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listAccount(this.queryParams).then(response => { listAccount(this.queryParams).then((response) => {
console.log(response);
this.accountList = response.rows; this.accountList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
}, },
getIncomeOrPayableList(queryParams, or) {
if (or === "pay") {
return getIncomeOrPayableList({
...queryParams,
tradeDeptId: queryParams.deptId,
});
} else {
return getIncomeOrPayableList({
...queryParams,
applyDeptId: queryParams.deptId,
});
}
},
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false; this.open = false;
...@@ -228,7 +344,7 @@ export default { ...@@ -228,7 +344,7 @@ export default {
this.form = { this.form = {
accountId: null, accountId: null,
deptId: null, deptId: null,
ableAmount: null ableAmount: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -244,9 +360,9 @@ export default { ...@@ -244,9 +360,9 @@ export default {
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.accountId) this.ids = selection.map((item) => item.accountId);
this.single = selection.length!==1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
...@@ -257,8 +373,8 @@ export default { ...@@ -257,8 +373,8 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const accountId = row.accountId || this.ids const accountId = row.accountId || this.ids;
getAccount(accountId).then(response => { getAccount(accountId).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改账户"; this.title = "修改账户";
...@@ -266,16 +382,16 @@ export default { ...@@ -266,16 +382,16 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.accountId != null) { if (this.form.accountId != null) {
updateAccount(this.form).then(response => { updateAccount(this.form).then((response) => {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addAccount(this.form).then(response => { addAccount(this.form).then((response) => {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
...@@ -287,53 +403,88 @@ export default { ...@@ -287,53 +403,88 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const accountIds = row.accountId || this.ids; const accountIds = row.accountId || this.ids;
this.$confirm('是否确认删除账户编号为"' + accountIds + '"的数据项?', "警告", { this.$confirm(
'是否确认删除账户编号为"' + accountIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(function() { }
)
.then(function () {
return delAccount(accountIds); return delAccount(accountIds);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}).catch(() => {}); })
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const queryParams = this.queryParams;
this.$confirm('是否确认导出所有账户数据项?', "警告", { this.$confirm("是否确认导出所有账户数据项?", "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(() => { })
.then(() => {
this.exportLoading = true; this.exportLoading = true;
return exportAccount(queryParams); return exportAccount(queryParams);
}).then(response => { })
.then((response) => {
this.download(response.msg); this.download(response.msg);
this.exportLoading = false; this.exportLoading = false;
}).catch(() => {}); })
.catch(() => {});
}, },
/** 查询部门下拉树结构 */ /** 查询部门下拉树结构 */
getTreeselect() { getTreeselect() {
treeselect().then(response => { treeselect().then((response) => {
this.deptOptions = response.data; this.deptOptions = response.data;
}); });
}, },
// 应收音符金额点击弹框 data是table传进来的数据,or是印绶还是应付
moneyDialog(data, or, pageNum, pageSize) {
this.tableOr = or;
this.moneyOpen = true;
this.ableTotalAmountData=[];
this.moneyLoading=true;
// 储存一下,好传参,点击进来的要
this.deptId = data.deptId;
const queryParams = {
pageNum: pageNum ? pageNum : 1,
pageSize: pageSize ? pageSize : 10,
deptId: this.deptId,
};
this.getIncomeOrPayableList(queryParams, or).then((res) => {
// console.log(res)
this.ableTotalAmountData = res.rows;
this.ableTotalAmounTotal=res.total;
this.moneyLoading=false;
});
// // 应收还是应付
// this.tableOr = or;
// this.moneyOpen = true;
// this.ableTotalAmountData = [];
},
//账户详情 //账户详情
accountDetail(row){ accountDetail(row) {
this.operateOpen = true; this.operateOpen = true;
this.queryAccountDetailParams.operateDeptId = row.deptId; this.queryAccountDetailParams.operateDeptId = row.deptId;
this.getOperateList(); this.getOperateList();
}, },
//账户操作记录查询 //账户操作记录查询
getOperateList(){ getOperateList() {
listOperate(this.queryAccountDetailParams).then(res =>{ listOperate(this.queryAccountDetailParams).then((res) => {
if(res.code == 200){ if (res.code == 200) {
this.cashOperateList = res.rows; this.cashOperateList = res.rows;
this.operateListTotal = res.total; this.operateListTotal = res.total;
} }
}) });
} },
} },
}; };
</script> </script>
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