|
@@ -11,7 +11,7 @@
|
|
|
<!-- 项目名称、类型开始 -->
|
|
|
<div class="Apply1">
|
|
|
<div class="inpInterval">项目名称</div>
|
|
|
- <el-select v-model="selects.projectName" style="width: 30%;" placeholder="请选择">
|
|
|
+ <el-select v-model="selects.projectName" style="width: 30%;" placeholder="请选择">
|
|
|
<el-option
|
|
|
v-for="item in projectFilter"
|
|
|
:key="item.id"
|
|
@@ -27,7 +27,7 @@
|
|
|
v-for="item in projectType"
|
|
|
:key="item.id"
|
|
|
:label="item.name"
|
|
|
- :value="item.id">
|
|
|
+ :value="item.name">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
@@ -115,7 +115,7 @@
|
|
|
</div>
|
|
|
<div class="howMoney">
|
|
|
<div class="inpInterval twoStyle">余额</div>
|
|
|
- <el-input v-model="item.reason" class="howMoneyInp" placeholder="金额"></el-input>
|
|
|
+ <el-input v-model="item.remainFund" class="howMoneyInp" placeholder="金额"></el-input>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
@@ -173,7 +173,7 @@
|
|
|
v-model="residue.reason">
|
|
|
</el-input>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
|
|
@@ -182,9 +182,24 @@
|
|
|
<div><p>附件上传</p></div>
|
|
|
</div>
|
|
|
<hr>
|
|
|
- <!-- <div class="makerfundDetailsAccessoryBlock">文件</div> -->
|
|
|
- <div class="makerfundDetailsaddMoneyBtn">
|
|
|
- <div class="jia">+</div>添加
|
|
|
+ <div style="display: flex;justify-content: flex-start;">
|
|
|
+ <el-upload
|
|
|
+ class="avatar-uploader"
|
|
|
+ action="#"
|
|
|
+ disabled
|
|
|
+ :show-file-list="false"
|
|
|
+ v-for="(item,index) in this.file" :key="index"
|
|
|
+ >
|
|
|
+ <img v-if="imageUrl" :src="imageUrl" class="avatar">
|
|
|
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <div class="addMoneyBtn" style="position: relative;">
|
|
|
+ <div class="jia">+</div>添加
|
|
|
+ <BeUpload @getFile="getFile" style="position: absolute;left: 0;width: 120px;height: 40px;opacity: 0;" class="uploadPic" :navName="'上传封面'" :accept="accept"></BeUpload>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
@@ -194,26 +209,48 @@
|
|
|
<div class="baseBtn">
|
|
|
<div class="blockWidth">
|
|
|
<el-button type="primary">生成表单</el-button>
|
|
|
- <el-button type="primary">提交</el-button>
|
|
|
+ <el-button type="primary" @click="uploadData">提交</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <!-- 提交对话框开始 -->
|
|
|
+ <el-dialog
|
|
|
+ title="提示"
|
|
|
+ :visible.sync="submitHint"
|
|
|
+ width="600px"
|
|
|
+ class="projectApplicationfundAddDialog"
|
|
|
+ :before-close="init">
|
|
|
+ <div class="addDialogLogo">LOGO</div>
|
|
|
+ <div class="deleteContent">确定提交?</div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitAll" class="btn5">确认提交</el-button>
|
|
|
+ <el-button @click="init" class="btn5" style="background:#cccccc" size="small">取消</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 提交对话框结束 -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import BeUpload from "../../components/tool/beUpload.vue";
|
|
|
+
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ BeUpload,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
- textarea:'',
|
|
|
- value: '',
|
|
|
- input:'',
|
|
|
+ accept:"*",
|
|
|
+ submitHint:false, //提交按钮
|
|
|
+
|
|
|
+ imageUrl: require('../../assets/img/cocoClass.png'),
|
|
|
+ file:[],
|
|
|
selects:{
|
|
|
projectName:'',
|
|
|
projectType:''
|
|
|
},
|
|
|
projectFilter:[], //项目名称
|
|
|
projectType:[ //项目类型
|
|
|
-
|
|
|
{
|
|
|
id:1,
|
|
|
name:'个人创客'
|
|
@@ -253,10 +290,31 @@ export default {
|
|
|
remainFund:'',
|
|
|
reason:'' //理由
|
|
|
}
|
|
|
- ],
|
|
|
+ ],
|
|
|
newDirectFundBlock:{ //添加直接经费
|
|
|
directFundData:'',
|
|
|
- directFundSelects:[],
|
|
|
+ directFundSelects:[
|
|
|
+ {
|
|
|
+ value:1,
|
|
|
+ label:'小型仪器设备费'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:2,
|
|
|
+ label:'材料费'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:3,
|
|
|
+ label:'测试化验加工费'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:4,
|
|
|
+ label:'项目协作费'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:5,
|
|
|
+ label:'其他支出'
|
|
|
+ },
|
|
|
+ ],
|
|
|
budget:'', //预算
|
|
|
usedFund:'', //已使用
|
|
|
remainFund:'',
|
|
@@ -298,7 +356,28 @@ export default {
|
|
|
],
|
|
|
newIndirectFundBlock:{ //添加间接经费
|
|
|
indirectFundData:'',
|
|
|
- indirectFundSelects:[],
|
|
|
+ indirectFundSelects:[
|
|
|
+ {
|
|
|
+ value:1,
|
|
|
+ label:'项目成功鉴定费'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:2,
|
|
|
+ label:'参展参赛费'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:3,
|
|
|
+ label:'创客交流活动费'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:4,
|
|
|
+ label:'知识产权事务费'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:5,
|
|
|
+ label:'其他支出'
|
|
|
+ },
|
|
|
+ ],
|
|
|
budget:'', //预算
|
|
|
usedFund:'', //已使用
|
|
|
remainFund:'',
|
|
@@ -316,7 +395,59 @@ export default {
|
|
|
,
|
|
|
}
|
|
|
},
|
|
|
+ computed :{
|
|
|
+ // sum(){
|
|
|
+ // // return 1+1
|
|
|
+ // let addsum=[]
|
|
|
+ // this.directFundBlock.forEach((e,i)=>{
|
|
|
+ // // console.log( e.budget-e.usedFund);
|
|
|
+ // addsum.push(e.budget-e.usedFund)
|
|
|
+ // })
|
|
|
+ // return addsum
|
|
|
+ // },
|
|
|
+ },
|
|
|
methods:{
|
|
|
+ uploadData(){
|
|
|
+ this.submitHint=true;
|
|
|
+ },
|
|
|
+ submitAll(){
|
|
|
+ if(this.selects.projectName=='') return this.$message.error('请选择项目名称')
|
|
|
+ if(this.selects.projectType=='') return this.$message.error('请选择项目类型')
|
|
|
+
|
|
|
+ let num=0;
|
|
|
+ let sum = this.directFundBlock.reduce((per,cur)=>{
|
|
|
+ return per+cur[budget]
|
|
|
+ })
|
|
|
+ console.log(sum);
|
|
|
+ // return
|
|
|
+ let param={
|
|
|
+ uid:this.$store.state.userInfo.userid,
|
|
|
+ cid:this.selects.projectName,
|
|
|
+ type:this.selects.projectType,
|
|
|
+ dir:JSON.stringify(this.directFundBlock),
|
|
|
+ indir:JSON.stringify(this.indirectFundBlock),
|
|
|
+ elseFund:JSON.stringify(this.residue),
|
|
|
+ file:JSON.stringify(this.file)
|
|
|
+ }
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api+'/insertMakerFund',param)
|
|
|
+ .then(res=>{
|
|
|
+ console.log(res);
|
|
|
+ if (res.data==1) {
|
|
|
+ this.$router.push('/makerfund')
|
|
|
+ return this.$message.success('创建成功')
|
|
|
+ }else{
|
|
|
+ this.$message.error('创建失败')
|
|
|
+ }
|
|
|
+ },err=>{
|
|
|
+ console.log(err);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getFile(val) { //上传封面
|
|
|
+ console.log(val);
|
|
|
+ this.file.push(val)
|
|
|
+ this.imageUrl=require("../../assets/img/cocoClass.png")
|
|
|
+ },
|
|
|
getData(){
|
|
|
this.ajax
|
|
|
.get(this.$store.state.api+'/SelectMakerFundSelects',{uid:this.$store.state.userInfo.userid})
|
|
@@ -328,11 +459,20 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
addDirectFund(){
|
|
|
- this.directFundBlock.push(this.newDirectFundBlock)
|
|
|
+ let oldArr={};
|
|
|
+ Object.assign(oldArr,this.newDirectFundBlock)
|
|
|
+ this.directFundBlock.push(oldArr)
|
|
|
+ for(let k in this.newDirectFundBlock) return this.newDirectFundBlock[k]=''
|
|
|
},
|
|
|
addIndirectFund(){
|
|
|
this.indirectFundBlock.push(this.newIndirectFundBlock)
|
|
|
},
|
|
|
+ init(){
|
|
|
+ //重置
|
|
|
+ // this.projectApplicationApply1.addMemberDialog=false
|
|
|
+ this.submitHint=false;
|
|
|
+
|
|
|
+ },
|
|
|
},
|
|
|
mounted(){
|
|
|
this.getData()
|
|
@@ -342,7 +482,107 @@ export default {
|
|
|
|
|
|
<style lang="less">
|
|
|
.makerfundApply{
|
|
|
+ //提交对话框开始
|
|
|
+ .projectApplicationfundAddDialog{
|
|
|
+
|
|
|
+ .el-dialog__header{
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+ .el-dialog{
|
|
|
+ border-radius: 5px;
|
|
|
+ overflow: hidden;
|
|
|
+
|
|
|
+ top: 10%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .deleteContent{
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 22px;
|
|
|
+ color: #000;
|
|
|
+ }
|
|
|
+ .addDialogLogo{
|
|
|
+ width: 60px;
|
|
|
+ height: 30px;
|
|
|
+ border-radius: 5px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ line-height: 30px;
|
|
|
+ background: #f2f2f2;
|
|
|
+ position: absolute;
|
|
|
+ left: 20px; top: 15px;
|
|
|
+ }
|
|
|
+ .el-dialog__header{
|
|
|
+ background: #32455b;
|
|
|
+ }
|
|
|
+ .el-dialog__title{
|
|
|
+ font-size: 18px;
|
|
|
|
|
|
+ color:rgb(246, 247, 246);
|
|
|
+ }
|
|
|
+ .addDialogMid{
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding:0 60px 0 10px;
|
|
|
+ .addDialogTit{
|
|
|
+ display: flex;
|
|
|
+ span{
|
|
|
+ width: 80px;
|
|
|
+ line-height: 40px;
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .addDialogTit1{
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 15px;
|
|
|
+ }
|
|
|
+ .addDialogTit2{
|
|
|
+ margin-top: 10px;
|
|
|
+ font-size: 18px;
|
|
|
+ color: #000;
|
|
|
+ text-indent: 2em;
|
|
|
+ }
|
|
|
+ .addDialogCon{
|
|
|
+ margin-top: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .dialog-footer{
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ .btn5{
|
|
|
+ height: 40px;
|
|
|
+ font-size: 16px;
|
|
|
+ background: #0e72e6;
|
|
|
+ width: 200px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //提交对话框结束
|
|
|
+
|
|
|
+ .avatar-uploader .el-upload {
|
|
|
+ border: 1px dashed #d9d9d9;
|
|
|
+ border-radius: 6px;
|
|
|
+ cursor: pointer;
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ // .avatar-uploader .el-upload:hover {
|
|
|
+ // border-color: #409EFF;
|
|
|
+ // }
|
|
|
+ .avatar-uploader-icon {
|
|
|
+ font-size: 28px;
|
|
|
+ color: #8c939d;
|
|
|
+ width: 178px;
|
|
|
+ height: 178px;
|
|
|
+ line-height: 178px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .avatar {
|
|
|
+ width: 178px;
|
|
|
+ height: 178px;
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
.Apply1{
|
|
|
height: 45px;
|
|
|
width: 100%;
|