|
|
|
|
@ -126,7 +126,7 @@
|
|
|
|
|
>
|
|
|
|
|
<div slot="tip" class="el-upload__tip">
|
|
|
|
|
支持文件格式:.rar .zip .doc .docx .pdf
|
|
|
|
|
<br />单个文件不能超过500kb
|
|
|
|
|
<br />单个文件不能超过20Mb
|
|
|
|
|
</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
@ -159,6 +159,32 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:extraFormBottom>
|
|
|
|
|
<Input search enter-button="搜 索" placeholder="搜索预算计划.." @on-search="getBudgets" />
|
|
|
|
|
<div style="min-width: 300px;">
|
|
|
|
|
<template v-if="form.plan_link.length > 0">
|
|
|
|
|
<template v-for="item in form.plan_link">
|
|
|
|
|
<Tag closable color="primary" @on-close="delPlan(item)">{{item.label}}</Tag>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
<xy-table :list="plans" :show-index="false" :table-item="planTable" :height="310" style="margin-top: 10px;"
|
|
|
|
|
ref="planTable" @select="selectPlan">
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column label="使用金额" header-align="center" width="140">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<Input :value="scope.row.use_money" @input="inputMoney($event,scope.row)" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
|
|
|
|
|
<div style="display: flex;justify-content: flex-end;">
|
|
|
|
|
<Page :total="planTotal" show-elevator @on-change="e => {
|
|
|
|
|
p
|
|
|
|
|
}" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 新增表 预算计划 -->
|
|
|
|
|
@ -174,7 +200,7 @@
|
|
|
|
|
:list="plans"
|
|
|
|
|
row-key="id"
|
|
|
|
|
:show-index="false"
|
|
|
|
|
:table-item="planTable"
|
|
|
|
|
:table-item="planOutTable"
|
|
|
|
|
style="margin-top: 10px"
|
|
|
|
|
@select="selected"
|
|
|
|
|
>
|
|
|
|
|
@ -186,7 +212,7 @@
|
|
|
|
|
<Page
|
|
|
|
|
:total="planTotal"
|
|
|
|
|
show-elevator
|
|
|
|
|
@on-change="e => {planSearch.p = e; getBudgets()}"
|
|
|
|
|
@on-change="e => {planSearch.p = e; getOutBudgets()}"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
@ -207,6 +233,7 @@ import {
|
|
|
|
|
detailContract as show,
|
|
|
|
|
} from "@/api/contract/contract";
|
|
|
|
|
import { httpCurl } from "@/api/out"
|
|
|
|
|
import { getBudget } from '@/api/budget/budget'
|
|
|
|
|
export default {
|
|
|
|
|
props: {
|
|
|
|
|
report_types: {
|
|
|
|
|
@ -242,7 +269,7 @@ export default {
|
|
|
|
|
list_rows: 10,
|
|
|
|
|
p: 1
|
|
|
|
|
},
|
|
|
|
|
planTable: [
|
|
|
|
|
planOutTable: [
|
|
|
|
|
{
|
|
|
|
|
width: 46,
|
|
|
|
|
sortable: false,
|
|
|
|
|
@ -291,6 +318,7 @@ export default {
|
|
|
|
|
files: [],
|
|
|
|
|
remark: "",
|
|
|
|
|
oa: [],
|
|
|
|
|
plan_link: []
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
report_type: [
|
|
|
|
|
@ -306,6 +334,59 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
planTable: [{
|
|
|
|
|
sortable: false,
|
|
|
|
|
width: 44,
|
|
|
|
|
type: 'selection'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "年份",
|
|
|
|
|
prop: 'year',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: 96,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "分类",
|
|
|
|
|
width: 136,
|
|
|
|
|
prop: 'type_detail.value',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "科室",
|
|
|
|
|
prop: 'plan_department.name',
|
|
|
|
|
width: 100,
|
|
|
|
|
align: 'center'
|
|
|
|
|
}, {
|
|
|
|
|
label: "隶属",
|
|
|
|
|
prop: 'pid_info.name',
|
|
|
|
|
width: 180,
|
|
|
|
|
align: 'left'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "名称",
|
|
|
|
|
prop: 'name',
|
|
|
|
|
width: 280,
|
|
|
|
|
align: 'left'
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
label: "计划金额",
|
|
|
|
|
prop: 'money',
|
|
|
|
|
width: 136,
|
|
|
|
|
align: 'right',
|
|
|
|
|
customFn: (row) => {
|
|
|
|
|
let m1 = row.money;
|
|
|
|
|
let m2 = row.update_money;
|
|
|
|
|
|
|
|
|
|
return m2 == 0 ? m1 : m2;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "已经使用",
|
|
|
|
|
prop: 'use_money_total',
|
|
|
|
|
width: 136,
|
|
|
|
|
align: 'right',
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
@ -319,7 +400,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
uploadBefore(file) {
|
|
|
|
|
console.log(file);
|
|
|
|
|
if (file.size / 1000 > 500) {
|
|
|
|
|
if (file.size / 1000 > 20 * 1024) {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "warning",
|
|
|
|
|
message: "上传文件大小超过500kb!",
|
|
|
|
|
@ -376,6 +457,60 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
delPlan(val) {
|
|
|
|
|
this.form.plan_link.map((item, index) => {
|
|
|
|
|
if (item.plan_id === val.plan_id) {
|
|
|
|
|
this.form.plan_link.splice(index, 1)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
selectPlan(sel, row) {
|
|
|
|
|
if (sel) {
|
|
|
|
|
let select = sel.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
contract_id: this.id,
|
|
|
|
|
plan_id: item.id,
|
|
|
|
|
use_money: item.use_money,
|
|
|
|
|
new_money: item.money,
|
|
|
|
|
label: item.name
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
//说明被删除了
|
|
|
|
|
if (!sel.find(plan => {
|
|
|
|
|
return plan.id == row.id
|
|
|
|
|
})) {
|
|
|
|
|
this.delPlan({
|
|
|
|
|
plan_id: row.id
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let _plan = JSON.parse(JSON.stringify(this.form.plan_link));
|
|
|
|
|
|
|
|
|
|
var _select = [];
|
|
|
|
|
select.map(item => {
|
|
|
|
|
if (!_plan.find(plan => {
|
|
|
|
|
return plan.plan_id == item.plan_id
|
|
|
|
|
})) {
|
|
|
|
|
_select.push(item)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.form.plan_link = [..._plan, ..._select]
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
this.form.plan_link = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
inputMoney(e, row) {
|
|
|
|
|
row.use_money = e
|
|
|
|
|
this.form.plan_link.forEach(item => {
|
|
|
|
|
if (item.plan_id == row.id) {
|
|
|
|
|
item.use_money = e
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getDetail() {
|
|
|
|
|
const res = await show({ id: this.id });
|
|
|
|
|
this.$integrateData(this.form, res);
|
|
|
|
|
@ -386,11 +521,14 @@ export default {
|
|
|
|
|
response: i
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.form.other_type = res.other_type?.id;
|
|
|
|
|
await this.getBudgets();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
submit() {
|
|
|
|
|
this.form.outcome_type = this.outcomeType;
|
|
|
|
|
this.form.files = this.fileList.map(i => i.response?.id);
|
|
|
|
|
this.form.contract_plan_act_links = this.form.plan_link;
|
|
|
|
|
if (this.type === "add") {
|
|
|
|
|
if (this.form.hasOwnProperty("id")) {
|
|
|
|
|
delete this.form.id;
|
|
|
|
|
@ -444,11 +582,38 @@ export default {
|
|
|
|
|
).detail;
|
|
|
|
|
},
|
|
|
|
|
async showPlan() {
|
|
|
|
|
await this.getBudgets();
|
|
|
|
|
await this.getOutBudgets();
|
|
|
|
|
this.isShowPlan = true;
|
|
|
|
|
},
|
|
|
|
|
//获取预算计划
|
|
|
|
|
async getBudgets() {
|
|
|
|
|
let res = await getBudget({
|
|
|
|
|
top_pid: 1,
|
|
|
|
|
...this.plansSelect
|
|
|
|
|
})
|
|
|
|
|
this.plans = res.list.data
|
|
|
|
|
this.planTotal = res.list.total
|
|
|
|
|
|
|
|
|
|
this.toggleSelection(this.form.plan_link.map(item => {
|
|
|
|
|
return item.plan_id
|
|
|
|
|
}))
|
|
|
|
|
},
|
|
|
|
|
//默认选择计划
|
|
|
|
|
toggleSelection(plans) {
|
|
|
|
|
if (plans) {
|
|
|
|
|
this.plans.filter(plan => {
|
|
|
|
|
if (plans.includes(plan.id)) {
|
|
|
|
|
plan.use_money = this.form.plan_link[plans.indexOf(plan.id)].use_money
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}).map(row => {
|
|
|
|
|
this.$refs.planTable.toggleRowSelection(row)
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.$refs.planTable.clearSelection()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//获取预算计划
|
|
|
|
|
async getOutBudgets() {
|
|
|
|
|
let res = await httpCurl(this.planSearch, false, '/Api/flowList');
|
|
|
|
|
this.plans = res.list
|
|
|
|
|
this.planTotal = Number(res.total)
|
|
|
|
|
|