index.vue 19 KB

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