<template>
	<div>
		<div class="crumbs">
			<el-breadcrumb separator="/">
				<el-breadcrumb-item>
					<i class="el-icon-lx-calendar"></i> Manuscript Accepted
				</el-breadcrumb-item>
			</el-breadcrumb>
		</div>
		<div class="art_state_text">
			<p>
				Dear editor, thank you for your hard work. Please complete the manuscript information before entering the
				production process. The manuscript information will bring into correspondence with Typesetting Software.
			</p>
		</div>
		<div class="container_state" v-loading="loading">
			<el-row :gutter="30">
				<el-col :span="15">

					<div class="art_state_">
						<div class="art_state_message">
							<div class="art_state_message_id">
								ID : <b style="margin-right: 60px;">{{form.accept_sn}}</b>
								Status : <b>{{articleState}}</b>
							</div>
							<h3>Basic information</h3>
							<p>
								<font>Title :</font><b>{{form.title}}</b>
							</p>
							<p>
								<font>Type :</font><b>{{myType}}</b>
							</p>
							<p v-show="form.type=='A'">
								<font>Ethical Approval :</font><b>{{form.approval?'Yes':'No'}}</b>
							</p>
							<p>
								<font>Journal :</font><b>{{journal_me}}</b>
							</p>
							<p v-if="form.special_num > 0">
								<font>Special Issues :</font><b>{{ form.special_title }}</b>
							</p>
							<p>
								<font>Major :</font><b>{{form.major}}</b>
							</p>
							<el-collapse v-model="activeNames" class="auth_colla">
								<el-collapse-item :title="authorList_name" name="1">
									<div v-for="(item, index) in form.authorList" class="auth_mess">
										<h4 style="font-weight: bolder;">
											<img src="../../assets/img/state_one.png" v-if="item.isSuper" style="width: 15px;margin: 0 2px 0 0;vertical-align: text-bottom;">
											{{item.firstname}} {{item.lastname}} {{item.isSuper?'#':''}}{{item.isReport?'*':''}}
										</h4>
										<div>
											<p v-if="item.email">
												<img src="../../assets/img/state_email.png" v-if="item.isReport" style="width: 14px;margin: 0 8px 0 0;vertical-align: text-bottom;">
												<font>Email : </font>{{item.email}}
											</p>
											<p v-if="item.orcid">
												<font>ORCID iD : </font>{{item.orcid}}
											</p>
											<p>
												<font>First author : </font>
												<b v-if="item.isSuper">Yes</b>
												<b v-if="!item.isSuper">No</b>
											</p>
											<p>
												<font>Corresponding Author :</font>
												<b v-if="item.isReport">Yes</b>
												<b v-if="!item.isReport">No</b>
											</p>
											<p v-if="item.address">
												<font>Address : </font>{{item.address}}
											</p>
											<p v-if="item.company">
												<font>Affiliation : </font>{{item.company}}
											</p>
											<p v-if="item.department">
												<font>Department : </font>{{item.department}}
											</p>
											<p v-if="item.title">
												<font>Title : </font>{{item.title}}
											</p>
											<p v-if="item.country">
												<font>Country : </font>{{item.country}}
											</p>
										</div>
									</div>
								</el-collapse-item>
							</el-collapse>
							<p>
								<font>Abstract :</font><b>{{form.abstrart}}</b>
							</p>
							<p>
								<font>KeyWords :</font><b>{{form.keyWords}}</b>
							</p>
							<p v-if="form.fund">
								<font>Fund :</font><b>{{form.fund}}</b>
							</p>
						</div>


						<div class="art_file">
							<h3 style="margin-bottom: 20px;">Files</h3>
							<h4 v-if="coverLetterFileList">Cover letter : </h4>
							<p v-if="coverLetterFileList">
								<a v-for="item in coverLetterFileList" :href="mediaUrl + item.file_url">
									<img src="../../assets/img/icon_0.png">
									<span>
										<font>Uploader : </font>{{item.username}}
										<i><i class="el-icon-time"></i>{{formatDate(item.ctime)}}</i>
									</span>
									<i class="el-icon-download download"></i>
								</a>
							</p>
							<br clear="both" v-if="coverLetterFileList">
							<h4 v-if="picturesAndTablesFileList">Figures : </h4>
							<p v-if="picturesAndTablesFileList">
								<a v-for="item in picturesAndTablesFileList" :href="mediaUrl + item.file_url">
									<img src="../../assets/img/icon_0.png">
									<span>
										<font>Uploader : </font>{{item.username}}
										<i><i class="el-icon-time"></i>{{formatDate(item.ctime)}}</i>
									</span>
									<i class="el-icon-download download"></i>
								</a>
							</p>
							<br clear="both" v-if="picturesAndTablesFileList">
							<h4 v-if="totalpageFileList">Title page : </h4>
							<p v-if="totalpageFileList">
								<a v-for="item in totalpageFileList" :href="mediaUrl + item.file_url">
									<img src="../../assets/img/icon_0.png">
									<span>
										<font>Uploader : </font>{{item.username}}
										<i><i class="el-icon-time"></i>{{formatDate(item.ctime)}}</i>
									</span>
									<i class="el-icon-download download"></i>
								</a>
							</p>
							<br clear="both" v-if="totalpageFileList">
							<h4>Manuscirpt : </h4>
							<p>
								<a v-for="item in manuscirptFileList" :href="mediaUrl + item.file_url">
									<img src="../../assets/img/icon_0.png">
									<span>
										<font>Uploader : </font>{{item.username}}
										<i><i class="el-icon-time"></i>{{formatDate(item.ctime)}}</i>
									</span>
									<i class="el-icon-download download"></i>
								</a>
							</p>
							<br clear="both">
						</div>
						<!-- 审稿人列表 -->
						<div class="art_revlist">
							<h3>Manuscript reviewer list</h3>
							<div class="rev_list">
								<p v-for="(item,index) in review_Data">
									{{index+1}} . {{item.reviewer}}
									<a @click="showdetail(item.art_rev_id)">
										<i class="el-icon-tickets"></i>Feedback
									</a>
								</p>
								<p v-if="review_Data==undefined" style="color: #888;margin-bottom: 40px;">
									No reviewer
								</p>
							</div>
						</div>

						<!-- 编辑上传文件列表 -->
						<div class="art_file">
							<h3 style="margin-bottom: 20px;">Editor Files</h3>
							<p v-if="proposalsFileList">
								<a v-for="(item,index) in proposalsFileList" :href="mediaUrl + item.proposal_file">
									<img src="../../assets/img/icon_0.png">
									<span>
										File{{index+1}}
										<i><i class="el-icon-time"></i>{{formatDate(item.ap_ctime)}}</i>
									</span>
									<i class="el-icon-download download"></i>
								</a>
							</p>
							<p v-if="proposalsFileList==''" style="color: #888;margin-left: 3px;">
								No files
							</p>
							<br clear="both" v-if="proposalsFileList">
						</div>
					</div>
					<div class="art_caozuo_">
						<div class="art_state_upagain" style="margin-bottom: 0;border-color: #eef6fb;padding-bottom: 0;">
							TMR Publishing Group journals follow a double blind peer review process to ensure impartial editorial
							decision-making. The author should not include identifying information the main manuscript as this must remain
							blinded. However, there are still some authors who expose information to reviewers. Here we ask the editor to
							identify such a manuscript, separate the two parts and re-upload them. If you need to do so, please
							<span @click="againVisble=true"> click here</span>.
							If you need not, please ignore this step.

						</div>
						
						<div class="art_state_btn">
							<div class="btn_remarks" @click="testedit" style="right: 0">
								<i class="el-icon-edit"></i>
								Remarks
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="9">
					<timetalk :talkMsgs="talkMsgs" :msgform="msgform"></timetalk>
					<timeaxis :prossMsgs="prossMsgs" :form="form"></timeaxis>
				</el-col>
			</el-row>
		</div>

		<el-dialog title="Upload file" :visible.sync="againVisble" width="500px">
			<el-upload class="upload-demo" :action="upload_again" accept=".doc, .docx, .rar, .zip" name="manuscirpt"
			 :before-upload="beforeupload_again" :on-error="uperr_again" :on-success="upSuccess_again" :limit="1" :on-exceed="alertlimit_again"
			 :on-remove="removefilemanuscirpt" ref="again_upload">
				<div class="el-upload__text" style="padding:8px 5px;">
					<em>Click Upload</em>
				</div>
				<div class="el-upload__tip" slot="tip">Only word and compressed files can be uploaded(.doc,.docx,.rar,.zip)</div>
			</el-upload>
			<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="saveAgain">Save</el-button>
			</span>
		</el-dialog>
		<el-dialog title="Remarks" :visible.sync="editbox" width="500px">
			<el-form ref="remark" :model="remark" label-width="80px">
				<el-form-item label="Content :">
					<el-input type="textarea" rows="5" v-model="remark.content"></el-input>
				</el-form-item>
			</el-form>
			<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="saveRemark">Save</el-button>
			</span>
		</el-dialog>
		<el-dialog title="Feedback questionnaire" :visible.sync="dialogFormVisible" width="750px">
			<el-form :model="questionform" ref="question" label-width="300px" label-position="top">
				<el-divider content-position="center">REFEREE'S ASSESSMENT</el-divider>
				<el-row :gutter="24">
					<el-col :span="12">
						<el-form-item label="1.Originality of the topic">
							<el-radio-group v-model="questionform.qu1">
								<el-radio :label="1">Excellent</el-radio>
								<el-radio :label="2">Good</el-radio>
								<el-radio :label="3">Fair</el-radio>
								<el-radio :label="4">Poor</el-radio>
							</el-radio-group>
						</el-form-item>
					</el-col>
					<el-col :span="12">
						<el-form-item label="2.Importance in its Field">
							<el-radio-group v-model="questionform.qu3">
								<el-radio :label="1">Excellent</el-radio>
								<el-radio :label="2">Good</el-radio>
								<el-radio :label="3">Fair</el-radio>
								<el-radio :label="4">Poor</el-radio>
							</el-radio-group>
						</el-form-item>
					</el-col>
					<el-col :span="12">
						<el-form-item label="3.Does the manuscript fall within the aim and scope of the journal?">
							<el-radio-group v-model="questionform.qu6">
								<el-radio :label="1">Excellent</el-radio>
								<el-radio :label="2">Good</el-radio>
								<el-radio :label="3">Fair</el-radio>
								<el-radio :label="4">Poor</el-radio>
							</el-radio-group>
						</el-form-item>
					</el-col>
					<el-col :span="12">
						<el-form-item label="4.English language">
							<el-radio-group v-model="questionform.qu8">
								<el-radio :label="1">Excellent</el-radio>
								<el-radio :label="2">Good</el-radio>
								<el-radio :label="3">Fair</el-radio>
								<el-radio :label="4">Poor</el-radio>
							</el-radio-group>
						</el-form-item>
					</el-col>
					<el-col :span="12">
						<el-form-item label="5.Readily Understandable">
							<el-radio-group v-model="questionform.qu5">
								<el-radio :label="1">Excellent</el-radio>
								<el-radio :label="2">Good</el-radio>
								<el-radio :label="3">Fair</el-radio>
								<el-radio :label="4">Poor</el-radio>
							</el-radio-group>
						</el-form-item>
					</el-col>
					<el-col :span="12">
						<el-collapse>
							<el-form-item label="6.Does the title represent manuscript's contents?">
								<el-col :span="8">
									<el-radio-group v-model="questionform.qu9">
										<el-radio :label="true">Yes</el-radio>
										<el-radio :label="false">No</el-radio>
									</el-radio-group>
								</el-col>
								<el-col :span="16">
									<el-collapse-item name="1" style="margin-top: -10px;">
										<template slot="title">
											<i class="el-icon-edit"></i>Comments/ Suggestions
										</template>
										<el-input type="textarea" placeholder="please input content" v-model="questionform.qu9contents" :rows="4"></el-input>
									</el-collapse-item>
								</el-col>
							</el-form-item>
						</el-collapse>
					</el-col>
				</el-row>


				<el-collapse>
					<el-form-item label="7.Is the Abstract accurate and concise?">
						<el-col :span="4">
							<el-radio-group v-model="questionform.qu10">
								<el-radio :label="true">Yes</el-radio>
								<el-radio :label="false">No</el-radio>
							</el-radio-group>
						</el-col>
						<el-col :span="20">
							<el-collapse-item name="2" style="margin-top: -10px;">
								<template slot="title">
									<i class="el-icon-edit"></i>Comments/ Suggestions
								</template>
								<el-input type="textarea" placeholder="please input content" v-model="questionform.qu10contents" :rows="4"></el-input>
							</el-collapse-item>
						</el-col>
					</el-form-item>
					<el-form-item label="8.Are the approach/ methods properly described?">
						<el-col :span="4">
							<el-radio-group v-model="questionform.qu11">
								<el-radio :label="true">Yes</el-radio>
								<el-radio :label="false">No</el-radio>
							</el-radio-group>
						</el-col>
						<el-col :span="20">
							<el-collapse-item name="3" style="margin-top: -10px;">
								<template slot="title">
									<i class="el-icon-edit"></i>Comments/ Suggestions
								</template>
								<el-input type="textarea" placeholder="please input content" v-model="questionform.qu11contents" :rows="4"></el-input>
							</el-collapse-item>
						</el-col>
					</el-form-item>
					<el-form-item label="9.Are the conclusions and interpretations sound?">
						<el-col :span="4">
							<el-radio-group v-model="questionform.qu12">
								<el-radio :label="true">Yes</el-radio>
								<el-radio :label="false">No</el-radio>
							</el-radio-group>
						</el-col>
						<el-col :span="20">
							<el-collapse-item name="4" style="margin-top: -10px;">
								<template slot="title">
									<i class="el-icon-edit"></i>Comments/ Suggestions
								</template>
								<el-input type="textarea" placeholder="please input content" v-model="questionform.qu12contents" :rows="4"></el-input>
							</el-collapse-item>
						</el-col>
					</el-form-item>
					<el-form-item label="10.Are the references properly cited?">
						<el-col :span="4">
							<el-radio-group v-model="questionform.qu13">
								<el-radio :label="true">Yes</el-radio>
								<el-radio :label="false">No</el-radio>
							</el-radio-group>
						</el-col>
						<el-col :span="20">
							<el-collapse-item name="5" style="margin-top: -10px;">
								<template slot="title">
									<i class="el-icon-edit"></i>Comments/ Suggestions
								</template>
								<el-input type="textarea" placeholder="please input content" v-model="questionform.qu13contents" :rows="4"></el-input>
							</el-collapse-item>
						</el-col>
					</el-form-item>

					<el-divider content-position="center">REFEREE'S RECOMMENDATIONS</el-divider>
					<el-form-item label="Overall the Paper is Rated">
						(Poor------------------------Excellent)
						<br />
						<el-radio-group v-model="questionform.rated" size="small">
							<el-radio-button label="1"></el-radio-button>
							<el-radio-button label="2"></el-radio-button>
							<el-radio-button label="3"></el-radio-button>
							<el-radio-button label="4"></el-radio-button>
							<el-radio-button label="5"></el-radio-button>
							<el-radio-button label="6"></el-radio-button>
							<el-radio-button label="7"></el-radio-button>
							<el-radio-button label="8"></el-radio-button>
							<el-radio-button label="9"></el-radio-button>
							<el-radio-button label="10"></el-radio-button>
						</el-radio-group>
						<span style="margin-left: 20px;">>Your score:{{questionform.rated}}</span>
					</el-form-item>
					<el-form-item label="REFEREE'S RECOMMENDATIONS" prop="recommend">
						<el-radio-group v-model="questionform.recommend" style="line-height: 30px;">
							<el-radio :label="1">Accept with minor revision</el-radio>
							<br />
							<el-radio :label="2">Accept with major revision</el-radio>
							<br />
							<el-radio :label="3">Reject in current form, but may be resubmitted</el-radio>
							<br />
							<el-radio :label="4">Reject, with no resubmission</el-radio>
						</el-radio-group>
					</el-form-item>
					<el-form-item label="OTHER SPECIFIC CRITICISMS">
						<el-radio-group v-model="questionform.other" style="line-height: 30px;">
							<el-radio :label="1">Imperfect style</el-radio>
							<br />
							<el-radio :label="2">Too long</el-radio>
							<br />
							<el-radio :label="3">References incorrectly presented</el-radio>
							<br />
							<el-radio :label="4">Typographical and Grammatical errors</el-radio>
						</el-radio-group>
					</el-form-item>
					<el-form-item label="Comments for the Authors">
						<el-input type="textarea" placeholder="please input content" v-model="questionform.comment" :rows="8"></el-input>
					</el-form-item>
					<el-form-item label="Confidential Comments to the Editor">
						<el-input type="textarea" placeholder="please input content" v-model="questionform.confident" :rows="8"></el-input>
					</el-form-item>
					<el-form-item label="Please choose disclose your name or remain anonymous.">
						<el-radio-group v-model="questionform.is_anonymous" style="line-height: 30px;">
							<el-radio :label="0">Disclose name</el-radio>
							<br />
							<el-radio :label="1">Remain anonymous</el-radio>
						</el-radio-group>
						<p style="line-height: 20px;color: #aaa;font-size: 13px;margin: 12px 0 0 0;">
							If you agree to disclose your name, we will acknowledge you by name in the published
							PDF. However, if you prefer to remain anonymous, we will still express our gratitude
							by thanking you as an anonymous reviewer. 
							<br />For example, {{form.title}} would like to thank AAAAAAAA, BBBBBBBB, and other anonymous reviewers for their
							invaluable contributions to the peer review process of this paper.
						</p>
					</el-form-item>
				</el-collapse>
			</el-form>
		</el-dialog>
	</div>
</template>

<script>
	import timetalk from './time_talk'
	import timeaxis from './time_axis'
	export default {
		components: {
			timetalk,
			timeaxis
		},
		data() {
			return {
				baseUrl: this.Common.baseUrl,
				mediaUrl: this.Common.mediaUrl,
				items: '',
				loading: false,
				editVisible: false,
				editbox: false,
				reverse: false,
				dialogFormVisible: false,
				Detailvisible: false,
				againVisble: false,
				questionform: {},
				coverLetterFileList: [],
				picturesAndTablesFileList: [],
				totalpageFileList: [],
				manuscirptFileList: [],
				proposalsFileList: [],
				authorList_name: '',
				review_Data: [],
				Total_review: 0,
				msgform: {
					username: localStorage.getItem('U_name'),
					article_id: this.$route.query.id,
					ad_content: ''
				},
				query_review: {
					articleId: this.$route.query.id,
					pageIndex: 1,
					pageSize: 10
				},
				editform: {
					editname: localStorage.getItem('U_name'),
					articleId: this.$route.query.id,
					state: 0,
					trsjournal: 0,
					editormsg: ''
				},
				remark: {
					articleId: this.$route.query.id,
					content: ''
				},
				repeform: {
					articleId: this.$route.query.id,
					repefen: '',
					zipurl: ''
				},
				activeNames: [],
				journals: [],
				items: [{
						state: 0,
						title: this.$t('artstate.state0'),
						disabled: true
					},
					{
						state: 1,
						title: this.$t('artstate.state1')
					},
					{
						state: 2,
						title: this.$t('artstate.state2'),
					},
					{
						state: 3,
						title: this.$t('artstate.state3')
					},
					{
						state: 4,
						title: this.$t('artstate.state4')
					},
					{
						state: 6,
						title: this.$t('artstate.state6')
					},
					{
						state: 5,
						title: this.$t('artstate.state5')
					},
				],
				form: {
					articleId: this.$route.query.id,
					journal: '',
					journalname: '',
					username: '',
					title: '',
					accept_sn: '',
					abstrart: '',
					keyWords: '',
					fund: '',
					type: '',
					major: '',
					approval: false,
					repetition: '',
					manuscirpt: '',
					remarks: '',
					state: '',
					ctime: '',
					authorList: [],
					transList: []
				},
				prossMsgs: [],
				talkMsgs: []
			};
		},
		created: function() {
			this.initarticle();
			this.initselect();
			this.initFileList();
			this.reviewdate();
		},
		computed: {
			myType: function() {
				let frag = '';
				switch (this.form.type) {
					case "A":
						frag = 'ARTICLE';
						break;
					case 'B':
						frag = 'REVIEW';
						break;
					case 'C':
						frag = 'CASE REPORT';
						break;
					case 'P':
						frag = 'RESEARCH PROPOSAL';
						break;
					case 'N':
						frag = 'NEWS';
						break;
					case 'T':
						frag = 'COMMENT';
						break;
					case 'CT':
						frag = 'CORRECTION';
						break;
					case 'HT':
						frag = 'HYPOTHESIS';
						break;
					case 'PF':
						frag = 'PREFACE';
						break;
					case 'ET':
						frag = 'EDITORIAL';
						break;
					case 'RP':
						frag = 'REPORT';
						break;
					case 'LR':
						frag = 'LETTER';
						break;
					case 'EF':
						frag = 'EMPIRICAL FORMULA';
						break;
					case 'EM':
						frag = 'EVIDENCE-BASED MEDICINE';
						break;
					case 'EC':
						frag = 'EXPERT CONSENSUS';
						break;
					case 'LTE':
						frag = 'LETTER TO EDITOR';
						break;
					case 'QI':
						frag = 'QUESTIONNAIRE INVESTIGATION';
						break;
					case 'PT':
						frag = 'PROTOCOL';
						break;
					case 'CS':
						frag = 'CASE SERIES';
						break;
					case 'RT':
						frag = 'RETRACTION';
						break;
					case 'MR':
						frag = 'MINI REVIEW';
						break;
					default:
						frag = 'OTHERS';
				}
				return frag;
			},
			upload_zip: function() {
				return this.baseUrl + 'api/Article/up_file/type/repezip';
			},
			upload_again: function() {
				return this.baseUrl + 'api/Article/up_file/type/manuscirpt';
			},
			journal_me: function() {
				var frag = this.form.journalname;
				if (this.form.special_num > 0) {
					frag += "(Special Issues)";
				}
				return frag;
			},
			articleState: function() {
				let str = '';
				switch (this.form.state) {
					case 0:
						str = this.$t('artstate.state0');
						break;
					case 1:
						str = this.$t('artstate.state1');
						break;
					case 2:
						str = this.$t('artstate.state2');
						break;
					case 3:
						str = this.$t('artstate.state3');
						break;
					case 4:
						str = this.$t('artstate.state4');
						break;
					case 5:
						str = this.$t('artstate.state5');
						break;
					case 6:
						str = this.$t('artstate.state6');
						break;
				}
				return str;
			}
		},
		methods: {
			//弹出编辑框
			testedit() {
				this.editbox = true;
			},
			statetostr(mystate) {
				let str = '';
				switch (mystate) {
					case -1:
						str = 'Manuscript Submission';
						break;
					case 0:
						str = this.$t('artstate.state0');
						break;
					case 1:
						str = this.$t('artstate.state1');
						break;
					case 2:
						str = this.$t('artstate.state2');
						break;
					case 3:
						str = this.$t('artstate.state3');
						break;
					case 4:
						str = this.$t('artstate.state4');
						break;
					case 5:
						str = this.$t('artstate.state5');
						break;
					case 6:
						str = this.$t('artstate.state6');
						break;
				}
				return str;
			},
			// 查看详情
			man_detal() {
				this.Detailvisible = true
			},
			//修改查重mark状态
			saveRemark() {
				this.loading = true;
				this.$api.post('api/Article/editArticleRemark', this.remark)
					.then(res => {
						this.loading = false;
						this.editbox = false;
						this.$message.success('success');
						this.initarticle();
					});
			},
			saveRepe() {
				if (this.repeform.zipurl == '') {
					this.$message.error('please upload zip');
					return false;
				}
				this.loading = true;
				this.$api.post('api/Article/changeRepetition', this.repeform)
					.then(res => {
						this.loading = false;
						this.form.repetition = this.repeform.repefen;
						this.$message.success('success');
					});
			},
			//初始化期刊选项
			initselect() {
				this.$api
					.post('api/Article/getJournal')
					.then((res) => {
						this.journals = res;
					})
					.catch((err) => {
						console.log(err);
					});
			},
			//初始化文章信息
			initarticle() {
				this.$api
					.post('api/Article/getArticleDetail', {
						articleId: this.editform.articleId,
						human: 'editor'
					})
					.then(res => {
						this.form.username = res.article.account;
						this.form.title = res.article.title;
						this.form.journal = res.article.journal_id;
						this.form.journalname = res.article.journalname;
						this.form.abstrart = res.article.abstrart;
						this.form.accept_sn = res.article.accept_sn;
						this.form.keyWords = res.article.keywords;
						this.form.fund = res.article.fund;
						this.form.type = res.article.type;
						this.form.special_num = res.article.special_num;
						this.form.special_title = res.article.special_title;
						this.form.major = res.major;
						this.form.approval = res.article.approval == 1 ? true : false;
						this.form.repetition = res.article.repetition;
						this.form.remarks = res.article.remarks;
						this.repeform.repefen = res.article.repetition;
						this.remark.content = res.article.remarks;
						this.editform.state = this.form.state = res.article.state;
						this.form.ctime = res.article.ctime;
						this.form.transList = res.transfer;
						let back_num = 0
						// 添加投递稿件条目
						res.msg.unshift({
							state_to: -1,
							ctime: res.article.ctime,
							color: '#B5C334',
							icon: 'el-icon-collection-tag',
							ftype: 0,
						});
						for (let i = res.msg.length - 1; i >= 0; i--) {
							if (res.msg[i].state_to == 4 && back_num == 0) {
								res.msg[i].back = 1;
								back_num = 1
							} else {
								res.msg[i].back = 0;
							}
							if (res.msg[i].state_to == 1) {
								res.msg[i].color = '#f75822'
								res.msg[i].icon = 'el-icon-document-checked'
							}
							if (res.msg[i].state_to == 2) {
								res.msg[i].color = '#0ebee1'
								res.msg[i].icon = 'el-icon-document'
							}
							if (res.msg[i].state_to == 3) {
								res.msg[i].color = '#f3170f'
								res.msg[i].icon = 'el-icon-close'
							}
							if (res.msg[i].state_to == 4) {
								res.msg[i].color = '#5a90e1'
								res.msg[i].icon = 'el-icon-edit-outline'
							}
							if (res.msg[i].state_to == 5) {
								res.msg[i].color = '#91cc75'
								res.msg[i].icon = 'el-icon-check'
							}
							if (res.msg[i].state_to == 6) {
								res.msg[i].color = '#27727B'
								res.msg[i].icon = 'el-icon-star-off'
							}
						}
						this.prossMsgs = res.msg;
						let alist = res.authors;
						let alist_name = [];
						for (let i in alist) {
							this.form.authorList.push({
								art_aut_id: alist[i].art_aut_id,
								firstname: alist[i].firstname,
								lastname: alist[i].lastname,
								orcid: alist[i].orcid,
								company: alist[i].company,
								department: alist[i].department,
								title: alist[i].author_title,
								country: alist[i].country,
								email: alist[i].email,
								address: alist[i].address,
								isSuper: alist[i].is_super == 1 ? true : false,
								isReport: alist[i].is_report == 1 ? true : false
							});
							if (i == alist.length - 1) {
								alist_name.push(alist[i].firstname + ' ' + alist[i].lastname)
							} else {
								alist_name.push(alist[i].firstname + ' ' + alist[i].lastname + ' , ')
							}
						}
						this.authorList_name = "Author : " + alist_name.join("");


					})
					.catch(err => {
						console.log(err);
					});

				// 留言板列表
				this.$api
					.post('api/Article/getArticleDialogs', {
						article_id: this.$route.query.id
					})
					.then((res) => {
						this.talkMsgs = res.data.dialogs;
					})
					.catch((err) => {
						console.log(err);
					});
			},

			// 获取编辑列表数据
			reviewdate() {
				this.$api
					.post('api/Article/getReviewerList', this.query_review)
					.then((res) => {
						this.review_Data = res.data;
					})
					.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 = 'Accept';
				} else if (row.state == 4) {
					frag = 'invalid';
				} else if (row.state == 5) {
					frag = 'invitation';
				}
				return frag;
			},

			// 上传文件
			saveAgain() {
				if (this.form.manuscirpt == '') {
					this.$message.error('Manuscirpt is required');
					return false;
				}
				this.loading = true;
				this.$api.post('api/Article/changeArticleFileEditor', this.form)
					.then(res => {
						this.loading = false;
						this.$message.success('success');
						this.againVisble = false
						this.initFileList()
					})
					.catch(err => {
						console.log(err);
					});
			},

			//检验上传文件的格式
			beforeupload_again(file) {

			},
			uperr_again(err) {
				this.$message.error('upload error');
			},
			upSuccess_again(res, file) {
				if (res.code == 0) {
					this.form.manuscirpt = 'manuscirpt/' + res.upurl;
				} else {
					this.$message.error('service error：' + res.msg);
				}
			},
			removefilemanuscirpt(file, fileList) {
				this.form.manuscirpt = '';
			},
			alertlimit_again() {
				this.$message.error('The maximum number of uploaded files has been exceeded');
			},



			// 打分问卷
			showdetail(e) {
				this.questionform = {}
				this.$api.post('api/Reviewer/getQuestion', {
					artrevid: e
				}).then((res) => {
					if (res.code == 0) {
						this.questionform = res.data;
						this.questionform.rev_qu_id = res.data.rev_qu_id;
						this.questionform.qu1 = res.data.qu1;
						this.questionform.qu2 = res.data.qu2;
						this.questionform.qu3 = res.data.qu3;
						this.questionform.qu4 = res.data.qu4;
						this.questionform.qu5 = res.data.qu5;
						this.questionform.qu6 = res.data.qu6;
						this.questionform.qu7 = res.data.qu7;
						this.questionform.qu8 = res.data.qu8;
						this.questionform.qu9 = res.data.qu9 == 0 ? false : true;
						this.questionform.qu9contents = res.data.qu9_contents;
						this.questionform.qu10 = res.data.qu10 == 0 ? false : true;
						this.questionform.qu10contents = res.data.qu10_contents;
						this.questionform.qu11 = res.data.qu11 == 0 ? false : true;
						this.questionform.qu11contents = res.data.qu11_contents;
						this.questionform.qu12 = res.data.qu12 == 0 ? false : true;
						this.questionform.qu12contents = res.data.qu12_contents;
						this.questionform.qu13 = res.data.qu13 == 0 ? false : true;
						this.questionform.qu13contents = res.data.qu13_contents;
						this.questionform.qu14 = res.data.qu14 == 0 ? false : true;
						this.questionform.qu14contents = res.data.qu14_contents;
						this.questionform.qu15 = res.data.qu15 == 0 ? false : true;
						this.questionform.qu15contents = res.data.qu15_contents;
						this.questionform.rated = res.data.rated;
						this.questionform.recommend = res.data.recommend;
						this.questionform.other = res.data.other;
						this.questionform.confident = res.data.confidential;
						this.questionform.comment = res.data.comments;
						this.questionform.is_anonymous = res.data.is_anonymous;
					}
				});
				this.dialogFormVisible = true
			},


			//初始化filelist
			initFileList() {
				this.$api
					.post('api/Article/getFilelistByArticleID', {
						articleId: this.form.articleId
					})
					.then(res => {
						this.coverLetterFileList = res.coverLetter;
						this.picturesAndTablesFileList = res.picturesAndTables;
						this.manuscirptFileList = res.manuscirpt;
						this.totalpageFileList = res.totalpage;
					})
					.catch(err => {
						console.log(err);
					});

				// 编辑上传的文件
				this.$api
					.post('api/Article/getArticleProposals', {
						article_id: this.form.articleId
					})
					.then(res => {
						this.proposalsFileList = res.data.proposals;
					})
					.catch(err => {
						console.log(err);
					});
			},

			upSuccess_repezip(res, file) {
				if (res.code == 0) {
					this.repeform.zipurl = 'repezip/' + res.upurl;
				}
			},
			upSuccess_repezip(res, file) {
				if (res.code == 0) {
					this.repeform.zipurl = 'repezip/' + res.upurl;
				}
			},
			//超出传送文件个数限制
			alertlimit() {
				this.$message.error('The maximum number of uploaded files has been exceeded');
			},
			getlinkurl(row) {
				return this.mediaUrl + row.file_url;
			},


			removefilerepezip(file, fileList) {
				this.repeform.zipurl = '';
			},
			formatDate(timestamp) {
				var date = new Date(timestamp * 1000); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
				var Y = date.getFullYear() + '-';
				var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
				var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
				var h = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
				var m = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
				var s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
				return Y + M + D + ' ' + h + ':' + m + ':' + s;
			},
		},
	};
</script>
