Blame view

src/views/system/sqywgz/components/dyztsd.vue 3.91 KB
1
<!--
2 3 4
 * @Description: 单元状态设定
 * @Autor: renchao
 * @LastEditTime: 2023-07-19 14:10:44
5 6 7
-->
<template>
  <div class='该组件名称'>
任超 committed
8
    <el-form :model="ruleForm">
9 10 11
      <el-row>
        <el-col :span="5">
          <el-form-item label="登记业务编码">
任超 committed
12
            {{ ruleForm.djywbm }}
13 14
          </el-form-item>
        </el-col>
15 16
        <el-col :span="12">
          <el-form-item label="登记业务名称">
任超 committed
17
            {{ ruleForm.djywmc }}
18 19 20 21
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
任超 committed
22 23 24 25 26 27 28
    <div v-if="ruleForm.sfsxql != '0'">
      <div class="dyztsd-title">
        <b>请勾选需要查询的权利信息</b>
        <div>
          <el-button type="text" @click="handleSelectall">选择全部 </el-button>
          <el-button type="text" @click="handleInvert">清除全部</el-button>
        </div>
29
      </div>
任超 committed
30 31 32 33 34 35
      <el-divider></el-divider>
      <ul class="qlxx-list">
        <li v-for="(item, index) in dataList.sxql" :key="index">
          <el-checkbox v-model="item.checked">{{ item.sxzdmc }}</el-checkbox>
        </li>
      </ul>
36
    </div>
任超 committed
37
    <b>限制办理状态</b>
38
    <ul class="screen-list">
任超 committed
39
      <li v-for="(item, index) in dataList.sxzt" :key="index">
40
        <div class="screen-list-left">
任超 committed
41
          <el-switch v-model="item.checked" @change="handleSelect(item)">
42
          </el-switch>
任超 committed
43
          {{ item.sxzdmc }}
44
        </div>
任超 committed
45
        <el-radio-group v-model="item.selected" :disabled="!item.checked">
任超 committed
46
          <el-radio :label="obj.sxzdz" v-for="(obj, index) in item.children" :key="index">{{ obj.sxzdmc }}</el-radio>
47 48 49 50 51 52
        </el-radio-group>
      </li>
    </ul>
  </div>
</template>
<script>
53 54 55 56 57 58 59 60 61 62
  export default {
    props: {
      ruleForm: {
        type: Object, default: {}
      },
      subData: {
        type: Object, default: () => {
          return {}
        }
      }
任超 committed
63
    },
64 65 66 67 68 69
    data () {
      return {
        dataList: {
          sxql: [],
          sxzt: []
        }
任超 committed
70
      }
71 72
    },
    watch: {
73
      dataList: {
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
        handler (newValue, oldValue) {
          this.$emit('updateValue', newValue)
        },
        deep: true
      },
      subData: {
        handler (newValue, oldValue) {
          if (!_.isEqual(newValue.sxql, this.dataList.sxql)) {
            this.dataList.sxql = _.cloneDeep(newValue.sxql)
          }
          if (!_.isEqual(newValue.sxzt, this.dataList.sxzt)) {
            this.dataList.sxzt = _.cloneDeep(newValue.sxzt)
          }
        },
        deep: true
89
      },
任超 committed
90
    },
91
    methods: {
yuanbo committed
92 93 94 95 96
      /**
       * @description: handleSelect
       * @param {*} item
       * @author: renchao
       */
97 98 99
      handleSelect (item) {
        if (item.checked) {
          item.selected = '0'
100
        }
任超 committed
101
      },
yuanbo committed
102 103 104 105
      /**
       * @description: handleSelectall
       * @author: renchao
       */
106 107 108 109 110
      handleSelectall () {
        this.dataList.sxql.forEach(item => {
          item.checked = true
        })
      },
yuanbo committed
111 112 113 114
      /**
       * @description: handleInvert
       * @author: renchao
       */
115 116 117 118
      handleInvert () {
        this.dataList.sxql.forEach(item => {
          item.checked = false
        })
任超 committed
119
      }
120 121 122 123
    }
  }
</script>
<style scoped lang='scss'>
124
  @import "~@/styles/mixin.scss";
125

126 127 128 129 130 131
  .dyztsd-title {
    @include flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 20px;
  }
132

133 134 135 136
  .qlxx-list {
    @include flex;
    flex-wrap: wrap;
    padding-left: 20px;
137

138 139 140 141
    li {
      width: 33%;
      margin-bottom: 15px;
    }
142 143
  }

144
  .screen-list {
145 146
    @include flex;
    align-items: center;
147 148 149
    flex-wrap: wrap;
    border: 1px solid $borderColor;
    border-bottom: none;
150

151 152 153 154 155 156 157 158
    li {
      @include flex;
      align-items: center;
      width: 50%;
      line-height: 50px;
      border-bottom: 1px solid $borderColor;
      padding-left: 20px;
    }
159

160 161 162 163 164 165 166 167 168
    &-left {
      margin-right: 20px;
      width: 160px;
      white-space: nowrap;
    }

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