index.vue 57 KB

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