parent
5705d97d89
commit
e25d898fed
@ -1,131 +1,355 @@
|
||||
<template>
|
||||
<div>
|
||||
<xy-dialog
|
||||
ref="dialog"
|
||||
:is-show.sync="isShow"
|
||||
type="normal"
|
||||
title="出差审批"
|
||||
@on-ok="confirm"
|
||||
>
|
||||
<xy-table :table-item="table" :list="records" show-summary :summary-method="summary">
|
||||
<template #btns> </template>
|
||||
</xy-table>
|
||||
</xy-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getBudget} from "@/api/budget/budget";
|
||||
import {addFundLog} from "@/api/paymentRegistration/fundLog";
|
||||
import {save} from "@/api/away";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
table: [
|
||||
{
|
||||
prop: 'plan',
|
||||
label: '资金来源',
|
||||
width: 140,
|
||||
align: 'left',
|
||||
formatter: (row) => {
|
||||
return row.plan_link?.reduce((pre, cur) => {
|
||||
return pre + (this.plans?.find(i => i.id === cur.plan_id)?.name ?? '') + ';'
|
||||
}, '')
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'title',
|
||||
label: '事由',
|
||||
minWidth: 180,
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
prop: 'start_date',
|
||||
label: '开始日期',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
prop: 'end_date',
|
||||
label: '结束日期',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
prop: 'admin.name',
|
||||
label: '经办人',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
prop: 'flow_title',
|
||||
label: '编号',
|
||||
width: 140,
|
||||
formatter: (row) => row.away_flow_links?.find(i => i.tag === "chuchaibaoxiao")?.flow_title
|
||||
},
|
||||
{
|
||||
prop: 'totalAmt',
|
||||
label: '金额',
|
||||
formatter: (row) => row.away_flow_links?.find(i => i.tag === "chuchaibaoxiao")?.flow_data?.totalAmt
|
||||
}
|
||||
],
|
||||
records: [],
|
||||
plans: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show() {
|
||||
this.isShow = true;
|
||||
},
|
||||
hidden() {
|
||||
this.isShow = false;
|
||||
},
|
||||
setRecords(records = []) {
|
||||
this.records = records
|
||||
},
|
||||
|
||||
summary(param) {
|
||||
const { columns, data } = param;
|
||||
return columns.map((column, index) => {
|
||||
if(index === 0) {
|
||||
return '合计'
|
||||
} else {
|
||||
return column.property === 'totalAmt' ? (
|
||||
data.reduce((pre, cur) => pre + (isNaN(Number(cur.away_flow_links?.find(i => i.tag === "chuchaibaoxiao")?.flow_data?.totalAmt)) ? 0 : Number(cur.away_flow_links?.find(i => i.tag === "chuchaibaoxiao")?.flow_data?.totalAmt)), 0)
|
||||
) : ''
|
||||
}
|
||||
})
|
||||
},
|
||||
async getBudgets() {
|
||||
let res = await getBudget({
|
||||
is_tree: 1
|
||||
})
|
||||
this.plans = res.list
|
||||
},
|
||||
async confirm() {
|
||||
const res = await Promise.allSettled(this.records.map(record => addFundLog({
|
||||
fund_type: 2,
|
||||
away_id: record.id,
|
||||
apply_money: record.away_flow_links?.find(i => i.tag === "chuchaibaoxiao")?.flow_data?.totalAmt,
|
||||
remark: record.away_flow_links?.find(i => i.tag === "chuchaibaoxiao")?.flow_title,
|
||||
contract_plan_act_links: record.plan_link?.map(plan => ({
|
||||
plan_id: this.plans.find(i => i.id === plan.plan_id)?.children[0].id,
|
||||
use_money: record.away_flow_links?.find(i => i.tag === "chuchaibaoxiao")?.flow_data?.totalAmt
|
||||
})),
|
||||
})))
|
||||
await Promise.allSettled(res.map((i, index) => i.status === 'fulfilled' ? save({
|
||||
financial_status: 2,
|
||||
id: this.records[index].id
|
||||
}) : ''))
|
||||
this.$message.success('操作成功')
|
||||
this.hidden()
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
created() {
|
||||
this.getBudgets()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<template>
|
||||
<div>
|
||||
<xy-dialog ref="dialog" :is-show.sync="isShow" type="normal" title="出差报销审批" @on-ok="confirm">
|
||||
<xy-table ref="awayTable" row-key="id" default-expand-all
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" :table-item="table" @select-all="toggleAll"
|
||||
@select="handleSelectionChange" :list="chuchaibaoxiaoDetailList">
|
||||
<template v-slot:oa_ht_away_links>
|
||||
<el-table-column prop="oa_ht_away_links" align="center" label="状态" width="100">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.hasOwnProperty('oa_ht_away_links')">
|
||||
<el-tag v-if="scope.row.oa_ht_away_links" type="success" size="small">
|
||||
已完成
|
||||
</el-tag>
|
||||
<el-tag v-else type="warning" size="small">
|
||||
待审批
|
||||
</el-tag>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<template #btns> </template>
|
||||
</xy-table>
|
||||
</xy-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getBudget
|
||||
} from "@/api/budget/budget";
|
||||
import {
|
||||
addFundLog
|
||||
} from "@/api/paymentRegistration/fundLog";
|
||||
import {
|
||||
save,
|
||||
getAwayDetails,
|
||||
updateAwayDetails,
|
||||
planSave
|
||||
} from "@/api/away";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
checkdKeys: false,
|
||||
table: [{
|
||||
type: 'selection',
|
||||
width: 54,
|
||||
reserveSelection: true,
|
||||
fixed: "left",
|
||||
selectable: row => row.oa_ht_away_links ? false : true,
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '人员',
|
||||
width: 180,
|
||||
align: 'left'
|
||||
},
|
||||
|
||||
{
|
||||
prop: 'flow.title',
|
||||
label: '流程名称',
|
||||
minWidth: 180,
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
prop: 'amt',
|
||||
label: '报销金额',
|
||||
width: 120,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'oa_ht_away_links',
|
||||
label: '状态',
|
||||
width: 180,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
align: 'left'
|
||||
}, {
|
||||
label: "创建日期",
|
||||
width: 160,
|
||||
prop: "created_at",
|
||||
formatter: (cell, data, value) => {
|
||||
return this.$moment(value).format("YYYY-MM-DD HH:mm");
|
||||
},
|
||||
},
|
||||
],
|
||||
records: [],
|
||||
plans: [],
|
||||
chuchaibaoxiaoDetailList: [],
|
||||
away_ids: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
spanMethods() {
|
||||
const xingmingSpan = {};
|
||||
const zijinSpan = {};
|
||||
this.chuchaibaoxiaoDetailList.forEach((item, index) => {
|
||||
const xingming = item.xingming_detail;
|
||||
const zijin = item.zijinlaiyuan;
|
||||
// 统计 xingming_detail 的合并信息
|
||||
if (!xingmingSpan[xingming]) {
|
||||
xingmingSpan[xingming] = {
|
||||
count: 1,
|
||||
index: index
|
||||
};
|
||||
} else {
|
||||
xingmingSpan[xingming].count++;
|
||||
}
|
||||
|
||||
// 结合 xingming_detail 统计 zijinlaiyuan 的合并信息
|
||||
const combinedKey = `${xingming}-${zijin}`;
|
||||
if (!zijinSpan[combinedKey]) {
|
||||
zijinSpan[combinedKey] = {
|
||||
count: 1,
|
||||
index: index
|
||||
};
|
||||
} else {
|
||||
zijinSpan[combinedKey].count++;
|
||||
}
|
||||
});
|
||||
return {
|
||||
xingmingSpan,
|
||||
zijinSpan
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show() {
|
||||
this.isShow = true;
|
||||
},
|
||||
hidden() {
|
||||
this.chuchaibaoxiaoDetailList = [];
|
||||
this.away_ids = [];
|
||||
this.$refs['awayTable'].clearSelection();
|
||||
this.isShow = false;
|
||||
},
|
||||
setRecords(ids) {
|
||||
console.log("ids", ids);
|
||||
this.getAway(ids);
|
||||
},
|
||||
summary(param) {
|
||||
const {
|
||||
columns,
|
||||
data
|
||||
} = param;
|
||||
return columns.map((column, index) => {
|
||||
if (index === 0) {
|
||||
return '合计';
|
||||
} else {
|
||||
return column.property === 'amt' ? (
|
||||
data.reduce((pre, cur) => pre + (cur.amt ? Number(cur.amt) : 0), 0)
|
||||
) : '';
|
||||
}
|
||||
});
|
||||
},
|
||||
async getAway(ids) {
|
||||
this.away_ids = ids;
|
||||
let res = await getAwayDetails({
|
||||
away_ids: ids
|
||||
});
|
||||
console.log("res.chuchaibaoxiaoDetailList", res.chuchaibaoxiaoDetailList)
|
||||
let arr = this.transformData(res.chuchaibaoxiaoDetailList)
|
||||
console.log("arr", arr);
|
||||
this.chuchaibaoxiaoDetailList = arr;
|
||||
this.$refs.awayTable.clearSelection()
|
||||
},
|
||||
transformData(originalData) {
|
||||
const result = [];
|
||||
for (const xingming_details in originalData) {
|
||||
const person = {
|
||||
id: Math.random(),
|
||||
name: xingming_details,
|
||||
children: [],
|
||||
parent: null, // 添加父级字段
|
||||
isSelect: false // 添加选中状态字段
|
||||
};
|
||||
const innerData = originalData[xingming_details];
|
||||
for (const innerKey in innerData) {
|
||||
const source = {
|
||||
id: Math.random(),
|
||||
name: innerKey,
|
||||
children: innerData[innerKey].map((item) => ({
|
||||
...item,
|
||||
name: item.xingming_detail,
|
||||
parent: source, // 指向当前父级
|
||||
isSelect: false // 添加选中状态字段
|
||||
})),
|
||||
parent: person, // 指向当前父级
|
||||
isSelect: false // 添加选中状态字段
|
||||
};
|
||||
person.children.push(source);
|
||||
}
|
||||
result.push(person);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
toggleAll() {
|
||||
this.checkdKeys = !this.checkdKeys
|
||||
this.splite(this.chuchaibaoxiaoDetailList, this.checkdKeys)
|
||||
|
||||
},
|
||||
splite(data, flag) {
|
||||
data.forEach((row) => {
|
||||
this.$refs.awayTable.toggleRowSelection(row, flag)
|
||||
if (row.children) {
|
||||
this.splite(row.children, flag)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSelectionChange(selection, row) {
|
||||
const allData = this.chuchaibaoxiaoDetailList;
|
||||
|
||||
// 取消选择的逻辑
|
||||
row.isSelect = !row.isSelect
|
||||
console.log("selection", selection, row)
|
||||
this.deselectChildren(row, row.isSelect); // 递归取消选择所有子级
|
||||
|
||||
// if(!row.isSelect){
|
||||
// this.deselectChildren(row,row.isSelect); // 递归取消选择所有子级
|
||||
// // this.updateParentSelection(row, true); // 更新父级状态
|
||||
// }else{
|
||||
// // 选择的逻辑
|
||||
// selection.forEach((item) => {
|
||||
// if (!this.isSelected(item)) {
|
||||
// this.selectChildren(item); // 递归选中所有子级
|
||||
// // this.updateParentSelection(item, true); // 更新父级状态
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
},
|
||||
selectChildren(parent) {
|
||||
if (parent.children) {
|
||||
parent.children.forEach((child) => {
|
||||
this.$refs.awayTable.toggleRowSelection(child, true); // 选中当前子级
|
||||
// child.isSelect = true; // 更新子级的 isSelect 状态
|
||||
this.$set(child, 'isSelect', true)
|
||||
this.selectChildren(child); // 递归选中子级的子级
|
||||
});
|
||||
}
|
||||
},
|
||||
deselectChildren(parent, isSelect) {
|
||||
console.log("isSelect", isSelect, parent)
|
||||
if (parent.children) {
|
||||
parent.children.forEach((child, index) => {
|
||||
this.$refs.awayTable.toggleRowSelection(child, isSelect); // 取消选择当前子级
|
||||
this.$set(child, 'isSelect', isSelect)
|
||||
this.deselectChildren(child, isSelect); // 递归取消选择子级的子级
|
||||
});
|
||||
} else {
|
||||
this.$refs.awayTable.toggleRowSelection(parent, isSelect);
|
||||
this.$set(parent, 'isSelect', isSelect)
|
||||
console.log("parent", parent)
|
||||
}
|
||||
},
|
||||
// updateParentSelection(item, isSelected) {
|
||||
// if (item.parent) {
|
||||
// const allSelected = item.parent.children.every((child) => child.isSelect === true);
|
||||
// const anySelected = item.parent.children.some((child) => child.isSelect === true);
|
||||
// item.parent.isSelect = allSelected ? true : anySelected ? '' : false; // 全选、半选、不选
|
||||
// this.$refs.awayTable.toggleRowSelection(item.parent, allSelected);
|
||||
// this.updateParentSelection(item.parent, allSelected); // 递归更新父级
|
||||
// }
|
||||
// },
|
||||
isSelected(item) {
|
||||
return item.isSelect === true;
|
||||
},
|
||||
async getBudgets() {
|
||||
let res = await getBudget({
|
||||
is_tree: 1
|
||||
});
|
||||
this.plans = res.list;
|
||||
},
|
||||
async confirm() {
|
||||
console.log("this.$refs['awayTable'].getSelection()", this.$refs['awayTable'].getSelection());
|
||||
let flowsList = this.$refs['awayTable'].getSelection();
|
||||
|
||||
let flow_id = [];
|
||||
let chuchai_pay_id = [];
|
||||
let chuchai_pay_details = [];
|
||||
let person_arr = []
|
||||
let money = 0
|
||||
flowsList.map(f => {
|
||||
if (f.flow && !f.oa_ht_away_links) {
|
||||
person_arr.push(f)
|
||||
}
|
||||
});
|
||||
if (person_arr.length < 1) {
|
||||
this.$message.warning('请选择待审批的出差报销')
|
||||
return
|
||||
}
|
||||
person_arr.map(item => {
|
||||
flow_id.push(item.flow.id);
|
||||
chuchai_pay_id.push(item.belongs_id);
|
||||
chuchai_pay_details.push(item.id);
|
||||
money += parseFloat(item.amt)
|
||||
})
|
||||
// away/save
|
||||
const away_plan_links = [];
|
||||
const planMap = {};
|
||||
|
||||
person_arr.forEach(item => {
|
||||
const {
|
||||
id,
|
||||
plan_id,
|
||||
amt
|
||||
} = item;
|
||||
if (!planMap[plan_id]) {
|
||||
planMap[plan_id] = {
|
||||
plan_id,
|
||||
use_money: 0,
|
||||
chuchai_pay_details: []
|
||||
};
|
||||
away_plan_links.push(planMap[plan_id]);
|
||||
}
|
||||
planMap[plan_id].use_money += parseFloat(amt);
|
||||
planMap[plan_id].chuchai_pay_details.push(id);
|
||||
});
|
||||
console.log("away_plan_links", away_plan_links)
|
||||
|
||||
const res = await updateAwayDetails({
|
||||
away_ids: this.away_ids,
|
||||
flow_id: flow_id,
|
||||
chuchai_pay_id: chuchai_pay_id,
|
||||
chuchai_pay_details: chuchai_pay_details,
|
||||
money: money
|
||||
}, true);
|
||||
console.log("res", res)
|
||||
await Promise.allSettled(away_plan_links.map((i, index) => {
|
||||
console.log(i)
|
||||
planSave({
|
||||
plan_id: i.plan_id,
|
||||
use_money: i.use_money,
|
||||
chuchai_pay_details: i.chuchai_pay_details
|
||||
})
|
||||
}))
|
||||
this.$message.success('操作成功');
|
||||
this.$emit('refresh');
|
||||
this.hidden();
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
// this.getBudgets()
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
|
||||
@ -0,0 +1,266 @@
|
||||
<template>
|
||||
<div class="batch-query">
|
||||
<xy-dialog ref="dialog" :is-show.sync="isShow" type="normal" title="批次查询" @on-ok="confirm">
|
||||
<el-card class="box-card">
|
||||
<!-- <template #header>
|
||||
<div class="card-header">
|
||||
<span>批次查询</span>
|
||||
</div>
|
||||
</template> -->
|
||||
|
||||
<!-- 搜索区域 -->
|
||||
<!-- <div class="search-area">
|
||||
<el-form :inline="true" :model="searchForm" class="demo-form-inline">
|
||||
<el-form-item label="审批日期">
|
||||
<el-date-picker
|
||||
v-model="searchForm.approveDate"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键词">
|
||||
<el-input
|
||||
v-model="searchForm.keyword"
|
||||
placeholder="请输入批次ID或用户姓名"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch">搜索</el-button>
|
||||
<el-button @click="handleReset">清空</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div> -->
|
||||
|
||||
<!-- 批次列表 @row-click="handleRowClick"-->
|
||||
<xy-table ref="awayTable" :showIndex="false" :default-expand-all="false" row-key="id"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" :list="batchList" :table-item="table">
|
||||
<template #btns> </template>
|
||||
</xy-table>
|
||||
|
||||
<div style="display: flex; justify-content: flex-end;padding: 10px 6px;">
|
||||
<Page
|
||||
:total="total"
|
||||
show-elevator
|
||||
@on-change="e => {
|
||||
select.page = e;
|
||||
getList();
|
||||
}"
|
||||
show-sizer
|
||||
@on-page-size-change="e => {
|
||||
select.page = 1;
|
||||
select.page_size = e;
|
||||
getList();
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 明细数据 -->
|
||||
<el-table :data="detailList" style="width: 100%" v-if="showDetail">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="name" label="姓名" width="100" />
|
||||
<el-table-column prop="processName" label="流程名称" width="150" />
|
||||
<el-table-column prop="source" label="资金来源" width="100" />
|
||||
<el-table-column prop="amount" label="金额" width="100" align="right" />
|
||||
<el-table-column prop="status" label="状态" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="getStatusType(scope.row.status)" size="small">
|
||||
{{ scope.row.status }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" width="150" />
|
||||
<el-table-column prop="createDate" label="创建日期" width="100" />
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<!-- <div class="pagination-container">
|
||||
<el-pagination v-model="currentPage" :page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" />
|
||||
</div> -->
|
||||
</el-card>
|
||||
</xy-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
awayIndex
|
||||
} from "@/api/away"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
// 搜索表单
|
||||
searchForm: {
|
||||
approveDate: '',
|
||||
keyword: ''
|
||||
},
|
||||
// 表格数据
|
||||
batchList: [],
|
||||
table: [
|
||||
{
|
||||
prop: 'zijinlaiyuan',
|
||||
label: '资金来源',
|
||||
width: 180,
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
prop: 'xingming_detail',
|
||||
label: '人员',
|
||||
width: 180,
|
||||
align: 'left'
|
||||
},
|
||||
|
||||
{
|
||||
prop: 'flow.title',
|
||||
label: '流程名称',
|
||||
minWidth: 180,
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
prop: 'amt',
|
||||
label: '报销金额',
|
||||
width: 120,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
align: 'left'
|
||||
}, {
|
||||
label: "创建日期",
|
||||
width: 160,
|
||||
prop: "form_date",
|
||||
formatter: (cell, data, value) => {
|
||||
return this.$moment(value).format("YYYY-MM-DD HH:mm");
|
||||
},
|
||||
},
|
||||
],
|
||||
// 明细数据
|
||||
detailList: [],
|
||||
showDetail: false,
|
||||
// 分页
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
const res = await awayIndex({
|
||||
page: this.currentPage,
|
||||
page_size: this.pageSize
|
||||
})
|
||||
this.total = res.total
|
||||
let arr = []
|
||||
res.data.map(item=>{
|
||||
arr.push({
|
||||
zijinlaiyuan:item.chuchai_detail.length>0?item.chuchai_detail[0].chuchai_pay.zijinlaiyuan:'',
|
||||
form_date:item.created_at,
|
||||
children:item.chuchai_detail
|
||||
})
|
||||
})
|
||||
this.batchList = arr
|
||||
|
||||
},
|
||||
confirm() {
|
||||
this.isShow = false
|
||||
},
|
||||
show() {
|
||||
this.isShow = true
|
||||
},
|
||||
// 获取状态对应的类型
|
||||
getStatusType(status) {
|
||||
const statusMap = {
|
||||
'已完成': 'success',
|
||||
'进行中': 'warning',
|
||||
'待审批': 'info'
|
||||
};
|
||||
return statusMap[status] || '';
|
||||
},
|
||||
// 搜索方法
|
||||
handleSearch() {
|
||||
console.log('搜索条件:', this.searchForm);
|
||||
// 这里添加实际的搜索逻辑
|
||||
},
|
||||
// 重置搜索
|
||||
handleReset() {
|
||||
this.searchForm.approveDate = '';
|
||||
this.searchForm.keyword = '';
|
||||
this.handleSearch();
|
||||
},
|
||||
// 行点击事件
|
||||
handleRowClick(row) {
|
||||
this.showDetail = true;
|
||||
// 模拟加载明细数据
|
||||
this.detailList = [{
|
||||
name: row.userName,
|
||||
processName: '项目A审批',
|
||||
source: row.source,
|
||||
amount: row.totalAmount * 0.6,
|
||||
status: '已完成',
|
||||
remark: '项目初期资金',
|
||||
createDate: row.createTime.split(' ')[0]
|
||||
},
|
||||
{
|
||||
name: row.userName,
|
||||
processName: '项目B审批',
|
||||
source: row.source,
|
||||
amount: row.totalAmount * 0.4,
|
||||
status: '进行中',
|
||||
remark: '项目中期资金',
|
||||
createDate: row.createTime.split(' ')[0]
|
||||
}
|
||||
];
|
||||
},
|
||||
// 分页方法
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.handleSearch();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.currentPage = val;
|
||||
this.handleSearch();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.batch-query {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.pagination-container {
|
||||
margin-top: 20px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
:deep(.el-tag--success) {
|
||||
background-color: #f0f9eb;
|
||||
}
|
||||
|
||||
:deep(.el-tag--warning) {
|
||||
background-color: #fdf6ec;
|
||||
}
|
||||
|
||||
:deep(.el-tag--info) {
|
||||
background-color: #f4f4f5;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in new issue