|
|
|
|
@ -89,7 +89,8 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 是否没有关联 -->
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -202,8 +203,102 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:extraFormBottom v-if="false">
|
|
|
|
|
<Input search enter-button="搜 索" placeholder="搜索预算计划.." v-model="searchContent" @on-search="getBudgets" />
|
|
|
|
|
<template v-slot:extraFormBottom v-if="paymentRegistrationForm.plan.length===0">
|
|
|
|
|
<div class="select-container">
|
|
|
|
|
<DatePicker
|
|
|
|
|
|
|
|
|
|
:value="planSelect.year"
|
|
|
|
|
placeholder="选择所属年份"
|
|
|
|
|
placement="bottom-start"
|
|
|
|
|
style="width: 180px;margin-right: 10px;"
|
|
|
|
|
type="year"
|
|
|
|
|
@on-change="(e) => {
|
|
|
|
|
planSelect.year = e
|
|
|
|
|
getBudgets(true)
|
|
|
|
|
}"
|
|
|
|
|
></DatePicker>
|
|
|
|
|
<el-select
|
|
|
|
|
placeholder="科室选择"
|
|
|
|
|
clearable
|
|
|
|
|
size="small"
|
|
|
|
|
v-model="planSelect.plan_department_id"
|
|
|
|
|
style="width: 180px;margin-right: 10px;"
|
|
|
|
|
@change="getBudgets(true)"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in departments"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-cascader
|
|
|
|
|
placeholder="资金类型选择"
|
|
|
|
|
:options="planTypes"
|
|
|
|
|
:props="{
|
|
|
|
|
checkStrictly: false,
|
|
|
|
|
label: 'name',
|
|
|
|
|
value: 'id',
|
|
|
|
|
}"
|
|
|
|
|
:value="planSelect.type"
|
|
|
|
|
clearable
|
|
|
|
|
size="small"
|
|
|
|
|
style="width: 220px;margin-right: 10px;"
|
|
|
|
|
@change="(e) => {
|
|
|
|
|
planSelect.type = e[e.length - 1] || '';
|
|
|
|
|
getBudgets(true);
|
|
|
|
|
}"
|
|
|
|
|
/>
|
|
|
|
|
<Input
|
|
|
|
|
v-model="planSelect.name"
|
|
|
|
|
search
|
|
|
|
|
enter-button="搜 索"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="搜索预算计划.."
|
|
|
|
|
@on-search="getBudgets(true)"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<xy-table
|
|
|
|
|
:header-cell-class-name="cellClassName"
|
|
|
|
|
|
|
|
|
|
:list="plans"
|
|
|
|
|
:show-index="false"
|
|
|
|
|
:table-item="planTable"
|
|
|
|
|
:height="300"
|
|
|
|
|
style="margin-top: 10px"
|
|
|
|
|
ref="editorPlanTable"
|
|
|
|
|
row-key="id"
|
|
|
|
|
border
|
|
|
|
|
default-expand-all
|
|
|
|
|
@select="planPick"
|
|
|
|
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="使用金额(元)"
|
|
|
|
|
:fixed="$store.getters.device === 'mobile'?false:'right'"
|
|
|
|
|
header-align="center"
|
|
|
|
|
width="144"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope" v-if="scope.row.pid > 0">
|
|
|
|
|
<InputNumber
|
|
|
|
|
style="width: 120px"
|
|
|
|
|
:min="0"
|
|
|
|
|
:precision="2"
|
|
|
|
|
:active-change="false"
|
|
|
|
|
v-model="scope.row._inputMoney"
|
|
|
|
|
:formatter="
|
|
|
|
|
(value) => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
|
|
|
|
"
|
|
|
|
|
:parser="(value) => value.replace(/\$\s?|(,*)/g, '')"
|
|
|
|
|
></InputNumber>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
<!-- <Input search enter-button="搜 索" placeholder="搜索预算计划.." v-model="searchContent" @on-search="getBudgets" />
|
|
|
|
|
<xy-table :list="plans" :show-index="false" :table-item="planTable" :height="310" style="margin-top: 10px"
|
|
|
|
|
ref="planTable" @select="selectPlan">
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
@ -217,7 +312,7 @@
|
|
|
|
|
|
|
|
|
|
<div style="display: flex; justify-content: flex-end">
|
|
|
|
|
<Page :total="planTotal" show-elevator @on-change="pageChange" />
|
|
|
|
|
</div>
|
|
|
|
|
</div> -->
|
|
|
|
|
</template>
|
|
|
|
|
</xy-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
@ -225,12 +320,13 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
getparameter
|
|
|
|
|
getparameter,getparameterTree
|
|
|
|
|
} from "@/api/system/dictionary";
|
|
|
|
|
import {
|
|
|
|
|
getFundLog,
|
|
|
|
|
addFundLog
|
|
|
|
|
} from "@/api/paymentRegistration/fundLog";
|
|
|
|
|
} from "@/api/paymentRegistration/fundLog";
|
|
|
|
|
import { listdeptNoAuth } from '@/api/system/department'
|
|
|
|
|
import {
|
|
|
|
|
getBudget
|
|
|
|
|
} from "@/api/budget/budget";
|
|
|
|
|
@ -266,7 +362,16 @@
|
|
|
|
|
searchContent: "",
|
|
|
|
|
planTotal: 0,
|
|
|
|
|
pageIndex: 1,
|
|
|
|
|
//付款登记
|
|
|
|
|
//付款登记
|
|
|
|
|
planSelect: {
|
|
|
|
|
name: "",
|
|
|
|
|
page_size: 20,
|
|
|
|
|
page: 1,
|
|
|
|
|
is_tree: 1,
|
|
|
|
|
year: new Date().getFullYear().toString(),
|
|
|
|
|
plan_department_id: "",
|
|
|
|
|
type: ""
|
|
|
|
|
},
|
|
|
|
|
plans: [],
|
|
|
|
|
planTypes: [],
|
|
|
|
|
contract: {},
|
|
|
|
|
@ -335,32 +440,73 @@
|
|
|
|
|
required: true,
|
|
|
|
|
message: "必选",
|
|
|
|
|
}, ],
|
|
|
|
|
},
|
|
|
|
|
planTable: [{
|
|
|
|
|
sortable: false,
|
|
|
|
|
width: 36,
|
|
|
|
|
type: "selection",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "分类",
|
|
|
|
|
prop: "type",
|
|
|
|
|
formatter: (cell, data, value) => {
|
|
|
|
|
let res = this.planTypes.filter((item) => {
|
|
|
|
|
return item.id === value;
|
|
|
|
|
});
|
|
|
|
|
return res[0]?.value || "未知";
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "名称",
|
|
|
|
|
prop: "name",
|
|
|
|
|
align: "left",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "计划金额",
|
|
|
|
|
prop: "money",
|
|
|
|
|
align: "right",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
departments:[],
|
|
|
|
|
planTable: [{
|
|
|
|
|
sortable: false,
|
|
|
|
|
width: 44,
|
|
|
|
|
type: "selection",
|
|
|
|
|
reserveSelection: true,
|
|
|
|
|
fixed: "left",
|
|
|
|
|
selectable: (row, index) => {
|
|
|
|
|
return row.pid > 0;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "科室",
|
|
|
|
|
prop: "plan_department.name",
|
|
|
|
|
width: 120,
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "年份",
|
|
|
|
|
prop: "year",
|
|
|
|
|
width: 80,
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "分类",
|
|
|
|
|
prop: "type_detail.value",
|
|
|
|
|
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_total",
|
|
|
|
|
width: 120,
|
|
|
|
|
align: "right",
|
|
|
|
|
formatter: (v1, v2, value) =>
|
|
|
|
|
value ? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : "",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "已用金额",
|
|
|
|
|
prop: "has_money_total",
|
|
|
|
|
width: 120,
|
|
|
|
|
align: "right",
|
|
|
|
|
formatter: (v1, v2, value) =>
|
|
|
|
|
value ? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : "",
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
@ -383,12 +529,31 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getPlanTypes() {
|
|
|
|
|
const res = await getparameter({
|
|
|
|
|
number: "money_way",
|
|
|
|
|
});
|
|
|
|
|
this.planTypes = res.detail;
|
|
|
|
|
},
|
|
|
|
|
// async getPlanTypes() {
|
|
|
|
|
// const res = await getparameter({
|
|
|
|
|
// number: "money_way",
|
|
|
|
|
// });
|
|
|
|
|
// this.planTypes = res.detail;
|
|
|
|
|
// },
|
|
|
|
|
async getPlanTypes() {
|
|
|
|
|
const res = await getparameterTree({
|
|
|
|
|
id: 3
|
|
|
|
|
});
|
|
|
|
|
const dataHandler = (data) => {
|
|
|
|
|
data.forEach(i => {
|
|
|
|
|
if (i.hasOwnProperty('detail')) {
|
|
|
|
|
i.children = i.detail.map(j => {
|
|
|
|
|
j.name = j.value
|
|
|
|
|
return j;
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
dataHandler(i['children'])
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
this.planTypes = dataHandler(res?.children) || []
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//翻页
|
|
|
|
|
pageChange(e) {
|
|
|
|
|
@ -429,18 +594,20 @@
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//获取合同信息
|
|
|
|
|
async getContract(info) {
|
|
|
|
|
async getContract(info) {
|
|
|
|
|
|
|
|
|
|
this.contract = await detailContract({
|
|
|
|
|
id: info.id,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.paymentRegistrationForm.plan = this.contract.plans.map((item) => {
|
|
|
|
|
return {
|
|
|
|
|
plan_id: item.id,
|
|
|
|
|
use_money: item.useMoney,
|
|
|
|
|
new_money: item.money,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
this.paymentRegistrationForm.plan = this.contract.plan_link
|
|
|
|
|
console.log("this.paymentRegistrationForm.plan",this.contract.plan_link)
|
|
|
|
|
if(this.contract.plan_link.legnth===0){
|
|
|
|
|
Message({
|
|
|
|
|
type: 'warning',
|
|
|
|
|
message: '该支出未关联预算计划,请在下方手动关联预算计划'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.form.audit_money = this.contract.audit_money;
|
|
|
|
|
if (this.contract.borrows && this.contract.borrows.length > 0) {
|
|
|
|
|
@ -477,7 +644,42 @@
|
|
|
|
|
files: this.fileList ? this.fileList.map(i => i?.response?.id) : [],
|
|
|
|
|
property: this.paymentRegistrationForm.property,
|
|
|
|
|
property_type_id: this.paymentRegistrationForm.property_type_id,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
// 如果没有关联预算计划,需要选择
|
|
|
|
|
if(this.paymentRegistrationForm.plan.length===0){
|
|
|
|
|
let contract_plan_act_links = this.$refs.editorPlanTable.getSelection()
|
|
|
|
|
console.log("contract_plan_act_links",contract_plan_act_links)
|
|
|
|
|
if(contract_plan_act_links.length<1){
|
|
|
|
|
Message({
|
|
|
|
|
type: 'warning',
|
|
|
|
|
message: '请选择预算计划'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
// 判断选择的预算计划金额是否不为0
|
|
|
|
|
let money0 = 0
|
|
|
|
|
contract_plan_act_links.map(i=>{
|
|
|
|
|
if(parseFloat(i._inputMoney)<=0 || !i._inputMoney){
|
|
|
|
|
money0++
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if(money0>0){
|
|
|
|
|
Message({
|
|
|
|
|
type: 'warning',
|
|
|
|
|
message: '选择的预算计划的使用金额不能为0'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
data.contract_plan_links = contract_plan_act_links.map(item=>{
|
|
|
|
|
return {
|
|
|
|
|
plan_id:item.id,
|
|
|
|
|
new_money:this.contract.money,
|
|
|
|
|
use_money:item._inputMoney
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
console.log("data",data,data.contract_plan_links)
|
|
|
|
|
// return
|
|
|
|
|
addFundLog(data).then((res) => {
|
|
|
|
|
//付款申请后同时更新一下合同中审计金额
|
|
|
|
|
editorContract({
|
|
|
|
|
@ -511,23 +713,55 @@
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//计划
|
|
|
|
|
//获取预算计划
|
|
|
|
|
async getBudgets() {
|
|
|
|
|
let res = await getBudget({
|
|
|
|
|
name: this.searchContent,
|
|
|
|
|
page_size: 10,
|
|
|
|
|
page: this.pageIndex,
|
|
|
|
|
});
|
|
|
|
|
this.plans = res.list.data;
|
|
|
|
|
this.planTotal = res.list.total;
|
|
|
|
|
//获取预算计划
|
|
|
|
|
initInputMoney(list) {
|
|
|
|
|
if (!Array.isArray(list)) return [];
|
|
|
|
|
|
|
|
|
|
return list.map(item => {
|
|
|
|
|
// 使用 Vue.set 确保响应式
|
|
|
|
|
this.$set(item, '_inputMoney', 0);
|
|
|
|
|
|
|
|
|
|
if (Array.isArray(item.children)) {
|
|
|
|
|
item.children = this.initInputMoney(item.children);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return item;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
cellClassName({row,column,rowIndex,columnIndex}){
|
|
|
|
|
if(columnIndex===0){
|
|
|
|
|
return 'allSelect'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getBudgets(refresh) {
|
|
|
|
|
let res = await getBudget(this.planSelect);
|
|
|
|
|
this.initInputMoney(res.list)
|
|
|
|
|
this.plans = res.list;
|
|
|
|
|
|
|
|
|
|
if(refresh){
|
|
|
|
|
this.$refs.editorPlanTable.clearSelection()
|
|
|
|
|
}
|
|
|
|
|
// this.planTotal = res.list.total;
|
|
|
|
|
|
|
|
|
|
// this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
|
|
|
|
|
// return item.plan_id
|
|
|
|
|
// }))
|
|
|
|
|
},
|
|
|
|
|
getDepartment() {
|
|
|
|
|
listdeptNoAuth().then((res) => {
|
|
|
|
|
this.departments = res.data;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
planPageChange(e) {
|
|
|
|
|
this.plansPageIndex = e;
|
|
|
|
|
this.getBudgets();
|
|
|
|
|
},
|
|
|
|
|
planPick (selection, row) {
|
|
|
|
|
if (row.year != new Date().getFullYear()) {
|
|
|
|
|
this.$confirm("您选择了非本年预算,是否继续?").catch(_ => {
|
|
|
|
|
this.$refs['editorPlanTable'].toggleRowSelection(row)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
selectPlan(sel, row) {
|
|
|
|
|
if (sel) {
|
|
|
|
|
@ -615,12 +849,24 @@
|
|
|
|
|
this.getPlanTypes();
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getAssetsFlowIds()
|
|
|
|
|
this.getAssetsFlowIds()
|
|
|
|
|
this.getDepartment()
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
::v-deep .ivu-input-group-append.ivu-input-search{
|
|
|
|
|
background-color: #409EFF;
|
|
|
|
|
}
|
|
|
|
|
::v-deep .allSelect .cell {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
.select-container {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
.payment-registration {
|
|
|
|
|
&-row {
|
|
|
|
|
display: flex;
|
|
|
|
|
|