<template><template> <el-form ref="activityRefForm" :model="activityRemarkQuery" label-width="20%" :rules="activityRemarkRules"> <el-form-item label="ID"> <div class="detail">{{activityDetail.id}} </div> </el-form-item> <el-form-item label="负责人"> <div class="detail"> {{activityDetail.ownerDO.name}} </div> </el-form-item> <el-form-item label="活动名称"> <div class="detail">{{activityDetail.name}} </div> </el-form-item> <el-form-item label="开始时间"> <div class="detail">{{activityDetail.startDate}} </div> </el-form-item> <el-form-item label="结束时间"> <div class="detail">{{activityDetail.endDate}} </div> </el-form-item> <el-form-item label="活动预算"> <div class="detail">{{activityDetail.cost}} </div> </el-form-item> <el-form-item label="活动描述"> <div class="detail">{{activityDetail.description}} </div> </el-form-item> <el-form-item label="创建时间"> <div class="detail">{{activityDetail.createTime}} </div> </el-form-item> <el-form-item label="创建人"> <div class="detail">{{activityDetail.createByDO.name}} </div> </el-form-item> <el-form-item label="编辑时间"> <div class="detail">{{activityDetail.editTime}} </div> </el-form-item> <el-form-item label="编辑人"> <div class="detail">{{activityDetail.editByDO.name}} </div> </el-form-item> <el-form-item label="填写备注:" prop="noteContent"> <el-input v-model="activityRemarkQuery.noteContent" :rows="8" type="textarea" placeholder="请输入活动备注" /> </el-form-item> <el-form-item> <el-button type="primary" @click="submit()">提交</el-button> <el-button @click="goBack()">返回</el-button> </el-form-item> </el-form> </template> <script> import { doGet, doPost } from '../http/httpRequest'; import { goBack,messageTip } from '../util/util.js'; export default { name : "activityDetail", mounted(){ this.loadActivityDetail(); }, inject : ["reload"], data(){ return { activityRules : {}, activityDetail : { ownerDO : {}, createByDO : {}, editByDO : {} }, activityRemarkQuery : {}, activityRemarkRules : { noteContent : [ { required: true, message: '请输入活动备注', trigger: 'blur' }, { min: 5, max: 255, message: '活动备注长度为5-255字符', trigger: 'blur' } ] } } }, methods : { loadActivityDetail(){ let id = this.$route.params.id; doGet("/api/activity/"+id,{}).then(resp => { if(resp.data.code === 200){ this.activityDetail = resp.data.data; if(!this.activityDetail.ownerDO){ this.activityDetail.ownerDO = {}; } if(!this.activityDetail.createByDO){ this.activityDetail.createByDO = {}; } if(!this.activityDetail.editByDO){ this.activityDetail.editByDO = {}; } this.activityDetail.id = id; } else{ messageTip("网络错误","error"); } }); }, submit(){ this.$refs.activityRefForm.validate((isValid) => { if(isValid){ doPost("/api/activity/remark",{ activityId : this.activityDetail.id, noteContent : this.activityRemarkQuery.noteContent }).then(resp => { if(resp.data.code === 200){ messageTip("提交成功","success"); this.reload(); } else{ messageTip("网络错误","error"); } }) } }); }, goBack, } } </script> <style> </style>
</template> <script> import { doGet, doPost } from '../http/httpRequest'; import { goBack,messageTip } from '../util/util.js'; export default { name : "activityDetail", mounted(){ this.loadActivityDetail(); }, inject : ["reload"], data(){ return { activityRules : {}, activityDetail : { ownerDO : {}, createByDO : {}, editByDO : {} }, activityRemarkQuery : {}, activityRemarkRules : { noteContent : [ { required: true, message: '请输入活动备注', trigger: 'blur' }, { min: 5, max: 255, message: '活动备注长度为5-255字符', trigger: 'blur' } ] } } }, methods : { loadActivityDetail(){ let id = this.$route.params.id; doGet("/api/activity/"+id,{}).then(resp => { if(resp.data.code === 200){ this.activityDetail = resp.data.data; if(!this.activityDetail.ownerDO){ this.activityDetail.ownerDO = {}; } if(!this.activityDetail.createByDO){ this.activityDetail.createByDO = {}; } if(!this.activityDetail.editByDO){ this.activityDetail.editByDO = {}; } this.activityDetail.id = id; } else{ messageTip("网络错误","error"); } }); }, submit(){ this.$refs.activityRefForm.validate((isValid) => { if(isValid){ doPost("/api/activity/remark",{ activityId : this.activityDetail.id, noteContent : this.activityRemarkQuery.noteContent }).then(resp => { if(resp.data.code === 200){ messageTip("提交成功","success"); this.reload(); } else{ messageTip("网络错误","error"); } }) } }); }, goBack, } } </script> <style> </style><el-form ref="activityRefForm" :model="activityRemarkQuery" label-width="20%" :rules="activityRemarkRules"> <el-form-item label="ID"> <div class="detail">{{activityDetail.id}} </div> </el-form-item> <el-form-item label="负责人"> <div class="detail"> {{activityDetail.ownerDO.name}} </div> </el-form-item> <el-form-item label="活动名称"> <div class="detail">{{activityDetail.name}} </div> </el-form-item> <el-form-item label="开始时间"> <div class="detail">{{activityDetail.startDate}} </div> </el-form-item> <el-form-item label="结束时间"> <div class="detail">{{activityDetail.endDate}} </div> </el-form-item> <el-form-item label="活动预算"> <div class="detail">{{activityDetail.cost}} </div> </el-form-item> <el-form-item label="活动描述"> <div class="detail">{{activityDetail.description}} </div> </el-form-item> <el-form-item label="创建时间"> <div class="detail">{{activityDetail.createTime}} </div> </el-form-item> <el-form-item label="创建人"> <div class="detail">{{activityDetail.createByDO.name}} </div> </el-form-item> <el-form-item label="编辑时间"> <div class="detail">{{activityDetail.editTime}} </div> </el-form-item> <el-form-item label="编辑人"> <div class="detail">{{activityDetail.editByDO.name}} </div> </el-form-item> <el-form-item label="填写备注:" prop="noteContent"> <el-input v-model="activityRemarkQuery.noteContent" :rows="8" type="textarea" placeholder="请输入活动备注" /> </el-form-item> <el-form-item> <el-button type="primary" @click="submit()">提交</el-button> <el-button @click="goBack()">返回</el-button> </el-form-item> </el-form>
本文转载自: https://blog.csdn.net/2201_75960169/article/details/136148264
版权归原作者 旧约Alatus 所有, 如有侵权,请联系我们删除。
版权归原作者 旧约Alatus 所有, 如有侵权,请联系我们删除。