wenhongquan 2 anos atrás
pai
commit
edc7685f20

+ 7 - 3
src/App.vue

@@ -1,3 +1,7 @@
-<template>
-  <router-view />
-</template>
+<template>
+   <!-- <el-config-provider :locale="'zh-cn'"> -->
+     <router-view />
+
+   <!-- </el-config-provider> -->
+
+</template>

+ 52 - 44
src/api/system/facilities.js

@@ -1,44 +1,52 @@
-import request from '@/utils/request'
-
-// 查询设施列表
-export function listFacilities(query) {
-  return request({
-    url: '/system/facilities/list',
-    method: 'get',
-    params: query
-  })
-}
-
-// 查询设施详细
-export function getFacilities(id) {
-  return request({
-    url: '/system/facilities/' + id,
-    method: 'get'
-  })
-}
-
-// 新增设施
-export function addFacilities(data) {
-  return request({
-    url: '/system/facilities',
-    method: 'post',
-    data: data
-  })
-}
-
-// 修改设施
-export function updateFacilities(data) {
-  return request({
-    url: '/system/facilities',
-    method: 'put',
-    data: data
-  })
-}
-
-// 删除设施
-export function delFacilities(id) {
-  return request({
-    url: '/system/facilities/' + id,
-    method: 'delete'
-  })
-}
+import request from '@/utils/request'
+
+// 查询设施列表
+export function listFacilities(query) {
+    return request({
+        url: '/system/facilities/list',
+        method: 'get',
+        params: query
+    })
+}
+
+export function listFacilities1(query) {
+    return request({
+        url: '/system/facilities/list',
+        method: 'post',
+        data: query
+    })
+}
+
+// 查询设施详细
+export function getFacilities(id) {
+    return request({
+        url: '/system/facilities/' + id,
+        method: 'get'
+    })
+}
+
+// 新增设施
+export function addFacilities(data) {
+    return request({
+        url: '/system/facilities',
+        method: 'post',
+        data: data
+    })
+}
+
+// 修改设施
+export function updateFacilities(data) {
+    return request({
+        url: '/system/facilities',
+        method: 'put',
+        data: data
+    })
+}
+
+// 删除设施
+export function delFacilities(id) {
+    return request({
+        url: '/system/facilities/' + id,
+        method: 'delete'
+    })
+}

+ 18 - 0
src/router/index.js

@@ -269,6 +269,24 @@ export const constantRoutes = [{
         }, ],
     },
     {
+        path: "/system/facilities",
+        component: Layout,
+        hidden: true,
+        children: [{
+            path: "",
+            component: () =>
+                import ("@/views/system/facilities/index"),
+            name: "facilitiesindex",
+            meta: { title: "设施列表", activeMenu: "/system/facilities" },
+        }, {
+            path: "detail/:id",
+            component: () =>
+                import ("@/views/system/facilities/detail"),
+            name: "facilitiesdetail",
+            meta: { title: "设施详请", activeMenu: "/system/facilities" },
+        }, ],
+    },
+    {
         path: "/monitor/job-log",
         component: Layout,
         hidden: true,

+ 71 - 0
src/utils/ruoyi.js

@@ -246,4 +246,75 @@ export async function blobValidate(data) {
     } catch (error) {
         return true;
     }
+}
+
+export function getfacilitiesdesname(key) {
+    const namejson = {
+        tz_id: { type: "text", des: "台账编号" },
+        tz_road: { type: "text", des: "所在道路" },
+        tz_ssly: { type: "text", des: "所属流域" },
+        pics: { type: "img", des: "施工图纸" },
+        tz_area_old: { type: "text", des: "区属(资料)" },
+        tz_area_new: { type: "text", des: "区属(行政)" },
+        tz_ss_name: { type: "text", des: "设施名称(工程资料名称)" },
+        tz_ss_road: { type: "text", des: "现况路名" },
+        tz_ss_pstz: { type: "text", des: "排水体制" },
+        tz_pkbh: { type: "text", des: "排口编号" },
+        tz_ss_road_se: { type: "text", des: "设施起止点(资料)" },
+        tz_ss_road_start: { type: "text", des: "实际管线起点" },
+        tz_ss_road_end: { type: "text", des: "实际管线终点" },
+        tz_ss_river: { type: "text", des: "河道流域(排入水体)" },
+        tz_gwly: { type: "text", des: "管网流域" },
+        tz_pfk: { type: "text", des: '排河口(座)', des1: "排放口" },
+        tz_xlymc: { type: "text", des: "小流域名称" },
+        tz_ss_dn: { type: "text", des: "管径范围(mm)" },
+        tz_ss_data_length: { type: "text", des: "运维设施长度(m)" },
+        tz_ss_data_main_length: { type: "text", des: "主管长度(m)" },
+        tz_ss_data_minor_length: { type: "text", des: "支管长度(m)" },
+        tz_ss_data_jing: { type: "text", des: "检查井数量(座)" },
+        tz_ss_data_ysk: { type: "text", des: "雨水口数量(座)" },
+        tz_bz_total: { type: "text", des: "箅子数量(块)共计" },
+        tz_bz_dan: { type: "text", des: '单箅(块)', des1: "箅子数量(块)单箅" },
+        tz_bz_shuang: { type: "text", des: '双箅(块)', des1: "箅子数量(块)双箅" },
+        tz_bz_san: { type: "text", des: '三箅(块)', des1: "箅子数量(块)三箅" },
+        tz_bz_si: { type: "text", des: '四箅(块)', des1: "箅子数量(块)四箅" },
+        tz_bz_duo: { type: "text", des: '多联箅(块)', des1: "箅子数量(块)多联箅" },
+        tz_jgsj: { type: "text", des: "竣工时间(建设)" },
+        tz_gjsj: { type: "text", des: "改建时间" },
+        tz_yssj: { type: "text", des: "验收时间" },
+        tz_ss_type: { type: "text", des: "管线类型(圆管、方沟、明渠)" },
+        tz_ss_cz: {
+            type: "text",
+            des: "管线材质(混凝土、钢管、铸铁管、pvc、复合管等)",
+        },
+        tz_dlj: { type: "text", des: "跌落井(座)" },
+        tz_jlj: { type: "text", des: "截流井(座)" },
+        tz_dhx: { type: "text", des: "倒虹吸(座)" },
+        tz_jsk: { type: "text", des: "进水口(是否有U型渠接入雨水管线等)" },
+        tz_zm_type: { type: "text", des: "闸门类型" },
+        tz_zm_material: { type: "text", des: "闸门材质" },
+        tz_ss_info: { type: "text", des: "移交来源" },
+        tz_ss_from: { type: "text", des: "移交单位" },
+        tz_ss_time: { type: "text", des: "移交时间" },
+        tz_ss_unit: { type: "text", des: "责任班组" },
+        tz_jssj: { type: "text", des: "接收时间" },
+        tz_ss_more: { type: "textarea", des: "备注" },
+        tz_xfgj_xxgq: {
+            type: "text",
+            des: "细分管径 小型管渠 Φ<DN600mm/截面积<0.283㎡",
+        },
+        tz_xfgj_zxgj: {
+            type: "text",
+            des: "细分管径 中型管径 DN600mm≤Φ≤DN1000mm/0.283㎡≤截面积≤0.785㎡",
+        },
+        tz_xfgj_dxgj: {
+            type: "text",
+            des: "细分管径 大型管径 DN1000mm<Φ≤DN1500mm/0.785㎡<截面积≤1.766㎡",
+        },
+        tz_xfgj_tdxgj: {
+            type: "text",
+            des: "细分管径 特大型管径 Φ> DN1500mm以上/截面积> 1.766㎡",
+        },
+    };
+    return namejson[key] ? namejson[key] : "-";
 }

+ 376 - 0
src/views/system/facilities/detail/index.vue

@@ -0,0 +1,376 @@
+<template>
+  <div style="padding: 10px 15px"  v-loading="loading">
+    <div class="taskdetail">
+      <div class="title">
+        {{ facilite.ext1?.tz_ss_name }}设施详情
+
+        <div class="btngroup">
+          <el-button
+            type="danger"
+            @click="
+              () => {
+                router.back();
+              }
+            "
+            >返回</el-button
+          >
+        </div>
+      </div>
+      <div class="card">
+        <div class="title" style="position: relative">
+          基本信息
+          <div
+            style="position: absolute; right: 10px; top: 0; color: #333; font-size: 20px"
+          ></div>
+        </div>
+        <div class="body">
+          <el-row>
+            <el-col
+              :span="6"
+              v-for="key in [
+                'tz_id',
+                'tz_ss_name',
+                'tz_ss_road_se',
+                'tz_ss_info',
+                'tz_area_new',
+                'tz_ss_data_length',
+                'tz_ss_dn',
+                'tz_ss_time',
+                'tz_ss_unit',
+                'tz_ssly',
+                'tz_jssj',
+                'tz_ss_from',
+                'tz_ss_pstz',
+                'tz_ss_data_jing',
+                'tz_ss_data_ysk',
+                'tz_pfk',
+              ]"
+            >
+              {{ getvaluebykey(key) }}
+            </el-col>
+            <el-col
+              :span="4"
+              v-for="key in [
+                'tz_bz_dan',
+                'tz_bz_shuang',
+                'tz_bz_san',
+                'tz_bz_si',
+                'tz_bz_duo',
+              ]"
+            >
+              {{ getvaluebykey(key) }}
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+
+      <div class="card">
+        <div class="title" style="position: relative">
+          补充信息
+          <div
+            style="position: absolute; right: 10px; top: 0; color: #333; font-size: 20px"
+          >
+            <el-button type="primary" @click="showbc = true">编辑</el-button>
+          </div>
+        </div>
+        <div class="body">
+          <el-row>
+            <el-col
+              :span="6"
+              v-for="key in [
+                'tz_ss_road',
+                'tz_ss_road_start',
+                'tz_ss_road_end',
+                'tz_jgsj',
+                'tz_ss_type',
+                'tz_ss_data_main_length',
+                'tz_ss_data_minor_length',
+                'tz_ss_river',
+                'tz_gwly',
+                'tz_xlymc',
+                'tz_pkbh',
+              ]"
+            >
+              {{ getvaluebykey(key) }}
+            </el-col>
+            <el-col :span="24" v-for="key in ['tz_ss_more']">
+              {{ getvaluebykey(key) }}
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+
+      <div class="card">
+        <div class="title" style="position: relative">
+          施工图纸
+          <div
+            style="position: absolute; right: 10px; top: 0; color: #333; font-size: 20px"
+          >
+            <el-button type="primary" @click="showpic = true">编辑</el-button>
+          </div>
+        </div>
+        <div class="body">
+          <el-row>
+            <el-col :span="24">
+              <ImagePreview
+                v-model:src="facilite.ext1.pics"
+                :height="'120px'"
+                :width="'120px'"
+              ></ImagePreview>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+    </div>
+
+    <el-dialog v-model="showbc" title="设施补充信息编辑" width="80vw" draggable>
+      <div>
+        <el-form :model="facilite">
+          <el-row>
+            <el-col
+              :span="8"
+              style="padding-right: 10px"
+              v-for="key in [
+                'tz_ss_road',
+                'tz_ss_road_start',
+                'tz_ss_road_end',
+                'tz_jgsj',
+                'tz_ss_type',
+                'tz_ss_data_main_length',
+                'tz_ss_data_minor_length',
+                'tz_ss_river',
+                'tz_gwly',
+                'tz_xlymc',
+                'tz_pkbh',
+              ]"
+            >
+              <el-form-item :label="getfacilitiesdesname(key).des + ':'">
+                <el-input
+                  v-model="facilite.ext1[key]"
+                  :type="getfacilitiesdesname(key).type"
+                  placeholder="请输入"
+              /></el-form-item>
+            </el-col>
+            <el-col :span="24" v-for="key in ['tz_ss_more']">
+              <el-form-item :label="getfacilitiesdesname(key).des + ':'">
+                <el-input
+                  v-model="facilite.ext1[key]"
+                  :type="getfacilitiesdesname(key).type"
+                  placeholder="请输入"
+              /></el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="showbc = false">取消</el-button>
+          <el-button type="primary" @click="savedata">确定</el-button>
+        </span>
+      </template>
+    </el-dialog>
+
+    <el-dialog v-model="showpic" title="施工图纸编辑" draggable>
+      <div>
+        <el-row>
+          <el-col :span="24">
+            <ImageUpload v-model="facilite.ext1.pics" :limit="20"></ImageUpload>
+          </el-col>
+        </el-row>
+      </div>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="showpic = false">取消</el-button>
+          <el-button type="primary" @click="savedata">确定</el-button>
+        </span>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+<script setup>
+import router from "../../../../router";
+import { defineComponent, ref, onMounted, watch } from "vue";
+import { getfacilitiesdesname } from "@/utils/ruoyi";
+import { useRoute } from "vue-router";
+import { useDict } from "@/utils/dict";
+import { cloneDeep } from "lodash";
+import ImagePreview from "@/components/ImagePreview";
+import ImageUpload from "@/components/ImageUpload";
+import { listDept, getDept } from "@/api/system/dept";
+import { treeselect as deptTreeselect } from "@/api/system/dept";
+import {
+  listFacilities,
+  listFacilities1,
+  getFacilities,
+  delFacilities,
+  addFacilities,
+  updateFacilities,
+} from "@/api/system/facilities";
+
+const {
+  task_status,
+  task_type,
+  task_event_type,
+  task_event_category,
+  sys_area,
+  facilities_pstz,
+} = useDict(
+  "task_status",
+  "task_type",
+  "task_event_type",
+  "task_event_category",
+  "sys_area",
+  "facilities_pstz"
+);
+const { proxy } = getCurrentInstance();
+const route = useRoute();
+const alldept = ref([]);
+const treedept = ref([]);
+const showbc = ref(false);
+const showpic = ref(false);
+const facilite = ref({ ext1: {} });
+const loading = ref(true);
+
+const getvaluebykey = (key) => {
+  var val = facilite.value.ext1[key] ?? "";
+  switch (key) {
+    case "tz_area_new": {
+      val = (sys_area.value ?? []).filter((i) => i.value === val + "")[0]?.label ?? "-";
+      break;
+    }
+    case "tz_ss_pstz": {
+      val =
+        (facilities_pstz.value ?? []).filter((i) => i.value === val + "")[0]?.label ??
+        "-";
+      break;
+    }
+    case "tz_ss_unit": {
+      val = (val == "" ? [] : val ?? [])
+        .map((i) => {
+          return (
+            alldept.value.find((p) => {
+              return p.deptId + "" === i + "";
+            })?.deptName ?? "-"
+          );
+        })
+        .join("、");
+      break;
+    }
+    default: {
+    }
+  }
+  if (val == "") {
+    val = " - ";
+  }
+
+  return getfacilitiesdesname(key).des + ":" + val;
+};
+
+const savedata = () => {
+ loading.value = true;
+  var ddf = cloneDeep(facilite.value);
+  ddf.ext1 = JSON.stringify(ddf.ext1);
+  updateFacilities(ddf).then((response) => {
+    proxy.$modal.msgSuccess("修改成功");
+    showbc.value = false;
+    showpic.value = false;
+    getfacilitieinfo();
+  });
+};
+
+const getfacilitieinfo = () => {
+  getFacilities(route.params.id).then((response) => {
+    facilite.value = response.data;
+    loading.value = false;
+    facilite.value.ext1 = JSON.parse(facilite.value.ext1);
+  });
+}
+
+{
+  if (!route.params.id || route.params.id == "undefined") {
+    router.back();
+  }
+  listDept().then((response) => {
+    alldept.value = cloneDeep(response.data);
+  });
+  function setdatakey(dept) {
+    if (dept.children) {
+      dept.children = dept.children.map((i) => {
+        return setdatakey(i);
+      });
+    }
+    dept["value"] = dept.id;
+    return dept;
+  }
+  deptTreeselect().then((res) => {
+    treedept.value = [setdatakey(res.data[0])];
+  });
+
+  getfacilitieinfo();
+}
+</script>
+
+<style lang="scss">
+.demo-tabs {
+  width: 100%;
+}
+.el-select {
+  width: 100% !important;
+}
+.taskdetail {
+  background: #fff;
+  padding: 30px 22px;
+  border-radius: 8px;
+  overflow-y: auto;
+  padding-top: 20px;
+  position: relative;
+
+  // .el-select {
+  //   width: 100%;
+  // }
+
+  .title {
+    color: #2b3551;
+    font-size: 16px;
+    font-weight: 400;
+    .btngroup {
+      position: absolute;
+      top: 13px;
+      right: 20px;
+      .el-button {
+        margin-left: 25px;
+      }
+    }
+  }
+  .card {
+    border: 1px solid #e5e9f2;
+    border-radius: 8px;
+    margin-top: 16px;
+    overflow: hidden;
+    .title {
+      background: rgba(192, 204, 218, 0.2);
+      height: 54px;
+      line-height: 54px;
+      color: #324057;
+      font-size: 14px;
+      font-weight: Bold;
+      padding-left: 22px;
+    }
+    .body {
+      padding: 20px;
+      color: #475669;
+      font-size: 14px;
+      // padding-top: 10px;
+      .el-col {
+        margin-bottom: 20px;
+      }
+      .titleheader {
+        color: #2c7de3;
+        font-weight: Bold;
+        margin-bottom: 24px;
+        margin-top: 20px;
+      }
+    }
+  }
+}
+</style>

+ 541 - 171
src/views/system/facilities/index.vue

@@ -1,80 +1,81 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="区属" prop="areaDes">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
+      <el-form-item label="台账编号" prop="params.ext1.tz_id">
         <el-input
-          v-model="queryParams.areaDes"
-          placeholder="请输入区属"
+          v-model="queryParams.params.ext1.tz_id"
+          placeholder="请输入"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="行政区属" prop="areaAdDes">
+      <el-form-item label="设施名称" prop="params.ext1.tz_ss_name">
         <el-input
-          v-model="queryParams.areaAdDes"
-          placeholder="请输入行政区属"
+          v-model="queryParams.params.ext1.tz_ss_name"
+          placeholder="请输入"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="扩展序号" prop="exId">
+      <el-form-item label="关键字" prop="params.keyword">
         <el-input
-          v-model="queryParams.exId"
-          placeholder="请输入扩展序号"
+          v-model="queryParams.params.keyword"
+          placeholder="所属流域/管径范围"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="设施名称" prop="name">
-        <el-input
-          v-model="queryParams.name"
-          placeholder="请输入设施名称"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="路名" prop="roadName">
-        <el-input
-          v-model="queryParams.roadName"
-          placeholder="请输入路名"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="性质(雨水、污水)" prop="nature">
-        <el-input
-          v-model="queryParams.nature"
-          placeholder="请输入性质(雨水、污水)"
+      <el-form-item label="城区" prop="params.ext1.tz_area_new">
+        <el-select
+          v-model="queryParams.params.ext1.tz_area_new"
+          class="m-2"
+          placeholder="请选择"
           clearable
           @keyup.enter.native="handleQuery"
-        />
+        >
+          <el-option
+            v-for="item in sys_area"
+            :label="item.label"
+            :value="item.value"
+          ></el-option>
+        </el-select>
       </el-form-item>
-      <el-form-item label="设施起点" prop="addrFrom">
-        <el-input
-          v-model="queryParams.addrFrom"
-          placeholder="请输入设施起点"
-          clearable
+      <el-form-item label="管辖班组" prop="params.ext1.tz_ss_unit">
+        <el-tree-select
+          v-model="queryParams.params.ext1.tz_ss_unit"
+          :data="treedept"
+          check-strictly="true"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="设施终点" prop="addrEnd">
-        <el-input
-          v-model="queryParams.addrEnd"
-          placeholder="请输入设施终点"
+      <el-form-item label="排水体制" prop="params.ext1.tz_ss_pstz">
+        <el-select
+          v-model="queryParams.params.ext1.tz_ss_pstz"
+          class="m-2"
+          placeholder="请选择"
           clearable
           @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="扩展编号1" prop="exId1">
-        <el-input
-          v-model="queryParams.exId1"
-          placeholder="请输入扩展编号1"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+        >
+          <el-option
+            v-for="item in facilities_pstz"
+            :label="item.label"
+            :value="item.value"
+          ></el-option>
+        </el-select>
+
       </el-form-item>
+
       <el-form-item>
-        <el-button type="primary" icon="search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button type="primary" icon="search" size="mini" @click="handleQuery"
+          >搜索</el-button
+        >
         <el-button icon="refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
@@ -88,7 +89,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['system:facilities:add']"
-        >新增</el-button>
+          >新增</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -97,9 +99,10 @@
           icon="Edit"
           size="mini"
           :disabled="single"
-          @click="handleUpdate"
+          @click.stop="handleUpdate"
           v-hasPermi="['system:facilities:edit']"
-        >修改</el-button>
+          >修改</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -108,9 +111,10 @@
           icon="Delete"
           size="mini"
           :disabled="multiple"
-          @click="handleDelete"
+          @click.stop="handleDelete"
           v-hasPermi="['system:facilities:remove']"
-        >删除</el-button>
+          >删除</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -120,45 +124,86 @@
           size="mini"
           @click="handleExport"
           v-hasPermi="['system:facilities:export']"
-        >导出</el-button>
+          >导出</el-button
+        >
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="facilitiesList" @selection-change="handleSelectionChange">
+    <el-table
+      v-loading="loading"
+      :data="facilitiesList"
+      @row-click="itemclick"
+      @selection-change="handleSelectionChange"
+    >
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="序号" align="center" prop="id" />
-      <el-table-column label="区属" align="center" prop="areaDes" />
-      <el-table-column label="行政区属" align="center" prop="areaAdDes" />
-      <el-table-column label="扩展序号" align="center" prop="exId" />
-      <el-table-column label="设施名称" align="center" prop="name" />
-      <el-table-column label="路名" align="center" prop="roadName" />
-      <el-table-column label="性质(雨水、污水)" align="center" prop="nature" />
-      <el-table-column label="设施起点" align="center" prop="addrFrom" />
-      <el-table-column label="设施终点" align="center" prop="addrEnd" />
-      <el-table-column label="扩展编号1" align="center" prop="exId1" />
+      <el-table-column label="台账编号" align="center" prop="ext1.tz_id" />
+      <el-table-column label="行政区属" align="center" prop="ext1.tz_area_new">
+        <template #default="scope">
+          {{
+            (sys_area ?? []).filter((i) => i.value === scope.row.ext1.tz_area_new + "")[0]
+              ?.label ?? "-"
+          }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="设施名称" align="center" prop="ext1.tz_ss_name" />
+      <el-table-column label="排水体制" align="center" prop="ext1.tz_ss_pstz">
+        <template #default="scope">
+          {{
+            (facilities_pstz ?? []).filter((i) => i.value === scope.row.ext1.tz_ss_pstz + "")[0]
+              ?.label ?? "-"
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="运维长度(米)"
+        align="center"
+        prop="ext1.tz_ss_data_length"
+      />
+      <el-table-column label="设施起止点" align="center" prop="ext1.tz_ss_road_se" />
+      <el-table-column label="管径范围(mm)" align="center" prop="ext1.tz_ss_dn" />
+      <el-table-column label="辖区班组" align="center" prop="ext1.tz_ss_unit">
+        <template #default="scope">
+          {{
+            (scope.row.ext1.tz_ss_unit == "" ? [] : scope.row.ext1.tz_ss_unit ?? [])
+              .map((i) => {
+                return (
+                  alldept.find((p) => {
+                    return p.deptId + "" === i + "";
+                  })?.deptName ?? "-"
+                );
+              })
+              .join("、")
+          }}
+        </template>
+      </el-table-column>
+
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template #default="scope">
           <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
+            @click.stop="handleUpdate(scope.row)"
             v-hasPermi="['system:facilities:edit']"
-          >修改</el-button>
+            >修改</el-button
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
+            @click.stop="handleDelete(scope.row)"
             v-hasPermi="['system:facilities:remove']"
-          >删除</el-button>
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
 
     <pagination
-      v-show="total>0"
+      v-show="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
@@ -166,37 +211,203 @@
     />
 
     <!-- 添加或修改设施对话框 -->
-    <el-dialog :title="title" v-model="open" width="500px" append-to-body>
-      <el-form ref="form" :model="fform" :rules="rules" label-width="80px">
-        <el-form-item label="区属" prop="areaDes">
-          <el-input v-model="fform.areaDes" placeholder="请输入区属" />
-        </el-form-item>
-        <el-form-item label="行政区属" prop="areaAdDes">
-          <el-input v-model="fform.areaAdDes" placeholder="请输入行政区属" />
-        </el-form-item>
-        <el-form-item label="扩展序号" prop="exId">
-          <el-input v-model="fform.exId" placeholder="请输入扩展序号" />
-        </el-form-item>
-        <el-form-item label="设施名称" prop="name">
-          <el-input v-model="fform.name" placeholder="请输入设施名称" />
-        </el-form-item>
-        <el-form-item label="路名" prop="roadName">
-          <el-input v-model="fform.roadName" placeholder="请输入路名" />
-        </el-form-item>
-        <el-form-item label="性质(雨水、污水)" prop="nature">
-          <el-input v-model="fform.nature" placeholder="请输入性质(雨水、污水)" />
-        </el-form-item>
-        <el-form-item label="设施起点" prop="addrFrom">
-          <el-input v-model="fform.addrFrom" placeholder="请输入设施起点" />
-        </el-form-item>
-        <el-form-item label="设施终点" prop="addrEnd">
-          <el-input v-model="fform.addrEnd" placeholder="请输入设施终点" />
-        </el-form-item>
-        <el-form-item label="扩展编号1" prop="exId1">
-          <el-input v-model="fform.exId1" placeholder="请输入扩展编号1" />
-        </el-form-item>
+    <el-dialog :title="title" v-model="open" width="80vw" append-to-body>
+      <el-form ref="form" :model="fform" :rules="rules" label-width="120px">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item :label="`台账编号:`" required prop="ext1.tz_id"
+              ><el-input
+                v-model="fform.ext1.tz_id"
+                :placeholder="`请输入编号`"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item :label="`行政区:`" prop="ext1.tz_area_new">
+              <el-select
+                v-model="fform.ext1.tz_area_new"
+                class="m-1"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in sys_area"
+                  :label="item.label"
+                  :value="item.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item :label="`设施名称:`" required prop="ext1.tz_ss_name"
+              ><el-input v-model="fform.ext1.tz_ss_name" :placeholder="`请输入`">
+              </el-input
+            ></el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item :label="`移交来源:`" prop="ext1.tz_ss_info"
+              ><el-input v-model="fform.ext1.tz_ss_info" :placeholder="`请输入`">
+              </el-input
+            ></el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item :label="`设施起止点:`" required prop="ext1.tz_ss_road_se"
+              ><el-input v-model="fform.ext1.tz_ss_road_se" :placeholder="`请输入`">
+              </el-input
+            ></el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item :label="`移交时间:`" prop="ext1.tz_ss_time">
+              <el-date-picker
+                v-model="fform.ext1.tz_ss_time"
+                value-format="YYYY-MM-DD"
+                type="date"
+                placeholder="请选择"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item :label="`运维长度:`" required prop="ext1.tz_ss_data_length"
+              ><el-input v-model="fform.ext1.tz_ss_data_length" :placeholder="`请输入`">
+                <template #append>(米)</template>
+              </el-input></el-form-item
+            >
+          </el-col>
+          <el-col :span="12">
+            <el-form-item :label="`移交单位:`" prop="ext1.tz_ss_from"
+              ><el-input v-model="fform.ext1.tz_ss_from" :placeholder="`请输入`">
+              </el-input
+            ></el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item :label="`管径范围:`" prop="ext1.tz_ss_dn"
+              ><el-input v-model="fform.ext1.tz_ss_dn" :placeholder="`请输入`">
+                <template #append>(mm)</template>
+              </el-input></el-form-item
+            >
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item :label="`接收时间:`" prop="ext1.tz_jssj">
+              <el-date-picker
+                v-model="fform.ext1.tz_jssj"
+                value-format="YYYY-MM-DD"
+                type="date"
+                placeholder="请选择"
+              />
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item :label="`所属流域:`" prop="ext1.tz_ssly"
+              ><el-input v-model="fform.ext1.tz_ssly" :placeholder="`请输入`">
+              </el-input
+            ></el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item :label="`辖区班组:`" prop="ext1.tz_ss_unit">
+              <el-tree-select
+                v-model="fform.ext1.tz_ss_unit"
+                multiple
+                :data="treedept"
+                check-strictly="true"
+            /></el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item :label="`排水体制:`" prop="ext1.tz_ss_pstz">
+              <el-select v-model="fform.ext1.tz_ss_pstz" class="m-1" placeholder="请选择">
+                <el-option
+                  v-for="item in facilities_pstz"
+                  :label="item.label"
+                  :value="item.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="6">
+            <el-form-item :label="`检查井:`" prop="ext1.tz_ss_data_jing"
+              ><el-input v-model="fform.ext1.tz_ss_data_jing" :placeholder="`请输入`">
+                <template #append>(座)</template>
+              </el-input></el-form-item
+            >
+          </el-col>
+          <el-col :span="6">
+            <el-form-item :label="`雨口井:`" prop="ext1.tz_ss_data_ysk"
+              ><el-input v-model="fform.ext1.tz_ss_data_ysk" :placeholder="`请输入`">
+                <template #append>(座)</template>
+              </el-input></el-form-item
+            >
+          </el-col>
+          <el-col :span="6">
+            <el-form-item :label="`排河口:`" prop="ext1.tz_pfk"
+              ><el-input v-model="fform.ext1.tz_pfk" :placeholder="`请输入`">
+                <template #append>(座)</template>
+              </el-input></el-form-item
+            >
+          </el-col>
+          <el-col :span="4" style="text-align: right">
+            <span style="font-weight: bold; line-height: 30px; padding-right: 20px">
+              雨水口检测详情</span
+            >
+          </el-col>
+          <el-col :span="4">
+            <el-form-item :label="`单箅:`" prop="ext1.tz_bz_dan" label-width="60px"
+              ><el-input v-model="fform.ext1.tz_bz_dan" :placeholder="`请输入`">
+                <template #append>(个)</template>
+              </el-input></el-form-item
+            >
+          </el-col>
+          <el-col :span="4">
+            <el-form-item :label="`双箅:`" prop="ext1.tz_bz_shuang" label-width="60px"
+              ><el-input v-model="fform.ext1.tz_bz_shuang" :placeholder="`请输入`">
+                <template #append>(个)</template>
+              </el-input></el-form-item
+            >
+          </el-col>
+          <el-col :span="4">
+            <el-form-item :label="`三箅:`" prop="ext1.tz_bz_san" label-width="60px"
+              ><el-input v-model="fform.ext1.tz_bz_san" :placeholder="`请输入`">
+                <template #append>(个)</template>
+              </el-input></el-form-item
+            >
+          </el-col>
+          <el-col :span="4">
+            <el-form-item :label="`四箅:`" prop="ext1.tz_bz_si" label-width="60px"
+              ><el-input v-model="fform.ext1.tz_bz_si" :placeholder="`请输入`">
+                <template #append>(个)</template>
+              </el-input></el-form-item
+            >
+          </el-col>
+          <el-col :span="4">
+            <el-form-item :label="`多箅:`" prop="ext1.tz_bz_duo" label-width="60px"
+              ><el-input v-model="fform.ext1.tz_bz_duo" :placeholder="`请输入`">
+                <template #append>(个)</template>
+              </el-input></el-form-item
+            >
+          </el-col>
+
+          <!-- <el-col :span="12" v-for="itemkey in Object.keys(facilities_obj)">
+            <el-form-item
+              :label="`${getfacilitiesdesname(itemkey).des}:`"
+              prop="areaDes"
+            >
+              <el-input
+                v-if="getfacilitiesdesname(itemkey).type == 'text'"
+                v-model="fform.ext1[itemkey + '']"
+                :placeholder="`请输入${getfacilitiesdesname(itemkey).des}`"
+              />
+              <el-input
+                type="textarea"
+                v-if="getfacilitiesdesname(itemkey).type == 'textarea'"
+                v-model="fform.ext1[itemkey + '']"
+                :placeholder="`请输入${getfacilitiesdesname(itemkey).des}`"
+              />
+            </el-form-item>
+          </el-col> -->
+        </el-row>
       </el-form>
-      <div slot="footer" class="dialog-footer">
+      <div slot="footer" class="dialog-footer" style="text-align: right">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
@@ -205,69 +416,210 @@
 </template>
 
 <script setup>
-import { listFacilities, getFacilities, delFacilities, addFacilities, updateFacilities } from "@/api/system/facilities";
+import {
+  listFacilities,
+  listFacilities1,
+  getFacilities,
+  delFacilities,
+  addFacilities,
+  updateFacilities,
+} from "@/api/system/facilities";
+import ImageUpload from "@/components/ImageUpload";
+import { useDict } from "@/utils/dict";
+import { Search } from "@element-plus/icons-vue";
+import { cloneDeep } from "lodash";
+import { listDept, getDept } from "@/api/system/dept";
+import { treeselect as deptTreeselect } from "@/api/system/dept";
+import { getfacilitiesdesname } from "@/utils/ruoyi";
 import { defineComponent, ref, onMounted, watch } from "vue";
+import router from "../../../router";
+const {
+  task_status,
+  task_type,
+  task_event_type,
+  task_event_category,
+  sys_area,
+  facilities_pstz,
+} = useDict(
+  "task_status",
+  "task_type",
+  "task_event_type",
+  "task_event_category",
+  "sys_area",
+  "facilities_pstz"
+);
 const { proxy } = getCurrentInstance();
 
-      // 遮罩层
+// 遮罩层
 const loading = ref(true);
-      // 选中数组
+// 选中数组
 const ids = ref([]);
-      // 非单个禁用
+// 非单个禁用
 const single = ref(true);
-      // 非多个禁用
+// 非多个禁用
 const multiple = ref(true);
-      // 显示搜索条件
+// 显示搜索条件
 const showSearch = ref(true);
-      // 总条数
+// 总条数
 const total = ref(0);
-      // 设施表格数据
+// 设施表格数据
 const facilitiesList = ref([]);
-      // 弹出层标题
+// 弹出层标题
 const title = ref("");
-      // 是否显示弹出层
+// 是否显示弹出层
 const open = ref(false);
-      // 查询参数
+// 查询参数
+const facilities_obj = ref({
+  tz_id: "",
+  tz_dhx: "",
+  tz_dlj: "",
+  tz_jlj: "",
+  tz_jsk: "",
+  tz_pfk: "",
+  tz_gjsj: "",
+  tz_gwly: "",
+  tz_jgsj: "",
+  tz_road: "",
+  tz_yssj: "",
+  tz_bz_si: "",
+  tz_ss_cz: "",
+  tz_ss_dn: "",
+  tz_xlymc: "",
+  tz_bz_dan: "",
+  tz_bz_duo: "",
+  tz_bz_san: "",
+  tz_ss_from: "",
+  tz_ss_info: "",
+  tz_ss_more: "",
+  tz_ss_name: "",
+  tz_ss_pstz: "",
+  tz_ss_road: "",
+  tz_ss_time: "",
+  tz_jssj: "",
+  tz_ssly: "",
+  tz_pkbh: "",
+  pics:"",
+  tz_ss_type: "",
+  tz_ss_unit: "",
+  tz_zm_type: "",
+  tz_area_new: "",
+  tz_area_old: "",
+  tz_bz_total: "",
+  tz_ss_river: "",
+  tz_bz_shuang: "",
+  tz_xfgj_dxgj: "",
+  tz_xfgj_xxgq: "",
+  tz_xfgj_zxgj: "",
+  tz_ss_road_se: "",
+  tz_xfgj_tdxgj: "",
+  tz_ss_data_ysk: "",
+  tz_ss_road_end: "",
+  tz_zm_material: "",
+  tz_ss_data_jing: "",
+  tz_ss_road_start: "",
+  tz_ss_data_length: "",
+  tz_ss_data_main_length: "",
+  tz_ss_data_minor_length: "",
+});
+
+const alldept = ref([]);
+
+listDept().then((response) => {
+  alldept.value = cloneDeep(response.data);
+});
+
+function setdatakey(dept) {
+  if (dept.children) {
+    dept.children = dept.children.map((i) => {
+      return setdatakey(i);
+    });
+  }
+  dept["value"] = dept.id;
+  return dept;
+}
+
+const treedept = ref([
+  {
+    value: "1",
+    label: "ss",
+  },
+  {
+    value: "2",
+    label: "ss1",
+  },
+]);
+deptTreeselect().then((res) => {
+  treedept.value = [setdatakey(res.data[0])];
+});
+
+const validatedhx = (rule, value, callback) => {
+  if (value === "") {
+    callback(new Error("请输入编号"));
+    return;
+  }
+  var p = {
+    params: {
+      ext1: {
+        tz_id: value,
+      },
+    },
+  };
+  listFacilities1(p).then((response) => {
+    if (response.total > 0 && response.rows[0].id != fform.value.id) {
+      callback(new Error("编号已存在"));
+    }
+    callback();
+  });
+};
 
 const data = reactive({
-  fform: {},
+  fform: { ext1: cloneDeep(facilities_obj.value) },
   queryParams: {
-    pageNum: 1,
-  pageSize: 10,
-  areaDes: null,
-  areaAdDes: null,
-  exId: null,
-  name: null,
-  roadName: null,
-  nature: null,
-  addrFrom: null,
-  addrEnd: null,
-  exId1: null
+    params: {
+      pageNum: 1,
+      pageSize: 10,
+      keyword: "",
+      ext1: {
+        tz_id: "",
+        tz_ss_name: "",
+        tz_area_new: "",
+        tz_ss_unit: "",
+        tz_ss_pstz: "",
+      },
+    },
   },
   rules: {
-     }
+    "ext1.tz_id": [{ validator: validatedhx, trigger: "blur" }],
+    "ext1.tz_ss_name": [{ required: true, message: "请输入名称", trigger: "blur" }],
+    "ext1.tz_ss_road_se": [{ required: true, message: "请输入起止点", trigger: "blur" }],
+    "ext1.tz_ss_data_length": [
+      { required: true, message: "请输入长度", trigger: "blur" },
+    ],
+  },
 });
 const { queryParams, fform, rules } = toRefs(data);
 
 onMounted(() => {
   getList();
-})
-
+});
 
 const getList = () => {
   loading.value = true;
-  listFacilities(queryParams.value).then(response => {
-    facilitiesList.value = response.rows;
+  listFacilities1(queryParams.value).then((response) => {
+    facilitiesList.value = response.rows.map((i) => {
+      i.ext1 = JSON.parse(i.ext1);
+      return i;
+    });
     total.value = response.total;
     loading.value = false;
   });
 };
-    // 取消按钮
+// 取消按钮
 const cancel = () => {
   open.value = false;
   reset();
 };
-    // 表单重置
+// 表单重置
 const reset = () => {
   fform.value = {
     id: null,
@@ -279,78 +631,96 @@ const reset = () => {
     nature: null,
     addrFrom: null,
     addrEnd: null,
-    exId1: null
+    exId1: null,
+    ext1: cloneDeep(facilities_obj.value),
   };
   proxy.resetForm("form");
 };
-    /** 搜索按钮操作 */
+/** 搜索按钮操作 */
 const handleQuery = () => {
   queryParams.value.pageNum = 1;
   getList();
 };
-    /** 重置按钮操作 */
+/** 重置按钮操作 */
 const resetQuery = () => {
   proxy.resetForm("queryForm");
   handleQuery();
 };
-    // 多选框选中数据
+// 多选框选中数据
 const handleSelectionChange = (selection) => {
-  ids.value = selection.map(item => item.id)
-  single.value = selection.length !== 1
-  multiple.value = !selection.length
+  ids.value = selection.map((item) => item.id);
+  single.value = selection.length !== 1;
+  multiple.value = !selection.length;
 };
-    /** 新增按钮操作 */
+/** 新增按钮操作 */
 const handleAdd = () => {
   reset();
   open.value = true;
   title.value = "添加设施";
 };
-    /** 修改按钮操作 */
+/** 修改按钮操作 */
 const handleUpdate = (row) => {
   reset();
   const id = row.id || ids.value;
-  getFacilities(id).then(response => {
+  getFacilities(id).then((response) => {
     fform.value = response.data;
+    fform.value.ext1 = JSON.parse(fform.value.ext1);
     open.value = true;
     title.value = "修改设施";
   });
 };
-    /** 提交按钮 */
+/** 提交按钮 */
 const submitForm = () => {
-  proxy.$refs["form"].validate(valid => {
-    if (valid) {
-      if (fform.value.id != null) {
-        updateFacilities(fform.value).then(response => {
-          proxy.$modal.msgSuccess("修改成功");
-          open.value = false;
-          getList();
-        });
-      } else {
-        addFacilities(fform.value).then(response => {
-          proxy.$modal.msgSuccess("新增成功");
-          open.value = false;
-          getList();
-        });
+  proxy.$refs["form"]
+    .validate((valid) => {
+      console.log(valid);
+      if (valid) {
+        if (fform.value.id != null) {
+          var ddf = cloneDeep(fform.value);
+          ddf.ext1 = JSON.stringify(ddf.ext1);
+          updateFacilities(ddf).then((response) => {
+            proxy.$modal.msgSuccess("修改成功");
+            open.value = false;
+            getList();
+          });
+        } else {
+          var ddf = cloneDeep(fform.value);
+          ddf.ext1 = JSON.stringify(ddf.ext1);
+          addFacilities(ddf).then((response) => {
+            proxy.$modal.msgSuccess("新增成功");
+            open.value = false;
+            getList();
+          });
+        }
       }
-    }
-  });
+    });
+
 };
-    /** 删除按钮操作 */
+/** 删除按钮操作 */
 const handleDelete = (row) => {
   const ids = row.id || ids.value;
-  proxy.$modal.confirm('是否确认删除设施编号为"' + ids + '"的数据项?').then(function () {
-    return delFacilities(ids);
-  }).then(() => {
-    getList();
-    proxy.$modal.msgSuccess("删除成功");
-  }).catch(() => { });
+  proxy.$modal
+    .confirm('是否确认删除设施编号为"' + ids + '"的数据项?')
+    .then(function () {
+      return delFacilities(ids);
+    })
+    .then(() => {
+      getList();
+      proxy.$modal.msgSuccess("删除成功");
+    })
+    .catch(() => {});
 };
-    /** 导出按钮操作 */
+/** 导出按钮操作 */
 const handleExport = () => {
-  proxy.download('system/facilities/export', {
-    ...queryParams.value
-  }, `facilities_${new Date().getTime()}.xlsx`)
+  proxy.download(
+    "system/facilities/export",
+    {
+      ...queryParams.value,
+    },
+    `facilities_${new Date().getTime()}.xlsx`
+  );
+};
+const itemclick = (row, index) => {
+  router.push("/system/facilities/detail/" + row.id);
 };
-
-
 </script>

+ 8 - 23
src/views/task/list/index.vue

@@ -159,31 +159,19 @@
           <el-table-column prop="createTime" label="来件时间" />
           <el-table-column
             prop="taskTime"
-            label="剩余时间"
+            label="剩余时间(办理时限)"
             v-if="currentstatus != 6"
           >
             <template #default="scope"
               ><div>
                 <div
-                  v-if="
-                    scope.row.taskReqCompleteTime != null &&
-                    scope.row.status < 5
-                  "
+                  v-if="scope.row.taskTime != null && scope.row.status < 5"
                   :class="
-                    moment(scope.row.taskReqCompleteTime).diff(
-                      moment(),
-                      'days'
-                    ) < 2
+                    moment(scope.row.taskTime).diff(moment(), 'days') < 2
                       ? 'tip-e'
-                      : moment(scope.row.taskReqCompleteTime).diff(
-                          moment(),
-                          'days'
-                        ) < 3
+                      : moment(scope.row.taskTime).diff(moment(), 'days') < 3
                       ? 'tip-w'
-                      : moment(scope.row.taskReqCompleteTime).diff(
-                          moment(),
-                          'days'
-                        ) > 5
+                      : moment(scope.row.taskTime).diff(moment(), 'days') > 5
                       ? 'tip-i'
                       : ''
                   "
@@ -191,14 +179,11 @@
                   <el-icon style="vertical-align: middle"><Clock /></el-icon>
                   <span>
                     {{
-                      moment(scope.row.taskReqCompleteTime).diff(
-                        moment(),
-                        "days"
-                      )
+                      moment(scope.row.taskTime).diff(moment(), "days")
                     }}天</span
                   >
                 </div>
-                <div v-if="scope.row.taskReqCompleteTime == null">-</div>
+                <div v-if="scope.row.taskTime == null">-</div>
               </div>
             </template>
           </el-table-column>
@@ -429,7 +414,7 @@ const ontaskadd = async () => {
       : "";
   taskobj.taskReqCompleteTime = taskobj.taskReqCompleteTime
     ? ""
-    : moment(taskobj.taskReqCompleteTime).format('YYYY-MM-DD HH:mm:ss');
+    : moment(taskobj.taskReqCompleteTime).format("YYYY-MM-DD HH:mm:ss");
   console.log(taskobj);
   loading.value = true;