From 375934d3e9162a5c355696758e5dedc6e54ef2b7 Mon Sep 17 00:00:00 2001 From: zhanglipeng Date: Thu, 3 Jun 2021 11:52:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E6=97=A5=E6=B5=81=E7=A8=8B=E8=AF=84?= =?UTF-8?q?=E4=BC=B0=E8=AF=84=E4=BC=B0=E5=AE=8C=E6=AF=95=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=88=B7=E6=96=B0list=20=E4=B8=80=E6=97=A5=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E8=B7=A8=E6=9C=88=E4=B8=8D=E8=83=BD=E7=BB=A7=E7=BB=AD=E8=AF=84?= =?UTF-8?q?=E4=BC=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/benyi/dayflowassessment/edit.vue | 28 ++++++++++++++++--- .../views/benyi/dayflowassessment/index.vue | 18 ++++++++++-- .../views/benyi/dayflowassessment/teacher.vue | 28 ++++++++++++++++--- 3 files changed, 64 insertions(+), 10 deletions(-) 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 + ); } }); }