index.vue 37 KB

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