From 3a02d6a0f7c5d2dfb2df2e1635315304b85695eb Mon Sep 17 00:00:00 2001
From: 唐耀东 <18861537@qq.com>
Date: 星期二, 10 五月 2022 17:49:39 +0800
Subject: [PATCH] 提交代码

---
 src/views/basics/school/index.vue |   43 ++++++++++++++++++++++++++++++++++++-------
 1 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/src/views/basics/school/index.vue b/src/views/basics/school/index.vue
index 7c164e1..11578c7 100644
--- a/src/views/basics/school/index.vue
+++ b/src/views/basics/school/index.vue
@@ -137,9 +137,16 @@
           <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-office-building"
+              @click="handleBuild(scope.row)"
+          >寤虹瓚
+          </el-button>
           <el-button
             size="mini"
             type="text"
@@ -170,7 +177,7 @@
     />
 
     <!-- 娣诲姞鎴栦慨鏀瑰鏍″璇濇 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+    <Dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="瀛︽牎浠g爜" prop="code">
           <el-input v-model="form.code" placeholder="璇疯緭鍏ュ鏍′唬鐮�"/>
@@ -227,17 +234,25 @@
         <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>
   </div>
 </template>
 
 <script>
 import {listSchool, getSchool, delSchool, addSchool, updateSchool} from "@/api/oa/school";
 import {listProvince, listCity} from "@/api/common/common";
+import building from '../building'
 
 export default {
   name: "School",
   dicts: ['DICT105', 'DICT106'],
+  components: {
+    building
+  },
   data() {
     return {
       // 鎸夐挳loading
@@ -296,6 +311,9 @@
         disciplineScope: [
           {required: true, message: "瀛︾鑼冨洿涓嶈兘涓虹┖", trigger: "change"}
         ],
+        remarks: [
+          {max: 128, message: '鏈�澶氳緭鍏�128涓瓧绗�', trigger: 'blur' }
+        ]
       },
       // 鐪佷唤
       provinceList: [],
@@ -304,12 +322,15 @@
       // 鐪佷唤
       provinceFormList: [],
       // 鍩庡競
-      cityFormList: []
+      cityFormList: [],
+      buildOpen: false,
+      id: undefined
     };
   },
   created() {
     this.getProvince().then(res => {
       this.provinceList = res
+      this.provinceFormList = res
     })
     this.getList();
   },
@@ -382,6 +403,10 @@
       getSchool(id).then(response => {
         this.loading = false;
         this.form = response.data;
+        listCity(this.form.provinceCode)
+          .then(res => {
+            this.cityFormList = res.data
+          })
         this.open = true;
         this.title = "淇敼瀛︽牎";
       });
@@ -414,7 +439,7 @@
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('鏄惁纭鍒犻櫎锛�').then(() => {
+      this.$modal.confirm(`鏄惁纭鍒犻櫎瀛︽牎浠g爜涓�${row.code}鐨勫鏍★紵`).then(() => {
         this.loading = true;
         return delSchool(ids);
       }).then(() => {
@@ -449,7 +474,6 @@
     },
     // 鏌ヨ鏉′欢鐪佷唤鏀瑰彉
     provinceQueryChange(v) {
-      this.queryParams.cityCode = undefined
       this.getCity(v).then(res => {
         this.cityList = res
       })
@@ -460,6 +484,11 @@
       this.getCity(v).then(res => {
         this.cityFormList = res
       })
+    },
+    // 寤虹瓚
+    handleBuild(r) {
+      this.id = r.id;
+      this.buildOpen = true;
     }
   }
 };

--
Gitblit v1.9.1