loulijun2021
2022-07-04 991a63234bba49da5a22d0f64ae15837d3253829
src/views/jcsz/zzjg.vue
@@ -99,7 +99,6 @@
          <el-table-column
            prop="lm_date"
            label="创建时间"
            show-overflow-tooltip
            sortable="custom"
          />
          <el-table-column
@@ -107,7 +106,7 @@
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-button type="text" @click="edit('edit',row)">修改</el-button>
                <el-button type="text" @click="edit('edit',row)">编辑</el-button>
                <el-button type="text" @click="del(row.id)">删除</el-button>
              </div>
            </template>
@@ -128,9 +127,9 @@
    </div>
    <el-dialog
      :title="operation==='add'?'新增':'修改'"
      :title="operation==='add'?'新增':'编辑'"
      :visible.sync="dialogVisible"
      width="50%"
      width="60%"
      top="15vh"
      :close-on-click-modal="false"
      @closed="handleClose"
@@ -151,15 +150,15 @@
          </el-radio-group>
        </el-form-item>
        <el-form-item label="组织编码" prop="OrgCode">
          <el-input v-model="dialogForm.OrgCode" :disabled="operation!=='add'" style="width: 220px" />
          <el-input v-model="dialogForm.OrgCode" disabled style="width: 200px" />
        </el-form-item>
        <el-form-item label="组织名称" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" style="width: 220px" />
          <el-input v-model="dialogForm.OrgName" style="width: 200px" />
        </el-form-item>
        <el-form-item v-if="dialogFormOrgTypeSelected!=='F'" prop="SupUnit" label="上级单位">
          <el-select
            v-model="dialogForm.SupUnit"
            style="width: 220px"
            style="width: 200px"
            filterable
            :popper-append-to-body="false"
            placeholder="请选择"
@@ -187,6 +186,7 @@
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import { getNewEncodingRules } from '@/utils/global'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -214,8 +214,11 @@
      }
    }
    return {
      windowHeight: 0,
      windowWidth: 0,
      mainHeight: 0,
      tableHeight: 0,
      numvalue: 0,
      form: {
        OrgCode: '', // 组织架构代码
        OrgName: '', // 组织架构名称
@@ -263,12 +266,38 @@
    }
  },
  // watch: {
  //   windowHeight(val) {
  //     console.log('实时屏幕高度:', val, this.windowHeight)
  //   },
  //   windowWidth(val) {
  //     if (val < 768) {
  //       this.dialogWidth = '100%'
  //     } else {
  //       this.dialogWidth = '75%'
  //     }
  //     console.log('实时屏幕宽度:', val, this.windowHeight)
  //   }
  // },
  created() {
    this.getOrganizationSearch()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
    // console.log('页面进入时的宽度:', document.body.clientWidth)
    // if (document.body.clientWidth < 768) {
    //   this.dialogWidth = '100%'
    // }
    //
    // // <!--把window.onresize事件挂在到mounted函数上-->
    // window.onresize = () => {
    //   return (() => {
    //     this.windowHeight = document.documentElement.clientHeight// 高
    //     this.windowWidth = document.documentElement.clientWidth // 宽
    //   })()
    // }
  },
  methods: {
    async getOrganizationSearch() {
@@ -320,9 +349,13 @@
    },
    // 新增按钮
    add(operation) {
    async add(operation) {
      this.operation = operation
      this.dialogVisible = true
      const res = await getNewEncodingRules(getCookie('ruleCode'))
      this.dialogForm.OrgCode = res.RightCode
      this.numvalue = res.numvalue
    },
    // 修改按钮
    edit(operation, row) {
@@ -383,6 +416,8 @@
            OrganType: this.dialogFormOrgTypeSelected,
            OrganCode: this.dialogForm.OrgCode,
            OrganName: this.dialogForm.OrgName,
            RightCode: this.operation === 'add' ? getCookie('ruleCode') : '',
            numvalue: this.operation === 'add' ? this.numvalue : '',
            SupUnit: this.dialogFormOrgTypeSelected === 'F' ? '0' : this.dialogForm.SupUnit,
            OperType: this.operation === 'add' ? 'Add' : 'Update',
            Operator: getCookie('admin')
@@ -458,9 +493,9 @@
  color: #606266;
}
::v-deep .el-dialog__body {
  padding: 20px 100px !important;
}
//::v-deep .el-dialog__body {
//  padding: 20px 100px !important;
//}
::v-deep .el-radio__input.is-checked .el-radio__inner {
  background-color: $main_color;