| | |
| | | <div align="left"> |
| | | |
| | | <div class="btn-line"> |
| | | <el-button type="primary" @click="onSubmit">新建项目</el-button> |
| | | <el-button type="primary" @click="addProject">新建项目</el-button> |
| | | <el-button type="primary" v-if="editShow" @click="editProject">编辑项目</el-button> |
| | | <el-button type="primary" @click="showDetail">查看详情</el-button> |
| | | |
| | | </div> |
| | | |
| | | <el-form label-width="80px" :inline="true" :label-position="labelPosition" :model="formInline" class="form-inline"> |
| | | <el-form-item label="审批人"> |
| | | <el-input v-model="formInline.user" placeholder="审批人"></el-input> |
| | | <el-form-item label="项目名称"> |
| | | <el-input v-model="formInline.name" placeholder="项目名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="活动区域"> |
| | | <el-select v-model="formInline.region" placeholder="活动区域"> |
| | | <el-option label="区域一" value="shanghai"></el-option> |
| | | <el-option label="区域二" value="beijing"></el-option> |
| | | |
| | | <el-form-item label="研究目的"> |
| | | <el-select v-model="formInline.type" placeholder="研究目的"> |
| | | <el-option label="干预性系统评价" value="干预性系统评价"></el-option> |
| | | <el-option label="诊断性系统评价" value="诊断性系统评价"></el-option> |
| | | <el-option label="预后性系统评价" value="预后性系统评价"></el-option> |
| | | <el-option label="相关性系统评价" value="相关性系统评价"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | |
| | | <el-form-item label="项目状态"> |
| | | <el-select v-model="formInline.status" placeholder="项目状态"> |
| | | <el-option label="未开始" value="edit"></el-option> |
| | | <el-option label="进行中" value="working"></el-option> |
| | | <el-option label="已延期" value="delay"></el-option> |
| | | <el-option label="已结束" value="finish"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item > |
| | | <el-button type="primary" @click="query_">查询</el-button> |
| | | <el-button type="info" @click="empty_">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div class="btn-line"> |
| | | <el-button type="primary" @click="onSubmit">查询</el-button> |
| | | <el-button type="info" @click="onSubmit">重置</el-button> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <el-table :data="tableData" style="width: 100%" :row-class-name="tableRowClassName"> |
| | | <el-table-column prop="name" label="项目名称" width="180"> |
| | | <el-table highlight-current-row |
| | | @current-change="tableChange" |
| | | v-loading="loading_table" |
| | | align="center" |
| | | max-height="280" |
| | | :data="tableData" style="width: 100%; " :row-class-name="tableRowClassName"> |
| | | <el-table-column prop="name" label="项目名称" > |
| | | </el-table-column> |
| | | <el-table-column prop="reseachType" label="研究类型" width="180"> |
| | | <el-table-column prop="status" label="当前状态" :formatter="status_"> |
| | | </el-table-column> |
| | | <el-table-column prop="detailCnt" label="服务项目数" width="180"> |
| | | <el-table-column prop="reseachType" label="研究类型" > |
| | | </el-table-column> |
| | | <el-table-column prop="finishCnt" label="已完成项目" width="180"> |
| | | <el-table-column prop="totalCnt" label="服务项目数" > |
| | | </el-table-column> |
| | | <el-table-column prop="delayCnt" label="延期项目" width="180"> |
| | | <el-table-column prop="finishCnt" label="已完成项目" > |
| | | </el-table-column> |
| | | <el-table-column prop="startTime" label="开始时间" width="180"> |
| | | <el-table-column prop="delayCnt" label="延期项目" > |
| | | </el-table-column> |
| | | <el-table-column prop="endTime" label="结束时间" width="180"> |
| | | <el-table-column prop="startTime" label="开始时间" :formatter="dateFormat_"> |
| | | </el-table-column> |
| | | <el-table-column prop="finish" label="是否结束" width="180"> |
| | | <el-table-column prop="endTime" label="结束时间" :formatter="dateFormat_" > |
| | | </el-table-column> |
| | | |
| | | <el-table-column prop="desp" label="项目描述"> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination background :current-page="pagenum" :page-sizes="[10, 15, 20]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" |
| | | <el-pagination |
| | | @current-change="handleCurrentChange" |
| | | background :current-page="pagenum" :page-sizes="[15]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total"> |
| | | </el-pagination> |
| | | |
| | | <el-dialog @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, |
| | | prodetail |
| | | }, |
| | | data() { |
| | | return { |
| | | 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.dialog_1 = false; |
| | | }, |
| | | 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; |
| | | if (this.selected.userId == this.userId) { |
| | | this.editShow = true; |
| | | }else { |
| | | this.editShow = false; |
| | | } |
| | | |
| | | }, |
| | | handleCurrentChange(pageno) { |
| | | this.pagenum = pageno; |
| | | this.query_(); |
| | | }, |
| | | empty_() { |
| | | this.formInline = {}; |
| | | this.query_(); |
| | | }, |
| | | query_() {}, |
| | | getData() { |
| | | query_() { |
| | | this.getData(this.formInline); |
| | | }, |
| | | getData(query) { |
| | | this.loading_table = true; |
| | | let pageno = this.pagenum; |
| | | let url = "/api/scheme/page/" + pageno; |
| | | this.axios.get(url, { |
| | | params: { |
| | | pageSize: this.pagesize |
| | | }, |
| | | |
| | | let params = { |
| | | pageSize: this.pagesize |
| | | }; |
| | | if(this.assign) { |
| | | params.userId = this.userId; |
| | | } |
| | | if(query){ |
| | | params.name = query.name; |
| | | params.status = query.status; |
| | | params.type = query.type; |
| | | } |
| | | this.$axios.get(url, { |
| | | params |
| | | }) |
| | | .then(data_ => { |
| | | console.log(data_); |
| | |
| | | }) |
| | | }, |
| | | tableRowClassName(row, rowIndex) { |
| | | if (rowIndex === 1) { |
| | | return 'warning-row'; |
| | | } else if (rowIndex === 3) { |
| | | if (row.finish) { |
| | | return 'success-row'; |
| | | } else if(row.delay){ |
| | | return 'warning-row'; |
| | | } |
| | | return ''; |
| | | }, |
| | | onSubmit() { |
| | | console.log('submit!'); |
| | | } |
| | | query_(); |
| | | }, |
| | | dateFormat_(row, colum, val ,index) { |
| | | return this.$moment(val).format('YYYY-MM-DD'); |
| | | |
| | | }, |
| | | status_(row, colum, val ,index) { |
| | | if(val == "working") { |
| | | return "进行中"; |
| | | }else if(val == "edit") { |
| | | return "未开始"; |
| | | }else if(val == "delay") { |
| | | return "已延期"; |
| | | }else if(val == "finish") { |
| | | return "已结束"; |
| | | } |
| | | }, |
| | | finishFotmat(row, colum, val ,index) { |
| | | if(val) { |
| | | return "已结束"; |
| | | }else { |
| | | return "进行中"; |
| | | } |
| | | }, |
| | | addProject() { |
| | | this.dialog_1 = true; |
| | | |
| | | }, |
| | | editProject() { |
| | | if(!this.selected || this.selected.status != "edit"){ |
| | | |
| | | this.$message({message:'请选中一条未启动的项目', type: 'warning'}); |
| | | }else { |
| | | this.rowData = { |
| | | id:this.selected.id, |
| | | desp:this.selected.desp, |
| | | name: this.selected.name, |
| | | objective:this.selected.reseachType, |
| | | items:[this.$moment(this.selected.startTime).format('YYYY-MM-DD'),this.$moment(this.selected.endTime).format('YYYY-MM-DD')] |
| | | } |
| | | this.dialog_1 = true; |
| | | } |
| | | |
| | | |
| | | },closeNewProject() { |
| | | this.dialog_1 = false; |
| | | query_(); |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | .btn-line { |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-table .warning-row { |
| | | background: oldlace; |
| | | } |
| | | |
| | | .el-table .success-row { |
| | | background: #f0f9eb; |
| | | } |
| | | </style> |