Browse Source

表单保存loading区分

master
xuhuajiao 2 weeks ago
parent
commit
996918367e
  1. 11
      src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
  2. 12
      src/views/components/category/PreviewForm.vue

11
src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue

@ -181,7 +181,7 @@
</div> </div>
<div slot="footer" class="dialog-footer" style="margin-top: 85px !important;"> <div slot="footer" class="dialog-footer" style="margin-top: 85px !important;">
<!-- <el-button v-if="formIsAddOrEdit==='add' && ((isTitleType === 3 && selectedCategory.arrangeType === 1) || isTitleType === 4 || isTitleType === 6 || (isTitleType === 3 && activeIndex === 1))" type="text" style="width: 84px; border-color: #0348f3; color: #0348f3; " @click="handleAiCategory">AI辅助著录</el-button> --> <!-- <el-button v-if="formIsAddOrEdit==='add' && ((isTitleType === 3 && selectedCategory.arrangeType === 1) || isTitleType === 4 || isTitleType === 6 || (isTitleType === 3 && activeIndex === 1))" type="text" style="width: 84px; border-color: #0348f3; color: #0348f3; " @click="handleAiCategory">AI辅助著录</el-button> -->
<el-button v-if="formIsAddOrEdit==='add'" type="primary" style="width: 140px; " @click="handlerArchivesSubmit(1)">保存并新增下一条</el-button>
<el-button v-if="formIsAddOrEdit==='add'" :loading="addNextBtnLoading" type="primary" style="width: 140px; " @click="handlerArchivesSubmit(1)">保存并新增下一条</el-button>
<el-button :loading="archivesBtnLoading" type="primary" @click="handlerArchivesSubmit(0)">保存</el-button> <el-button :loading="archivesBtnLoading" type="primary" @click="handlerArchivesSubmit(0)">保存</el-button>
</div> </div>
</div> </div>
@ -466,6 +466,7 @@ export default {
data() { data() {
return { return {
archivesBtnLoading: false, archivesBtnLoading: false,
addNextBtnLoading: false,
activeMenuIndex: '1', activeMenuIndex: '1',
formVisible: false, formVisible: false,
formTitle: '项目', formTitle: '项目',
@ -952,8 +953,12 @@ export default {
handlerArchivesSubmitAndAdd() { handlerArchivesSubmitAndAdd() {
this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id, this.quickPaperArcId) this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id, this.quickPaperArcId)
}, },
formLoadingShow(loadingType) {
this.archivesBtnLoading = loadingType
formLoadingShow(loadingType, type = 0) {
if (type === 1) {
this.addNextBtnLoading = loadingType
} else {
this.archivesBtnLoading = loadingType
}
}, },
repeatDataShow(data) { repeatDataShow(data) {
this.repeatVisible = true this.repeatVisible = true

12
src/views/components/category/PreviewForm.vue

@ -1736,12 +1736,12 @@ export default {
if (valid) { if (valid) {
this.addOrUpdateForm.archive_no = originalArchiveNo this.addOrUpdateForm.archive_no = originalArchiveNo
delete this.addOrUpdateForm.id delete this.addOrUpdateForm.id
this.$emit('formLoadingShow', true)
this.$emit('formLoadingShow', true, arcAddType)
// //
if (this.isDesFormType === 'prearchiveLibrary') { if (this.isDesFormType === 'prearchiveLibrary') {
if (this.fileOriginal === null || this.fileOriginal === '') { if (this.fileOriginal === null || this.fileOriginal === '') {
this.$message({ message: '请上传电子原件', type: 'error', offset: 8 }) this.$message({ message: '请上传电子原件', type: 'error', offset: 8 })
this.$emit('formLoadingShow', false)
this.$emit('formLoadingShow', false, arcAddType)
return false return false
} }
// delete this.addOrUpdateForm.fileOriginal // delete this.addOrUpdateForm.fileOriginal
@ -1763,7 +1763,7 @@ export default {
this.crud.refresh() this.crud.refresh()
this.fileOriginal = null this.fileOriginal = null
} }
this.$emit('formLoadingShow', false)
this.$emit('formLoadingShow', false, arcAddType)
}) })
} else if (this.isDesFormType === 'mergeFile') { } else if (this.isDesFormType === 'mergeFile') {
// //
@ -1785,7 +1785,7 @@ export default {
} }
this.$emit('close-dialog') this.$emit('close-dialog')
this.crud.refresh() this.crud.refresh()
this.$emit('formLoadingShow', false)
this.$emit('formLoadingShow', false, arcAddType)
}) })
} else { } else {
// //
@ -1882,7 +1882,7 @@ export default {
this.$message({ message: res.message + ',新增失败', type: 'error', offset: 8 }) this.$message({ message: res.message + ',新增失败', type: 'error', offset: 8 })
this.$emit('close-dialog', parentsId) this.$emit('close-dialog', parentsId)
} }
this.$emit('formLoadingShow', false)
this.$emit('formLoadingShow', false, arcAddType)
}) })
} else { } else {
collectEdit(params).then(res => { collectEdit(params).then(res => {
@ -1894,7 +1894,7 @@ export default {
this.$message({ message: res.message + ',编辑失败', type: 'error', offset: 8 }) this.$message({ message: res.message + ',编辑失败', type: 'error', offset: 8 })
this.$emit('close-dialog', parentsId) this.$emit('close-dialog', parentsId)
} }
this.$emit('formLoadingShow', false)
this.$emit('formLoadingShow', false, arcAddType)
}) })
} }
} }

Loading…
Cancel
Save