diff --git a/src/apps/AppAskForm/FormSetting.vue b/src/apps/AppAskForm/FormSetting.vue
index c19832aa..05f6a51c 100644
--- a/src/apps/AppAskForm/FormSetting.vue
+++ b/src/apps/AppAskForm/FormSetting.vue
@@ -68,7 +68,7 @@
取消
- {{ type === 'edit' ? '发布' : '确定' }}
+ {{ isEdit ? '发布' : '确定' }}
export default {
- props: ['id', 'formConfig', 'type'],
-
+ props: ['formConfig'],
+ computed: {
+ isEdit() {
+ return this.$route.query.type == 'edit'
+ }
+ },
data() {
+ let {id} = this.$route.query
return {
+ id,
params: {
year: true,
month: true,
@@ -101,8 +107,7 @@ export default {
periodValidityType: '0'
}
},
-
- mounted() {
+ created() {
if (this.id) {
this.getInfo(this.id)
} else if (this.formConfig) {
@@ -111,25 +116,23 @@ export default {
this.commitType = res.commitType || '1'
this.actionNotice = res.actionNotice === '1'
this.dynamicNotice = res.dynamicNotice === '1'
-
if (res.periodValidityType === '1') {
this.periodValidityEndTime = res.periodValidityEndTime
}
}
},
-
methods: {
onTimeChange(e) {
this.periodValidityEndTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`
},
back() {
- this.$emit('back')
+ uni.navigateBack({})
},
getInfo(id) {
this.$http.post(`/app/appquestionnairetemplate/queryDetailById?id=${id}`).then(res => {
- if (res.code == 0) {
+ if (res?.data) {
this.periodValidityType = res.data.periodValidityType
this.commitType = res.data.commitType
this.actionNotice = res.data.actionNotice === '1'
@@ -158,9 +161,7 @@ export default {
}
}).then(res => {
if (res.code == 0) {
- uni.$emit('reload')
this.$u.toast('发布成功')
-
this.back()
}
}).catch(e => {
@@ -169,12 +170,10 @@ export default {
},
confirm() {
- if (this.type === 'edit') {
+ if (this.isEdit) {
this.publish()
-
return false
}
-
uni.$emit('setting', {
periodValidityType: this.periodValidityType,
commitType: this.commitType,
@@ -182,7 +181,6 @@ export default {
dynamicNotice: this.dynamicNotice ? '1' : '0',
periodValidityEndTime: this.periodValidityEndTime ? this.periodValidityEndTime : ''
})
-
this.back()
}
}
diff --git a/src/apps/AppAskForm/components/List.vue b/src/apps/AppAskForm/components/List.vue
index 75dd4726..416818c9 100644
--- a/src/apps/AppAskForm/components/List.vue
+++ b/src/apps/AppAskForm/components/List.vue
@@ -124,13 +124,13 @@ export default {
},
showPopup(item) {
- if (item.status === '2') {
- this.$confirm('表单已停止发布,请在后台管理系统中查看调查结果', '', {
- showCancel: false
- })
-
- return false
- }
+ // if (item.status === '2') {
+ // this.$confirm('表单已停止发布,请在后台管理系统中查看调查结果', '', {
+ // showCancel: false
+ // })
+ //
+ // return false
+ // }
this.info = item
this.id = item.id
@@ -205,11 +205,9 @@ export default {
if (this.info.status === '1') {
return this.$u.toast('该表单已发布')
}
-
- this.linkTo(`./formSetting?id=${this.info.id}&type=edit`)
+ this.linkTo(`./FormSetting?id=${this.info.id}&type=edit`)
this.isShow = false
},
-
toEdit() {
if (this.info.dataCount !== 0) {
return this.$u.toast('该表单已有数据,无法编辑!')