<template> 
 | 
    <div class="box"> 
 | 
        <el-form :model="form" ref="form" label-width="140px"> 
 | 
            <el-form-item label="来访预约方式:" prop="reservationWay"> 
 | 
                <el-radio-group v-model="form.reservationWay"> 
 | 
                    <el-radio :label="0">预约免登记</el-radio> 
 | 
                    <el-radio :label="1">预约后登记(需要配备访客机)</el-radio> 
 | 
                </el-radio-group> 
 | 
            </el-form-item> 
 | 
            <el-form-item label="被访人校验方式:" prop="checkVisit"> 
 | 
                <el-radio-group v-model="form.checkVisit"> 
 | 
                    <el-radio :label="0">仅手机号</el-radio> 
 | 
                    <el-radio :label="1">手机号&姓名</el-radio> 
 | 
                </el-radio-group> 
 | 
            </el-form-item> 
 | 
            <el-form-item label="健康证是否必填:" prop="healthCard"> 
 | 
                <el-radio-group v-model="form.healthCard"> 
 | 
                    <el-radio :label="0">否</el-radio> 
 | 
                    <el-radio :label="1">是</el-radio> 
 | 
                </el-radio-group> 
 | 
            </el-form-item> 
 | 
            <el-form-item label="访客是否答题:" prop="isAnswer"> 
 | 
                <el-switch 
 | 
                    v-model="form.isAnswer" 
 | 
                    active-color="#13ce66" 
 | 
                    inactive-color="#ff4949" 
 | 
                    :active-value="1" 
 | 
                    :inactive-value="0"> 
 | 
                </el-switch> 
 | 
            </el-form-item> 
 | 
            <el-form-item label="访客答题主题:" prop="theme"> 
 | 
                <el-input style="width: 50%;" type="textarea" v-model="form.theme" placeholder="请输入答题标题" v-trim/> 
 | 
            </el-form-item> 
 | 
            <el-form-item label="访客答题说明:" prop="description"> 
 | 
                <el-input style="width: 50%;" type="textarea" v-model="form.description" placeholder="请输入" v-trim/> 
 | 
            </el-form-item> 
 | 
            <el-form-item> 
 | 
                <el-button type="primary" @click="submit">保存配置项</el-button> 
 | 
            </el-form-item> 
 | 
        </el-form> 
 | 
    </div> 
 | 
</template> 
 | 
  
 | 
<script> 
 | 
import { getLaborConfigDTO, updateLaborConfigDTO } from '@/api/system/common' 
 | 
export default { 
 | 
  name: 'visitorSources', 
 | 
  
 | 
  data () { 
 | 
    return { 
 | 
      form: { 
 | 
        id: null, 
 | 
        checkVisit: 0, 
 | 
        reservationWay: 0, 
 | 
        healthCard: 0, 
 | 
        isAnswer: 0, 
 | 
        theme: '', 
 | 
        description: '' 
 | 
      } 
 | 
    } 
 | 
  }, 
 | 
  
 | 
  created () { 
 | 
    this.getData() 
 | 
  }, 
 | 
  
 | 
  methods: { 
 | 
    getData () { 
 | 
      getLaborConfigDTO({}) 
 | 
        .then(res => { 
 | 
          this.form.checkVisit = res.checkVisit 
 | 
          this.form.description = res.description 
 | 
          this.form.healthCard = res.healthCard 
 | 
          this.form.isAnswer = res.isAnswer 
 | 
          this.form.reservationWay = res.reservationWay 
 | 
          this.form.theme = res.theme 
 | 
        }) 
 | 
    }, 
 | 
    submit () { 
 | 
      updateLaborConfigDTO({ 
 | 
        isAnswer: this.form.isAnswer, 
 | 
        healthCard: this.form.healthCard, 
 | 
        checkVisit: this.form.checkVisit, 
 | 
        reservationWay: this.form.reservationWay, 
 | 
        description: this.form.description, 
 | 
        theme: this.form.theme 
 | 
      }).then(res => { 
 | 
        this.$message.success('保存成功') 
 | 
        this.getData() 
 | 
      }) 
 | 
    } 
 | 
  } 
 | 
} 
 | 
</script> 
 | 
  
 | 
<style lang="scss" scoped> 
 | 
    .box { 
 | 
        width: 100%; 
 | 
        height: 100%; 
 | 
        padding: 30px; 
 | 
        box-sizing: border-box; 
 | 
        background: #ffffff; 
 | 
    } 
 | 
</style> 
 |