index.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="行政区" prop="district">
  5. <el-select v-model="queryParams1.district" placeholder="请选择行政区" clearable
  6. @change="queryParams1.areaId = undefined;getAreaList(queryParams1.district)"
  7. @clear="queryParams1.areaId = undefined;areaList=[];
  8. queryParams1.buildingId = undefined;buildingList=[];
  9. queryParams1.unitId = undefined;unitList=[]">
  10. <el-option
  11. v-for="dict in dict.type.district"
  12. :key="dict.value"
  13. :label="dict.label"
  14. :value="dict.value"
  15. />
  16. </el-select>
  17. </el-form-item>
  18. <el-form-item label="小区名称" prop="areaId">
  19. <el-select v-model="queryParams1.areaId" filterable clearable placeholder="请选择小区"
  20. @change="queryParams1.buildingId = undefined;getBuildingList1(queryParams1.areaId)"
  21. @clear="queryParams1.buildingId = undefined;buildingList=[];
  22. queryParams1.unitId = undefined;unitList=[]">
  23. <el-option
  24. v-for="item in areaList"
  25. :key="item.id"
  26. :label="item.name"
  27. :value="item.id">
  28. </el-option>
  29. </el-select>
  30. </el-form-item>
  31. <el-form-item label="楼宇名称" prop="buildingId">
  32. <el-select v-model="queryParams1.buildingId" filterable clearable placeholder="请选择楼宇"
  33. @change="queryParams1.unitId = undefined;getUnitList1(queryParams1.buildingId)"
  34. @clear="queryParams1.unitId = undefined;unitList=[]"
  35. >
  36. <el-option
  37. v-for="item in buildingList"
  38. :key="item.id"
  39. :label="item.name"
  40. :value="item.id">
  41. </el-option>
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="单元" prop="unitId">
  45. <el-select v-model="queryParams1.unitId" placeholder="请选择单元" filterable clearable>
  46. <el-option
  47. v-for="obj in unitList"
  48. :key="obj.id"
  49. :label="obj.name"
  50. :value="obj.id"
  51. ></el-option>
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item>
  55. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  56. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  57. </el-form-item>
  58. </el-form>
  59. <el-row :gutter="10" class="mb8">
  60. <el-col :span="1.5">
  61. <el-button
  62. type="primary"
  63. plain
  64. icon="el-icon-plus"
  65. size="mini"
  66. @click="handleAdd"
  67. v-hasPermi="['zdsz:engineeringCivil:add']"
  68. >新增
  69. </el-button>
  70. </el-col>
  71. <el-col :span="1.5">
  72. <el-button
  73. type="success"
  74. plain
  75. icon="el-icon-edit"
  76. size="mini"
  77. :disabled="single"
  78. @click="handleUpdate"
  79. v-hasPermi="['zdsz:engineeringCivil:edit']"
  80. >修改工程信息
  81. </el-button>
  82. </el-col>
  83. <el-col :span="1.5">
  84. <el-button
  85. type="danger"
  86. plain
  87. icon="el-icon-delete"
  88. size="mini"
  89. :disabled="multiple"
  90. @click="handleDelete"
  91. v-hasPermi="['zdsz:engineeringCivil:remove']"
  92. >删除
  93. </el-button>
  94. </el-col>
  95. <el-col :span="1.5">
  96. <el-button
  97. type="warning"
  98. plain
  99. icon="el-icon-download"
  100. size="mini"
  101. @click="handleExport"
  102. v-hasPermi="['zdsz:engineeringCivil:export']"
  103. >导出
  104. </el-button>
  105. </el-col>
  106. <el-col :span="1.5">
  107. <el-button
  108. type="danger"
  109. icon="el-icon-circle-check"
  110. size="mini"
  111. @click="handleExport"
  112. v-hasPermi="['zdsz:engineeringCivil:export']"
  113. >批量审核
  114. </el-button>
  115. </el-col>
  116. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  117. </el-row>
  118. <el-table v-loading="loading" :data="engineeringCivilList" @selection-change="handleSelectionChange">
  119. <el-table-column type="selection" width="55" align="center"/>
  120. <el-table-column label="主键" align="center" prop="id" v-if="false"/>
  121. <el-table-column label="行政区" align="center" prop="district">
  122. <template slot-scope="scope">
  123. <dict-tag :options="dict.type.district" :value="scope.row.district"/>
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="小区名称" align="center" prop="areaName"/>
  127. <el-table-column label="楼宇名称" align="center" prop="buildingName"/>
  128. <el-table-column label="单元名称" align="center" prop="unitName"/>
  129. <el-table-column label="房间名称" align="center" prop="houseName"/>
  130. <el-table-column label="工程类型" align="center" prop="enginType">
  131. <template slot-scope="scope">
  132. {{ scope.row.enginType === 'old_renovation' ? "旧改工程" : "新建" }}
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="工程分类" align="center" prop="enginClassificationName"/>
  136. <el-table-column label="工程周期" align="center" prop="enginCycle">
  137. <template slot-scope="scope">
  138. <dict-tag :options="dict.type.engin_cycle" :value="scope.row.enginCycle"/>
  139. </template>
  140. </el-table-column>
  141. <!-- <el-table-column label="完工状态" align="center" prop="completionStatus"/>-->
  142. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300">
  143. <template slot-scope="scope">
  144. <el-button
  145. size="mini"
  146. type="text"
  147. icon="el-icon-edit"
  148. @click="handleUpdate(scope.row)"
  149. v-hasPermi="['zdsz:engineeringCivil:edit']"
  150. >修改工程信息
  151. </el-button>
  152. <el-button
  153. size="mini"
  154. type="text"
  155. icon="el-icon-edit"
  156. @click="addNodeInfo(scope.row)"
  157. v-hasPermi="['zdsz:engineeringCivil:edit']"
  158. >填写节点信息
  159. </el-button>
  160. <el-button
  161. size="mini"
  162. type="text"
  163. icon="el-icon-delete"
  164. @click="handleDelete(scope.row)"
  165. v-hasPermi="['zdsz:engineeringCivil:remove']"
  166. >删除
  167. </el-button>
  168. <el-button
  169. size="mini"
  170. type="text"
  171. icon="el-icon-circle-check"
  172. @click="viewSource(scope.row)"
  173. v-hasPermi="['zdsz:engineeringCivil:remove']"
  174. >审核
  175. </el-button>
  176. <el-button
  177. size="mini"
  178. type="text"
  179. icon="el-icon-time"
  180. @click="viewSource(scope.row)"
  181. v-hasPermi="['zdsz:engineeringCivil:remove']"
  182. >历史用料
  183. </el-button>
  184. <el-button
  185. size="mini"
  186. type="text"
  187. icon="el-icon-edit"
  188. @click="addNewPipe(scope.row)"
  189. >新增顶管工程
  190. </el-button>
  191. <el-button
  192. size="mini"
  193. type="text"
  194. icon="el-icon-edit"
  195. @click="addMaterial(scope.row)"
  196. >添加用料
  197. </el-button>
  198. </template>
  199. </el-table-column>
  200. </el-table>
  201. <pagination
  202. v-show="total>0"
  203. :total="total"
  204. :page.sync="queryParams1.pageNum"
  205. :limit.sync="queryParams1.pageSize"
  206. @pagination="getList"
  207. />
  208. <!-- 添加或修改民用工程对话框 -->
  209. <el-dialog :title="title" ref="nodeForm" :visible.sync="open" width="500" append-to-body custom-class="addDialog"
  210. @close="onClose">
  211. <el-form ref="form" :model="queryParams" :rules="rules" label-width="110px">
  212. <el-row>
  213. <el-col :span="12">
  214. <el-form-item label="行政区" prop="district">
  215. <el-select
  216. :disabled="title == '添加用料' "
  217. v-model="queryParams.district"
  218. placeholder="请选择行政区"
  219. @change="districtHasChanged"
  220. >
  221. <el-option
  222. v-for="e in dict.type.district"
  223. :key="e.value"
  224. :label="e.label"
  225. :value="e.value"
  226. ></el-option>
  227. </el-select>
  228. </el-form-item>
  229. </el-col>
  230. <el-col :span="12">
  231. <el-form-item label="小区" prop="areaId">
  232. <el-select
  233. :disabled="title == '添加用料' "
  234. v-model="queryParams.areaId"
  235. placeholder="请选择小区"
  236. @change="communityHasChanged"
  237. >
  238. <el-option
  239. v-for="e in communityOptions"
  240. :key="e.id"
  241. :label="e.name"
  242. :value="e.id"
  243. ></el-option>
  244. </el-select>
  245. </el-form-item>
  246. </el-col>
  247. </el-row>
  248. <el-row>
  249. <el-col :span="12">
  250. <el-form-item label="楼栋" prop="buildingId">
  251. <el-select
  252. :disabled="title == '添加用料' "
  253. v-model="queryParams.buildingId"
  254. placeholder="请选择楼栋"
  255. @change="buildingHasChanged"
  256. >
  257. <el-option
  258. v-for="e in buildingOptions"
  259. :key="e.id"
  260. :label="e.name"
  261. :value="e.id"
  262. ></el-option>
  263. </el-select>
  264. </el-form-item>
  265. </el-col>
  266. <el-col :span="12">
  267. <el-form-item label="单元" prop="unitId">
  268. <el-select
  269. :disabled="title == '添加用料' "
  270. v-model="queryParams.unitId"
  271. placeholder="请选择单元"
  272. @change="unitHasChanged"
  273. >
  274. <el-option
  275. v-for="e in unitOptions"
  276. :key="e.id"
  277. :label="e.name"
  278. :value="e.id"
  279. ></el-option>
  280. </el-select>
  281. </el-form-item>
  282. </el-col>
  283. </el-row>
  284. <el-row>
  285. <el-col :span="12">
  286. <el-form-item label="房间" prop="houseId">
  287. <el-select
  288. :disabled="title == '添加用料' "
  289. v-model="queryParams.houseId"
  290. placeholder="请选择房间"
  291. >
  292. <el-option
  293. v-for="e in houseOptions"
  294. :key="e.id"
  295. :label="e.name"
  296. :value="e.id"
  297. ></el-option>
  298. </el-select>
  299. </el-form-item>
  300. </el-col>
  301. <el-col :span="12">
  302. <el-form-item label="工程类型" prop="enginType">
  303. <el-select
  304. :disabled="title == '添加用料' "
  305. v-model="queryParams.enginType"
  306. placeholder="请选择工程类型"
  307. @change="enginTypeHasChanged"
  308. >
  309. <el-option
  310. v-for="e in enginTypeOption"
  311. :key="e.value"
  312. :label="e.label"
  313. :value="e.value"
  314. ></el-option>
  315. </el-select>
  316. </el-form-item>
  317. </el-col>
  318. </el-row>
  319. <el-row>
  320. <el-col :span="12">
  321. <el-form-item label="工程分类" prop="enginClassification">
  322. <el-select
  323. :disabled="title == '添加用料' "
  324. v-model="queryParams.enginClassification"
  325. placeholder="请选择工程分类"
  326. @change="currentEnginTypeChanged"
  327. >
  328. <el-option
  329. v-for="e in currentEnginTypeChangeOptions"
  330. :key="e.dictValue"
  331. :label="e.dictLabel"
  332. :value="e.dictValue"
  333. ></el-option>
  334. </el-select>
  335. </el-form-item>
  336. </el-col>
  337. <el-col :span="12">
  338. <el-form-item label="工程周期" prop="enginCycle">
  339. <el-select
  340. :disabled="title == '添加用料' "
  341. v-model="queryParams.enginCycle"
  342. placeholder="请填写工程周期"
  343. >
  344. <el-option
  345. v-for="e in dict.type.engin_cycle"
  346. :key="e.value"
  347. :label="e.label"
  348. :value="e.value"
  349. ></el-option>
  350. </el-select>
  351. </el-form-item>
  352. </el-col>
  353. </el-row>
  354. <el-row>
  355. <el-col :span="24" v-if="title!=='修改民用工程'">
  356. <el-form-item label="节点">
  357. <el-checkbox-group v-model="currentCheckList">
  358. <el-checkbox
  359. :label="item.dictValue"
  360. v-for="item in checkList"
  361. :key="item"
  362. ></el-checkbox>
  363. </el-checkbox-group>
  364. </el-form-item>
  365. </el-col>
  366. </el-row>
  367. <EnginNodeInfo
  368. v-for="(e,idx) in currentCheckList"
  369. :key="idx"
  370. :name="e"
  371. :ref="'EnginNodeInfo'+idx"
  372. :currentContain="(listContain.find(i => i.name == e)).components"
  373. :updateOption='(updateOption.find(i => i.type == e)) || {}'
  374. :types="currentCheckList"
  375. :status="enginNodeStatus"
  376. enginType="民用工程"
  377. />
  378. <!-- <el-tabs type="border-card" >
  379. <el-tab-pane label="用户管理">用户管理</el-tab-pane>
  380. <el-tab-pane label="配置管理">配置管理</el-tab-pane>
  381. <el-tab-pane label="角色管理">角色管理</el-tab-pane>
  382. <el-tab-pane label="定时任务补偿">定时任务补偿</el-tab-pane>
  383. </el-tabs> -->
  384. </el-form>
  385. <div slot="footer" class="dialog-footer">
  386. <el-button :loading="buttonLoading" type="primary" @click="toNodeDetail">{{ enginNodeStatus }}</el-button>
  387. <el-button @click="cancel">取 消</el-button>
  388. </div>
  389. </el-dialog>
  390. <!-- 查看历史 -->
  391. <ConstructionDetails
  392. ref="ConstructionDetails"
  393. :currentCollapses="currentCollapses"
  394. :type="nodeDetailType"
  395. enginType="民用工程"
  396. />
  397. <!-- 顶管工程新增 -->
  398. <EngineePipe ref="enginPipe"/>
  399. </div>
  400. </template>
  401. <script>
  402. import {
  403. listEngineeringCivil,
  404. getEngineeringCivil,
  405. delEngineeringCivil,
  406. addEngineeringCivil,
  407. updateEngineeringCivil
  408. } from "@/api/zdsz/engineeringCivil";
  409. import {
  410. addEnginee, // 新增工程
  411. getHousesList, // 获取当前房间集合
  412. putEngineeringCivil, // 民用工程修改
  413. viewEngineeringCivil, // 民用工程查看详情
  414. deleteEngineeringCivil, // 删除民用工程
  415. getDictList, viewEngineeringInfrastructureSource, viewEngineeringCivilSource
  416. } from "@/api/zdsz/enginee"
  417. import {getAreaList} from "@/api/zdsz/area";
  418. import {getBuildingList} from "@/api/zdsz/building";
  419. import {getUnits} from "@/api/zdsz/unit";
  420. import {getDicts} from "@/api/system/dict/data";
  421. import EnginNodeInfo from "@/components/EnginNodeInfo/index";
  422. import EngineePipe from '@/components/EngineePipe'
  423. import ConstructionDetails from "@/components/ConstructionDetails/index.vue";
  424. export default {
  425. components: {
  426. ConstructionDetails,
  427. EnginNodeInfo,
  428. EngineePipe
  429. },
  430. name: "EngineeringCivil",
  431. dicts: ['pass_check',
  432. 'is_repair',
  433. 'engin_type',
  434. 'self_closing_valve_type',
  435. 'visit_type', 'district',
  436. 'new_built_indoor_engin',
  437. "old_renovation_indoor_engin",
  438. "old_renovation_courtyard",
  439. "old_renovation_overhead",
  440. "new_built_indoor_engin",
  441. "new_built_courtyard",
  442. "new_built_overhead",
  443. "engin_cycle"],
  444. data() {
  445. return {
  446. nodeDetailType:null,
  447. currentCollapses: [],
  448. enginId: undefined,
  449. updateOption: [],
  450. listContain: [
  451. {
  452. name:'拆旧管',
  453. components:[
  454. [
  455. 'corrosionLevel', // 腐蚀等级
  456. ],
  457. 'constructTime', // 施工时间
  458. 'zEngiineeringPhotoBoList', // 照片
  459. ]
  460. },
  461. {
  462. name:'警器切断阀',
  463. components:[
  464. [
  465. 'materialQuality', // 材质
  466. 'specifications', // 规格
  467. 'number', // 数量
  468. ],
  469. 'constructTime', // 施工时间
  470. 'zEngiineeringPhotoBoList', // 照片
  471. 'remark', // 施工内容
  472. ]
  473. },
  474. {
  475. name: '放线',
  476. components: [
  477. [
  478. 'materialQuality', // 材质
  479. 'specifications', // 规格
  480. 'number', // 数量
  481. ],
  482. 'constructTime', // 施工时间
  483. 'zEngiineeringPhotoBoList', // 照片
  484. 'remark', // 施工内容
  485. ]
  486. },
  487. {
  488. name: '挖沟',
  489. components: [
  490. [
  491. 'materialQuality', // 材质
  492. 'specifications', // 规格
  493. 'number', // 数量
  494. ],
  495. 'constructTime', // 施工时间
  496. 'zEngiineeringPhotoBoList', // 照片
  497. 'remark', // 施工内容
  498. ]
  499. },
  500. {
  501. name: '焊接',
  502. components: [
  503. [
  504. 'materialQuality', // 材质
  505. 'specifications', // 规格
  506. 'number', // 数量
  507. ],
  508. 'constructTime', // 施工时间
  509. 'zEngiineeringPhotoBoList', // 照片
  510. 'remark', // 施工内容
  511. ]
  512. },
  513. {
  514. name: '下沟',
  515. components: [
  516. [
  517. 'materialQuality', // 材质
  518. 'specifications', // 规格
  519. 'number', // 数量
  520. ],
  521. 'constructTime', // 施工时间
  522. 'zEngiineeringPhotoBoList', // 照片
  523. 'remark', // 施工内容
  524. ]
  525. },
  526. {
  527. name: '回田',
  528. components: [
  529. [
  530. 'materialQuality', // 材质
  531. 'specifications', // 规格
  532. 'number', // 数量
  533. ],
  534. 'backfillTime', // 回填时间
  535. 'constructTime', // 施工时间
  536. 'zEngiineeringPhotoBoList', // 照片
  537. 'remark', // 施工内容
  538. ]
  539. },
  540. {
  541. name: '打压',
  542. components: [
  543. [
  544. 'materialQuality', // 材质
  545. 'specifications', // 规格
  546. 'number', // 数量
  547. ],
  548. 'segmentedCompressionQualified', // 分段打压
  549. 'constructTime', // 施工时间
  550. 'zEngiineeringPhotoBoList', // 照片
  551. 'remark', // 施工内容
  552. ]
  553. },
  554. {
  555. name: '除锈',
  556. components: [
  557. [
  558. 'materialQuality', // 材质
  559. 'specifications', // 规格
  560. 'number', // 数量
  561. ],
  562. 'constructTime', // 施工时间
  563. 'zEngiineeringPhotoBoList', // 照片
  564. 'remark', // 施工内容
  565. ]
  566. },
  567. {
  568. name: '刷油',
  569. components: [
  570. [
  571. 'materialQuality', // 材质
  572. 'specifications', // 规格
  573. 'number', // 数量
  574. ],
  575. 'constructTime', // 施工时间
  576. 'zEngiineeringPhotoBoList', // 照片
  577. 'remark', // 施工内容
  578. ]
  579. },
  580. {
  581. name: '打磨',
  582. components: [
  583. [
  584. 'materialQuality', // 材质
  585. 'specifications', // 规格
  586. 'number', // 数量
  587. ],
  588. 'constructTime', // 施工时间
  589. 'zEngiineeringPhotoBoList', // 照片
  590. 'remark', // 施工内容
  591. ]
  592. },
  593. {
  594. name: '打孔',
  595. components: [
  596. [
  597. 'corrosionLevel', // 孔径/腐蚀等级
  598. ],
  599. 'constructTime', // 施工时间
  600. 'zEngiineeringPhotoBoList', // 照片
  601. ]
  602. },
  603. {
  604. name: '立杠',
  605. components: [
  606. [
  607. 'materialQuality', // 材质
  608. 'specifications', // 规格
  609. 'number', // 数量
  610. ],
  611. 'constructTime', // 施工时间
  612. 'zEngiineeringPhotoBoList', // 照片
  613. ]
  614. },
  615. {
  616. name: '挂表',
  617. components: [
  618. [
  619. 'brand', // 品牌
  620. ],
  621. 'constructTime', // 施工时间
  622. 'zEngiineeringPhotoBoList', // 照片
  623. 'remark', // 施工内容
  624. ]
  625. },
  626. {
  627. name: '表后管',
  628. components: [
  629. [
  630. 'materialQuality', // 材质
  631. 'specifications', // 规格
  632. 'number', // 数量
  633. ],
  634. 'constructAccordingDrawings', // 是否按图纸施工
  635. 'constructTime', // 施工时间
  636. 'zEngiineeringPhotoBoList', // 照片
  637. ]
  638. },
  639. {
  640. name: '阀管',
  641. components: [
  642. [
  643. 'materialQuality', // 材质
  644. 'specifications', // 规格
  645. 'number', // 数量
  646. 'visitType', // 上门类型
  647. 'selfClosingValveType', // 自闭阀类型
  648. ],
  649. 'constructTime', // 施工时间
  650. 'zEngiineeringPhotoBoList', // 照片
  651. ]
  652. },
  653. ],
  654. currentCheckList: [],
  655. enginClassificationinfo: '',
  656. enginClassification: '',
  657. enginClassificationOption: [],
  658. enginTypeOption: [
  659. {
  660. value: 'old_renovation',
  661. label: '旧改'
  662. }, {
  663. value: 'new_built',
  664. label: '新建'
  665. },
  666. ],
  667. currentEnginTypeChangeOptions: [],
  668. // 按钮loading
  669. buttonLoading: false,
  670. // 遮罩层
  671. loading: true,
  672. // 选中数组
  673. ids: [],
  674. // 非单个禁用
  675. single: true,
  676. // 非多个禁用
  677. multiple: true,
  678. // 显示搜索条件
  679. showSearch: true,
  680. // 总条数
  681. total: 0,
  682. // 民用工程表格数据
  683. engineeringCivilList: [],
  684. // 弹出层标题
  685. title: "",
  686. // 是否显示弹出层
  687. open: false,
  688. // 查询参数
  689. queryParams: {
  690. district: undefined,
  691. areaId: undefined,
  692. buildingId: undefined,
  693. unitId: undefined,
  694. houseId: undefined,
  695. enginType: undefined,
  696. enginCycle: undefined,
  697. completionStatus: undefined,
  698. enginClassification: undefined,
  699. imgUrl: undefined,
  700. zEngineeringNodeBoList: {
  701. type: undefined,
  702. zEngineeringInfoBo: {
  703. constructAddre: undefined, // 施工地址
  704. constructPhone: undefined, // 施工人电话
  705. constructUser: undefined, // 施工人
  706. headName: undefined, // 负责人
  707. headPhone: undefined, // 负责人电话
  708. constructAccordingDrawings: undefined, // 是否按图纸施工
  709. segmentedCompressionQualified: undefined, // 分段打压是否合格
  710. selfClosingValveType: undefined, // 自闭阀类型
  711. visitType: undefined, // 上门类型
  712. backfillTime: undefined, // 回填时间
  713. constructTime: undefined, // 施工时间
  714. zEngiineeringPhotoBoList: undefined, // 图片列表
  715. zEngineeringMaterialBo: undefined,// 用料对象, //节点信息
  716. }
  717. }
  718. },
  719. queryParams1: {
  720. pageNum: 1,
  721. pageSize: 10,
  722. district: undefined,
  723. areaId: undefined,
  724. buildingId: undefined,
  725. unitId: undefined,
  726. houseId: undefined,
  727. enginType: undefined,
  728. enginClassification: undefined,
  729. enginCycle: undefined,
  730. completionStatus: undefined,
  731. imgUrl: undefined,
  732. },
  733. zEngineeringInfoBo: {
  734. constructAddre: '', // 施工地址
  735. constructPhone: '', // 施工人电话
  736. constructUser: '', // 施工人
  737. headName: '', // 负责人
  738. headPhone: '', // 负责人电话
  739. constructAccordingDrawings: '', // 是否按图纸施工
  740. segmentedCompressionQualified: '', // 分段打压是否合格
  741. selfClosingValveType: '', // 自闭阀类型
  742. visitType: '', // 上门类型
  743. backfillTime: '', // 回填时间
  744. constructTime: '', // 施工时间
  745. zEngiineeringPhotoBoList: [], // 图片列表
  746. zEngineeringMaterialBo: [],// 用料对象
  747. },
  748. nodeList: [],
  749. // 表单参数
  750. form: {},
  751. value: [],
  752. // 表单校验
  753. rules: {
  754. id: [
  755. {required: true, message: "主键不能为空", trigger: "blur"}
  756. ],
  757. district: [
  758. {required: true, message: "行政区不能为空", trigger: "change"}
  759. ],
  760. areaId: [
  761. {required: true, message: "小区id不能为空", trigger: "change"}
  762. ],
  763. buildingId: [
  764. {required: true, message: "楼宇id不能为空", trigger: "change"}
  765. ],
  766. unitId: [
  767. {required: true, message: "单元id不能为空", trigger: "change"}
  768. ],
  769. houseId: [
  770. {required: true, message: "房间id不能为空", trigger: "change"}
  771. ],
  772. enginType: [
  773. {required: true, message: "工程类型不能为空", trigger: "change"}
  774. ],
  775. enginClassification: [
  776. {required: true, message: "工程分类不能为空", trigger: "change"}
  777. ],
  778. enginCycle: [
  779. {required: true, message: "工程周期不能为空", trigger: "change"}
  780. ],
  781. completionStatus: [
  782. {required: true, message: "完工状态不能为空", trigger: "change"}
  783. ],
  784. imgUrl: [
  785. {required: true, message: "默认图片地址不能为空", trigger: "blur"}
  786. ],
  787. remark: [
  788. {required: true, message: "备注不能为空", trigger: "blur"}
  789. ],
  790. },
  791. areaList: [],
  792. buildingList: [],
  793. unitList: [],
  794. currentDistrict: null, // 当前行政区
  795. currentCommunity: null, // 当前小区
  796. currentBuilding: null, // 当前楼宇
  797. currentUnit: null, // 当前单元
  798. communityOptions: [],
  799. buildingOptions: [], // 楼栋集合
  800. unitOptions: [], // 单元集合
  801. houseOptions: [], // 房间集合
  802. enginClassification_list: [], // 室内节点,
  803. checkList: [],// 节点集合
  804. enginNodeStatus: null
  805. };
  806. },
  807. created() {
  808. this.getList();
  809. },
  810. mounted() {
  811. },
  812. computed: {
  813. currentContain(e) {
  814. console.log('当前contain', e)
  815. }
  816. },
  817. methods: {
  818. addNodeInfo(e){
  819. this.nodeDetailType = '修改'
  820. this.enginId = e.id
  821. let val = e.enginType + "_" + e.enginClassification
  822. getDicts(val).then(res => {
  823. let dict = []
  824. for (let i = 0; i < res.data.length; i++) {
  825. dict.push({
  826. "label": res.data[i].dictLabel,
  827. "value": res.data[i].dictValue,
  828. })
  829. }
  830. this.$refs.ConstructionDetails.open(dict)
  831. })
  832. },
  833. viewNodeSource(e) {
  834. viewEngineeringCivilSource({
  835. id: this.enginId,
  836. type: e
  837. }).then(res => {
  838. try {
  839. this.currentCollapses = res.data.zEngineeringNodeBo.zEngineeringInfoBoList
  840. } catch (error) {
  841. this.currentCollapses = [];
  842. }
  843. console.log('折叠面板info',this.currentCollapses)
  844. })
  845. this.$forceUpdate()
  846. },
  847. // 查看历史
  848. viewSource(e) {
  849. console.log(e)
  850. this.enginId = e.id
  851. let val = e.enginType + "_" + e.enginClassification
  852. getDicts(val).then(res => {
  853. let dict = []
  854. for (let i = 0; i < res.data.length; i++) {
  855. dict.push({
  856. "label": res.data[i].dictLabel,
  857. "value": res.data[i].dictValue,
  858. })
  859. }
  860. this.$refs.ConstructionDetails.open(dict)
  861. })
  862. },
  863. // 新增顶管工程
  864. addNewPipe(data) {
  865. this.$refs.enginPipe.openDialog({
  866. id: data.id,
  867. type: '民用工程'
  868. }, 'add',data)
  869. },
  870. // 新增物料
  871. addMaterial(data) {
  872. this.title = "添加用料";
  873. this.enginNodeStatus = '添加用料'
  874. this.loading = true;
  875. this.reset();
  876. const id = data.id || this.ids
  877. getEngineeringCivil(id).then(res => {
  878. this.loading = false;
  879. let newData = res.data
  880. // 手动调用行政区发生改变
  881. this.districtHasChanged(newData.district)
  882. this.communityHasChanged(newData.areaId)
  883. this.buildingHasChanged(newData.buildingId, newData.areaId)
  884. this.unitHasChanged(newData.unitId)
  885. // 获取工程分类
  886. this.enginTypeHasChanged(newData.enginType)
  887. let val = newData.enginType + "_" + newData.enginClassification
  888. this.currentCheckList = []
  889. getDicts(val).then(res => {
  890. this.checkList = res.data
  891. })
  892. this.queryParams = newData
  893. console.log(this.queryParams.areaId)
  894. // console.log('选中节点集合',this.currentCheckList)
  895. // this.enginClassification = zEngineeringNodeBo.type
  896. // newData.zEngineeringNodeBo = zEngineeringNodeBo
  897. this.currentType = 'addMaterial'
  898. this.open = true
  899. })
  900. },
  901. currentEnginTypeChanged() {
  902. this.currentCheckList = []
  903. if (this.queryParams.enginType == undefined || this.queryParams.enginType == ''
  904. || this.queryParams.enginClassification == undefined || this.queryParams.enginClassification == ''
  905. )
  906. return
  907. let val = this.queryParams.enginType + "_" + this.queryParams.enginClassification
  908. getDicts(val).then(res => {
  909. this.checkList = res.data
  910. })
  911. },
  912. // 当前所选行政区发生改变 查询当前小区集合
  913. districtHasChanged(district) {
  914. this.queryParams.areaId = null
  915. this.queryParams.buildingId = null
  916. this.queryParams.unitId = null
  917. getAreaList({district}).then(res => {
  918. this.communityOptions = res.data
  919. })
  920. },
  921. // 当前所选小区发生改变 查询当前楼栋集合
  922. communityHasChanged(areaId) {
  923. this.queryParams.buildingId = null
  924. this.queryParams.unitId = null
  925. getBuildingList({areaId}).then(res => {
  926. this.buildingOptions = res.data
  927. })
  928. },
  929. buildingHasChanged(buildingId, areaId) {
  930. console.log(buildingId)
  931. this.queryParams.unitId = null
  932. getUnits(areaId || this.queryParams.areaId, buildingId).then(res => {
  933. this.unitOptions = res.data
  934. })
  935. },
  936. unitHasChanged(unitId) {
  937. getHousesList({unitId}).then(res => {
  938. console.log(res)
  939. this.houseOptions = res.data
  940. })
  941. },
  942. enginTypeHasChanged(enginType = null) {
  943. this.currentCheckList = []
  944. this.queryParams.enginClassification = ''
  945. this.currentEnginTypeChangeOptions = []
  946. getDicts(enginType || this.queryParams.enginType).then(res => {
  947. this.currentEnginTypeChangeOptions = res.data
  948. })
  949. },
  950. onClose() {
  951. console.log(this.currentCheckList)
  952. this.currentCheckList = []
  953. this.checkList = []
  954. this.reset()
  955. },
  956. closeToSucceed() {
  957. this.open = false;
  958. },
  959. getAreaList(district) {
  960. if (district === undefined || district == null || district === '')
  961. return
  962. getAreaList({district: district}).then(res => this.areaList = res.data)
  963. },
  964. getBuildingList1(areaId) {
  965. if (areaId === undefined || areaId == null || areaId === '')
  966. return
  967. getBuildingList({areaId: areaId}).then(res => this.buildingList = res.data)
  968. },
  969. getUnitList1(buildingId) {
  970. if (buildingId === undefined || buildingId == null || buildingId === '')
  971. return
  972. getUnits(this.queryParams.areaId, buildingId).then(res => this.unitList = res.data)
  973. },
  974. /** 查询民用工程列表 */
  975. getList() {
  976. this.loading = true;
  977. listEngineeringCivil(this.queryParams1).then(response => {
  978. this.engineeringCivilList = response.rows;
  979. this.total = response.total;
  980. this.loading = false;
  981. });
  982. },
  983. // 取消按钮
  984. cancel() {
  985. this.open = false;
  986. this.reset();
  987. },
  988. // 表单重置
  989. reset() {
  990. this.form = {
  991. id: undefined,
  992. district: undefined,
  993. areaId: undefined,
  994. buildingId: undefined,
  995. unitId: undefined,
  996. houseId: undefined,
  997. enginType: undefined,
  998. enginClassification: undefined,
  999. enginCycle: undefined,
  1000. completionStatus: undefined,
  1001. version: undefined,
  1002. imgUrl: undefined,
  1003. remark: undefined,
  1004. delFlag: undefined,
  1005. createBy: undefined,
  1006. createTime: undefined,
  1007. updateBy: undefined,
  1008. updateTime: undefined
  1009. };
  1010. this.queryParams = {
  1011. district: undefined,
  1012. areaId: undefined,
  1013. buildingId: undefined,
  1014. unitId: undefined,
  1015. houseId: undefined,
  1016. enginType: undefined,
  1017. enginClassification: undefined,
  1018. enginCycle: undefined,
  1019. completionStatus: undefined,
  1020. imgUrl: undefined,
  1021. // zEngineeringNodeBo: {
  1022. // type: undefined,
  1023. // zEngineeringInfoBo: {
  1024. // constructAddre: undefined, // 施工地址
  1025. // constructPhone: undefined, // 施工人电话
  1026. // constructUser: undefined, // 施工人
  1027. // headName: undefined, // 负责人
  1028. // headPhone: undefined, // 负责人电话
  1029. // constructAccordingDrawings: undefined, // 是否按图纸施工
  1030. // segmentedCompressionQualified: undefined, // 分段打压是否合格
  1031. // selfClosingValveType: undefined, // 自闭阀类型
  1032. // visitType: undefined, // 上门类型
  1033. // backfillTime: undefined, // 回填时间
  1034. // constructTime: undefined, // 施工时间
  1035. // zEngiineeringPhotoBoList: undefined, // 图片列表
  1036. // zEngineeringMaterialBo: undefined,// 用料对象, //节点信息
  1037. // }
  1038. // },
  1039. }
  1040. this.enginClassification = null
  1041. this.resetForm("form");
  1042. },
  1043. /** 搜索按钮操作 */
  1044. handleQuery() {
  1045. this.queryParams.pageNum = 1;
  1046. this.getList();
  1047. },
  1048. /** 重置按钮操作 */
  1049. resetQuery() {
  1050. this.resetForm("queryForm");
  1051. this.handleQuery();
  1052. },
  1053. // 多选框选中数据
  1054. handleSelectionChange(selection) {
  1055. this.ids = selection.map(item => item.id)
  1056. this.single = selection.length !== 1
  1057. this.multiple = !selection.length
  1058. },
  1059. // 新增顶管工程
  1060. // addNewPipe(data){
  1061. // this.$refs.enginPipe.openDialog({
  1062. // id:data.id
  1063. // },'add')
  1064. // },
  1065. nodeCancel() {
  1066. this.nodeDetailVisible = false
  1067. },
  1068. toNodeDetail() {
  1069. let nodeCollection = []
  1070. // 收集节点信息
  1071. this.currentCheckList.forEach((e, idx) => {
  1072. let nodeItem = this.$refs['EnginNodeInfo' + idx][0].infoCollection()
  1073. // console.log(nodeItem)
  1074. nodeCollection.push(nodeItem)
  1075. })
  1076. this.queryParams.zEngineeringNodeBoList = nodeCollection
  1077. if (this.enginNodeStatus == '修改') {
  1078. putEngineeringCivil(this.queryParams).then(res => {
  1079. if (res.code == 200) {
  1080. this.$message({
  1081. message: '添加成功',
  1082. type: 'success'
  1083. });
  1084. this.open = false
  1085. console.log('选中节点集合', this.currentCheckList)
  1086. this.currentCheckList = []
  1087. this.getList()
  1088. // this.$emit('closeToSucceed')
  1089. }
  1090. })
  1091. } else if(this.enginNodeStatus == '添加用料'){
  1092. addEngineeringCivil(this.queryParams).then(res => {
  1093. if(res.code == 200){
  1094. this.$message({
  1095. message: '添加成功',
  1096. type: 'success'
  1097. });
  1098. this.open = false
  1099. console.log('选中节点集合',this.currentCheckList)
  1100. this.currentCheckList = []
  1101. this.getList()
  1102. // this.$emit('closeToSucceed')
  1103. }
  1104. })
  1105. } else if(this.enginNodeStatus == '添加用料'){
  1106. addEngineeringCivil(this.queryParams).then(res => {
  1107. if(res.code == 200){
  1108. this.$message({
  1109. message: '添加成功',
  1110. type: 'success'
  1111. });
  1112. this.open = false
  1113. console.log('选中节点集合',this.currentCheckList)
  1114. this.currentCheckList = []
  1115. // this.$emit('closeToSucceed')
  1116. }
  1117. })
  1118. } else {
  1119. addEngineeringCivil(this.queryParams).then(res => {
  1120. if (res.code == 200) {
  1121. this.$message({
  1122. message: '新增成功',
  1123. type: 'success'
  1124. });
  1125. this.open = false
  1126. console.log('选中节点集合', this.currentCheckList)
  1127. this.currentCheckList = []
  1128. // this.$emit('closeToSucceed')
  1129. }
  1130. })
  1131. }
  1132. return
  1133. getDictList({enginType: ['new_built', 'old_renovation']}).then(res => {
  1134. this.nodeList = res.data
  1135. console.log('跳到详情前的queryParams', this.queryParams)
  1136. console.log('跳到详情前的节点集合', this.nodeList)
  1137. if (this.currentType == 'put') {
  1138. this.$refs.childNode.open(this.queryParams, 16, this.nodeList)
  1139. this.currentType = null
  1140. return
  1141. }
  1142. // 加工 enginClassification 工程节点
  1143. // const parts = this.value[1].split('_');
  1144. // let result = parts.slice(2).join('_');
  1145. // console.log(result)
  1146. // this.queryParams.zEngineeringNodeBo.type = this.enginClassification
  1147. // this.queryParams.enginClassification = result
  1148. // console.log(this.queryParams)
  1149. console.log('新增queryparams传值', this.queryParams)
  1150. this.$refs.childNode.open(this.queryParams, 0, this.nodeList)
  1151. return
  1152. this.$refs['form'].validate(e => {
  1153. if (e) {
  1154. this.nodeDetailVisible = true
  1155. }
  1156. })
  1157. })
  1158. },
  1159. /** 新增按钮操作 */
  1160. handleAdd() {
  1161. this.enginNodeStatus = '新增'
  1162. this.reset();
  1163. this.open = true;
  1164. this.title = "添加民用工程";
  1165. },
  1166. /** 修改按钮操作 */
  1167. handleUpdate(row) {
  1168. let that = this
  1169. this.enginNodeStatus = '修改'
  1170. this.loading = true;
  1171. this.reset();
  1172. const id = row.id || this.ids
  1173. getEngineeringCivil(id).then(res => {
  1174. debugger
  1175. that.loading = false;
  1176. // let newData = res.data
  1177. // // 手动调用行政区发生改变
  1178. that.queryParams = res.data
  1179. let va = that.queryParams.enginClassification
  1180. that.enginTypeHasChanged(that.queryParams.enginType)
  1181. that.queryParams.enginClassification = va
  1182. that.open = true
  1183. that.title = "修改民用工程";
  1184. })
  1185. },
  1186. /** 提交按钮 */
  1187. submitForm() {
  1188. this.$refs["form"].validate(valid => {
  1189. if (valid) {
  1190. this.buttonLoading = true;
  1191. if (this.form.id != null) {
  1192. updateEngineeringCivil(this.form).then(response => {
  1193. this.$modal.msgSuccess("修改成功");
  1194. this.open = false;
  1195. debugger
  1196. this.getList();
  1197. }).finally(() => {
  1198. this.buttonLoading = false;
  1199. });
  1200. } else {
  1201. addEngineeringCivil(this.form).then(response => {
  1202. this.$modal.msgSuccess("新增成功");
  1203. this.open = false;
  1204. this.getList();
  1205. }).finally(() => {
  1206. this.buttonLoading = false;
  1207. });
  1208. }
  1209. }
  1210. });
  1211. },
  1212. /** 删除按钮操作 */
  1213. handleDelete(row) {
  1214. const ids = row.id || this.ids;
  1215. this.$modal.confirm('是否确认删除民用工程编号为"' + ids + '"的数据项?').then(() => {
  1216. this.loading = true;
  1217. return delEngineeringCivil(ids);
  1218. }).then(() => {
  1219. this.loading = false;
  1220. this.getList();
  1221. this.$modal.msgSuccess("删除成功");
  1222. }).catch(() => {
  1223. }).finally(() => {
  1224. this.loading = false;
  1225. });
  1226. },
  1227. /** 导出按钮操作 */
  1228. handleExport() {
  1229. this.download('zdsz/engineeringCivil/export', {
  1230. ...this.queryParams
  1231. }, `engineeringCivil_${new Date().getTime()}.xlsx`)
  1232. }
  1233. }
  1234. };
  1235. </script>
  1236. <style lang="scss" scoped>
  1237. ::v-deep .addDialog {
  1238. width: 60%;
  1239. }
  1240. ::v-deep .appendElDialog {
  1241. width: 70%;
  1242. height: 80%;
  1243. .el-dialog__body {
  1244. height: 85%;
  1245. }
  1246. .el-form-item {
  1247. margin-bottom: 22px;
  1248. width: 44%;
  1249. display: inline-block;
  1250. }
  1251. .el-form-item:nth-child(2n+2) {
  1252. margin-left: 5%;
  1253. }
  1254. .el-form-item:not(:nth-child(1):nth-child(2)) {
  1255. margin-top: 0.5%;
  1256. }
  1257. .remark_input {
  1258. .el-textarea__inner {
  1259. width: 238%;
  1260. height: 190px;
  1261. }
  1262. }
  1263. }
  1264. ::v-deep .appendElNodeDialog {
  1265. // width: 70%;
  1266. height: 80%;
  1267. .el-dialog__body {
  1268. height: 85%;
  1269. }
  1270. .el-form-item {
  1271. margin-bottom: 22px;
  1272. width: 44%;
  1273. display: inline-block;
  1274. }
  1275. .el-form-item:nth-child(2n+2) {
  1276. margin-left: 5%;
  1277. }
  1278. .el-form-item:not(:nth-child(1):nth-child(2)) {
  1279. margin-top: 0.5%;
  1280. }
  1281. }
  1282. </style>