123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929 |
- <template>
- <div style="padding: 10px">
- <div class="formbody">
- <el-form :inline="true" v-model="queryparameters" class="demo-form-inline">
- <el-col :span="6">
- <el-form-item label="设施台账">
- <el-select filterable
- v-model="queryparameters.facilitiesId"
- class="m-1"
- placeholder="请选择"
- >
- <el-option
- v-for="item in alldevices"
- :label="item.ext1.tz_id" :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="计划状态" v-if="currentstatus == 1">
- <el-select v-model="queryparameters.status" class="m-1" placeholder="请选择">
- <el-option
- v-for="item in detection_status"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="道路名">
- <el-select v-model="queryparameters.taskArea" class="m-2" placeholder="请选择">
- <el-option
- v-for="item in alldevices"
- :label="item.roadName"
- :value="item.roadName"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="班组区域">
- <el-tree-select v-model="queryparameters.taskDeptRange" multiple :data="treedept" check-strictly="true" />
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="任务时间">
- <el-date-picker v-model="qdate" type="daterange" value-format="YYYY-MM-DD" range-separator="到"
- start-placeholder="开始时间" end-placeholder="结束时间" />
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="关键字">
- <el-input v-model="queryparameters.searchkey" placeholder="设施名称/道路"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <div style="float: right">
- <el-form-item>
- <el-button type="primary" @click="resetall">重置</el-button>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="getList">查询</el-button>
- </el-form-item>
- <el-form-item>
- <el-button type="success" @click="adddetection">新增</el-button>
- </el-form-item>
- </div>
- </el-col>
- </el-form>
- <div>
- <el-table
- :data="tableData"
- class="eltable"
- style="width: 100%"
- @row-click="tblrowclick"
- >
- <el-table-column prop="taskCode" label="台账编号">
- <template #default="scope">
- {{
- alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]?.ext1
- .tz_id ?? "-"
- }}
- </template>
- </el-table-column>
- <el-table-column prop="taskCode" label="设施名称">
- <template #default="scope">
- {{
- alldevices.filter((i) => i.id === scope.row.facilitiesId)[0]?.ext1
- .tz_ss_name ?? "-"
- }}
- </template>
- </el-table-column>
- <el-table-column prop="taskCode" label="城区">
- <template #default="scope">
- {{
- (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="检测类型">
- <template #default="scope">
- {{
- detection_type.filter(
- (i) => i.value + "" === scope.row.detectionType + ""
- )[0]?.label ?? "-"
- }}
- </template>
- </el-table-column>
- <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">
- {{
- 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)"
- >修改
- </el-button>
- <el-popconfirm title="确定删除?" @confirm="deltask(scope.row)">
- <template #reference>
- <el-button text size="small" @click.stop="">删除</el-button>
- </template>
- </el-popconfirm>
- </template>
- </el-table-column>
- <!-- <el-table-column prop="ext1" label="责任人" width="180">
- <template #default="scope">
- {{ scope.row.ext1 === "" ? "未派发" : scope.row.ext1 }}
- </template>
- </el-table-column> -->
- </el-table>
- <div style="position: relative; padding-right: 20px; margin-top: -20px">
- <Pagination
- :total="pagedata.total ?? 0"
- v-show="pagedata.total > 0"
- v-model:page="queryparameters.pageNum"
- v-model:limit="queryparameters.pageSize"
- @pagination="getList"
- ></Pagination>
- <!-- <el-pagination
- style="float: right"
- small
- background
- :page-sizes="[10, 20, 30, 50]"
- :page-size="10"
- layout=" sizes,prev, pager, next"
- :total="pagedata.total??0"
- class="mt-4"
- /> -->
- </div>
- </div>
- </div>
- <el-dialog
- v-model="showadd"
- v-loading="loading"
- title="新增设施检测计划"
- width="70%"
- draggable
- >
- <div>
- <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-select
- v-model="detectioninfo.facilitiesId"
- filterable
- placeholder="请选择设备"
- >
- <el-option
- v-for="item in alldevices"
- :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="任务类型"
- required
- label-width="150px"
- prop="maintainType"
- >
- <el-select
- v-model="detectioninfo.maintainType"
- filterable
- placeholder="请选择类型"
- >
- <el-option
- v-for="item in detection_type"
- :label="item.label"
- :value="parseInt(item.value)"
- ></el-option>
- </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="detectioninfo.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="detectioninfo.ext1.facilities_road"
- placeholder="请输入"
- ></el-input></el-form-item
- ></el-col>
- <el-col :span="6"
- ><el-form-item label="运维长度" label-width="100px">
- <el-input
- type="number"
- 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
- type="number"
- 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.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="detectioninfo.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="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-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="number"
- 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="number"
- 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="number"
- 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="4" style="padding-right: 10px">
- <el-form-item label="单箅" label-width="40px">
- <el-input
- v-model="detectioninfo.ext1.task.bz_dan"
- type="number"
- 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_shuang"
- type="number"
- 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="number"
- 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="number"
- 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="number"
- 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="number"
- 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="number" 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>
- <el-button type="primary" @click="onadd">保存</el-button>
- </span>
- </template>
- </el-dialog>
- </div>
- </template>
- <script setup>
- import { defineComponent, ref, reactive, onMounted, computed } from "vue";
- 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 { listDept, getDept } from "@/api/system/dept";
- import { treeselect as deptTreeselect } from "@/api/system/dept";
- import { cloneDeep } from "lodash";
- import { ElMessage } from "element-plus";
- import { onBeforeRouteLeave, 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",
- "detection_type"
- );
- const queryparameters = ref({
- status: "",
- facilitiesId: "",
- taskDeptRange: [],
- searchkey: "",
- pageNum: 1,
- pageSize: 10,
- });
- const { proxy } = getCurrentInstance();
- const showadd = ref(false);
- const loading = ref(false);
- const tableData = ref([]);
- const pagedata = ref({});
- const route = useRoute();
- const qdate = ref([]);
- const currentstatus = computed(() => route.params.status);
- const alldevices = ref([]);
- const treedept = ref([]);
- const detectioninfo = ref({});
- const maintaininfo = ref();
- const alldept = ref([]);
- const adddetection = () => {
- initadd();
- showadd.value = true;
- };
- const tblrowclick = (row) => {
- // console.log(row)
- router.push(`/detection/detail/${row.id}`);
- };
- const resetall = () => {
- queryparameters.value = {
- status: "",
- facilitiesId: "",
- taskDeptRange: [],
- searchkey: "",
- pageNum: 1,
- pageSize: 10,
- }
- }
- 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;
- 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) => {
- loading.value = false;
- showadd.value = false;
- getList();
- });
- } else {
- 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) => {
- loading.value = false;
- showadd.value = false;
- getList();
- });
- }
- };
- const getList = () => {
- if (currentstatus.value != 1) {
- if (currentstatus.value == 2) {
- queryparameters.value.status = 1;
- } else {
- queryparameters.value.status = currentstatus.value;
- }
- } else {
- queryparameters.value.status = "";
- }
- var cq = cloneDeep(queryparameters.value);
- var query = proxy.addDateRange(cq, qdate.value);
- if (query.status == "0") {
- delete query.status;
- }
- if (query.searchkey != undefined && query.searchkey !== "") {
- query.params["searchkey"] = query.searchkey;
- }
- if (query.taskDeptRange != undefined) {
- query.taskDeptRange = query.taskDeptRange.join(",");
- }
- listDetection(query).then((response) => {
- tableData.value = response.rows.map((i) => {
- i.ext1 = JSON.parse(i.ext1);
- return i;
- });
- pagedata.value = response;
- });
- };
- const getyears = () => {
- var years = [];
- for (var i = 0; i <= 100; i++) {
- 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());
- } else {
- months.push((1 + i).toString());
- }
- }
- 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));
- }
- showadd.value = true;
- };
- const deltask = (row) => {
- delDetection(row.id).then((res) => {
- ElMessage.success("删除成功");
- getList();
- });
- };
- {
- 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;
- }
- deptTreeselect().then((res) => {
- treedept.value = [setdatakey(res.data[0].children.filter(i => i.id == 202))[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;
- }
- }
- );
- }
- onMounted(() => {
- });
- onBeforeRouteLeave((to, from, next) => {
- to.meta.activeMenu = from.path;
- console.log(to);
- next()
- })
- </script>
- <style lang="scss" scoped>
- .formbody {
- background: #fff;
- width: 100%;
- border-radius: 5px;
- min-height: 80vh;
- padding: 15px 10px;
- .eltable {
- border: 1px solid #e5e9f2;
- border-radius: 5px;
- }
- }
- </style>
- <style>
- .el-table__row:hover {
- cursor: pointer;
- }
- .el-select {
- width: 100%;
- }
- </style>
|