wenhongquan 2 年 前
コミット
403a67c357

+ 9 - 1
src/api/system/maintain.js

@@ -61,11 +61,19 @@ export function feedbackMaintain(data) {
     });
 }
 
-// 成果上传养护计划
+// 验收上传养护计划
 export function completeMaintain(data) {
     return request({
         url: "/system/maintain/complete",
         method: "post",
         data: data,
     });
+}
+
+export function resultsuploadMaintain(data) {
+    return request({
+        url: "/system/maintain/resultsupload",
+        method: "post",
+        data: data,
+    });
 }

+ 1 - 1
src/components/FileUpload/index.vue

@@ -56,7 +56,7 @@ const props = defineProps({
   // 文件类型, 例如['png', 'jpg', 'jpeg']
   fileType: {
     type: Array,
-    default: () => ["doc","docx", "xls", "xlsx", "ppt", "pptx", "txt", "pdf"],
+    default: () => ["doc","docx", "xls", "xlsx", "ppt", "pptx", "txt", "pdf","dwg"],
   },
   // 是否显示提示
   isShowTip: {

ファイルの差分が大きいため隠しています
+ 321 - 769
src/views/detection/detail/index.vue


+ 550 - 152
src/views/detection/list/index.vue

@@ -1,11 +1,7 @@
 <template>
   <div style="padding: 10px">
     <div class="formbody">
-      <el-form
-        :inline="true"
-        v-model="queryparameters"
-        class="demo-form-inline"
-      >
+      <el-form :inline="true" v-model="queryparameters" class="demo-form-inline">
         <el-form-item label="设施台账">
           <el-select
             v-model="queryparameters.facilitiesId"
@@ -20,11 +16,7 @@
           </el-select>
         </el-form-item>
         <el-form-item label="计划状态" v-if="currentstatus == 1">
-          <el-select
-            v-model="queryparameters.status"
-            class="m-1"
-            placeholder="请选择"
-          >
+          <el-select v-model="queryparameters.status" class="m-1" placeholder="请选择">
             <el-option
               v-for="item in detection_status"
               :label="item.label"
@@ -33,11 +25,7 @@
           </el-select>
         </el-form-item>
         <el-form-item label="道路名">
-          <el-select
-            v-model="queryparameters.taskArea"
-            class="m-2"
-            placeholder="请选择"
-          >
+          <el-select v-model="queryparameters.taskArea" class="m-2" placeholder="请选择">
             <el-option
               v-for="item in alldevices"
               :label="item.roadName"
@@ -62,51 +50,120 @@
           style="width: 100%"
           @row-click="tblrowclick"
         >
-          <el-table-column label="设备台账">
+          <el-table-column prop="taskCode" label="台账编号">
             <template #default="scope">
               {{
-                alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]
-                  ?.exId ?? "-"
+                alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]?.ext1
+                  .tz_id ?? "-"
               }}
             </template>
           </el-table-column>
-
-          <el-table-column prop="taskCode" label="设施道路">
+          <el-table-column prop="taskCode" label="设施名称">
             <template #default="scope">
               {{
-                alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]
-                  ?.roadName ?? "-"
+                alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]?.ext1
+                  .tz_ss_name ?? "-"
               }}
             </template>
           </el-table-column>
-          <el-table-column prop="detectionYear" label="年计划" width="180" />
-          <el-table-column prop="detectionMonth" label="月计划" width="180" />
-          <el-table-column label="运维设施长度" width="180">
+          <el-table-column prop="taskCode" label="城区">
             <template #default="scope">
               {{
-                alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]
-                  ?.fLength ?? ""
+                (sys_area ?? []).filter(
+                  (i) =>
+                    i.value ===
+                    alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]?.ext1
+                      .tz_area_new +
+                      ""
+                )[0]?.label ?? "-"
               }}
             </template>
           </el-table-column>
-          <el-table-column label="计划状态" width="180">
+          <el-table-column label="检测类型">
             <template #default="scope">
               {{
-                detection_status.filter(
-                  (i) => i.value.toString() === scope.row.status.toString()
+                detection_type.filter(
+                  (i) => i.value + "" === scope.row.detectionType + ""
                 )[0]?.label ?? "-"
               }}
             </template>
           </el-table-column>
-          <el-table-column label="检测类型">
+          <el-table-column label="路段范围">
             <template #default="scope">
               {{
-                detection_type.filter(
-                  (i) => i.value.toString() === scope.row.detectionType.toString()
-                )[0]?.label ?? "-"
+                alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]?.ext1
+                  .tz_ss_road_se ?? "-"
+              }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="ext1.task.datestart" label="计划时间" />
+          <el-table-column prop="ext1.task.dateend" label="完成时间" />
+          <el-table-column label="管径(mm)">
+            <template #default="scope">
+              {{ scope.row.ext1.task.gd.map((i) => i.yh_gj).join("、") }}
+            </template>
+          </el-table-column>
+          <el-table-column label="管道清淤(米)">
+            <template #default="scope">
+              {{
+                evilFn(
+                  scope.row.ext1.task.gd
+                    .map((i) => (i.yh_length && i.yh_length != "" ? i.yh_length : 0))
+                    .join("+")
+                )
+              }}
+            </template>
+          </el-table-column>
+
+          <el-table-column label="雨水口清掏(座)">
+            <template #default="scope">
+              {{ scope.row.ext1.task.ysk }}
+            </template>
+          </el-table-column>
+
+          <el-table-column label="检查井清掏(座)">
+            <template #default="scope">
+              {{ scope.row.ext1.task.jcj }}
+            </template>
+          </el-table-column>
+
+          <el-table-column label="计划状态">
+            <template #default="scope">
+              {{
+                detection_status.filter((i) => i.value === scope.row.status + "")[0]
+                  ?.label ?? "-"
               }}
             </template>
           </el-table-column>
+
+          <el-table-column prop="maintainUnit" label="辖区班组">
+            <template #default="scope">
+              {{
+                (scope.row.ext1.facilities_unit == ""
+                  ? []
+                  : scope.row.ext1.facilities_unit ?? []
+                )
+                  .map((i) => {
+                    return (
+                      alldept.find((p) => {
+                        return p.deptId + "" === i + "";
+                      })?.deptName ?? "-"
+                    );
+                  })
+                  .join("、")
+              }}
+            </template>
+          </el-table-column>
+          <el-table-column label="检测单位">
+            <template #default="scope">
+              {{ scope.row.detectionDes }}
+            </template>
+          </el-table-column>
+          <el-table-column label="备注">
+            <template #default="scope">
+              {{ scope.row.detectionRemark }}
+            </template>
+          </el-table-column>
           <el-table-column prop="address" label="操作">
             <template #default="scope">
               <el-button text size="small" @click.stop="edittask(scope.row)"
@@ -152,32 +209,39 @@
     <el-dialog
       v-model="showadd"
       v-loading="loading"
-      title="新增检测计划"
+      title="新增设施检测计划"
       width="70%"
       draggable
     >
       <div>
-        <el-form :model="detectioninfo">
+        <el-form :model="detectioninfo" ref="form">
+          <div style="font-weight: bold; font-size: 15px; margin-bottom: 10px">
+            任务基础信息
+          </div>
           <el-row>
-            <el-col :span="12">
-              <el-form-item label="关联设施" label-width="150px">
+            <el-col :span="12"
+              ><el-form-item label="关联设施" label-width="150px">
                 <el-select
                   v-model="detectioninfo.facilitiesId"
                   filterable
-                  placeholder="请选择"
+                  placeholder="请选择设备"
                 >
                   <el-option
                     v-for="item in alldevices"
-                    :label="item.name"
+                    :label="item.ext1.tz_id"
                     :value="item.id"
                   ></el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
+                </el-select> </el-form-item
+            ></el-col>
             <el-col :span="12">
-              <el-form-item label="检测类型" label-width="150px">
+              <el-form-item
+                label="任务类型"
+                required
+                label-width="150px"
+                prop="maintainType"
+              >
                 <el-select
-                  v-model="detectioninfo.detectionType"
+                  v-model="detectioninfo.maintainType"
                   filterable
                   placeholder="请选择类型"
                 >
@@ -186,80 +250,306 @@
                     :label="item.label"
                     :value="parseInt(item.value)"
                   ></el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
+                </el-select> </el-form-item
+            ></el-col>
           </el-row>
-
           <el-row>
-            <el-col :span="8">
-              <el-form-item label="计划年" label-width="150px">
-                <el-select
-                  v-model="detectioninfo.detectionYear"
-                  filterable
-                  placeholder="请选择计划年"
-                >
-                  <el-option
-                    v-for="item in getyears()"
-                    :label="item"
-                    :value="item"
-                  ></el-option>
-                </el-select> </el-form-item
+            <el-col :span="12"
+              ><el-form-item label="设施名称" label-width="150px">
+                <el-input
+                  v-model="detectioninfo.ext1.facilities_name"
+                  placeholder="请输入"
+                ></el-input></el-form-item
             ></el-col>
-            <el-col :span="8">
-              <el-form-item label="计划月" label-width="150px">
-                <el-select
-                  v-model="detectioninfo.detectionMonth"
-                  filterable
-                  placeholder="请选择计划月"
-                >
-                  <el-option
-                    v-for="item in getmonth()"
-                    :label="item"
-                    :value="item"
-                  ></el-option> </el-select></el-form-item
+            <el-col :span="12"
+              ><el-form-item label="所在道路" label-width="150px">
+                <el-input
+                  v-model="detectioninfo.ext1.facilities_road"
+                  placeholder="请输入"
+                ></el-input></el-form-item
             ></el-col>
-            <el-col :span="8">
-              <el-form-item label="计划周" label-width="150px">
+
+            <el-col :span="6"
+              ><el-form-item label="运维长度" label-width="100px">
+                <el-input
+                  v-model="detectioninfo.ext1.facilities_length"
+                  placeholder="请输入"
+                  ><template #append>(米)</template></el-input
+                ></el-form-item
+              ></el-col
+            >
+
+            <el-col :span="6"
+              ><el-form-item label="管径范围" label-width="100px">
+                <el-input
+                  v-model="detectioninfo.ext1.facilities_gjfw"
+                  placeholder="请输入"
+                  ><template #append>(mm)</template></el-input
+                ></el-form-item
+              ></el-col
+            >
+            <el-col :span="12"
+              ><el-form-item
+                label="检测起点"
+                required
+                label-width="100px"
+                prop="ext1.facilities_start"
+              >
                 <el-input
-                  v-model="detectioninfo.detectionWeek"
-                  placeholder="请输入周"
-                ></el-input> </el-form-item
+                  v-model="detectioninfo.ext1.facilities_start"
+                  placeholder="请输入"
+                ></el-input></el-form-item
             ></el-col>
-          </el-row>
 
-          <el-row>
             <el-col :span="12"
-              ><el-form-item label="计划作业组" label-width="150px">
+              ><el-form-item label="辖区班组" label-width="100px">
                 <el-tree-select
-                  v-model="detectioninfo.detectionDept"
+                  v-model="detectioninfo.ext1.facilities_unit"
                   multiple
                   :data="treedept"
                   check-strictly="true"
-                /> </el-form-item
-            ></el-col>
+              /></el-form-item>
+            </el-col>
+
             <el-col :span="12"
-              ><el-form-item label="计划备注" label-width="150px">
+              ><el-form-item
+                label="检测终点"
+                required
+                label-width="100px"
+                prop="ext1.facilities_end"
+              >
+                <el-input
+                  v-model="detectioninfo.ext1.facilities_end"
+                  placeholder="请输入"
+                ></el-input></el-form-item
+            ></el-col>
+
+            <el-col :span="24">
+              <el-form-item label="检测备注" label-width="150px">
+                <el-input
+                  v-model="detectioninfo.detectionRemark"
+                  type="textarea"
+                  placeholder="请输入"
+                ></el-input></el-form-item
+            ></el-col>
+
+            <el-col :span="24">
+              <el-form-item label="检测单位" label-width="150px">
                 <el-input
                   v-model="detectioninfo.detectionDes"
                   type="textarea"
                   placeholder="请输入"
-                ></el-input> </el-form-item
+                ></el-input></el-form-item
             ></el-col>
           </el-row>
+          <div style="font-weight: bold; font-size: 15px; margin-bottom: 10px">
+            养护计划量及任务派发
+          </div>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="检查井" label-width="100px">
+                <el-input
+                  v-model="detectioninfo.ext1.task.jcj"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(座)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="雨水口" label-width="100px">
+                <el-input
+                  v-model="detectioninfo.ext1.task.ysk"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(座)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="排河口" label-width="100px">
+                <el-input
+                  v-model="detectioninfo.ext1.task.phk"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(座)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+          </el-row>
 
           <el-row>
-            <el-col :span="24"
-              ><el-form-item label="备注" label-width="150px">
+            <el-col :span="4">
+              <div
+                style="
+                  font-weight: bold;
+                  font-size: 15px;
+                  text-align: right;
+                  padding-right: 30px;
+                  padding-top: 3px;
+                "
+              >
+                雨水口检测详情
+              </div>
+            </el-col>
+            <el-col :span="4" style="padding-right: 10px">
+              <el-form-item label="单箅" label-width="40px">
                 <el-input
-                  v-model="detectioninfo.detectionRemark"
-                  type="textarea"
+                  v-model="detectioninfo.ext1.task.bz_dan"
+                  type="text"
                   placeholder="请输入"
-                ></el-input> </el-form-item
-            ></el-col>
+                  ><template #append>(个)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+            <el-col :span="4" style="padding-right: 10px">
+              <el-form-item label="双箅" label-width="40px">
+                <el-input
+                  v-model="detectioninfo.ext1.task.bz_shuang"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(个)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+            <el-col :span="4" style="padding-right: 10px">
+              <el-form-item label="三箅" label-width="40px">
+                <el-input
+                  v-model="detectioninfo.ext1.task.bz_san"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(个)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+            <el-col :span="4" style="padding-right: 10px">
+              <el-form-item label="四箅" label-width="40px">
+                <el-input
+                  v-model="detectioninfo.ext1.task.bz_si"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(个)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+            <el-col :span="4" style="padding-right: 10px">
+              <el-form-item label="多箅" label-width="40px">
+                <el-input
+                  v-model="detectioninfo.ext1.task.bz_duo"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(个)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+          </el-row>
+
+          <el-row>
+            <el-col :span="4">
+              <div
+                style="
+                  font-weight: bold;
+                  font-size: 15px;
+                  text-align: right;
+                  padding-right: 30px;
+                  padding-top: 3px;
+                "
+              >
+                管道检测详情
+              </div>
+            </el-col>
+            <el-col :span="20">
+              <el-row>
+                <el-col :span="24">
+                  <el-row v-for="(item, index) in detectioninfo.ext1.task.gd">
+                    <el-col :span="8" style="padding-right: 10px">
+                      <el-form-item label="管道检测" label-width="80px">
+                        <el-input
+                          v-model="item.yh_length"
+                          type="text"
+                          placeholder="请输入"
+                          ><template #append>(米)</template></el-input
+                        ></el-form-item
+                      >
+                    </el-col>
+
+                    <el-col :span="8" style="padding-right: 10px">
+                      <el-form-item label="管径" label-width="80px">
+                        <el-input v-model="item.yh_gj" type="text" placeholder="请输入"
+                          ><template #append>(mm)</template></el-input
+                        ></el-form-item
+                      >
+                    </el-col>
+                    <el-col :span="8" style="padding-right: 40px; position: relative">
+                      <el-form-item label="备注" label-width="40px">
+                        <el-input
+                          v-model="item.yh_remark"
+                          type="text"
+                          placeholder="请输入"
+                        ></el-input
+                      ></el-form-item>
+                      <el-button
+                        style="position: absolute; right: 0; top: 3px"
+                        size="small"
+                        @click="gzloperat(index)"
+                        type="primary"
+                        :icon="
+                          index == detectioninfo.ext1.task.gd.length - 1 ? Plus : Minus
+                        "
+                      ></el-button>
+                    </el-col>
+                  </el-row>
+                </el-col>
+
+                <el-col :span="24">
+                  <div style="font-weight: bold; font-size: 15px">
+                    合计:{{
+                      evilFn(
+                        detectioninfo.ext1.task.gd
+                          .map((i) => {
+                            var p = 0;
+                            try {
+                              p = parseFloat(i.yh_length);
+                            } catch (e) {
+                              p = 0;
+                            }
+                            return p == "" || isNaN(p) ? 0 : p;
+                          })
+                          .join("+")
+                      )
+                    }}
+                    米
+                  </div>
+                </el-col>
+              </el-row>
+            </el-col>
+          </el-row>
+
+          <el-row style="margin-top: 10px">
+            <el-col :span="12" style="text-align: right">
+              <el-form-item :label="`计划开始时间`">
+                <el-date-picker
+                  v-model="detectioninfo.ext1.task.datestart"
+                  value-format="YYYY-MM"
+                  type="month"
+                  placeholder="请选择"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="12" style="text-align: right">
+              <el-form-item :label="`计划结束时间`">
+                <el-date-picker
+                  v-model="detectioninfo.ext1.task.dateend"
+                  value-format="YYYY-MM"
+                  type="month"
+                  placeholder="请选择"
+                />
+              </el-form-item>
+            </el-col>
           </el-row>
         </el-form>
       </div>
+
       <template #footer>
         <span class="dialog-footer">
           <el-button @click="showadd = false">取消</el-button>
@@ -276,16 +566,38 @@ import { useDict } from "@/utils/dict";
 import router from "../../../router";
 // 分页组件
 import Pagination from "@/components/Pagination";
-
 import { listFacilities } from "@/api/system/facilities";
-
-import { listDetection,addDetection } from "@/api/system/detection";
+import { listDetection, addDetection } from "@/api/system/detection";
 import { listDept, getDept } from "@/api/system/dept";
 import { treeselect as deptTreeselect } from "@/api/system/dept";
 import { cloneDeep } from "lodash";
 import { ElMessage } from "element-plus";
 import { useRoute } from "vue-router";
 import { delDetection, updateDetection } from "../../../api/system/detection";
+import {
+  Delete,
+  Edit,
+  Search,
+  Share,
+  Upload,
+  Plus,
+  Minus,
+} from "@element-plus/icons-vue";
+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 { detection_status, detection_type } = useDict(
   "detection_status",
@@ -308,32 +620,10 @@ const route = useRoute();
 const currentstatus = computed(() => route.params.status);
 
 const alldevices = ref([]);
-
-listFacilities().then((res) => {
-  alldevices.value = res.rows;
-});
-
+const treedept = ref([]);
 const detectioninfo = ref({});
 const maintaininfo = ref();
-const initadd = () => {
-  detectioninfo.value = {
-    detectionDept: "",
-    detectionDes: "",
-    detectionLogs: null,
-    detectionMonth: "",
-    detectionRemark: "",
-    detectionType: null,
-    detectionWeek: "",
-    detectionYear: "",
-    ext1: "",
-    ext2: "",
-    id:null,
-    facilitiesId: 1,
-    remark: null,
-    status: 1,
-  };
-};
-initadd();
+const alldept = ref([]);
 
 const adddetection = () => {
   initadd();
@@ -345,33 +635,74 @@ const tblrowclick = (row) => {
   router.push(`/detection/detail/${row.id}`);
 };
 
+const initadd = () => {
+  detectioninfo.value = {
+    ext1: {
+      facilities_name: "",
+      facilities_road: "",
+      facilities_length: "",
+      facilities_gjfw: "",
+      facilities_start: "",
+      facilities_end: "",
+      facilities_unit: "",
+      task: {
+        jcj: "",
+        ysk: "",
+        phk: "",
+        bz_dan: "",
+        bz_shuang: "",
+        bz_san: "",
+        bz_si: "",
+        bz_duo: "",
+        gd: [
+          {
+            yh_length: "",
+            yh_gj: "",
+            yh_remark: "",
+          }
+        ],
+        datestart: "",
+        dateend: "",
+      },
+    },
+    facilitiesId: null,
+    detectionRemark: "",
+    detectionDes: '',
+    detectionWeek:'',
+    detectionType: "",
+    id: null,
+    status: 1,
+  };
+};
 const onadd = () => {
- loading.value = true;
+  loading.value = true;
   if (detectioninfo.value.id == null) {
-
     var detectioninfoobj = cloneDeep(detectioninfo.value);
+    detectioninfoobj.ext1 = JSON.stringify(detectioninfoobj.ext1);
     // delete detectioninfoobj.detectionDept;
-    detectioninfoobj.detectionDept = (detectioninfo.value.detectionDept instanceof Array) ? detectioninfo.value.detectionDept.join(",") : '';
-    addDetection(detectioninfoobj).then(res => {
+    detectioninfoobj.detectionDept =
+      detectioninfo.value.detectionDept instanceof Array
+        ? detectioninfo.value.detectionDept.join(",")
+        : "";
+    addDetection(detectioninfoobj).then((res) => {
       loading.value = false;
       showadd.value = false;
       getList();
-    })
-
+    });
   } else {
-      var detectioninfoobj = cloneDeep(detectioninfo.value);
+    var detectioninfoobj = cloneDeep(detectioninfo.value);
+    detectioninfoobj.ext1 = JSON.stringify(detectioninfoobj.ext1);
     // delete detectioninfoobj.detectionDept;
-    detectioninfoobj.detectionDept = (detectioninfo.value.detectionDept instanceof Array) ? detectioninfo.value.detectionDept.join(",") : '';
-    updateDetection(detectioninfoobj).then(res => {
+    detectioninfoobj.detectionDept =
+      detectioninfo.value.detectionDept instanceof Array
+        ? detectioninfo.value.detectionDept.join(",")
+        : "";
+    updateDetection(detectioninfoobj).then((res) => {
       loading.value = false;
       showadd.value = false;
       getList();
-    })
-
+    });
   }
-
-
-
 };
 
 const getList = () => {
@@ -385,11 +716,13 @@ const getList = () => {
     queryparameters.value.status = "";
   }
   listDetection(queryparameters.value).then((response) => {
-    tableData.value = response.rows;
+    tableData.value = response.rows.map((i) => {
+      i.ext1 = JSON.parse(i.ext1);
+      return i;
+    });
     pagedata.value = response;
   });
 };
-getList();
 
 const getyears = () => {
   var years = [];
@@ -410,13 +743,35 @@ const getmonth = () => {
   return months;
 };
 
-
-
+const gzloperat = (index) => {
+  if (detectioninfo.value.ext1.task.gd.length - 1 == index) {
+    //add
+    detectioninfo.value.ext1.task.gd.push({
+      yh_length: "",
+      yh_gj: "",
+      yh_remark: "",
+    });
+  } else {
+    //sub
+    detectioninfo.value.ext1.task.gd.splice(index, 1);
+  }
+};
+const evilFn = (fn) => {
+  let Fn = Function; // 一个变量指向Function,防止有些前端编译工具报错
+  return new Fn(`return ${fn}`)();
+};
 const edittask = (row) => {
   detectioninfo.value = cloneDeep(row);
-   if (detectioninfo.value.detectionDept!=null && detectioninfo.value.detectionDept!="" && detectioninfo.value.detectionDept!=undefined && !Array.isArray(detectioninfo.value.detectionDept)) {
-          detectioninfo.value.detectionDept = detectioninfo.value.detectionDept.split(",").map(i => parseInt(i));
-        }
+  if (
+    detectioninfo.value.detectionDept != null &&
+    detectioninfo.value.detectionDept != "" &&
+    detectioninfo.value.detectionDept != undefined &&
+    !Array.isArray(detectioninfo.value.detectionDept)
+  ) {
+    detectioninfo.value.detectionDept = detectioninfo.value.detectionDept
+      .split(",")
+      .map((i) => parseInt(i));
+  }
   showadd.value = true;
 };
 const deltask = (row) => {
@@ -426,20 +781,63 @@ const deltask = (row) => {
   });
 };
 
-
-onMounted(() => {});
-function setdatakey(dept) {
-  if (dept.children) {
-    dept.children = dept.children.map((i) => {
-      return setdatakey(i);
+{
+  listFacilities().then((res) => {
+    alldevices.value = res.rows.map((i) => {
+      i.ext1 = JSON.parse(i.ext1);
+      return i;
     });
+  });
+  initadd();
+  getList();
+
+  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;
   }
-  dept["value"] = dept.id;
-  return dept;
+
+  deptTreeselect().then((res) => {
+    treedept.value = [setdatakey(res.data[0])];
+  });
+
+  watch(
+    () => detectioninfo.value.facilitiesId,
+    () => {
+      if (detectioninfo.value.facilitiesId != null) {
+        var fd = alldevices.value.filter(
+          (i) => i.id + "" == detectioninfo.value.facilitiesId + ""
+        )[0];
+        detectioninfo.value.ext1["facilities_name"] = fd.ext1.tz_ss_name;
+        detectioninfo.value.ext1["facilities_road"] = fd.ext1.tz_ss_road;
+        detectioninfo.value.ext1["facilities_length"] = fd.ext1.tz_ss_data_length;
+        detectioninfo.value.ext1["facilities_gjfw"] = fd.ext1.tz_ss_dn;
+        detectioninfo.value.ext1["facilities_start"] = fd.ext1.tz_ss_road_start;
+        detectioninfo.value.ext1["facilities_end"] = fd.ext1.tz_ss_road_end;
+        detectioninfo.value.ext1["facilities_unit"] = fd.ext1.tz_ss_unit;
+        detectioninfo.value.ext1["task"]["jcj"] = fd.ext1.tz_ss_data_jing;
+        detectioninfo.value.ext1["task"]["ysk"] = fd.ext1.tz_ss_data_ysk;
+        detectioninfo.value.ext1["task"]["phk"] = fd.ext1.tz_pfk;
+        detectioninfo.value.ext1["task"]["bz_dan"] = fd.ext1.tz_bz_dan;
+        detectioninfo.value.ext1["task"]["bz_shuang"] = fd.ext1.tz_bz_shuang;
+        detectioninfo.value.ext1["task"]["bz_san"] = fd.ext1.tz_bz_san;
+        detectioninfo.value.ext1["task"]["bz_si"] = fd.ext1.tz_bz_si;
+        detectioninfo.value.ext1["task"]["bz_duo"] = fd.ext1.tz_bz_duo;
+      }
+    }
+  );
 }
-const treedept = ref([]);
-deptTreeselect().then((res) => {
-  treedept.value = [setdatakey(res.data[0])];
+
+onMounted(() => {
+
 });
 </script>
 

ファイルの差分が大きいため隠しています
+ 435 - 695
src/views/maintain/detail/index.vue


+ 558 - 137
src/views/maintain/list/index.vue

@@ -1,11 +1,7 @@
 <template>
   <div style="padding: 10px">
     <div class="formbody">
-      <el-form
-        :inline="true"
-        v-model="queryparameters"
-        class="demo-form-inline"
-      >
+      <el-form :inline="true" v-model="queryparameters" class="demo-form-inline">
         <el-form-item label="设施名称">
           <el-select
             v-model="queryparameters.facilitiesId"
@@ -20,11 +16,7 @@
           </el-select>
         </el-form-item>
         <el-form-item label="计划状态" v-if="currentstatus == 1">
-          <el-select
-            v-model="queryparameters.status"
-            class="m-1"
-            placeholder="请选择"
-          >
+          <el-select v-model="queryparameters.status" class="m-1" placeholder="请选择">
             <el-option
               v-for="item in maintain_status"
               :label="item.label"
@@ -62,44 +54,121 @@
           style="width: 100%"
           @row-click="tblrowclick"
         >
-          <el-table-column prop="taskCode" label="设施道路">
+          <el-table-column prop="taskCode" label="台账编号">
             <template #default="scope">
               {{
-                alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]
-                  ?.roadName ?? "-"
+                alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]?.ext1.tz_id ??
+                "-"
               }}
             </template>
           </el-table-column>
-          <el-table-column prop="maintainYear" label="年计划" width="180" />
-          <el-table-column prop="maintainMonth" label="月计划" width="180" />
-          <el-table-column label="运维设施长度" width="180">
+          <el-table-column prop="taskCode" label="设施名称">
             <template #default="scope">
               {{
-                alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]
-                  ?.fLength ?? ""
+                alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]?.ext1.tz_ss_name ??
+                "-"
               }}
             </template>
           </el-table-column>
-          <el-table-column label="计划状态" width="180">
+          <el-table-column prop="taskCode" label="城区">
             <template #default="scope">
               {{
-                maintain_status.filter(
-                  (i) => i.value === scope.row.status + ""
-                )[0]?.label ?? "-"
+                 (sys_area ?? []).filter((i) => i.value === alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]?.ext1.tz_area_new + "")[0]
+              ?.label ?? "-"
               }}
             </template>
           </el-table-column>
-          <el-table-column label="养护类型">
+           <el-table-column label="养护类型">
             <template #default="scope">
               {{
                 maintain_type.filter(
-                  (i) => (i.value+"") === (scope.row.maintainType + "")
+                  (i) => i.value + "" === scope.row.maintainType + ""
                 )[0]?.label ?? "-"
               }}
             </template>
           </el-table-column>
-          <el-table-column prop="maintainUnit" label="养护单位" />
-          <el-table-column prop="address" label="操作">
+           <el-table-column label="路段范围">
+            <template #default="scope">
+              {{
+                 alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]?.ext1.tz_ss_road_se ??
+                "-"
+              }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="ext1.task.datestart" label="计划时间"  />
+          <el-table-column prop="ext1.task.dateend" label="完成时间" />
+          <el-table-column label="管径(mm)" >
+            <template #default="scope">
+              {{
+                scope.row.ext1.task.gd.map(i=>i.yh_gj).join("、")
+              }}
+            </template>
+          </el-table-column>
+           <el-table-column label="管道清淤(米)"  >
+            <template #default="scope">
+              {{
+                evilFn(scope.row.ext1.task.gd.map(i=>(i.yh_length && i.yh_length!=''?i.yh_length:0 ) ).join("+"))
+              }}
+            </template>
+          </el-table-column>
+
+            <el-table-column label="雨水口清掏(座)"  >
+            <template #default="scope">
+              {{
+                scope.row.ext1.task.ysk
+              }}
+            </template>
+          </el-table-column>
+
+            <el-table-column label="检查井清掏(座)"  >
+            <template #default="scope">
+              {{
+               scope.row.ext1.task.jcj
+              }}
+            </template>
+          </el-table-column>
+
+
+
+          <el-table-column label="计划状态" >
+            <template #default="scope">
+              {{
+                maintain_status.filter((i) => i.value === scope.row.status + "")[0]
+                  ?.label ?? "-"
+              }}
+            </template>
+          </el-table-column>
+
+          <el-table-column prop="maintainUnit" label="辖区班组" >
+            <template #default="scope">
+          {{
+            (scope.row.ext1.facilities_unit == "" ? [] : scope.row.ext1.facilities_unit ?? [])
+              .map((i) => {
+                return (
+                  alldept.find((p) => {
+                    return p.deptId + "" === i + "";
+                  })?.deptName ?? "-"
+                );
+              })
+              .join("、")
+          }}
+        </template>
+            </el-table-column>
+             <el-table-column label="养护单位"  >
+            <template #default="scope">
+              {{
+               scope.row.maintainUnit
+              }}
+            </template>
+          </el-table-column>
+             <el-table-column label="备注"  >
+            <template #default="scope">
+              {{
+               scope.row.maintainRemark
+              }}
+            </template>
+          </el-table-column>
+                      <el-table-column prop="address" label="操作">
             <template #default="scope">
               <el-button text size="small" @click.stop="edittask(scope.row)"
                 >修改
@@ -134,10 +203,14 @@
       v-loading="loading"
       title="新增养护计划"
       width="70%"
+      append-to-body
       draggable
     >
       <div>
-        <el-form :model="maintaininfo">
+        <el-form :model="maintaininfo" ref="form">
+          <div style="font-weight: bold; font-size: 15px; margin-bottom: 10px">
+            任务基础信息
+          </div>
           <el-row>
             <el-col :span="12"
               ><el-form-item label="关联设施" label-width="150px">
@@ -148,14 +221,19 @@
                 >
                   <el-option
                     v-for="item in alldevices"
-                    :label="item.name"
+                    :label="item.ext1.tz_id"
                     :value="item.id"
                   ></el-option>
                 </el-select> </el-form-item
             ></el-col>
             <el-col :span="12">
-              <el-form-item label="养护类型" label-width="150px">
-                  <el-select
+              <el-form-item
+                label="养护类型"
+                required
+                label-width="150px"
+                prop="maintainType"
+              >
+                <el-select
                   v-model="maintaininfo.maintainType"
                   filterable
                   placeholder="请选择类型"
@@ -165,76 +243,300 @@
                     :label="item.label"
                     :value="parseInt(item.value)"
                   ></el-option>
-                </el-select>
-                </el-form-item
+                </el-select> </el-form-item
             ></el-col>
           </el-row>
           <el-row>
-            <el-col :span="12"><el-form-item label="养护单位" label-width="150px">
-               <el-input
-                        v-model="maintaininfo.maintainUnit"
-                        placeholder="请输入"
-                      ></el-input></el-form-item></el-col>
-             <el-col :span="12"><el-form-item label="养护数量" label-width="150px">
-               <el-input
-                        v-model="maintaininfo.maintainCount"
-                        placeholder="请输入"
-                      ></el-input></el-form-item></el-col>
+            <el-col :span="12"
+              ><el-form-item label="设施名称" label-width="150px">
+                <el-input
+                  v-model="maintaininfo.ext1.facilities_name"
+                  placeholder="请输入"
+                ></el-input></el-form-item
+            ></el-col>
+            <el-col :span="12"
+              ><el-form-item label="所在道路" label-width="150px">
+                <el-input
+                  v-model="maintaininfo.ext1.facilities_road"
+                  placeholder="请输入"
+                ></el-input></el-form-item
+            ></el-col>
+
+            <el-col :span="6"
+              ><el-form-item label="运维长度" label-width="100px">
+                <el-input
+                  v-model="maintaininfo.ext1.facilities_length"
+                  placeholder="请输入"
+                  ><template #append>(米)</template></el-input
+                ></el-form-item
+              ></el-col
+            >
+
+            <el-col :span="6"
+              ><el-form-item label="管径范围" label-width="100px">
+                <el-input v-model="maintaininfo.ext1.facilities_gjfw" placeholder="请输入"
+                  ><template #append>(mm)</template></el-input
+                ></el-form-item
+              ></el-col
+            >
+            <el-col :span="12"
+              ><el-form-item
+                label="养护起点"
+                required
+                label-width="100px"
+                prop="ext1.facilities_start"
+              >
+                <el-input
+                  v-model="maintaininfo.ext1.facilities_start"
+                  placeholder="请输入"
+                ></el-input></el-form-item
+            ></el-col>
+
+            <el-col :span="12"
+              ><el-form-item label="辖区班组" label-width="100px">
+                <el-tree-select
+                  v-model="maintaininfo.ext1.facilities_unit"
+                  multiple
+                  :data="treedept"
+                  check-strictly="true"
+              /></el-form-item>
+            </el-col>
+
+            <el-col :span="12"
+              ><el-form-item
+                label="养护终点"
+                required
+                label-width="100px"
+                prop="ext1.facilities_end"
+              >
+                <el-input
+                  v-model="maintaininfo.ext1.facilities_end"
+                  placeholder="请输入"
+                ></el-input></el-form-item
+            ></el-col>
+
+            <el-col :span="24">
+              <el-form-item label="计划备注" label-width="150px">
+                <el-input
+                  v-model="maintaininfo.maintainDes"
+                  type="textarea"
+                  placeholder="请输入"
+                ></el-input></el-form-item
+            ></el-col>
+
+            <el-col :span="24">
+              <el-form-item label="养护单位" label-width="150px">
+                <el-input
+                  v-model="maintaininfo.maintainUnit"
+                  type="textarea"
+                  placeholder="请输入"
+                ></el-input></el-form-item
+            ></el-col>
           </el-row>
+          <div style="font-weight: bold; font-size: 15px; margin-bottom: 10px">
+            养护计划量及任务派发
+          </div>
           <el-row>
-            <el-col :span="8"> <el-form-item label="计划年" label-width="150px">
-                <el-select
-                  v-model="maintaininfo.maintainYear"
-                  filterable
-                  placeholder="请选择类型"
-                >
-                  <el-option
-                    v-for="item in getyears()"
-                    :label="item"
-                    :value="item"
-                  ></el-option>
-                </el-select></el-form-item></el-col>
-             <el-col :span="8"> <el-form-item label="计划月" label-width="150px">
-               <el-select
-                  v-model="maintaininfo.maintainMonth"
-                  filterable
-                  placeholder="请选择类型"
-                >
-                  <el-option
-                    v-for="item in getmonth()"
-                    :label="item"
-                    :value="item"
-                  ></el-option>
-                </el-select></el-form-item></el-col>
-                 <el-col :span="8"> <el-form-item label="报送南排" label-width="150px">
-               <el-select
-                  v-model="maintaininfo.maintainReportNp"
-                  filterable
-                  placeholder="请选择"
-                >
-                  <el-option
-                    label="是"
-                    :value="1"
-                  ></el-option>
-                  <el-option
-                    label="否"
-                    :value="0"
-                  ></el-option>
-                </el-select></el-form-item></el-col>
+            <el-col :span="8">
+              <el-form-item label="检查井" label-width="100px">
+                <el-input
+                  v-model="maintaininfo.ext1.task.jcj"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(座)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="雨水口" label-width="100px">
+                <el-input
+                  v-model="maintaininfo.ext1.task.ysk"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(座)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="排河口" label-width="100px">
+                <el-input
+                  v-model="maintaininfo.ext1.task.phk"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(座)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
           </el-row>
+
           <el-row>
-            <el-col :span="12"> <el-form-item label="计划备注" label-width="150px">
-               <el-input
-                        v-model="maintaininfo.maintainDes"
-                        type="textarea"
-                        placeholder="请输入"
-                      ></el-input></el-form-item></el-col>
-             <el-col :span="12"> <el-form-item label="备注" label-width="150px">
-              <el-input
-                        v-model="maintaininfo.maintainRemark"
-                        type="textarea"
-                        placeholder="请输入"
-                      ></el-input></el-form-item></el-col>
+            <el-col :span="4">
+              <div
+                style="
+                  font-weight: bold;
+                  font-size: 15px;
+                  text-align: right;
+                  padding-right: 30px;
+                  padding-top: 3px;
+                "
+              >
+                雨水口养护详情
+              </div>
+            </el-col>
+            <el-col :span="4" style="padding-right: 10px">
+              <el-form-item label="单箅" label-width="40px">
+                <el-input
+                  v-model="maintaininfo.ext1.task.bz_dan"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(个)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+            <el-col :span="4" style="padding-right: 10px">
+              <el-form-item label="双箅" label-width="40px">
+                <el-input
+                  v-model="maintaininfo.ext1.task.bz_shuang"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(个)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+            <el-col :span="4" style="padding-right: 10px">
+              <el-form-item label="三箅" label-width="40px">
+                <el-input
+                  v-model="maintaininfo.ext1.task.bz_san"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(个)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+            <el-col :span="4" style="padding-right: 10px">
+              <el-form-item label="四箅" label-width="40px">
+                <el-input
+                  v-model="maintaininfo.ext1.task.bz_si"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(个)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+            <el-col :span="4" style="padding-right: 10px">
+              <el-form-item label="多箅" label-width="40px">
+                <el-input
+                  v-model="maintaininfo.ext1.task.bz_duo"
+                  type="text"
+                  placeholder="请输入"
+                  ><template #append>(个)</template></el-input
+                ></el-form-item
+              >
+            </el-col>
+          </el-row>
+
+          <el-row>
+            <el-col :span="4">
+              <div
+                style="
+                  font-weight: bold;
+                  font-size: 15px;
+                  text-align: right;
+                  padding-right: 30px;
+                  padding-top: 3px;
+                "
+              >
+                管道养护详情
+              </div>
+            </el-col>
+            <el-col :span="20">
+              <el-row>
+                <el-col :span="24">
+                  <el-row v-for="(item, index) in maintaininfo.ext1.task.gd">
+                    <el-col :span="8" style="padding-right: 10px">
+                      <el-form-item label="管道养护" label-width="80px">
+                        <el-input
+                          v-model="item.yh_length"
+                          type="text"
+                          placeholder="请输入"
+                          ><template #append>(米)</template></el-input
+                        ></el-form-item
+                      >
+                    </el-col>
+
+                    <el-col :span="8" style="padding-right: 10px">
+                      <el-form-item label="管径" label-width="80px">
+                        <el-input v-model="item.yh_gj" type="text" placeholder="请输入"
+                          ><template #append>(mm)</template></el-input
+                        ></el-form-item
+                      >
+                    </el-col>
+                    <el-col :span="8" style="padding-right: 40px; position: relative">
+                      <el-form-item label="备注" label-width="40px">
+                        <el-input
+                          v-model="item.yh_remark"
+                          type="text"
+                          placeholder="请输入"
+                        ></el-input
+                      ></el-form-item>
+                      <el-button
+                        style="position: absolute; right: 0; top: 3px"
+                        size="small"
+                        @click="gzloperat(index)"
+                        type="primary"
+                        :icon="
+                          index == maintaininfo.ext1.task.gd.length - 1 ? Plus : Minus
+                        "
+                      ></el-button>
+                    </el-col>
+                  </el-row>
+                </el-col>
+
+                <el-col :span="24">
+                  <div style="font-weight: bold; font-size: 15px">
+                    合计:{{
+                      evilFn(
+                        maintaininfo.ext1.task.gd
+                          .map((i) => {
+                            var p = 0;
+                            try {
+                              p = parseFloat(i.yh_length);
+                            } catch (e) {
+                              p = 0;
+                            }
+                            return p == "" || isNaN(p) ? 0 : p;
+                          })
+                          .join("+")
+                      )
+                    }}
+                    米
+                  </div>
+                </el-col>
+              </el-row>
+            </el-col>
+          </el-row>
+
+          <el-row style="margin-top: 10px">
+            <el-col :span="12" style="text-align: right">
+              <el-form-item :label="`计划开始时间`">
+                <el-date-picker
+                  v-model="maintaininfo.ext1.task.datestart"
+                  value-format="YYYY-MM"
+                  type="month"
+                  placeholder="请选择"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="12" style="text-align: right">
+              <el-form-item :label="`计划结束时间`">
+                <el-date-picker
+                  v-model="maintaininfo.ext1.task.dateend"
+                  value-format="YYYY-MM"
+                  type="month"
+                  placeholder="请选择"
+                />
+              </el-form-item>
+            </el-col>
           </el-row>
         </el-form>
       </div>
@@ -249,34 +551,52 @@
 </template>
 
 <script setup>
-import { defineComponent, ref, reactive, onMounted, computed } from "vue";
+import { defineComponent, ref, reactive, onMounted, computed, watch } from "vue";
 import { useDict } from "@/utils/dict";
 import router from "../../../router";
 // 分页组件
 import Pagination from "@/components/Pagination";
-
 import { listFacilities } from "@/api/system/facilities";
-
-import { listMaintain ,addMaintain} from "@/api/system/maintain";
-
+import { listMaintain, addMaintain } from "@/api/system/maintain";
 import { cloneDeep } from "lodash";
+import { listDept, getDept } from "@/api/system/dept";
+import { treeselect as deptTreeselect } from "@/api/system/dept";
 import { ElMessage } from "element-plus";
-
 import { useRoute } from "vue-router";
-import { delMaintain, updateMaintain } from "../../../api/system/maintain";
-
-const { maintain_status, maintain_type } = useDict(
-  "maintain_status",
-  "maintain_type"
-);
+import { delMaintain, getMaintain, updateMaintain } from "../../../api/system/maintain";
+import {
+  Delete,
+  Edit,
+  Search,
+  Share,
+  Upload,
+  Plus,
+  Minus,
+} from "@element-plus/icons-vue";
 
+const { maintain_status, maintain_type } = useDict("maintain_status", "maintain_type");
 const queryparameters = ref({
   status: "",
-  maintainType:"",
+  maintainType: "",
   facilitiesId: "",
   pageNum: 1,
   pageSize: 10,
 });
+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 showadd = ref(false);
@@ -285,33 +605,53 @@ const tableData = ref([]);
 const pagedata = ref({});
 const route = useRoute();
 const currentstatus = computed(() => route.params.status);
-
 const alldevices = ref([]);
-
-listFacilities().then((res) => {
-  alldevices.value = res.rows;
-});
-
 const maintaininfo = ref();
+const alldept = ref([]);
+const treedept = ref([]);
+
 const initadd = () => {
   maintaininfo.value = {
-    facilitiesId: 1,
-    maintainCount: 0,
-    maintainDes: "",
-    maintainMonth: "",
+    ext1: {
+      facilities_name: "",
+      facilities_road: "",
+      facilities_length: "",
+      facilities_gjfw: "",
+      facilities_start: "",
+      facilities_end: "",
+      facilities_unit: "",
+      task: {
+        jcj: "",
+        ysk: "",
+        phk: "",
+        bz_dan: "",
+        bz_shuang: "",
+        bz_san: "",
+        bz_si: "",
+        bz_duo: "",
+        gd: [
+          {
+            yh_length: "",
+            yh_gj: "",
+            yh_remark: "",
+          },
+        ],
+        datestart: "",
+        dateend: "",
+      },
+    },
+    facilitiesId: null,
     maintainRemark: "",
     maintainType: "",
-    maintainUnit: "",
-    maintainYear: "",
-    maintainReportNp: 1,
-    id:null,
+    id: null,
     status: 1,
   };
-}
-initadd();
+  proxy.resetForm("form");
+};
 
 const addmaintain = () => {
   initadd();
+
   showadd.value = true;
 };
 const getyears = () => {
@@ -320,19 +660,18 @@ const getyears = () => {
     years.push((2019 + i).toString());
   }
   return years;
-}
+};
 const getmonth = () => {
   var months = [];
   for (var i = 0; i < 12; i++) {
     if (i < 9) {
-       months.push("0"+(1 + i).toString());
-
+      months.push("0" + (1 + i).toString());
     } else {
-       months.push((1 + i).toString());
+      months.push((1 + i).toString());
     }
   }
   return months;
-}
+};
 
 const tblrowclick = (row) => {
   // console.log(row)
@@ -343,19 +682,22 @@ const onadd = () => {
   // Element.loading();
   loading.value = true;
   if (maintaininfo.value.id == null) {
-    addMaintain(maintaininfo.value).then(res => {
+    var ddf = cloneDeep(maintaininfo.value);
+    ddf.ext1 = JSON.stringify(ddf.ext1);
+    addMaintain(ddf).then((res) => {
       loading.value = false;
       showadd.value = false;
       getList();
-    })
+    });
   } else {
-    updateMaintain(maintaininfo.value).then(res => {
+    var ddf = cloneDeep(maintaininfo.value);
+    ddf.ext1 = JSON.stringify(ddf.ext1);
+    updateMaintain(ddf).then((res) => {
       loading.value = false;
       showadd.value = false;
       getList();
-    })
+    });
   }
-
 };
 
 const getList = () => {
@@ -369,16 +711,23 @@ const getList = () => {
     queryparameters.value.status = "";
   }
   listMaintain(queryparameters.value).then((response) => {
-    tableData.value = response.rows;
+    tableData.value = response.rows.map((i) => {
+      i.ext1 = JSON.parse(i.ext1);
+      return i;
+    });
     pagedata.value = response;
   });
 };
-getList();
-
 
 const edittask = (row) => {
-  maintaininfo.value = cloneDeep(row);
-  showadd.value = true;
+  initadd();
+  const id = row.id || ids.value;
+  getMaintain(id).then((res) => {
+    maintaininfo.value = res.data;
+    maintaininfo.value.ext1 = JSON.parse(maintaininfo.value.ext1);
+    showadd.value = true;
+    // title.value = "修改设施";
+  });
 };
 const deltask = (row) => {
   delMaintain(row.id).then((res) => {
@@ -386,8 +735,80 @@ const deltask = (row) => {
     getList();
   });
 };
+const gzloperat = (index) => {
+  if (maintaininfo.value.ext1.task.gd.length - 1 == index) {
+    //add
+    maintaininfo.value.ext1.task.gd.push({
+      yh_length: "",
+      yh_gj: "",
+      yh_remark: "",
+    });
+  } else {
+    //sub
+    maintaininfo.value.ext1.task.gd.splice(index, 1);
+  }
+};
+
+const evilFn = (fn) => {
+  let Fn = Function; // 一个变量指向Function,防止有些前端编译工具报错
+  return new Fn(`return ${fn}`)();
+};
+
+function setdatakey(dept) {
+  if (dept.children) {
+    dept.children = dept.children.map((i) => {
+      return setdatakey(i);
+    });
+  }
+  dept["value"] = dept.id;
+  return dept;
+}
 
 onMounted(() => {});
+
+{
+  listFacilities().then((res) => {
+    alldevices.value = res.rows.map((i) => {
+      i.ext1 = JSON.parse(i.ext1);
+      return i;
+    });
+  });
+  initadd();
+  getList();
+
+  listDept().then((response) => {
+    alldept.value = cloneDeep(response.data);
+  });
+  deptTreeselect().then((res) => {
+    treedept.value = [setdatakey(res.data[0])];
+  });
+
+  watch(
+    () => maintaininfo.value.facilitiesId,
+    () => {
+      if (maintaininfo.value.facilitiesId != null) {
+        var fd = alldevices.value.filter(
+          (i) => i.id + "" == maintaininfo.value.facilitiesId + ""
+        )[0];
+        maintaininfo.value.ext1["facilities_name"] = fd.ext1.tz_ss_name;
+        maintaininfo.value.ext1["facilities_road"] = fd.ext1.tz_ss_road;
+        maintaininfo.value.ext1["facilities_length"] = fd.ext1.tz_ss_data_length;
+        maintaininfo.value.ext1["facilities_gjfw"] = fd.ext1.tz_ss_dn;
+        maintaininfo.value.ext1["facilities_start"] = fd.ext1.tz_ss_road_start;
+        maintaininfo.value.ext1["facilities_end"] = fd.ext1.tz_ss_road_end;
+        maintaininfo.value.ext1["facilities_unit"] = fd.ext1.tz_ss_unit;
+        maintaininfo.value.ext1["task"]["jcj"] = fd.ext1.tz_ss_data_jing;
+        maintaininfo.value.ext1["task"]["ysk"] = fd.ext1.tz_ss_data_ysk;
+        maintaininfo.value.ext1["task"]["phk"] = fd.ext1.tz_pfk;
+        maintaininfo.value.ext1["task"]["bz_dan"] = fd.ext1.tz_bz_dan;
+        maintaininfo.value.ext1["task"]["bz_shuang"] = fd.ext1.tz_bz_shuang;
+        maintaininfo.value.ext1["task"]["bz_san"] = fd.ext1.tz_bz_san;
+        maintaininfo.value.ext1["task"]["bz_si"] = fd.ext1.tz_bz_si;
+        maintaininfo.value.ext1["task"]["bz_duo"] = fd.ext1.tz_bz_duo;
+      }
+    }
+  );
+}
 </script>
 
 <style lang="scss" scoped>

+ 3 - 123
src/views/mb/detection/feedback/index.vue

@@ -39,7 +39,7 @@
                   </template>
                 </van-field>
 
-                <van-field
+                <!-- <van-field
                   v-model="zxfkobj.gzz.rs"
                   name="人数"
                   label="人数"
@@ -138,7 +138,7 @@
                   name="车牌号"
                   label="车牌号"
                   placeholder="请输入车牌号"
-                />
+                /> -->
 
                 <van-field name="作业图片" label="作业图片">
                     <template #input>
@@ -154,103 +154,7 @@
             </van-form>
           </div>
         </van-tab>
-        <van-tab title="工作量">
-          <div :style="`background:#fff;padding-top: 10px;max-height:${bodyheight-160}px;overflow-y: auto;`">
-            <van-form>
-              <van-cell-group inset>
 
-                <van-field
-                  v-model="zxfkobj.gzl.jcj"
-                  name="检查井(座)"
-                  label="检查井(座)"
-                  type="number"
-                  placeholder="请输入数量"
-                />
-                <van-field
-                  v-model="zxfkobj.gzl.ysk"
-                  name="雨水口(座)"
-                  label="雨水口(座)"
-                  type="number"
-                  placeholder="请输入数量"
-                />
-                <van-field
-                  v-model="zxfkobj.gzl.bz"
-                  name="箅子(个)"
-                  label="箅子(个)"
-                  type="number"
-                  placeholder="请输入数量"
-                />
-                <van-field
-                  v-model="zxfkobj.gzl.zg"
-                  name="主管(m)"
-                  label="主管(m)"
-                  type="number"
-                  placeholder="请输入数量"
-                />
-                <van-field
-                  v-model="zxfkobj.gzl.jhg"
-                  name="接户管(m)"
-                  label="接户管(m)"
-                  type="number"
-                  placeholder="请输入数量"
-                />
-                <van-field
-                  v-model="zxfkobj.gzl.yskzg"
-                  name="雨水口支管(m)"
-                  label="雨水口支管(m)"
-                  type="number"
-                  placeholder="请输入数量"
-                />
-                <van-field
-                  v-model="zxfkobj.gzl.zsscd"
-                  name="总设施长度(m)"
-                  label="总设施长度(m)"
-                  type="number"
-                  placeholder="请输入数量"
-                />
-                  <van-field
-                  v-model="zxfkobj.gzl.gjfw"
-                  name="管径范围(mm)"
-                  label="管径范围(mm)"
-                  type="number"
-                  placeholder="请输入数量"
-                />
-                <van-field
-                  v-model="zxfkobj.gzl.remark"
-                  name="备注"
-                  label="备注"
-                  rows="2"
-                  autosize
-                  type="textarea"
-                  placeholder="请输入"
-                />
-                <van-field
-                  v-model="zxfkobj.gzl.wnzyyy"
-                  name="未能作业原因"
-                  label="未能作业原因"
-                  rows="2"
-                  autosize
-                  type="textarea"
-                  placeholder="请输入"
-                />
-                <van-field
-                  v-model="zxfkobj.gzl.remark1"
-                  name="备注"
-                  label="备注"
-                  rows="2"
-                  autosize
-                  type="textarea"
-                  placeholder="请输入"
-                />
-                <van-field name="现场图片" label="现场图片">
-                   <template #input>
-                  <ImageUpload v-model="zxfkobj.gzl.images"></ImageUpload>
-                  </template>
-                </van-field>
-              </van-cell-group>
-            </van-form>
-          </div>
-        </van-tab>
       </van-tabs>
 
       <div style="margin: 16px">
@@ -326,33 +230,9 @@ const zxfkobj = ref({
   gzz: {
     fzr: "",
     zy: "",
-    rs: 1,
-    starttime: "",
-    endtime: "",
-    addrstart: "",
-    addrend: "",
-    cq: "",
-    addr: "",
-    jcsb: "",
-    cars: "",
-    carnumber: "",
     zyimages: [],
     gzimages: [],
-  },
-  gzl: {
-   jcj: "",
-    ysk: "",
-    bz: "",
-    zg: "",
-    jhg: "",
-    yskzg: "",
-    zsscd: "",
-    gjfw: "",
-    remark: "",
-    wnzyyy: "",
-    remark1: "",
-    images: [],
-  },
+  }
 });
 const allusers = ref([]);
 

+ 18 - 22
src/views/mb/detection/index.vue

@@ -32,8 +32,8 @@
                   <div class="header">
                     <div>
                       计划名称:{{
-                        alldevices.filter((i) => i.id === item.facilitiesId)[0]
-                          ?.roadName ?? "-"
+                       alldevices.filter((i) => i.id === item.facilitiesId)[0]
+                          ?.ext1.tz_ss_name  ?? "-"
                       }}检测计划
                     </div>
                     <div class="time">{{ item.detectionTime }}</div>
@@ -61,24 +61,14 @@
                           }}
                         </div></van-col
                       >
-                      <van-col span="8"> <div>计划年:{{item.detectionYear}}</div></van-col>
-                      <van-col span="8"><div>计划月:{{item.detectionMonth}}</div></van-col>
-                      <van-col span="8"><div>计划周:{{item.detectionWeek}}</div></van-col>
+                       <van-col span="12">
+                        <div>计划开始:{{ item.ext1.task.datestart }}</div></van-col
+                      >
+                      <van-col span="12"
+                        ><div>计划结束:{{ item.ext1.task.dateend }}</div></van-col
+                      >
                       <van-col span="24"
-                        ><div>
-                          设施起止点:
-                          {{
-                            alldevices.filter(
-                              (i) => i.id === item.facilitiesId
-                            )[0]?.addrFrom
-                          }}
-                          -
-                          {{
-                            alldevices.filter(
-                              (i) => i.id === item.facilitiesId
-                            )[0]?.addrEnd
-                          }}
-                        </div></van-col
+                        ><div>检测单位: {{ item.detectionDes }}</div></van-col
                       >
                     </van-row>
                      <van-row v-if="item.status == 2">
@@ -144,7 +134,10 @@ const option2 = computed(() => {
 });
 const alldevices = ref([]);
 listFacilities().then((res) => {
-  alldevices.value = res.rows;
+  alldevices.value = res.rows.map((i) => {
+      i.ext1 = JSON.parse(i.ext1);
+      return i;
+    });
 });
 
 const pagec = ref(1);
@@ -165,7 +158,10 @@ const onLoad = () => {
   listDetection(p).then((res) => {
     // finished.value = true;
     loading.value = false;
-    detectionlist.value = detectionlist.value.concat(res.rows);
+    detectionlist.value = detectionlist.value.concat(res.rows.map((i) => {
+      i.ext1 = JSON.parse(i.ext1);
+      return i;
+    }));
     if (res.total <= detectionlist.value.length) {
       finished.value = true;
     }
@@ -206,7 +202,7 @@ const gotoxcfk = (item) => {
 }
 
 const gotodetail = (item) => {
-  router.push(`/mb/detection/detail/${item.id}`);
+  // router.push(`/mb/detection/detail/${item.id}`);
 }
 </script>
 

+ 6 - 28
src/views/mb/maintain/feedback/index.vue

@@ -15,6 +15,7 @@
                 <van-field
                   v-model="zxfkobj.gzz.fzr"
                   name="负责人"
+                  readonly
                   label="负责人"
                   placeholder="请输入负责人"
                 />
@@ -39,7 +40,7 @@
                   </template>
                 </van-field>
 
-                <van-field
+                <!-- <van-field
                   v-model="zxfkobj.gzz.rs"
                   name="人数"
                   label="人数"
@@ -138,7 +139,7 @@
                   name="车牌号"
                   label="车牌号"
                   placeholder="请输入车牌号"
-                />
+                /> -->
 
                 <van-field name="作业图片" label="作业图片">
                     <template #input>
@@ -154,7 +155,7 @@
             </van-form>
           </div>
         </van-tab>
-        <van-tab title="工作量">
+        <!-- <van-tab title="工作量">
           <div :style="`background:#fff;padding-top: 10px;max-height:${bodyheight-160}px;overflow-y: auto;`">
             <van-form>
               <van-cell-group inset>
@@ -242,7 +243,7 @@
               </van-cell-group>
             </van-form>
           </div>
-        </van-tab>
+        </van-tab> -->
       </van-tabs>
 
       <div style="margin: 16px">
@@ -316,34 +317,11 @@ const onConfirm2 = () => {
 const active = ref(0);
 const zxfkobj = ref({
   gzz: {
-    fzr: "",
+     fzr: "",
     zy: "",
-    rs: 1,
-    starttime: "",
-    endtime: "",
-    addrstart: "",
-    addrend: "",
-    cq: "",
-    addr: "",
-    jcsb: "",
-    cars: "",
-    carnumber: "",
     zyimages: [],
     gzimages: [],
   },
-  gzl: {
-    gj: "",
-    dycd: "",
-    nl: "",
-    jcj: "",
-    ysk: "",
-    bz: "",
-    yskzg: "",
-    remark: "",
-    wnzyyy: "",
-    remark1: "",
-    images: [],
-  },
 });
 const allusers = ref([]);
 

+ 12 - 6
src/views/mb/maintain/index.vue

@@ -34,7 +34,7 @@
                     <div>
                       计划名称:{{
                         alldevices.filter((i) => i.id === item.facilitiesId)[0]
-                          ?.roadName ?? "-"
+                          ?.ext1.tz_ss_name  ?? "-"
                       }}养护计划
                     </div>
                     <div class="time">{{ item.maintainTime }}</div>
@@ -63,10 +63,10 @@
                         </div></van-col
                       >
                       <van-col span="12">
-                        <div>计划年:{{ item.maintainYear }}</div></van-col
+                        <div>计划开始:{{ item.ext1.task.datestart }}</div></van-col
                       >
                       <van-col span="12"
-                        ><div>计划月:{{ item.maintainMonth }}</div></van-col
+                        ><div>计划结束:{{ item.ext1.task.dateend }}</div></van-col
                       >
                       <van-col span="24"
                         ><div>养护单位: {{ item.maintainUnit }}</div></van-col
@@ -135,7 +135,10 @@ const option2 = computed(() => {
 });
 const alldevices = ref([]);
 listFacilities().then((res) => {
-  alldevices.value = res.rows;
+  alldevices.value = res.rows.map((i) => {
+      i.ext1 = JSON.parse(i.ext1);
+      return i;
+    });
 });
 
 const pagec = ref(1);
@@ -156,7 +159,10 @@ const onLoad = () => {
   listMaintain(p).then((res) => {
     // finished.value = true;
     loading.value = false;
-    maintainlist.value = maintainlist.value.concat(res.rows);
+    maintainlist.value = maintainlist.value.concat(res.rows.map((i) => {
+      i.ext1 = JSON.parse(i.ext1);
+      return i;
+    }));
     if (res.total <= maintainlist.value.length) {
       finished.value = true;
     }
@@ -197,7 +203,7 @@ const onClickRight = () => {
   alert("add");
 };
 const gotodetail = (item) => {
-  router.push(`/mb/maintain/detail/${item.id}`);
+  // router.push(`/mb/maintain/detail/${item.id}`);
 };
 </script>
 

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません