index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  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="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="110px">
  10. <el-form-item label="工程名称" prop="enginName">
  11. <el-input v-model="queryParams.enginName" placeholder="请输入建筑工程名称" maxlength="20"></el-input>
  12. </el-form-item>
  13. <el-form-item label="工程分类" prop="enginClassification" v-if="engineeType">
  14. <el-select v-model="queryParams.enginClassification" placeholder="请选择工程分类">
  15. <el-option
  16. v-for="e in dict.type.engin_classification"
  17. :key="e.value"
  18. :label="e.label"
  19. :value="e.value"
  20. ></el-option>
  21. </el-select>
  22. </el-form-item>
  23. <el-form-item>
  24. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  25. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  26. </el-form-item>
  27. </el-form>
  28. <el-row :gutter="10" class="mb8">
  29. <el-col :span="1.5">
  30. <el-button
  31. type="primary"
  32. plain
  33. icon="el-icon-plus"
  34. size="mini"
  35. @click="handleAdd"
  36. v-hasPermi="['zdsz:engineeringIndustry:add']"
  37. >新增
  38. </el-button>
  39. </el-col>
  40. <el-col :span="1.5">
  41. <el-button
  42. type="success"
  43. plain
  44. icon="el-icon-edit"
  45. size="mini"
  46. :disabled="single"
  47. @click="handleUpdate"
  48. v-hasPermi="['zdsz:engineeringIndustry:edit']"
  49. >修改
  50. </el-button>
  51. </el-col>
  52. <el-col :span="1.5">
  53. <el-button
  54. type="danger"
  55. plain
  56. icon="el-icon-delete"
  57. size="mini"
  58. :disabled="multiple"
  59. @click="handleDelete"
  60. v-hasPermi="['zdsz:engineeringIndustry:remove']"
  61. >删除
  62. </el-button>
  63. </el-col>
  64. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  65. </el-row>
  66. <el-table v-loading="loading" :data="comprehensiveList" @selection-change="handleSelectionChange">
  67. <el-table-column type="selection" width="55" align="center"/>
  68. <el-table-column label="工程名称" align="center" prop="enginName"/>
  69. <el-table-column label="建筑单位" align="center" prop="constructUnit"/>
  70. <el-table-column label="项目负责人" align="center" prop="projectHead"/>
  71. <el-table-column label="现场负责人" align="center" prop="sceneHead"/>
  72. <el-table-column label="设计负责人" align="center" prop="designHead"/>
  73. <el-table-column label="设计单位" align="center" prop="designUnit"/>
  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" class-name="small-padding fixed-width">
  77. <template v-slot="scope">
  78. <el-button
  79. size="mini"
  80. type="text"
  81. icon="el-icon-edit"
  82. @click="handleUpdate(scope.row)"
  83. v-hasPermi="['zdsz:engineeringIndustry:edit']"
  84. >修改
  85. </el-button>
  86. <el-button
  87. size="mini"
  88. type="text"
  89. icon="el-icon-delete"
  90. @click="handleDelete(scope.row)"
  91. v-hasPermi="['zdsz:engineeringIndustry:remove']"
  92. >删除
  93. </el-button>
  94. <el-button
  95. size="mini"
  96. type="text"
  97. icon="el-icon-edit"
  98. @click="addNewPipe(scope.row)"
  99. >新增顶管工程
  100. </el-button>
  101. <el-button
  102. type="text"
  103. icon="el-icon-edit"
  104. size="mini"
  105. @click="viewSource(scope.row)"
  106. >历史</el-button>
  107. </template>
  108. </el-table-column>
  109. </el-table>
  110. <pagination
  111. v-show="total>0"
  112. :total="total"
  113. :page.sync="queryParams.pageNum"
  114. :limit.sync="queryParams.pageSize"
  115. @pagination="getList"
  116. />
  117. <!-- 顶管工程新增 -->
  118. <EngineePipe ref="enginPipe"/>
  119. <!-- 添加或修改市政工程|工业工程对话框 -->
  120. <el-dialog :title="title" :visible.sync="open" append-to-body customClass="appendElDialog">
  121. <el-form ref="form" :model="form" :rules="rules" label-width="110px">
  122. <el-form-item label="工程名称" prop="enginName">
  123. <el-input v-model="form.enginName" placeholder="请填写工程名称" maxlength="20"></el-input>
  124. </el-form-item>
  125. <el-form-item label="建筑单位" prop="constructUnit">
  126. <el-input v-model="form.constructUnit" placeholder="请填写建筑单位" maxlength="50"></el-input>
  127. </el-form-item>
  128. <el-form-item label="项目负责人" prop="projectHead">
  129. <el-input v-model="form.projectHead" placeholder="请填写项目负责人" maxlength="20"></el-input>
  130. </el-form-item>
  131. <el-form-item label="现场负责人" prop="sceneHead">
  132. <el-input v-model="form.sceneHead" placeholder="请填写现场负责人" maxlength="20"></el-input>
  133. </el-form-item>
  134. <el-form-item label="设计单位" prop="designUnit">
  135. <el-input v-model="form.designUnit" placeholder="请填写设计单位" maxlength="50"></el-input>
  136. </el-form-item>
  137. <el-form-item label="设计负责人" prop="designHead">
  138. <el-input v-model="form.designHead" placeholder="请填写现场负责人" maxlength="20"></el-input>
  139. </el-form-item>
  140. <el-form-item label="设计联系方式" prop="designPhone">
  141. <el-input v-model="form.designPhone" placeholder="请填写设计联系方式" maxlength="11"></el-input>
  142. </el-form-item>
  143. <el-form-item label="监理单位" prop="supervisionUnit">
  144. <el-input v-model="form.supervisionUnit" placeholder="请填写监理单位" maxlength="50"/>
  145. </el-form-item>
  146. <el-form-item label="监理负责人" prop="supervisionHead">
  147. <el-input v-model="form.supervisionHead" placeholder="请填写监理负责人" maxlength="20"></el-input>
  148. </el-form-item>
  149. <el-form-item label="监理联系电话" prop="supervisionPhone">
  150. <el-input v-model="form.supervisionPhone" placeholder="请填写监理联系电话" maxlength="11"></el-input>
  151. </el-form-item>
  152. <el-form-item label="工程类型" prop="enginType">
  153. <el-select v-model="form.enginType" placeholder="请选择工程类型" style="width: 100%">
  154. <el-option
  155. v-for="e in dict.type.industry_engin_type"
  156. :key="e.value"
  157. :label="e.label"
  158. :value="e.value"
  159. ></el-option>
  160. </el-select>
  161. </el-form-item>
  162. <el-form-item label="工程分类" prop="enginClassification" v-if="form.type === '1'">
  163. <el-select v-model="form.enginClassification" placeholder="请选择工程分类" style="width: 100%">
  164. <el-option
  165. v-for="e in dict.type.engin_classification"
  166. :key="e.value"
  167. :label="e.label"
  168. :value="e.value"
  169. ></el-option>
  170. </el-select>
  171. </el-form-item>
  172. <el-row :gutter="20">
  173. <el-col :span="24">
  174. <el-form-item label="文件" prop="" v-if="currentType==='put'" style="width: 100%">
  175. <ObsFileUpload ref="obsFileUpload" :file-size="100" :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg']" :limit="9999" :value="form.pics"
  176. ></ObsFileUpload>
  177. </el-form-item>
  178. <el-form-item label="文件" prop="" v-if="currentType==='add'" style="width: 100%">
  179. <ObsFileUpload ref="obsFileUpload" :file-size="100" :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg']" :limit="9999" :value="form.files"
  180. ></ObsFileUpload>
  181. </el-form-item>
  182. </el-col>
  183. </el-row>
  184. <div style="width: 20%; float: right">
  185. <el-button :loading="buttonLoading" type="primary" @click="toNodeDetail">填写施工信息</el-button>
  186. <el-button @click="cancel">取 消</el-button>
  187. </div>
  188. </el-form>
  189. </el-dialog>
  190. <!-- 施工信息dialog -->
  191. <el-dialog :visible.sync="nodeDetailVisible" title="施工信息" append-to-body customClass="appendElNodeDialog" width="70% !important">
  192. <!-- 节点表单 -->
  193. <el-form ref="nodeForm" :model="form.zEngineeringNodeBo.zEngineeringInfoBo" :rules="nodeRules" label-width="200px">
  194. <el-form-item label="施工时间" prop="constructTime">
  195. <el-date-picker
  196. v-model="form.zEngineeringNodeBo.zEngineeringInfoBo.constructTime"
  197. value-format="yyyy-MM-dd hh:mm:ss"
  198. type="datetime"
  199. style="width: 100%"
  200. placeholder="请选择施工时间">
  201. </el-date-picker>
  202. </el-form-item>
  203. <el-form-item label="施工人" prop="constructUser" v-if="form.id">
  204. <el-input v-model="form.zEngineeringNodeBo.zEngineeringInfoBo.constructUser" placeholder="请填写施工人" maxlength="20" disabled></el-input>
  205. </el-form-item>
  206. <el-row>
  207. <el-form-item label="照片" prop="zEngiineeringPhotoBoList" style="width: 100%;">
  208. <ObsImageUpload ref="obsImageUpload" :limit="9999" :fileType="['png', 'jpg', 'jpeg']" :value="form.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList"
  209. @input="getUrl"></ObsImageUpload>
  210. </el-form-item>
  211. </el-row>
  212. <el-row v-for="(item, index) in form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo" :key="index">
  213. <el-col :span="7">
  214. <el-form-item
  215. :prop="'zEngineeringMaterialBo.' + index + '.materialQuality'"
  216. label-width="50px"
  217. label="材质" :rules="{required: true, message: '请输入材质', trigger: 'blur'}">
  218. <el-input v-model="item.materialQuality" placeholder="请输入材质" style="width: 100%"/>
  219. </el-form-item>
  220. </el-col>
  221. <el-col :span="7">
  222. <el-form-item
  223. :prop="'zEngineeringMaterialBo.' + index + '.specifications'"
  224. label-width="50px"
  225. label="规格" :rules="{required: true, message: '请输入规格', trigger: 'blur'}">
  226. <el-input v-model="item.specifications" placeholder="请输入规格" style="width: 100%"/>
  227. </el-form-item>
  228. </el-col>
  229. <el-col :span="7">
  230. <el-form-item
  231. :prop="'zEngineeringMaterialBo.' + index + '.number'"
  232. label-width="50px"
  233. label="数量" :rules="{required: true, message: '请输入数量', trigger: 'change'}">
  234. <div class="block" style="display: inline-block; margin-right: 20px;">
  235. <el-input v-model="item.number" placeholder="请输入数量" style="width: 100%"/>
  236. </div>
  237. </el-form-item>
  238. </el-col>
  239. <el-col :span="3">
  240. <el-form-item style="margin-left: -120px;">
  241. <el-button v-if="form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo.length > 1" @click="removezEngineeringMaterialBo(index)">
  242. 删除
  243. </el-button>
  244. </el-form-item>
  245. </el-col>
  246. </el-row>
  247. <div style="width: 25%; float: right">
  248. <el-button @click="addzEngineeringMaterialBo">新增用料信息</el-button>
  249. <el-button :loading="buttonLoading" type="primary" @click="submitForm">提交</el-button>
  250. <el-button @click="nodeCancel">取 消</el-button>
  251. </div>
  252. </el-form>
  253. </el-dialog>
  254. <ConstructionDetails
  255. ref="ConstructionDetails"
  256. :currentCollapses="currentCollapses"
  257. />
  258. </div>
  259. </template>
  260. <script>
  261. import {
  262. addEngineeEngineeIndustry,
  263. DelEngineeEngineeIndustry,
  264. EditEngineeEngineeIndustry,
  265. getEngineeIndustryList,
  266. putEngineeEngineeIndustry,
  267. QueryEngineeIndustry
  268. } from '@/api/zdsz/engineeringIndustry'
  269. import EngineePipe from '@/components/EngineePipe'
  270. import { validPhoneMobile } from '@/api/rules'
  271. import ConstructionDetails from "@/components/ConstructionDetails/index.vue";
  272. import { getEnginMaterialQualityList } from '@/api/zdsz/enginee'
  273. import { getEnginSpecificationsList } from '@/api/zdsz/enginSpecifications'
  274. export default {
  275. name: "openrepair",
  276. dicts: ['pass_check', 'is_repair', 'industry_engin_type', 'self_closing_valve_type', 'visit_type', 'engin_classification','engineering_infrastructure'],
  277. components: {
  278. ConstructionDetails,
  279. EngineePipe
  280. },
  281. data() {
  282. var validatePicPass = (rule, value, callback) => {
  283. console.log('校验值', this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList)
  284. let p = new Promise((resolve, reject) => {
  285. if(this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList.length != 0){
  286. this.$message({
  287. message: '校验通过',
  288. type: 'success'
  289. });
  290. return true
  291. }else{
  292. this.$message({
  293. message: 'no pass',
  294. type: 'error'
  295. });
  296. return false
  297. }
  298. });
  299. return p;
  300. };
  301. return {
  302. // 按钮loading
  303. buttonLoading: false,
  304. // 遮罩层
  305. loading: true,
  306. // 选中数组
  307. ids: [],
  308. // 非单个禁用
  309. single: true,
  310. // 非多个禁用
  311. multiple: true,
  312. // 显示搜索条件
  313. showSearch: true,
  314. // 工程分类显示
  315. engineeType: true,
  316. // 总条数
  317. total: 0,
  318. currentNode:[],
  319. currentCollapses:[],
  320. // 市政工程|工业工程表格数据
  321. comprehensiveList: [],
  322. // 弹出层标题
  323. title: "",
  324. nodeList:[],
  325. // 是否显示弹出层
  326. open: false,
  327. // 查询参数
  328. queryParams: {
  329. enginName: '', // 工程名称
  330. enginClassification: '', // 工程分类
  331. zEngineeringNodeBo: {
  332. type: '',
  333. zEngineeringInfoBo: {}, //施工信息
  334. }
  335. },
  336. constructAccordingDrawingsOption: [ // 是否按图纸施工
  337. {
  338. value: '1',
  339. label: '是'
  340. },
  341. {
  342. value: '0',
  343. label: '否'
  344. }
  345. ],
  346. segmentedCompressionQualifiedOption: [ // 分段打压
  347. {
  348. value: '1',
  349. label: '是'
  350. },
  351. {
  352. value: '0',
  353. label: '否'
  354. }
  355. ],
  356. nodeDetailVisible: false, // 施工信息dialog
  357. // 表单参数
  358. form: {
  359. files:[], // 附件
  360. pics:[], // 附件返回
  361. type:'', // 用来区分工业工程、市政工程
  362. enginName:'', // 工程名称
  363. enginType:'', // 工程类型
  364. constructUnit:'', // 建筑单位
  365. projectHead:'', // 项目负责人
  366. sceneHead:'', // 现场负责人
  367. designUnit:'', // 设计单位
  368. designHead:'', // 设计负责人
  369. designPhone:'', // 设计联系电话
  370. supervisionUnit:'', // 监理单位
  371. supervisionHead:'', // 监理负责人
  372. supervisionPhone:'', // 监理联系电话
  373. enginClassification:'', // 工程分类
  374. zEngineeringNodeBo:{ // 工程节点
  375. type:'', // 节点类型
  376. zEngineeringInfoBo: { // 施工信息
  377. constructUser: '', // 施工人
  378. constructTime: '', // 施工时间
  379. zEngiineeringPhotoBoList: [], // 图片列表
  380. zEngineeringMaterialBo: [ // 用料对象
  381. {
  382. materialQuality: '', // 用料材质
  383. specifications: '', // 用料规格
  384. number: '' // 用料数量
  385. },
  386. ],
  387. },
  388. },
  389. },
  390. zEngineeringAttachmentsList:[], // 工程附件
  391. EngineepipeType: [], // 工程类型
  392. // 表单校验
  393. rules: {
  394. sceneHead: [
  395. {required: true, message: "现场负责人不能为空", trigger: 'blur'}
  396. ],
  397. enginName: [
  398. {required: true, message: "工程名称不能为空", trigger: 'blur'}
  399. ],
  400. enginClassification: [
  401. {required: true, message: "工程分类不能为空", trigger: 'blur'}
  402. ],
  403. supervisionUnit: [
  404. {required: true, message: "监理单位不能为空", trigger: 'blur'}
  405. ],
  406. enginType: [
  407. {required: true, message: "工程类型不能为空", trigger: 'blur'}
  408. ],
  409. supervisionPhone: [
  410. {required: true, message: "监理联系电话不能为空", trigger: 'blur'},
  411. {validator: validPhoneMobile, trigger: 'blur'}
  412. ],
  413. constructUnit: [
  414. {required: true, message: "建筑单位不能为空", trigger: 'blur'}
  415. ],
  416. projectHead: [
  417. {required: true, message: "项目负责人不能为空", trigger: 'blur'}
  418. ],
  419. designHead: [
  420. {required: true, message: "设计负责人不能为空", trigger: 'blur'}
  421. ],
  422. designUnit: [
  423. {required: true, message: "设计单位不能为空", trigger: 'blur'}
  424. ],
  425. designPhone: [
  426. {required: true, message: "联系方式不能为空", trigger: 'blur'},
  427. {validator: validPhoneMobile, trigger: 'blur'}
  428. ],
  429. supervisionHead: [
  430. {required: true, message: "监理负责人不能为空", trigger: 'blur'}
  431. ],
  432. type: [
  433. {required: false, message: "类型不能为空", trigger: "blur"}
  434. ],
  435. remark: [
  436. {required: false, message: "备注不能为空", trigger: "blur"}
  437. ],
  438. zEngineeringAttachmentsList: [
  439. {required: false, message: "附件不能为空", trigger: "blur"}
  440. ],
  441. },
  442. // 节点规则校验
  443. nodeRules: {
  444. // constructTime: [
  445. // {required: true, message: "施工时间不能为空", trigger: ['blur','change']}
  446. // ],
  447. zEngiineeringPhotoBoList: [
  448. {required: true, message: "图片不能为空", trigger: 'change', validator: validatePicPass}
  449. ],
  450. },
  451. currentType: null, // 附件组件类型 put修改 add新增
  452. };
  453. },
  454. created() {
  455. // 根据url获取type节点类型
  456. this.getType();
  457. if (this.form.type === '2') {
  458. this.engineeType = false
  459. }
  460. this.getList();
  461. },
  462. mounted() {
  463. // 手动渲染
  464. setInterval(() =>{
  465. this.$forceUpdate()
  466. },500)
  467. },
  468. methods: {
  469. addzEngineeringMaterialBo(){
  470. console.log(this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo)
  471. this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo.push({
  472. materialQuality: '', // 用料材质
  473. specifications: '', // 用料规格
  474. number: '' // 用料数量
  475. })
  476. },
  477. removezEngineeringMaterialBo(index){
  478. this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo.splice(index, 1)
  479. },
  480. // 根据url获取type节点类型
  481. getType() {
  482. const queryString = window.location.search;
  483. const params = new URLSearchParams(queryString);
  484. const type = params.get('type');
  485. if (type) {
  486. this.form.type = type;
  487. this.form.zEngineeringNodeBo.type = (type === '1' ? "工业工程" : "市政工程")
  488. }
  489. },
  490. // 新增顶管工程
  491. addNewPipe(data) {
  492. this.$refs.enginPipe.openDialog({
  493. id: data.id,
  494. type: this.form.zEngineeringNodeBo.type
  495. }, 'add')
  496. },
  497. // 历史查询
  498. viewSource(e){
  499. this.currentId = e.id
  500. this.$refs.ConstructionDetails.open(_,this.form.type)
  501. },
  502. viewNodeSource(e){
  503. // todo: 获取数据
  504. QueryEngineeIndustry({
  505. id:this.currentId
  506. }).then(res => {
  507. try {
  508. this.currentCollapses = res.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList
  509. console.log('当前历史数据',this.currentCollapses)
  510. } catch (error) {
  511. this.currentCollapses = [];
  512. }
  513. console.log(this.currentCollapses)
  514. })
  515. },
  516. nodeCancel() {
  517. this.nodeDetailVisible = false
  518. },
  519. toNodeDetail() {
  520. this.$refs["form"].validate(valid => {
  521. if (valid) {
  522. this.form.files = this.$refs.obsFileUpload.fileList
  523. this.nodeDetailVisible = true
  524. }
  525. })
  526. },
  527. getUrl(url) {
  528. this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList = this.$refs.obsImageUpload.fileList ? this.$refs.obsImageUpload.fileList.map(e => e.url) : [];
  529. },
  530. /** 查询市政工程|工业工程列表 */
  531. getList() {
  532. this.loading = true;
  533. let enginType = this.form.zEngineeringNodeBo.type;
  534. // 获取材质 市政工程 1 - 工业工程 2
  535. getEnginMaterialQualityList({enginType}).then(res => {
  536. console.log(res);
  537. });
  538. // 获取材质规格
  539. getEnginSpecificationsList('材质ID').then(res => {
  540. console.log(res)
  541. })
  542. getEngineeIndustryList({
  543. type: this.form.type
  544. }).then(res => {
  545. this.comprehensiveList = res.rows;
  546. this.total = res.total;
  547. this.loading = false;
  548. });
  549. },
  550. // 取消按钮
  551. cancel() {
  552. this.open = false;
  553. this.reset();
  554. },
  555. // 表单重置
  556. reset() {
  557. for (let formKey in this.form) {
  558. this.form[formKey] = null
  559. }
  560. this.form.zEngineeringNodeBo={}
  561. this.form.zEngineeringNodeBo.zEngineeringInfoBo={}
  562. this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo=[]
  563. // this.resetForm("form");
  564. // for (let formKey in this.zEngineeringInfoBo) {
  565. // this.zEngineeringInfoBo[formKey] = null
  566. // }
  567. this.getType()
  568. },
  569. /** 搜索按钮操作 */
  570. handleQuery() {
  571. this.queryParams.pageNum = 1;
  572. this.getList();
  573. },
  574. /** 重置按钮操作 */
  575. resetQuery() {
  576. this.resetForm("queryForm");
  577. this.handleQuery();
  578. },
  579. // 多选框选中数据
  580. handleSelectionChange(selection) {
  581. this.ids = selection.map(item => item.id)
  582. this.single = selection.length !== 1
  583. this.multiple = !selection.length
  584. },
  585. /** 新增按钮操作 */
  586. handleAdd() {
  587. this.reset();
  588. this.title = (this.form.type === '1' ? "新增工业工程":"新增市政工程");
  589. this.currentType = 'add'
  590. this.open = true;
  591. },
  592. /** 修改按钮操作 */
  593. handleUpdate(row) {
  594. this.loading = true;
  595. this.reset();
  596. const id = row.id || this.ids
  597. putEngineeEngineeIndustry(id).then(response => {
  598. this.loading = false;
  599. this.form = response.data;
  600. this.form.zEngineeringNodeBo = response.data.zEngineeringNodeBoList[0]
  601. this.form.zEngineeringNodeBo.zEngineeringInfoBo = response.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList[0]
  602. this.title = (this.form.type === '1' ? "修改工业工程":"修改市政工程");
  603. this.currentType = 'put'
  604. this.open = true;
  605. });
  606. },
  607. /** 提交按钮 */
  608. submitForm() {
  609. this.$refs["nodeForm"].validate(valid => {
  610. if (valid) {
  611. if (this.form.id == null) {
  612. console.log(this.form)
  613. // this.form.zEngineeringNodeBo = this.zEngineeringInfoBo
  614. // this.form.zEngineeringNodeBo.zEngineeringInfoBo = {}
  615. // this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList = this.form.zEngineeringNodeBo.zEngiineeringPhotoBoList
  616. // this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = this.form.zEngineeringNodeBo.zEngineeringMaterialBo
  617. addEngineeEngineeIndustry(this.form).then(res => {
  618. this.$modal.msgSuccess("新增成功");
  619. this.open = false;
  620. this.nodeDetailVisible = false
  621. this.getList();
  622. })
  623. } else {
  624. // this.form.zEngineeringNodeBo = this.zEngineeringInfoBo
  625. // this.form.zEngineeringNodeBo.zEngineeringInfoBo = {}
  626. // this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList = this.form.zEngineeringNodeBo.zEngiineeringPhotoBoList
  627. // this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = this.form.zEngineeringNodeBo.zEngineeringMaterialBo
  628. EditEngineeEngineeIndustry(this.form).then(res => {
  629. this.$modal.msgSuccess("修改成功");
  630. this.open = false;
  631. this.nodeDetailVisible = false
  632. this.getList();
  633. })
  634. }
  635. }
  636. });
  637. },
  638. /** 删除按钮操作 */
  639. handleDelete(row) {
  640. const ids = row.id || this.ids;
  641. this.$modal.confirm('是否确认删除所选择的数据项?').then(() => {
  642. this.loading = true;
  643. return DelEngineeEngineeIndustry(ids);
  644. }).then(() => {
  645. this.loading = false;
  646. this.getList();
  647. this.$modal.msgSuccess("删除成功");
  648. }).catch(() => {
  649. }).finally(() => {
  650. this.loading = false;
  651. });
  652. },
  653. /** 导出按钮操作 */
  654. handleExport() {
  655. this.download('zdsz/engineeringIndustry/export', {
  656. ...this.queryParams
  657. }, `comprehensive_${new Date().getTime()}.xlsx`)
  658. }
  659. }
  660. };
  661. </script>
  662. <style lang="scss" scoped>
  663. ::v-deep .appendElDialog {
  664. width: 70%;
  665. height: 80%;
  666. .el-dialog__body {
  667. height: 85%;
  668. }
  669. .el-form-item {
  670. margin-bottom: 22px;
  671. width: 44%;
  672. display: inline-block;
  673. }
  674. .el-form-item:nth-child(2n+2) {
  675. margin-left: 5%;
  676. }
  677. .el-form-item:not(:nth-child(1):nth-child(2)) {
  678. margin-top: 0.5%;
  679. }
  680. .remark_input {
  681. .el-textarea__inner {
  682. width: 238%;
  683. height: 190px;
  684. }
  685. }
  686. }
  687. ::v-deep .appendElNodeDialog {
  688. // width: 70%;
  689. height: 80%;
  690. .el-dialog__body {
  691. height: 85%;
  692. }
  693. .el-form-item {
  694. margin-bottom: 22px;
  695. width: 44%;
  696. display: inline-block;
  697. }
  698. .el-form-item:nth-child(2n+2) {
  699. margin-left: 5%;
  700. }
  701. .el-form-item:not(:nth-child(1):nth-child(2)) {
  702. margin-top: 0.5%;
  703. }
  704. }
  705. </style>