From f1ba84aea2a62bd2c4b6fd650535da0f657dc2c3 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Sat, 14 Aug 2021 10:58:17 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/zhba_regulatory

---
 src/views/securityCompany/train.vue |  163 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 162 insertions(+), 1 deletions(-)

diff --git a/src/views/securityCompany/train.vue b/src/views/securityCompany/train.vue
index e03efd2..51812dc 100644
--- a/src/views/securityCompany/train.vue
+++ b/src/views/securityCompany/train.vue
@@ -28,7 +28,48 @@
       @row-click="handleRowClick"
       @on-load="onLoad"
     >
+      <template slot-scope="{ type, size, row }" slot="menu">
+        <el-button
+          :size="size"
+          :type="type"
+          class="zhengJian-icon"
+          @click.stop="punish(row)"
+          >处罚</el-button
+        >
+      </template>
     </avue-crud>
+    <el-dialog
+      title="处罚"
+      :visible.sync="dialogVisible"
+      width="60%"
+      :before-close="handleClose"
+      :modal-append-to-body="false"
+      center
+    >
+      <!-- <span>这是一段信息</span> -->
+      <avue-form
+        :option="optionf"
+        v-model="objf"
+        @submit="submitf"
+        @error="errorf"
+      >
+        <template slot-scope="{ type, size, row }" slot="menuForm">
+          <el-button
+            :size="size"
+            icon="el-icon-error"
+            :type="type"
+            @click="close(row)"
+            >关闭</el-button
+          >
+        </template>
+      </avue-form>
+      <!-- <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="dialogVisible = false"
+          >确 定</el-button
+        >
+      </span> -->
+    </el-dialog>
   </basic-container>
 </template>
 
@@ -40,11 +81,75 @@
   update,
   remove,
 } from "@/api/securityCompany/train";
+import { savePunish } from "@/api/securityCompany/security";
 import { mapGetters } from "vuex";
 
 export default {
   data() {
     return {
+      objf: {},
+      optionf: {
+        column: [
+          {
+            label: "公司名称",
+            prop: "enterprisename",
+            span: 24,
+            labelWidth: 110,
+            rules: [
+              {
+                required: true,
+                message: "请输入身份证号码",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "处罚原因",
+            prop: "punishreason",
+            span: 24,
+            labelWidth: 110,
+            rules: [
+              {
+                required: true,
+                message: "请输入荣誉名称",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "处罚结果",
+            prop: "punishresult",
+            span: 24,
+            // type: "textarea",
+            labelWidth: 110,
+          },
+          {
+            label: "处罚日期",
+            prop: "punishtime",
+            span: 24,
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd",
+            // type: "textarea",
+            labelWidth: 110,
+          },
+          {
+            label: "处罚批准文号",
+            prop: "punisnum",
+            span: 24,
+            // type: "textarea",
+            labelWidth: 110,
+          },
+          //   {
+          //     label: "授予单位名称",
+          //     prop: "sex2",
+          //     span: 24,
+          //     labelWidth: 110,
+          //   },
+        ],
+      },
+      dialogVisible: false,
+
       form: {},
       query: {},
       loading: true,
@@ -60,7 +165,8 @@
         editBtn: false,
         addBtn: false,
         selection: true,
-        menu: false,
+        // menu: false,
+        menuWidth: 100,
 
         align: "center",
         height: "auto",
@@ -175,6 +281,61 @@
     },
   },
   methods: {
+    punish(row) {
+      //打开处罚
+      // console.log(row);
+      this.objf = {
+        deptid: row.departmentid,
+        enterprisename: row.enterprisename,
+      };
+      this.dialogVisible = true;
+    },
+    close(row) {
+      this.dialogVisible = false;
+      this.objf = {
+        enterprisename: "",
+        punishreason: "",
+        punishresult: "",
+        punishtime: "",
+        punisnum: "",
+      };
+    },
+    submitf(form, done) {
+      console.log(form);
+      var that = this;
+      savePunish(form).then((res) => {
+        this.$message({
+          type: "success",
+          message: "操作成功!",
+        });
+        that.objf = {
+          enterprisename: "",
+          punishreason: "",
+          punishresult: "",
+          punishtime: "",
+          punisnum: "",
+        };
+      });
+      // this.$message.success(JSON.stringify(form));
+      done();
+      this.dialogVisible = false;
+      this.objf = {};
+    },
+    errorf(err) {
+      this.$message.success("操作失败");
+      console.log(err);
+    },
+    handleClose(done) {
+      this.objf = {
+        enterprisename: "",
+        punishreason: "",
+        punishresult: "",
+        punishtime: "",
+        punisnum: "",
+      };
+      done();
+    },
+
     rowSave(row, done, loading) {
       add(row).then(
         () => {

--
Gitblit v1.9.3