From d7dca690cedd12e271f0ee0b9050679d73796f5c Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期一, 06 一月 2025 09:28:10 +0800
Subject: [PATCH] 1

---
 admin/src/views/workorder/components/OperaYwWorkorderWindow.vue |   93 ++++++++++++++++++++++++++++++++++------------
 1 files changed, 69 insertions(+), 24 deletions(-)

diff --git a/admin/src/views/workorder/components/OperaYwWorkorderWindow.vue b/admin/src/views/workorder/components/OperaYwWorkorderWindow.vue
index 9eb7fcf..c97fbf4 100644
--- a/admin/src/views/workorder/components/OperaYwWorkorderWindow.vue
+++ b/admin/src/views/workorder/components/OperaYwWorkorderWindow.vue
@@ -1,5 +1,6 @@
 <template>
-  <GlobalWindow width="800px" :title="title" :visible.sync="visible" :confirm-working="isWorking" @confirm="confirm">
+  <GlobalWindow width="800px" :title="title" :visible.sync="visible" @close="close" :confirm-working="isWorking"
+    @confirm="confirm">
     <el-form :model="form" ref="form" :rules="rules">
       <el-form-item label="浣嶇疆绫诲瀷" prop="areaType">
         <el-select v-model="form.areaType">
@@ -18,18 +19,18 @@
         </el-select>
       </el-form-item>
 
-      <el-form-item label="閫夋嫨妤煎眰" prop="floorId">
+      <el-form-item v-if="form.areaType == 1" label="閫夋嫨妤煎眰" prop="floorId">
         <el-select v-model="form.floorId">
           <el-option v-for="item in levelList" clearable filterable :label="item.name" :value="item.id" />
         </el-select>
       </el-form-item>
       <el-form-item v-if="form.areaType == 0" label="閫夋嫨鎴块棿" prop="roomId">
         <el-select v-model="form.roomId" clearable filterable>
-          <el-option v-for="item in roomList" :label="item.name" :value="item.id" />
+          <el-option v-for="item in roomList" :label="item.roomNum" :value="item.id" />
         </el-select>
       </el-form-item>
-      <el-form-item label="鍒嗙被" prop="cateId">
-        <el-cascader v-model="form.areaIds" @change="changeSel" placeholder="璇烽�夋嫨宸℃鍖哄煙" clearable :options="cateList"
+      <el-form-item label="宸ュ崟鍒嗙被" prop="cateId">
+        <el-cascader v-model="form.areaIds" @change="changeSel" placeholder="璇烽�夋嫨鍒嗙被" clearable :options="cateList"
           :props="{
             label: 'name',
             value: 'id',
@@ -74,7 +75,7 @@
 import { getProjectList } from '@/api/project/ywProject'
 import { getBuildList } from '@/api/project/ywBuilding'
 import { getRoomList } from '@/api/project/ywRoom'
-import { fetchList } from '@/api/project/yeFloor'
+import { getFloorList } from '@/api/project/yeFloor'
 import { fetchList as getCateList } from '@/api/business/category.js'
 import { rules } from './config'
 export default {
@@ -86,12 +87,8 @@
       // 琛ㄥ崟鏁版嵁
       form: {
         id: null,
-        creator: '',
-        createDate: '',
-        editor: '',
         editDate: '',
         floor: '',
-        isdeleted: '',
         title: '',
         remark: '',
         status: '',
@@ -103,7 +100,6 @@
         floorId: '',
         roomId: '',
         userId: '',
-        phone: '',
         submitDate: '',
         cateId: '',
         areaType: '0',
@@ -128,7 +124,7 @@
       uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/visitsAdmin/cloudService/public/uploadBatch',
       fileList: [],
       uploadData: {
-        folder: 'HIDDEN_DANGER_FILE'
+        folder: 'YW_WORKORDER_FILE'
       },
     }
   },
@@ -144,9 +140,40 @@
       this.visible = true
       this.getProject()
       this.getCate()
-      // 鏂板缓
+      // 鏂板缓 
       if (target == null) {
+        this.form = {
+          id: null,
+          editDate: '',
+          floor: '',
+          title: '',
+          remark: '',
+          status: '',
+          sortnum: '',
+          content: '',
+          getDate: '',
+          projectId: '',
+          buildingId: '',
+          floorId: '',
+          roomId: '',
+          userId: '',
+          submitDate: '',
+          cateId: '',
+          areaType: '0',
+          code: '',
+          dealStatus: '',
+          dispatchUserId: '',
+          dispatchDate: '',
+          dispatchInfo: '',
+          dealUserId: '',
+          dealDate: '',
+          dealInfo: '',
+          dealType: ''
+        }
         this.$nextTick(() => {
+          this.buildList = []
+          this.roomList = []
+          this.levelList = []
           this.$refs.form.resetFields()
           this.form[this.configData['field.id']] = null
         })
@@ -159,9 +186,17 @@
         }
       })
     },
+    close() {
+      this.visible = false
+      this.$emit('close')
+    },
     getProject() {
       getProjectList({}).then(res => {
-        this.projectList = res
+        this.projectList = res || []
+        if(this.projectList.length > 0){
+          this.$set(this.form, 'projectId', this.projectList[0].id)
+          this.getBuild(this.projectList[0].id)
+        }
       })
     },
     getBuild(projectId) {
@@ -169,18 +204,27 @@
       this.$set(this.form, 'floorId', '')
       this.$set(this.form, 'roomId', '')
       getBuildList({ projectId }).then(res => {
-        this.buildList = res
+        this.buildList = res || []
+        // if(projectId && this.buildList.length > 0){
+        //   this.$set(this.form, 'buildingId', this.buildList[0].id)
+        //   this.changeBuild(this.buildList[0].id)
+        // }
       })
     },
     changeBuild(e) {
       this.$set(this.form, 'floorId', '')
       this.$set(this.form, 'roomId', '')
-      this.getLevel(e)
-      this.getRoom(e)
+      if (this.form.areaType == 1) {
+        this.getLevel(e)
+      } else {
+        this.getRoom(e)
+      }
+
+
     },
     getLevel(buildingId) {
-      fetchList({ model: { buildingId }, capacity: 9999, page: 1 }).then(res => {
-        this.levelList = res.records
+      getFloorList({ buildingId }).then(res => {
+        this.levelList = res
       })
     },
     getRoom(buildingId) {
@@ -190,12 +234,11 @@
       })
     },
     changeSel(e) {
-      if(e && e.length == 2){
+      if (e && e.length == 2) {
         this.$set(this.form, 'cateId', e[1])
-      }else{
+      } else {
         this.$set(this.form, 'cateId', '')
       }
-      
     },
     getCate() {
       getCateList({
@@ -247,12 +290,14 @@
           fileurlFull: item.url
         })
       }
-      console.log('file', this.fileList)
-      // this.$set(this.param, 'faceImg', file.imgurl)
+
+      // console.log('file', this.fileList)
+      this.$set(this.form, 'fileList', this.fileList)
       // this.$set(this.param, 'faceImgUrl', file.imgurlfull)
     },
     handleDelImg(i) {
       this.fileList.splice(i, 1)
+      this.$set(this.form, 'fileList', this.fileList)
     },
     close() {
       this.isShowModal = false

--
Gitblit v1.9.3