Pārlūkot izejas kodu

市政工程 沟上沟下

wangzhe 1 gadu atpakaļ
vecāks
revīzija
46e9386f5e

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

@@ -47,9 +47,12 @@ export function DelEngineeEngineeIndustry(id) {
   })
 }
 
-export function QueryEngineeIndustry({id}) {
+export function QueryEngineeIndustry({id, type}) {
+  // alert(`${id}`)
+  // alert(`${type}`)
   return request({
-    url: `/zdsz/engineeringIndustry/${id}/1`,
+    // url: `/zdsz/engineeringIndustry/${id}/1`,
+    url: `/zdsz/engineeringIndustry/${id}/${type}`,
     method: 'get',
   })
 }

+ 24 - 4
src/components/ConstructionDetails/index.vue

@@ -560,26 +560,32 @@ export default {
       console.log('item1为新值,item2为旧值', item1[0].value)
       this.activeNames = item1[0].value
       this.$parent.viewNodeSource(item1[0].value)
+      // alert(item1[0].value)
     },
     currentCollapses(){
       try {
+        console.log(1)
         this.currentCollapses[0].zEngineeringReviewBo.reviewStatus != 1 ? this.isChecking = true : false
       } catch (error) {
         this.isChecking = true
       }
       console.log('isChecking',this.isChecking)
+      console.log('isChecking',this.isChecking)
       let materialQuality = []
       try {
+        console.log(2)
         materialQuality = this.currentCollapses[0].zEngineeringMaterialBo[0].materialQuality
       } catch (error) {
         materialQuality = []
       }
       try {
+        console.log(3)
         this.reviewStatus = this.currentCollapses[0].zEngineeringReviewBo.reviewStatus != '1' ? true : false
       } catch (error) {
         this.reviewStatus = true
       }
       if(materialQuality){
+        console.log(4)
         getEnginSpecificationsList({materId:materialQuality}).then(res => {
           console.log('规格',res.data)
           this.specificationsList = res.data
@@ -664,6 +670,7 @@ export default {
     },
     // 查看单节点历史
     viewSource(e) {
+      console.log('节点123',e)
       console.log('节点',e)
       this.node=e.name
       this.nodesource=e
@@ -736,7 +743,7 @@ export default {
      */
     open(dicts, type = null,currentStatus = null,kind = null,title= null,enginClassification,enginSort,enginType) {
       console.log(1)
-      console.log(dicts)
+      console.log(currentStatus)
       console.log(type)
       console.log(kind)
       console.log(2)
@@ -766,15 +773,28 @@ export default {
       this.titleName = title
       this.checkingVisible = false
       console.log(this.reviewStatus,this.currentStatus,this.isChecking)
-      if (type == '1' || type == '2') {
-        // 工业 市政
-        this.$parent.viewNodeSource()
+
+      if (type == '1') {
+        // 工业
+        // alert('工业='+dicts)
         this.currentDicts = [
           {
             value: "历史数据",
             label: "历史数据"
           }
         ]
+        this.$parent.viewNodeSource()
+      }if (type == '2') {
+        // alert('市政='+dicts)
+        // 市政
+        // this.currentDicts = [
+        //   {
+        //     value: "历史数据",
+        //     label: "历史数据"
+        //   }
+        // ]
+        this.currentDicts = dicts
+        this.$parent.viewNodeSource()
       } else if (type === '危险作业工程') {
         this.$parent.viewNodeSource()
         this.currentDicts = [

+ 29 - 5
src/views/zdsz/engineeringIndustry/index.vue

@@ -329,6 +329,7 @@ import {
   putEngineeEngineeIndustry,
   QueryEngineeIndustry, UpdateEngineeIndustry
 } from '@/api/zdsz/engineeringIndustry'
+import {getDicts} from "@/api/system/dict/data";
 import EngineePipe from '@/components/EngineePipe'
 import {validPhoneMobile} from '@/api/rules'
 import ConstructionDetails from '@/components/ConstructionDetails/index.vue'
@@ -692,10 +693,30 @@ export default {
     },
     // 历史查询
     viewSource(e) {
-      console.log(e)
+      console.log('历史查询', e)
       this.currentId = e.id
-      this.$refs.ConstructionDetails.open(_, this.form.type,null,null,null,null,null,this.form.type === '1' ? "工业工程" : "市政工程")
-      this.status = 'read-only'
+      let val = e.enginType + "_" + e.enginClassification
+      val = 'municipal_engineering_node'
+      // alert(val)
+      getDicts(val).then(res => {
+        let dict = []
+        for (let i = 0; i < res.data.length; i++) {
+          dict.push({
+            "label": res.data[i].dictLabel,
+            "value": res.data[i].dictValue,
+          })
+        }
+        // 市政工程功能已完成 工业工程请根据自己需求酌情修改此处代码
+        this.$refs.ConstructionDetails.open(this.form.type==2?dict:[
+          {
+            value: "历史数据",
+            label: "历史数据"
+          }
+        ], this.form.type,null,null,null,null,null,this.form.type === '1' ? "工业工程" : "市政工程")
+        this.status = 'read-only'
+      })
+      // this.$refs.ConstructionDetails.open(_, this.form.type,null,null,null,null,null,this.form.type === '1' ? "工业工程" : "市政工程")
+      // this.status = 'read-only'
     },
     // 历史查询
     updateviewSource(e) {
@@ -704,10 +725,13 @@ export default {
       this.status = 'put'
     },
     viewNodeSource(e) {
-      console.log(e)
+      // alert('type='+e)
+      if(!e)return
+      console.log('todo: 获取数据', e)
       // todo: 获取数据
       QueryEngineeIndustry({
-        id: this.currentId
+        id: this.currentId,
+        type: e
       }).then(res => {
         console.log(res)
         this.form = res.data

+ 1 - 0
src/views/zdsz/engineeringPipeJacking/index.vue

@@ -579,6 +579,7 @@ export default {
     },
     // 查看历史
     async viewSource(e,type = null){
+      console.log('查看历史 type=',type)
       const res = await getDicts('pipe_jack');
       const r = res.data!=null?res.data.map(o=>{return {label:o.dictLabel,value:o.dictValue}}):[];
       this.currentId = e.id