From 60c2f64672e5b44896723cb1c64a6b31ec68f0f1 Mon Sep 17 00:00:00 2001 From: aixianling Date: Tue, 25 Oct 2022 15:47:46 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=91=E9=BE=99=E6=B1=9F=E6=B0=91=E6=94=BF?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/AppAskForm/AppForm.vue | 43 ++++++---- src/apps/AppAskForm/components/formDetail.vue | 84 +++++++------------ src/common/axios.js | 5 +- .../AppAssessmentScoreTask.vue | 1 + .../AppAssessmentScoreTask/astDetail.vue | 13 +-- src/styles/common.scss | 11 +++ 6 files changed, 79 insertions(+), 78 deletions(-) diff --git a/src/apps/AppAskForm/AppForm.vue b/src/apps/AppAskForm/AppForm.vue index 1a096ea0..a059902e 100644 --- a/src/apps/AppAskForm/AppForm.vue +++ b/src/apps/AppAskForm/AppForm.vue @@ -1,9 +1,9 @@ @@ -24,29 +24,40 @@ export default { }, computed: { ...mapState(['user']), - showDetail() { - return !!this.$route.query?.id && this.access - }, + showDetail: v => !!v.$route.query?.id && v.access, errMsg() { this.access && (this.err = "表单不存在") return this.err || "数据读取中..." }, - errStatus() { - return !!this.err ? "error" : "loading" + errStatus: v => !!v.err ? "error" : "loading", + isPreview: v => !!v.$route.query?.preview, + actions() { + const config = { + default: { + pageTitle: "调查问卷", + common: "appquestionnairetemplate", + detail: "appquestionnairetemplate", + preview: true //是否有预览模式的存在,若存在需要无登录查询模板数据 + }, + AppAssessmentScoreTask: { + pageTitle: "考核评分", + common: "appassessmentscortask", + detail: "appassessmentscoretemplate", + preview: false, //是否有预览模式的存在,若存在需要无登录查询模板数据 + back: true,//填写完是否要返回按钮 + } + } + return config[this.$route.query.from || "default"] }, - isPreview() { - return !!this.$route.query?.preview - }, - action: v => v.$route.query.action || "appquestionnairetemplate" }, methods: { ...mapActions(['getCode', 'getToken']), checkAccess(review) { - let {code, suiteId, id} = this.$route.query - if (this.isPreview) { + const {code, suiteId, id, result} = this.$route.query + if (this.isPreview || result) { this.access = true } else if (!!this.user.token) { - this.$http.post(`/app/${this.action}/commitCheck`, null, { + this.$http.post(`/app/${this.actions.common}/commitCheck`, null, { params: {id} }).then(res => { if (res?.code == 0) { @@ -54,7 +65,7 @@ export default { } else if (res?.code == 401) { this.checkAccess() } else { - this.err = "无法获取表单" + this.err = res?.msg || "无法获取表单" } }).catch(err => { this.err = err @@ -70,7 +81,7 @@ export default { this.checkAccess() }, onShow() { - document.title = '问卷调查' + document.title = this.actions.pageTitle wx.hideOptionMenu() }, } diff --git a/src/apps/AppAskForm/components/formDetail.vue b/src/apps/AppAskForm/components/formDetail.vue index 4521206f..b024c4c3 100644 --- a/src/apps/AppAskForm/components/formDetail.vue +++ b/src/apps/AppAskForm/components/formDetail.vue @@ -6,15 +6,17 @@
成绩
+ 返回 -
+
{{ option.label }}
@@ -36,7 +38,7 @@ -
+
@@ -53,8 +55,8 @@
- - + +
提交
@@ -64,11 +66,13 @@