Browse Source

市政工程|工业工程 历史按钮

刘浩男 1 year ago
parent
commit
f568557e87

+ 9 - 2
src/api/zdsz/engineeringIndustry.js

@@ -7,10 +7,10 @@ function getTypeFromUrl(url) {
   return params.get('type');
 }
 
-export function getEngineeIndustryList({enginType ='',}) {
+export function getEngineeIndustryList() {
   const type = getTypeFromUrl(window.location.href);
   return request({
-    url: `/zdsz/engineeringIndustry/list?type=${type}&enginType=${enginType}`,
+    url: `/zdsz/engineeringIndustry/list?type=${type}`,
     method: 'get',
   })
 }
@@ -46,4 +46,11 @@ export function DelEngineeEngineeIndustry(id) {
   })
 }
 
+export function QueryEngineeIndustry({id}) {
+  return request({
+    url: `/zdsz/engineeringIndustry/${id}`,
+    method: 'get',
+  })
+}
+
 

+ 28 - 17
src/components/ConstructionDetails/index.vue

@@ -1,26 +1,26 @@
 
- <!-- 
+ <!--
     *@description: 工程历史详情
     *@author: yh Fu
     *@date: 2024-1-8 10:04:23
-    *@version: V1.0.5 
+    *@version: V1.0.5
 -->
 
 <template>
-    <el-dialog 
-        :visible.sync="dialogVisible" 
-        title="" 
+    <el-dialog
+        :visible.sync="dialogVisible"
+        title=""
         width="60%"
         append-to-body
         custom-class="ConstructionDetailsDialog">
         <el-tabs v-model="activeName" type="card" @tab-click="viewSource" class="projectTabs">
-            <el-tab-pane 
-                :label="e.label" 
+            <el-tab-pane
+                :label="e.label"
                 :name="e.value"
                 v-for="(e,idx) in currentDicts"
                 :key="idx"
                 >
-                <el-collapse 
+                <el-collapse
                     class="rmOldPie"
                     v-for="(e,idx) in currentCollapses"
                     :key="idx"
@@ -42,7 +42,7 @@
                         </div>
                         <hr>
                         <!--  用料明细 -->
-                        <div 
+                        <div
                             v-for="(i,idx) in e.zEngineeringMaterialBo"
                             :key="idx"
                         >
@@ -56,9 +56,9 @@
                             <img :src=require(v) v-for="v in e.zEngiineeringPhotoBoList" :key="v">
 
                         </div> -->
-                        <ObsImageUpload 
-                          ref="obsImageUpload" 
-                          :limit="9999" 
+                        <ObsImageUpload
+                          ref="obsImageUpload"
+                          :limit="9999"
                           :fileType="['png', 'jpg', 'jpeg']"
                           disabled
                           :value="e.zEngiineeringPhotoBoList"
@@ -91,12 +91,23 @@ export default {
         // 单项审核
         checkWorking(){
 
-        },  
+        },
         // 查看历史
-        open(dicts){
-            console.log(dicts)
+        open(dicts,type = null){
+            if(type == '1' || type == '2'){
+              // 工业 市政
+              this.$parent.viewNodeSource()
+              this.currentDicts = [
+                {
+                  value:"历史数据",
+                  label:"历史数据"
+                }
+              ]
+            }else{
+              console.log(dicts)
+              this.currentDicts = dicts
+            }
             this.dialogVisible = true
-            this.currentDicts = dicts
         }
     }
 }
@@ -165,4 +176,4 @@ export default {
         }
     }
 }
-</style>
+</style>

+ 37 - 45
src/views/zdsz/engineeringIndustry/index.vue

@@ -66,47 +66,6 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-          <el-table v-loading="loading" :data="comprehensiveList" @selection-change="handleSelectionChange">
-            <el-table-column type="selection" width="55" align="center" />
-            <!--      <el-table-column label="" align="center" prop="id" v-if="true"/>-->
-            <el-table-column label="建筑单位" align="center" prop="constructUnit" />
-            <el-table-column label="项目负责人" align="center" prop="projectHead" />
-            <el-table-column label="现场负责人" align="center" prop="sceneHead" />
-            <el-table-column label="设计负责人" align="center" prop="designHead" />
-            <el-table-column label="设计单位" align="center" prop="designUnit" />
-            <el-table-column label="监理负责人" align="center" prop="supervisionHead" />
-            <el-table-column label="监理单位" align="center" prop="supervisionUnit" />
-            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-              <template slot-scope="scope">
-                <el-button
-                  type="text"
-                  icon="el-icon-edit"
-                  size="mini"
-                  @click="viewSource(scope.row)"
-                >历史</el-button>
-                <el-button
-                  size="mini"
-                  type="text"
-                  icon="el-icon-edit"
-                  @click="handleUpdate(scope.row)"
-                  v-hasPermi="['zdsz:engineeringIndustry:edit']"
-                >修改</el-button>
-                <el-button
-                  size="mini"
-                  type="text"
-                  icon="el-icon-delete"
-                  @click="handleDelete(scope.row)"
-                  v-hasPermi="['zdsz:engineeringIndustry:remove']"
-                >删除</el-button>
-                <el-button
-                  size="mini"
-                  type="text"
-                  icon="el-icon-edit"
-                  @click="addNewPipe(scope.row)"
-                >新增顶管工程</el-button>
-              </template>
-            </el-table-column>
-          </el-table>
     <el-table v-loading="loading" :data="comprehensiveList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="工程名称" align="center" prop="enginName"/>
@@ -120,6 +79,12 @@
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
+            type="text"
+            icon="el-icon-edit"
+            size="mini"
+            @click="viewSource(scope.row)"
+          >历史</el-button>
+          <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
@@ -191,7 +156,7 @@
         <el-form-item label="工程类型" prop="enginType">
           <el-select v-model="form.enginType" placeholder="请选择工程类型" style="width: 100%">
             <el-option
-              v-for="e in EngineepipeType"
+              v-for="e in dict.type.industry_engin_type"
               :key="e.value"
               :label="e.label"
               :value="e.value"
@@ -337,6 +302,10 @@
 <!--            </div>-->
           </el-form>
         </el-dialog>
+    <ConstructionDetails
+      ref="ConstructionDetails"
+      :currentCollapses="currentCollapses"
+    />
   </div>
 </template>
 <script>
@@ -345,15 +314,18 @@ import {
   DelEngineeEngineeIndustry,
   EditEngineeEngineeIndustry,
   getEngineeIndustryList,
-  putEngineeEngineeIndustry
+  putEngineeEngineeIndustry,
+  QueryEngineeIndustry
 } from '@/api/zdsz/engineeringIndustry'
 import EngineePipe from '@/components/EngineePipe'
 import { validPhoneMobile } from '@/api/rules'
+import ConstructionDetails from "@/components/ConstructionDetails/index.vue";
 
 export default {
   name: "openrepair",
-  dicts: ['pass_check', 'is_repair', 'engin_type', 'self_closing_valve_type', 'visit_type', 'engin_classification','engineering_infrastructure'],
+  dicts: ['pass_check', 'is_repair', 'industry_engin_type', 'self_closing_valve_type', 'visit_type', 'engin_classification','engineering_infrastructure'],
   components: {
+    ConstructionDetails,
     EngineePipe
   },
   data() {
@@ -375,6 +347,7 @@ export default {
       // 总条数
       total: 0,
       currentNode:[],
+      currentCollapses:[],
       // 市政工程|工业工程表格数据
       comprehensiveList: [],
       // 弹出层标题
@@ -545,8 +518,8 @@ export default {
       if (type) {
         this.form.type = type;
         this.form.zEngineeringNodeBo.type = (type === '1' ? "工业工程" : "市政工程")
-        this.EngineepipeType = (type === '1' ? [{ value: '0', label: '小微商服' },{ value: '1', label: '新建工业' },{ value: '2', label: '改造工业' }] : [{ value: '0', label: '气源' },{ value: '1', label: '排迁' }])
       }
+
     },
     // 新增顶管工程
     addNewPipe(data) {
@@ -555,6 +528,25 @@ export default {
         type: this.form.zEngineeringNodeBo.type
       }, 'add')
     },
+    // 历史查询
+    viewSource(e){
+      this.currentId = e.id
+      this.$refs.ConstructionDetails.open(_,this.form.type)
+    },
+    viewNodeSource(e){
+      // todo: 获取数据
+      QueryEngineeIndustry({
+        id:this.currentId
+      }).then(res => {
+        try {
+          this.currentCollapses = res.data.zengineeringNodeBoList[0].zEngineeringInfoBoList
+          console.log('当前历史数据',this.currentCollapses)
+        } catch (error) {
+          this.currentCollapses = [];
+        }
+        console.log(this.currentCollapses)
+      })
+    },
     nodeCancel() {
       this.nodeDetailVisible = false
     },

+ 3 - 3
src/views/zdsz/engineeringPipeJacking/index.vue

@@ -236,7 +236,7 @@
           <EngineePipe ref="enginPipe"/>
 
           <!-- 查看历史 -->
-          <ConstructionDetails 
+          <ConstructionDetails
             ref="ConstructionDetails"
             :currentCollapses="currentCollapses"
             />
@@ -244,7 +244,7 @@
       </template>
 
       <script>
-      import EngineePipe from "@/components/EngineePipe"   
+      import EngineePipe from "@/components/EngineePipe"
       import ConstructionDetails from "@/components/ConstructionDetails"             // 查看历史
       import {
         addEnginee,                                // 新增工程
@@ -447,7 +447,7 @@
           // 查看历史
           viewSource(e){
             this.currentId = e.id
-            this.$refs.ConstructionDetails.open(this.dict.type.pipe_jack)
+            this.$refs.ConstructionDetails.open(this.dict.type.engin_type)
           },
           viewNodeSource(e){
             console.log(e)