BUG 26017
This commit is contained in:
		@@ -68,7 +68,7 @@
 | 
			
		||||
      <div @click="back">
 | 
			
		||||
        <span>取消</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div @click="confirm">{{ type === 'edit' ? '发布' : '确定' }}</div>
 | 
			
		||||
      <div @click="confirm">{{ isEdit ? '发布' : '确定' }}</div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <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"
 | 
			
		||||
@@ -78,10 +78,16 @@
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
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()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -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('该表单已有数据,无法编辑!')
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user