index.vue 53 KB

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