index.vue 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672
  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 label="工程类型" prop="enginType">
  55. <el-select v-model="queryParams1.enginType" placeholder="请选择工程类型" clearable
  56. @change="enginTypeHasChangeds"
  57. @clear="currentEnginTypeChangeOptions1=[];queryParams1.enginClassification=undefined;queryParams1.enginType=undefined">
  58. <el-option
  59. v-for="dict in enginTypeOption"
  60. :key="dict.value"
  61. :label="dict.label"
  62. :value="dict.value"
  63. />
  64. </el-select>
  65. </el-form-item>
  66. <el-form-item label="工程分类" prop="enginClassification">
  67. <el-select v-model="queryParams1.enginClassification" placeholder="请选择工程分类" clearable
  68. @clear="">
  69. <el-option
  70. v-for="dict in currentEnginTypeChangeOptions1"
  71. :key="dict.dictValue"
  72. :label="dict.dictLabel"
  73. :value="dict.dictValue"
  74. />
  75. </el-select>
  76. </el-form-item>
  77. <el-form-item label="工程周期" prop="enginCycle">
  78. <el-select v-model="queryParams1.enginCycle" placeholder="请选择工程周期" clearable
  79. @clear="">
  80. <el-option
  81. v-for="dict in dict.type.engin_cycle"
  82. :key="dict.value"
  83. :label="dict.label"
  84. :value="dict.value"
  85. />
  86. </el-select>
  87. </el-form-item>
  88. <el-form-item>
  89. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  90. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  91. </el-form-item>
  92. </el-form>
  93. <el-row :gutter="10" class="mb8">
  94. <el-col :span="1.5">
  95. <el-button
  96. type="primary"
  97. plain
  98. icon="el-icon-plus"
  99. size="mini"
  100. @click="handleAdd"
  101. v-hasPermi="['zdsz:engineeringCivil:add']"
  102. >新增
  103. </el-button>
  104. </el-col>
  105. <el-col :span="1.5">
  106. <el-button
  107. type="success"
  108. plain
  109. icon="el-icon-edit"
  110. size="mini"
  111. :disabled="single"
  112. @click="handleUpdate"
  113. v-hasPermi="['zdsz:engineeringCivil:edit']"
  114. >修改工程信息
  115. </el-button>
  116. </el-col>
  117. <el-col :span="1.5">
  118. <el-button
  119. type="danger"
  120. plain
  121. icon="el-icon-delete"
  122. size="mini"
  123. :disabled="multiple"
  124. @click="handleDelete"
  125. v-hasPermi="['zdsz:engineeringCivil:remove']"
  126. >删除
  127. </el-button>
  128. </el-col>
  129. <el-col :span="1.5">
  130. <el-button
  131. type="warning"
  132. plain
  133. icon="el-icon-download"
  134. size="mini"
  135. @click="handleExport"
  136. v-hasPermi="['zdsz:engineeringCivil:export']"
  137. >导出
  138. </el-button>
  139. </el-col>
  140. <el-col :span="1.5">
  141. <el-button
  142. type="danger"
  143. icon="el-icon-circle-check"
  144. size="mini"
  145. @click="handleCheckings"
  146. v-hasPermi="['zdsz:engineeringCivil:review']"
  147. >批量审核
  148. </el-button>
  149. </el-col>
  150. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  151. </el-row>
  152. <el-table v-loading="loading" :data="engineeringCivilList" @selection-change="handleSelectionChange">
  153. <el-table-column type="selection" width="55" align="center"/>
  154. <el-table-column label="主键" align="center" prop="id" v-if="false"/>
  155. <el-table-column label="行政区" align="center" prop="district">
  156. <template slot-scope="scope">
  157. <dict-tag :options="dict.type.district" :value="scope.row.district"/>
  158. </template>
  159. </el-table-column>
  160. <el-table-column label="小区名称" align="center" prop="areaName"/>
  161. <el-table-column label="楼宇名称" align="center" prop="buildingName"/>
  162. <el-table-column label="单元名称" align="center" prop="unitName"/>
  163. <el-table-column label="房间名称" align="center" prop="houseName"/>
  164. <el-table-column label="工程类型" align="center" prop="enginType">
  165. <template slot-scope="scope">
  166. {{ scope.row.enginType === 'old_renovation' ? "旧改工程" : "新建" }}
  167. </template>
  168. </el-table-column>
  169. <el-table-column label="工程分类" align="center" prop="enginClassificationName"/>
  170. <el-table-column label="工程周期" align="center" prop="enginCycle">
  171. <template slot-scope="scope">
  172. <dict-tag :options="dict.type.engin_cycle" :value="scope.row.enginCycle"/>
  173. </template>
  174. </el-table-column>
  175. <!-- <el-table-column label="完工状态" align="center" prop="completionStatus"/>-->
  176. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300">
  177. <template slot-scope="scope">
  178. <el-button
  179. size="mini"
  180. type="text"
  181. icon="el-icon-edit"
  182. @click="handleUpdate(scope.row)"
  183. v-hasPermi="['zdsz:engineeringCivil:edit']"
  184. >修改工程信息
  185. </el-button>
  186. <el-button
  187. size="mini"
  188. type="text"
  189. icon="el-icon-edit"
  190. @click="addNodeInfo(scope.row)"
  191. v-hasPermi="['zdsz:engineeringCivil:add']"
  192. >修改施工信息
  193. </el-button>
  194. <el-button
  195. size="mini"
  196. type="text"
  197. icon="el-icon-delete"
  198. @click="handleDelete(scope.row)"
  199. v-hasPermi="['zdsz:engineeringCivil:remove']"
  200. >删除
  201. </el-button>
  202. <el-button
  203. size="mini"
  204. type="text"
  205. icon="el-icon-circle-check"
  206. @click="viewSource(scope.row,'check')"
  207. v-hasPermi="['zdsz:engineeringCivil:review']"
  208. >审核
  209. </el-button>
  210. <el-button
  211. size="mini"
  212. type="text"
  213. icon="el-icon-time"
  214. @click="viewSource(scope.row)"
  215. v-hasPermi="['zdsz:engineeringCivil:query']"
  216. >历史施工
  217. </el-button>
  218. <el-button
  219. size="mini"
  220. type="text"
  221. icon="el-icon-edit"
  222. v-hasPermi="['zdsz:engineeringPipeJacking:add']"
  223. @click="addNewPipe(scope.row)"
  224. >新增顶管工程
  225. </el-button>
  226. <el-button
  227. size="mini"
  228. type="text"
  229. icon="el-icon-edit"
  230. v-hasPermi="['zdsz:engineeringCivil:add']"
  231. @click="addMaterial(scope.row)"
  232. >添加用料
  233. </el-button>
  234. </template>
  235. </el-table-column>
  236. </el-table>
  237. <pagination
  238. v-show="total>0"
  239. :total="total"
  240. :page.sync="queryParams1.pageNum"
  241. :limit.sync="queryParams1.pageSize"
  242. @pagination="getList"
  243. />
  244. <!-- 添加或修改民用工程对话框 -->
  245. <el-dialog :title="title" ref="nodeForm" :visible.sync="open" width="500" append-to-body custom-class="addDialog"
  246. @close="onClose">
  247. <el-form ref="form" :model="queryParams" :rules="rules" label-width="110px">
  248. <el-row>
  249. <el-col :span="12">
  250. <el-form-item label="行政区" prop="district">
  251. <el-select
  252. :disabled="title == '添加用料' "
  253. v-model="queryParams.district"
  254. placeholder="请选择行政区"
  255. filterable
  256. @change="districtHasChanged"
  257. >
  258. <el-option
  259. v-for="e in dict.type.district"
  260. :key="e.value"
  261. :label="e.label"
  262. :value="e.value"
  263. ></el-option>
  264. </el-select>
  265. </el-form-item>
  266. </el-col>
  267. <el-col :span="12">
  268. <el-form-item label="小区" prop="areaId">
  269. <el-select
  270. :disabled="title == '添加用料' "
  271. v-model="queryParams.areaId"
  272. filterable
  273. placeholder="请选择小区"
  274. @change="communityHasChanged"
  275. >
  276. <el-option
  277. v-for="e in communityOptions"
  278. :key="e.id"
  279. :label="e.name"
  280. :value="e.id"
  281. ></el-option>
  282. </el-select>
  283. </el-form-item>
  284. </el-col>
  285. </el-row>
  286. <el-row>
  287. <el-col :span="12">
  288. <el-form-item label="楼栋" prop="buildingId">
  289. <el-select
  290. :disabled="title == '添加用料' "
  291. filterable
  292. v-model="queryParams.buildingId"
  293. placeholder="请选择楼栋"
  294. @change="buildingHasChanged"
  295. >
  296. <el-option
  297. v-for="e in buildingOptions"
  298. :key="e.id"
  299. :label="e.name"
  300. :value="e.id"
  301. ></el-option>
  302. </el-select>
  303. </el-form-item>
  304. </el-col>
  305. <el-col :span="12">
  306. <el-form-item label="单元" prop="unitId">
  307. <el-select
  308. :disabled="title == '添加用料' "
  309. v-model="queryParams.unitId"
  310. filterable
  311. placeholder="请选择单元"
  312. @change="unitHasChanged"
  313. >
  314. <el-option
  315. v-for="e in unitOptions"
  316. :key="e.id"
  317. :label="e.name"
  318. :value="e.id"
  319. ></el-option>
  320. </el-select>
  321. </el-form-item>
  322. </el-col>
  323. </el-row>
  324. <el-row>
  325. <el-col :span="12">
  326. <el-form-item label="房间" prop="houseId">
  327. <el-select
  328. :disabled="title == '添加用料' "
  329. v-model="queryParams.houseId"
  330. filterable
  331. placeholder="请选择房间"
  332. >
  333. <el-option
  334. v-for="e in houseOptions"
  335. :key="e.id"
  336. :label="e.name"
  337. :value="e.id"
  338. ></el-option>
  339. </el-select>
  340. </el-form-item>
  341. </el-col>
  342. <el-col :span="12">
  343. <el-form-item label="工程类型" prop="enginType">
  344. <el-select
  345. :disabled="title == '添加用料' "
  346. v-model="queryParams.enginType"
  347. placeholder="请选择工程类型"
  348. @change="enginTypeHasChanged"
  349. >
  350. <el-option
  351. v-for="e in enginTypeOption"
  352. :key="e.value"
  353. :label="e.label"
  354. :value="e.value"
  355. ></el-option>
  356. </el-select>
  357. </el-form-item>
  358. </el-col>
  359. </el-row>
  360. <el-row>
  361. <el-col :span="12">
  362. <el-form-item label="工程分类" prop="enginClassification">
  363. <el-select
  364. :disabled="title == '添加用料' "
  365. v-model="queryParams.enginClassification"
  366. placeholder="请选择工程分类"
  367. @change="currentEnginTypeChanged"
  368. >
  369. <el-option
  370. v-for="e in currentEnginTypeChangeOptions"
  371. :key="e.dictValue"
  372. :label="e.dictLabel"
  373. :value="e.dictValue"
  374. ></el-option>
  375. </el-select>
  376. </el-form-item>
  377. </el-col>
  378. <el-col :span="12">
  379. <el-form-item label="工程周期" prop="enginCycle">
  380. <el-select
  381. :disabled="title == '添加用料' "
  382. v-model="queryParams.enginCycle"
  383. placeholder="请填写工程周期"
  384. >
  385. <el-option
  386. v-for="e in dict.type.engin_cycle"
  387. :key="e.value"
  388. :label="e.label"
  389. :value="e.value"
  390. ></el-option>
  391. </el-select>
  392. </el-form-item>
  393. </el-col>
  394. </el-row>
  395. <el-row>
  396. <el-col :span="24" v-if="title!=='修改民用工程'">
  397. <el-form-item label="环节">
  398. <el-checkbox-group v-model="currentCheckList">
  399. <el-checkbox
  400. :label="item.dictValue"
  401. v-for="item in checkList"
  402. :key="item"
  403. ></el-checkbox>
  404. </el-checkbox-group>
  405. </el-form-item>
  406. </el-col>
  407. </el-row>
  408. <EnginNodeInfo
  409. v-for="(e,idx) in currentCheckList"
  410. :key="idx"
  411. :name="e"
  412. :ref="'EnginNodeInfo'+idx"
  413. :currentContain="(listContain.find(i => i.name == e)).components"
  414. :updateOption='(updateOption.find(i => i.type == e)) || {}'
  415. :types="currentCheckList"
  416. :status="enginNodeStatus"
  417. enginType="民用工程"
  418. />
  419. <!-- <el-tabs type="border-card" >
  420. <el-tab-pane label="用户管理">用户管理</el-tab-pane>
  421. <el-tab-pane label="配置管理">配置管理</el-tab-pane>
  422. <el-tab-pane label="角色管理">角色管理</el-tab-pane>
  423. <el-tab-pane label="定时任务补偿">定时任务补偿</el-tab-pane>
  424. </el-tabs> -->
  425. </el-form>
  426. <div slot="footer" class="dialog-footer">
  427. <el-button :loading="buttonLoading" type="primary" @click="toNodeDetail">{{ enginNodeStatus }}</el-button>
  428. <el-button @click="cancel">取 消</el-button>
  429. </div>
  430. </el-dialog>
  431. <!-- 查看历史 -->
  432. <ConstructionDetails
  433. ref="ConstructionDetails"
  434. :currentCollapses="currentCollapses"
  435. :type="nodeDetailType"
  436. @updateNodeOption="updateNodeOption"
  437. @checkWorking="checkWorking"
  438. :status="status"
  439. :zEngineeringNodeBo="zEngineeringNodeBo"
  440. enginType="民用工程"
  441. />
  442. <!-- 批量审核 -->
  443. <el-dialog
  444. ref="checkingAllForm"
  445. title="批量审核"
  446. :visible.sync="checkingsVisible"
  447. class="checkingAll"
  448. @close="checkingAllFormClosed"
  449. >
  450. <el-form :model="checkingForm" :rules="checkingFormRules" ref="checkingFormAll">
  451. <el-form-item label="工程类型" prop="enginType">
  452. <el-select
  453. v-model="checkingForm.enginType"
  454. placeholder="请选择工程类型"
  455. @change="enginTypeHasChanged"
  456. >
  457. <el-option
  458. v-for="e in enginTypeOption"
  459. :key="e.value"
  460. :label="e.label"
  461. :value="e.value"
  462. ></el-option>
  463. </el-select>
  464. </el-form-item>
  465. <el-form-item label="工程分类" prop="enginClassification">
  466. <el-select
  467. v-model="checkingForm.enginClassification"
  468. placeholder="请选择工程分类"
  469. @change="currentCheckingAllEnginTypeChanged"
  470. >
  471. <el-option
  472. v-for="e in currentEnginTypeChangeOptions"
  473. :key="e.dictValue"
  474. :label="e.dictLabel"
  475. :value="e.dictValue"
  476. ></el-option>
  477. </el-select>
  478. </el-form-item>
  479. <el-form-item label="环节" label-width="78px" prop="type">
  480. <el-select
  481. v-model="checkingForm.type"
  482. placeholder="请选择工程分类"
  483. >
  484. <el-option
  485. v-for="e in checkingAllList"
  486. :key="e.dictValue"
  487. :label="e.dictLabel"
  488. :value="e.dictValue"
  489. ></el-option>
  490. </el-select>
  491. </el-form-item>
  492. <el-form-item prop="reviewTime" label="工程创建时间" style="margin-left: -5%;">
  493. <el-date-picker
  494. v-model="checkingForm.reviewTime"
  495. type="month"
  496. value-format="yyyy-MM"
  497. placeholder="选择月">
  498. </el-date-picker>
  499. </el-form-item>
  500. <el-form-item
  501. label-width="78px"
  502. label="审核状态"
  503. prop="reviewStatus"
  504. >
  505. <el-select v-model="checkingForm.reviewStatus" placeholder="请选择审核状态" label="审核状态" @change="validateCHanged">
  506. <el-option
  507. v-for="e in reviewStatusList"
  508. :key="e.label"
  509. :label="e.label"
  510. :value="e.value"
  511. ></el-option>
  512. </el-select>
  513. </el-form-item>
  514. <el-form-item
  515. label-width="78px"
  516. label="审核内容"
  517. prop="reviewContent"
  518. >
  519. <div class="block" style="display: inline-block; margin-right: 20px;">
  520. <el-input
  521. v-model="checkingForm.reviewContent"
  522. placeholder="请输入审核内容"
  523. type="textarea"
  524. style="width: 100%"/>
  525. </div>
  526. </el-form-item>
  527. </el-form>
  528. <span slot="footer" class="dialog-footer">
  529. <el-button @click="checkingsVisible = false">取 消</el-button>
  530. <el-button type="primary" @click=checkingAllSubmit>提 交</el-button>
  531. </span>
  532. </el-dialog>
  533. <!-- 顶管工程新增 -->
  534. <EngineePipe ref="enginPipe"/>
  535. </div>
  536. </template>
  537. <!--engineeringPipeJacking-->
  538. <script>
  539. import {
  540. listEngineeringCivil,
  541. getEngineeringCivil,
  542. delEngineeringCivil,
  543. addEngineeringCivil,
  544. updateEngineeringCivil
  545. } from "@/api/zdsz/engineeringCivil";
  546. import {
  547. addEnginee, // 新增工程
  548. getHousesList, // 获取当前房间集合
  549. putEngineeringCivil, // 民用工程修改
  550. viewEngineeringCivil, // 民用工程查看详情
  551. deleteEngineeringCivil, // 删除民用工程
  552. getDictList,
  553. viewEngineeringInfrastructureSource,
  554. viewEngineeringCivilSource,
  555. engineeringCivilAllReview,
  556. CivilReview
  557. } from "@/api/zdsz/enginee"
  558. import {getAreaList} from "@/api/zdsz/area";
  559. import {getBuildingList} from "@/api/zdsz/building";
  560. import {getUnits} from "@/api/zdsz/unit";
  561. import {getDicts} from "@/api/system/dict/data";
  562. import EnginNodeInfo from "@/components/EnginNodeInfo/index";
  563. import EngineePipe from '@/components/EngineePipe'
  564. import ConstructionDetails from "@/components/ConstructionDetails/index.vue";
  565. function formatDate(date) {
  566. const days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
  567. const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
  568. const day = days[date.getUTCDay()];
  569. const month = months[date.getUTCMonth()];
  570. const dateNum = String(date.getUTCDate()).padStart(2, '0');
  571. const hours = String(date.getUTCHours()).padStart(2, '0');
  572. const minutes = String(date.getUTCMinutes()).padStart(2, '0');
  573. const seconds = String(date.getUTCSeconds()).padStart(2, '0');
  574. const year = date.getUTCFullYear();
  575. return `${day} ${month} ${dateNum} ${hours}:${minutes}:${seconds} CST ${year}`;
  576. }
  577. export default {
  578. components: {
  579. ConstructionDetails,
  580. EnginNodeInfo,
  581. EngineePipe
  582. },
  583. name: "EngineeringCivil",
  584. dicts: ['pass_check',
  585. 'is_repair',
  586. 'engin_type',
  587. 'self_closing_valve_type',
  588. 'visit_type', 'district',
  589. 'new_built_indoor_engin',
  590. "old_renovation_indoor_engin",
  591. "old_renovation_courtyard",
  592. "old_renovation_overhead",
  593. "new_built_indoor_engin",
  594. "new_built_courtyard",
  595. "new_built_overhead",
  596. "engin_cycle"],
  597. data() {
  598. return {
  599. nodeDetailType: null,
  600. currentCollapses: [],
  601. enginId: undefined,
  602. checkingsVisible: false,
  603. updateOption: [],
  604. checkingFormRules:{
  605. enginType: [
  606. {required: true, message: "工程类型不能为空", trigger: ['change']}
  607. ],
  608. enginClassification: [
  609. {required: true, message: "工程分类不能为空", trigger: ['change']}
  610. ],
  611. type: [
  612. {required: true, message: "环节不能为空", trigger: ['change']}
  613. ],
  614. reviewTime: [
  615. {required: true, message: "工程创建时间不能为空", trigger: ['change']}
  616. ],
  617. reviewStatus: [
  618. {required: true, message: "审核状态不能为空", trigger: ['change']}
  619. ],
  620. reviewContent: [
  621. {required: true, message: "审核内容不能为空", trigger: ['change']}
  622. ],
  623. },
  624. listContain: [
  625. {
  626. name: '拆旧管',
  627. components: [
  628. [
  629. 'corrosionLevel', // 腐蚀等级
  630. ],
  631. 'constructTime', // 施工时间
  632. 'zEngiineeringPhotoBoList', // 照片
  633. ]
  634. },
  635. {
  636. name: '报警器切断阀',
  637. components: [
  638. [
  639. 'brand', // 品牌
  640. ],
  641. 'constructTime', // 施工时间
  642. 'zEngiineeringPhotoBoList', // 照片
  643. // 'remark', // 施工内容
  644. ]
  645. },
  646. {
  647. name: '放线',
  648. components: [
  649. [
  650. 'materialQuality', // 材质
  651. 'specifications', // 规格
  652. 'number', // 数量
  653. ],
  654. 'constructTime', // 施工时间
  655. 'zEngiineeringPhotoBoList', // 照片
  656. // 'remark', // 施工内容
  657. ]
  658. },
  659. {
  660. name: '挖沟',
  661. components: [
  662. [
  663. 'materialQuality', // 材质
  664. 'specifications', // 规格
  665. 'number', // 数量
  666. ],
  667. 'constructTime', // 施工时间
  668. 'zEngiineeringPhotoBoList', // 照片
  669. // 'remark', // 施工内容
  670. ]
  671. },
  672. {
  673. name: '焊接',
  674. components: [
  675. [
  676. 'materialQuality', // 材质
  677. 'specifications', // 规格
  678. 'number', // 数量
  679. ],
  680. 'constructTime', // 施工时间
  681. 'zEngiineeringPhotoBoList', // 照片
  682. // 'remark', // 施工内容
  683. ]
  684. },
  685. {
  686. name: '下沟',
  687. components: [
  688. [
  689. 'materialQuality', // 材质
  690. 'specifications', // 规格
  691. 'number', // 数量
  692. ],
  693. 'constructTime', // 施工时间
  694. 'zEngiineeringPhotoBoList', // 照片
  695. // 'remark', // 施工内容
  696. ]
  697. },
  698. {
  699. name: '回田',
  700. components: [
  701. [
  702. 'materialQuality', // 材质
  703. 'specifications', // 规格
  704. 'number', // 数量
  705. ],
  706. 'backfillTime', // 回填时间
  707. 'constructTime', // 施工时间
  708. 'zEngiineeringPhotoBoList', // 照片
  709. // 'remark', // 施工内容
  710. ]
  711. },
  712. {
  713. name: '打压',
  714. components: [
  715. [
  716. 'materialQuality', // 材质
  717. 'specifications', // 规格
  718. 'number', // 数量
  719. ],
  720. 'segmentedCompressionQualified', // 分段打压
  721. 'constructTime', // 施工时间
  722. 'zEngiineeringPhotoBoList', // 照片
  723. // 'remark', // 施工内容
  724. ]
  725. },
  726. {
  727. name: '除锈',
  728. components: [
  729. [
  730. 'materialQuality', // 材质
  731. 'specifications', // 规格
  732. 'number', // 数量
  733. ],
  734. 'constructTime', // 施工时间
  735. 'zEngiineeringPhotoBoList', // 照片
  736. // 'remark', // 施工内容
  737. ]
  738. },
  739. {
  740. name: '刷油',
  741. components: [
  742. [
  743. 'materialQuality', // 材质
  744. 'specifications', // 规格
  745. 'number', // 数量
  746. ],
  747. 'constructTime', // 施工时间
  748. 'zEngiineeringPhotoBoList', // 照片
  749. // 'remark', // 施工内容
  750. ]
  751. },
  752. {
  753. name: '打磨',
  754. components: [
  755. [
  756. 'materialQuality', // 材质
  757. 'specifications', // 规格
  758. 'number', // 数量
  759. ],
  760. 'constructTime', // 施工时间
  761. 'zEngiineeringPhotoBoList', // 照片
  762. // 'remark', // 施工内容
  763. ]
  764. },
  765. {
  766. name: '打孔',
  767. components: [
  768. [
  769. 'corrosionLevel', // 孔径/腐蚀等级
  770. ],
  771. 'constructTime', // 施工时间
  772. 'zEngiineeringPhotoBoList', // 照片
  773. ]
  774. },
  775. {
  776. name: '立杠',
  777. components: [
  778. [
  779. 'materialQuality', // 材质
  780. 'specifications', // 规格
  781. 'number', // 数量
  782. ],
  783. 'constructTime', // 施工时间
  784. 'zEngiineeringPhotoBoList', // 照片
  785. ]
  786. },
  787. {
  788. name: '挂表',
  789. components: [
  790. [
  791. 'brand', // 品牌
  792. ],
  793. 'constructTime', // 施工时间
  794. 'zEngiineeringPhotoBoList', // 照片
  795. // 'remark', // 施工内容
  796. ]
  797. },
  798. {
  799. name: '表后管',
  800. components: [
  801. [
  802. 'materialQuality', // 材质
  803. 'specifications', // 规格
  804. 'number', // 数量
  805. ],
  806. 'constructAccordingDrawings', // 是否按图纸施工
  807. 'constructTime', // 施工时间
  808. 'zEngiineeringPhotoBoList', // 照片
  809. ]
  810. },
  811. {
  812. name: '阀管',
  813. components: [
  814. [
  815. 'materialQuality', // 材质
  816. 'specifications', // 规格
  817. 'number', // 数量
  818. 'visitType', // 上门类型
  819. 'selfClosingValveType', // 自闭阀类型
  820. ],
  821. 'constructTime', // 施工时间
  822. 'zEngiineeringPhotoBoList', // 照片
  823. ]
  824. },
  825. ],
  826. currentCheckList: [],
  827. enginClassificationinfo: '',
  828. enginClassification: '',
  829. enginClassificationOption: [],
  830. enginTypeOption: [
  831. {
  832. value: 'old_renovation',
  833. label: '旧改'
  834. }, {
  835. value: 'new_built',
  836. label: '新建'
  837. },
  838. ],
  839. currentEnginTypeChangeOptions: [],
  840. currentEnginTypeChangeOptions1: [],
  841. // 按钮loading
  842. buttonLoading: false,
  843. // 遮罩层
  844. loading: true,
  845. // 选中数组
  846. ids: [],
  847. // 非单个禁用
  848. single: true,
  849. // 非多个禁用
  850. multiple: true,
  851. // 显示搜索条件
  852. showSearch: true,
  853. // 总条数
  854. total: 0,
  855. // 民用工程表格数据
  856. engineeringCivilList: [],
  857. // 弹出层标题
  858. title: "",
  859. // 是否显示弹出层
  860. open: false,
  861. // 查询参数
  862. queryParams: {
  863. district: undefined,
  864. areaId: undefined,
  865. buildingId: undefined,
  866. unitId: undefined,
  867. houseId: undefined,
  868. enginType: undefined,
  869. enginCycle: undefined,
  870. completionStatus: undefined,
  871. enginClassification: undefined,
  872. imgUrl: undefined,
  873. zEngineeringNodeBoList: {
  874. type: undefined,
  875. zEngineeringInfoBo: {
  876. constructAddre: undefined, // 施工地址
  877. constructPhone: undefined, // 施工人电话
  878. constructUser: undefined, // 施工人
  879. headName: undefined, // 负责人
  880. headPhone: undefined, // 负责人电话
  881. constructAccordingDrawings: undefined, // 是否按图纸施工
  882. segmentedCompressionQualified: undefined, // 分段打压是否合格
  883. selfClosingValveType: undefined, // 自闭阀类型
  884. visitType: undefined, // 上门类型
  885. backfillTime: undefined, // 回填时间
  886. constructTime: undefined, // 施工时间
  887. zEngiineeringPhotoBoList: undefined, // 图片列表
  888. zEngineeringMaterialBo: undefined,// 用料对象, //节点信息
  889. }
  890. }
  891. },
  892. queryParams1: {
  893. pageNum: 1,
  894. pageSize: 10,
  895. district: undefined,
  896. areaId: undefined,
  897. buildingId: undefined,
  898. unitId: undefined,
  899. houseId: undefined,
  900. enginType: undefined,
  901. enginClassification: undefined,
  902. enginCycle: undefined,
  903. completionStatus: undefined,
  904. imgUrl: undefined,
  905. },
  906. zEngineeringInfoBo: {
  907. constructAddre: '', // 施工地址
  908. constructPhone: '', // 施工人电话
  909. constructUser: '', // 施工人
  910. headName: '', // 负责人
  911. headPhone: '', // 负责人电话
  912. constructAccordingDrawings: '', // 是否按图纸施工
  913. segmentedCompressionQualified: '', // 分段打压是否合格
  914. selfClosingValveType: '', // 自闭阀类型
  915. visitType: '', // 上门类型
  916. backfillTime: '', // 回填时间
  917. constructTime: '', // 施工时间
  918. zEngiineeringPhotoBoList: [], // 图片列表
  919. zEngineeringMaterialBo: [],// 用料对象
  920. },
  921. nodeList: [],
  922. // 表单参数
  923. form: {},
  924. value: [],
  925. // 表单校验
  926. rules: {
  927. id: [
  928. {required: true, message: "主键不能为空", trigger: "blur"}
  929. ],
  930. district: [
  931. {required: true, message: "行政区不能为空", trigger: "change"}
  932. ],
  933. areaId: [
  934. {required: true, message: "小区不能为空", trigger: "change"}
  935. ],
  936. buildingId: [
  937. {required: true, message: "楼宇不能为空", trigger: "change"}
  938. ],
  939. unitId: [
  940. {required: true, message: "单元不能为空", trigger: "change"}
  941. ],
  942. houseId: [
  943. {required: true, message: "房间不能为空", trigger: "change"}
  944. ],
  945. enginType: [
  946. {required: true, message: "工程类型不能为空", trigger: "change"}
  947. ],
  948. enginClassification: [
  949. {required: true, message: "工程分类不能为空", trigger: "change"}
  950. ],
  951. enginCycle: [
  952. {required: true, message: "工程周期不能为空", trigger: "change"}
  953. ],
  954. completionStatus: [
  955. {required: true, message: "完工状态不能为空", trigger: "change"}
  956. ],
  957. imgUrl: [
  958. {required: true, message: "默认图片地址不能为空", trigger: "blur"}
  959. ],
  960. remark: [
  961. {required: true, message: "备注不能为空", trigger: "blur"}
  962. ],
  963. },
  964. areaList: [],
  965. buildingList: [],
  966. unitList: [],
  967. currentDistrict: null, // 当前行政区
  968. currentCommunity: null, // 当前小区
  969. currentBuilding: null, // 当前楼宇
  970. currentUnit: null, // 当前单元
  971. communityOptions: [],
  972. buildingOptions: [], // 楼栋集合
  973. unitOptions: [], // 单元集合
  974. houseOptions: [], // 房间集合
  975. enginClassification_list: [], // 室内节点,
  976. checkList: [],// 节点集合
  977. enginNodeStatus: null,
  978. updateParams: {},
  979. status: null,
  980. createTime: '', // 工程创建时间
  981. checkingForm: {
  982. reviewStatus: '', // 审核状态
  983. reviewContent: '', // 审核内容
  984. enginType: null,
  985. enginClassification: null,
  986. reviewTime: '',
  987. type: '',
  988. },
  989. checkingAllList: [],
  990. reviewStatusList: [
  991. {
  992. value: '1',
  993. label: '通过'
  994. },
  995. {
  996. value: '0',
  997. label: '不通过'
  998. }
  999. ],
  1000. zEngineeringNodeBo:{
  1001. },
  1002. currentEnginName: null,
  1003. };
  1004. },
  1005. created() {
  1006. this.getList();
  1007. },
  1008. mounted() {
  1009. },
  1010. computed: {
  1011. currentContain(e) {
  1012. console.log('当前contain', e)
  1013. }
  1014. },
  1015. methods: {
  1016. checkingAllFormClosed(){
  1017. this.$refs.checkingFormAll.resetFields()
  1018. },
  1019. validateCHanged(e){
  1020. this.reviewStatusList[e].label == '通过' ? this.checkingFormRules.reviewContent[0].required = true : this.checkingFormRules.reviewContent[0].required = false
  1021. },
  1022. checkingAllSubmit() {
  1023. this.$refs.checkingFormAll.validate(valid => {
  1024. if(valid){
  1025. // this.checkingForm.createTime = formatDate(this.checkingForm.createTime)
  1026. engineeringCivilAllReview(this.checkingForm).then(res => {
  1027. if (res.code == 200) {
  1028. this.$message({
  1029. message: '批量审核请求以提交后台,5-10分钟后均可成功。',
  1030. type: 'success'
  1031. });
  1032. this.checkingsVisible = false
  1033. this.checkingForm = {
  1034. reviewStatus: '', // 审核状态
  1035. reviewContent: '', // 审核内容
  1036. enginType: null,
  1037. enginClassification: null,
  1038. reviewTime: '',
  1039. type: '',
  1040. }
  1041. this.$refs.checkingFormAll.resetFields()
  1042. }
  1043. })
  1044. } else {
  1045. this.$message.error('请填写必填项!')
  1046. }
  1047. })
  1048. },
  1049. // 批量审核
  1050. handleCheckings() {
  1051. this.checkingsVisible = true
  1052. },
  1053. // 节点单项审核
  1054. checkWorking(checkingInfo) {
  1055. let params = checkingInfo
  1056. params.createTime = this.createTime
  1057. CivilReview(params).then(res => {
  1058. if (res.code == 200) {
  1059. this.$message({
  1060. message: '审核成功',
  1061. type: 'success'
  1062. });
  1063. setTimeout(() => {
  1064. this.viewNodeSource()
  1065. },1000)
  1066. }
  1067. })
  1068. },
  1069. // 修改施工信息
  1070. updateNodeOption(zEngineeringInfoBoList) {
  1071. delete this.updateParams.zEngineeringNodeBoList
  1072. this.updateParams.zEngineeringNodeBo.zEngineeringInfoBoList = zEngineeringInfoBoList
  1073. putEngineeringCivil(this.updateParams).then(res => {
  1074. console.log(res)
  1075. if (res.code == 200) {
  1076. this.$message({
  1077. message: '修改成功',
  1078. type: 'success'
  1079. });
  1080. this.$refs.ConstructionDetails.dialogVisible = false
  1081. this.updateParams = {}
  1082. }
  1083. })
  1084. },
  1085. addNodeInfo(e) {
  1086. this.nodeDetailType = '修改'
  1087. this.enginId = e.id
  1088. this.status = 'put'
  1089. let val = e.enginType + "_" + e.enginClassification
  1090. getDicts(val).then(res => {
  1091. let dict = []
  1092. for (let i = 0; i < res.data.length; i++) {
  1093. dict.push({
  1094. "label": res.data[i].dictLabel,
  1095. "value": res.data[i].dictValue,
  1096. })
  1097. }
  1098. this.$refs.ConstructionDetails.open(dict)
  1099. })
  1100. },
  1101. viewNodeSource(e = null) {
  1102. if(e){
  1103. this.currentEnginName = e
  1104. }
  1105. console.log(this.currentEnginName )
  1106. viewEngineeringCivilSource({
  1107. id: this.enginId,
  1108. type: e || this.currentEnginName
  1109. }).then(res => {
  1110. console.log('______', res)
  1111. this.createTime = res.data.createTime
  1112. try {
  1113. this.updateParams = res.data
  1114. this.currentCollapses = res.data.zEngineeringNodeBo.zEngineeringInfoBoList
  1115. this.$refs.ConstructionDetails.setEngineId(res.data.zEngineeringNodeBo.id || null)
  1116. } catch (error) {
  1117. this.currentCollapses = [];
  1118. }
  1119. console.log('折叠面板info', this.currentCollapses)
  1120. })
  1121. this.$forceUpdate()
  1122. },
  1123. // 查看历史
  1124. viewSource(e, type = null) {
  1125. this.enginId = e.id
  1126. let val = e.enginType + "_" + e.enginClassification
  1127. getDicts(val).then(res => {
  1128. let dict = []
  1129. for (let i = 0; i < res.data.length; i++) {
  1130. dict.push({
  1131. "label": res.data[i].dictLabel,
  1132. "value": res.data[i].dictValue,
  1133. })
  1134. }
  1135. this.zEngineeringNodeBo = e
  1136. this.$refs.ConstructionDetails.open(dict, _, type)
  1137. this.status = 'read-only'
  1138. })
  1139. },
  1140. // 新增顶管工程
  1141. addNewPipe(data) {
  1142. this.$refs.enginPipe.openDialog({
  1143. id: data.id,
  1144. type: '民用工程'
  1145. }, 'add', data)
  1146. },
  1147. // 新增物料
  1148. addMaterial(data) {
  1149. this.title = "添加用料";
  1150. this.enginNodeStatus = '添加用料'
  1151. this.loading = true;
  1152. this.reset();
  1153. const id = data.id || this.ids
  1154. getEngineeringCivil(id).then(res => {
  1155. this.loading = false;
  1156. let newData = res.data
  1157. // 手动调用行政区发生改变
  1158. this.districtHasChanged(newData.district)
  1159. this.communityHasChanged(newData.areaId)
  1160. this.buildingHasChanged(newData.buildingId, newData.areaId)
  1161. this.unitHasChanged(newData.unitId)
  1162. // 获取工程分类
  1163. this.enginTypeHasChanged(newData.enginType)
  1164. let val = newData.enginType + "_" + newData.enginClassification
  1165. this.currentCheckList = []
  1166. getDicts(val).then(res => {
  1167. this.checkList = res.data
  1168. })
  1169. this.queryParams = newData
  1170. console.log(this.queryParams.areaId)
  1171. // console.log('选中节点集合',this.currentCheckList)
  1172. // this.enginClassification = zEngineeringNodeBo.type
  1173. // newData.zEngineeringNodeBo = zEngineeringNodeBo
  1174. this.currentType = 'addMaterial'
  1175. this.open = true
  1176. })
  1177. },
  1178. currentEnginTypeChanged() {
  1179. this.currentCheckList = []
  1180. if (this.queryParams.enginType == undefined || this.queryParams.enginType == ''
  1181. || this.queryParams.enginClassification == undefined || this.queryParams.enginClassification == ''
  1182. )
  1183. return
  1184. let val = this.queryParams.enginType + "_" + this.queryParams.enginClassification
  1185. getDicts(val).then(res => {
  1186. this.checkList = res.data
  1187. })
  1188. },
  1189. currentCheckingAllEnginTypeChanged() {
  1190. this.checkingAllList = []
  1191. if (this.checkingForm.enginType == undefined || this.checkingForm.enginType == ''
  1192. || this.checkingForm.enginClassification == undefined || this.checkingForm.enginClassification == ''
  1193. )
  1194. return
  1195. let val = this.checkingForm.enginType + "_" + this.checkingForm.enginClassification
  1196. getDicts(val).then(res => {
  1197. this.checkingAllList = res.data
  1198. })
  1199. },
  1200. // 当前所选行政区发生改变 查询当前小区集合
  1201. districtHasChanged(district) {
  1202. this.queryParams.areaId = null
  1203. this.queryParams.buildingId = null
  1204. this.queryParams.unitId = null
  1205. this.communityOptions = [];
  1206. this.buildingOptions = [];
  1207. this.unitOptions=[];
  1208. this.houseOptions=[];
  1209. getAreaList({district}).then(res => {
  1210. this.communityOptions = res.data
  1211. })
  1212. },
  1213. // 当前所选小区发生改变 查询当前楼栋集合
  1214. communityHasChanged(areaId) {
  1215. this.queryParams.buildingId = null
  1216. this.queryParams.unitId = null
  1217. this.buildingOptions = [];
  1218. this.unitOptions=[];
  1219. this.houseOptions=[];
  1220. getBuildingList({areaId}).then(res => {
  1221. this.buildingOptions = res.data
  1222. })
  1223. },
  1224. buildingHasChanged(buildingId, areaId) {
  1225. this.unitOptions=[];
  1226. this.houseOptions=[];
  1227. this.queryParams.unitId = null
  1228. getUnits(buildingId).then(res => {
  1229. this.unitOptions = res.data
  1230. })
  1231. },
  1232. unitHasChanged(unitId) {
  1233. this.houseOptions=[];
  1234. getHousesList({unitId}).then(res => {
  1235. console.log(res)
  1236. this.houseOptions = res.data
  1237. })
  1238. },
  1239. enginTypeHasChangeds(enginType = null) {
  1240. if (this.queryParams1.enginType == undefined || this.queryParams1.enginType == null || this.queryParams1.enginType == '')
  1241. return
  1242. this.currentCheckList = []
  1243. this.queryParams1.enginClassification = ''
  1244. this.currentEnginTypeChangeOptions1 = []
  1245. getDicts(enginType || this.queryParams1.enginType).then(res => {
  1246. this.currentEnginTypeChangeOptions1 = res.data
  1247. })
  1248. },
  1249. enginTypeHasChanged(enginType = null) {
  1250. this.currentCheckList = []
  1251. this.queryParams.enginClassification = ''
  1252. this.currentEnginTypeChangeOptions = []
  1253. getDicts(enginType || this.queryParams.enginType).then(res => {
  1254. this.currentEnginTypeChangeOptions = res.data
  1255. })
  1256. },
  1257. onClose() {
  1258. console.log(this.currentCheckList)
  1259. this.currentCheckList = []
  1260. this.checkList = []
  1261. this.reset()
  1262. },
  1263. closeToSucceed() {
  1264. this.open = false;
  1265. },
  1266. getAreaList(district) {
  1267. if (district === undefined || district == null || district === '')
  1268. return
  1269. getAreaList({district: district}).then(res => this.areaList = res.data)
  1270. },
  1271. getBuildingList1(areaId) {
  1272. if (areaId === undefined || areaId == null || areaId === '')
  1273. return
  1274. getBuildingList({areaId: areaId}).then(res => this.buildingList = res.data)
  1275. },
  1276. getUnitList1(buildingId) {
  1277. if (buildingId === undefined || buildingId == null || buildingId === '')
  1278. return
  1279. getUnits(buildingId).then(res => this.unitList = res.data)
  1280. },
  1281. /** 查询民用工程列表 */
  1282. getList() {
  1283. this.loading = true;
  1284. listEngineeringCivil(this.queryParams1).then(response => {
  1285. this.engineeringCivilList = response.rows;
  1286. this.total = response.total;
  1287. this.loading = false;
  1288. });
  1289. },
  1290. // 取消按钮
  1291. cancel() {
  1292. this.open = false;
  1293. this.reset();
  1294. },
  1295. // 表单重置
  1296. reset() {
  1297. this.form = {
  1298. id: undefined,
  1299. district: undefined,
  1300. areaId: undefined,
  1301. buildingId: undefined,
  1302. unitId: undefined,
  1303. houseId: undefined,
  1304. enginType: undefined,
  1305. enginClassification: undefined,
  1306. enginCycle: undefined,
  1307. completionStatus: undefined,
  1308. version: undefined,
  1309. imgUrl: undefined,
  1310. // remark: undefined,
  1311. delFlag: undefined,
  1312. createBy: undefined,
  1313. createTime: undefined,
  1314. updateBy: undefined,
  1315. updateTime: undefined
  1316. };
  1317. this.queryParams = {
  1318. district: undefined,
  1319. areaId: undefined,
  1320. buildingId: undefined,
  1321. unitId: undefined,
  1322. houseId: undefined,
  1323. enginType: undefined,
  1324. enginClassification: undefined,
  1325. enginCycle: undefined,
  1326. completionStatus: undefined,
  1327. imgUrl: undefined,
  1328. // zEngineeringNodeBo: {
  1329. // type: undefined,
  1330. // zEngineeringInfoBo: {
  1331. // constructAddre: undefined, // 施工地址
  1332. // constructPhone: undefined, // 施工人电话
  1333. // constructUser: undefined, // 施工人
  1334. // headName: undefined, // 负责人
  1335. // headPhone: undefined, // 负责人电话
  1336. // constructAccordingDrawings: undefined, // 是否按图纸施工
  1337. // segmentedCompressionQualified: undefined, // 分段打压是否合格
  1338. // selfClosingValveType: undefined, // 自闭阀类型
  1339. // visitType: undefined, // 上门类型
  1340. // backfillTime: undefined, // 回填时间
  1341. // constructTime: undefined, // 施工时间
  1342. // zEngiineeringPhotoBoList: undefined, // 图片列表
  1343. // zEngineeringMaterialBo: undefined,// 用料对象, //节点信息
  1344. // }
  1345. // },
  1346. }
  1347. this.enginClassification = null
  1348. this.resetForm("form");
  1349. },
  1350. /** 搜索按钮操作 */
  1351. handleQuery() {
  1352. this.queryParams1.pageNum = 1;
  1353. this.getList();
  1354. },
  1355. /** 重置按钮操作 */
  1356. resetQuery() {
  1357. this.resetForm("queryForm");
  1358. this.areaList = []
  1359. this.buildingList = []
  1360. this.unitList = []
  1361. this.currentEnginTypeChangeOptions1 = []
  1362. this.handleQuery();
  1363. },
  1364. // 多选框选中数据
  1365. handleSelectionChange(selection) {
  1366. this.ids = selection.map(item => item.id)
  1367. this.single = selection.length !== 1
  1368. this.multiple = !selection.length
  1369. },
  1370. // 新增顶管工程
  1371. // addNewPipe(data){
  1372. // this.$refs.enginPipe.openDialog({
  1373. // id:data.id
  1374. // },'add')
  1375. // },
  1376. nodeCancel() {
  1377. this.nodeDetailVisible = false
  1378. },
  1379. toNodeDetail() {
  1380. this.$refs.form.validate(valid => {
  1381. if(valid){
  1382. let nodeCollection = []
  1383. // 收集节点信息
  1384. this.currentCheckList.forEach((e, idx) => {
  1385. let nodeItem = this.$refs['EnginNodeInfo' + idx][0].infoCollection()
  1386. nodeCollection.push(nodeItem)
  1387. setTimeout(() =>{
  1388. console.log('nodeCollection:', nodeItem)
  1389. console.log('nodeCollection:', this.$refs['EnginNodeInfo' + idx][0])
  1390. },2000)
  1391. })
  1392. this.queryParams.zEngineeringNodeBoList = nodeCollection
  1393. if (this.enginNodeStatus == '修改') {
  1394. putEngineeringCivil(this.queryParams).then(res => {
  1395. if (res.code == 200) {
  1396. this.$message({
  1397. message: '修改成功',
  1398. type: 'success'
  1399. });
  1400. this.open = false
  1401. console.log('选中节点集合', this.currentCheckList)
  1402. this.currentCheckList = []
  1403. this.getList()
  1404. // this.$emit('closeToSucceed')
  1405. }
  1406. })
  1407. } else if (this.enginNodeStatus == '添加用料') {
  1408. addEngineeringCivil(this.queryParams).then(res => {
  1409. if (res.code == 200) {
  1410. this.$message({
  1411. message: '添加成功',
  1412. type: 'success'
  1413. });
  1414. this.open = false
  1415. console.log('选中节点集合', this.currentCheckList)
  1416. this.currentCheckList = []
  1417. this.getList()
  1418. // this.$emit('closeToSucceed')
  1419. }
  1420. })
  1421. } else if (this.enginNodeStatus == '添加用料') {
  1422. addEngineeringCivil(this.queryParams).then(res => {
  1423. if (res.code == 200) {
  1424. this.$message({
  1425. message: '添加成功',
  1426. type: 'success'
  1427. });
  1428. this.open = false
  1429. console.log('选中节点集合', this.currentCheckList)
  1430. this.currentCheckList = []
  1431. this.getList();
  1432. // this.$emit('closeToSucceed')
  1433. }
  1434. })
  1435. } else {
  1436. addEngineeringCivil(this.queryParams).then(res => {
  1437. if (res.code == 200) {
  1438. this.$message({
  1439. message: '新增成功',
  1440. type: 'success'
  1441. });
  1442. this.open = false
  1443. console.log('选中节点集合', this.currentCheckList)
  1444. this.currentCheckList = []
  1445. this.getList();
  1446. // this.$emit('closeToSucceed')
  1447. }
  1448. })
  1449. }
  1450. } else {
  1451. // this.$message.error(`请完善信息!`);
  1452. }
  1453. })
  1454. return
  1455. getDictList({enginType: ['new_built', 'old_renovation']}).then(res => {
  1456. this.nodeList = res.data
  1457. console.log('跳到详情前的queryParams', this.queryParams)
  1458. console.log('跳到详情前的节点集合', this.nodeList)
  1459. if (this.currentType == 'put') {
  1460. this.$refs.childNode.open(this.queryParams, 16, this.nodeList)
  1461. this.currentType = null
  1462. return
  1463. }
  1464. // 加工 enginClassification 工程节点
  1465. // const parts = this.value[1].split('_');
  1466. // let result = parts.slice(2).join('_');
  1467. // console.log(result)
  1468. // this.queryParams.zEngineeringNodeBo.type = this.enginClassification
  1469. // this.queryParams.enginClassification = result
  1470. // console.log(this.queryParams)
  1471. console.log('新增queryparams传值', this.queryParams)
  1472. this.$refs.childNode.open(this.queryParams, 0, this.nodeList)
  1473. return
  1474. this.$refs['form'].validate(e => {
  1475. if (e) {
  1476. this.nodeDetailVisible = true
  1477. }
  1478. })
  1479. })
  1480. },
  1481. /** 新增按钮操作 */
  1482. handleAdd() {
  1483. this.enginNodeStatus = '新增'
  1484. this.reset();
  1485. this.open = true;
  1486. this.title = "添加民用工程";
  1487. },
  1488. /** 修改按钮操作 */
  1489. handleUpdate(row) {
  1490. let that = this
  1491. this.enginNodeStatus = '修改'
  1492. this.loading = true;
  1493. this.reset();
  1494. const id = row.id || this.ids
  1495. getEngineeringCivil(id).then(res => {
  1496. that.loading = false;
  1497. // let newData = res.data
  1498. // // 手动调用行政区发生改变
  1499. let newData = res.data
  1500. that.districtHasChanged(newData.district)
  1501. that.communityHasChanged(newData.areaId)
  1502. that.buildingHasChanged(newData.buildingId, newData.areaId)
  1503. that.unitHasChanged(newData.unitId)
  1504. that.queryParams = res.data
  1505. let va = that.queryParams.enginClassification
  1506. that.enginTypeHasChanged(that.queryParams.enginType)
  1507. that.queryParams.enginClassification = va
  1508. that.open = true
  1509. that.title = "修改民用工程";
  1510. })
  1511. },
  1512. /** 提交按钮 */
  1513. submitForm() {
  1514. this.$refs["form"].validate(valid => {
  1515. if (valid) {
  1516. this.buttonLoading = true;
  1517. if (this.form.id != null) {
  1518. updateEngineeringCivil(this.form).then(response => {
  1519. this.$modal.msgSuccess("修改成功");
  1520. this.open = false;
  1521. debugger
  1522. this.getList();
  1523. }).finally(() => {
  1524. this.buttonLoading = false;
  1525. });
  1526. } else {
  1527. addEngineeringCivil(this.form).then(response => {
  1528. this.$modal.msgSuccess("新增成功");
  1529. this.open = false;
  1530. this.getList();
  1531. }).finally(() => {
  1532. this.buttonLoading = false;
  1533. });
  1534. }
  1535. }
  1536. });
  1537. },
  1538. /** 删除按钮操作 */
  1539. handleDelete(row) {
  1540. console.log(row)
  1541. const ids = row.id || this.ids;
  1542. this.$modal.confirm('是否确认删除所选数据项?').then(() => {
  1543. this.loading = true;
  1544. return delEngineeringCivil(ids);
  1545. }).then(() => {
  1546. this.loading = false;
  1547. this.getList();
  1548. this.$modal.msgSuccess("删除成功");
  1549. }).catch(() => {
  1550. }).finally(() => {
  1551. this.loading = false;
  1552. });
  1553. },
  1554. /** 导出按钮操作 */
  1555. handleExport() {
  1556. this.download('zdsz/engineeringCivil/export', {
  1557. ...this.queryParams1
  1558. }, `engineeringCivil_${new Date().getTime()}.xlsx`)
  1559. }
  1560. }
  1561. };
  1562. </script>
  1563. <style lang="scss" scoped>
  1564. ::v-deep .addDialog {
  1565. width: 60%;
  1566. // height: 85%;
  1567. max-height: 85%;
  1568. overflow: hidden;
  1569. overflow-y: scroll;
  1570. }
  1571. ::v-deep .appendElDialog {
  1572. overflow: hidden;
  1573. overflow-y: scroll;
  1574. width: 70%;
  1575. height: 80%;
  1576. .el-dialog__body {
  1577. height: 85%;
  1578. }
  1579. .el-form-item {
  1580. margin-bottom: 22px;
  1581. width: 44%;
  1582. display: inline-block;
  1583. }
  1584. .el-form-item:nth-child(2n+2) {
  1585. margin-left: 5%;
  1586. }
  1587. .el-form-item:not(:nth-child(1):nth-child(2)) {
  1588. margin-top: 0.5%;
  1589. }
  1590. .remark_input {
  1591. .el-textarea__inner {
  1592. width: 238%;
  1593. height: 190px;
  1594. }
  1595. }
  1596. }
  1597. ::v-deep .appendElNodeDialog {
  1598. // width: 70%;
  1599. height: 80%;
  1600. .el-dialog__body {
  1601. height: 85%;
  1602. }
  1603. .el-form-item {
  1604. margin-bottom: 22px;
  1605. width: 44%;
  1606. display: inline-block;
  1607. }
  1608. .el-form-item:nth-child(2n+2) {
  1609. margin-left: 5%;
  1610. }
  1611. .el-form-item:not(:nth-child(1):nth-child(2)) {
  1612. margin-top: 0.5%;
  1613. }
  1614. }
  1615. ::v-deep .checkingAll {
  1616. .el-dialog {
  1617. width: 40%;
  1618. height: 70%;
  1619. }
  1620. .el-dialog__body {
  1621. padding-left: 28%;
  1622. }
  1623. .el-form div:not(:nth-child(1)) {
  1624. margin-top: 1%;
  1625. }
  1626. .el-textarea__inner {
  1627. width: 360px;
  1628. height: 115px;
  1629. }
  1630. }
  1631. </style>