123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
- <el-form-item label="行政区" prop="district">
- <el-select v-model="queryParams1.district" placeholder="请选择行政区" clearable
- @change="queryParams1.areaId = undefined;getAreaList(queryParams1.district)"
- @clear="queryParams1.areaId = undefined;areaList=[];
- queryParams1.buildingId = undefined;buildingList=[];
- queryParams1.unitId = undefined;unitList=[]">
- <el-option
- v-for="dict in dict.type.district"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="小区名称" prop="areaId">
- <el-select v-model="queryParams1.areaId" filterable clearable placeholder="请选择小区"
- @change="queryParams1.buildingId = undefined;getBuildingList1(queryParams1.areaId)"
- @clear="queryParams1.buildingId = undefined;buildingList=[];
- queryParams1.unitId = undefined;unitList=[]">
- <el-option
- v-for="item in areaList"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="楼宇名称" prop="buildingId">
- <el-select v-model="queryParams1.buildingId" filterable clearable placeholder="请选择楼宇"
- @change="queryParams1.unitId = undefined;getUnitList1(queryParams1.buildingId)"
- @clear="queryParams1.unitId = undefined;unitList=[]"
- >
- <el-option
- v-for="item in buildingList"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="单元" prop="unitId">
- <el-select v-model="queryParams1.unitId" placeholder="请选择单元" filterable clearable>
- <el-option
- v-for="obj in unitList"
- :key="obj.id"
- :label="obj.name"
- :value="obj.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- plain
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['zdsz:engineeringCivil:add']"
- >新增
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="success"
- plain
- icon="el-icon-edit"
- size="mini"
- :disabled="single"
- @click="handleUpdate"
- v-hasPermi="['zdsz:engineeringCivil:edit']"
- >修改
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- plain
- icon="el-icon-delete"
- size="mini"
- :disabled="multiple"
- @click="handleDelete"
- v-hasPermi="['zdsz:engineeringCivil:remove']"
- >删除
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- plain
- icon="el-icon-download"
- size="mini"
- @click="handleExport"
- v-hasPermi="['zdsz:engineeringCivil:export']"
- >导出
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- icon="el-icon-circle-check"
- size="mini"
- @click="handleExport"
- v-hasPermi="['zdsz:engineeringCivil:export']"
- >批量审核
- </el-button>
- </el-col>
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-table v-loading="loading" :data="engineeringCivilList" @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="55" align="center"/>
- <el-table-column label="主键" align="center" prop="id" v-if="false"/>
- <el-table-column label="行政区" align="center" prop="district">
- <template slot-scope="scope">
- <dict-tag :options="dict.type.district" :value="scope.row.district"/>
- </template>
- </el-table-column>
- <el-table-column label="小区名称" align="center" prop="areaName"/>
- <el-table-column label="楼宇名称" align="center" prop="buildingName"/>
- <el-table-column label="单元名称" align="center" prop="unitName"/>
- <el-table-column label="房间名称" align="center" prop="houseName"/>
- <el-table-column label="工程类型" align="center" prop="enginType">
- <template slot-scope="scope">
- {{ scope.row.enginType === 'old_renovation' ? "旧改工程" : "新建" }}
- </template>
- </el-table-column>
- <el-table-column label="工程分类" align="center" prop="enginClassificationName"/>
- <el-table-column label="工程周期" align="center" prop="enginCycle">
- <template slot-scope="scope">
- <dict-tag :options="dict.type.engin_cycle" :value="scope.row.enginCycle"/>
- </template>
- </el-table-column>
- <!-- <el-table-column label="完工状态" align="center" prop="completionStatus"/>-->
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['zdsz:engineeringCivil:edit']"
- >修改
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['zdsz:engineeringCivil:remove']"
- >删除
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-circle-check"
- @click="viewSource(scope.row)"
- v-hasPermi="['zdsz:engineeringCivil:remove']"
- >审核
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-time"
- @click="viewSource(scope.row)"
- v-hasPermi="['zdsz:engineeringCivil:remove']"
- >历史用料
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="addNewPipe(scope.row)"
- >新增顶管工程
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="addMaterial(scope.row)"
- >新增物料
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams1.pageNum"
- :limit.sync="queryParams1.pageSize"
- @pagination="getList"
- />
- <!-- 添加或修改民用工程对话框 -->
- <el-dialog :title="title" ref="nodeForm" :visible.sync="open" width="500" append-to-body custom-class="addDialog"
- @close="onClose">
- <el-form ref="form" :model="queryParams" :rules="rules" label-width="110px">
- <el-row>
- <el-col :span="12">
- <el-form-item label="行政区" prop="district">
- <el-select
- :disabled="title == '添加用料' "
- v-model="queryParams.district"
- placeholder="请选择行政区"
- @change="districtHasChanged"
- >
- <el-option
- v-for="e in dict.type.district"
- :key="e.value"
- :label="e.label"
- :value="e.value"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="小区" prop="areaId">
- <el-select
- :disabled="title == '添加用料' "
- v-model="queryParams.areaId"
- placeholder="请选择小区"
- @change="communityHasChanged"
- >
- <el-option
- v-for="e in communityOptions"
- :key="e.id"
- :label="e.name"
- :value="e.id"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="楼栋" prop="buildingId">
- <el-select
- :disabled="title == '添加用料' "
- v-model="queryParams.buildingId"
- placeholder="请选择楼栋"
- @change="buildingHasChanged"
- >
- <el-option
- v-for="e in buildingOptions"
- :key="e.id"
- :label="e.name"
- :value="e.id"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="单元" prop="unitId">
- <el-select
- :disabled="title == '添加用料' "
- v-model="queryParams.unitId"
- placeholder="请选择单元"
- @change="unitHasChanged"
- >
- <el-option
- v-for="e in unitOptions"
- :key="e.id"
- :label="e.name"
- :value="e.id"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="房间" prop="houseId">
- <el-select
- :disabled="title == '添加用料' "
- v-model="queryParams.houseId"
- placeholder="请选择房间"
- >
- <el-option
- v-for="e in houseOptions"
- :key="e.id"
- :label="e.name"
- :value="e.id"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="工程类型" prop="enginType">
- <el-select
- :disabled="title == '添加用料' "
- v-model="queryParams.enginType"
- placeholder="请选择工程类型"
- @change="enginTypeHasChanged"
- >
- <el-option
- v-for="e in enginTypeOption"
- :key="e.value"
- :label="e.label"
- :value="e.value"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="工程分类" prop="enginClassification">
- <el-select
- :disabled="title == '添加用料' "
- v-model="queryParams.enginClassification"
- placeholder="请选择工程分类"
- @change="currentEnginTypeChanged"
- >
- <el-option
- v-for="e in currentEnginTypeChangeOptions"
- :key="e.dictValue"
- :label="e.dictLabel"
- :value="e.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="工程周期" prop="enginCycle">
- <el-select
- :disabled="title == '添加用料' "
- v-model="queryParams.enginCycle"
- placeholder="请填写工程周期"
- >
- <el-option
- v-for="e in dict.type.engin_cycle"
- :key="e.value"
- :label="e.label"
- :value="e.value"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-form-item label="节点">
- <el-checkbox-group v-model="currentCheckList">
- <el-checkbox
- :label="item.dictValue"
- v-for="item in checkList"
- :key="item"
- ></el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- </el-col>
- </el-row>
- <EnginNodeInfo
- v-for="(e,idx) in currentCheckList"
- :key="idx"
- :name="e"
- :ref="'EnginNodeInfo'+idx"
- :currentContain="(listContain.find(i => i.name == e)).components"
- :updateOption='(updateOption.find(i => i.type == e)) || {}'
- :types="currentCheckList"
- :status="enginNodeStatus"
- enginType="民用工程"
- />
- <!-- <el-tabs type="border-card" >
- <el-tab-pane label="用户管理">用户管理</el-tab-pane>
- <el-tab-pane label="配置管理">配置管理</el-tab-pane>
- <el-tab-pane label="角色管理">角色管理</el-tab-pane>
- <el-tab-pane label="定时任务补偿">定时任务补偿</el-tab-pane>
- </el-tabs> -->
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button :loading="buttonLoading" type="primary" @click="toNodeDetail">{{ enginNodeStatus }}</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 查看历史 -->
- <ConstructionDetails
- ref="ConstructionDetails"
- :currentCollapses="currentCollapses"
- />
- </div>
- </template>
- <script>
- import {
- listEngineeringCivil,
- getEngineeringCivil,
- delEngineeringCivil,
- addEngineeringCivil,
- updateEngineeringCivil
- } from "@/api/zdsz/engineeringCivil";
- import {
- addEnginee, // 新增工程
- getHousesList, // 获取当前房间集合
- putEngineeringCivil, // 民用工程修改
- viewEngineeringCivil, // 民用工程查看详情
- deleteEngineeringCivil, // 删除民用工程
- getDictList, viewEngineeringInfrastructureSource, viewEngineeringCivilSource
- } from "@/api/zdsz/enginee"
- import {getAreaList} from "@/api/zdsz/area";
- import {getBuildingList} from "@/api/zdsz/building";
- import {getUnits} from "@/api/zdsz/unit";
- import {getDicts} from "@/api/system/dict/data";
- import EnginNodeInfo from "@/components/EnginNodeInfo/index";
- import ConstructionDetails from "@/components/ConstructionDetails/index.vue";
- export default {
- components: {
- ConstructionDetails,
- EnginNodeInfo
- },
- name: "EngineeringCivil",
- dicts: ['pass_check',
- 'is_repair',
- 'engin_type',
- 'self_closing_valve_type',
- 'visit_type', 'district',
- 'new_built_indoor_engin',
- "old_renovation_indoor_engin",
- "old_renovation_courtyard",
- "old_renovation_overhead",
- "new_built_indoor_engin",
- "new_built_courtyard",
- "new_built_overhead",
- "engin_cycle"],
- data() {
- return {
- currentCollapses: [],
- enginId: undefined,
- updateOption: [],
- listContain: [
- {
- name: '放线',
- components: [
- [
- 'materialQuality', // 材质
- 'specifications', // 规格
- 'number', // 数量
- ],
- 'constructTime', // 施工时间
- 'zEngiineeringPhotoBoList', // 照片
- 'remark', // 施工内容
- ]
- },
- {
- name: '挖沟',
- components: [
- [
- 'materialQuality', // 材质
- 'specifications', // 规格
- 'number', // 数量
- ],
- 'constructTime', // 施工时间
- 'zEngiineeringPhotoBoList', // 照片
- 'remark', // 施工内容
- ]
- },
- {
- name: '焊接',
- components: [
- [
- 'materialQuality', // 材质
- 'specifications', // 规格
- 'number', // 数量
- ],
- 'constructTime', // 施工时间
- 'zEngiineeringPhotoBoList', // 照片
- 'remark', // 施工内容
- ]
- },
- {
- name: '下沟',
- components: [
- [
- 'materialQuality', // 材质
- 'specifications', // 规格
- 'number', // 数量
- ],
- 'constructTime', // 施工时间
- 'zEngiineeringPhotoBoList', // 照片
- 'remark', // 施工内容
- ]
- },
- {
- name: '回田',
- components: [
- [
- 'materialQuality', // 材质
- 'specifications', // 规格
- 'number', // 数量
- ],
- 'backfillTime', // 回填时间
- 'constructTime', // 施工时间
- 'zEngiineeringPhotoBoList', // 照片
- 'remark', // 施工内容
- ]
- },
- {
- name: '打压',
- components: [
- [
- 'materialQuality', // 材质
- 'specifications', // 规格
- 'number', // 数量
- ],
- 'segmentedCompressionQualified', // 分段打压
- 'constructTime', // 施工时间
- 'zEngiineeringPhotoBoList', // 照片
- 'remark', // 施工内容
- ]
- },
- {
- name: '除锈',
- components: [
- [
- 'materialQuality', // 材质
- 'specifications', // 规格
- 'number', // 数量
- ],
- 'constructTime', // 施工时间
- 'zEngiineeringPhotoBoList', // 照片
- 'remark', // 施工内容
- ]
- },
- {
- name: '刷油',
- components: [
- [
- 'materialQuality', // 材质
- 'specifications', // 规格
- 'number', // 数量
- ],
- 'constructTime', // 施工时间
- 'zEngiineeringPhotoBoList', // 照片
- 'remark', // 施工内容
- ]
- },
- {
- name: '打磨',
- components: [
- [
- 'materialQuality', // 材质
- 'specifications', // 规格
- 'number', // 数量
- ],
- 'constructTime', // 施工时间
- 'zEngiineeringPhotoBoList', // 照片
- 'remark', // 施工内容
- ]
- },
- {
- name: '打孔',
- components: [
- [
- 'corrosionLevel', // 孔径/腐蚀等级
- ],
- 'constructTime', // 施工时间
- 'zEngiineeringPhotoBoList', // 照片
- ]
- },
- {
- name: '立杠',
- components: [
- [
- 'materialQuality', // 材质
- 'specifications', // 规格
- 'number', // 数量
- ],
- 'constructTime', // 施工时间
- 'zEngiineeringPhotoBoList', // 照片
- ]
- },
- {
- name: '挂表',
- components: [
- [
- 'brand', // 品牌
- ],
- 'constructTime', // 施工时间
- 'zEngiineeringPhotoBoList', // 照片
- 'remark', // 施工内容
- ]
- },
- {
- name: '表后管',
- components: [
- [
- 'materialQuality', // 材质
- 'specifications', // 规格
- 'number', // 数量
- ],
- 'constructAccordingDrawings', // 是否按图纸施工
- 'constructTime', // 施工时间
- 'zEngiineeringPhotoBoList', // 照片
- ]
- },
- {
- name: '阀管',
- components: [
- [
- 'materialQuality', // 材质
- 'specifications', // 规格
- 'number', // 数量
- 'visitType', // 上门类型
- 'selfClosingValveType', // 自闭阀类型
- ],
- 'constructTime', // 施工时间
- 'zEngiineeringPhotoBoList', // 照片
- ]
- },
- ],
- currentCheckList: [],
- enginClassificationinfo: '',
- enginClassification: '',
- enginClassificationOption: [],
- enginTypeOption: [
- {
- value: 'old_renovation',
- label: '旧改'
- }, {
- value: 'new_built',
- label: '新建'
- },
- ],
- currentEnginTypeChangeOptions: [],
- // 按钮loading
- buttonLoading: false,
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 民用工程表格数据
- engineeringCivilList: [],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- // 查询参数
- queryParams: {
- district: undefined,
- areaId: undefined,
- buildingId: undefined,
- unitId: undefined,
- houseId: undefined,
- enginType: undefined,
- enginCycle: undefined,
- completionStatus: undefined,
- enginClassification: undefined,
- imgUrl: undefined,
- zEngineeringNodeBoList: {
- type: undefined,
- zEngineeringInfoBo: {
- constructAddre: undefined, // 施工地址
- constructPhone: undefined, // 施工人电话
- constructUser: undefined, // 施工人
- headName: undefined, // 负责人
- headPhone: undefined, // 负责人电话
- constructAccordingDrawings: undefined, // 是否按图纸施工
- segmentedCompressionQualified: undefined, // 分段打压是否合格
- selfClosingValveType: undefined, // 自闭阀类型
- visitType: undefined, // 上门类型
- backfillTime: undefined, // 回填时间
- constructTime: undefined, // 施工时间
- zEngiineeringPhotoBoList: undefined, // 图片列表
- zEngineeringMaterialBo: undefined,// 用料对象, //节点信息
- }
- }
- },
- queryParams1: {
- pageNum: 1,
- pageSize: 10,
- district: undefined,
- areaId: undefined,
- buildingId: undefined,
- unitId: undefined,
- houseId: undefined,
- enginType: undefined,
- enginClassification: undefined,
- enginCycle: undefined,
- completionStatus: undefined,
- imgUrl: undefined,
- },
- zEngineeringInfoBo: {
- constructAddre: '', // 施工地址
- constructPhone: '', // 施工人电话
- constructUser: '', // 施工人
- headName: '', // 负责人
- headPhone: '', // 负责人电话
- constructAccordingDrawings: '', // 是否按图纸施工
- segmentedCompressionQualified: '', // 分段打压是否合格
- selfClosingValveType: '', // 自闭阀类型
- visitType: '', // 上门类型
- backfillTime: '', // 回填时间
- constructTime: '', // 施工时间
- zEngiineeringPhotoBoList: [], // 图片列表
- zEngineeringMaterialBo: [],// 用料对象
- },
- nodeList: [],
- // 表单参数
- form: {},
- value: [],
- // 表单校验
- rules: {
- id: [
- {required: true, message: "主键不能为空", trigger: "blur"}
- ],
- district: [
- {required: true, message: "行政区不能为空", trigger: "change"}
- ],
- areaId: [
- {required: true, message: "小区id不能为空", trigger: "change"}
- ],
- buildingId: [
- {required: true, message: "楼宇id不能为空", trigger: "change"}
- ],
- unitId: [
- {required: true, message: "单元id不能为空", trigger: "change"}
- ],
- houseId: [
- {required: true, message: "房间id不能为空", trigger: "change"}
- ],
- enginType: [
- {required: true, message: "工程类型不能为空", trigger: "change"}
- ],
- enginClassification: [
- {required: true, message: "工程分类不能为空", trigger: "change"}
- ],
- enginCycle: [
- {required: true, message: "工程周期不能为空", trigger: "change"}
- ],
- completionStatus: [
- {required: true, message: "完工状态不能为空", trigger: "change"}
- ],
- imgUrl: [
- {required: true, message: "默认图片地址不能为空", trigger: "blur"}
- ],
- remark: [
- {required: true, message: "备注不能为空", trigger: "blur"}
- ],
- },
- areaList: [],
- buildingList: [],
- unitList: [],
- currentDistrict: null, // 当前行政区
- currentCommunity: null, // 当前小区
- currentBuilding: null, // 当前楼宇
- currentUnit: null, // 当前单元
- communityOptions: [],
- buildingOptions: [], // 楼栋集合
- unitOptions: [], // 单元集合
- houseOptions: [], // 房间集合
- enginClassification_list: [], // 室内节点,
- checkList: [],// 节点集合
- enginNodeStatus: null
- };
- },
- created() {
- this.getList();
- },
- mounted() {
- },
- computed: {
- currentContain(e) {
- console.log('当前contain', e)
- }
- },
- methods: {
- viewNodeSource(e) {
- viewEngineeringCivilSource({
- id: this.enginId,
- type: e
- }).then(res => {
- try {
- this.currentCollapses = res.data.zEngineeringNodeBo.zEngineeringInfoBoList
- } catch (error) {
- this.currentCollapses = [];
- }
- console.log('折叠面板info',this.currentCollapses)
- })
- this.$forceUpdate()
- },
- // 查看历史
- viewSource(e) {
- console.log(e)
- this.enginId = e.id
- let val = e.enginType + "_" + e.enginClassification
- getDicts(val).then(res => {
- let dict = []
- for (let i = 0; i < res.data.length; i++) {
- dict.push({
- "label": res.data[i].dictLabel,
- "value": res.data[i].dictValue,
- })
- }
- this.$refs.ConstructionDetails.open(dict)
- })
- },
- // 新增顶管工程
- addNewPipe(data) {
- this.$refs.enginPipe.openDialog({
- id: data.id,
- type: '民用工程'
- }, 'add')
- },
- // 新增物料
- addMaterial(data) {
- this.title = "添加用料";
- // this.enginNodeStatus = '修改'
- this.loading = true;
- this.reset();
- const id = data.id || this.ids
- getEngineeringCivil(id).then(res => {
- this.loading = false;
- let newData = res.data
- // 手动调用行政区发生改变
- this.districtHasChanged(newData.district)
- this.communityHasChanged(newData.areaId)
- this.buildingHasChanged(newData.buildingId, newData.areaId)
- this.unitHasChanged(newData.unitId)
- // 获取工程分类
- this.enginTypeHasChanged(newData.enginType)
- let val = newData.enginType + "_" + newData.enginClassification
- this.currentCheckList = []
- getDicts(val).then(res => {
- this.checkList = res.data
- })
- this.queryParams = newData
- console.log(this.queryParams.areaId)
- // console.log('选中节点集合',this.currentCheckList)
- // this.enginClassification = zEngineeringNodeBo.type
- // newData.zEngineeringNodeBo = zEngineeringNodeBo
- this.currentType = 'addMaterial'
- this.open = true
- })
- },
- currentEnginTypeChanged() {
- this.currentCheckList = []
- if (this.queryParams.enginType == undefined || this.queryParams.enginType == ''
- || this.queryParams.enginClassification == undefined || this.queryParams.enginClassification == ''
- )
- return
- let val = this.queryParams.enginType + "_" + this.queryParams.enginClassification
- getDicts(val).then(res => {
- this.checkList = res.data
- })
- },
- // 当前所选行政区发生改变 查询当前小区集合
- districtHasChanged(district) {
- this.queryParams.areaId = null
- this.queryParams.buildingId = null
- this.queryParams.unitId = null
- getAreaList({district}).then(res => {
- this.communityOptions = res.data
- })
- },
- // 当前所选小区发生改变 查询当前楼栋集合
- communityHasChanged(areaId) {
- this.queryParams.buildingId = null
- this.queryParams.unitId = null
- getBuildingList({areaId}).then(res => {
- this.buildingOptions = res.data
- })
- },
- buildingHasChanged(buildingId, areaId) {
- console.log(buildingId)
- this.queryParams.unitId = null
- getUnits(areaId || this.queryParams.areaId, buildingId).then(res => {
- this.unitOptions = res.data
- })
- },
- unitHasChanged(unitId) {
- getHousesList({unitId}).then(res => {
- console.log(res)
- this.houseOptions = res.data
- })
- },
- enginTypeHasChanged(enginType = null) {
- this.currentCheckList = []
- this.queryParams.enginClassification = ''
- this.currentEnginTypeChangeOptions = []
- getDicts(enginType || this.queryParams.enginType).then(res => {
- this.currentEnginTypeChangeOptions = res.data
- })
- },
- onClose() {
- console.log(this.currentCheckList)
- this.currentCheckList = []
- this.checkList = []
- this.$refs.nodeForm.resetFields()
- },
- closeToSucceed() {
- this.open = false;
- },
- getAreaList(district) {
- if (district === undefined || district == null || district === '')
- return
- getAreaList({district: district}).then(res => this.areaList = res.data)
- },
- getBuildingList1(areaId) {
- if (areaId === undefined || areaId == null || areaId === '')
- return
- getBuildingList({areaId: areaId}).then(res => this.buildingList = res.data)
- },
- getUnitList1(buildingId) {
- if (buildingId === undefined || buildingId == null || buildingId === '')
- return
- getUnits(this.queryParams.areaId, buildingId).then(res => this.unitList = res.data)
- },
- /** 查询民用工程列表 */
- getList() {
- this.loading = true;
- listEngineeringCivil(this.queryParams1).then(response => {
- this.engineeringCivilList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- id: undefined,
- district: undefined,
- areaId: undefined,
- buildingId: undefined,
- unitId: undefined,
- houseId: undefined,
- enginType: undefined,
- enginClassification: undefined,
- enginCycle: undefined,
- completionStatus: undefined,
- version: undefined,
- imgUrl: undefined,
- remark: undefined,
- delFlag: undefined,
- createBy: undefined,
- createTime: undefined,
- updateBy: undefined,
- updateTime: undefined
- };
- this.queryParams = {
- district: undefined,
- areaId: undefined,
- buildingId: undefined,
- unitId: undefined,
- houseId: undefined,
- enginType: undefined,
- enginClassification: undefined,
- enginCycle: undefined,
- completionStatus: undefined,
- imgUrl: undefined,
- // zEngineeringNodeBo: {
- // type: undefined,
- // zEngineeringInfoBo: {
- // constructAddre: undefined, // 施工地址
- // constructPhone: undefined, // 施工人电话
- // constructUser: undefined, // 施工人
- // headName: undefined, // 负责人
- // headPhone: undefined, // 负责人电话
- // constructAccordingDrawings: undefined, // 是否按图纸施工
- // segmentedCompressionQualified: undefined, // 分段打压是否合格
- // selfClosingValveType: undefined, // 自闭阀类型
- // visitType: undefined, // 上门类型
- // backfillTime: undefined, // 回填时间
- // constructTime: undefined, // 施工时间
- // zEngiineeringPhotoBoList: undefined, // 图片列表
- // zEngineeringMaterialBo: undefined,// 用料对象, //节点信息
- // }
- // },
- }
- this.enginClassification = null
- this.resetForm("form");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.id)
- this.single = selection.length !== 1
- this.multiple = !selection.length
- },
- // 新增顶管工程
- // addNewPipe(data){
- // this.$refs.enginPipe.openDialog({
- // id:data.id
- // },'add')
- // },
- nodeCancel() {
- this.nodeDetailVisible = false
- },
- toNodeDetail() {
- let nodeCollection = []
- // 收集节点信息
- this.currentCheckList.forEach((e, idx) => {
- let nodeItem = this.$refs['EnginNodeInfo' + idx][0].infoCollection()
- // console.log(nodeItem)
- nodeCollection.push(nodeItem)
- })
- this.queryParams.zEngineeringNodeBoList = nodeCollection
- if (this.enginNodeStatus == '修改') {
- putEngineeringCivil(this.queryParams).then(res => {
- if (res.code == 200) {
- this.$message({
- message: '修改成功',
- type: 'success'
- });
- this.open = false
- console.log('选中节点集合', this.currentCheckList)
- this.currentCheckList = []
- // this.$emit('closeToSucceed')
- }
- })
- } else {
- addEngineeringCivil(this.queryParams).then(res => {
- if (res.code == 200) {
- this.$message({
- message: '新增成功',
- type: 'success'
- });
- this.open = false
- console.log('选中节点集合', this.currentCheckList)
- this.currentCheckList = []
- // this.$emit('closeToSucceed')
- }
- })
- }
- return
- getDictList({enginType: ['new_built', 'old_renovation']}).then(res => {
- this.nodeList = res.data
- console.log('跳到详情前的queryParams', this.queryParams)
- console.log('跳到详情前的节点集合', this.nodeList)
- if (this.currentType == 'put') {
- this.$refs.childNode.open(this.queryParams, 16, this.nodeList)
- this.currentType = null
- return
- }
- // 加工 enginClassification 工程节点
- // const parts = this.value[1].split('_');
- // let result = parts.slice(2).join('_');
- // console.log(result)
- // this.queryParams.zEngineeringNodeBo.type = this.enginClassification
- // this.queryParams.enginClassification = result
- // console.log(this.queryParams)
- console.log('新增queryparams传值', this.queryParams)
- this.$refs.childNode.open(this.queryParams, 0, this.nodeList)
- return
- this.$refs['form'].validate(e => {
- if (e) {
- this.nodeDetailVisible = true
- }
- })
- })
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.enginNodeStatus = '新增'
- this.reset();
- this.open = true;
- this.title = "添加民用工程";
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.enginNodeStatus = '修改'
- this.loading = true;
- // this.reset();
- const id = row.id || this.ids
- getEngineeringCivil(id).then(res => {
- this.loading = false;
- let newData = res.data
- // 手动调用行政区发生改变
- // this.districtHasChanged(newData.district)
- this.queryParams = newData
- this.updateOption = res.data.zEngineeringNodeBoList
- console.log(this.queryParams.areaId)
- // start update修改数据
- res.data.zEngineeringNodeBoList.forEach((e, idx) => {
- this.currentCheckList.push(e.type)
- })
- console.log('选中节点集合', this.currentCheckList)
- // end
- let zEngineeringNodeBo = {
- type: res.data.zEngineeringNodeBoList[0].type,
- zEngineeringInfoBo: res.data.zEngineeringNodeBoList[0].zEngineeringInfoBo
- }
- if (res.data.areaId != '' && res.data.areaId != null) {
- this.communityHasChanged(res.data.areaId)
- }
- if (res.data.district != '' && res.data.district != null) {
- this.districtHasChanged(res.data.district)
- }
- if (res.data.buildingId != '' && res.data.buildingId != null) {
- this.buildingHasChanged(res.data.buildingId)
- }
- if (res.data.unitId != '' && res.data.unitId != null) {
- this.unitHasChanged(res.data.unitId)
- }
- this.value[0] = res.data.enginType
- this.value[1] = res.data.enginClassification
- if (res.data.enginClassification != null && res.data.enginClassification != '') {
- this.enginClassificationOption = this.dict.type[res.data.enginClassification]
- }
- this.enginClassification = zEngineeringNodeBo.type
- newData.zEngineeringNodeBo = zEngineeringNodeBo
- this.currentType = 'put'
- console.log('修改queryparams传值', this.queryParams)
- console.log(this.queryParams)
- this.zEngineeringInfoBo = newData.zEngineeringNodeBo.zEngineeringInfoBo
- this.open = true
- this.title = "修改民用工程";
- })
- },
- /** 提交按钮 */
- submitForm() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- this.buttonLoading = true;
- if (this.form.id != null) {
- updateEngineeringCivil(this.form).then(response => {
- this.$modal.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- }).finally(() => {
- this.buttonLoading = false;
- });
- } else {
- addEngineeringCivil(this.form).then(response => {
- this.$modal.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- }).finally(() => {
- this.buttonLoading = false;
- });
- }
- }
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const ids = row.id || this.ids;
- this.$modal.confirm('是否确认删除民用工程编号为"' + ids + '"的数据项?').then(() => {
- this.loading = true;
- return delEngineeringCivil(ids);
- }).then(() => {
- this.loading = false;
- this.getList();
- this.$modal.msgSuccess("删除成功");
- }).catch(() => {
- }).finally(() => {
- this.loading = false;
- });
- },
- /** 导出按钮操作 */
- handleExport() {
- this.download('zdsz/engineeringCivil/export', {
- ...this.queryParams
- }, `engineeringCivil_${new Date().getTime()}.xlsx`)
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .addDialog {
- width: 60%;
- }
- ::v-deep .appendElDialog {
- width: 70%;
- height: 80%;
- .el-dialog__body {
- height: 85%;
- }
- .el-form-item {
- margin-bottom: 22px;
- width: 44%;
- display: inline-block;
- }
- .el-form-item:nth-child(2n+2) {
- margin-left: 5%;
- }
- .el-form-item:not(:nth-child(1):nth-child(2)) {
- margin-top: 0.5%;
- }
- .remark_input {
- .el-textarea__inner {
- width: 238%;
- height: 190px;
- }
- }
- }
- ::v-deep .appendElNodeDialog {
- // width: 70%;
- height: 80%;
- .el-dialog__body {
- height: 85%;
- }
- .el-form-item {
- margin-bottom: 22px;
- width: 44%;
- display: inline-block;
- }
- .el-form-item:nth-child(2n+2) {
- margin-left: 5%;
- }
- .el-form-item:not(:nth-child(1):nth-child(2)) {
- margin-top: 0.5%;
- }
- }
- </style>
|