luojun 2 年 前
コミット
7752415125
1 ファイル変更60 行追加40 行削除
  1. 60 40
      src/views/system/dept/dialog.edit.vue

+ 60 - 40
src/views/system/dept/dialog.edit.vue

@@ -72,8 +72,12 @@
           <el-row>
             <el-col :span="12">
               <el-form-item label="是否可用" prop="isLock">
-                <el-switch v-model="form.isLock" :active-value="0"
-          :inactive-value="1"> </el-switch>
+                <el-switch
+                  v-model="form.isLock"
+                  :active-value="1"
+                  :inactive-value="0"
+                >
+                </el-switch>
               </el-form-item>
             </el-col>
             <el-col :span="12">
@@ -81,8 +85,11 @@
                 label="加钞间出入口远程控制"
                 prop="cashAddingRoomRemoteControl"
               >
-                <el-switch v-model="form.cashAddingRoomRemoteControl" :active-value="1"
-          :inactive-value="0">
+                <el-switch
+                  v-model="form.cashAddingRoomRemoteControl"
+                  :active-value="1"
+                  :inactive-value="0"
+                >
                 </el-switch>
               </el-form-item>
             </el-col>
@@ -169,7 +176,7 @@
                 size="mini"
                 type="text"
                 icon="el-icon-delete"
-                @click="handleOrgDelete(scope.row)"
+                @click="handleOrgDelete(scope.$index)"
                 v-hasPermi="['system:construction:remove']"
                 >删除</el-button
               >
@@ -284,6 +291,7 @@ export default {
       orgform: {},
       //默认选中节点
       defaultKeys: [],
+
       rules: {
         parentId: [
           { required: true, message: "上级机构不能为空", trigger: "blur" },
@@ -342,41 +350,49 @@ export default {
     },
     /** 提交按钮 */
     submitOrgForm() {
-      this.orgform.orgId = this.orgid;
-      this.$refs["orgform"].validate((valid) => {
-        if (valid) {
-          this.orgform.type = 4;
-          if (this.orgform.id != null) {
-            updateOrgPhysicalDefenseConstruction(this.orgform).then(
-              (response) => {
-                this.$modal.msgSuccess("修改成功");
-                this.orgopen = false;
-                this.getOrgPhysicalDefenseConstructionInfo();
-              }
-            );
-          } else {
-            addOrgPhysicalDefenseConstruction(this.orgform).then((response) => {
-              this.$modal.msgSuccess("新增成功");
-              this.orgopen = false;
-              this.getOrgPhysicalDefenseConstructionInfo();
-            });
-          }
-        }
-      });
+      let dat = { standard: this.orgform.standard,
+        dateOfCompliance:this.orgform.dateOfCompliance,
+        certificateEvidence:this.orgform.certificateEvidence,
+        certificate:this.orgform.certificate,
+        evidence:this.orgform.evidence
+      };
+      this.constructionList.push(dat);
+      this.orgopen = false;
+      // this.orgform.orgId = this.orgid;
+      // this.$refs["orgform"].validate((valid) => {
+      //   if (valid) {
+      //     this.orgform.type = 4;
+      //     if (this.orgform.id != null) {
+      //       updateOrgPhysicalDefenseConstruction(this.orgform).then(
+      //         (response) => {
+      //           this.$modal.msgSuccess("修改成功");
+      //           this.orgopen = false;
+      //           this.getOrgPhysicalDefenseConstructionInfo();
+      //         }
+      //       );
+      //     } else {
+      //       addOrgPhysicalDefenseConstruction(this.orgform).then((response) => {
+      //         this.$modal.msgSuccess("新增成功");
+      //         this.orgopen = false;
+      //         this.getOrgPhysicalDefenseConstructionInfo();
+      //       });
+      //     }
+      //   }
+      // });
     },
     /** 删除按钮操作 */
     handleOrgDelete(row) {
-      const orgids = row.id || this.orgids;
-      this.$modal
-        .confirm('是否确认删除机构物防建设编号为"' + orgids + '"的数据项?')
-        .then(function () {
-          return delOrgPhysicalDefenseConstruction(orgids);
-        })
-        .then(() => {
-          this.getOrgPhysicalDefenseConstructionInfo();
-          this.$modal.msgSuccess("删除成功");
-        })
-        .catch(() => {});
+      this.constructionList.splice(row, 1)
+      // this.$modal
+      //   .confirm('是否确认删除机构物防建设编号为"' + orgids + '"的数据项?')
+      //   .then(function () {
+      //     return delOrgPhysicalDefenseConstruction(orgids);
+      //   })
+      //   .then(() => {
+      //     this.getOrgPhysicalDefenseConstructionInfo();
+      //     this.$modal.msgSuccess("删除成功");
+      //   })
+      //   .catch(() => {});
     },
     /** 修改按钮操作 */
     handleOrgUpdate(row) {
@@ -438,14 +454,17 @@ export default {
       this.id = 0;
       this.constructionList = [];
       if (row != 0) {
-        // console.log(row)
+        // console.log(row,111111111111)
+        
         this.orgid = row.orgid;
         this.form = row;
+        // this.form.isLock2=row.isLock;
         this.id = row.id;
         if (row.id != null) {
           getExtendByOrgId(row.id).then((data) => {
             console.log(data.data);
             if (data.data != null) {
+              this.form.orgExtendId=data.data.id,
               this.form.cashAddingRoomRemoteControl =
                 data.data.cashAddingRoomRemoteControl;
               this.form.detachedLobbyEquipment =
@@ -472,9 +491,10 @@ export default {
           .cashAddingRoomRemoteControl
           ? 1
           : 0;
-        console.log(this.form);
+        this.form.constructionList=this.constructionList;
+        // console.log(this.form);
         addOrUpdate(this.form).then((data) => {
-          this.$modal.msgSuccess("添加成功");
+          this.$modal.msgSuccess("成功");
           this.onHide();
         });
         // this.$emit("success");