index.vue 39 KB

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