index.vue 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436
  1. <!--
  2. *@description: 工业工程
  3. *@author: yh Fu
  4. *@date: 2024-01-02 15:51:03
  5. *@version: V1.0.5
  6. -->
  7. <template>
  8. <div class="app-container">
  9. <el-form :model="searchParams" ref="searchParams" size="small" :inline="true" v-show="showSearch"
  10. label-width="110px">
  11. <el-form-item label="工程名称" prop="enginName">
  12. <el-input v-model="searchParams.enginName" placeholder="请输入工程名称" maxlength="20"></el-input>
  13. </el-form-item>
  14. <el-form-item label="工程分类" prop="enginType">
  15. <el-select v-model="searchParams.enginType" placeholder="请选择工程类型" clearable>
  16. <el-option
  17. v-for="dict in EngineepipeType"
  18. :key="dict.dictValue"
  19. :label="dict.dictLabel"
  20. :value="dict.dictValue"
  21. />
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="工程类型" prop="enginClassification">
  25. <el-select v-model="searchParams.enginClassification" placeholder="请选择工程分类" clearable>
  26. <el-option
  27. v-for="dict in enginClassificationList"
  28. :key="dict.dictValue"
  29. :label="dict.dictLabel"
  30. :value="dict.dictValue"
  31. />
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  36. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  37. </el-form-item>
  38. </el-form>
  39. <el-row :gutter="10" class="mb8">
  40. <el-col :span="1.5">
  41. <el-button
  42. type="primary"
  43. plain
  44. icon="el-icon-plus"
  45. size="mini"
  46. @click="handleAdd"
  47. v-hasPermi="['zdsz:engineeringgy:add']"
  48. >新增
  49. </el-button>
  50. </el-col>
  51. <el-col :span="1.5">
  52. <el-button
  53. type="success"
  54. plain
  55. icon="el-icon-edit"
  56. size="mini"
  57. :disabled="single"
  58. @click="handleUpdate"
  59. v-hasPermi="['zdsz:engineeringgy:edit']"
  60. >修改
  61. </el-button>
  62. </el-col>
  63. <el-col :span="1.5">
  64. <el-button
  65. type="danger"
  66. plain
  67. icon="el-icon-delete"
  68. size="mini"
  69. :disabled="multiple"
  70. @click="handleDelete"
  71. v-hasPermi="['zdsz:engineeringgy:remove']"
  72. >删除
  73. </el-button>
  74. </el-col>
  75. <el-col :span="1.5">
  76. <el-button
  77. type="warning"
  78. plain
  79. icon="el-icon-download"
  80. size="mini"
  81. @click="handleExport"
  82. v-hasPermi="['demo:demo:export']"
  83. >导出</el-button>
  84. </el-col>
  85. <el-col :span="2.5" style="float: right;">
  86. <span
  87. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #807e7a;"></span>无数据
  88. <span
  89. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #e0c794;"></span>待审核
  90. <span
  91. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #30B08F;"></span>通过
  92. <span
  93. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #C03639;"></span>不通过
  94. </el-col>
  95. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  96. </el-row>
  97. <el-table v-loading="loading" :data="comprehensiveList" @selection-change="handleSelectionChange">
  98. <el-table-column type="selection" width="55" align="center"/>
  99. <el-table-column label="工程名称" align="center" prop="enginName"/>
  100. <el-table-column label="工程类型" align="center" prop="enginType"/>
  101. <el-table-column label="工程分类" align="center" prop="enginClassification"/>
  102. <el-table-column label="现场负责人" align="center" prop="sceneHead"/>
  103. <el-table-column label="设计负责人" align="center" prop="designHead"/>
  104. <el-table-column label="监理负责人" align="center" prop="supervisionHead"/>
  105. <el-table-column label="建项时间" align="center" prop="createTime"/>
  106. <el-table-column label="进场时间" align="center" prop="startTime"/>
  107. <el-table-column label="竣工时间" align="center" prop="beCompletedTime"/>
  108. <el-table-column label="用料比" align="center" prop="enginClassification" width="300px">
  109. <template slot-scope="scope">
  110. <div>
  111. <span>PE{实际:{{scope.row.pesj}},预计:{{scope.row.pePreset}},占比:{{scope.row.pePreset == 0||scope.row.pePreset == null ? 100:(scope.row.pesj / scope.row.pePreset * 100).toFixed(1)}}%}</span><br>
  112. <span>钢材{实际:{{scope.row.gsj}},预计:{{scope.row.gcPreset}},占比:{{scope.row.gcPreset == 0||scope.row.pePreset == null ? 100:(scope.row.gsj / scope.row.gcPreset * 100).toFixed(1)}}%}</span>
  113. </div>
  114. </template>
  115. </el-table-column>
  116. <el-table-column label="审核状态" align="center" prop="nodeReViewStateList" width="250">
  117. <template slot-scope="scope">
  118. <div style="text-align:center">
  119. <el-popover
  120. v-for="item in scope.row.nodeReViewStateList"
  121. placement="top-start"
  122. trigger="hover"
  123. :content="item.Type">
  124. <span slot="reference" v-if="item.state == '-1' && item.content=='无数据'"
  125. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #807e7a;"></span>
  126. <span slot="reference" v-else-if="item.state == '0' && item.content=='暂未审核'"
  127. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #e0c794;"></span>
  128. <span slot="reference" v-else-if="item.state == '1' "
  129. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #30B08F;"></span>
  130. <span slot="reference" v-else
  131. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #C03639;"></span>
  132. </el-popover>
  133. </div>
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  137. <template v-slot="scope">
  138. <el-button
  139. size="mini"
  140. type="text"
  141. icon="el-icon-edit"
  142. @click="handleUpdate(scope.row)"
  143. v-hasPermi="['zdsz:engineeringgy:edit']"
  144. >修改
  145. </el-button>
  146. <el-button
  147. type="text"
  148. icon="el-icon-edit"
  149. size="mini"
  150. v-hasPermi="['zdsz:engineeringgy:edit']"
  151. @click="updateviewSource(scope.row)"
  152. >修改施工信息
  153. </el-button>
  154. <el-button type="text"
  155. icon="el-icon-edit"
  156. size="mini"
  157. v-hasPermi="['zdsz:engineeringgy:add']"
  158. @click="addzEngineeringMaterBo(scope.row)"
  159. >添加用料
  160. </el-button>
  161. <el-button
  162. size="mini"
  163. type="text"
  164. icon="el-icon-edit"
  165. v-hasPermi="['zdsz:engineeringPipeJacking:add']"
  166. @click="addNewPipe(scope.row)"
  167. >新增顶管工程
  168. </el-button>
  169. <el-button
  170. size="mini"
  171. type="text"
  172. icon="el-icon-circle-check"
  173. @click="viewSource(scope.row,'check')"
  174. v-hasPermi="['zdsz:engineeringgy:review']"
  175. >审核
  176. </el-button>
  177. <el-button
  178. type="text"
  179. icon="el-icon-edit"
  180. size="mini"
  181. v-hasPermi="['zdsz:engineeringgy:query']"
  182. @click="viewSource(scope.row)"
  183. >历史施工
  184. </el-button>
  185. <el-button
  186. type="text"
  187. icon="el-icon-download"
  188. size="mini"
  189. @click="downloadZip(scope.row.enginName)"
  190. >下载图片
  191. </el-button>
  192. <el-button
  193. size="mini"
  194. type="text"
  195. icon="el-icon-delete"
  196. @click="handleDelete(scope.row)"
  197. v-hasPermi="['zdsz:engineeringgy:remove']"
  198. >删除
  199. </el-button>
  200. </template>
  201. </el-table-column>
  202. </el-table>
  203. <pagination
  204. v-show="total>0"
  205. :total="total"
  206. :page.sync="searchParams.pageNum"
  207. :limit.sync="searchParams.pageSize"
  208. @pagination="getList"
  209. />
  210. <!-- 顶管工程新增 -->
  211. <EngineePipe ref="enginPipe"/>
  212. <!-- 修改工业工程对话框 -->
  213. <el-dialog :title="title" :visible.sync="open" append-to-body customClass="appendElDialog">
  214. <el-form ref="form" :model="form" :rules="rules" label-width="110px">
  215. <el-form-item label="工程名称" prop="enginName" v-hasPermi="['zdsz:engineeringgy:add']">
  216. <el-input v-model="form.enginName" placeholder="请填写工程名称" maxlength="60"
  217. :readonly="title == '添加用料' "></el-input>
  218. </el-form-item>
  219. <el-form-item label="建筑单位" prop="constructUnit" v-hasPermi="['zdsz:engineeringgy:add']">
  220. <el-input v-model="form.constructUnit" placeholder="请填写建筑单位" maxlength="50"
  221. :readonly="title == '添加用料' "></el-input>
  222. </el-form-item>
  223. <el-form-item label="项目负责人" prop="projectHead">
  224. <el-select
  225. v-model="form.projectHead"
  226. placeholder="请选择项目负责人"
  227. clearable
  228. @change="getSceneHeadList"
  229. >
  230. <el-option
  231. v-for="dict in dict.type.project_head"
  232. :key="dict.value"
  233. :label="dict.label"
  234. :value="dict.value+','+dict.raw.remark"
  235. />
  236. </el-select>
  237. </el-form-item>
  238. <el-form-item label="现场负责人" prop="sceneHead">
  239. <el-select
  240. v-model="form.sceneHead"
  241. placeholder="请选择现场负责人"
  242. clearable
  243. >
  244. <el-option
  245. v-for="dict in sceneHead"
  246. :label="dict"
  247. :value="dict"
  248. />
  249. </el-select>
  250. </el-form-item>
  251. <el-form-item label="设计单位" prop="designUnit">
  252. <el-select
  253. v-model="form.designUnit"
  254. placeholder="请选择设计单位"
  255. clearable
  256. @change="getDesignUnitList"
  257. >
  258. <el-option
  259. v-for="dict in dict.type.design_unit"
  260. :key="dict.value"
  261. :label="dict.label"
  262. :value="dict.value+','+dict.raw.remark"
  263. />
  264. </el-select>
  265. </el-form-item>
  266. <el-form-item label="设计负责人" prop="designHead">
  267. <el-select
  268. v-model="form.designHead"
  269. placeholder="请选择设计负责人"
  270. clearable
  271. >
  272. <el-option
  273. v-for="dict in designHead"
  274. :label="dict"
  275. :value="dict"
  276. />
  277. </el-select>
  278. </el-form-item>
  279. <el-form-item label="设计联系方式" prop="designPhone">
  280. <el-input v-model="form.designPhone" placeholder="请填写设计联系方式" maxlength="13"
  281. :readonly="title == '添加用料' "></el-input>
  282. </el-form-item>
  283. <el-form-item label="监理单位" prop="supervisionUnit">
  284. <el-select
  285. v-model="form.supervisionUnit"
  286. placeholder="请选择监理单位"
  287. clearable
  288. @change="getSupervisionUnitList"
  289. >
  290. <el-option
  291. v-for="dict in dict.type.supervision_unit"
  292. :key="dict.value"
  293. :label="dict.label"
  294. :value="dict.value+','+dict.raw.remark"
  295. />
  296. </el-select>
  297. </el-form-item>
  298. <el-form-item label="监理负责人" prop="supervisionHead">
  299. <el-select
  300. v-model="form.supervisionHead"
  301. placeholder="请选择监理负责人"
  302. clearable
  303. >
  304. <el-option
  305. v-for="dict in supervisionHead"
  306. :label="dict"
  307. :value="dict"
  308. />
  309. </el-select>
  310. </el-form-item>
  311. <el-form-item label="监理联系电话" prop="supervisionPhone">
  312. <el-input v-model="form.supervisionPhone" placeholder="请填写监理联系电话" maxlength="13"
  313. :readonly="title == '添加用料' "></el-input>
  314. </el-form-item>
  315. <el-form-item label="PE管材预设" prop="pePreset">
  316. <el-input v-model="form.pePreset" placeholder="请填写PE管材预设" maxlength="20" oninput="value=value.match(/\d+(\.\d{0,1})?/) ? value.match(/\d+(\.\d{0,1})?/)[0] : ''"
  317. :readonly="title == '添加用料' "></el-input>
  318. </el-form-item>
  319. <el-form-item label="钢材预设" prop="gcPreset">
  320. <el-input v-model="form.gcPreset" placeholder="请填写钢材预设" maxlength="13" oninput="value=value.match(/\d+(\.\d{0,1})?/) ? value.match(/\d+(\.\d{0,1})?/)[0] : ''"
  321. :readonly="title == '添加用料' "></el-input>
  322. </el-form-item>
  323. <el-form-item label="工程分类" prop="enginType" v-hasPermi="['zdsz:engineeringgy:add']">
  324. <el-select v-model="form.enginType" placeholder="请选择工程分类" style="width: 100%"
  325. :disabled="title == '添加用料' ">
  326. <el-option
  327. v-for="e in EngineepipeType"
  328. :key="e.dictValue"
  329. :label="e.dictLabel"
  330. :value="e.dictValue"
  331. ></el-option>
  332. </el-select>
  333. </el-form-item>
  334. <el-form-item label="工程类型" prop="enginClassification" v-hasPermi="['zdsz:engineeringgy:add']">
  335. <el-select v-model="form.enginClassification" placeholder="请选择工程类型" style="width: 100%" @change="clickByType"
  336. :disabled="title == '添加用料' ">
  337. <el-option
  338. v-for="e in enginClassificationList"
  339. :key="e.dictValue"
  340. :label="e.dictLabel"
  341. :value="e.dictValue"
  342. ></el-option>
  343. </el-select>
  344. </el-form-item>
  345. <el-row :gutter="20">
  346. <el-col :span="24">
  347. <el-form-item label="附件" v-if="form.id" style="width: 100%">
  348. <ObsFileUpload ref="obsFileUpload" :file-size="100"
  349. :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg','mp4']"
  350. :limit="9999"
  351. :value="form.pics"
  352. :disabled="title == '添加用料' "
  353. @input="filesUpload"
  354. ></ObsFileUpload>
  355. </el-form-item>
  356. <el-form-item label="附件" v-else style="width: 100%">
  357. <ObsFileUpload ref="obsFileUpload" :file-size="100"
  358. :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg','mp4']"
  359. :limit="9999"
  360. :disabled="title == '添加用料' "
  361. :value="form.files"
  362. @input="filesUpload"
  363. ></ObsFileUpload>
  364. </el-form-item>
  365. </el-col>
  366. </el-row>
  367. <el-row v-if="title=='添加用料'">
  368. <el-col :span="24">
  369. <el-form-item label="环节">
  370. <el-checkbox-group v-model="currentCheckList" style="display: flex">
  371. <el-checkbox
  372. :label="item.dictValue"
  373. v-for="item in nodeList"
  374. :key="item"
  375. :disabled=enginNodeStatusExecuted(item)
  376. ></el-checkbox>
  377. </el-checkbox-group>
  378. </el-form-item>
  379. </el-col>
  380. </el-row>
  381. <EnginNodeInfo
  382. v-if="title=='添加用料'"
  383. v-for="(e,idx) in currentCheckList"
  384. :key="idx"
  385. :name="e"
  386. :ref="'EnginNodeInfo'+idx"
  387. :flag="flag"
  388. :types="currentCheckList"
  389. :currentContain="currentCheckList"
  390. :enginType="'工业工程'"
  391. :enginSort="form.enginType"
  392. />
  393. <div style="width: 25%; float: right" v-if="title=='添加用料'">
  394. <el-button :loading="buttonLoading" type="primary" @click="toNodeDetail">提交</el-button>
  395. </div>
  396. <div style="width: 25%; float: right" v-else>
  397. <el-button :loading="buttonLoading" type="primary" @click="submitForm">提交</el-button>
  398. <el-button @click="cancel">取 消</el-button>
  399. </div>
  400. </el-form>
  401. </el-dialog>
  402. <!-- 添加工业工程对话框 -->
  403. <el-dialog :title="title" :visible.sync="openadd" append-to-body customClass="appendElDialog">
  404. <el-form ref="form" :model="form" :rules="rules" label-width="110px">
  405. <el-form-item label="工程名称" prop="enginName">
  406. <el-input v-model="form.enginName" placeholder="请填写工程名称" maxlength="60"
  407. :readonly="title == '添加用料' "></el-input>
  408. </el-form-item>
  409. <el-form-item label="建筑单位" prop="constructUnit">
  410. <el-input v-model="form.constructUnit" placeholder="请填写建筑单位" maxlength="50"
  411. :readonly="title == '添加用料' "></el-input>
  412. </el-form-item>
  413. <el-form-item label="项目负责人" prop="projectHead">
  414. <el-select
  415. v-model="form.projectHead"
  416. placeholder="请选择项目负责人"
  417. clearable
  418. @change="getSceneHeadList"
  419. >
  420. <el-option
  421. v-for="dict in dict.type.project_head"
  422. :key="dict.value"
  423. :label="dict.label"
  424. :value="dict.value+','+dict.raw.remark"
  425. />
  426. </el-select>
  427. </el-form-item>
  428. <el-form-item label="现场负责人" prop="sceneHead">
  429. <el-select
  430. v-model="form.sceneHead"
  431. placeholder="请选择现场负责人"
  432. clearable
  433. >
  434. <el-option
  435. v-for="dict in sceneHead"
  436. :label="dict"
  437. :value="dict"
  438. />
  439. </el-select>
  440. </el-form-item>
  441. <el-form-item label="设计单位" prop="designUnit">
  442. <el-select
  443. v-model="form.designUnit"
  444. placeholder="请选择设计单位"
  445. clearable
  446. @change="getDesignUnitList"
  447. >
  448. <el-option
  449. v-for="dict in dict.type.design_unit"
  450. :key="dict.value"
  451. :label="dict.label"
  452. :value="dict.value+','+dict.raw.remark"
  453. />
  454. </el-select>
  455. </el-form-item>
  456. <el-form-item label="设计负责人" prop="designHead">
  457. <el-select
  458. v-model="form.designHead"
  459. placeholder="请选择设计负责人"
  460. clearable
  461. >
  462. <el-option
  463. v-for="dict in designHead"
  464. :label="dict"
  465. :value="dict"
  466. />
  467. </el-select>
  468. </el-form-item>
  469. <el-form-item label="设计联系方式" prop="designPhone">
  470. <el-input v-model="form.designPhone" placeholder="请填写设计联系方式" maxlength="13"
  471. :readonly="title == '添加用料' "></el-input>
  472. </el-form-item>
  473. <el-form-item label="监理单位" prop="supervisionUnit">
  474. <el-select
  475. v-model="form.supervisionUnit"
  476. placeholder="请选择监理单位"
  477. clearable
  478. @change="getSupervisionUnitList"
  479. >
  480. <el-option
  481. v-for="dict in dict.type.supervision_unit"
  482. :key="dict.value"
  483. :label="dict.label"
  484. :value="dict.value+','+dict.raw.remark"
  485. />
  486. </el-select>
  487. </el-form-item>
  488. <el-form-item label="监理负责人" prop="supervisionHead">
  489. <el-select
  490. v-model="form.supervisionHead"
  491. placeholder="请选择监理负责人"
  492. clearable
  493. >
  494. <el-option
  495. v-for="dict in supervisionHead"
  496. :label="dict"
  497. :value="dict"
  498. />
  499. </el-select>
  500. </el-form-item>
  501. <el-form-item label="监理联系电话" prop="supervisionPhone">
  502. <el-input v-model="form.supervisionPhone" placeholder="请填写监理联系电话" maxlength="13"
  503. :readonly="title == '添加用料' "></el-input>
  504. </el-form-item>
  505. <el-form-item label="庭院PE管材预设" prop="pePreset">
  506. <el-input v-model="form.pePresetTy" placeholder="请填写PE管材预设" maxlength="20" oninput="value=value.match(/\d+(\.\d{0,1})?/) ? value.match(/\d+(\.\d{0,1})?/)[0] : ''"
  507. :readonly="title == '添加用料' "></el-input>
  508. </el-form-item>
  509. <el-form-item label="庭院钢材预设" prop="gcPreset">
  510. <el-input v-model="form.gcPresetTy" placeholder="请填写钢材预设" maxlength="13" oninput="value=value.match(/\d+(\.\d{0,1})?/) ? value.match(/\d+(\.\d{0,1})?/)[0] : ''"
  511. :readonly="title == '添加用料' "></el-input>
  512. </el-form-item>
  513. <el-form-item label="室内PE管材预设" prop="pePreset">
  514. <el-input v-model="form.pePresetSn" placeholder="请填写PE管材预设" maxlength="20" oninput="value=value.match(/\d+(\.\d{0,1})?/) ? value.match(/\d+(\.\d{0,1})?/)[0] : ''"
  515. :readonly="title == '添加用料' "></el-input>
  516. </el-form-item>
  517. <el-form-item label="室内钢材预设" prop="gcPreset">
  518. <el-input v-model="form.gcPresetSn" placeholder="请填写钢材预设" maxlength="13" oninput="value=value.match(/\d+(\.\d{0,1})?/) ? value.match(/\d+(\.\d{0,1})?/)[0] : ''"
  519. :readonly="title == '添加用料' "></el-input>
  520. </el-form-item>
  521. <el-form-item label="工程分类" prop="enginType" >
  522. <el-select v-model="form.enginType" placeholder="请选择工程分类" style="width: 100%"
  523. :disabled="title == '添加用料' ">
  524. <el-option
  525. v-for="e in EngineepipeType"
  526. :key="e.dictValue"
  527. :label="e.dictLabel"
  528. :value="e.dictValue"
  529. ></el-option>
  530. </el-select>
  531. </el-form-item>
  532. <el-form-item label="工程类型" prop="enginClassification">
  533. <el-select v-model="enginClassificationQuery" placeholder="请选择工程类型" style="width: 100%" multiple @change="clickByType"
  534. :disabled="title == '添加用料' ">
  535. <el-option
  536. v-for="e in enginClassificationList"
  537. :key="e.dictValue"
  538. :label="e.dictLabel"
  539. :value="e.dictValue"
  540. ></el-option>
  541. </el-select>
  542. </el-form-item>
  543. <el-row :gutter="20">
  544. <el-col :span="24">
  545. <el-form-item label="附件" v-if="form.id" style="width: 100%">
  546. <ObsFileUpload ref="obsFileUpload" :file-size="100"
  547. :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg','mp4']"
  548. :limit="9999"
  549. :value="form.pics"
  550. :disabled="title == '添加用料' "
  551. @input="filesUpload"
  552. ></ObsFileUpload>
  553. </el-form-item>
  554. <el-form-item label="附件" v-else style="width: 100%">
  555. <ObsFileUpload ref="obsFileUpload" :file-size="100"
  556. :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg','mp4']"
  557. :limit="9999"
  558. :disabled="title == '添加用料' "
  559. :value="form.files"
  560. @input="filesUpload"
  561. ></ObsFileUpload>
  562. </el-form-item>
  563. </el-col>
  564. </el-row>
  565. <div style="width: 25%; float: right" >
  566. <el-button :loading="buttonLoading" type="primary" @click="submitFormAdd">提交</el-button>
  567. <el-button @click="cancel">取 消</el-button>
  568. </div>
  569. </el-form>
  570. </el-dialog>
  571. <!-- 施工信息dialog -->
  572. <el-dialog :visible.sync="nodeDetailVisible" title="施工信息" append-to-body customClass="appendElNodeDialog"
  573. width="70% !important">
  574. <el-form ref="nodeForm" :model="zEngineeringNodeBo.zEngineeringInfoBo" :rules="nodeRules" label-width="200px">
  575. <el-form-item label="施工时间" prop="constructTime">
  576. <el-date-picker
  577. v-model="zEngineeringNodeBo.zEngineeringInfoBo.constructTime"
  578. value-format="yyyy-MM-dd hh:mm:ss"
  579. type="datetime"
  580. style="width: 100%"
  581. placeholder="请选择施工时间">
  582. </el-date-picker>
  583. </el-form-item>
  584. <el-row>
  585. <el-form-item label="照片" prop="zEngiineeringPhotoBoList" style="width: 100%;">
  586. <ObsImageUpload ref="obsImageUpload" :limit="9999" :fileType="['png', 'jpg', 'jpeg']"
  587. :value="zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList"
  588. @input="getUrl"></ObsImageUpload>
  589. </el-form-item>
  590. </el-row>
  591. <el-row v-for="(item, index) in zEngineeringMaterialBo" :key="index">
  592. <el-col :span="7">
  593. <el-form-item
  594. :prop="`${item.id}.materialQuality`"
  595. style="margin-left: 120px"
  596. label-width="auto"
  597. label="材质"
  598. >
  599. <el-select v-model="item.materialQuality" placeholder="请选择材质" style="width: 70%"
  600. @change="getEnginSpecificationsList(item, index)">
  601. <el-option
  602. v-for="e in materialQualityList"
  603. :key="e.id"
  604. :label="e.name"
  605. :value="e.id"
  606. ></el-option>
  607. </el-select>
  608. </el-form-item>
  609. </el-col>
  610. <el-col :span="7">
  611. <el-form-item
  612. :prop="`${item.id}.specifications`"
  613. style="margin-left: 80px"
  614. label-width="auto"
  615. label="规格"
  616. >
  617. <el-select v-model="item.specifications" placeholder="请选择规格" style="width: 70%">
  618. <el-option
  619. v-for="e in zEngineeringMaterialBo.specifications"
  620. :key="e.id"
  621. :label="e.name"
  622. :value="e.id"
  623. ></el-option>
  624. </el-select>
  625. </el-form-item>
  626. </el-col>
  627. <el-col :span="7">
  628. <el-form-item
  629. :prop="`${item.id}.number`"
  630. style="margin-left: 40px"
  631. label-width="auto"
  632. label="数量"
  633. >
  634. <div class="block" style="display: inline-block; margin-right: 20px;">
  635. <el-input v-model="item.number" placeholder="请输入数量" style="width: 100%" maxlength="8"/>
  636. </div>
  637. </el-form-item>
  638. </el-col>
  639. <el-col :span="3">
  640. <el-form-item style="margin-left: -120px;">
  641. <el-button v-if="zEngineeringMaterialBo.length > 1" @click="removezEngineeringMaterialBo(index)">
  642. 删除
  643. </el-button>
  644. </el-form-item>
  645. </el-col>
  646. </el-row>
  647. <div style="width: 25%; float: right">
  648. <el-button @click="addzEngineeringMaterialBo">添加用料</el-button>
  649. <el-button :loading="buttonLoading" type="primary" @click="updateMaterBo">提交</el-button>
  650. <el-button @click="nodeCancel">取 消</el-button>
  651. </div>
  652. </el-form>
  653. </el-dialog>
  654. <ConstructionDetails
  655. ref="ConstructionDetails"
  656. :status="status"
  657. :currentCollapses="currentCollapses"
  658. :zEngineeringNodeBo="zEngineeringNodeBo"
  659. @updateNodeOption="updateNodeOption"
  660. @checkWorking="checkWorking"
  661. :enginType="'工业工程'"
  662. />
  663. </div>
  664. </template>
  665. <script>
  666. import {
  667. addEngineeEngineeIndustry,
  668. DelEngineeEngineeIndustry,
  669. EditEngineeEngineeIndustry,
  670. getEngineeIndustryList,
  671. putEngineeEngineeIndustry,
  672. QueryEngineeIndustry, UpdateEngineeIndustry
  673. } from '@/api/zdsz/engineeringGY'
  674. import {getDicts} from "@/api/system/dict/data";
  675. import EngineePipe from '@/components/EngineePipe'
  676. import ConstructionDetails from '@/components/ConstructionDetails/indexGY.vue'
  677. import {
  678. getEnginMaterialQualityList,
  679. insertReview,
  680. } from '@/api/zdsz/enginee'
  681. import {getEnginSpecificationsList} from '@/api/zdsz/enginSpecifications'
  682. import EnginNodeInfo from "@/components/EnginNodeInfo/indexGY.vue";
  683. export default {
  684. name: "工业",
  685. dicts: ['project_head','design_unit','supervision_unit'],
  686. components: {
  687. EnginNodeInfo,
  688. ConstructionDetails,
  689. EngineePipe
  690. },
  691. data() {
  692. // 自定义校验
  693. const validatePicPass = (rule, value, callback) => {
  694. return new Promise((resolve, reject) => {
  695. // 至少有一个图片、一个创建时间
  696. if (this.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList.length !== 0
  697. && (this.zEngineeringNodeBo.zEngineeringInfoBo.constructTime !== null || undefined)) {
  698. resolve(true)
  699. } else {
  700. reject(new Error('no pass'))
  701. }
  702. })
  703. }
  704. return {
  705. sceneHead:[],
  706. designHead:[],
  707. supervisionHead:[],
  708. // 审核时间
  709. createTime: null,
  710. // 按钮loading
  711. buttonLoading: false,
  712. // 遮罩层
  713. loading: true,
  714. // 选中数组
  715. ids: [],
  716. enginClassificationList: [],
  717. enginClassificationQuery: [],
  718. status: null,
  719. // 非单个禁用
  720. single: true,
  721. // 非多个禁用
  722. multiple: true,
  723. // 显示搜索条件
  724. showSearch: true,
  725. // 工程分类显示
  726. engineeType: true,
  727. // 总条数
  728. total: 0,
  729. currentNode: [],
  730. currentCollapses: [],
  731. // 工业工程|工业工程表格数据
  732. comprehensiveList: [],
  733. // 弹出层标题
  734. title: "",
  735. gc: true,
  736. nodeList: [],
  737. // 是否显示弹出层
  738. open: false,
  739. openadd:false,
  740. // 查询参数
  741. queryParams: {
  742. enginType: null,
  743. enginName: '', // 工程名称
  744. enginClassification: '', // 工程分类
  745. },
  746. nodeDetailVisible: false, // 施工信息dialog
  747. MaterVisible: false, // 用料信息dialog
  748. // 表单参数
  749. form: {
  750. files: [], // 附件
  751. pics: [], // 附件返回
  752. type: '', // 用来区分工业工程、工业工程
  753. enginName: '', // 工程名称
  754. enginType: '', // 工程类型
  755. enginClassification: '', // 工程分类
  756. constructUnit: '', // 建筑单位
  757. projectHead: '', // 项目负责人
  758. sceneHead: '', // 现场负责人
  759. designUnit: '', // 设计单位
  760. designHead: '', // 设计负责人
  761. designPhone: '', // 设计联系电话
  762. supervisionUnit: '', // 监理单位
  763. supervisionHead: '', // 监理负责人
  764. supervisionPhone: '', // 监理联系电话
  765. pePreset: 0, // PE管材预设量
  766. gcPreset: 0, // 钢材预设量
  767. pePresetTy: 0, // PE管材预设量
  768. gcPresetTy: 0, // 钢材预设量
  769. pePresetSn: 0, // PE管材预设量
  770. gcPresetSn: 0, // 钢材预设量
  771. zEngineeringNodeBo: { // 工程节点
  772. type: '', // 节点类型
  773. zEngineeringInfoBo: { // 施工信息
  774. constructUser: '', // 施工人
  775. constructTime: '', // 施工时间
  776. zEngiineeringPhotoBoList: [], // 图片列表
  777. zEngineeringMaterialBo: [ // 用料对象
  778. {
  779. materialQuality: '', // 用料材质
  780. specifications: '', // 用料规格
  781. number: '' // 用料数量
  782. },
  783. ],
  784. },
  785. },
  786. },
  787. zEngineeringMaterialBo: [ // 用料对象
  788. {
  789. materialQuality: '', // 用料材质
  790. specifications: '', // 用料规格
  791. number: '' // 用料数量
  792. },
  793. ],
  794. zEngineeringNodeBo: { // 工程节点
  795. type: '', // 节点类型
  796. zEngineeringInfoBo: { // 施工信息
  797. constructUser: '', // 施工人
  798. constructTime: '', // 施工时间
  799. zEngiineeringPhotoBoList: [], // 图片列表
  800. }
  801. },
  802. EngineepipeType: [], // 工程类型
  803. materialQualityList: [], // 用料材质List
  804. specificationsList: [], // 用料规格List
  805. // 表单校验
  806. rules: {
  807. enginName: [
  808. {required: true, message: "工程名称不能为空", trigger: 'blur'}
  809. ],
  810. enginType: [
  811. {required: true, message: "工程类型不能为空", trigger: 'blur'}
  812. ],
  813. enginClassificationQuery: [
  814. {required: true, message: "工程分类不能为空", trigger: 'blur'}
  815. ],
  816. constructUnit: [
  817. {required: true, message: "建筑单位不能为空", trigger: 'blur'}
  818. ],
  819. },
  820. // 节点规则校验
  821. nodeRules: {
  822. constructTime: [
  823. {required: true, message: "施工时间不能为空", trigger: ['change', 'blur']}
  824. ],
  825. zEngiineeringPhotoBoList: [
  826. {required: true, message: "图片不能为空", trigger: ['change', 'blur'], validator: validatePicPass}
  827. ],
  828. },
  829. searchParams: {
  830. pageSize: 10,
  831. pageNum: 1,
  832. enginName: null, // 工程名称
  833. },
  834. currentType: null, // 附件组件类型 put修改 add新增
  835. dictArr: [],
  836. currentCheckingEnginList: [],
  837. currentCheckList: [],
  838. flag:null,
  839. };
  840. },
  841. created() {
  842. //工程分类
  843. this.getType();
  844. //列表
  845. this.getList();
  846. },
  847. mounted() {
  848. // 获取材质
  849. getEnginMaterialQualityList({enginType: '工业工程'}).then(res => {
  850. this.materialQualityList = res.data
  851. });
  852. },
  853. methods: {
  854. getSceneHeadList(param){
  855. this.form.projectHead = param.split(',')[0];
  856. this.form.sceneHead = "";
  857. this.sceneHead = param.split(',')[1].split('、');
  858. },
  859. getDesignUnitList(param){
  860. this.form.designUnit = param.split(',')[0];
  861. this.form.designHead = "";
  862. this.designHead = param.split(',')[1].split('、');
  863. },
  864. getSupervisionUnitList(param){
  865. this.form.supervisionUnit = param.split(',')[0];
  866. this.form.supervisionHead = "";
  867. this.supervisionHead = param.split(',')[1].split('、');
  868. },
  869. downloadZip(name) {
  870. this.$download.zip(`/zdsz/engineeringPipeJacking/downloadZip/${'工业工程'}/${name}`, name);
  871. },
  872. // 节点审核
  873. checkWorking(checkingInfo,flag) {
  874. let params = checkingInfo
  875. params.createTime = this.createTime
  876. if (flag === 1){
  877. params.infoIdList.forEach(item=>{
  878. if (item.zEngiineeringPhotoBoListOne.length>0){
  879. item.zEngiineeringPhotoBoListOne.forEach(o=>{
  880. item.zEngiineeringPhotoBoList.push(o)
  881. })
  882. }
  883. if (item.zEngiineeringPhotoBoListTwo.length>0){
  884. item.zEngiineeringPhotoBoListTwo.forEach(o=>{
  885. item.zEngiineeringPhotoBoList.push(o)
  886. })
  887. }
  888. if (item.zEngiineeringPhotoBoListThree.length>0){
  889. item.zEngiineeringPhotoBoListThree.forEach(o=>{
  890. item.zEngiineeringPhotoBoList.push(o)
  891. })
  892. }
  893. })
  894. }
  895. console.log('节点审核 checkingInfo===', params)
  896. insertReview(params).then(res => {
  897. if (res.code == 200) {
  898. this.$message({
  899. message: '审核成功',
  900. type: 'success'
  901. });
  902. this.$refs.ConstructionDetails.dialogVisible = false
  903. this.getList()
  904. }
  905. })
  906. },
  907. filesUpload(url) {
  908. console.log('upload successfully')
  909. this.form.files = url
  910. this.$refs.form.validate()
  911. },
  912. validateState(rule, value, callback) {
  913. console.log(rule)
  914. console.log(value)
  915. return new Promise((resolve, reject) => {
  916. if (value !== null && value !== undefined && value !== '' && value !== 0) {
  917. resolve(true)
  918. } else {
  919. return callback(new Error('材质不能为空'))
  920. }
  921. })
  922. },
  923. validateSize(rule, value, callback) {
  924. console.log(value)
  925. return new Promise((resolve, reject) => {
  926. const value = this.zEngineeringMaterialBo[rule.index].specifications
  927. console.log(value)
  928. if (value !== null && value !== undefined && value !== '' && value !== 0) {
  929. resolve(true)
  930. } else {
  931. return callback(new Error('规格不能为空'))
  932. }
  933. })
  934. },
  935. validateNumber(rule, value, callback) {
  936. console.log(value)
  937. return new Promise((resolve, reject) => {
  938. const value = this.zEngineeringMaterialBo[rule.index].number
  939. // 至少有一个图片、一个用料信息、一个创建时间
  940. if (value) {
  941. resolve(true)
  942. } else {
  943. return reject(new Error('数量不能为空'))
  944. }
  945. })
  946. },
  947. updateNodeOption(value) {
  948. try {
  949. this.form.zEngineeringNodeBo.zEngineeringInfoBoList = this.form.zEngineeringNodeBo.zEngineeringInfoBoList.filter(obj => value.map(o => o.id).includes(obj.id))
  950. } catch (e) {
  951. }
  952. this.form.files = this.form.pics
  953. EditEngineeEngineeIndustry(this.form).then(res => {
  954. this.$modal.msgSuccess("修改成功");
  955. this.$refs.ConstructionDetails.dialogVisible = false
  956. })
  957. this.getList();
  958. },
  959. // 根据所选材质获取对应规格
  960. getEnginSpecificationsList(item, index) {
  961. this.zEngineeringMaterialBo[index].specifications = null
  962. // 根据材质ID获取材质规格
  963. getEnginSpecificationsList(item.materialQuality).then(res => {
  964. this.zEngineeringMaterialBo.specifications = res.data
  965. })
  966. },
  967. updateMaterBo() {
  968. this.form.zEngineeringNodeBo = []
  969. if (this.zEngineeringMaterialBo.length > 0) {
  970. let valid = true;
  971. if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['materialQuality'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['materialQuality'] == null) {
  972. valid = false;
  973. }
  974. if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['specifications'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['specifications'] == null) {
  975. valid = false;
  976. }
  977. if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['number'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['number'] == null) {
  978. valid = false;
  979. }
  980. if (valid) {
  981. this.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = this.zEngineeringMaterialBo
  982. this.form.zEngineeringNodeBo = this.zEngineeringNodeBo
  983. this.$refs.nodeForm.validate(valid => {
  984. if (valid) {
  985. EditEngineeEngineeIndustry(this.form).then(res => {
  986. this.nodeDetailVisible = false
  987. this.$modal.msgSuccess("新增成功");
  988. })
  989. }
  990. });
  991. } else {
  992. this.$message.warning('完善信息!')
  993. }
  994. }
  995. },
  996. //添加用料
  997. addzEngineeringMaterialBo() {
  998. if (this.zEngineeringMaterialBo.length > 0) {
  999. let valid = true;
  1000. if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['materialQuality'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['materialQuality'] == null) {
  1001. valid = false;
  1002. }
  1003. if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['specifications'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['specifications'] == null) {
  1004. valid = false;
  1005. }
  1006. if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['number'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['number'] == null) {
  1007. valid = false;
  1008. }
  1009. if (valid) {
  1010. this.zEngineeringMaterialBo.push({
  1011. materialQuality: '', // 用料材质
  1012. specifications: '', // 用料规格
  1013. number: '' // 用料数量
  1014. })
  1015. } else {
  1016. this.$message.warning('完善信息!')
  1017. }
  1018. }
  1019. },
  1020. // 删除用料信息
  1021. removezEngineeringMaterialBo(index) {
  1022. this.zEngineeringMaterialBo.splice(index, 1)
  1023. },
  1024. // 工程类型与工程分类与节点类型
  1025. getType() {
  1026. getDicts("industry_engin_type").then(res => {
  1027. this.EngineepipeType = res.data
  1028. });
  1029. getDicts("engin_classification").then(res => {
  1030. this.enginClassificationList = res.data
  1031. })
  1032. },
  1033. clickByType(value) {
  1034. this.flag = null;
  1035. if (!value) return;
  1036. let str = '';
  1037. if (value == '室内管线') {
  1038. str = 'gy_inner'
  1039. } else if (value == '室外管线') {
  1040. str = 'gy_out'
  1041. } else if (value == '调压柜') {
  1042. str = 'gy_tyg'
  1043. } else {
  1044. return;
  1045. }
  1046. this.flag = str;
  1047. getDicts(str).then(res => {
  1048. this.nodeList = res.data
  1049. })
  1050. },
  1051. enginNodeStatusExecuted(item) {
  1052. console.log(item)
  1053. try {
  1054. return this.form.nodeReViewStateList.find(o => o.Type == item.dictLabel).state == '1';
  1055. } catch (error) {
  1056. return false
  1057. }
  1058. },
  1059. addNewPipe(data) {
  1060. this.$refs.enginPipe.openDialog({
  1061. id: data.id,
  1062. type: this.form.type
  1063. }, 'add', data)
  1064. },
  1065. //添加用料信息
  1066. addzEngineeringMaterBo(data) {
  1067. this.title = "添加用料";
  1068. this.reset();
  1069. const id = data.id
  1070. putEngineeEngineeIndustry(id).then(res => {
  1071. this.form = res.data;
  1072. this.clickByType(this.form.enginClassification)
  1073. this.currentType = 'addMaterial'
  1074. this.open = true
  1075. })
  1076. },
  1077. async viewSource(e, type = null) {
  1078. console.log('历史',e)
  1079. this.currentId = e.id
  1080. if (!e.enginClassification)return;
  1081. let str = '';
  1082. if (e.enginClassification == '室内管线') {
  1083. str = 'gy_inner'
  1084. } else if (e.enginClassification == '室外管线') {
  1085. str = 'gy_out'
  1086. } else if (e.enginClassification == '调压柜') {
  1087. str = 'gy_tyg'
  1088. }
  1089. const r = await getDicts(str)
  1090. let dict = []
  1091. for (let i = 0; i < r.data.length; i++) {
  1092. dict.push({
  1093. label: r.data[i].dictLabel,
  1094. value: r.data[i].dictValue
  1095. })
  1096. }
  1097. if (type) {
  1098. this.status = 'review'
  1099. } else {
  1100. this.status = 'read-only'
  1101. }
  1102. this.$refs.ConstructionDetails.open(dict, null, null, null, this.status, e.enginClassification)
  1103. },
  1104. async updateviewSource(e) {
  1105. this.currentId = e.id
  1106. if (!e.enginClassification)return;
  1107. let str = '';
  1108. if (e.enginClassification == '室内管线') {
  1109. str = 'gy_inner'
  1110. } else if (e.enginClassification == '室外管线') {
  1111. str = 'gy_out'
  1112. } else if (e.enginClassification == '调压柜') {
  1113. str = 'gy_tyg'
  1114. }
  1115. const r = await getDicts(str)
  1116. let dict = []
  1117. for (let i = 0; i < r.data.length; i++) {
  1118. dict.push({
  1119. label: r.data[i].dictLabel,
  1120. value: r.data[i].dictValue
  1121. })
  1122. }
  1123. this.status = 'put'
  1124. this.$refs.ConstructionDetails.open(dict, null, null, null, this.status, e.enginClassification)
  1125. },
  1126. viewNodeSource(e) {
  1127. if (!e) return
  1128. // todo: 获取数据
  1129. QueryEngineeIndustry({
  1130. id: this.currentId,
  1131. type: e
  1132. }).then(res => {
  1133. this.createTime = res.data.createTime
  1134. this.form = res.data
  1135. try {
  1136. this.currentCollapses = res.data.zEngineeringNodeBo.zEngineeringInfoBoList
  1137. this.$refs.ConstructionDetails.setEngineId(res.data.zEngineeringNodeBo.id || null)
  1138. } catch (error) {
  1139. this.currentCollapses = [];
  1140. }
  1141. })
  1142. },
  1143. nodeCancel() {
  1144. this.nodeDetailVisible = false
  1145. this.reset()
  1146. },
  1147. getUrl(url) {
  1148. this.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList = this.$refs.obsImageUpload.fileList ? this.$refs.obsImageUpload.fileList.map(e => e.url) : [];
  1149. },
  1150. /** 查询工业工程 */
  1151. getList(val) {
  1152. this.loading = true;
  1153. getEngineeIndustryList(this.searchParams).then(res => {
  1154. this.comprehensiveList = res.rows;
  1155. this.total = res.total;
  1156. this.loading = false;
  1157. });
  1158. },
  1159. // 取消按钮
  1160. cancel() {
  1161. this.open = false;
  1162. this.reset();
  1163. },
  1164. // 表单重置
  1165. reset() {
  1166. for (let formKey in this.form) {
  1167. this.form[formKey] = null
  1168. }
  1169. this.form.zEngineeringNodeBo = {}
  1170. this.form.zEngineeringNodeBo.zEngineeringInfoBo = {}
  1171. this.zEngineeringMaterialBo = []
  1172. this.zEngineeringMaterialBo.push({
  1173. materialQuality: '', // 用料材质
  1174. specifications: '', // 用料规格
  1175. number: '' // 用料数量
  1176. })
  1177. this.getType()
  1178. },
  1179. /** 搜索按钮操作 */
  1180. handleQuery() {
  1181. this.searchParams.pageNum = 1;
  1182. this.getList();
  1183. },
  1184. /** 重置按钮操作 */
  1185. resetQuery() {
  1186. this.resetForm("searchParams");
  1187. this.handleQuery();
  1188. },
  1189. // 多选框选中数据
  1190. handleSelectionChange(selection) {
  1191. this.ids = selection.map(item => item.id)
  1192. this.single = selection.length !== 1
  1193. this.multiple = !selection.length
  1194. },
  1195. /** 新增按钮操作 */
  1196. handleAdd() {
  1197. this.reset();
  1198. this.gc = true
  1199. this.title = "新增工业工程";
  1200. this.currentType = 'add'
  1201. // this.open = true;
  1202. this.openadd = true;
  1203. },
  1204. removeFile(val) {
  1205. this.form.files = val
  1206. },
  1207. /** 修改按钮操作 */
  1208. handleUpdate(row) {
  1209. this.gc = false
  1210. this.loading = true;
  1211. this.reset();
  1212. const id = row.id || this.ids
  1213. putEngineeEngineeIndustry(id).then(response => {
  1214. this.loading = false;
  1215. this.form = response.data;
  1216. if (response.data.zEngineeringNodeBoList !== undefined && response.data.zEngineeringNodeBoList.length > 0) {
  1217. this.zEngineeringNodeBo = response.data.zEngineeringNodeBoList[0]
  1218. if (response.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList !== undefined && response.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList.length > 0) {
  1219. this.zEngineeringNodeBo.zEngineeringInfoBo = response.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList[0]
  1220. }
  1221. }
  1222. this.title = "修改工业工程";
  1223. this.currentType = 'put'
  1224. this.open = true;
  1225. });
  1226. },
  1227. toNodeDetail() {
  1228. this.$refs["form"].validate(valid => {
  1229. if (valid) {
  1230. let nodeCollection = []
  1231. // 收集节点信息
  1232. this.currentCheckList.forEach((e, idx) => {
  1233. let nodeItem = this.$refs['EnginNodeInfo' + idx][0].infoCollection()
  1234. nodeCollection.push(nodeItem)
  1235. })
  1236. this.form.zEngineeringNodeBoList = nodeCollection
  1237. console.log(this.form.zEngineeringNodeBoList)
  1238. if (this.title == '添加用料') {
  1239. this.buttonLoading = true
  1240. addEngineeEngineeIndustry(this.form).then(res => {
  1241. if (res.code == 200) {
  1242. this.$message({
  1243. message: '添加成功',
  1244. type: 'success'
  1245. });
  1246. this.buttonLoading = false
  1247. this.open = false
  1248. this.currentCheckList = []
  1249. this.getList()
  1250. }
  1251. })
  1252. }
  1253. }
  1254. })
  1255. },
  1256. /** 提交按钮 */
  1257. submitForm() {
  1258. this.$refs["form"].validate(valid => {
  1259. if (valid) {
  1260. this.form.files = this.$refs.obsFileUpload.fileList;
  1261. if (this.form.files.length === 0) {
  1262. this.$message.warning('必须上传附件!')
  1263. return
  1264. }
  1265. this.form.zEngineeringNodeBo = null
  1266. if (this.zEngineeringNodeBo.type !== '') {
  1267. this.form.zEngineeringNodeBo = this.zEngineeringNodeBo
  1268. this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = this.zEngineeringMaterialBo
  1269. }
  1270. // if (this.form.enginClassification && this.form.enginClassification != [] && this.form.enginClassification.length > 0) {
  1271. // this.form.enginClassification = this.form.enginClassification.join(',');
  1272. // } else {
  1273. // this.form.enginClassification = ""
  1274. // }
  1275. if (this.form.id == null) {
  1276. addEngineeEngineeIndustry(this.form).then(res => {
  1277. this.$modal.msgSuccess("新增成功");
  1278. this.open = false;
  1279. this.nodeDetailVisible = false
  1280. this.getList();
  1281. })
  1282. } else {
  1283. UpdateEngineeIndustry(this.form).then(res => {
  1284. this.$modal.msgSuccess("修改成功");
  1285. this.open = false;
  1286. this.nodeDetailVisible = false
  1287. this.getList();
  1288. })
  1289. }
  1290. }
  1291. });
  1292. },
  1293. /** 提交按钮 */
  1294. submitFormAdd() {
  1295. this.$refs["form"].validate(valid => {
  1296. if (valid) {
  1297. this.form.files = this.$refs.obsFileUpload.fileList;
  1298. if (this.form.files.length === 0) {
  1299. this.$message.warning('必须上传附件!')
  1300. return
  1301. }
  1302. this.form.zEngineeringNodeBo = null
  1303. if (this.zEngineeringNodeBo.type !== '') {
  1304. this.form.zEngineeringNodeBo = this.zEngineeringNodeBo
  1305. this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = this.zEngineeringMaterialBo
  1306. }
  1307. if (this.enginClassificationQuery && this.enginClassificationQuery != [] && this.enginClassificationQuery.length > 0) {
  1308. for(let i in this.enginClassificationQuery){
  1309. this.form.enginClassification = this.enginClassificationQuery[i];
  1310. if(this.enginClassificationQuery[i] == '室内管线'){
  1311. this.form.pePreset= this.form.pePresetSn;
  1312. this.form.gcPreset= this.form.gcPresetSn;
  1313. }else if (this.enginClassificationQuery[i] == '室外管线'){
  1314. this.form.pePreset= this.form.pePresetTy;
  1315. this.form.gcPreset= this.form.gcPresetTy;
  1316. }else{
  1317. this.form.pePreset= 0;
  1318. this.form.gcPreset= 0;
  1319. }
  1320. addEngineeEngineeIndustry(this.form).then(res => {
  1321. this.$modal.msgSuccess("新增成功");
  1322. this.openadd = false;
  1323. this.nodeDetailVisible = false
  1324. })
  1325. this.getList();
  1326. }
  1327. }
  1328. }
  1329. });
  1330. },
  1331. /** 删除按钮操作 */
  1332. handleDelete(row) {
  1333. const ids = row.id || this.ids;
  1334. this.$modal.confirm('是否确认删除所选择的数据项?').then(() => {
  1335. this.loading = true;
  1336. return DelEngineeEngineeIndustry(ids);
  1337. }).then(() => {
  1338. this.loading = false;
  1339. this.getList();
  1340. this.$modal.msgSuccess("删除成功");
  1341. }).catch(() => {
  1342. }).finally(() => {
  1343. this.loading = false;
  1344. });
  1345. },
  1346. /** 导出按钮操作 */
  1347. handleExport() {
  1348. this.download('zdsz/engineeringGY/export', {
  1349. ...this.queryParams
  1350. }, `工业工程数据_${new Date().getTime()}.xlsx`)
  1351. }
  1352. }
  1353. };
  1354. </script>
  1355. <style lang="scss" scoped>
  1356. ::v-deep .appendElDialog {
  1357. width: 70%;
  1358. height: 80%;
  1359. .el-dialog__body {
  1360. height: 85%;
  1361. overflow-y: scroll;
  1362. }
  1363. .el-form-item {
  1364. margin-bottom: 22px;
  1365. padding-left: 30px;
  1366. width: 44%;
  1367. display: inline-block;
  1368. }
  1369. .el-form-item:nth-child(2n+2) {
  1370. margin-left: 5%;
  1371. }
  1372. .el-form-item:not(:nth-child(1):nth-child(2)) {
  1373. margin-top: 0.5%;
  1374. }
  1375. .remark_input {
  1376. .el-textarea__inner {
  1377. width: 238%;
  1378. height: 190px;
  1379. }
  1380. }
  1381. }
  1382. ::v-deep .appendElNodeDialog {
  1383. // width: 70%;
  1384. height: 80%;
  1385. .el-select {
  1386. width: 70%
  1387. }
  1388. .el-dialog__body {
  1389. height: 85%;
  1390. }
  1391. .el-form-item {
  1392. margin-bottom: 22px;
  1393. width: 100%;
  1394. display: inline-block;
  1395. }
  1396. .el-form-item:not(:nth-child(1):nth-child(2)) {
  1397. margin-top: 0.5%;
  1398. }
  1399. }
  1400. </style>