index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913
  1. <!--
  2. *@description: 民用工程
  3. *@author: yh Fu
  4. *@date: 2024-01-04 13:08:59
  5. *@version: V1.0.5
  6. -->
  7. <template>
  8. <div class="app-container">
  9. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="110px">
  10. <el-form-item label="小区" prop="areaId">
  11. <el-select v-model="queryParams.areaId" placeholder="请选择小区" filterable @change="getBuildings">
  12. <el-option
  13. v-for="obj in areas"
  14. :key="obj.id"
  15. :label="obj.name"
  16. :value="obj.id"
  17. ></el-option>
  18. </el-select>
  19. </el-form-item>
  20. <el-form-item label="楼栋" prop="buildingId">
  21. <el-select v-model="queryParams.buildingId" placeholder="请选择楼栋" filterable @change="getUnits">
  22. <el-option
  23. v-for="obj in builds"
  24. :key="obj.id"
  25. :label="obj.name"
  26. :value="obj.id"
  27. ></el-option>
  28. </el-select>
  29. </el-form-item>
  30. <el-form-item label="单元" prop="unitId">
  31. <el-select v-model="queryParams.unitId" placeholder="请选择单元" filterable @change="getHouses">
  32. <el-option
  33. v-for="obj in units"
  34. :key="obj.id"
  35. :label="obj.name"
  36. :value="obj.id"
  37. ></el-option>
  38. </el-select>
  39. </el-form-item>
  40. <el-form-item label="房间号" prop="houseId">
  41. <el-select v-model="queryParams.houseId" placeholder="请选择房间号" filterable>
  42. <el-option
  43. v-for="obj in houses"
  44. :key="obj.id"
  45. :label="obj.name"
  46. :value="obj.id"
  47. ></el-option>
  48. </el-select>
  49. </el-form-item>
  50. <el-form-item>
  51. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  52. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  53. </el-form-item>
  54. </el-form>
  55. <el-row :gutter="10" class="mb8">
  56. <el-col :span="1.5">
  57. <el-button
  58. type="primary"
  59. plain
  60. icon="el-icon-plus"
  61. size="mini"
  62. @click="handleAdd"
  63. v-hasPermi="['zdsz:openbolt:add']"
  64. >新增</el-button>
  65. </el-col>
  66. <el-col :span="1.5">
  67. <el-button
  68. type="success"
  69. plain
  70. icon="el-icon-edit"
  71. size="mini"
  72. :disabled="single"
  73. @click="handleUpdate"
  74. v-hasPermi="['zdsz:openbolt:edit']"
  75. >修改</el-button>
  76. </el-col>
  77. <el-col :span="1.5">
  78. <el-button
  79. type="danger"
  80. plain
  81. icon="el-icon-delete"
  82. size="mini"
  83. :disabled="multiple"
  84. @click="handleDelete"
  85. v-hasPermi="['zdsz:openbolt:remove']"
  86. >删除</el-button>
  87. </el-col>
  88. <!-- <el-col :span="1.5">-->
  89. <!-- <el-button-->
  90. <!-- type="warning"-->
  91. <!-- plain-->
  92. <!-- icon="el-icon-download"-->
  93. <!-- size="mini"-->
  94. <!-- @click="handleExport"-->
  95. <!-- v-hasPermi="['zdsz:openbolt:export']"-->
  96. <!-- >导出</el-button>-->
  97. <!-- </el-col>-->
  98. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  99. </el-row>
  100. <el-table v-loading="loading" :data="comprehensiveList" @selection-change="handleSelectionChange">
  101. <el-table-column type="selection" width="55" align="center" />
  102. <!-- <el-table-column label="" align="center" prop="id" v-if="true"/>-->
  103. <el-table-column label="小区" align="center" prop="areaName" />
  104. <el-table-column label="楼栋" align="center" prop="buildingName" />
  105. <el-table-column label="单元" align="center" prop="unitName" />
  106. <el-table-column label="房间" align="center" prop="houseName" />
  107. <el-table-column label="安检是否合格" align="center" prop="isQualified">
  108. <template slot-scope="scope">
  109. <dict-tag :options="dict.type.pass_check" :value="scope.row.isQualified"/>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/>
  113. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  114. <template slot-scope="scope">
  115. <el-button
  116. size="mini"
  117. type="text"
  118. icon="el-icon-edit"
  119. @click="handleUpdate(scope.row)"
  120. v-hasPermi="['zdsz:comprehensive:edit']"
  121. >修改</el-button>
  122. <el-button
  123. size="mini"
  124. type="text"
  125. icon="el-icon-delete"
  126. @click="handleDelete(scope.row)"
  127. v-hasPermi="['zdsz:comprehensive:remove']"
  128. >删除</el-button>
  129. <el-button
  130. size="mini"
  131. type="text"
  132. icon="el-icon-edit"
  133. @click="addNewPipe(scope.row)"
  134. >新增顶管工程</el-button>
  135. </template>
  136. </el-table-column>
  137. </el-table>
  138. <pagination
  139. v-show="total>0"
  140. :total="total"
  141. :page.sync="queryParams.pageNum"
  142. :limit.sync="queryParams.pageSize"
  143. @pagination="getList"
  144. />
  145. <!-- 顶管工程新增 -->
  146. <EngineePipe ref="enginPipe"/>
  147. <!-- 添加或修改开栓|安检|维修对话框 -->
  148. <el-dialog :title="title" :visible.sync="open" append-to-body customClass="appendElDialog">
  149. <el-form ref="form" :model="queryParams" :rules="rules" label-width="110px">
  150. <el-form-item label="行政区" prop="district">
  151. <el-select
  152. v-model="queryParams.district"
  153. placeholder="请选择行政区"
  154. @change="districtHasChanged"
  155. >
  156. <el-option
  157. v-for="e in dict.type.district"
  158. :key="e.value"
  159. :label="e.label"
  160. :value="e.value"
  161. ></el-option>
  162. </el-select>
  163. </el-form-item>
  164. <el-form-item label="小区" prop="areaId">
  165. <el-select
  166. v-model="queryParams.areaId"
  167. placeholder="请选择小区"
  168. @change="communityHasChanged"
  169. >
  170. <el-option
  171. v-for="e in communityOptions"
  172. :key="e.id"
  173. :label="e.name"
  174. :value="e.id"
  175. ></el-option>
  176. </el-select>
  177. </el-form-item>
  178. <el-form-item label="楼栋" prop="buildingId">
  179. <el-select
  180. v-model="queryParams.buildingId"
  181. placeholder="请选择楼栋"
  182. @change="buildingHasChanged"
  183. >
  184. <el-option
  185. v-for="e in buildingOptions"
  186. :key="e.id"
  187. :label="e.name"
  188. :value="e.id"
  189. ></el-option>
  190. </el-select>
  191. </el-form-item>
  192. <el-form-item label="单元" prop="unitId">
  193. <el-select
  194. v-model="queryParams.unitId"
  195. placeholder="请选择单元"
  196. @change="unitHasChanged"
  197. >
  198. <el-option
  199. v-for="e in unitOptions"
  200. :key="e.id"
  201. :label="e.name"
  202. :value="e.id"
  203. ></el-option>
  204. </el-select>
  205. </el-form-item>
  206. <el-form-item label="房间" prop="houseId">
  207. <el-select
  208. v-model="queryParams.houseId"
  209. placeholder="请选择房间"
  210. >
  211. <el-option
  212. v-for="e in houseOptions"
  213. :key="e.id"
  214. :label="e.name"
  215. :value="e.id"
  216. ></el-option>
  217. </el-select>
  218. </el-form-item>
  219. <!-- <el-form-item label="工程类型" prop="enginType">
  220. <el-select
  221. v-model="queryParams.enginType"
  222. placeholder="请选择工程类型"
  223. @change="enginTypeHasChanged"
  224. >
  225. <el-option
  226. v-for="e in enginTypeOption"
  227. :key="e.value"
  228. :label="e.label"
  229. :value="e.value"
  230. ></el-option>
  231. </el-select>
  232. </el-form-item> -->
  233. <el-form-item label="工程类型">
  234. <el-cascader
  235. v-model="value"
  236. :options="options"
  237. @change="currentEnginTypeChange">
  238. </el-cascader>
  239. </el-form-item>
  240. <el-form-item label="工程节点">
  241. <el-select
  242. v-model="enginClassification"
  243. placeholder="请选择工程节点"
  244. >
  245. <el-option
  246. v-for="e in enginClassificationOption"
  247. :key="e.value"
  248. :label="e.label"
  249. :value="e.value"
  250. ></el-option>
  251. </el-select>
  252. </el-form-item>
  253. <el-form-item label="工程周期" prop="enginCycle">
  254. <el-select
  255. v-model="queryParams.enginCycle"
  256. placeholder="请填写工程周期"
  257. >
  258. <el-option
  259. v-for="e in dict.type.engin_cycle"
  260. :key="e.value"
  261. :label="e.label"
  262. :value="e.value"
  263. ></el-option>
  264. </el-select>
  265. </el-form-item>
  266. <!-- <el-form-item label="备注" prop="remark">
  267. <el-input
  268. v-model="queryParams.remark"
  269. type="textarea"
  270. placeholder="请输入内容"
  271. class="remark_input"
  272. />
  273. </el-form-item> -->
  274. </el-form>
  275. <div slot="footer" class="dialog-footer">
  276. <!-- <el-button :loading="buttonLoading" type="primary" @click="submitForm">确定</el-button> -->
  277. <el-button :loading="buttonLoading" type="primary" @click="toNodeDetail">填写节点信息</el-button>
  278. <el-button @click="cancel">取 消</el-button>
  279. </div>
  280. </el-dialog>
  281. <!-- 节点信息dialog -->
  282. <enginee-node
  283. ref="childNode"
  284. @closeToSucceed="closeToSucceed"
  285. />
  286. </div>
  287. </template>
  288. <script>
  289. import { listComprehensive, getComprehensive, delComprehensive, addComprehensive, updateComprehensive } from "@/api/zdsz/comprehensive";
  290. import {getBuildings} from "@/api/zdsz/building";
  291. import {getUnits} from "@/api/zdsz/unit";
  292. import {getAreas} from "@/api/zdsz/area";
  293. import {getHouses, listHouse} from "@/api/zdsz/house";
  294. import EngineeNode from '@/components/EngineeNode/index'
  295. import {
  296. getEngineeringCivil, // 查询工程列表
  297. addEnginee, // 新增工程
  298. getAreaList, // 获取当前小区集合
  299. getBuildingList, // 获取当前楼栋集合
  300. getUnitList, // 获取当前单元集合
  301. getHousesList, // 获取当前房间集合
  302. putEngineeringCivil, // 民用工程修改
  303. viewEngineeringCivil, // 民用工程查看详情
  304. deleteEngineeringCivil, // 删除民用工程
  305. } from "@/api/zdsz/enginee"
  306. import EngineePipe from "@/components/EngineePipe"
  307. export default {
  308. name: "openrepair",
  309. dicts:['pass_check',
  310. 'is_repair',
  311. 'engin_type',
  312. 'self_closing_valve_type',
  313. 'visit_type','district',
  314. 'new_built_indoor_engin',
  315. "old_renovation_indoor_engin",
  316. "old_renovation_courtyard_engin",
  317. "old_renovation_overhead",
  318. "new_built_indoor_engin",
  319. "new_built_courtyard_engin",
  320. "new_built_overhead",
  321. "engin_cycle"
  322. ],
  323. components:{
  324. EngineePipe,
  325. EngineeNode
  326. },
  327. data() {
  328. var validatePass = (rule, value, callback) => {
  329. console.log('校验值', value)
  330. if (value === '') {
  331. callback(new Error('请输入密码'));
  332. } else {
  333. if (this.ruleForm.checkPass !== '') {
  334. this.$refs.ruleForm.validateField('checkPass');
  335. }
  336. callback();
  337. }
  338. };
  339. return {
  340. // 按钮loading
  341. buttonLoading: false,
  342. // 遮罩层
  343. loading: true,
  344. // 选中数组
  345. ids: [],
  346. // 非单个禁用
  347. single: true,
  348. // 非多个禁用
  349. multiple: true,
  350. // 显示搜索条件
  351. showSearch: true,
  352. // 总条数
  353. total: 0,
  354. // 开栓|安检|维修表格数据
  355. comprehensiveList: [],
  356. // 弹出层标题
  357. title: "",
  358. // 是否显示弹出层
  359. open: false,
  360. enginTypeOption:[
  361. {
  362. value:'old_renovation',
  363. label:'旧改'
  364. },
  365. {
  366. value:'new_built',
  367. label:'新建'
  368. }
  369. ],
  370. nodeType:'1', // 节点类型
  371. enginClassification:'',
  372. // 查询参数
  373. queryParams: {
  374. district:null, // 行政区
  375. areaId:'', // 小区
  376. enginType:'', // 工程类型
  377. buildingId:null,
  378. unitId:null,
  379. houseId:null,
  380. type:'01', // 类型 01工业工程 02市政工程
  381. district:'', // 工程类型 民用工程 0 ,市政工程 1,工业工程 2 ,顶管工程 3,危险作业工程 4,基建工程 5
  382. enginClassification:null, // 工程分类
  383. zEngineeringNodeBo:{
  384. type:'',
  385. zEngineeringInfoBo:{}, //节点信息
  386. }
  387. },
  388. zEngineeringInfoBo:{
  389. constructAddre:'', // 施工地址
  390. constructPhone:'', // 施工人电话
  391. constructUser:'', // 施工人
  392. headName:'', // 负责人
  393. headPhone:'', // 负责人电话
  394. constructAccordingDrawings:'', // 是否按图纸施工
  395. segmentedCompressionQualified:'', // 分段打压是否合格
  396. selfClosingValveType:'', // 自闭阀类型
  397. visitType:'', // 上门类型
  398. backfillTime:'', // 回填时间
  399. constructTime:'', // 施工时间
  400. zEngiineeringPhotoBoList:[], // 图片列表
  401. zEngineeringMaterialBo:[],// 用料对象
  402. }, // 节点信息
  403. constructAccordingDrawingsOption:[
  404. {
  405. value:'1',
  406. label:'是'
  407. },
  408. {
  409. value:'0',
  410. label:'否'
  411. }
  412. ],
  413. segmentedCompressionQualifiedOption:[
  414. {
  415. value:'1',
  416. label:'是'
  417. },
  418. {
  419. value:'0',
  420. label:'否'
  421. }
  422. ],
  423. nodeDetailVisible:false,
  424. // 表单参数
  425. form: {},
  426. areas: [],
  427. builds: [],
  428. units: [],
  429. rooms: [],
  430. houses: [],
  431. // 表单校验
  432. rules: {
  433. areaId: [
  434. { required: true, message: "小区不能为空", trigger: "change" }
  435. ],
  436. district: [
  437. { required: true, message: "现场负责人不能为空" ,trigger: 'blur'}
  438. ],
  439. supervisionUnit: [
  440. { required: true, message: "监理单位不能为空" ,trigger: 'blur'}
  441. ],
  442. district: [
  443. { required: true, message: "现场负责人不能为空" ,trigger: 'blur'}
  444. ],
  445. supervisionPhone: [
  446. { required: true, message: "建立联系电话不能为空" ,trigger: 'blur'}
  447. ],
  448. constructUnit: [
  449. { required: true, message: "建筑单位不能为空" ,trigger: 'blur'}
  450. ],
  451. areaId: [
  452. { required: true, message: "设计负责人不能为空" ,trigger: 'blur'}
  453. ],
  454. enginCycle: [
  455. { required: true, message: "设计单位不能为空" ,trigger: 'blur'}
  456. ],
  457. designPhone: [
  458. { required: true, message: "联系方式不能为空" ,trigger: 'blur'}
  459. ],
  460. supervisionHead: [
  461. { required: true, message: "监理负责人不能为空" ,trigger: 'blur'}
  462. ],
  463. buildingId: [
  464. { required: true, message: "楼栋不能为空", trigger: "change" }
  465. ],
  466. unitId: [
  467. { required: true, message: "单元不能为空", trigger: "change" }
  468. ],
  469. houseId: [
  470. { required: true, message: "房间不能为空", trigger: "change" }
  471. ],
  472. type: [
  473. { required: false, message: "类型不能为空", trigger: "change" }
  474. ],
  475. isQualified: [
  476. { required: true, message: "安检是否合格不能为空", trigger: "blur" }
  477. ],
  478. // remark: [
  479. // { required: false, message: "备注不能为空", trigger: "blur" }
  480. // ],
  481. },
  482. // 节点规则校验
  483. nodeRules:{
  484. type: [
  485. { required: true, message: "施工地址不能为空" ,trigger: 'blur'}
  486. ],
  487. constructAddre: [
  488. { required: true, message: "施工地址不能为空" ,trigger: 'blur'}
  489. ],
  490. constructPhone: [
  491. { required: true, message: "施工人电话不能为空" ,trigger: 'blur'}
  492. ],
  493. constructUser: [
  494. { required: true, message: "施工人不能为空" ,trigger: 'blur'}
  495. ],
  496. headName: [
  497. { required: true, message: "负责人不能为空" ,trigger: 'blur'}
  498. ],
  499. headPhone: [
  500. { required: true, message: "负责人电话不能为空" ,trigger: 'blur'}
  501. ],
  502. },
  503. currentDistrict:null, // 当前行政区
  504. currentCommunity:null, // 当前小区
  505. currentBuilding:null, // 当前楼宇
  506. currentUnit:null, // 当前单元
  507. communityOptions:[
  508. ],
  509. buildingOptions:[], // 楼栋集合
  510. unitOptions:[], // 单元集合
  511. houseOptions:[], // 房间集合
  512. enginClassification_list:[],// 室内节点
  513. new_built_list:[
  514. {
  515. label:'旧改',
  516. value:'old'
  517. },
  518. {
  519. label:'新建',
  520. value:'new'
  521. },
  522. ],
  523. currentEnginType:[],
  524. enginTypeOptions:[
  525. {
  526. value:'old_renovation',
  527. label:'旧改',
  528. children:[
  529. {
  530. value:'inside',
  531. lable:'室内',
  532. },
  533. {
  534. value:'yard',
  535. lable:'庭院',
  536. },
  537. {
  538. value:'float',
  539. lable:'架空',
  540. },
  541. ]
  542. },
  543. {
  544. value:'new_built',
  545. label:'新建',
  546. children:[
  547. {
  548. value:'inside',
  549. lable:'室内',
  550. },
  551. {
  552. value:'yard',
  553. lable:'庭院',
  554. },
  555. {
  556. value:'float',
  557. lable:'架空',
  558. },
  559. ]
  560. },
  561. ],
  562. value: [],
  563. options: [
  564. {
  565. value: 'old_renovation',
  566. label: '旧改',
  567. children: [
  568. {
  569. value: 'old_renovation_indoor_engin',
  570. label: '室内',
  571. },
  572. {
  573. value: 'old_renovation_courtyard_engin',
  574. label: '庭院',
  575. },
  576. {
  577. value: 'old_renovation_overhead',
  578. label: '架空',
  579. }
  580. ]
  581. },
  582. {
  583. value: 'new_built',
  584. label: '新建',
  585. children: [
  586. {
  587. value: 'new_built_indoor_engin',
  588. label: '室内',
  589. },
  590. {
  591. value: 'new_built_courtyard_engin',
  592. label: '庭院',
  593. },
  594. {
  595. value: 'new_built_overhead',
  596. label: '架空',
  597. }
  598. ]
  599. },
  600. ],
  601. enginClassificationOption:[], // 工程节点集合
  602. currentType:null,
  603. };
  604. },
  605. created() {
  606. this.getList();
  607. // this.getAreas();
  608. },
  609. methods: {
  610. closeToSucceed(){
  611. this.open = false;
  612. },
  613. currentEnginTypeChange(val){
  614. const enginDict = val[1]
  615. const enginType = val[0]
  616. this.queryParams.enginType = enginType
  617. this.enginClassificationOption = this.dict.type[enginDict]
  618. },
  619. // 当前所选行政区发生改变 查询当前小区集合
  620. districtHasChanged(district){
  621. this.queryParams.areaId = null
  622. this.queryParams.buildingId = null
  623. this.queryParams.unitId = null
  624. getAreaList({district}).then(res => {
  625. this.communityOptions = res.data
  626. })
  627. },
  628. // 当前所选小区发生改变 查询当前楼栋集合
  629. communityHasChanged(areaId){
  630. this.queryParams.buildingId = null
  631. this.queryParams.unitId = null
  632. getBuildingList({areaId}).then(res => {
  633. this.buildingOptions = res.data
  634. })
  635. },
  636. buildingHasChanged(buildingId){
  637. this.queryParams.unitId = null
  638. getUnitList({buildingId}).then(res => {
  639. this.unitOptions = res.data
  640. })
  641. },
  642. unitHasChanged(unitId){
  643. getHousesList({unitId}).then(res => {
  644. console.log(res)
  645. this.houseOptions = res.data
  646. })
  647. },
  648. enginTypeHasChanged(val){
  649. if(val == 'old_renovation'){
  650. }else if(val == 'new_built'){
  651. }
  652. },
  653. // 新增顶管工程
  654. addNewPipe(data){
  655. this.$refs.enginPipe.openDialog({
  656. id:data.id
  657. },'add')
  658. },
  659. nodeCancel(){
  660. this.nodeDetailVisible = false
  661. },
  662. toNodeDetail(){
  663. if(this.currentType == 'put'){
  664. this.$refs.childNode.open(this.queryParams,16)
  665. this.currentType = null
  666. return
  667. }
  668. // 加工 enginClassification 工程节点
  669. const parts = this.value[1].split('_');
  670. let result = parts.slice(2).join('_');
  671. this.queryParams.zEngineeringNodeBo.type = this.enginClassification
  672. this.queryParams.enginClassification = result
  673. console.log(this.queryParams)
  674. this.$refs.childNode.open(this.queryParams,0)
  675. return
  676. this.$refs['form'].validate(e => {
  677. if(e){
  678. this.nodeDetailVisible = true
  679. }
  680. })
  681. },
  682. getUrl(url) {
  683. this.zEngineeringInfoBo.zEngiineeringPhotoBoList = this.$refs.obsImageUpload.fileList?this.$refs.obsImageUpload.fileList.map(e=>e.url):[];
  684. },
  685. getBuildings(id) {
  686. this.units = []
  687. this.houses = []
  688. this.queryParams.buildingId = undefined
  689. this.queryParams.unitId = undefined
  690. this.queryParams.houseId = undefined
  691. getBuildings(id).then(res => {
  692. this.builds = res.data
  693. })
  694. },
  695. getUnits(id) {
  696. this.houses = []
  697. this.queryParams.unitId = undefined
  698. this.queryParams.houseId = undefined
  699. getUnits(this.queryParams.areaId,id).then(res => {
  700. this.units = res.data
  701. })
  702. },
  703. getAreas() {
  704. this.builds = []
  705. this.units = []
  706. this.houses = []
  707. this.queryParams.buildingId = undefined
  708. this.queryParams.unitId = undefined
  709. this.queryParams.houseId = undefined
  710. this.form.buildingId = undefined
  711. this.form.unitId = undefined
  712. this.form.houseId = undefined
  713. getAreas().then(res => {
  714. this.areas = res.data;
  715. });
  716. },
  717. getHouses() {
  718. this.houses = []
  719. this.queryParams.houseId = undefined
  720. getHouses(this.queryParams.unitId).then(res => {
  721. this.houses = res.data;
  722. });
  723. },
  724. getBuildings1(id) {
  725. this.units = []
  726. this.houses = []
  727. this.form.buildingId = undefined
  728. this.form.unitId = undefined
  729. this.form.houseId = undefined
  730. getBuildings(id).then(res => {
  731. this.builds = res.data
  732. })
  733. },
  734. getUnits1(id) {
  735. this.houses = []
  736. this.form.unitId = undefined
  737. this.form.houseId = undefined
  738. getUnits(this.form.areaId,id).then(res => {
  739. this.units = res.data
  740. })
  741. },
  742. getHouses1() {
  743. this.houses = []
  744. this.form.houseId = undefined
  745. getHouses(this.form.unitId).then(res => {
  746. this.houses = res.data;
  747. });
  748. },
  749. /** 查询民用工程列表 */
  750. getList() {
  751. this.loading = true;
  752. getEngineeringCivil().then(res => {
  753. console.log(res)
  754. this.comprehensiveList = res.rows;
  755. this.total = res.total;
  756. this.loading = false;
  757. });
  758. },
  759. // 取消按钮
  760. cancel() {
  761. this.open = false;
  762. this.reset();
  763. this.houses = []
  764. this.units = []
  765. this.builds = []
  766. },
  767. // 表单重置
  768. reset() {
  769. this.$nextTick(() => {
  770. this.$refs['form'].resetFields()
  771. this.$refs['nodeForm'].resetFields()
  772. })
  773. this.resetForm("form");
  774. this.resetForm("nodeForm");
  775. },
  776. /** 搜索按钮操作 */
  777. handleQuery() {
  778. this.queryParams.pageNum = 1;
  779. this.getList();
  780. },
  781. /** 重置按钮操作 */
  782. resetQuery() {
  783. this.resetForm("queryForm");
  784. this.handleQuery();
  785. },
  786. // 多选框选中数据
  787. handleSelectionChange(selection) {
  788. this.ids = selection.map(item => item.id)
  789. this.single = selection.length!==1
  790. this.multiple = !selection.length
  791. },
  792. /** 新增按钮操作 */
  793. handleAdd() {
  794. this.reset();
  795. this.open = true;
  796. this.title = "新增工程";
  797. },
  798. /** 修改按钮操作 */
  799. handleUpdate(row) {
  800. viewEngineeringCivil(row.id).then(res => {
  801. let newData = res.data
  802. console.log(newData)
  803. console.log(res.data.zEngineeringNodeBoList[0].type)
  804. let zEngineeringNodeBo = {
  805. type:res.data.zEngineeringNodeBoList[0].type,
  806. zEngineeringInfoBo:res.data.zEngineeringNodeBoList[0].zEngineeringInfoBo
  807. }
  808. newData.zEngineeringNodeBo = zEngineeringNodeBo
  809. this.currentType = 'put'
  810. this.queryParams = newData
  811. console.log(this.queryParams)
  812. this.zEngineeringInfoBo = newData.zEngineeringNodeBo.zEngineeringInfoBo
  813. this.open = true
  814. })
  815. },
  816. /** 提交按钮 */
  817. submitForm() {
  818. // this.$refs["nodeForm"].validate(valid => {
  819. // if (valid) {
  820. this.queryParams.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
  821. console.log(this.queryParams)
  822. addEnginee(this.queryParams).then(res => {
  823. console.log(res)
  824. })
  825. // }
  826. // });
  827. },
  828. /** 删除按钮操作 */
  829. handleDelete(row) {
  830. deleteEngineeringCivil(row.id).then(res => {
  831. if(res.code == 200){
  832. this.$modal.msgSuccess("删除成功");
  833. this.getList()
  834. }
  835. })
  836. },
  837. /** 导出按钮操作 */
  838. handleExport() {
  839. this.download('zdsz/openbolt/export', {
  840. ...this.queryParams
  841. }, `comprehensive_${new Date().getTime()}.xlsx`)
  842. }
  843. }
  844. };
  845. </script>
  846. <style lang="scss" scoped>
  847. ::v-deep .appendElDialog{
  848. width: 70%;
  849. height: 80%;
  850. .el-dialog__body{
  851. height: 85%;
  852. }
  853. .el-form-item{
  854. margin-bottom: 22px;
  855. width: 44%;
  856. display: inline-block;
  857. }
  858. .el-form-item:nth-child(2n+2){
  859. margin-left: 5%;
  860. }
  861. .el-form-item:not(:nth-child(1):nth-child(2)){
  862. margin-top: 0.5%;
  863. }
  864. .remark_input{
  865. .el-textarea__inner{
  866. width: 238%;
  867. height: 190px;
  868. }
  869. }
  870. }
  871. ::v-deep .appendElNodeDialog{
  872. // width: 70%;
  873. height: 80%;
  874. .el-dialog__body{
  875. height: 85%;
  876. }
  877. .el-form-item{
  878. margin-bottom: 22px;
  879. width: 44%;
  880. display: inline-block;
  881. }
  882. .el-form-item:nth-child(2n+2){
  883. margin-left: 5%;
  884. }
  885. .el-form-item:not(:nth-child(1):nth-child(2)){
  886. margin-top: 0.5%;
  887. }
  888. }
  889. </style>