From 3bd1fdf103ca2c58e2b28cc802f84d729a9d44ad Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Wed, 29 Sep 2021 16:46:22 +0800
Subject: [PATCH] 公司修改 派遣修改

---
 src/views/securityUnit/securityTraining.vue |   98 +++++++++++++++++++++----------------------------
 1 files changed, 42 insertions(+), 56 deletions(-)

diff --git a/src/views/securityUnit/securityTraining.vue b/src/views/securityUnit/securityTraining.vue
index 45490f3..b441e8b 100644
--- a/src/views/securityUnit/securityTraining.vue
+++ b/src/views/securityUnit/securityTraining.vue
@@ -69,58 +69,22 @@
           </el-button>
         </template>
       </avue-crud>
-      <div class="lod" v-show="forms != -1">
-        <div class="lod-in">
-          <!-- <el-col class="trees" v-if="forms == 0">
-          <div class="box">
-            <el-scrollbar>
-              <basic-container>
-                <avue-tree
-                  :option="treeOption"
-                  :data="treeData"
-                  @node-click="nodeClick"
-                />
-              </basic-container>
-            </el-scrollbar>
-          </div>
-        </el-col> -->
-          <avue-form
-            ref="form"
-            v-model="obj0"
-            :option="option0"
-            v-if="forms == 0"
-          >
-            <template slot="menuForm">
-              <el-button type="primary" @click="tip0">下一页</el-button>
-              <el-button type="info" @click="tipover">取消</el-button>
-            </template>
-          </avue-form>
-          <avue-form
-            ref="form1"
-            v-model="obj1"
-            :option="option1"
-            v-else-if="forms == 1"
-          >
-            <template slot="menuForm">
-              <el-button type="primary" @click="tip1up1">上一页</el-button>
-              <el-button type="primary" @click="tip1">下一页</el-button>
-              <el-button type="info" @click="tipover">取消</el-button>
-            </template>
-          </avue-form>
-          <avue-form
-            ref="form2"
-            v-model="obj2"
-            :option="option2"
-            v-else-if="forms == 2"
-          >
-            <template slot="menuForm">
-              <el-button type="primary" @click="tip2up2">上一页</el-button>
-              <el-button type="primary" @click="tip2">提交</el-button>
-              <el-button type="info" @click="tipover">取消</el-button>
-            </template>
-          </avue-form>
-        </div>
-      </div>
+      <el-dialog
+        :visible.sync="forms"
+        width="80%"
+        top="5vh"
+        :modal-append-to-body="false"
+        class="addCompany"
+      >
+        <avue-form
+          ref="form"
+          v-model="obj0"
+          :option="option0"
+          v-if="forms"
+          @submit="handleSubmit"
+        >
+        </avue-form>
+      </el-dialog>
     </div>
     <el-dialog
       title="保安单位导入"
@@ -256,7 +220,7 @@
       },
       option0: {
         emptyBtn: false,
-        submitBtn: false,
+        submitBtn: true,
         gutter: 30,
         column: column0,
       },
@@ -279,7 +243,7 @@
         column: column2,
       },
 
-      forms: -1,
+      forms: false,
       data0: {},
       data1: {},
       data2: {},
@@ -307,6 +271,10 @@
         column: column,
       },
     };
+  },
+    created() {
+    this.option0.column[4].value = 2;
+    this.option0.column[4].disabled = true;
   },
   computed: {
     ...mapGetters(["userInfo"]),
@@ -382,13 +350,31 @@
     },
     rowSave(form, done, loading) {
       // console.log("save1");
-      this.forms = 0;
+      this.forms = true;
       var that = this;
       //先获取部门接口
       getDeptLazyTree().then((res) => {
         var d = res.data.data;
         that.treeData = d;
         // console.log(d);
+      });
+    },
+    handleSubmit(form, done) {
+      console.log(form);
+      adddata(form).then((res) => {
+        if (res.data.success) {
+          this.$message({
+            message: "提交成功",
+            type: "success",
+          });
+          done();
+          this.forms = false;
+        } else {
+          this.$message({
+            message: "提交失败",
+            type: "warning",
+          });
+        }
       });
     },
     searchChange(params, done) {
@@ -624,7 +610,7 @@
       this.tipover();
     },
     tip1up1() {
-      this.forms = 0;
+      this.forms = true;
     },
     tip2up2() {
       this.forms = 1;

--
Gitblit v1.9.3