diff --git a/ruoyi-ui/src/views/benyi/dayflowassessment/edit.vue b/ruoyi-ui/src/views/benyi/dayflowassessment/edit.vue index e8d0c513e..79b3a9dbb 100644 --- a/ruoyi-ui/src/views/benyi/dayflowassessment/edit.vue +++ b/ruoyi-ui/src/views/benyi/dayflowassessment/edit.vue @@ -211,13 +211,23 @@ export default { type: "warning", callback: (action) => { if (action === "confirm") { - this.loading = true; this.form.list = this.dayflowstandardList; this.form.status = "1"; addDayflowassessment(this.form).then((response) => { if (response.code === 200) { this.msgSuccess("评估成功"); - this.loading = false; + // 自动关闭 tab + this.$store.state.tagsView.visitedViews.splice( + this.$store.state.tagsView.visitedViews.findIndex( + (item) => item.path === this.$route.path + ), + 1 + ); + this.$router.push( + this.$store.state.tagsView.visitedViews[ + this.$store.state.tagsView.visitedViews.length - 1 + ].path + ); } }); } @@ -235,13 +245,23 @@ export default { type: "warning", callback: (action) => { if (action === "confirm") { - this.loading = true; this.form.list = this.dayflowstandardList; this.form.status = "0"; addDayflowassessment(this.form).then((response) => { if (response.code === 200) { this.msgSuccess("保存成功"); - this.loading = false; + // 自动关闭 tab + this.$store.state.tagsView.visitedViews.splice( + this.$store.state.tagsView.visitedViews.findIndex( + (item) => item.path === this.$route.path + ), + 1 + ); + this.$router.push( + this.$store.state.tagsView.visitedViews[ + this.$store.state.tagsView.visitedViews.length - 1 + ].path + ); } }); } diff --git a/ruoyi-ui/src/views/benyi/dayflowassessment/index.vue b/ruoyi-ui/src/views/benyi/dayflowassessment/index.vue index 9f1d3f8fd..5788ccc02 100644 --- a/ruoyi-ui/src/views/benyi/dayflowassessment/index.vue +++ b/ruoyi-ui/src/views/benyi/dayflowassessment/index.vue @@ -152,7 +152,7 @@ import { listUser } from "@/api/system/user"; import { listDetail, getDetail } from "@/api/benyi/dayflow/dayflowmanger"; export default { - name: "Dayflowassessment", + name: "Dayflowassessment_1", data() { return { // 遮罩层 @@ -332,9 +332,23 @@ export default { }, //控制按钮可用 checkUpdateable(row) { + //console.log(row.createTime); var status = row.status; + var nowdate = new Date(); + var y = nowdate.getFullYear(); + var m = (nowdate.getMonth() + 1).toString().padStart(2, "0"); //console.log(date.toLocaleDateString()); - return status == "1"; + + return status == "1" || !this.CompareDate(row.createTime, y + "/" + m); + }, + //比较日期大小 + CompareDate(d1, d2) { + //return new Date(d1.replace(/-/g, "/")) > new Date(d2.replace(/-/g, "/")); + //console.log(d1.replace(/-/g, "/").substring(0, 7)); + //console.log(d2.replace(/-/g, "/").substring(0, 7)); + var d3 = d1.replace(/-/g, "/").substring(0, 7); + var d4 = d2.replace(/-/g, "/").substring(0, 7); + return d3 == d4; }, }, }; diff --git a/ruoyi-ui/src/views/benyi/dayflowassessment/teacher.vue b/ruoyi-ui/src/views/benyi/dayflowassessment/teacher.vue index a6164aff9..cf4cca378 100644 --- a/ruoyi-ui/src/views/benyi/dayflowassessment/teacher.vue +++ b/ruoyi-ui/src/views/benyi/dayflowassessment/teacher.vue @@ -259,13 +259,23 @@ export default { type: "warning", callback: (action) => { if (action === "confirm") { - this.loading = true; this.form.list = this.dayflowstandardList; this.form.status = "1"; addDayflowassessment(this.form).then((response) => { if (response.code === 200) { this.msgSuccess("评估成功"); - this.loading = false; + // 自动关闭 tab + this.$store.state.tagsView.visitedViews.splice( + this.$store.state.tagsView.visitedViews.findIndex( + (item) => item.path === this.$route.path + ), + 1 + ); + this.$router.push( + this.$store.state.tagsView.visitedViews[ + this.$store.state.tagsView.visitedViews.length - 1 + ].path + ); } }); } @@ -286,13 +296,23 @@ export default { type: "warning", callback: (action) => { if (action === "confirm") { - this.loading = true; this.form.list = this.dayflowstandardList; this.form.status = "0"; addDayflowassessment(this.form).then((response) => { if (response.code === 200) { this.msgSuccess("保存成功"); - this.loading = false; + // 自动关闭 tab + this.$store.state.tagsView.visitedViews.splice( + this.$store.state.tagsView.visitedViews.findIndex( + (item) => item.path === this.$route.path + ), + 1 + ); + this.$router.push( + this.$store.state.tagsView.visitedViews[ + this.$store.state.tagsView.visitedViews.length - 1 + ].path + ); } }); }