index.vue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260
  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">
  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.$refs.nodeForm.resetFields()
  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.$emit('closeToSucceed')
  1035. }
  1036. })
  1037. } else {
  1038. addEngineeringCivil(this.queryParams).then(res => {
  1039. if (res.code == 200) {
  1040. this.$message({
  1041. message: '新增成功',
  1042. type: 'success'
  1043. });
  1044. this.open = false
  1045. console.log('选中节点集合', this.currentCheckList)
  1046. this.currentCheckList = []
  1047. // this.$emit('closeToSucceed')
  1048. }
  1049. })
  1050. }
  1051. return
  1052. getDictList({enginType: ['new_built', 'old_renovation']}).then(res => {
  1053. this.nodeList = res.data
  1054. console.log('跳到详情前的queryParams', this.queryParams)
  1055. console.log('跳到详情前的节点集合', this.nodeList)
  1056. if (this.currentType == 'put') {
  1057. this.$refs.childNode.open(this.queryParams, 16, this.nodeList)
  1058. this.currentType = null
  1059. return
  1060. }
  1061. // 加工 enginClassification 工程节点
  1062. // const parts = this.value[1].split('_');
  1063. // let result = parts.slice(2).join('_');
  1064. // console.log(result)
  1065. // this.queryParams.zEngineeringNodeBo.type = this.enginClassification
  1066. // this.queryParams.enginClassification = result
  1067. // console.log(this.queryParams)
  1068. console.log('新增queryparams传值', this.queryParams)
  1069. this.$refs.childNode.open(this.queryParams, 0, this.nodeList)
  1070. return
  1071. this.$refs['form'].validate(e => {
  1072. if (e) {
  1073. this.nodeDetailVisible = true
  1074. }
  1075. })
  1076. })
  1077. },
  1078. /** 新增按钮操作 */
  1079. handleAdd() {
  1080. this.enginNodeStatus = '新增'
  1081. this.reset();
  1082. this.open = true;
  1083. this.title = "添加民用工程";
  1084. },
  1085. /** 修改按钮操作 */
  1086. handleUpdate(row) {
  1087. this.enginNodeStatus = '修改'
  1088. this.loading = true;
  1089. // this.reset();
  1090. const id = row.id || this.ids
  1091. getEngineeringCivil(id).then(res => {
  1092. this.loading = false;
  1093. let newData = res.data
  1094. // 手动调用行政区发生改变
  1095. // this.districtHasChanged(newData.district)
  1096. this.queryParams = newData
  1097. this.updateOption = res.data.zEngineeringNodeBoList
  1098. console.log(this.queryParams.areaId)
  1099. // start update修改数据
  1100. res.data.zEngineeringNodeBoList.forEach((e, idx) => {
  1101. this.currentCheckList.push(e.type)
  1102. })
  1103. console.log('选中节点集合', this.currentCheckList)
  1104. // end
  1105. let zEngineeringNodeBo = {
  1106. type: res.data.zEngineeringNodeBoList[0].type,
  1107. zEngineeringInfoBo: res.data.zEngineeringNodeBoList[0].zEngineeringInfoBo
  1108. }
  1109. if (res.data.areaId != '' && res.data.areaId != null) {
  1110. this.communityHasChanged(res.data.areaId)
  1111. }
  1112. if (res.data.district != '' && res.data.district != null) {
  1113. this.districtHasChanged(res.data.district)
  1114. }
  1115. if (res.data.buildingId != '' && res.data.buildingId != null) {
  1116. this.buildingHasChanged(res.data.buildingId)
  1117. }
  1118. if (res.data.unitId != '' && res.data.unitId != null) {
  1119. this.unitHasChanged(res.data.unitId)
  1120. }
  1121. this.value[0] = res.data.enginType
  1122. this.value[1] = res.data.enginClassification
  1123. if (res.data.enginClassification != null && res.data.enginClassification != '') {
  1124. this.enginClassificationOption = this.dict.type[res.data.enginClassification]
  1125. }
  1126. this.enginClassification = zEngineeringNodeBo.type
  1127. newData.zEngineeringNodeBo = zEngineeringNodeBo
  1128. this.currentType = 'put'
  1129. console.log('修改queryparams传值', this.queryParams)
  1130. console.log(this.queryParams)
  1131. this.zEngineeringInfoBo = newData.zEngineeringNodeBo.zEngineeringInfoBo
  1132. this.open = true
  1133. this.title = "修改民用工程";
  1134. })
  1135. },
  1136. /** 提交按钮 */
  1137. submitForm() {
  1138. this.$refs["form"].validate(valid => {
  1139. if (valid) {
  1140. this.buttonLoading = true;
  1141. if (this.form.id != null) {
  1142. updateEngineeringCivil(this.form).then(response => {
  1143. this.$modal.msgSuccess("修改成功");
  1144. this.open = false;
  1145. this.getList();
  1146. }).finally(() => {
  1147. this.buttonLoading = false;
  1148. });
  1149. } else {
  1150. addEngineeringCivil(this.form).then(response => {
  1151. this.$modal.msgSuccess("新增成功");
  1152. this.open = false;
  1153. this.getList();
  1154. }).finally(() => {
  1155. this.buttonLoading = false;
  1156. });
  1157. }
  1158. }
  1159. });
  1160. },
  1161. /** 删除按钮操作 */
  1162. handleDelete(row) {
  1163. const ids = row.id || this.ids;
  1164. this.$modal.confirm('是否确认删除民用工程编号为"' + ids + '"的数据项?').then(() => {
  1165. this.loading = true;
  1166. return delEngineeringCivil(ids);
  1167. }).then(() => {
  1168. this.loading = false;
  1169. this.getList();
  1170. this.$modal.msgSuccess("删除成功");
  1171. }).catch(() => {
  1172. }).finally(() => {
  1173. this.loading = false;
  1174. });
  1175. },
  1176. /** 导出按钮操作 */
  1177. handleExport() {
  1178. this.download('zdsz/engineeringCivil/export', {
  1179. ...this.queryParams
  1180. }, `engineeringCivil_${new Date().getTime()}.xlsx`)
  1181. }
  1182. }
  1183. };
  1184. </script>
  1185. <style lang="scss" scoped>
  1186. ::v-deep .addDialog {
  1187. width: 60%;
  1188. }
  1189. ::v-deep .appendElDialog {
  1190. width: 70%;
  1191. height: 80%;
  1192. .el-dialog__body {
  1193. height: 85%;
  1194. }
  1195. .el-form-item {
  1196. margin-bottom: 22px;
  1197. width: 44%;
  1198. display: inline-block;
  1199. }
  1200. .el-form-item:nth-child(2n+2) {
  1201. margin-left: 5%;
  1202. }
  1203. .el-form-item:not(:nth-child(1):nth-child(2)) {
  1204. margin-top: 0.5%;
  1205. }
  1206. .remark_input {
  1207. .el-textarea__inner {
  1208. width: 238%;
  1209. height: 190px;
  1210. }
  1211. }
  1212. }
  1213. ::v-deep .appendElNodeDialog {
  1214. // width: 70%;
  1215. height: 80%;
  1216. .el-dialog__body {
  1217. height: 85%;
  1218. }
  1219. .el-form-item {
  1220. margin-bottom: 22px;
  1221. width: 44%;
  1222. display: inline-block;
  1223. }
  1224. .el-form-item:nth-child(2n+2) {
  1225. margin-left: 5%;
  1226. }
  1227. .el-form-item:not(:nth-child(1):nth-child(2)) {
  1228. margin-top: 0.5%;
  1229. }
  1230. }
  1231. </style>