瀏覽代碼

Merge branch 'zdsz3.0' of http://192.168.10.18:3000/sunwei/zdsz_vue into zdsz3.0

付宇航 1 年之前
父節點
當前提交
2c2e5aa6f3
共有 2 個文件被更改,包括 53 次插入26 次删除
  1. 2 2
      src/api/zdsz/engineeringIndustry.js
  2. 51 24
      src/views/zdsz/engineeringIndustry/index.vue

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

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

+ 51 - 24
src/views/zdsz/engineeringIndustry/index.vue

@@ -7,12 +7,12 @@
 
 
 <template>
 <template>
   <div class="app-container">
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="110px">
+    <el-form :model="searchParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="110px">
       <el-form-item label="工程名称" prop="enginName">
       <el-form-item label="工程名称" prop="enginName">
-        <el-input v-model="queryParams.enginName" placeholder="请输入建筑工程名称" maxlength="20"></el-input>
+        <el-input v-model="searchParams.enginName" placeholder="请输入建筑工程名称" maxlength="20"></el-input>
       </el-form-item>
       </el-form-item>
       <el-form-item label="工程分类" prop="enginClassification" v-if="engineeType">
       <el-form-item label="工程分类" prop="enginClassification" v-if="engineeType">
-        <el-select v-model="queryParams.enginClassification" placeholder="请选择工程分类">
+        <el-select v-model="searchParams.enginClassification" placeholder="请选择工程分类">
           <el-option
           <el-option
             v-for="e in dict.type.engin_classification"
             v-for="e in dict.type.engin_classification"
             :key="e.value"
             :key="e.value"
@@ -87,12 +87,17 @@
           >修改
           >修改
           </el-button>
           </el-button>
           <el-button
           <el-button
-            size="mini"
             type="text"
             type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['zdsz:engineeringIndustry:remove']"
-          >删除
+            icon="el-icon-edit"
+            size="mini"
+            @click="updateviewSource(scope.row)"
+          >修改节点信息
+          </el-button>
+          <el-button type="text"
+                     icon="el-icon-edit"
+                     size="mini"
+                     @click="addzEngineeringMaterBo(scope.row)"
+          >新增用料信息
           </el-button>
           </el-button>
           <el-button
           <el-button
             size="mini"
             size="mini"
@@ -108,11 +113,13 @@
             @click="viewSource(scope.row)"
             @click="viewSource(scope.row)"
           >历史
           >历史
           </el-button>
           </el-button>
-          <el-button type="text"
-                     icon="el-icon-edit"
-                     size="mini"
-                     @click="addzEngineeringMaterBo(scope.row)"
-          >新增用料信息
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['zdsz:engineeringIndustry:remove']"
+          >删除
           </el-button>
           </el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
@@ -287,8 +294,10 @@
     </el-dialog>
     </el-dialog>
     <ConstructionDetails
     <ConstructionDetails
       ref="ConstructionDetails"
       ref="ConstructionDetails"
+      :status="status"
       :currentCollapses="currentCollapses"
       :currentCollapses="currentCollapses"
       @updateNodeOption = "updateNodeOption"
       @updateNodeOption = "updateNodeOption"
+      enginType="工业工程"
     />
     />
   </div>
   </div>
 </template>
 </template>
@@ -334,6 +343,7 @@ export default {
       loading: true,
       loading: true,
       // 选中数组
       // 选中数组
       ids: [],
       ids: [],
+      status:null,
       // 非单个禁用
       // 非单个禁用
       single: true,
       single: true,
       // 非多个禁用
       // 非多个禁用
@@ -468,6 +478,10 @@ export default {
           {required: true, message: "图片不能为空", trigger: ['change', 'blur'], validator: validatePicPass}
           {required: true, message: "图片不能为空", trigger: ['change', 'blur'], validator: validatePicPass}
         ],
         ],
       },
       },
+      searchParams:{
+        enginName:null,             // 工程名称
+        enginClassification:null,   // 工程分类
+      },
       currentType: null, // 附件组件类型 put修改 add新增
       currentType: null, // 附件组件类型 put修改 add新增
     };
     };
   },
   },
@@ -481,9 +495,9 @@ export default {
   },
   },
   mounted() {
   mounted() {
     // 手动渲染
     // 手动渲染
-    setInterval(() => {
-      this.$forceUpdate()
-    }, 500)
+    // setInterval(() => {
+    //   this.$forceUpdate()
+    // }, 500)
   },
   },
   methods: {
   methods: {
     validateState(rule, value, callback) {
     validateState(rule, value, callback) {
@@ -522,10 +536,15 @@ export default {
       })
       })
     },
     },
     updateNodeOption(value){
     updateNodeOption(value){
-      UpdateEngineeIndustry(value).then(res => {
+      console.log(this.form);
+      console.log(value)
+      this.form.files = this.form.pics
+      UpdateEngineeIndustry(this.form).then(res => {
         this.$modal.msgSuccess("修改成功");
         this.$modal.msgSuccess("修改成功");
-        this.getList();
+
+        this.$refs.ConstructionDetails.dialogVisible = false
       })
       })
+      this.getList();
     },
     },
     // 根据所选材质获取对应规格
     // 根据所选材质获取对应规格
     getEnginSpecificationsList(item, index) {
     getEnginSpecificationsList(item, index) {
@@ -579,7 +598,7 @@ export default {
     //新增用料信息
     //新增用料信息
     addzEngineeringMaterialBo() {
     addzEngineeringMaterialBo() {
       this.zEngineeringMaterialBo.push({
       this.zEngineeringMaterialBo.push({
-        // materialQuality: '', // 用料材质
+        materialQuality: '', // 用料材质
         specifications: '', // 用料规格
         specifications: '', // 用料规格
         number: '' // 用料数量
         number: '' // 用料数量
       })
       })
@@ -614,12 +633,22 @@ export default {
     viewSource(e) {
     viewSource(e) {
       this.currentId = e.id
       this.currentId = e.id
       this.$refs.ConstructionDetails.open(_, this.form.type)
       this.$refs.ConstructionDetails.open(_, this.form.type)
+      this.status = 'read-only'
+    },
+    // 历史查询
+    updateviewSource(e) {
+      this.currentId = e.id
+      this.$refs.ConstructionDetails.open(_, this.form.type)
+      this.status = 'put'
     },
     },
     viewNodeSource(e) {
     viewNodeSource(e) {
+      console.log(e)
       // todo: 获取数据
       // todo: 获取数据
       QueryEngineeIndustry({
       QueryEngineeIndustry({
         id: this.currentId
         id: this.currentId
       }).then(res => {
       }).then(res => {
+        console.log(res)
+        this.form = res.data
         try {
         try {
           this.currentCollapses = res.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList
           this.currentCollapses = res.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList
         } catch (error) {
         } catch (error) {
@@ -644,16 +673,14 @@ export default {
       this.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList = this.$refs.obsImageUpload.fileList ? this.$refs.obsImageUpload.fileList.map(e => e.url) : [];
       this.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList = this.$refs.obsImageUpload.fileList ? this.$refs.obsImageUpload.fileList.map(e => e.url) : [];
     },
     },
     /** 查询市政工程|工业工程列表 */
     /** 查询市政工程|工业工程列表 */
-    getList() {
+    getList(val) {
       this.loading = true;
       this.loading = true;
       let enginType = this.form.zEngineeringNodeBo.type;
       let enginType = this.form.zEngineeringNodeBo.type;
       // 获取材质
       // 获取材质
       getEnginMaterialQualityList({enginType}).then(res => {
       getEnginMaterialQualityList({enginType}).then(res => {
         this.materialQualityList = res.data
         this.materialQualityList = res.data
       });
       });
-      getEngineeIndustryList({
-        type: this.form.type
-      }).then(res => {
+      getEngineeIndustryList(val || {}).then(res => {
         this.comprehensiveList = res.rows;
         this.comprehensiveList = res.rows;
         this.total = res.total;
         this.total = res.total;
         this.loading = false;
         this.loading = false;
@@ -682,7 +709,7 @@ export default {
     /** 搜索按钮操作 */
     /** 搜索按钮操作 */
     handleQuery() {
     handleQuery() {
       this.queryParams.pageNum = 1;
       this.queryParams.pageNum = 1;
-      this.getList();
+      this.getList(this.searchParams);
     },
     },
     /** 重置按钮操作 */
     /** 重置按钮操作 */
     resetQuery() {
     resetQuery() {