diff --git a/src/components/page/ReferenceEditor.vue b/src/components/page/ReferenceEditor.vue index 8db9e2b..3535c78 100644 --- a/src/components/page/ReferenceEditor.vue +++ b/src/components/page/ReferenceEditor.vue @@ -136,9 +136,9 @@ - +

现在您可以添加或者修改您的引用文献信息,如果您有引用文献的Doi数据,可以直接复制到Doi输入框,并提交,系统会自动识别您的引用文献,如果您没有Doi数据,也可以打开“Show Content”开关,直接填写您的引用文献内容。

-

There is no Doi data:

+

There is no Doi data:

@@ -151,19 +151,19 @@ --> - + - + - + - + - - + + @@ -252,8 +252,10 @@ title:'', joura:'', dateno:'', - link:'', - p_refer_id:null, // 当前行一行的引用序号 + doilink:'', + pre_p_refer_id:null, // 当前行一行的引用序号, + article_id: null, + p_refer_id: null }, refenceLinkFormrules:{ author:[ @@ -265,8 +267,8 @@ dateno:[ { required: true, message: 'The dateno cannot be empty', trigger: 'blur' }, ], - link:[ - { required: true, message: 'The link cannot be empty', trigger: 'blur' }, + doilink:[ + { required: true, message: 'The doilink cannot be empty', trigger: 'blur' }, ] }, dialogTitle:'' @@ -347,23 +349,36 @@ change(row, optitle){ this.dialogTitle = optitle this.editboxVisible = true - if(row.refer_doi){ - // 有doi - this.refenceForm.refer_doi = row.refer_doi - this.refenceForm.p_refer_id = row.p_refer_id - }else{ - // doi - this.contentVisible = true - } - + this.$nextTick(() => { + if(row.is_web == 0){ + // 有doi row.is_web: 00 + this.refenceForm.refer_doi = row.refer_doi + this.refenceForm.p_refer_id = row.p_refer_id + }else{ + // 无doi row.is_web: 1 + this.contentVisible = true + this.refenceLinkForm.article_id = this.$route.query.id + this.refenceLinkForm.p_refer_id = row.p_refer_id + this.refenceLinkForm.author = row.author + this.refenceLinkForm.title = row.title + this.refenceLinkForm.joura = row.joura + this.refenceLinkForm.dateno = row.dateno + this.refenceLinkForm.doilink = row.doilink + } + }) }, // 取消保存 - cancelSave(){ + cancelSave(){ this.editboxVisible = false // refenceForm - this.$refs['refenceForm'].resetFields(); + this.$refs['refenceForm'].clearValidate(); + this.$refs['refenceForm'].resetFields(); + + this.$refs['refenceLinkForm'].clearValidate(); + this.$refs['refenceLinkForm'].resetFields(); + this.refenceForm.refer_doi = '' this.dialogTitle = '' }, @@ -379,10 +394,25 @@ }, // 编辑无doi editNoneDoi(){ - this.$refs.refenceLinkForm.validate((valid) => { + this.$refs.refenceLinkForm.validate((valid) => { this.addLoading = true if(valid){ - console.log('没有doi编辑情况') + this.$api + .post('api/Preaccept/editReferNotdoi', this.refenceLinkForm) + .then(res => { + if (res.code == 0) { + this.addLoading = false + this.$message.success('successed!') + this.cancelSave() + this.getRefData() + + } else { + this.$message.error(res.msg); + } + }) + .catch(err => { + this.$message.error(err); + }); } }) }, @@ -422,6 +452,27 @@ // 保存新增 saveAdd(){ + if(this.contentVisible){ // 无doi形式 + this.$refs.refenceLinkForm.validate((valid) => { + if(valid){ + this.addLoading = true + this.$api + .post('api/Preaccept/addReferNotdoi', this.refenceLinkForm) + .then(res => { + if (res.code == 0) { + this.addLoading = false + this.$message.success('successed!') + this.editboxVisible = false + this.getRefData() + this.cancelSave() + } + }) + .catch(err => { + this.$message.error(err); + }); + } + }) + }else{ // 有doi形式 this.$refs.refenceForm.validate((valid) => { if(valid){ this.addLoading = true @@ -455,12 +506,13 @@ return false; } }) + } }, beforeupload_manuscirpt(file) { let flieArr = file.name.split(".") let fileSuffix = flieArr[flieArr.length - 1]; console.log(fileSuffix) - console.log(this.upload_manuscirpt,'upload_manuscirpt') + // return false if (fileSuffix != 'xlsx') { this.$message.error('Only excel and compressed files can be uploaded(.xlsx)'); @@ -548,6 +600,10 @@ // this.$refs['refenceForm'].clearValidate() this.editboxVisible = true this.refenceForm.p_refer_id = row.p_refer_id + + this.refenceLinkForm.pre_p_refer_id = row.p_refer_id + this.refenceLinkForm.article_id = this.$route.query.id + this.$nextTick(()=>{ this.$refs['refenceForm'].clearValidate(['refer_doi']); }) @@ -627,8 +683,7 @@ this.$nextTick(()=>{ this.$refs['refenceLinkForm'].clearValidate() this.$refs['refenceForm'].clearValidate() - }) - console.log(newVal) + }) }, // immediate: true, deep: true // 可以深度检测到 person 对象的属性值的变化 diff --git a/src/components/page/articleListEditor_A.vue b/src/components/page/articleListEditor_A.vue index cf340de..2a6ecea 100644 --- a/src/components/page/articleListEditor_A.vue +++ b/src/components/page/articleListEditor_A.vue @@ -1247,15 +1247,22 @@ }, //修改文章状态 saveEdit() { - + const loading33 = this.$loading({ + lock: true, + text: 'Loading...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); this.$api .post('api/Article/editArticleEditor', this.editform) .then(res => { if (res.code == 0) { + loading33.close() this.$message.success('success'); this.editVisible = false; this.getdate(); } else { + loading33.close() this.$message.error(res.msg); } })