| | |
| | | |
| | | <div class="btn-line"> |
| | | <el-button type="primary" @click="addProject">新建项目</el-button> |
| | | <el-button type="primary" @click="editProject">编辑项目</el-button> |
| | | <el-button type="primary" @click="onSubmit">查看详情</el-button> |
| | | <el-button type="primary" v-if="editShow" @click="editProject">编辑项目</el-button> |
| | | <el-button type="primary" @click="showDetail">查看详情</el-button> |
| | | |
| | | </div> |
| | | |
| | |
| | | :total="total"> |
| | | </el-pagination> |
| | | |
| | | <el-dialog @close="Cancel" width="70%" top="50px" :visible.sync="dialog_1" append-to-body> |
| | | <el-dialog v-if="dialog_1" @close="Cancel" width="70%" top="50px" :visible.sync="dialog_1" append-to-body> |
| | | <newProject @closeNewProject="closeNewProject" v-bind:rowData="rowData" ref="newProject_"></newProject> |
| | | </el-dialog> |
| | | <el-dialog v-if="dialog_2" @close="Cancel2" width="70%" top="50px" :visible.sync="dialog_2" append-to-body> |
| | | <prodetail @closeNewProject="closeDetail" v-bind:rowData="detailData" ref="newProject2_"></prodetail> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import newProject from '../components/popup/newProject.vue' |
| | | import prodetail from '../components/popup/prodetail.vue' |
| | | export default { |
| | | |
| | | components: { |
| | | newProject |
| | | newProject, |
| | | prodetail |
| | | }, |
| | | data() { |
| | | return { |
| | | rowData:undefined, |
| | | editShow: true, |
| | | |
| | | loading_table: false, |
| | | query: "", |
| | | rowData:undefined, |
| | | detailData:undefined, |
| | | dialog_1: false, |
| | | dialog_2: false, |
| | | pagenum: 1, |
| | | pagesize: 15, |
| | | total: 0, |
| | | selected: undefined, |
| | | labelPosition: "left", |
| | | tableData: [], |
| | | userId:"", |
| | | assign:undefined, |
| | | formInline: { |
| | | user: '', |
| | | region: '' |
| | |
| | | }, |
| | | mounted() { //组件配置后,页面显示前。用于加载数据 |
| | | this.getData(); |
| | | this.userId = localStorage.getItem('userId'); |
| | | this.assign = localStorage.getItem('assign'); |
| | | }, |
| | | methods: { |
| | | Cancel() { |
| | | this.$refs.newProject_.Cancel(); |
| | | this.dialog_1 = false; |
| | | this.query_(); |
| | | }, |
| | | Cancel2() { |
| | | this.dialog_2 = false; |
| | | this.closeDetail(); |
| | | }, |
| | | closeDetail() { |
| | | this.detailData = undefined; |
| | | }, |
| | | showDetail() { |
| | | if(!this.selected){ |
| | | |
| | | this.$message({message:'请选中一条未启动的项目', type: 'warning'}); |
| | | return; |
| | | } |
| | | this.dialog_2 = true; |
| | | }, |
| | | tableChange(val) { |
| | | this.selected = val; |
| | | this.detailData = val; |
| | | // this.editShow = true; |
| | | if (this.selected.userId == this.userId) { |
| | | this.editShow = true; |
| | | }else { |
| | | this.editShow = false; |
| | | } |
| | | |
| | | }, |
| | | handleCurrentChange(pageno) { |
| | | this.pagenum = pageno; |
| | |
| | | this.loading_table = true; |
| | | let pageno = this.pagenum; |
| | | let url = "/api/scheme/page/" + pageno; |
| | | |
| | | let params = { |
| | | pageSize: this.pagesize |
| | | }; |
| | | |
| | | if(this.assign) { |
| | | params.userId = this.userId; |
| | | } |
| | | if(query){ |
| | | params.name = query.name; |
| | | params.status = query.status; |
| | |
| | | }, |
| | | dateFormat_(row, colum, val ,index) { |
| | | return this.$moment(val).format('YYYY-MM-DD'); |
| | | |
| | | }, |
| | | status_(row, colum, val ,index) { |
| | | if(val == "working") { |
| | |
| | | }, |
| | | addProject() { |
| | | this.dialog_1 = true; |
| | | |
| | | this.rowData = {}; |
| | | }, |
| | | editProject() { |
| | | if(!this.selected || this.selected.status != "edit"){ |
| | | if(!this.selected || this.selected.status == "finish"){ |
| | | |
| | | this.$message({message:'请选中一条未启动的项目', type: 'warning'}); |
| | | this.$message({message:'请选中一条未完成的项目', type: 'warning'}); |
| | | }else { |
| | | this.rowData = { |
| | | id:this.selected.id, |
| | | desp:this.selected.desp, |
| | | name: this.selected.name, |
| | | beginDate: this.selected.beginDate, |
| | | endDate: this.selected.endDate, |
| | | objective:this.selected.reseachType, |
| | | items:[this.$moment(this.selected.startTime).format('YYYY-MM-DD'),this.$moment(this.selected.endTime).format('YYYY-MM-DD')] |
| | | } |
| | |
| | | |
| | | |
| | | },closeNewProject() { |
| | | this.dialog_1 = false |
| | | this.dialog_1 = false; |
| | | query_(); |
| | | }, |
| | | |
| | | } |