|
|
|
@ -208,7 +208,9 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<template v-slot:extraFormBottom>
|
|
|
|
<template v-slot:extraFormBottom>
|
|
|
|
<div v-if="paymentRegistrationForm.plan.length===0">
|
|
|
|
<!-- v-if="paymentRegistrationForm.plan.length===0" -->
|
|
|
|
|
|
|
|
<div >
|
|
|
|
|
|
|
|
<div style="margin:5px 0;color:#000;">拟使用预算</div>
|
|
|
|
<div class="select-container">
|
|
|
|
<div class="select-container">
|
|
|
|
<DatePicker
|
|
|
|
<DatePicker
|
|
|
|
:value="planSelect.year"
|
|
|
|
:value="planSelect.year"
|
|
|
|
@ -218,7 +220,7 @@
|
|
|
|
type="year"
|
|
|
|
type="year"
|
|
|
|
@on-change="(e) => {
|
|
|
|
@on-change="(e) => {
|
|
|
|
planSelect.year = e
|
|
|
|
planSelect.year = e
|
|
|
|
getBudgets(true)
|
|
|
|
getBudgets('',true)
|
|
|
|
}"
|
|
|
|
}"
|
|
|
|
></DatePicker>
|
|
|
|
></DatePicker>
|
|
|
|
<el-select
|
|
|
|
<el-select
|
|
|
|
@ -227,7 +229,7 @@
|
|
|
|
size="small"
|
|
|
|
size="small"
|
|
|
|
v-model="planSelect.plan_department_id"
|
|
|
|
v-model="planSelect.plan_department_id"
|
|
|
|
style="width: 180px;margin-right: 10px;"
|
|
|
|
style="width: 180px;margin-right: 10px;"
|
|
|
|
@change="getBudgets(true)"
|
|
|
|
@change="getBudgets('',true)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
<el-option
|
|
|
|
v-for="item in departments"
|
|
|
|
v-for="item in departments"
|
|
|
|
@ -251,7 +253,7 @@
|
|
|
|
style="width: 220px;margin-right: 10px;"
|
|
|
|
style="width: 220px;margin-right: 10px;"
|
|
|
|
@change="(e) => {
|
|
|
|
@change="(e) => {
|
|
|
|
planSelect.type = e[e.length - 1] || '';
|
|
|
|
planSelect.type = e[e.length - 1] || '';
|
|
|
|
getBudgets(true);
|
|
|
|
getBudgets('',true);
|
|
|
|
}"
|
|
|
|
}"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<Input
|
|
|
|
<Input
|
|
|
|
@ -260,7 +262,7 @@
|
|
|
|
enter-button="搜 索"
|
|
|
|
enter-button="搜 索"
|
|
|
|
clearable
|
|
|
|
clearable
|
|
|
|
placeholder="搜索预算计划.."
|
|
|
|
placeholder="搜索预算计划.."
|
|
|
|
@on-search="getBudgets(true)"
|
|
|
|
@on-search="getBudgets('',true)"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
@ -271,7 +273,7 @@
|
|
|
|
:table-item="planTable"
|
|
|
|
:table-item="planTable"
|
|
|
|
:height="300"
|
|
|
|
:height="300"
|
|
|
|
style="margin-top: 10px"
|
|
|
|
style="margin-top: 10px"
|
|
|
|
ref="editorPlanTable"
|
|
|
|
ref="planTable"
|
|
|
|
border
|
|
|
|
border
|
|
|
|
@select="planPick"
|
|
|
|
@select="planPick"
|
|
|
|
key="planTable"
|
|
|
|
key="planTable"
|
|
|
|
@ -284,8 +286,9 @@
|
|
|
|
header-align="center"
|
|
|
|
header-align="center"
|
|
|
|
width="144"
|
|
|
|
width="144"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<template slot-scope="scope" v-if="scope.row.pid > 0">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<InputNumber
|
|
|
|
<Input :value="scope.row.use_money" @input="inputMoney($event,scope.row)" />
|
|
|
|
|
|
|
|
<!-- <InputNumber
|
|
|
|
style="width: 120px"
|
|
|
|
style="width: 120px"
|
|
|
|
:min="0"
|
|
|
|
:min="0"
|
|
|
|
:precision="2"
|
|
|
|
:precision="2"
|
|
|
|
@ -295,7 +298,7 @@
|
|
|
|
(value) => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
|
|
|
(value) => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
|
|
|
"
|
|
|
|
"
|
|
|
|
:parser="(value) => value.replace(/\$\s?|(,*)/g, '')"
|
|
|
|
:parser="(value) => value.replace(/\$\s?|(,*)/g, '')"
|
|
|
|
></InputNumber>
|
|
|
|
></InputNumber> -->
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
@ -304,9 +307,9 @@
|
|
|
|
<Page :total="planTotal" show-elevator @on-change="pageChange" />
|
|
|
|
<Page :total="planTotal" show-elevator @on-change="pageChange" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-else>
|
|
|
|
<!-- <div v-else>
|
|
|
|
<xy-table :list="showPlanList" key="showPlanTable" :show-index="false" :table-item="showPlanTable" :height="200" style="margin-top: 10px"
|
|
|
|
<xy-table :list="showPlanList" key="showPlanTable" :show-index="false" :table-item="showPlanTable" :height="200" style="margin-top: 10px"
|
|
|
|
ref="editorPlanTable1">
|
|
|
|
ref="planTable1">
|
|
|
|
<template v-slot:type>
|
|
|
|
<template v-slot:type>
|
|
|
|
<el-table-column label="分类" width="120" header-align="center">
|
|
|
|
<el-table-column label="分类" width="120" header-align="center">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
@ -318,7 +321,7 @@
|
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</xy-table>
|
|
|
|
</xy-table>
|
|
|
|
</div>
|
|
|
|
</div> -->
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</xy-dialog>
|
|
|
|
</xy-dialog>
|
|
|
|
@ -698,9 +701,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
this.paymentRegistrationForm.plan = this.contract.plan_link
|
|
|
|
this.paymentRegistrationForm.plan = this.contract.plan_link
|
|
|
|
|
|
|
|
|
|
|
|
if(this.contract.plan_link,length>0){
|
|
|
|
// if(this.contract.plan_link,length>0){
|
|
|
|
this.showPlanList = this.mergePlanData(this.contract.plan_link,this.contract.plans)
|
|
|
|
// this.showPlanList = this.mergePlanData(this.contract.plan_link,this.contract.plans)
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
console.log("this.paymentRegistrationForm.plan",this.contract.plan_link,this.showPlanList)
|
|
|
|
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({
|
|
|
|
@ -713,8 +716,9 @@
|
|
|
|
if (this.contract.borrows && this.contract.borrows.length > 0) {
|
|
|
|
if (this.contract.borrows && this.contract.borrows.length > 0) {
|
|
|
|
this.paymentRegistrationForm.applyMoney =
|
|
|
|
this.paymentRegistrationForm.applyMoney =
|
|
|
|
parseFloat(this.contract.money) - parseFloat(this.contract.borrows[0].money) + parseFloat(this.contract.borrows[0].diff)
|
|
|
|
parseFloat(this.contract.money) - parseFloat(this.contract.borrows[0].money) + parseFloat(this.contract.borrows[0].diff)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getBudgets(this.contract.plans?.map(i => i.pid>0?i.pid:i.id)?.toString())
|
|
|
|
const res = await getFundLog({
|
|
|
|
const res = await getFundLog({
|
|
|
|
contract_id: this.contract.id,
|
|
|
|
contract_id: this.contract.id,
|
|
|
|
show_type: 1
|
|
|
|
show_type: 1
|
|
|
|
@ -729,7 +733,14 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
inputMoney(e, row) {
|
|
|
|
|
|
|
|
row.use_money = e
|
|
|
|
|
|
|
|
this.paymentRegistrationForm.plan.forEach(item => {
|
|
|
|
|
|
|
|
if (item.plan_id == row.id) {
|
|
|
|
|
|
|
|
item.use_money = e
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
submit() {
|
|
|
|
submit() {
|
|
|
|
let data = {
|
|
|
|
let data = {
|
|
|
|
contract_id: this.contract.id,
|
|
|
|
contract_id: this.contract.id,
|
|
|
|
@ -747,7 +758,7 @@
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// 如果没有关联预算计划,需要选择
|
|
|
|
// 如果没有关联预算计划,需要选择
|
|
|
|
if(this.paymentRegistrationForm.plan.length===0){
|
|
|
|
if(this.paymentRegistrationForm.plan.length===0){
|
|
|
|
let contract_plan_act_links = this.$refs.editorPlanTable.getSelection()
|
|
|
|
let contract_plan_act_links = this.$refs.planTable.getSelection()
|
|
|
|
console.log("contract_plan_act_links",contract_plan_act_links)
|
|
|
|
console.log("contract_plan_act_links",contract_plan_act_links)
|
|
|
|
if(contract_plan_act_links.length<1){
|
|
|
|
if(contract_plan_act_links.length<1){
|
|
|
|
Message({
|
|
|
|
Message({
|
|
|
|
@ -759,7 +770,7 @@
|
|
|
|
// 判断选择的预算计划金额是否不为0
|
|
|
|
// 判断选择的预算计划金额是否不为0
|
|
|
|
let money0 = 0
|
|
|
|
let money0 = 0
|
|
|
|
contract_plan_act_links.map(i=>{
|
|
|
|
contract_plan_act_links.map(i=>{
|
|
|
|
if(parseFloat(i._inputMoney)<=0 || !i._inputMoney){
|
|
|
|
if(parseFloat(i.use_money)<=0 || !i.use_money){
|
|
|
|
money0++
|
|
|
|
money0++
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
@ -774,7 +785,7 @@
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
plan_id:item.id,
|
|
|
|
plan_id:item.id,
|
|
|
|
new_money:this.contract.money,
|
|
|
|
new_money:this.contract.money,
|
|
|
|
use_money:item._inputMoney
|
|
|
|
use_money:item.use_money
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -833,16 +844,24 @@
|
|
|
|
return 'allSelect'
|
|
|
|
return 'allSelect'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async getBudgets(refresh) {
|
|
|
|
async getBudgets(pid,search) {
|
|
|
|
let res = await getBudget(this.planSelect);
|
|
|
|
if(search){
|
|
|
|
|
|
|
|
this.$refs.planTable.clearSelection()
|
|
|
|
|
|
|
|
this.paymentRegistrationForm.plan = []
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let res = await getBudget({
|
|
|
|
|
|
|
|
top_pid: 1,
|
|
|
|
|
|
|
|
...this.planSelect,
|
|
|
|
|
|
|
|
pid
|
|
|
|
|
|
|
|
});
|
|
|
|
this.initInputMoney(res.list.data)
|
|
|
|
this.initInputMoney(res.list.data)
|
|
|
|
this.plans = res.list.data;
|
|
|
|
this.plans = res.list.data;
|
|
|
|
|
|
|
|
this.planTotal = res.list.total;
|
|
|
|
if(refresh){
|
|
|
|
|
|
|
|
this.$refs.editorPlanTable.clearSelection()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.planTotal = res.list.total;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
|
|
|
|
|
|
|
|
return item.plan_id
|
|
|
|
|
|
|
|
}))
|
|
|
|
// this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
|
|
|
|
// this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
|
|
|
|
// return item.plan_id
|
|
|
|
// return item.plan_id
|
|
|
|
// }))
|
|
|
|
// }))
|
|
|
|
@ -859,7 +878,7 @@
|
|
|
|
planPick (selection, row) {
|
|
|
|
planPick (selection, row) {
|
|
|
|
if (row.year != new Date().getFullYear()) {
|
|
|
|
if (row.year != new Date().getFullYear()) {
|
|
|
|
this.$confirm("您选择了非本年预算,是否继续?").catch(_ => {
|
|
|
|
this.$confirm("您选择了非本年预算,是否继续?").catch(_ => {
|
|
|
|
this.$refs['editorPlanTable'].toggleRowSelection(row)
|
|
|
|
this.$refs['planTable'].toggleRowSelection(row)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
@ -876,26 +895,62 @@
|
|
|
|
this.paymentRegistrationForm.plan = [];
|
|
|
|
this.paymentRegistrationForm.plan = [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
toggleSelection(e) {
|
|
|
|
toggleSelection(plans) {
|
|
|
|
if (!e) {
|
|
|
|
if (plans) {
|
|
|
|
return;
|
|
|
|
console.log("this.plans",plans,this.plans,this.paymentRegistrationForm)
|
|
|
|
}
|
|
|
|
let arr = this.plans.filter(plan => {
|
|
|
|
let plans = this.paymentRegistrationForm.plan.map((item) => {
|
|
|
|
if (plans.includes(plan.id)) {
|
|
|
|
return item.plan_id;
|
|
|
|
plan.use_money = parseFloat(this.paymentRegistrationForm.plan[plans.indexOf(plan.id)].use_money) ==0 ?
|
|
|
|
});
|
|
|
|
this.totalApplyMoney() : this.paymentRegistrationForm.plan[plans.indexOf(plan.id)].use_money
|
|
|
|
if (plans) {
|
|
|
|
return true
|
|
|
|
this.plans
|
|
|
|
}else if(plans.includes(plan.pid)) {
|
|
|
|
.filter((plan) => {
|
|
|
|
plan.use_money = parseFloat(this.paymentRegistrationForm.plan[plans.indexOf(plan.pid)].use_money) ==0 ?
|
|
|
|
return plans.includes(plan.id);
|
|
|
|
this.totalApplyMoney() : this.paymentRegistrationForm.plan[plans.indexOf(plan.pid)].use_money
|
|
|
|
})
|
|
|
|
return true
|
|
|
|
.map((row) => {
|
|
|
|
}else{
|
|
|
|
this.$nextTick(() => {
|
|
|
|
plan.use_money = 0
|
|
|
|
this.$refs["planTable"].toggleRowSelection(row);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
// plan.use_money = this.paymentRegistrationForm.applyMoney
|
|
|
|
});
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
console.log("arr",arr)
|
|
|
|
this.$refs["planTable"].clearSelection();
|
|
|
|
arr.forEach(row => {
|
|
|
|
}
|
|
|
|
console.log("row",row)
|
|
|
|
|
|
|
|
this.$refs.planTable.toggleRowSelection(row)
|
|
|
|
|
|
|
|
this.paymentRegistrationForm.plan.push({
|
|
|
|
|
|
|
|
contract_id: this.contract.id,
|
|
|
|
|
|
|
|
plan_id: row.id,
|
|
|
|
|
|
|
|
use_money: row.use_money,
|
|
|
|
|
|
|
|
new_money: row.money,
|
|
|
|
|
|
|
|
label: row.name,
|
|
|
|
|
|
|
|
plan:row
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.$refs.planTable.clearSelection()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (!e) {
|
|
|
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// let plans = this.paymentRegistrationForm.plan.map((item) => {
|
|
|
|
|
|
|
|
// return item.plan_id;
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// if (plans) {
|
|
|
|
|
|
|
|
// this.plans
|
|
|
|
|
|
|
|
// .filter((plan) => {
|
|
|
|
|
|
|
|
// return plans.includes(plan.id);
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// .map((row) => {
|
|
|
|
|
|
|
|
// this.$nextTick(() => {
|
|
|
|
|
|
|
|
// this.$refs["planTable"].toggleRowSelection(row);
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// this.$refs["planTable"].clearSelection();
|
|
|
|
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
async getAssetsFlowIds() {
|
|
|
|
async getAssetsFlowIds() {
|
|
|
|
@ -941,7 +996,10 @@
|
|
|
|
watch: {
|
|
|
|
watch: {
|
|
|
|
isShowPaymentRegistration(newVal) {
|
|
|
|
isShowPaymentRegistration(newVal) {
|
|
|
|
if (newVal) {
|
|
|
|
if (newVal) {
|
|
|
|
this.getBudgets();
|
|
|
|
// this.getBudgets();
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.paymentRegistrationForm.plan = []
|
|
|
|
|
|
|
|
this.$refs.planTable.clearSelection()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|