index.vue 55 KB

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