|
|
|
@ -72,6 +72,10 @@
|
|
|
|
</Poptip>
|
|
|
|
</Poptip>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 预算计划 -->
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 是否有借款 -->
|
|
|
|
<!-- 是否有借款 -->
|
|
|
|
<div v-if="contract.borrows && contract.borrows.length>0">
|
|
|
|
<div v-if="contract.borrows && contract.borrows.length>0">
|
|
|
|
@ -90,7 +94,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 是否没有关联 -->
|
|
|
|
<!-- 是否有 -->
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
@ -203,10 +207,10 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<template v-slot:extraFormBottom v-if="paymentRegistrationForm.plan.length===0">
|
|
|
|
<template v-slot:extraFormBottom>
|
|
|
|
|
|
|
|
<div v-if="paymentRegistrationForm.plan.length===0">
|
|
|
|
<div class="select-container">
|
|
|
|
<div class="select-container">
|
|
|
|
<DatePicker
|
|
|
|
<DatePicker
|
|
|
|
|
|
|
|
|
|
|
|
:value="planSelect.year"
|
|
|
|
:value="planSelect.year"
|
|
|
|
placeholder="选择所属年份"
|
|
|
|
placeholder="选择所属年份"
|
|
|
|
placement="bottom-start"
|
|
|
|
placement="bottom-start"
|
|
|
|
@ -262,18 +266,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
<xy-table
|
|
|
|
<xy-table
|
|
|
|
:header-cell-class-name="cellClassName"
|
|
|
|
:header-cell-class-name="cellClassName"
|
|
|
|
|
|
|
|
|
|
|
|
:list="plans"
|
|
|
|
:list="plans"
|
|
|
|
:show-index="false"
|
|
|
|
:show-index="false"
|
|
|
|
:table-item="planTable"
|
|
|
|
:table-item="planTable"
|
|
|
|
:height="300"
|
|
|
|
:height="300"
|
|
|
|
style="margin-top: 10px"
|
|
|
|
style="margin-top: 10px"
|
|
|
|
ref="editorPlanTable"
|
|
|
|
ref="editorPlanTable"
|
|
|
|
row-key="id"
|
|
|
|
|
|
|
|
border
|
|
|
|
border
|
|
|
|
default-expand-all
|
|
|
|
|
|
|
|
@select="planPick"
|
|
|
|
@select="planPick"
|
|
|
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
|
key="planTable"
|
|
|
|
|
|
|
|
:tree-props="{ children: 'notchildren', hasChildren: 'hasChildren' }"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<template v-slot:btns>
|
|
|
|
<template v-slot:btns>
|
|
|
|
<el-table-column
|
|
|
|
<el-table-column
|
|
|
|
@ -298,21 +300,26 @@
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</xy-table>
|
|
|
|
</xy-table>
|
|
|
|
<!-- <Input search enter-button="搜 索" placeholder="搜索预算计划.." v-model="searchContent" @on-search="getBudgets" />
|
|
|
|
<div style="display: flex; justify-content: flex-end">
|
|
|
|
<xy-table :list="plans" :show-index="false" :table-item="planTable" :height="310" style="margin-top: 10px"
|
|
|
|
<Page :total="planTotal" show-elevator @on-change="pageChange" />
|
|
|
|
ref="planTable" @select="selectPlan">
|
|
|
|
</div>
|
|
|
|
<template v-slot:btns>
|
|
|
|
</div>
|
|
|
|
<el-table-column label="使用金额(元)" header-align="center">
|
|
|
|
<div v-else>
|
|
|
|
|
|
|
|
<xy-table :list="showPlanList" key="showPlanTable" :show-index="false" :table-item="showPlanTable" :height="200" style="margin-top: 10px"
|
|
|
|
|
|
|
|
ref="editorPlanTable1">
|
|
|
|
|
|
|
|
<template v-slot:type>
|
|
|
|
|
|
|
|
<el-table-column label="分类" width="120" header-align="center">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<Input :value="scope.row.useMoney" @input="(e) => (scope.row.useMoney = e)" />
|
|
|
|
{{findVal(planTypes,scope.row.type)}}
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
|
|
|
<div></div>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</xy-table>
|
|
|
|
</xy-table>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div style="display: flex; justify-content: flex-end">
|
|
|
|
|
|
|
|
<Page :total="planTotal" show-elevator @on-change="pageChange" />
|
|
|
|
|
|
|
|
</div> -->
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</xy-dialog>
|
|
|
|
</xy-dialog>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -367,10 +374,11 @@
|
|
|
|
name: "",
|
|
|
|
name: "",
|
|
|
|
page_size: 20,
|
|
|
|
page_size: 20,
|
|
|
|
page: 1,
|
|
|
|
page: 1,
|
|
|
|
is_tree: 1,
|
|
|
|
// is_tree: 1,
|
|
|
|
year: new Date().getFullYear().toString(),
|
|
|
|
year: new Date().getFullYear().toString(),
|
|
|
|
plan_department_id: "",
|
|
|
|
plan_department_id: "",
|
|
|
|
type: ""
|
|
|
|
type: "",
|
|
|
|
|
|
|
|
top_pid: 1,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
plans: [],
|
|
|
|
plans: [],
|
|
|
|
planTypes: [],
|
|
|
|
planTypes: [],
|
|
|
|
@ -442,7 +450,8 @@
|
|
|
|
}, ],
|
|
|
|
}, ],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
departments:[],
|
|
|
|
departments:[],
|
|
|
|
planTable: [{
|
|
|
|
planTable: [
|
|
|
|
|
|
|
|
{
|
|
|
|
sortable: false,
|
|
|
|
sortable: false,
|
|
|
|
width: 44,
|
|
|
|
width: 44,
|
|
|
|
type: "selection",
|
|
|
|
type: "selection",
|
|
|
|
@ -506,11 +515,82 @@
|
|
|
|
align: "right",
|
|
|
|
align: "right",
|
|
|
|
formatter: (v1, v2, value) =>
|
|
|
|
formatter: (v1, v2, value) =>
|
|
|
|
value ? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : "",
|
|
|
|
value ? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : "",
|
|
|
|
|
|
|
|
}],
|
|
|
|
|
|
|
|
showPlanList:[],
|
|
|
|
|
|
|
|
showPlanTable: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
label: "科室",
|
|
|
|
|
|
|
|
prop: "plan_department_id",
|
|
|
|
|
|
|
|
width: 120,
|
|
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
|
|
formatter: (row, column, value) => {
|
|
|
|
|
|
|
|
return this.departments.find(i => i.id === row.plan_department_id)?.name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
label: "年份",
|
|
|
|
|
|
|
|
prop: "year",
|
|
|
|
|
|
|
|
width: 80,
|
|
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
label: "分类",
|
|
|
|
|
|
|
|
prop: "type",
|
|
|
|
|
|
|
|
width: 120,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
label: "名称",
|
|
|
|
|
|
|
|
prop: "name",
|
|
|
|
|
|
|
|
minWidth: 180,
|
|
|
|
|
|
|
|
align: "left",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
label: "内容",
|
|
|
|
|
|
|
|
prop: "content",
|
|
|
|
|
|
|
|
minWidth: 240,
|
|
|
|
|
|
|
|
align: "left",
|
|
|
|
|
|
|
|
showOverflowTooltip: true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
label: "计划金额",
|
|
|
|
|
|
|
|
prop: "money",
|
|
|
|
|
|
|
|
align: "right",
|
|
|
|
|
|
|
|
width: 120,
|
|
|
|
|
|
|
|
formatter: (v1, v2, value) => {
|
|
|
|
|
|
|
|
return `${(value && parseFloat(value) !== 0) ? value : v1.update_money }`.replace(/\B(?=(\d{3})+(?!\d))/g, ",")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
label: "使用金额",
|
|
|
|
|
|
|
|
prop: "use_money",
|
|
|
|
|
|
|
|
width: 120,
|
|
|
|
|
|
|
|
align: "right",
|
|
|
|
|
|
|
|
formatter: (v1, v2, value) =>
|
|
|
|
|
|
|
|
value ? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : "",
|
|
|
|
|
|
|
|
}]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
findVal(arr, id) {
|
|
|
|
|
|
|
|
for (let i = 0; i < arr.length; i++) {
|
|
|
|
|
|
|
|
// 1. 找到匹配项,直接返回name
|
|
|
|
|
|
|
|
if (arr[i].id == id) {
|
|
|
|
|
|
|
|
console.log("arr[i].name", arr[i].name);
|
|
|
|
|
|
|
|
return arr[i].name;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 2. 有children数组,递归查找
|
|
|
|
|
|
|
|
else if (arr[i].children instanceof Array) {
|
|
|
|
|
|
|
|
// 接收递归的返回值
|
|
|
|
|
|
|
|
const childResult = this.findVal(arr[i].children, id);
|
|
|
|
|
|
|
|
// 若子数组中找到结果,直接返回(传递到上层)
|
|
|
|
|
|
|
|
if (childResult) {
|
|
|
|
|
|
|
|
return childResult;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 3. 所有层级都没找到,返回null或空字符串(可选)
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
},
|
|
|
|
//上传
|
|
|
|
//上传
|
|
|
|
successHandle(response, file, fileList) {
|
|
|
|
successHandle(response, file, fileList) {
|
|
|
|
this.fileList = fileList;
|
|
|
|
this.fileList = fileList;
|
|
|
|
@ -594,6 +674,22 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//获取合同信息
|
|
|
|
//获取合同信息
|
|
|
|
|
|
|
|
mergePlanData(plans, planLink) {
|
|
|
|
|
|
|
|
// 创建 plans 的映射表,键为 plan_id,值为 use_money
|
|
|
|
|
|
|
|
const planMap = new Map(
|
|
|
|
|
|
|
|
plans.map(plan => [plan.plan_id, plan.use_money])
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 遍历 planLink,为每个项添加匹配的 use_money
|
|
|
|
|
|
|
|
return planLink.map(item => {
|
|
|
|
|
|
|
|
// 如果找到匹配的 plan_id,则添加 use_money,否则添加 null 或默认值
|
|
|
|
|
|
|
|
const useMoney = planMap.get(item.id) || null;
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
...item,
|
|
|
|
|
|
|
|
use_money: useMoney
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
async getContract(info) {
|
|
|
|
async getContract(info) {
|
|
|
|
|
|
|
|
|
|
|
|
this.contract = await detailContract({
|
|
|
|
this.contract = await detailContract({
|
|
|
|
@ -601,7 +697,11 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
this.paymentRegistrationForm.plan = this.contract.plan_link
|
|
|
|
this.paymentRegistrationForm.plan = this.contract.plan_link
|
|
|
|
console.log("this.paymentRegistrationForm.plan",this.contract.plan_link)
|
|
|
|
|
|
|
|
|
|
|
|
if(this.contract.plan_link,length>0){
|
|
|
|
|
|
|
|
this.showPlanList = this.mergePlanData(this.contract.plan_link,this.contract.plans)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log("this.paymentRegistrationForm.plan",this.contract.plan_link,this.showPlanList)
|
|
|
|
if(this.contract.plan_link.legnth===0){
|
|
|
|
if(this.contract.plan_link.legnth===0){
|
|
|
|
Message({
|
|
|
|
Message({
|
|
|
|
type: 'warning',
|
|
|
|
type: 'warning',
|
|
|
|
@ -735,13 +835,13 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async getBudgets(refresh) {
|
|
|
|
async getBudgets(refresh) {
|
|
|
|
let res = await getBudget(this.planSelect);
|
|
|
|
let res = await getBudget(this.planSelect);
|
|
|
|
this.initInputMoney(res.list)
|
|
|
|
this.initInputMoney(res.list.data)
|
|
|
|
this.plans = res.list;
|
|
|
|
this.plans = res.list.data;
|
|
|
|
|
|
|
|
|
|
|
|
if(refresh){
|
|
|
|
if(refresh){
|
|
|
|
this.$refs.editorPlanTable.clearSelection()
|
|
|
|
this.$refs.editorPlanTable.clearSelection()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// this.planTotal = res.list.total;
|
|
|
|
this.planTotal = res.list.total;
|
|
|
|
|
|
|
|
|
|
|
|
// this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
|
|
|
|
// this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
|
|
|
|
// return item.plan_id
|
|
|
|
// return item.plan_id
|
|
|
|
|