zhengpz
2021-08-27 27c0c8c3769d5725b201ed897ca1ec2ff27a4e86
src/views/securityCompany/armed.vue
@@ -2,8 +2,8 @@
 * @Author: Morpheus
 * @Date: 2021-07-07 17:30:05
 * @Last Modified by: Morpheus
 * @Last Modified time: 2021-07-10 16:05:44
 * menu-name 武装守押公司查询
 * @Last Modified time: 2021-07-10 16:01:42
 * menu-name 保安服务公司查询
 */
<template>
  <basic-container>
@@ -25,10 +25,67 @@
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @row-click="handleRowClick"
      @on-load="onLoad"
    >
      <!-- @row-click="handleRowClick" -->
      <template slot-scope="{ row }" slot="znum">
        <el-tag
          class="rowClickSelf"
          @click="rowClickSelf(row)"
          title="点击查看保安人员情况"
          >{{ row.znum }}</el-tag
        >
      </template>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          icon="el-icon-s-custom"
          :size="size"
          :type="type"
          @click.stop="handleRowClick(row)"
          >查看
        </el-button>
        <el-button
          :size="size"
          :type="type"
          icon="el-icon-warning"
          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>
@@ -39,12 +96,77 @@
  add,
  update,
  remove,
} from "@/api/securityCompany/armed";
  savePunish,
} from "@/api/securityCompany/security";
import { mapGetters } from "vuex";
import { companyColimn } from "./column";
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,73 +182,21 @@
        editBtn: false,
        addBtn: false,
        selection: true,
        menu: false,
        selection: true,
        searchShowBtn: false,
        // menu: false,
        border: true,
        align: "center",
        height: "auto",
        calcHeight: 30,
        tip: false,
        searchShowBtn: false,
        searchShow: true,
        menuWidth: 160,
        searchMenuSpan: 6,
        index: true,
        viewBtn: true,
        dialogClickModal: false,
        column: [
          {
            label: "公司名称",
            prop: "enterprisename",
            search: true,
            searchSpan: 4,
            display: false,
          },
          {
            label: "法定代表人",
            prop: "representative",
            display: false,
            width: 120,
          },
          {
            label: "注册时间",
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            mock: {
              type: "datetime",
              format: "yyyy-MM-dd",
            },
            search: true,
            searchSpan: 4,
            display: false,
            width: 180,
          },
          {
            label: "注册资金",
            prop: "registeredcapital",
            display: false,
            width: 130,
          },
          {
            label: "实缴资金",
            prop: "capital",
            display: false,
            width: 130,
          },
          {
            label: "公司类型",
            prop: "enterprises",
            display: false,
          },
          {
            label: "注册地址",
            prop: "address",
            display: false,
            width: 280,
          },
        ],
        column: companyColimn,
        group: [
          {
            label: "详细信息",
@@ -176,6 +246,67 @@
    },
  },
  methods: {
    rowClickSelf(val) {
      console.log(val.departmentid);
      this.$router.push({
        path: "/securityGuardManagement/registerOnce",
        query: { departmentid: val.departmentid },
      });
    },
    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();
    },
    punish(row) {
      //打开处罚
      // console.log(row);
      this.objf = {
        deptid: row.departmentid,
        enterprisename: row.enterprisename,
      };
      this.dialogVisible = true;
    },
    rowSave(row, done, loading) {
      add(row).then(
        () => {
@@ -265,11 +396,12 @@
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query),
        3
        2
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        console.log(this.data);
        this.loading = false;
        this.selectionClear();
      });
@@ -279,7 +411,8 @@
    handleRowClick(row) {
      // delete (row["name"]);
      var obj = row;
      obj["name"] = "保安公司详细资料";
      obj["name"] = "保安公司详细信息";
      console.log(obj, "obj");
      this.$router.push({
        path: `/securityCompany/index`,
        query: obj,
@@ -289,5 +422,5 @@
};
</script>
<style>
<style lang="scss">
</style>