index.vue 41 KB

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