index.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114
  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="enginType">
  12. <el-select v-model="searchParams.enginType" placeholder="请选择工程类型" clearable>
  13. <el-option
  14. v-for="dict in EngineepipeType"
  15. :key="dict.dictValue"
  16. :label="dict.dictLabel"
  17. :value="dict.dictValue"
  18. />
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item label="工程类型" prop="enginClassification">
  22. <el-select v-model="searchParams.enginClassification" placeholder="请选择工程分类" clearable>
  23. <el-option
  24. v-for="dict in enginClassificationList"
  25. :key="dict.dictValue"
  26. :label="dict.dictLabel"
  27. :value="dict.dictValue"
  28. />
  29. </el-select>
  30. </el-form-item>
  31. <el-form-item label="工程名称" prop="enginName">
  32. <el-input v-model="searchParams.enginName" placeholder="请输入工程名称" maxlength="20"></el-input>
  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. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  76. </el-row>
  77. <el-table v-loading="loading" :data="comprehensiveList" @selection-change="handleSelectionChange">
  78. <el-table-column type="selection" width="55" align="center"/>
  79. <el-table-column label="工程名称" align="center" prop="enginName"/>
  80. <el-table-column label="工程类型" align="center" prop="enginType"/>
  81. <el-table-column label="工程分类" align="center" prop="enginClassification"/>
  82. <el-table-column label="现场负责人" align="center" prop="sceneHead"/>
  83. <el-table-column label="设计负责人" align="center" prop="designHead"/>
  84. <el-table-column label="监理负责人" align="center" prop="supervisionHead"/>
  85. <el-table-column label="用料比" align="center" prop="enginClassification" width="300px">
  86. <template slot-scope="scope">
  87. <div>
  88. <span>PE{实际:{{scope.row.pesj}},预计:{{scope.row.pePreset}},占比:{{scope.row.peys == 0 ? 100:(scope.row.pesj / scope.row.pePreset * 100).toFixed(1)}}%}</span><br>
  89. <span>钢材{实际:{{scope.row.gsj}},预计:{{scope.row.gcPreset}},占比:{{scope.row.gys == 0 ? 100:(scope.row.gsj / scope.row.gcPreset * 100).toFixed(1)}}%}</span>
  90. </div>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="审核状态" align="center" prop="nodeReViewStateList" width="250">
  94. <template slot-scope="scope">
  95. <div style="text-align:center">
  96. <el-popover
  97. v-for="item in scope.row.nodeReViewStateList"
  98. placement="top-start"
  99. trigger="hover"
  100. :content="item.Type">
  101. <span slot="reference" v-if="(item.state == '1'||item.state == '2')"
  102. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #30B08F;"></span>
  103. <span slot="reference" v-if="item.state == '0' "
  104. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #C03639;"></span>
  105. </el-popover>
  106. </div>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  110. <template v-slot="scope">
  111. <el-button
  112. size="mini"
  113. type="text"
  114. icon="el-icon-edit"
  115. @click="handleUpdate(scope.row)"
  116. v-hasPermi="['zdsz:engineeringgy:edit']"
  117. >修改
  118. </el-button>
  119. <el-button
  120. type="text"
  121. icon="el-icon-edit"
  122. size="mini"
  123. v-hasPermi="['zdsz:engineeringgy:edit']"
  124. @click="updateviewSource(scope.row)"
  125. >修改施工信息
  126. </el-button>
  127. <el-button type="text"
  128. icon="el-icon-edit"
  129. size="mini"
  130. v-hasPermi="['zdsz:engineeringgy:add']"
  131. @click="addzEngineeringMaterBo(scope.row)"
  132. >添加用料
  133. </el-button>
  134. <el-button
  135. size="mini"
  136. type="text"
  137. icon="el-icon-edit"
  138. v-hasPermi="['zdsz:engineeringPipeJacking:add']"
  139. @click="addNewPipe(scope.row)"
  140. >新增顶管工程
  141. </el-button>
  142. <el-button
  143. size="mini"
  144. type="text"
  145. icon="el-icon-circle-check"
  146. @click="viewSource(scope.row,'check')"
  147. v-hasPermi="['zdsz:engineeringgy:review']"
  148. >审核
  149. </el-button>
  150. <el-button
  151. type="text"
  152. icon="el-icon-edit"
  153. size="mini"
  154. v-hasPermi="['zdsz:engineeringgy:query']"
  155. @click="viewSource(scope.row)"
  156. >历史施工
  157. </el-button>
  158. <el-button
  159. type="text"
  160. icon="el-icon-download"
  161. size="mini"
  162. @click="download(scope.row.enginName)"
  163. >下载图片
  164. </el-button>
  165. <el-button
  166. size="mini"
  167. type="text"
  168. icon="el-icon-delete"
  169. @click="handleDelete(scope.row)"
  170. v-hasPermi="['zdsz:engineeringgy:remove']"
  171. >删除
  172. </el-button>
  173. </template>
  174. </el-table-column>
  175. </el-table>
  176. <pagination
  177. v-show="total>0"
  178. :total="total"
  179. :page.sync="searchParams.pageNum"
  180. :limit.sync="searchParams.pageSize"
  181. @pagination="getList"
  182. />
  183. <!-- 顶管工程新增 -->
  184. <EngineePipe ref="enginPipe"/>
  185. <!-- 添加或修改工业工程|工业工程对话框 -->
  186. <el-dialog :title="title" :visible.sync="open" append-to-body customClass="appendElDialog">
  187. <el-form ref="form" :model="form" :rules="rules" label-width="110px">
  188. <el-form-item label="工程名称" prop="enginName">
  189. <el-input v-model="form.enginName" placeholder="请填写工程名称" maxlength="60"
  190. :readonly="title == '添加用料' "></el-input>
  191. </el-form-item>
  192. <el-form-item label="建筑单位" prop="constructUnit">
  193. <el-input v-model="form.constructUnit" placeholder="请填写建筑单位" maxlength="50"
  194. :readonly="title == '添加用料' "></el-input>
  195. </el-form-item>
  196. <el-form-item label="项目负责人" prop="projectHead">
  197. <el-input v-model="form.projectHead" placeholder="请填写项目负责人" maxlength="20"
  198. :readonly="title == '添加用料' "></el-input>
  199. </el-form-item>
  200. <el-form-item label="现场负责人" prop="sceneHead">
  201. <el-input v-model="form.sceneHead" placeholder="请填写现场负责人" maxlength="20"
  202. :readonly="title == '添加用料' "></el-input>
  203. </el-form-item>
  204. <el-form-item label="设计单位" prop="designUnit">
  205. <el-input v-model="form.designUnit" placeholder="请填写设计单位" maxlength="50"
  206. :readonly="title == '添加用料' "></el-input>
  207. </el-form-item>
  208. <el-form-item label="设计负责人" prop="designHead">
  209. <el-input v-model="form.designHead" placeholder="请填写现场负责人" maxlength="20"
  210. :readonly="title == '添加用料' "></el-input>
  211. </el-form-item>
  212. <el-form-item label="设计联系方式" prop="designPhone">
  213. <el-input v-model="form.designPhone" placeholder="请填写设计联系方式" maxlength="13"
  214. :readonly="title == '添加用料' "></el-input>
  215. </el-form-item>
  216. <el-form-item label="监理单位" prop="supervisionUnit">
  217. <el-input v-model="form.supervisionUnit" placeholder="请填写监理单位" maxlength="50"
  218. :readonly="title == '添加用料' "/>
  219. </el-form-item>
  220. <el-form-item label="监理负责人" prop="supervisionHead">
  221. <el-input v-model="form.supervisionHead" placeholder="请填写监理负责人" maxlength="20"
  222. :readonly="title == '添加用料' "></el-input>
  223. </el-form-item>
  224. <el-form-item label="监理联系电话" prop="supervisionPhone">
  225. <el-input v-model="form.supervisionPhone" placeholder="请填写监理联系电话" maxlength="13"
  226. :readonly="title == '添加用料' "></el-input>
  227. </el-form-item>
  228. <el-form-item label="PE管材预设" prop="pePreset">
  229. <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] : ''"
  230. :readonly="title == '添加用料' "></el-input>
  231. </el-form-item>
  232. <el-form-item label="钢材预设" prop="gcPreset">
  233. <el-input v-model="form.gcPreset" placeholder="请填写钢材预设" maxlength="13" oninput="value=value.match(/\d+(\.\d{0,1})?/) ? value.match(/\d+(\.\d{0,1})?/)[0] : ''"
  234. :readonly="title == '添加用料' "></el-input>
  235. </el-form-item>
  236. <el-form-item label="工程分类" prop="enginType">
  237. <el-select v-model="form.enginType" placeholder="请选择工程分类" style="width: 100%"
  238. :disabled="title == '添加用料' ">
  239. <el-option
  240. v-for="e in EngineepipeType"
  241. :key="e.dictValue"
  242. :label="e.dictLabel"
  243. :value="e.dictValue"
  244. ></el-option>
  245. </el-select>
  246. </el-form-item>
  247. <el-form-item label="工程类型" prop="enginClassification">
  248. <el-select v-model="form.enginClassification" placeholder="请选择工程类型" style="width: 100%" @change="clickByType"
  249. :disabled="title == '添加用料' ">
  250. <el-option
  251. v-for="e in enginClassificationList"
  252. :key="e.dictValue"
  253. :label="e.dictLabel"
  254. :value="e.dictValue"
  255. ></el-option>
  256. </el-select>
  257. </el-form-item>
  258. <el-row :gutter="20">
  259. <el-col :span="24">
  260. <el-form-item label="附件" v-if="form.id" style="width: 100%">
  261. <ObsFileUpload ref="obsFileUpload" :file-size="100"
  262. :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg','mp4']"
  263. :limit="9999"
  264. :value="form.pics"
  265. :disabled="title == '添加用料' "
  266. @input="filesUpload"
  267. ></ObsFileUpload>
  268. </el-form-item>
  269. <el-form-item label="附件" v-else style="width: 100%">
  270. <ObsFileUpload ref="obsFileUpload" :file-size="100"
  271. :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg','mp4']"
  272. :limit="9999"
  273. :disabled="title == '添加用料' "
  274. :value="form.files"
  275. @input="filesUpload"
  276. ></ObsFileUpload>
  277. </el-form-item>
  278. </el-col>
  279. </el-row>
  280. <el-row v-if="title=='添加用料'">
  281. <el-col :span="24">
  282. <el-form-item label="环节">
  283. <el-checkbox-group v-model="currentCheckList" style="display: flex">
  284. <el-checkbox
  285. :label="item.dictValue"
  286. v-for="item in nodeList"
  287. :key="item"
  288. :disabled=enginNodeStatusExecuted(item)
  289. ></el-checkbox>
  290. </el-checkbox-group>
  291. </el-form-item>
  292. </el-col>
  293. </el-row>
  294. <EnginNodeInfo
  295. v-if="title=='添加用料'"
  296. v-for="(e,idx) in currentCheckList"
  297. :key="idx"
  298. :name="e"
  299. :ref="'EnginNodeInfo'+idx"
  300. :flag="flag"
  301. :types="currentCheckList"
  302. :currentContain="currentCheckList"
  303. :enginType="'工业工程'"
  304. :enginSort="form.enginType"
  305. />
  306. <div style="width: 25%; float: right" v-if="title=='添加用料'">
  307. <el-button :loading="buttonLoading" type="primary" @click="toNodeDetail">提交</el-button>
  308. </div>
  309. <div style="width: 25%; float: right" v-else>
  310. <el-button :loading="buttonLoading" type="primary" @click="submitForm">提交</el-button>
  311. <el-button @click="cancel">取 消</el-button>
  312. </div>
  313. </el-form>
  314. </el-dialog>
  315. <!-- 施工信息dialog -->
  316. <el-dialog :visible.sync="nodeDetailVisible" title="施工信息" append-to-body customClass="appendElNodeDialog"
  317. width="70% !important">
  318. <el-form ref="nodeForm" :model="zEngineeringNodeBo.zEngineeringInfoBo" :rules="nodeRules" label-width="200px">
  319. <el-form-item label="施工时间" prop="constructTime">
  320. <el-date-picker
  321. v-model="zEngineeringNodeBo.zEngineeringInfoBo.constructTime"
  322. value-format="yyyy-MM-dd hh:mm:ss"
  323. type="datetime"
  324. style="width: 100%"
  325. placeholder="请选择施工时间">
  326. </el-date-picker>
  327. </el-form-item>
  328. <el-row>
  329. <el-form-item label="照片" prop="zEngiineeringPhotoBoList" style="width: 100%;">
  330. <ObsImageUpload ref="obsImageUpload" :limit="9999" :fileType="['png', 'jpg', 'jpeg']"
  331. :value="zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList"
  332. @input="getUrl"></ObsImageUpload>
  333. </el-form-item>
  334. </el-row>
  335. <el-row v-for="(item, index) in zEngineeringMaterialBo" :key="index">
  336. <el-col :span="7">
  337. <el-form-item
  338. :prop="`${item.id}.materialQuality`"
  339. style="margin-left: 120px"
  340. label-width="auto"
  341. label="材质"
  342. >
  343. <el-select v-model="item.materialQuality" placeholder="请选择材质" style="width: 70%"
  344. @change="getEnginSpecificationsList(item, index)">
  345. <el-option
  346. v-for="e in materialQualityList"
  347. :key="e.id"
  348. :label="e.name"
  349. :value="e.id"
  350. ></el-option>
  351. </el-select>
  352. </el-form-item>
  353. </el-col>
  354. <el-col :span="7">
  355. <el-form-item
  356. :prop="`${item.id}.specifications`"
  357. style="margin-left: 80px"
  358. label-width="auto"
  359. label="规格"
  360. >
  361. <el-select v-model="item.specifications" placeholder="请选择规格" style="width: 70%">
  362. <el-option
  363. v-for="e in zEngineeringMaterialBo.specifications"
  364. :key="e.id"
  365. :label="e.name"
  366. :value="e.id"
  367. ></el-option>
  368. </el-select>
  369. </el-form-item>
  370. </el-col>
  371. <el-col :span="7">
  372. <el-form-item
  373. :prop="`${item.id}.number`"
  374. style="margin-left: 40px"
  375. label-width="auto"
  376. label="数量"
  377. >
  378. <div class="block" style="display: inline-block; margin-right: 20px;">
  379. <el-input v-model="item.number" placeholder="请输入数量" style="width: 100%" maxlength="8"/>
  380. </div>
  381. </el-form-item>
  382. </el-col>
  383. <el-col :span="3">
  384. <el-form-item style="margin-left: -120px;">
  385. <el-button v-if="zEngineeringMaterialBo.length > 1" @click="removezEngineeringMaterialBo(index)">
  386. 删除
  387. </el-button>
  388. </el-form-item>
  389. </el-col>
  390. </el-row>
  391. <div style="width: 25%; float: right">
  392. <el-button @click="addzEngineeringMaterialBo">添加用料</el-button>
  393. <el-button :loading="buttonLoading" type="primary" @click="updateMaterBo">提交</el-button>
  394. <el-button @click="nodeCancel">取 消</el-button>
  395. </div>
  396. </el-form>
  397. </el-dialog>
  398. <ConstructionDetails
  399. ref="ConstructionDetails"
  400. :status="status"
  401. :currentCollapses="currentCollapses"
  402. :zEngineeringNodeBo="zEngineeringNodeBo"
  403. @updateNodeOption="updateNodeOption"
  404. @checkWorking="checkWorking"
  405. :enginType="'工业工程'"
  406. />
  407. </div>
  408. </template>
  409. <script>
  410. import {
  411. addEngineeEngineeIndustry,
  412. DelEngineeEngineeIndustry,
  413. EditEngineeEngineeIndustry,
  414. getEngineeIndustryList,
  415. putEngineeEngineeIndustry,
  416. QueryEngineeIndustry, UpdateEngineeIndustry
  417. } from '@/api/zdsz/engineeringGY'
  418. import {getDicts} from "@/api/system/dict/data";
  419. import EngineePipe from '@/components/EngineePipe'
  420. import ConstructionDetails from '@/components/ConstructionDetails/indexGY.vue'
  421. import {
  422. getEnginMaterialQualityList,
  423. insertReview,
  424. } from '@/api/zdsz/enginee'
  425. import {getEnginSpecificationsList} from '@/api/zdsz/enginSpecifications'
  426. import EnginNodeInfo from "@/components/EnginNodeInfo/indexGY.vue";
  427. export default {
  428. name: "工业",
  429. dicts: [],
  430. components: {
  431. EnginNodeInfo,
  432. ConstructionDetails,
  433. EngineePipe
  434. },
  435. data() {
  436. // 自定义校验
  437. const validatePicPass = (rule, value, callback) => {
  438. return new Promise((resolve, reject) => {
  439. // 至少有一个图片、一个创建时间
  440. if (this.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList.length !== 0
  441. && (this.zEngineeringNodeBo.zEngineeringInfoBo.constructTime !== null || undefined)) {
  442. resolve(true)
  443. } else {
  444. reject(new Error('no pass'))
  445. }
  446. })
  447. }
  448. return {
  449. // 审核时间
  450. createTime: null,
  451. // 按钮loading
  452. buttonLoading: false,
  453. // 遮罩层
  454. loading: true,
  455. // 选中数组
  456. ids: [],
  457. enginClassificationList: [],
  458. status: null,
  459. // 非单个禁用
  460. single: true,
  461. // 非多个禁用
  462. multiple: true,
  463. // 显示搜索条件
  464. showSearch: true,
  465. // 工程分类显示
  466. engineeType: true,
  467. // 总条数
  468. total: 0,
  469. currentNode: [],
  470. currentCollapses: [],
  471. // 工业工程|工业工程表格数据
  472. comprehensiveList: [],
  473. // 弹出层标题
  474. title: "",
  475. gc: true,
  476. nodeList: [],
  477. // 是否显示弹出层
  478. open: false,
  479. // 查询参数
  480. queryParams: {
  481. enginType: null,
  482. enginName: '', // 工程名称
  483. enginClassification: '', // 工程分类
  484. },
  485. nodeDetailVisible: false, // 施工信息dialog
  486. MaterVisible: false, // 用料信息dialog
  487. // 表单参数
  488. form: {
  489. files: [], // 附件
  490. pics: [], // 附件返回
  491. type: '', // 用来区分工业工程、工业工程
  492. enginName: '', // 工程名称
  493. enginType: '', // 工程类型
  494. enginClassification: '', // 工程分类
  495. constructUnit: '', // 建筑单位
  496. projectHead: '', // 项目负责人
  497. sceneHead: '', // 现场负责人
  498. designUnit: '', // 设计单位
  499. designHead: '', // 设计负责人
  500. designPhone: '', // 设计联系电话
  501. supervisionUnit: '', // 监理单位
  502. supervisionHead: '', // 监理负责人
  503. supervisionPhone: '', // 监理联系电话
  504. pePreset: 0, // PE管材预设量
  505. gcPreset: 0, // 钢材预设量
  506. zEngineeringNodeBo: { // 工程节点
  507. type: '', // 节点类型
  508. zEngineeringInfoBo: { // 施工信息
  509. constructUser: '', // 施工人
  510. constructTime: '', // 施工时间
  511. zEngiineeringPhotoBoList: [], // 图片列表
  512. zEngineeringMaterialBo: [ // 用料对象
  513. {
  514. materialQuality: '', // 用料材质
  515. specifications: '', // 用料规格
  516. number: '' // 用料数量
  517. },
  518. ],
  519. },
  520. },
  521. },
  522. zEngineeringMaterialBo: [ // 用料对象
  523. {
  524. materialQuality: '', // 用料材质
  525. specifications: '', // 用料规格
  526. number: '' // 用料数量
  527. },
  528. ],
  529. zEngineeringNodeBo: { // 工程节点
  530. type: '', // 节点类型
  531. zEngineeringInfoBo: { // 施工信息
  532. constructUser: '', // 施工人
  533. constructTime: '', // 施工时间
  534. zEngiineeringPhotoBoList: [], // 图片列表
  535. }
  536. },
  537. EngineepipeType: [], // 工程类型
  538. materialQualityList: [], // 用料材质List
  539. specificationsList: [], // 用料规格List
  540. // 表单校验
  541. rules: {
  542. enginName: [
  543. {required: true, message: "工程名称不能为空", trigger: 'blur'}
  544. ],
  545. enginType: [
  546. {required: true, message: "工程类型不能为空", trigger: 'blur'}
  547. ],
  548. enginClassification: [
  549. {required: true, message: "工程分类不能为空", trigger: 'blur'}
  550. ],
  551. constructUnit: [
  552. {required: true, message: "建筑单位不能为空", trigger: 'blur'}
  553. ],
  554. },
  555. // 节点规则校验
  556. nodeRules: {
  557. constructTime: [
  558. {required: true, message: "施工时间不能为空", trigger: ['change', 'blur']}
  559. ],
  560. zEngiineeringPhotoBoList: [
  561. {required: true, message: "图片不能为空", trigger: ['change', 'blur'], validator: validatePicPass}
  562. ],
  563. },
  564. searchParams: {
  565. pageSize: 10,
  566. pageNum: 1,
  567. enginName: null, // 工程名称
  568. },
  569. currentType: null, // 附件组件类型 put修改 add新增
  570. dictArr: [],
  571. currentCheckingEnginList: [],
  572. currentCheckList: [],
  573. flag:null,
  574. };
  575. },
  576. created() {
  577. //工程分类
  578. this.getType();
  579. //列表
  580. this.getList();
  581. },
  582. mounted() {
  583. // 获取材质
  584. getEnginMaterialQualityList({enginType: '工业工程'}).then(res => {
  585. this.materialQualityList = res.data
  586. });
  587. },
  588. methods: {
  589. download(name) {
  590. this.$download.zip(`/zdsz/engineeringPipeJacking/downloadZip/${'工业工程'}/${name}`, name);
  591. },
  592. // 节点审核
  593. checkWorking(checkingInfo,flag) {
  594. let params = checkingInfo
  595. params.createTime = this.createTime
  596. if (flag === 1){
  597. params.infoIdList.forEach(item=>{
  598. if (item.zEngiineeringPhotoBoListOne.length>0){
  599. item.zEngiineeringPhotoBoListOne.forEach(o=>{
  600. item.zEngiineeringPhotoBoList.push(o)
  601. })
  602. }
  603. if (item.zEngiineeringPhotoBoListTwo.length>0){
  604. item.zEngiineeringPhotoBoListTwo.forEach(o=>{
  605. item.zEngiineeringPhotoBoList.push(o)
  606. })
  607. }
  608. if (item.zEngiineeringPhotoBoListThree.length>0){
  609. item.zEngiineeringPhotoBoListThree.forEach(o=>{
  610. item.zEngiineeringPhotoBoList.push(o)
  611. })
  612. }
  613. })
  614. }
  615. console.log('节点审核 checkingInfo===', params)
  616. insertReview(params).then(res => {
  617. if (res.code == 200) {
  618. this.$message({
  619. message: '审核成功',
  620. type: 'success'
  621. });
  622. this.$refs.ConstructionDetails.dialogVisible = false
  623. this.getList()
  624. }
  625. })
  626. },
  627. filesUpload(url) {
  628. console.log('upload successfully')
  629. this.form.files = url
  630. this.$refs.form.validate()
  631. },
  632. validateState(rule, value, callback) {
  633. console.log(rule)
  634. console.log(value)
  635. return new Promise((resolve, reject) => {
  636. if (value !== null && value !== undefined && value !== '' && value !== 0) {
  637. resolve(true)
  638. } else {
  639. return callback(new Error('材质不能为空'))
  640. }
  641. })
  642. },
  643. validateSize(rule, value, callback) {
  644. console.log(value)
  645. return new Promise((resolve, reject) => {
  646. const value = this.zEngineeringMaterialBo[rule.index].specifications
  647. console.log(value)
  648. if (value !== null && value !== undefined && value !== '' && value !== 0) {
  649. resolve(true)
  650. } else {
  651. return callback(new Error('规格不能为空'))
  652. }
  653. })
  654. },
  655. validateNumber(rule, value, callback) {
  656. console.log(value)
  657. return new Promise((resolve, reject) => {
  658. const value = this.zEngineeringMaterialBo[rule.index].number
  659. // 至少有一个图片、一个用料信息、一个创建时间
  660. if (value) {
  661. resolve(true)
  662. } else {
  663. return reject(new Error('数量不能为空'))
  664. }
  665. })
  666. },
  667. updateNodeOption(value) {
  668. try {
  669. this.form.zEngineeringNodeBo.zEngineeringInfoBoList = this.form.zEngineeringNodeBo.zEngineeringInfoBoList.filter(obj => value.map(o => o.id).includes(obj.id))
  670. } catch (e) {
  671. }
  672. this.form.files = this.form.pics
  673. EditEngineeEngineeIndustry(this.form).then(res => {
  674. this.$modal.msgSuccess("修改成功");
  675. this.$refs.ConstructionDetails.dialogVisible = false
  676. })
  677. this.getList();
  678. },
  679. // 根据所选材质获取对应规格
  680. getEnginSpecificationsList(item, index) {
  681. this.zEngineeringMaterialBo[index].specifications = null
  682. // 根据材质ID获取材质规格
  683. getEnginSpecificationsList(item.materialQuality).then(res => {
  684. this.zEngineeringMaterialBo.specifications = res.data
  685. })
  686. },
  687. updateMaterBo() {
  688. this.form.zEngineeringNodeBo = []
  689. if (this.zEngineeringMaterialBo.length > 0) {
  690. let valid = true;
  691. if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['materialQuality'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['materialQuality'] == null) {
  692. valid = false;
  693. }
  694. if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['specifications'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['specifications'] == null) {
  695. valid = false;
  696. }
  697. if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['number'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['number'] == null) {
  698. valid = false;
  699. }
  700. if (valid) {
  701. this.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = this.zEngineeringMaterialBo
  702. this.form.zEngineeringNodeBo = this.zEngineeringNodeBo
  703. this.$refs.nodeForm.validate(valid => {
  704. if (valid) {
  705. EditEngineeEngineeIndustry(this.form).then(res => {
  706. this.nodeDetailVisible = false
  707. this.$modal.msgSuccess("新增成功");
  708. })
  709. }
  710. });
  711. } else {
  712. this.$message.warning('完善信息!')
  713. }
  714. }
  715. },
  716. //添加用料
  717. addzEngineeringMaterialBo() {
  718. if (this.zEngineeringMaterialBo.length > 0) {
  719. let valid = true;
  720. if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['materialQuality'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['materialQuality'] == null) {
  721. valid = false;
  722. }
  723. if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['specifications'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['specifications'] == null) {
  724. valid = false;
  725. }
  726. if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['number'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['number'] == null) {
  727. valid = false;
  728. }
  729. if (valid) {
  730. this.zEngineeringMaterialBo.push({
  731. materialQuality: '', // 用料材质
  732. specifications: '', // 用料规格
  733. number: '' // 用料数量
  734. })
  735. } else {
  736. this.$message.warning('完善信息!')
  737. }
  738. }
  739. },
  740. // 删除用料信息
  741. removezEngineeringMaterialBo(index) {
  742. this.zEngineeringMaterialBo.splice(index, 1)
  743. },
  744. // 工程类型与工程分类与节点类型
  745. getType() {
  746. getDicts("industry_engin_type").then(res => {
  747. this.EngineepipeType = res.data
  748. });
  749. getDicts("engin_classification").then(res => {
  750. this.enginClassificationList = res.data
  751. })
  752. },
  753. clickByType(value) {
  754. this.flag = null;
  755. if (!value) return;
  756. let str = '';
  757. if (value == '室内管线') {
  758. str = 'gy_inner'
  759. } else if (value == '室外管线') {
  760. str = 'gy_out'
  761. } else if (value == '调压柜') {
  762. str = 'gy_tyg'
  763. } else {
  764. return;
  765. }
  766. this.flag = str;
  767. getDicts(str).then(res => {
  768. this.nodeList = res.data
  769. })
  770. },
  771. enginNodeStatusExecuted(item) {
  772. console.log(item)
  773. try {
  774. return this.form.nodeReViewStateList.find(o => o.Type == item.dictLabel).state == '1';
  775. } catch (error) {
  776. return false
  777. }
  778. },
  779. addNewPipe(data) {
  780. this.$refs.enginPipe.openDialog({
  781. id: data.id,
  782. type: this.form.type
  783. }, 'add', data)
  784. },
  785. //添加用料信息
  786. addzEngineeringMaterBo(data) {
  787. this.title = "添加用料";
  788. this.reset();
  789. const id = data.id
  790. putEngineeEngineeIndustry(id).then(res => {
  791. this.form = res.data;
  792. this.clickByType(this.form.enginClassification)
  793. this.currentType = 'addMaterial'
  794. this.open = true
  795. })
  796. },
  797. async viewSource(e, type = null) {
  798. console.log('历史',e)
  799. this.currentId = e.id
  800. if (!e.enginClassification)return;
  801. let str = '';
  802. if (e.enginClassification == '室内管线') {
  803. str = 'gy_inner'
  804. } else if (e.enginClassification == '室外管线') {
  805. str = 'gy_out'
  806. } else if (e.enginClassification == '调压柜') {
  807. str = 'gy_tyg'
  808. }
  809. const r = await getDicts(str)
  810. let dict = []
  811. for (let i = 0; i < r.data.length; i++) {
  812. dict.push({
  813. label: r.data[i].dictLabel,
  814. value: r.data[i].dictValue
  815. })
  816. }
  817. if (type) {
  818. this.status = 'review'
  819. } else {
  820. this.status = 'read-only'
  821. }
  822. this.$refs.ConstructionDetails.open(dict, null, null, null, this.status, e.enginClassification)
  823. },
  824. async updateviewSource(e) {
  825. this.currentId = e.id
  826. if (!e.enginClassification)return;
  827. let str = '';
  828. if (e.enginClassification == '室内管线') {
  829. str = 'gy_inner'
  830. } else if (e.enginClassification == '室外管线') {
  831. str = 'gy_out'
  832. } else if (e.enginClassification == '调压柜') {
  833. str = 'gy_tyg'
  834. }
  835. const r = await getDicts(str)
  836. let dict = []
  837. for (let i = 0; i < r.data.length; i++) {
  838. dict.push({
  839. label: r.data[i].dictLabel,
  840. value: r.data[i].dictValue
  841. })
  842. }
  843. this.status = 'put'
  844. this.$refs.ConstructionDetails.open(dict, null, null, null, this.status, e.enginClassification)
  845. },
  846. viewNodeSource(e) {
  847. if (!e) return
  848. // todo: 获取数据
  849. QueryEngineeIndustry({
  850. id: this.currentId,
  851. type: e
  852. }).then(res => {
  853. this.createTime = res.data.createTime
  854. this.form = res.data
  855. try {
  856. this.currentCollapses = res.data.zEngineeringNodeBo.zEngineeringInfoBoList
  857. this.$refs.ConstructionDetails.setEngineId(res.data.zEngineeringNodeBo.id || null)
  858. } catch (error) {
  859. this.currentCollapses = [];
  860. }
  861. })
  862. },
  863. nodeCancel() {
  864. this.nodeDetailVisible = false
  865. this.reset()
  866. },
  867. getUrl(url) {
  868. this.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList = this.$refs.obsImageUpload.fileList ? this.$refs.obsImageUpload.fileList.map(e => e.url) : [];
  869. },
  870. /** 查询工业工程 */
  871. getList(val) {
  872. this.loading = true;
  873. getEngineeIndustryList(this.searchParams).then(res => {
  874. this.comprehensiveList = res.rows;
  875. this.total = res.total;
  876. this.loading = false;
  877. });
  878. },
  879. // 取消按钮
  880. cancel() {
  881. this.open = false;
  882. this.reset();
  883. },
  884. // 表单重置
  885. reset() {
  886. for (let formKey in this.form) {
  887. this.form[formKey] = null
  888. }
  889. this.form.zEngineeringNodeBo = {}
  890. this.form.zEngineeringNodeBo.zEngineeringInfoBo = {}
  891. this.zEngineeringMaterialBo = []
  892. this.zEngineeringMaterialBo.push({
  893. materialQuality: '', // 用料材质
  894. specifications: '', // 用料规格
  895. number: '' // 用料数量
  896. })
  897. this.getType()
  898. },
  899. /** 搜索按钮操作 */
  900. handleQuery() {
  901. this.searchParams.pageNum = 1;
  902. this.getList();
  903. },
  904. /** 重置按钮操作 */
  905. resetQuery() {
  906. this.resetForm("searchParams");
  907. this.handleQuery();
  908. },
  909. // 多选框选中数据
  910. handleSelectionChange(selection) {
  911. this.ids = selection.map(item => item.id)
  912. this.single = selection.length !== 1
  913. this.multiple = !selection.length
  914. },
  915. /** 新增按钮操作 */
  916. handleAdd() {
  917. this.reset();
  918. this.gc = true
  919. this.title = "新增工业工程";
  920. this.currentType = 'add'
  921. this.open = true;
  922. },
  923. removeFile(val) {
  924. this.form.files = val
  925. },
  926. /** 修改按钮操作 */
  927. handleUpdate(row) {
  928. this.gc = false
  929. this.loading = true;
  930. this.reset();
  931. const id = row.id || this.ids
  932. putEngineeEngineeIndustry(id).then(response => {
  933. this.loading = false;
  934. this.form = response.data;
  935. if (response.data.zEngineeringNodeBoList !== undefined && response.data.zEngineeringNodeBoList.length > 0) {
  936. this.zEngineeringNodeBo = response.data.zEngineeringNodeBoList[0]
  937. if (response.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList !== undefined && response.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList.length > 0) {
  938. this.zEngineeringNodeBo.zEngineeringInfoBo = response.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList[0]
  939. }
  940. }
  941. this.title = "修改工业工程";
  942. this.currentType = 'put'
  943. this.open = true;
  944. });
  945. },
  946. toNodeDetail() {
  947. this.$refs["form"].validate(valid => {
  948. if (valid) {
  949. let nodeCollection = []
  950. // 收集节点信息
  951. this.currentCheckList.forEach((e, idx) => {
  952. let nodeItem = this.$refs['EnginNodeInfo' + idx][0].infoCollection()
  953. nodeCollection.push(nodeItem)
  954. })
  955. this.form.zEngineeringNodeBoList = nodeCollection
  956. console.log(this.form.zEngineeringNodeBoList)
  957. if (this.title == '添加用料') {
  958. this.buttonLoading = true
  959. addEngineeEngineeIndustry(this.form).then(res => {
  960. if (res.code == 200) {
  961. this.$message({
  962. message: '添加成功',
  963. type: 'success'
  964. });
  965. this.buttonLoading = false
  966. this.open = false
  967. this.currentCheckList = []
  968. this.getList()
  969. }
  970. })
  971. }
  972. }
  973. })
  974. },
  975. /** 提交按钮 */
  976. submitForm() {
  977. this.$refs["form"].validate(valid => {
  978. if (valid) {
  979. this.form.files = this.$refs.obsFileUpload.fileList;
  980. if (this.form.files.length === 0) {
  981. this.$message.warning('必须上传附件!')
  982. return
  983. }
  984. this.form.zEngineeringNodeBo = null
  985. if (this.zEngineeringNodeBo.type !== '') {
  986. this.form.zEngineeringNodeBo = this.zEngineeringNodeBo
  987. this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = this.zEngineeringMaterialBo
  988. }
  989. // if (this.form.enginClassification && this.form.enginClassification != [] && this.form.enginClassification.length > 0) {
  990. // this.form.enginClassification = this.form.enginClassification.join(',');
  991. // } else {
  992. // this.form.enginClassification = ""
  993. // }
  994. if (this.form.id == null) {
  995. addEngineeEngineeIndustry(this.form).then(res => {
  996. this.$modal.msgSuccess("新增成功");
  997. this.open = false;
  998. this.nodeDetailVisible = false
  999. this.getList();
  1000. })
  1001. } else {
  1002. UpdateEngineeIndustry(this.form).then(res => {
  1003. this.$modal.msgSuccess("修改成功");
  1004. this.open = false;
  1005. this.nodeDetailVisible = false
  1006. this.getList();
  1007. })
  1008. }
  1009. }
  1010. });
  1011. },
  1012. /** 删除按钮操作 */
  1013. handleDelete(row) {
  1014. const ids = row.id || this.ids;
  1015. this.$modal.confirm('是否确认删除所选择的数据项?').then(() => {
  1016. this.loading = true;
  1017. return DelEngineeEngineeIndustry(ids);
  1018. }).then(() => {
  1019. this.loading = false;
  1020. this.getList();
  1021. this.$modal.msgSuccess("删除成功");
  1022. }).catch(() => {
  1023. }).finally(() => {
  1024. this.loading = false;
  1025. });
  1026. },
  1027. /** 导出按钮操作 */
  1028. handleExport() {
  1029. this.download('zdsz/engineeringIndustry/export', {
  1030. ...this.queryParams
  1031. }, `comprehensive_${new Date().getTime()}.xlsx`)
  1032. }
  1033. }
  1034. };
  1035. </script>
  1036. <style lang="scss" scoped>
  1037. ::v-deep .appendElDialog {
  1038. width: 70%;
  1039. height: 80%;
  1040. .el-dialog__body {
  1041. height: 85%;
  1042. overflow-y: scroll;
  1043. }
  1044. .el-form-item {
  1045. margin-bottom: 22px;
  1046. padding-left: 30px;
  1047. width: 44%;
  1048. display: inline-block;
  1049. }
  1050. .el-form-item:nth-child(2n+2) {
  1051. margin-left: 5%;
  1052. }
  1053. .el-form-item:not(:nth-child(1):nth-child(2)) {
  1054. margin-top: 0.5%;
  1055. }
  1056. .remark_input {
  1057. .el-textarea__inner {
  1058. width: 238%;
  1059. height: 190px;
  1060. }
  1061. }
  1062. }
  1063. ::v-deep .appendElNodeDialog {
  1064. // width: 70%;
  1065. height: 80%;
  1066. .el-select {
  1067. width: 70%
  1068. }
  1069. .el-dialog__body {
  1070. height: 85%;
  1071. }
  1072. .el-form-item {
  1073. margin-bottom: 22px;
  1074. width: 100%;
  1075. display: inline-block;
  1076. }
  1077. .el-form-item:not(:nth-child(1):nth-child(2)) {
  1078. margin-top: 0.5%;
  1079. }
  1080. }
  1081. </style>