|
@@ -112,12 +112,12 @@ export default {
|
|
|
this.permissionBtn.isShowBtn('etaTablePermission','etaTable_customize_data_save')
|
|
|
}
|
|
|
},
|
|
|
- beforeRouteLeave(to,from,next){
|
|
|
- if(to.path!='/addMixedSheet'){
|
|
|
- this.markFinishStatus()
|
|
|
- }
|
|
|
- next()
|
|
|
- },
|
|
|
+ // beforeRouteLeave(to,from,next){
|
|
|
+ // if(to.path!='/addMixedSheet'){
|
|
|
+ // this.markFinishStatus()
|
|
|
+ // }
|
|
|
+ // next()
|
|
|
+ // },
|
|
|
data() {
|
|
|
return {
|
|
|
sheetId: this.$route.query.id || '',
|
|
@@ -232,9 +232,17 @@ export default {
|
|
|
Source: 3,
|
|
|
TableData: this.$refs.customTableRef.getSaveParams()
|
|
|
};
|
|
|
- console.log("自动保存");
|
|
|
+ // console.log("自动保存");
|
|
|
const res = await sheetInterface.sheetEdit({ ExcelInfoId: Number(this.sheetId),...params })
|
|
|
if(res.Ret !==200) return
|
|
|
+
|
|
|
+ if(res.Data.Status==1){
|
|
|
+ this.$message.warning(res.Data.Msg)
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.backHandle()
|
|
|
+ },1000)
|
|
|
+ return
|
|
|
+ }
|
|
|
this.saveTime = this.$moment().format('YYYY-MM-DD HH:mm:ss')
|
|
|
},1500),
|
|
|
/* 保存表格 */
|
|
@@ -274,7 +282,13 @@ export default {
|
|
|
: await sheetInterface.sheetAdd(params)
|
|
|
|
|
|
if(res.Ret !==200) return
|
|
|
-
|
|
|
+ if(res.Data.Status==1){
|
|
|
+ this.$message.warning(res.Data.Msg)
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.backHandle()
|
|
|
+ },1000)
|
|
|
+ return
|
|
|
+ }
|
|
|
this.sheetId = this.sheetId || res.Data.ExcelInfoId;
|
|
|
this.$message.success('保存成功')
|
|
|
this.saveTime = this.$moment().format('YYYY-MM-DD HH:mm:ss')
|
|
@@ -289,23 +303,23 @@ export default {
|
|
|
// }
|
|
|
// })
|
|
|
},300),
|
|
|
- markFinishStatus(){
|
|
|
- if((!this.sheetId) || (!this.isCanEdit)) return
|
|
|
- sheetInterface.markSheetEditStatus({ExcelInfoId: +this.sheetId,Status:2}).then(res=>{
|
|
|
- if(res.Ret != 200) return
|
|
|
- })
|
|
|
- }
|
|
|
+ // markFinishStatus(){
|
|
|
+ // if((!this.sheetId) || (!this.isCanEdit)) return
|
|
|
+ // sheetInterface.markSheetEditStatus({ExcelInfoId: +this.sheetId,Status:2}).then(res=>{
|
|
|
+ // if(res.Ret != 200) return
|
|
|
+ // })
|
|
|
+ // }
|
|
|
},
|
|
|
created() {
|
|
|
this.getClassify();
|
|
|
this.getDetail();
|
|
|
},
|
|
|
- mounted(){
|
|
|
- window.addEventListener('beforeunload',this.markFinishStatus)
|
|
|
- },
|
|
|
- beforeDestroy(){
|
|
|
- window.removeEventListener('beforeunload',this.markFinishStatus)
|
|
|
- }
|
|
|
+ // mounted(){
|
|
|
+ // window.addEventListener('beforeunload',this.markFinishStatus)
|
|
|
+ // },
|
|
|
+ // beforeDestroy(){
|
|
|
+ // window.removeEventListener('beforeunload',this.markFinishStatus)
|
|
|
+ // }
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|