BUG 26017
This commit is contained in:
@@ -68,7 +68,7 @@
|
|||||||
<div @click="back">
|
<div @click="back">
|
||||||
<span>取消</span>
|
<span>取消</span>
|
||||||
</div>
|
</div>
|
||||||
<div @click="confirm">{{ type === 'edit' ? '发布' : '确定' }}</div>
|
<div @click="confirm">{{ isEdit ? '发布' : '确定' }}</div>
|
||||||
</div>
|
</div>
|
||||||
<u-modal v-model="isShowModal" :content="tips"></u-modal>
|
<u-modal v-model="isShowModal" :content="tips"></u-modal>
|
||||||
<u-picker mode="time" v-model="isShowTime" :show-time-tag="true" @close="isShowTime = false" @confirm="onTimeChange"
|
<u-picker mode="time" v-model="isShowTime" :show-time-tag="true" @close="isShowTime = false" @confirm="onTimeChange"
|
||||||
@@ -78,10 +78,16 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: ['id', 'formConfig', 'type'],
|
props: ['formConfig'],
|
||||||
|
computed: {
|
||||||
|
isEdit() {
|
||||||
|
return this.$route.query.type == 'edit'
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
|
let {id} = this.$route.query
|
||||||
return {
|
return {
|
||||||
|
id,
|
||||||
params: {
|
params: {
|
||||||
year: true,
|
year: true,
|
||||||
month: true,
|
month: true,
|
||||||
@@ -101,8 +107,7 @@ export default {
|
|||||||
periodValidityType: '0'
|
periodValidityType: '0'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
mounted() {
|
|
||||||
if (this.id) {
|
if (this.id) {
|
||||||
this.getInfo(this.id)
|
this.getInfo(this.id)
|
||||||
} else if (this.formConfig) {
|
} else if (this.formConfig) {
|
||||||
@@ -111,25 +116,23 @@ export default {
|
|||||||
this.commitType = res.commitType || '1'
|
this.commitType = res.commitType || '1'
|
||||||
this.actionNotice = res.actionNotice === '1'
|
this.actionNotice = res.actionNotice === '1'
|
||||||
this.dynamicNotice = res.dynamicNotice === '1'
|
this.dynamicNotice = res.dynamicNotice === '1'
|
||||||
|
|
||||||
if (res.periodValidityType === '1') {
|
if (res.periodValidityType === '1') {
|
||||||
this.periodValidityEndTime = res.periodValidityEndTime
|
this.periodValidityEndTime = res.periodValidityEndTime
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onTimeChange(e) {
|
onTimeChange(e) {
|
||||||
this.periodValidityEndTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`
|
this.periodValidityEndTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`
|
||||||
},
|
},
|
||||||
|
|
||||||
back() {
|
back() {
|
||||||
this.$emit('back')
|
uni.navigateBack({})
|
||||||
},
|
},
|
||||||
|
|
||||||
getInfo(id) {
|
getInfo(id) {
|
||||||
this.$http.post(`/app/appquestionnairetemplate/queryDetailById?id=${id}`).then(res => {
|
this.$http.post(`/app/appquestionnairetemplate/queryDetailById?id=${id}`).then(res => {
|
||||||
if (res.code == 0) {
|
if (res?.data) {
|
||||||
this.periodValidityType = res.data.periodValidityType
|
this.periodValidityType = res.data.periodValidityType
|
||||||
this.commitType = res.data.commitType
|
this.commitType = res.data.commitType
|
||||||
this.actionNotice = res.data.actionNotice === '1'
|
this.actionNotice = res.data.actionNotice === '1'
|
||||||
@@ -158,9 +161,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
uni.$emit('reload')
|
|
||||||
this.$u.toast('发布成功')
|
this.$u.toast('发布成功')
|
||||||
|
|
||||||
this.back()
|
this.back()
|
||||||
}
|
}
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
@@ -169,12 +170,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
confirm() {
|
confirm() {
|
||||||
if (this.type === 'edit') {
|
if (this.isEdit) {
|
||||||
this.publish()
|
this.publish()
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.$emit('setting', {
|
uni.$emit('setting', {
|
||||||
periodValidityType: this.periodValidityType,
|
periodValidityType: this.periodValidityType,
|
||||||
commitType: this.commitType,
|
commitType: this.commitType,
|
||||||
@@ -182,7 +181,6 @@ export default {
|
|||||||
dynamicNotice: this.dynamicNotice ? '1' : '0',
|
dynamicNotice: this.dynamicNotice ? '1' : '0',
|
||||||
periodValidityEndTime: this.periodValidityEndTime ? this.periodValidityEndTime : ''
|
periodValidityEndTime: this.periodValidityEndTime ? this.periodValidityEndTime : ''
|
||||||
})
|
})
|
||||||
|
|
||||||
this.back()
|
this.back()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,13 +124,13 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
showPopup(item) {
|
showPopup(item) {
|
||||||
if (item.status === '2') {
|
// if (item.status === '2') {
|
||||||
this.$confirm('表单已停止发布,请在后台管理系统中查看调查结果', '', {
|
// this.$confirm('表单已停止发布,请在后台管理系统中查看调查结果', '', {
|
||||||
showCancel: false
|
// showCancel: false
|
||||||
})
|
// })
|
||||||
|
//
|
||||||
return false
|
// return false
|
||||||
}
|
// }
|
||||||
|
|
||||||
this.info = item
|
this.info = item
|
||||||
this.id = item.id
|
this.id = item.id
|
||||||
@@ -205,11 +205,9 @@ export default {
|
|||||||
if (this.info.status === '1') {
|
if (this.info.status === '1') {
|
||||||
return this.$u.toast('该表单已发布')
|
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
|
this.isShow = false
|
||||||
},
|
},
|
||||||
|
|
||||||
toEdit() {
|
toEdit() {
|
||||||
if (this.info.dataCount !== 0) {
|
if (this.info.dataCount !== 0) {
|
||||||
return this.$u.toast('该表单已有数据,无法编辑!')
|
return this.$u.toast('该表单已有数据,无法编辑!')
|
||||||
|
|||||||
Reference in New Issue
Block a user