src/views/jcsz/yhqd.vue
@@ -71,7 +71,7 @@
              </el-select>
            </el-form-item>
          </div>
          <div style="display: flex;align-items: flex-start;margin-top: 3px">
          <div class="bodySearchReset">
            <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button>
            <el-button type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          </div>
@@ -80,7 +80,9 @@
      <div class="elTableDiv">
        <el-table
          ref="tableDataRef"
          :data="tableData"
          class="tableFixed"
          :height="tableHeight+'px'"
          highlight-current-row
          :style="{width: 100+'%',height:tableHeight+'px'}"
@@ -396,7 +398,7 @@
          show-checkbox
          node-key="code"
          default-expand-all
          style="height: 300px"
          style="height: 300px;overflow-y: scroll"
          :props="defaultPropsOfRoleTree"
          @check="checkBoxClick"
        />
@@ -458,7 +460,7 @@
          sortable="custom"
        >
          <template slot-scope="{row}">
            <el-input v-if="row.isVisible===1" v-model="row.group_code" placeholder="请输入" />
            <el-input v-if="row.isVisible===1" v-model="row.group_code" oninput="value=value.replace(/[^0-9a-zA-Z]/g,'')" placeholder="请输入" />
            <div v-else> {{ row.group_code }}</div>
          </template>
        </el-table-column>
@@ -534,27 +536,15 @@
} from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import $ from 'jquery'
import clearAllChildren from '@/utils/global'
import clearAllChildren, { validateCode } from '@/utils/global'
import { MesOrderStepReportSelectUserGroup } from '@/api/scgl'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
  name: 'YYQD',
  components: {
    Pagination, ImportPicker
  },
  data() {
    const validateName = (rule, value, callback) => {
      if (!value) {
        return callback(new Error('请输入编码'))
      } else {
        if (SER_HZ.test(value)) {
          return callback(new Error('编码不能为中文'))
        } else {
          callback()
        }
      }
    }
    const validateMobile = (rule, value, callback) => {
      if (!value) {
        callback()
@@ -584,7 +574,6 @@
        }
      }
    }
    return {
      isIpad: false,
      mainHeight: 0,
@@ -637,7 +626,7 @@
      operation: '',
      dialogFormRules: {
        UserCode: [
          { required: true, validator: validateName, trigger: ['blur', 'change'] }
          { required: true, validator: validateCode, trigger: ['blur', 'change'] }
        ],
        UserName: [
          { required: true, message: '请输入用户名称', trigger: ['blur', 'change'] }
@@ -892,6 +881,7 @@
          this.tableHeight = this.tableHeight - 40
        }
        this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
        this.$refs.tableDataRef.doLayout()
      })
    },
    // 关联角色点击事件
@@ -903,10 +893,10 @@
      this.dialogFormRoles.username = row.username
      this.dialogFormRoles.usercode = row.usercode
      const { data: res } = await UserAssociationRole({ usercode: row.usercode })
      this.rolesAll = res
      this.rolesAll = res.filter(item => item.children.length !== 0)
      const nodeKey = []// 树形回显key
      res.forEach((item, index) => {
      this.rolesAll.forEach((item, index) => {
        this.dialogFormRoles.rolesArr.push({
          code: item.code,
          name: item.name,
@@ -933,8 +923,6 @@
          }
        }
      })
      console.log(this.dialogFormRoles.roleTreeSelectedArr, 11)
      console.log(this.dialogFormRoles.rolesArr, 888)
      this.dialogFormRoles.rolesArr[0].isSelected1 = true// 默认选中第一个
      // this.dialogFormRoles.rolesArr[0].name = '全部'
@@ -1448,6 +1436,15 @@
  margin-bottom: 0;
}
.tableFixed{
  ::v-deep .el-table__fixed-right{
    height: 100% !important;
  }
  ::v-deep .el-table__fixed{
    height: 100% !important;
  }
}
</style>
<style>