dyztsd.vue 3.89 KB
<!--
  功能:单元状态设定
-->
<template>
  <div class='该组件名称'>
    <el-form :model="ruleForm" :rules="rules">
      <el-row>
        <el-col :span="5">
          <el-form-item label="登记业务编码">
            {{ ruleForm.djywbm }}
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="登记业务名称">
            {{ ruleForm.djywmc }}
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div class="dyztsd-title">
      <b>请勾选需要查询的权利信息</b>
      <div>
        <el-button type="text" @click="handleSelectall">选择全部</el-button>
        <el-button type="text" @click="handleInvert">清除全部</el-button>
      </div>
    </div>
    <el-divider></el-divider>
    <ul class="qlxx-list">
      <li v-for="(item, index) in dataList.qlxxList" :key="index">
        <el-checkbox v-model="item.checked">{{ item.sxzdmc }}</el-checkbox>
      </li>
    </ul>
    <ul class="screen-list">
      <li v-for="(item, index) in dataList.screenList" :key="index">
        <div class="screen-list-left">
          <el-switch v-model="item.checked" @change="handleSelect(item)">
          </el-switch>
          {{ item.name }}
        </div>
        <el-radio-group v-model="item.radio" :disabled="!item.checked">
          <el-radio :label="1">正在办理</el-radio>
          <el-radio :label="2">未办理</el-radio>
        </el-radio-group>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  props: {
    ruleForm: {
      type: Object, default: {}
    },
    sxql: {
      type: Array, default: () => {
        return []
      }
    }
  },
  data () {
    return {
      rules: {
        djywbm: [
          { required: true, message: '登记业务编码', trigger: 'blur' },
        ],
        djywmc: [
          { required: true, message: '登记业务名称', trigger: 'blur' },
        ],
      },
      dataList: {
        qlxxList: [
          {
            checked: false,
            name: '国有建设用地使用权'
          }
        ],
        screenList: [
          {
            checked: true,
            name: '筛选单元办理状态条件',
            radio: 1
          },
          {
            checked: true,
            name: '筛选单元办理状态条件',
            radio: 1
          },
          {
            checked: true,
            name: '筛选单元办理状态条件',
            radio: 1
          },
          {
            checked: true,
            name: '筛选单元办理状态条件',
            radio: 1
          }
        ]
      },

    }
  },
  watch: {
    dataList: {
      handler (newValue, oldValue) {
        this.$emit('updateValue', newValue)
      },
      deep: true
    },
    sxql: {
      handler (newValue, oldValue) {
        this.dataList.qlxxList = newValue
      },
      deep: true
    },
  },
  methods: {
    handleSelect (item) {
      if (!item.checked) {
        item.radio = 0
      }
    },
    handleSelectall () {
      this.dataList.qlxxList.forEach(item => {
        item.checked = true
      })
    },
    handleInvert () {
      this.dataList.qlxxList.forEach(item => {
        item.checked = false
      })
    }
  }
}
</script>
<style scoped lang='scss'>
@import "~@/styles/mixin.scss";

.dyztsd-title {
  @include flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 20px;
}

.qlxx-list {
  @include flex;
  flex-wrap: wrap;
  padding-left: 20px;

  li {
    width: 33%;
    margin-bottom: 15px;
  }
}

.screen-list {
  @include flex;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid $borderColor;
  border-bottom: none;

  li {
    @include flex;
    align-items: center;
    width: 50%;
    line-height: 50px;
    border-bottom: 1px solid $borderColor;
    padding-left: 20px;
  }

  &-left {
    margin-right: 20px;
  }

  li:nth-child(odd) {
    border-right: 1px solid $borderColor;
  }
}
</style>