预算查看加搜索

master
xy 1 year ago
parent 2e6b58a2b6
commit 2b4e3ac797

@ -51,7 +51,6 @@ router.beforeEach(async (to, from, next) => {
}
// determine whether the user has logged in
const hasToken = getToken()
if (hasToken) {
if (to.path === '/login') {
// if is logged in, redirect to the home page

@ -12,7 +12,7 @@
:list="list"
:table-item="tableItem"
:default-expand-all="false"
@expand-change="expandChange"
>
<template v-slot:btns> </template>
</xy-table>
@ -27,7 +27,7 @@
type="primary"
class="slot-btns-item"
style="margin: 10px;"
>
>@expand-change="expandChange"
年中自评确认
</Button>
</el-popover>

@ -4,12 +4,47 @@
<div slot="content"></div>
<slot>
<div>
<span style="padding: 0 6px;">年份</span>
<span style="padding: 0 6px">名称</span>
<span><el-input
v-model="select.name"
placeholder="请输入名称"
style="width: 130px"
size="small"
></el-input></span>
<span style="padding: 0 6px">年份</span>
<span>
<DatePicker placeholder="选择所属年份" type="year" placement="bottom" :value="select.year" style="width: 130px;"
@on-change="(e)=>select.year = e"></DatePicker>
<DatePicker
:value="select.year"
placeholder="选择所属年份"
placement="bottom"
style="width: 130px"
type="year"
@on-change="(e) => (select.year = e)"
></DatePicker>
</span>
<span style="padding: 0 6px">资金隶属情况</span>
<span>
<el-select
placeholder="资金隶属情况"
clearable
multiple
collapse-tags
size="small"
v-model="select.dimension"
style="width: 200px"
>
<el-option
v-for="item in dimensions"
:label="item.value"
:value="item.id"
:key="item.id"
>
</el-option>
</el-select>
</span>
<span style="padding: 0 6px"> 预算类型 </span>
<span>
<el-cascader
@ -27,12 +62,21 @@
/>
</span>
<span style="padding: 0 6px;">
科室
</span>
<span style="padding: 0 6px"> 科室 </span>
<span>
<el-select placeholder="科室选择" clearable size="small" v-model="select.department" style="width: 160px;">
<el-option v-for="item in departments" :label="item.name" :value="item.id" :key="item.id">
<el-select
placeholder="科室选择"
clearable
size="small"
v-model="select.department"
style="width: 160px"
>
<el-option
v-for="item in departments"
:label="item.name"
:value="item.id"
:key="item.id"
>
</el-option>
</el-select>
</span>
@ -118,6 +162,29 @@
},
data() {
return {
isTree: true,
dimensions: [
{
value: "年初部门预算",
id: "1"
},
{
value: "年中追加部门预算",
id: "2"
},
{
value: "上年结转资金",
id: "3"
},
{
value: "基本户资金",
id: "4"
},
{
value: "其他",
id: "5"
}
],
isShowAdd: false,
types: [],
form: {
@ -230,11 +297,14 @@
},
],
select: {
name: "",
page: 1,
year: "",
type: "",
type_pid: "",
department: "",
is_auth: 0,
type_pid: "",
dimension: []
},
departments: [], //
@ -244,6 +314,23 @@
}
},
methods: {
changeTree() {
if (!this.isTree) {
this.table = [
{
label: "隶属项目",
prop: "pid_info_name",
width: 200,
align: "left",
sortable: false,
fixed: "left",
},
].concat(this.tableItem);
} else {
this.table = this.tableItem;
}
this.getBudgets();
},
handleTypePick(e) {
if (e.length === 1) {
this.select.type_pid = e[0] || ''
@ -342,15 +429,17 @@
//
getBudgets() {
getBudget({
name: this.select.name,
page_size: this.pageSize,
page: this.pageIndex,
year: this.select.year,
type: this.select.type,
plan_department_id: this.select.department,
is_tree: this.isTree ? 1 : "",
top_pid: !this.isTree ? 1 : "",
is_auth:this.select.is_auth,
type_pid: this.select.type_pid,
//top_pid: 1,
is_auth: 1,
is_tree: 1
dimension: this.select.dimension.toString()
}).then(res => {
for (var m of res.list) {
m.pid_info_name = m.pid_info?.name

@ -1124,12 +1124,11 @@ export default {
},
{
label: "计划金额",
prop: "money",
prop: "update_money",
align: "right",
width: 120,
formatter: (v1, v2, value) => {
return `${(value && parseFloat(value) !== 0) ? value : v1.update_money }`.replace(/\B(?=(\d{3})+(?!\d))/g, ",")
}
return `${(value && parseFloat(value) !== 0) ? value : v1.money }`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") }
},
{
label: "实付金额",
@ -1303,7 +1302,7 @@ export default {
});
return;
}
if ((i._inputMoney > ((Number(i.money) || Number(i.update_money)) - Number(i.has_money_total))) || (i._inputMoney > ((Number(i.money) || Number(i.update_money)) - Number(i.use_money_total)))) {
if ((i._inputMoney > (Number(i.update_money) || (Number(i.money)) - Number(i.has_money_total))) || (i._inputMoney > (Number(i.update_money) || (Number(i.money)) - Number(i.use_money_total)))) {
this.$message({
type: "warning",
message: `${i.year}${i.name} 使用金额大于剩余预算!`,

@ -1038,6 +1038,7 @@
ref="planTable"
:height="300"
:list="plans"
highlight-current-row
:show-index="false"
:table-item="planTable"
style="margin-top: 10px"
@ -2754,7 +2755,7 @@ export default {
}
}
}
if (item.purchase_way?.value !== '网上商城' && item.is_contract && item.purchase_way?.remark === 'true' && !item.is_substitute) {
if (item.is_contract && item.purchase_way?.remark === 'true' && !item.is_substitute) {
// \
flowStatus["zhaobiao"].setStatus(item.invite_status)
if (item.invite_status === 1 && item.purchase_status === 3) {
@ -2762,7 +2763,7 @@ export default {
flowStatus["zhaobiao"].setExecutable(true)
}
}
if (item.is_contract && item.purchase_way?.value !== "网上商城") {
if (item.is_contract) {
//
flowStatus["shenpi"].setStatus(item.join_status)
if (item.join_status === 1 && (item.invite_status === 3 ||
@ -2771,7 +2772,7 @@ export default {
flowStatus["shenpi"].setExecutable(true)
}
}
if (item.is_contract && item.purchase_way?.value !== "网上商城" && !item.is_substitute) {
if (item.is_contract && !item.is_substitute) {
flowStatus["qianding"].setStatus(item.status)
if (item.join_status === 3 && item.status === 1) {
flowStatus["qianding"].setExecutable(true)
@ -2780,7 +2781,7 @@ export default {
if (item.is_end === 0) {
flowStatus["zhifu"].setStatus(1)
//
if ((!item.is_contract && !item.is_substitute && item.purchase_status === 3) || (item.purchase_way?.value === "网上商城" && item.purchase_status === 3) ||
if ((!item.is_contract && !item.is_substitute && item.purchase_status === 3) ||
item.status === 2 ||
(!item.is_contract && item.is_simple) || (item.is_contract && item.is_substitute && item.join_status === 3)) {
//
@ -2852,7 +2853,7 @@ export default {
if (/contractLedger/g.test(this.$route.path)) {
this.select.is_contract = 1;
this.select.purchase_status = 3;
this.select.invite_status = 3;
//this.select.invite_status = 3;
this.select.is_simple = "";
}
if (/contractAll/g.test(this.$route.path)) {

@ -383,13 +383,17 @@ export default {
{
if (row.act_plan_link.length > 0) {
return row.act_plan_link.map((item) => {
return (
<div>
{" "}
[{item.plan.year}] {(item.plan && item.plan.pid_info) ? item.plan.pid_info.name: ''} - {item.plan.name} <br /> [使用金额]{" "}
{item.use_money}{" "}
</div>
);
if (item.plan) {
return (
<div>
{" "}
[{item.plan.year}] {(item.plan && item.plan.pid_info) ? item.plan.pid_info.name: ''} - {item.plan.name} <br /> [使用金额]{" "}
{item.use_money}{" "}
</div>
);
} else {
return ""
}
});
}
}

@ -161,6 +161,21 @@
</span>
</div>
<div>
<span style="padding: 0 6px; word-break: keep-all">预算计划</span>
<span>
<Input
v-model="select.plan_name"
clearable
placeholder="请选择预算计划"
@on-focus="isShowPlanForSearch = true"
style="width: 200px"
@on-clear="select.plan_id = '',select.plan_name = '请选择预算计划'"
/>
</span>
</div>
<Button
style="margin-left: 10px"
type="primary"
@ -286,6 +301,63 @@
<detailContract ref="detailContract"></detailContract>
<paymentRegistration ref="paymentRegistration" @refresh="getList"></paymentRegistration>
<!-- 搜索使用 预算计划 -->
<xy-dialog
:is-show.sync="isShowPlanForSearch"
title="预算计划"
:width="720"
@on-ok="planSelectForSearch"
>
<template>
<Input
v-model="planSearch.name"
search
enter-button="搜 索"
placeholder="搜索预算计划.."
@on-search="planSearch.page = 1,getBudgets()"
/>
<div
style="
margin: 10px 0;
display: flex;
justify-content: space-between;
align-items: center;
"
>
<div>
已选择<span style="margin-right: 10px">{{
select.plan_name
}}</span>
</div>
<el-link type="success" @click="select.plan_id = '',select.plan_name = '请选择预算计划'"
>清空选择</el-link
>
</div>
<xy-table
:list="plans"
highlight-current-row
@rowClick="selectPlanForSearch"
:show-index="false"
:table-item="planTableSearch"
:height="310"
style="margin-top: 10px"
:tree-props="{ children: 'notChildren', hasChildren: 'hasChildren' }"
ref="singlePlanTable"
>
<template v-slot:btns> </template>
</xy-table>
<div style="display: flex; justify-content: flex-end">
<Page :total="planTotal" show-elevator @on-change="e => { planSearch.page = e;getBudgets() }" />
</div>
<el-tag type="warning">点击行进行选择</el-tag>
</template>
<template v-slot:footerContent>
<Button type="primary" @click="isShowPlanForSearch = false,getList()">确定</Button>
</template>
</xy-dialog>
</div>
</template>
@ -297,15 +369,60 @@ import { listdeptNoAuth } from "@/api/system/department";
import addExpenseAccount from "@/views/inOut/component/addExpenseAccount.vue";
import detailContract from '@/views/contract/components/detailContract.vue';
import paymentRegistration from '@/views/contract/components/paymentRegistration.vue'
import { getBudget } from '@/api/budget/budget'
export default {
components: {
addExpenseAccount,detailContract,paymentRegistration
},
data() {
return {
isShowPlanForSearch: false,
planSearch: {
page_size: 10,
page: 1,
top_pid: "1",
is_tree: "0",
name: "",
plan_department_id: "",
year: ""
},
planTableSearch: [
{
label: "分类",
prop: "type_detail.value",
},
{
label: "年份",
prop: "year",
align: "center",
},
{
label: "名称",
prop: "name",
align: "left",
},
{
label: "计划金额",
prop: "money",
align: "right",
width: 120,
customFn: (row) => {
let m1 = row.money;
let m2 = row.update_money;
return m2 == 0 ? m1 : m2;
},
},
],
plans: [],
planTotal: 0,
otherType: [],
total: 0,
select: {
plan_id: "",
keyword: "",
page: 1,
page_size: 10,
@ -432,6 +549,42 @@ export default {
};
},
methods: {
//
selectPlanForSearch(sel) {
if (sel) {
this.select.plan_id = sel.id;
this.select.plan_name = sel.name;
} else {
this.select.plan_id = "";
this.select.plan_name = "";
}
},
//
async getBudgets() {
let res = await getBudget(this.planSearch);
this.plans = res.list.data;
this.planTotal = res.list.total || 0;
this.toggleSelection(
this.plan.map((item) => {
return item.value.plan_id;
}),
1
);
},
//
planSelectForSearch() {
if (!this.select.plan_id) {
this.$message({
type: "warning",
message: "选择计划不能为空",
});
return;
}
this.isShowPlanForSearch = false;
},
init() {
for (let key in this.select) {
if (this.select[key] instanceof Array) {
@ -488,6 +641,7 @@ export default {
this.getDepartment();
this.getOtherType();
this.getList();
this.getBudgets();
},
};
</script>

Loading…
Cancel
Save