|
@@ -103,8 +103,8 @@
|
|
|
>
|
|
|
<template #default="scope">
|
|
|
<div class="operations">
|
|
|
- <el-button type="primary" @click="amendDialogData(scope.row)" size="mini">修改</el-button>
|
|
|
- <el-button type="primary" @click="del(scope.row)" size="mini">删除</el-button>
|
|
|
+ <el-button type="primary" @click="amendDialogData(scope.$index)" size="mini">修改</el-button>
|
|
|
+ <el-button type="primary" @click="del(scope.$index)" size="mini">删除</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -127,11 +127,10 @@
|
|
|
:visible.sync="addFundDialog"
|
|
|
width="950px"
|
|
|
class="fundDetail"
|
|
|
- :before-close="this.init">
|
|
|
+ :before-close="init">
|
|
|
|
|
|
<div class="dialogTop">
|
|
|
<div class="dagSpan">项目名称</div>
|
|
|
- <!-- <el-input v-model="data2.projectName" disabled placeholder="请输入内容"></el-input> -->
|
|
|
<el-select v-model="data2.select.projectName" disabled style="width: 100%;" placeholder="请选择">
|
|
|
<el-option
|
|
|
v-for="item in data2.options"
|
|
@@ -143,7 +142,6 @@
|
|
|
</div>
|
|
|
<div class="dialogTop">
|
|
|
<div class="dagSpan">项目类型</div>
|
|
|
- <!-- <el-input v-model="data2.tel" disabled style="width: 30%;" placeholder="请输入内容"></el-input> -->
|
|
|
<el-select v-model="data2.select.sort" disabled style="width: 30%;" placeholder="请选择">
|
|
|
<el-option
|
|
|
v-for="item in data2.sortOptions"
|
|
@@ -174,7 +172,7 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="dagInpS1">
|
|
|
- <div class="dagSpan" style="position:relative;top: -100px;">备注</div>
|
|
|
+ <div class="dagSpan" style="position:relative;top: -90px;">备注</div>
|
|
|
<el-input
|
|
|
type="textarea"
|
|
|
:rows="5"
|
|
@@ -294,7 +292,7 @@
|
|
|
|
|
|
<!-- 删除成员对话框开始 -->
|
|
|
<el-dialog
|
|
|
- title="删除经费明细"
|
|
|
+ title="删除"
|
|
|
:visible.sync="delFundDetail"
|
|
|
width="600px"
|
|
|
class="delMemberDialog">
|
|
@@ -313,17 +311,17 @@
|
|
|
import { VueEditor } from "vue2-editor";
|
|
|
export default {
|
|
|
// 接收父组件传递回来的方法
|
|
|
- props:["data","next",'back','submitBtn','addFundDetail','data2','confirmSetFund'],
|
|
|
+ props:["data","next",'back','submitBtn','data2','confirmSetFund'],
|
|
|
components:{
|
|
|
VueEditor
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- iid:[],
|
|
|
+ iid:'',
|
|
|
delFundDetail:false, //删除经费明细对话框
|
|
|
addFundDialog:false, //经费明细对话框
|
|
|
- setFund:false,
|
|
|
- recompose:0, //判断是否是修改
|
|
|
+ setFund:false, //设置月支出计划
|
|
|
+ recompose:0, //判断是否是修改 0 修改 1 添加
|
|
|
projectFundDetailInput:{
|
|
|
fund:'',
|
|
|
type:'',
|
|
@@ -356,61 +354,83 @@ import { VueEditor } from "vue2-editor";
|
|
|
this.setFund=false;
|
|
|
this.delFundDetail=false;
|
|
|
},
|
|
|
+
|
|
|
+ backBtn1(){ //上一步
|
|
|
+ this.back();
|
|
|
+ },
|
|
|
+ submit(){ //提交按钮
|
|
|
+ this.submitBtn();
|
|
|
+ },
|
|
|
+ addBtn(){ //经费明细添加对话框显示
|
|
|
+ this.addFundDialog=true;
|
|
|
+ },
|
|
|
+ amendDialogData(val){ //修改经费明细数据对话框显示
|
|
|
+ this.recompose=1
|
|
|
+ Object.assign(this.data.dialog,this.data.tableData2[val])
|
|
|
+ this.data.dialog['index']=val
|
|
|
+ this.addFundDialog=true;
|
|
|
+ // this.data.dialog=val
|
|
|
+ // this.iid=val
|
|
|
+ },
|
|
|
finish(){ //添加经费明细对话框完成按钮
|
|
|
- if(this.recompose){
|
|
|
- console.log('修改');
|
|
|
- this.data.tableData2.forEach((e,i,arr) => {
|
|
|
- if (e.id == this.iid.id) {
|
|
|
- if(this.data2.select.fund == '' || this.data2.select.fund==undefined )return this.$message.error('请输入项目预算总经费')
|
|
|
- if (this.data.dialog.type=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支类别')
|
|
|
- if (this.data.dialog.disburseProject=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支出项目')
|
|
|
- if (this.data.dialog.fund=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入金额')
|
|
|
-
|
|
|
- let oldMoney = this.data.tableData2.reduce((prev,cur)=>{ //默认第一次为0,
|
|
|
- console.log(prev,cur["fund"]);
|
|
|
- return prev+cur["fund"]
|
|
|
- },0); //默认值第一次运算为0
|
|
|
- // console.log(oldMoney); 第一次0
|
|
|
- oldMoney+=this.data.dialog.fund; //因为本次的数据还未添加到列表中,所以直接在这里进行相加判断
|
|
|
- if(oldMoney>(this.data2.select.fund)*10000) return this.$message.error('经费明细超出预算总金额');
|
|
|
- arr.splice(i,1,this.data.dialog)
|
|
|
- this.data.dialog={}
|
|
|
- this.recompose=0
|
|
|
- return this.init()
|
|
|
- }
|
|
|
- });
|
|
|
- return false
|
|
|
- }
|
|
|
+ if(this.recompose){ //修改
|
|
|
|
|
|
+ if (this.data.dialog.type=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支类别')
|
|
|
+ if (this.data.dialog.disburseProject=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支出项目')
|
|
|
+ if (this.data.dialog.fund=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入金额')
|
|
|
+ let oldMoney = this.data.tableData2.reduce((prev,cur)=>{ //默认第一次为0,
|
|
|
+ console.log(prev,cur["fund"]);
|
|
|
+ return prev+cur["fund"]
|
|
|
+ },0); //默认值第一次运算为0
|
|
|
+ // console.log(oldMoney); 第一次0
|
|
|
+ oldMoney+=this.data.dialog.fund; //因为本次的数据还未添加到列表中,所以直接在这里进行相加判断
|
|
|
+ if(oldMoney>(this.data2.select.fund)*10000) return this.$message.error('经费明细超出预算总金额');
|
|
|
+ Object.assign(this.data.tableData2[this.data.dialog['index']],this.data.dialog)
|
|
|
+ for(let k in this.data.dialog) this.data.dialog[k]=''
|
|
|
+ return this.addFundDialog=false;
|
|
|
+
|
|
|
+ // Object.assign(this.data.dialog,this.data.tableData2[])
|
|
|
+ // this.data.tableData2.forEach((e,i,arr) => {
|
|
|
+ // if (e.id == this.iid.id) {
|
|
|
+ // // if(this.data2.select.fund == '' || this.data2.select.fund==undefined )return this.$message.error('请输入项目预算总经费')
|
|
|
+ // if (this.data.dialog.type=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支类别')
|
|
|
+ // if (this.data.dialog.disburseProject=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支出项目')
|
|
|
+ // if (this.data.dialog.fund=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入金额')
|
|
|
|
|
|
+ //
|
|
|
+ // arr.splice(i,1,this.data.dialog)
|
|
|
+ // this.data.dialog={}
|
|
|
+ // this.recompose=0
|
|
|
+ // return this.init()
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // return false
|
|
|
+ }
|
|
|
+ let oldDia={} //添加数据防止污染
|
|
|
+ // 添加
|
|
|
if(this.data2.select.fund == '' || this.data2.select.fund==undefined )return this.$message.error('请输入项目预算总经费')
|
|
|
if (this.data.dialog.type=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支类别')
|
|
|
if (this.data.dialog.disburseProject=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入支出项目')
|
|
|
if (this.data.dialog.fund=="" || this.data2.select.fund==undefined ) return this.$message.error('请输入金额')
|
|
|
|
|
|
|
|
|
- // let oldMoney = this.data.tableData2.reduce((prev,cur)=>prev=prev+cur["fund"],0)
|
|
|
let oldMoney = this.data.tableData2.reduce((prev,cur)=>{ //默认第一次为0,
|
|
|
- console.log(prev,cur["fund"]);
|
|
|
+ // console.log(prev,cur["fund"]);
|
|
|
return prev+cur["fund"]
|
|
|
},0); //默认值第一次运算为0
|
|
|
- console.log(oldMoney);
|
|
|
+ // console.log(oldMoney);
|
|
|
|
|
|
oldMoney+=this.data.dialog.fund; //因为本次的数据还未添加到列表中,所以直接在这里进行相加判断
|
|
|
|
|
|
if(oldMoney>(this.data2.select.fund)*10000)return this.$message.error('经费明细超出预算总金额');
|
|
|
- this.addFundDetail();
|
|
|
- this.init();
|
|
|
-
|
|
|
- },
|
|
|
- backBtn1(){ //上一步
|
|
|
- this.back();
|
|
|
- },
|
|
|
- submit(){ //提交按钮
|
|
|
- this.submitBtn();
|
|
|
- },
|
|
|
- addBtn(){ //经费明细添加按钮
|
|
|
- this.addFundDialog=true;
|
|
|
+ // let p=this.projectApplicationApply3;
|
|
|
+ // p.dialog.id=uuid.v1();
|
|
|
+ // console.log(this.data.dialog);
|
|
|
+ Object.assign(oldDia,this.data.dialog)
|
|
|
+ this.data.tableData2.push(oldDia);
|
|
|
+ for(let k in this.data.dialog) this.data.dialog[k]='';
|
|
|
+ // console.log(this.data.tableData2);
|
|
|
+ this.addFundDialog=false;
|
|
|
},
|
|
|
setFundBtn(){ //经费月支出计划设置经费对话框显示
|
|
|
// console.log(this.data2.value);
|
|
@@ -432,25 +452,21 @@ import { VueEditor } from "vue2-editor";
|
|
|
this.confirmSetFund()
|
|
|
this.init()
|
|
|
},
|
|
|
- amendDialogData(val){ //修改经费明细数据对话框显示
|
|
|
- this.recompose=1
|
|
|
- console.log(val);
|
|
|
- this.addFundDialog=true;
|
|
|
- this.data.dialog=val
|
|
|
- this.iid=val
|
|
|
- },
|
|
|
+
|
|
|
del(val){ //删除经费明细对话框显示
|
|
|
this.delFundDetail=true;
|
|
|
- console.log(111);
|
|
|
this.iid=val
|
|
|
},
|
|
|
- commitDel(){
|
|
|
- this.data.tableData2.forEach((e,i,arr)=>{
|
|
|
- if (e.id == this.iid.id) {
|
|
|
- arr.splice(i,1)
|
|
|
- this.delFundDetail=false;
|
|
|
- }
|
|
|
- })
|
|
|
+ commitDel(){ //确定删除
|
|
|
+ this.data.tableData2.splice(this.iid,1)
|
|
|
+ this.delFundDetail=false;
|
|
|
+
|
|
|
+ // this.data.tableData2.forEach((e,i,arr)=>{
|
|
|
+ // if (e.id == this.iid.id) {
|
|
|
+ // arr.splice(i,1)
|
|
|
+ // this.delFundDetail=false;
|
|
|
+ // }
|
|
|
+ // })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -459,17 +475,17 @@ import { VueEditor } from "vue2-editor";
|
|
|
<style lang="less">
|
|
|
//对话框样式
|
|
|
|
|
|
- .el-input__inner{
|
|
|
- color: #000;
|
|
|
- font-size: 16px;
|
|
|
- }
|
|
|
- .el-textarea__inner{
|
|
|
- color: #000;
|
|
|
- font-size: 16px;
|
|
|
- }
|
|
|
- .el-input.is-disabled .el-input__inner{
|
|
|
- color: #3a3838;
|
|
|
- }
|
|
|
+ // .el-input__inner{
|
|
|
+ // color: #000;
|
|
|
+ // font-size: 16px;
|
|
|
+ // }
|
|
|
+ // .el-textarea__inner{
|
|
|
+ // color: #000;
|
|
|
+ // font-size: 16px;
|
|
|
+ // }
|
|
|
+ // .el-input.is-disabled .el-input__inner{
|
|
|
+ // color: #3a3838;
|
|
|
+ // }
|
|
|
.totalFundLabel{
|
|
|
width:90px;
|
|
|
line-height: 38px;
|
|
@@ -489,6 +505,9 @@ import { VueEditor } from "vue2-editor";
|
|
|
line-height: 25px;
|
|
|
margin: 15px 5px 30px;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
.fundDetail{ //经费明细添加对话框,防止冲突
|
|
|
.el-dialog__title{
|
|
|
font-size: 18px;
|
|
@@ -531,7 +550,9 @@ import { VueEditor } from "vue2-editor";
|
|
|
margin-right: 50px;
|
|
|
}
|
|
|
}
|
|
|
- .AddFund{ //添加对话框
|
|
|
+
|
|
|
+
|
|
|
+ .AddFund{ //月支出计划添加对话框
|
|
|
.el-input__inner{
|
|
|
width: 100%;
|
|
|
}
|
|
@@ -597,6 +618,8 @@ import { VueEditor } from "vue2-editor";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
.delMemberDialog{ //删除经费明细对话框样式
|
|
|
font-size: 18px;
|
|
|
.el-dialog{
|
|
@@ -621,21 +644,9 @@ import { VueEditor } from "vue2-editor";
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
- // .addDialogMid{
|
|
|
- // box-sizing: border-box;
|
|
|
- // padding:0 60px 0 10px;
|
|
|
- // .addDialogTit{
|
|
|
- // display: flex;
|
|
|
- // span{
|
|
|
- // width: 80px;
|
|
|
- // font-size: 16px;
|
|
|
- // line-height: 40px;
|
|
|
- // text-align: left;
|
|
|
-
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // }
|
|
|
+ .el-dialog__body{
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
.dialog-footer{
|
|
|
display: flex;
|
|
|
justify-content: center;
|