liuchengxin
2022-06-09 0d68be1fa109b0f55fa0b4c023baf4b66dcc9f28
src/views/basics/school/index.vue
@@ -1,6 +1,6 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
      <el-form-item label="学校代码" prop="code">
        <el-input
          v-model="queryParams.code"
@@ -137,9 +137,23 @@
          <dict-tag :options="dict.type.DICT106" :value="scope.row.disciplineScope"/>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remarks"/>
      <el-table-column label="操作" fixed="right" width="120" align="center" class-name="small-padding fixed-width">
<!--      <el-table-column label="备注" align="center" prop="remarks"/>-->
      <el-table-column label="操作" fixed="right" width="220" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
              size="mini"
              type="text"
              icon="el-icon-wind-power"
              @click="handleOrganization(scope.row)"
          >机构
          </el-button>
          <el-button
              size="mini"
              type="text"
              icon="el-icon-office-building"
              @click="handleBuild(scope.row)"
          >建筑
          </el-button>
          <el-button
            size="mini"
            type="text"
@@ -170,7 +184,7 @@
    />
    <!-- 添加或修改学校对话框 -->
    <el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="500px" append-to-body>
    <Dialog :title="title" :visible.sync="open" width="500px" :append-to-body="true" :close-on-click-modal="false">
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="学校代码" prop="code">
          <el-input v-model="form.code" placeholder="请输入学校代码"/>
@@ -227,17 +241,33 @@
        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    </Dialog>
    <!-- 建筑 -->
    <el-drawer title="建筑单元" :visible.sync="buildOpen" size="50%" :append-to-body="true" :destroy-on-close="true">
      <building :schoolId="id"></building>
    </el-drawer>
    <!-- 组织机构 -->
    <el-drawer title="组织机构" :visible.sync="organizationOpen" size="50%" :append-to-body="true" :destroy-on-close="true">
      <organization :schoolId="id"></organization>
    </el-drawer>
  </div>
</template>
<script>
import {listSchool, getSchool, delSchool, addSchool, updateSchool} from "@/api/oa/school";
import {listProvince, listCity} from "@/api/common/common";
import building from '../building'
import organization from '../organization'
export default {
  name: "School",
  dicts: ['DICT105', 'DICT106'],
  components: {
    building,
    organization
  },
  data() {
    return {
      // 按钮loading
@@ -307,7 +337,10 @@
      // 省份
      provinceFormList: [],
      // 城市
      cityFormList: []
      cityFormList: [],
      buildOpen: false,
      organizationOpen: false,
      id: undefined
    };
  },
  created() {
@@ -467,6 +500,16 @@
      this.getCity(v).then(res => {
        this.cityFormList = res
      })
    },
    // 建筑
    handleBuild(r) {
      this.id = r.id;
      this.buildOpen = true;
    },
    // 组织机构
    handleOrganization(r) {
      this.id = r.id;
      this.organizationOpen = true;
    }
  }
};