index.vue 35 KB

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