index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. <!--
  2. *@description: 顶管工程
  3. *@author: yh Fu
  4. *@date: 2024-01-04 09:24:57
  5. *@version: V1.0.5
  6. -->
  7. <template>
  8. <div class="app-container">
  9. <!-- 新增主表与节点-->
  10. <el-dialog :title="title" :visible.sync="open" append-to-body customClass="appendElDialog">
  11. <el-form ref="form" :model="queryParams" :rules="rules" label-width="110px">
  12. <el-row :gutter="20">
  13. <el-col :span="12">
  14. <!-- <el-form-item label="工程类型" prop="type" v-show="!queryParams.id">
  15. <el-select v-model="queryParams.type" placeholder="请选择类型" disabled >
  16. <el-option
  17. v-for="e in dict.type.engin_type"
  18. :key="e.value"
  19. :label="e.label"
  20. :value="e.value"
  21. ></el-option>
  22. </el-select>
  23. </el-form-item> -->
  24. </el-col>
  25. <!-- <el-col :span="12">-->
  26. <!-- <el-form-item label="节点类型" prop="zEngineeringNodeBoType">-->
  27. <!-- <el-select v-model="queryParams.zEngineeringNodeBo.type" placeholder="请选择节点类型">-->
  28. <!-- <el-option-->
  29. <!-- v-for="e in dict.type.pipe_jack"-->
  30. <!-- :key="e.value"-->
  31. <!-- :label="e.label"-->
  32. <!-- :value="e.value"-->
  33. <!-- ></el-option>-->
  34. <!-- </el-select>-->
  35. <!-- </el-form-item>-->
  36. <!-- </el-col>-->
  37. </el-row>
  38. <el-row :gutter="20">
  39. <el-col :span="12">
  40. <el-form-item label="工程名称" prop="enginName">
  41. <el-input v-model="queryParams.enginName" placeholder="请填写工程名称" maxlength="60" :disabled="title == '添加用料' "></el-input>
  42. </el-form-item>
  43. </el-col>
  44. <el-col :span="12">
  45. <el-form-item label="工程地址" prop="enginAddre">
  46. <el-input v-model="queryParams.enginAddre" placeholder="请填写工程地址" maxlength="100" :disabled="title == '添加用料' "></el-input>
  47. </el-form-item>
  48. </el-col>
  49. </el-row>
  50. <el-row :gutter="20">
  51. <el-col :span="12">
  52. <el-form-item label="工程编码" prop="enginCode">
  53. <el-input v-model="queryParams.enginCode" placeholder="请填写工程编码" maxlength="50" :disabled="title == '添加用料' "></el-input>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :span="12">
  57. <el-form-item label="施工单位" prop="constructUnit">
  58. <el-input v-model="queryParams.constructUnit" placeholder="请填写施工单位" maxlength="100" :disabled="title == '添加用料' "></el-input>
  59. </el-form-item>
  60. </el-col>
  61. </el-row>
  62. <el-row :gutter="20">
  63. <el-col :span="12">
  64. <el-form-item label="工程规模" prop="enginScale">
  65. <el-input v-model="queryParams.enginScale" placeholder="请填写工程规模" maxlength="50" :disabled="title == '添加用料' "></el-input>
  66. </el-form-item>
  67. </el-col>
  68. <el-col :span="12">
  69. <el-form-item label="施工质量" prop="constructQuality">
  70. <el-input v-model="queryParams.constructQuality" placeholder="请填写施工质量" maxlength="50" :disabled="title == '添加用料' "></el-input>
  71. </el-form-item>
  72. </el-col>
  73. </el-row>
  74. <el-row :gutter="20">
  75. <el-col :span="12">
  76. <el-form-item label="PE管材预设" prop="pePreset">
  77. <el-input v-model="queryParams.pePreset" placeholder="请填写PE管材预设" maxlength="20" oninput="value=value.match(/\d+(\.\d{0,1})?/) ? value.match(/\d+(\.\d{0,1})?/)[0] : ''"></el-input>
  78. </el-form-item>
  79. </el-col>
  80. <el-col :span="12">
  81. <el-form-item label="钢材预设" prop="gcPreset">
  82. <el-input v-model="queryParams.gcPreset" placeholder="请填写钢材预设" maxlength="13" oninput="value=value.match(/\d+(\.\d{0,1})?/) ? value.match(/\d+(\.\d{0,1})?/)[0] : ''"></el-input>
  83. </el-form-item>
  84. </el-col>
  85. </el-row>
  86. <el-row :gutter="20">
  87. <el-col :span="12">
  88. <el-form-item label="施工进度" prop="constructSchedule">
  89. <el-input v-model="queryParams.constructSchedule" placeholder="请填写施工进度" maxlength="50" :disabled="title == '添加用料' "/>
  90. </el-form-item>
  91. </el-col>
  92. <!-- <el-col :span="12">-->
  93. <!-- <el-form-item label="备注" prop="remark">-->
  94. <!-- <el-input-->
  95. <!-- v-model="queryParams.remark"-->
  96. <!-- type="textarea"-->
  97. <!-- placeholder="请输入内容"-->
  98. <!-- maxlength="255"-->
  99. <!-- :disabled="title == '添加用料' "-->
  100. <!-- />-->
  101. <!-- </el-form-item>-->
  102. <!-- </el-col>-->
  103. </el-row>
  104. <el-row :gutter="20">
  105. <el-col :span="24">
  106. <el-form-item label="文件" prop="" v-if="currentType=='put'">
  107. <ObsFileUpload ref="obsFileUpload" :file-size="100" :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg','mp4']" :limit="9999" :value="queryParams.pics" :disabled="title == '添加用料' "
  108. ></ObsFileUpload>
  109. </el-form-item>
  110. <el-form-item label="文件" prop="" v-if="currentType=='add'">
  111. <ObsFileUpload ref="obsFileUpload" :file-size="100" :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg','mp4']" :limit="9999" :value="queryParams.files" :disabled="title == '添加用料' "
  112. ></ObsFileUpload>
  113. </el-form-item>
  114. </el-col>
  115. </el-row>
  116. <el-form-item label="节点" style="width: 100%;margin-left: 0;" v-if="title!=='修改顶管信息' ">
  117. <el-checkbox-group v-model="currentCheckList">
  118. <el-checkbox
  119. :label="item.label"
  120. v-for="item in checkList"
  121. :key="item.label"
  122. ></el-checkbox>
  123. </el-checkbox-group>
  124. </el-form-item>
  125. <EnginNodeInfo
  126. v-for="(e,idx) in currentCheckList"
  127. :key="idx"
  128. :name="e"
  129. :ref="'EnginNodeInfo'+idx"
  130. :currentContain="(listContain.find(i => i.name == e)).components"
  131. :updateOption='(updateOption.find(i => i.type == e)) || {}'
  132. :types="currentCheckList"
  133. :status="enginNodeStatus"
  134. enginType="顶管工程"
  135. />
  136. </el-form>
  137. <div slot="footer" class="dialog-footer">
  138. <!-- <el-button type="primary" @click="submitData">提交</el-button> -->
  139. <el-button :loading="buttonLoading" type="primary" @click="toNodeDetail">{{keyWork}}</el-button>
  140. <el-button @click="cancel">取 消</el-button>
  141. </div>
  142. </el-dialog>
  143. <!-- 节点信息dialog -->
  144. <enginee-node
  145. @closeToSucceed="closeToSucceed"
  146. @files="getFiles"
  147. ref="childNode"
  148. />
  149. </div>
  150. </template>
  151. <script>
  152. import {getComprehensive, delComprehensive} from "@/api/zdsz/comprehensive";
  153. import EnginNodeInfo from "@/components/EnginNodeInfo/index";
  154. import {
  155. getEngineeList, // 查询工程列表
  156. addEnginee, // 新增工程
  157. getDictList, putEngineeringPipeJacking,
  158. addEngineeringPipeJacking
  159. } from "@/api/zdsz/enginee"
  160. import EngineeNode from '@/components/EngineeNode/index'
  161. // 节点信息
  162. export default {
  163. name: "EngineePipe",
  164. components: {
  165. EngineeNode,
  166. EnginNodeInfo
  167. },
  168. dicts: ['pipe_jack'],
  169. data() {
  170. return {
  171. // 按钮loading
  172. buttonLoading: false,
  173. // 遮罩层
  174. loading: true,
  175. // 选中数组
  176. ids: [],
  177. keyWork:'新增',
  178. // 非单个禁用
  179. single: true,
  180. // 非多个禁用
  181. multiple: true,
  182. // 显示搜索条件
  183. showSearch: true,
  184. // 总条数
  185. total: 0,
  186. // 开栓|安检|维修表格数据
  187. comprehensiveList: [],
  188. // 弹出层标题
  189. title: "顶管信息",
  190. // 是否显示弹出层
  191. open: false,
  192. // 查询参数
  193. queryParams: {
  194. files:[],
  195. enginId: null, // 外建工程
  196. enginName: '', // 工程名称
  197. enginAddre: '', // 工程地址
  198. enginScale: '', // 工程名称联系方式
  199. enginCode: '', // 工程编码
  200. constructQuality: '', // 施工质量
  201. constructSchedule: "", // 施工进度
  202. remark: '', // 备注
  203. pePreset: 0, // PE管材预设量
  204. gcPreset: 0, // 钢材预设量
  205. constructUnit: null,
  206. zEngineeringNodeBo: {
  207. type: null,
  208. zEngineeringInfoBo: {}, //节点信息
  209. },
  210. zEngineeringNodeBoList:[]
  211. },
  212. zEngineeringInfoBo: {
  213. constructAddre: '', // 施工地址
  214. constructPhone: '', // 施工人电话
  215. constructUser: '', // 施工人
  216. headName: '', // 负责人
  217. headPhone: '', // 负责人电话
  218. constructAccordingDrawings: '', // 是否按图纸施工
  219. segmentedCompressionQualified: '', // 分段打压是否合格
  220. selfClosingValveType: '', // 自闭阀类型
  221. visitType: '', // 上门类型
  222. backfillTime: '', // 回填时间
  223. constructTime: '', // 施工时间
  224. zEngiineeringPhotoBoList: [], // 图片列表
  225. zEngineeringMaterialBo: [],// 用料对象
  226. },
  227. constructAccordingDrawingsOption: [
  228. {
  229. value: '1',
  230. label: '是'
  231. },
  232. {
  233. value: '0',
  234. label: '否'
  235. }
  236. ],
  237. nodeDetailVisible: false,
  238. // 表单参数
  239. form: {},
  240. // 表单校验
  241. rules: {
  242. constructSchedule: [
  243. {required: true, message: "施工进度不能为空", trigger: 'blur'}
  244. ],
  245. constructQuality: [
  246. {required: true, message: "施工质量不能为空", trigger: 'blur'}
  247. ],
  248. constructUnit: [
  249. {required: true, message: "施工单位不能为空", trigger: 'blur'}
  250. ],
  251. enginName: [
  252. {required: true, message: "工程名称不能为空", trigger: 'blur'}
  253. ],
  254. enginAddre: [
  255. {required: true, message: "工程地址不能为空", trigger: 'blur'}
  256. ],
  257. enginScale: [
  258. {required: true, message: "工程规模不能为空", trigger: 'blur'}
  259. ],
  260. enginCode: [
  261. {required: true, message: "工程编码不能为空", trigger: 'blur'}
  262. ],
  263. files: [
  264. { required: false, message: '必须上传文件!', trigger: 'change' },
  265. ]
  266. },
  267. currentType: null, // 组件类型 put修改 add新增
  268. currentCheckList:[],
  269. enginNodeStatus:null,
  270. checkList:[],
  271. updateOption:[],
  272. listContain:[
  273. {
  274. name:'进场',
  275. components:[
  276. [
  277. 'materialQuality', // 材质
  278. 'specifications', // 规格
  279. 'number', // 数量
  280. 'remark', // 描述
  281. ],
  282. 'constructTime', // 施工时间
  283. 'zEngiineeringPhotoBoList', // 照片
  284. ]
  285. },
  286. {
  287. name:'导向',
  288. components:[
  289. [
  290. 'materialQuality', // 材质
  291. 'specifications', // 规格
  292. 'number', // 数量
  293. 'remark', // 描述
  294. ],
  295. 'constructTime', // 施工时间
  296. 'zEngiineeringPhotoBoList', // 照片
  297. ]
  298. },
  299. {
  300. name:'扩孔',
  301. components:[
  302. [
  303. 'materialQuality', // 材质
  304. 'specifications', // 规格
  305. 'number', // 数量
  306. 'remark', // 描述
  307. ],
  308. 'constructTime', // 施工时间
  309. 'zEngiineeringPhotoBoList', // 照片
  310. ]
  311. },
  312. {
  313. name:'回拖',
  314. components:[
  315. [
  316. 'materialQuality', // 材质
  317. 'specifications', // 规格
  318. 'number', // 数量
  319. 'remark', // 描述
  320. ],
  321. 'constructTime', // 施工时间
  322. 'zEngiineeringPhotoBoList', // 照片
  323. ]
  324. }
  325. ]
  326. };
  327. },
  328. created() {
  329. },
  330. mounted(){
  331. this.checkList = this.dict.type.pipe_jack
  332. },
  333. methods: {
  334. // 顶管工程修改
  335. async putEnginPipe(data, type) {
  336. this.enginNodeStatus = '修改'
  337. await this.reset();
  338. let newData = data
  339. // let zEngineeringNodeBo = {
  340. // type: data.zEngineeringNodeBoList[0].type,
  341. // zEngineeringInfoBo: data.zEngineeringNodeBoList[0].zEngineeringInfoBoList[0]
  342. // }
  343. // newData.zEngineeringNodeBo = zEngineeringNodeBo
  344. this.currentType = type
  345. if (this.currentType=='put'){
  346. this.title = '修改顶管信息'
  347. this.keyWork = '修改'
  348. }
  349. this.queryParams = newData
  350. this.zEngineeringInfoBo = newData.zEngineeringNodeBoList
  351. this.open = true
  352. },
  353. closeToSucceed() {
  354. this.open = false
  355. this.nodeDetailVisible = false
  356. },
  357. getFiles(flag){
  358. if (flag){
  359. this.$refs.obsFileUpload.fileList=this.queryParams.files
  360. }
  361. },
  362. async openDialog(data, type,sata) {
  363. await this.reset();
  364. this.currentCheckList=[]
  365. this.currentType = type
  366. if (this.currentType == 'add') {
  367. this.title = '新增顶管信息'
  368. this.queryParams.enginId = data.id
  369. } else if (this.currentType == 'put') {
  370. this.title = '修改顶管信息'
  371. } else if (this.currentType == 'addMaterial') {
  372. this.title = '添加用料'
  373. this.enginNodeStatus = '添加用料'
  374. this.queryParams = sata
  375. }
  376. this.queryParams.type = data.type
  377. //带值(民用工程、工业工程、市政工程)
  378. if (data.type=='民用工程'){
  379. this.queryParams.enginAddre =
  380. sata.district + ' - ' + sata.areaName + ' - ' + sata.buildingName + ' - ' + sata.unitName + ' - ' + sata.houseName;
  381. }
  382. if (['工业工程','市政工程','顶管工程','碰口作业'].includes(data.type)){
  383. this.queryParams.enginName = sata.enginName;
  384. }
  385. //带值
  386. this.queryParams.enginName = sata.enginName?sata.enginName:'';
  387. this.open = true
  388. },
  389. nodeCancel() {
  390. this.nodeDetailVisible = false
  391. },
  392. submitData(){
  393. // this.queryParams.files = this.$refs.obsFileUpload.fileList;
  394. if (this.$refs.obsFileUpload.fileList==null||this.$refs.obsFileUpload.fileList.length===0){
  395. this.$message.warning('必须上传文件!')
  396. return
  397. }
  398. this.$refs["form"].validate(valid => {
  399. if (valid) {
  400. if (this.queryParams.id != null) {
  401. putEngineeringPipeJacking(this.queryParams).then(response => {
  402. this.$modal.msgSuccess("修改成功");
  403. this.open = false;
  404. this.getList();
  405. }).finally(() => {
  406. });
  407. }
  408. }})
  409. },
  410. toNodeDetail() {
  411. let nodeCollection = []
  412. // 收集节点信息
  413. this.currentCheckList.forEach((e, idx) => {
  414. let nodeItem = this.$refs['EnginNodeInfo' + idx][0].infoCollection()
  415. nodeCollection.push(nodeItem)
  416. })
  417. this.queryParams.zEngineeringNodeBoList = nodeCollection
  418. // this.queryParams.zEngineeringNodeBoList[0].zEngineeringInfoBo.constructTime = this.queryParams.zEngineeringNodeBoList[0].constructTime
  419. // delete this.queryParams.zEngineeringNodeBoList[0].constructTime
  420. if (this.enginNodeStatus == '修改') {
  421. this.$refs["form"].validate(valid => {
  422. if (valid) {
  423. this.queryParams.files = this.$refs.obsFileUpload.fileList;
  424. if (this.$refs.obsFileUpload.fileList==null||this.$refs.obsFileUpload.fileList.length===0){
  425. this.$message.warning('必须上传文件!')
  426. return
  427. }
  428. if (this.queryParams.id != null) {
  429. putEngineeringPipeJacking(this.queryParams).then(response => {
  430. this.$modal.msgSuccess("修改成功");
  431. this.open = false;
  432. this.currentCheckList = []
  433. this.$parent.getList();
  434. })
  435. }
  436. }})
  437. }
  438. else if(this.enginNodeStatus == '添加用料'){
  439. addEngineeringPipeJacking(this.queryParams).then(res => {
  440. if(res.code == 200){
  441. this.$message({
  442. message: '添加成功',
  443. type: 'success'
  444. });
  445. this.open = false
  446. console.log('选中节点集合',this.currentCheckList)
  447. this.currentCheckList = []
  448. this.getList()
  449. // this.$emit('closeToSucceed')
  450. }
  451. })
  452. }
  453. else {
  454. this.$refs["form"].validate(valid => {
  455. if (valid) {
  456. this.queryParams.files = this.$refs.obsFileUpload.fileList;
  457. if (this.$refs.obsFileUpload.fileList==null||this.$refs.obsFileUpload.fileList.length===0){
  458. this.$message.warning('必须上传文件!')
  459. return
  460. }
  461. // if (this.queryParams!=null){
  462. // delete this.queryParams.zEngineeringNodeBoList
  463. // delete this.queryParams.zEngineeringNodeBo
  464. // }
  465. addEngineeringPipeJacking(this.queryParams).then(res => {
  466. if (res.code == 200) {
  467. this.$message({
  468. message: '新增成功',
  469. type: 'success'
  470. });
  471. this.open = false
  472. console.log('选中节点集合', this.currentCheckList)
  473. this.currentCheckList = []
  474. this.getList()
  475. // this.$emit('closeToSucceed')
  476. }
  477. })
  478. }})
  479. }
  480. },
  481. // 取消按钮
  482. cancel() {
  483. this.open = false;
  484. this.reset();
  485. },
  486. // 表单重置
  487. reset() {
  488. this.queryParams.files=[]
  489. this.resetForm("form");
  490. },
  491. /** 提交按钮 */
  492. submitForm() {
  493. this.queryParams.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
  494. addEnginee(this.queryParams).then(res => {
  495. })
  496. }
  497. }
  498. };
  499. </script>
  500. <style lang="scss" scoped>
  501. ::v-deep .appendElDialog {
  502. width: 950px;
  503. height: 700px;
  504. .el-dialog__footer {
  505. padding: 20px;
  506. padding-top: 0px;
  507. text-align: right;
  508. -webkit-box-sizing: border-box;
  509. box-sizing: border-box;
  510. }
  511. .el-dialog__body {
  512. overflow: hidden;
  513. overflow-y: scroll;
  514. height: 85%;
  515. }
  516. .el-form-item:nth-child(2n+2) {
  517. margin-left: 5%;
  518. }
  519. .el-form-item:not(:nth-child(1):nth-child(2)) {
  520. margin-top: 0.5%;
  521. }
  522. .remark_input {
  523. .el-textarea__inner {
  524. width: 238%;
  525. height: 190px;
  526. }
  527. }
  528. }
  529. ::v-deep .appendElNodeDialog {
  530. // width: 70%;
  531. height: 80%;
  532. .el-dialog__body {
  533. height: 85%;
  534. }
  535. .el-form-item {
  536. margin-bottom: 22px;
  537. width: 44%;
  538. display: inline-block;
  539. }
  540. .el-form-item:nth-child(2n+2) {
  541. margin-left: 5%;
  542. }
  543. .el-form-item:not(:nth-child(1):nth-child(2)) {
  544. margin-top: 0.5%;
  545. }
  546. }
  547. </style>