浏览代码

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

付宇航 1 年之前
父节点
当前提交
17057a6078
共有 1 个文件被更改,包括 39 次插入46 次删除
  1. 39 46
      src/views/zdsz/engineeringCivil/index.vue

+ 39 - 46
src/views/zdsz/engineeringCivil/index.vue

@@ -78,7 +78,7 @@
           :disabled="single"
           :disabled="single"
           @click="handleUpdate"
           @click="handleUpdate"
           v-hasPermi="['zdsz:engineeringCivil:edit']"
           v-hasPermi="['zdsz:engineeringCivil:edit']"
-        >修改
+        >修改工程信息
         </el-button>
         </el-button>
       </el-col>
       </el-col>
       <el-col :span="1.5">
       <el-col :span="1.5">
@@ -149,6 +149,14 @@
             icon="el-icon-edit"
             icon="el-icon-edit"
             @click="addNodeInfo(scope.row)"
             @click="addNodeInfo(scope.row)"
             v-hasPermi="['zdsz:engineeringCivil:edit']"
             v-hasPermi="['zdsz:engineeringCivil:edit']"
+          >修改工程信息
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="addNodeInfo(scope.row)"
+            v-hasPermi="['zdsz:engineeringCivil:edit']"
           >填写节点信息
           >填写节点信息
           </el-button>
           </el-button>
           <el-button
           <el-button
@@ -348,7 +356,7 @@
           </el-col>
           </el-col>
         </el-row>
         </el-row>
         <el-row>
         <el-row>
-          <el-col :span="24">
+          <el-col :span="24" v-if="title!=='修改民用工程'">
             <el-form-item label="节点">
             <el-form-item label="节点">
               <el-checkbox-group v-model="currentCheckList">
               <el-checkbox-group v-model="currentCheckList">
                 <el-checkbox
                 <el-checkbox
@@ -958,7 +966,7 @@ export default {
       console.log(this.currentCheckList)
       console.log(this.currentCheckList)
       this.currentCheckList = []
       this.currentCheckList = []
       this.checkList = []
       this.checkList = []
-      this.$refs.nodeForm.resetFields()
+      this.reset()
     },
     },
     closeToSucceed() {
     closeToSucceed() {
       this.open = false;
       this.open = false;
@@ -1091,6 +1099,21 @@ export default {
             this.open = false
             this.open = false
             console.log('选中节点集合', this.currentCheckList)
             console.log('选中节点集合', this.currentCheckList)
             this.currentCheckList = []
             this.currentCheckList = []
+            this.getList()
+            // this.$emit('closeToSucceed')
+          }
+        })
+      } else if(this.enginNodeStatus == '添加用料'){
+        addEngineeringCivil(this.queryParams).then(res => {
+          if(res.code == 200){
+            this.$message({
+              message: '添加成功',
+              type: 'success'
+            });
+            this.open = false
+            console.log('选中节点集合',this.currentCheckList)
+            this.currentCheckList = []
+            this.getList()
             // this.$emit('closeToSucceed')
             // this.$emit('closeToSucceed')
           }
           }
         })
         })
@@ -1158,53 +1181,22 @@ export default {
     },
     },
     /** 修改按钮操作 */
     /** 修改按钮操作 */
     handleUpdate(row) {
     handleUpdate(row) {
+      let that = this
       this.enginNodeStatus = '修改'
       this.enginNodeStatus = '修改'
       this.loading = true;
       this.loading = true;
-      // this.reset();
+      this.reset();
       const id = row.id || this.ids
       const id = row.id || this.ids
       getEngineeringCivil(id).then(res => {
       getEngineeringCivil(id).then(res => {
-        this.loading = false;
-        let newData = res.data
-        // 手动调用行政区发生改变
-        // this.districtHasChanged(newData.district)
-        this.queryParams = newData
-        this.updateOption = res.data.zEngineeringNodeBoList
-        console.log(this.queryParams.areaId)
-        // start update修改数据
-        res.data.zEngineeringNodeBoList.forEach((e, idx) => {
-          this.currentCheckList.push(e.type)
-        })
-        console.log('选中节点集合', this.currentCheckList)
-        // end
-        let zEngineeringNodeBo = {
-          type: res.data.zEngineeringNodeBoList[0].type,
-          zEngineeringInfoBo: res.data.zEngineeringNodeBoList[0].zEngineeringInfoBo
-        }
-        if (res.data.areaId != '' && res.data.areaId != null) {
-          this.communityHasChanged(res.data.areaId)
-        }
-        if (res.data.district != '' && res.data.district != null) {
-          this.districtHasChanged(res.data.district)
-        }
-        if (res.data.buildingId != '' && res.data.buildingId != null) {
-          this.buildingHasChanged(res.data.buildingId)
-        }
-        if (res.data.unitId != '' && res.data.unitId != null) {
-          this.unitHasChanged(res.data.unitId)
-        }
-        this.value[0] = res.data.enginType
-        this.value[1] = res.data.enginClassification
-        if (res.data.enginClassification != null && res.data.enginClassification != '') {
-          this.enginClassificationOption = this.dict.type[res.data.enginClassification]
-        }
-        this.enginClassification = zEngineeringNodeBo.type
-        newData.zEngineeringNodeBo = zEngineeringNodeBo
-        this.currentType = 'put'
-        console.log('修改queryparams传值', this.queryParams)
-        console.log(this.queryParams)
-        this.zEngineeringInfoBo = newData.zEngineeringNodeBo.zEngineeringInfoBo
-        this.open = true
-        this.title = "修改民用工程";
+        debugger
+        that.loading = false;
+        // let newData = res.data
+        // // 手动调用行政区发生改变
+        that.queryParams = res.data
+        let va = that.queryParams.enginClassification
+        that.enginTypeHasChanged(that.queryParams.enginType)
+        that.queryParams.enginClassification = va
+        that.open = true
+        that.title = "修改民用工程";
       })
       })
     },
     },
     /** 提交按钮 */
     /** 提交按钮 */
@@ -1216,6 +1208,7 @@ export default {
             updateEngineeringCivil(this.form).then(response => {
             updateEngineeringCivil(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.open = false;
+              debugger
               this.getList();
               this.getList();
             }).finally(() => {
             }).finally(() => {
               this.buttonLoading = false;
               this.buttonLoading = false;