12
This commit is contained in:
282
src/components/page/articleReviewer.vue
Normal file
282
src/components/page/articleReviewer.vue
Normal file
@@ -0,0 +1,282 @@
|
||||
<template>
|
||||
<div >
|
||||
<div class="crumbs">
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item>
|
||||
<i class="el-icon-lx-calendar"></i> Manuscript reviewer list
|
||||
</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
<div class="container" v-loading="loading">
|
||||
<div class="handle-box">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
@click="editVisible=true"
|
||||
>Add reviewer</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
stripe
|
||||
class="table"
|
||||
ref="multipleTable"
|
||||
header-cell-class-name="table-header"
|
||||
>
|
||||
<el-table-column type="index" label="No." align="center" width="60"></el-table-column>
|
||||
<!-- <el-table-column prop="art_rev_id" label="ID" align="center" width="60"></el-table-column> -->
|
||||
<el-table-column label="Reviewer" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-badge is-dot :hidden="scope.row.reviewer_act==1?false:true" class="item">
|
||||
{{scope.row.reviewer}}
|
||||
</el-badge>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="country" label="Country" align="center"></el-table-column>
|
||||
<el-table-column prop="company" label="Company" align="center"></el-table-column>
|
||||
<el-table-column :formatter="majorTitle" label="Major" align="center"></el-table-column>
|
||||
<el-table-column prop="field" label="Field" align="center"></el-table-column>
|
||||
<el-table-column :formatter="revstate" label="state" align="center"></el-table-column>
|
||||
<el-table-column label="" width="230" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-tickets"
|
||||
@click="showdetail(scope.row)"
|
||||
>Detail</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination">
|
||||
<el-pagination
|
||||
background
|
||||
layout="total, prev, pager, next"
|
||||
:current-page="query.pageIndex"
|
||||
:page-size="query.pageSize"
|
||||
:total="Total"
|
||||
@current-change="handlePageChange"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog title="add reviewer" :visible.sync="editVisible" width="40%">
|
||||
<el-form ref="editform" :model="editform" label-width="100px">
|
||||
<el-form-item label="state">
|
||||
<el-select
|
||||
v-model="editform.uid"
|
||||
:change="changereviewer()"
|
||||
placeholder="Please select"
|
||||
>
|
||||
<el-option :key="0" label="please select" :value="0"></el-option>
|
||||
<el-option
|
||||
v-for="item in reviewerList"
|
||||
:key="item.user_id"
|
||||
:label="item.account"
|
||||
:value="item.user_id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="Country" v-if="editform.uid != 0">
|
||||
<span>{{reviewer_data.country}}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Company" v-if="editform.uid != 0">
|
||||
<span>{{reviewer_data.company}}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Major" v-if="editform.uid != 0">
|
||||
<span>{{reviewer_data.major_title}}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Field" v-if="editform.uid != 0">
|
||||
<span>{{reviewer_data.field}}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Introduction" v-if="editform.uid != 0">
|
||||
<span>{{reviewer_data.introduction}}</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="editVisible = false">cancel</el-button>
|
||||
<el-button type="primary" @click="saveEdit">save</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
baseUrl: this.Common.baseUrl,
|
||||
query: {
|
||||
articleId: this.$route.query.id,
|
||||
pageIndex: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
editform: {
|
||||
uid: 0,
|
||||
articleId: this.$route.query.id
|
||||
},
|
||||
reviewer_data: {
|
||||
introduction: '',
|
||||
country: '',
|
||||
company: '',
|
||||
major_title: '',
|
||||
field: ''
|
||||
},
|
||||
editVisible: false,
|
||||
tableData: [],
|
||||
reviewerList: [],
|
||||
loading:false,
|
||||
Total: 0
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getdate();
|
||||
this.initreviewerList();
|
||||
},
|
||||
computed: {
|
||||
upload_url: function () {
|
||||
return this.baseUrl + 'api/Reviewer/up_file';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取编辑列表数据
|
||||
getdate() {
|
||||
this.$api
|
||||
.post('api/Article/getReviewerList', this.query)
|
||||
.then((res) => {
|
||||
this.Total = res.totle;
|
||||
this.tableData = res.data;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handlePageChange(val) {
|
||||
this.$set(this.query, 'pageIndex', val);
|
||||
this.getdate();
|
||||
},
|
||||
addReviewer() {
|
||||
alert('sssss');
|
||||
},
|
||||
//初始化审查员列表
|
||||
initreviewerList() {
|
||||
this.$api
|
||||
.post('api/Article/getArticleReviewerList', { articleId: this.query.articleId })
|
||||
.then((res) => {
|
||||
this.reviewerList = res.data;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
//保存添加操作
|
||||
saveEdit() {
|
||||
if (this.editform.uid == 0) {
|
||||
this.$message.error('please select a reviewer');
|
||||
} else {
|
||||
this.loading = true;
|
||||
this.$api
|
||||
.post('api/Article/addArticleReviewer', this.editform)
|
||||
.then((res) => {
|
||||
this.loading = false;
|
||||
if (res.code == 0) {
|
||||
this.$message.success('add success');
|
||||
this.$router.go(0);
|
||||
} else {
|
||||
this.$message.error('add error');
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
},
|
||||
showdetail(row) {
|
||||
if(row.state==4){
|
||||
this.$message.error('Review expired!');
|
||||
}else{
|
||||
this.$router.push({ path: 'articleReviewerDetail', query: { id: row.art_rev_id } });
|
||||
}
|
||||
|
||||
},
|
||||
changereviewer() {
|
||||
if (this.editform.uid !== 0) {
|
||||
this.$api
|
||||
.post('api/Article/getReviewerdetail', { uid: this.editform.uid })
|
||||
.then((res) => {
|
||||
this.reviewer_data.introduction = res.data.introduction;
|
||||
this.reviewer_data.country = res.data.country;
|
||||
this.reviewer_data.company = res.data.company;
|
||||
this.reviewer_data.major_title = res.data.major_title;
|
||||
this.reviewer_data.field = res.data.field;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
},
|
||||
majorTitle(row, column, cellValue, index) {
|
||||
return row.major_title + '(' + row.major_ctitle + ')';
|
||||
},
|
||||
revstate(row, column, cellValue, index) {
|
||||
let frag = '';
|
||||
if (row.state == 0) {
|
||||
frag = 'With reviewer';
|
||||
} else if (row.state == 1) {
|
||||
frag = 'Revision';
|
||||
} else if (row.state == 2) {
|
||||
frag = 'Reject';
|
||||
} else if (row.state == 3) {
|
||||
frag = 'Accepted';
|
||||
} else if (row.state == 4){
|
||||
frag = 'invalid';
|
||||
}
|
||||
return frag;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.handle-box {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.handle-select {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.handle-input {
|
||||
width: 300px;
|
||||
display: inline-block;
|
||||
}
|
||||
.table {
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
}
|
||||
.red {
|
||||
color: #ff0000;
|
||||
}
|
||||
.mr10 {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.table-td-thumb {
|
||||
display: block;
|
||||
margin: auto;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: #f3ca7f;
|
||||
}
|
||||
.el-table .success-row {
|
||||
background: #bcfc9a;
|
||||
}
|
||||
.el-table .normol-row {
|
||||
background: #d8f1c7;
|
||||
}
|
||||
.el-table .red-row {
|
||||
background: #f05555;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user