From 4e86fd38a29427a8bb50d73d8eb22f21dfb943d4 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 25 十一月 2024 18:38:20 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 admin/src/views/workorder/workorderList.vue |  144 +++++++++++++++++++++++++++++++++++-------------
 1 files changed, 105 insertions(+), 39 deletions(-)

diff --git a/admin/src/views/workorder/workorderList.vue b/admin/src/views/workorder/workorderList.vue
index 1173e81..0936036 100644
--- a/admin/src/views/workorder/workorderList.vue
+++ b/admin/src/views/workorder/workorderList.vue
@@ -2,19 +2,35 @@
   <TableLayout :permissions="['business:ywworkorder:query']">
     <!-- 鎼滅储琛ㄥ崟 -->
     <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
-      <el-form-item prop="areaType">
+      <el-form-item prop="areaType" label="浣嶇疆绫诲埆">
         <el-select v-model="searchForm.areaType">
           <el-option label="瀹ゅ唴缁翠慨" value="0"></el-option>
           <el-option label="鍏叡缁翠慨" value="1"></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="璇烽�夋嫨鎶ヤ慨鍖哄煙" prop="buildingId">
-        <el-input v-model="searchForm.buildingId" placeholder="璇疯緭鍏ユ墍灞為」鐩紪鐮侊紙鍏宠仈yw_building)"
-          @keypress.enter.native="search"></el-input>
+      <el-form-item label="閫夋嫨椤圭洰" prop="projectId">
+        <el-select v-model="searchForm.projectId" @change="getBuild" clearable filterable>
+          <el-option v-for="item in projectList" :label="item.name" :value="item.id" />
+        </el-select>
       </el-form-item>
-      <el-form-item prop="cateId">
-        <el-input v-model="searchForm.cateId" placeholder="鎶ヤ慨鐗╁搧绫诲埆" @keypress.enter.native="search"></el-input>
+      <el-form-item label="閫夋嫨妤煎畤" prop="buildingId">
+        <el-select v-model="searchForm.buildingId" clearable filterable>
+          <el-option v-for="item in buildList" :label="item.name" :value="item.id" />
+        </el-select>
       </el-form-item>
+      <el-form-item prop="cateId" label="鐗╁搧绫诲埆">
+        <el-cascader v-model="searchForm.areaIds" @change="changeSel" placeholder="璇烽�夋嫨宸℃鍖哄煙" clearable
+          :options="cateList" :props="{
+            label: 'name',
+            value: 'id',
+            children: 'childCategoryList'
+          }"></el-cascader>
+      </el-form-item>
+      <el-form-item label="鎻愪氦鏃ユ湡">
+        <el-date-picker v-model="searchForm.selDate" @change="changeSelDate" format="yyyy-MM-dd"
+          value-format="yyyy-MM-dd" type="daterange"></el-date-picker>
+      </el-form-item>
+
       <section>
         <el-button type="primary" @click="search">鎼滅储</el-button>
         <el-button type="primary" :loading="isWorking.export" v-permissions="['business:ywworkorder:exportExcel']"
@@ -37,10 +53,15 @@
             <span v-if="scope.row.areaType == 1">鍏叡鍖哄煙</span>
           </template>
         </el-table-column>
-        <el-table-column prop="" label="鎶ヤ慨鍖哄煙" min-width="100px"></el-table-column>
-        <el-table-column prop="cateName" label="鎶ヤ慨鐗╁搧绫诲瀷" min-width="100px"></el-table-column>
-        <el-table-column prop="userName" label="涓婃姤浜�" min-width="100px"></el-table-column>
-        <el-table-column prop="submitDate" label="涓婃姤鏃堕棿" min-width="100px"></el-table-column>
+        <el-table-column prop="" label="鎶ヤ慨鍖哄煙" min-width="100px">
+          <template v-slot="scope">
+            <span>{{ scope.row.buildingName }} / {{ scope.row.areaType == 0 ? scope.row.roomNum : scope.row.floorName
+              }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="categoryName" label="鐗╁搧绫诲瀷" min-width="100px"></el-table-column>
+        <el-table-column prop="creatorName" label="涓婃姤浜�" min-width="100px"></el-table-column>
+        <el-table-column prop="createDate" label="涓婃姤鏃堕棿" min-width="100px"></el-table-column>
         <el-table-column prop="dealUserName" label="澶勭悊浜�" min-width="100px"></el-table-column>
         <el-table-column label="澶勭悊缁撴灉" min-width="100px">
           <template slot-scope="{row}">
@@ -49,16 +70,17 @@
             <span v-if="row.dealStatus == 2">宸插鐞�</span>
           </template>
         </el-table-column>
-        <el-table-column v-if="containPermissions(['business:ywworkorder:update'])"
-          label="鎿嶄綔" min-width="80" fixed="right">
+        <el-table-column v-if="containPermissions(['business:ywworkorder:update'])" label="鎿嶄綔" min-width="80"
+          fixed="right">
           <template slot-scope="{row}">
-            <span class="primaryColor cu">鏌ョ湅璇︽儏</span>
+            <span @click="handleDetail(row)" class="primaryColor cu">鏌ョ湅璇︽儏</span>
           </template>
         </el-table-column>
       </el-table>
       <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination">
       </pagination>
     </template>
+    <Detail v-if="showDetail" ref="DetailRef" @close="showDetail = false" @success="search" />
     <!-- 鏂板缓/淇敼 -->
     <OperaYwWorkorderWindow ref="operaYwWorkorderWindow" @success="handlePageChange" />
   </TableLayout>
@@ -69,43 +91,29 @@
 import TableLayout from '@/layouts/TableLayout'
 import Pagination from '@/components/common/Pagination'
 import OperaYwWorkorderWindow from './components/OperaYwWorkorderWindow'
+import Detail from './components/detail'
+import { getBuildList } from '@/api/project/ywBuilding'
+import { getProjectList } from '@/api/project/ywProject'
+import { fetchList as getCateList } from '@/api/business/category.js'
 export default {
   name: 'YwWorkorder',
   extends: BaseTable,
-  components: { TableLayout, Pagination, OperaYwWorkorderWindow },
+  components: { TableLayout, Pagination,Detail, OperaYwWorkorderWindow },
   data() {
     return {
       // 鎼滅储
+      showDetail: false,
       searchForm: {
+        selDate: [],
         areaType: '',
-        creator: '',
-        createDate: '',
-        editor: '',
-        editDate: '',
-        isdeleted: '',
-        title: '',
-        remark: '',
-        status: '',
-        sortnum: '',
-        content: '',
-        getDate: '',
+        areaIds: '',
         projectId: '',
         buildingId: '',
-        roomId: '',
-        userId: '',
-        phone: '',
-        submitDate: '',
         cateId: '',
-        code: '',
-        dealStatus: '',
-        dispatchUserId: '',
-        dispatchDate: '',
-        dispatchInfo: '',
-        dealUserId: '',
-        dealDate: '',
-        dealInfo: '',
-        dealType: ''
-      }
+      },
+      projectList: [],
+      buildList: [],
+      cateList: [],
     }
   },
   created() {
@@ -116,6 +124,64 @@
       'field.main': 'id'
     })
     this.search()
+    this.initData()
+  },
+  methods: {
+    handleDetail(row) {
+      this.showDetail = true
+      this.$nextTick(() => {
+        this.$refs.DetailRef.visible = true
+        this.$refs.DetailRef.id = row.id
+        this.$refs.DetailRef.getDetail()
+        
+      })
+    },
+    initData() {
+      getProjectList({}).then(res => {
+        this.projectList = res
+      })
+      getCateList({
+        model: { type: 3 },
+        capacity: 1000,
+        page: 1,
+      }).then(res => {
+        this.cateList = res.records || []
+      })
+    },
+    getBuild(projectId) {
+      this.$set(this.searchForm, 'buildingId', '')
+      getBuildList({ projectId }).then(res => {
+        this.buildList = res
+      })
+    },
+    changeSel(e) {
+      if (e && e.length == 2) {
+        this.$set(this.searchForm, 'cateId', e[1])
+      } else {
+        this.$set(this.searchForm, 'cateId', '')
+      }
+    },
+    reset() {
+      this.searchForm = {
+        selDate: [],
+        areaType: '',
+        areaIds: '',
+        projectId: '',
+        buildingId: '',
+        cateId: '',
+      }
+      this.search()
+    },
+    changeSelDate(e) {
+      if (e && e.length > 0) {
+        this.$set(this.searchForm, 'queryStartTime', e[0] + ' 00:00:00')
+        this.$set(this.searchForm, 'queryEndTime', e[1] + ' 23:59:59')
+      } else {
+        this.$set(this.searchForm, 'queryStartTime', '')
+        this.$set(this.searchForm, 'queryEndTime', '')
+      }
+
+    },
   }
 }
 </script>

--
Gitblit v1.9.3