<template>
  <div>
    <div
      style="
        background-color: #f4f7fc;
        min-height: 80vh;
        overflow: auto;
        padding: 20px;
      "
    >
      <el-row>
        <el-col :span="4"><div class="grid-content ep-bg-purple" /></el-col>
        <el-col :span="16"
          ><div
            v-loading="loading"
            class="grid-content ep-bg-purple-light"
            style="
              background-color: white;
              min-height: 85vh;
              border: 1px solid #e4e7ed;
            "
          >
            <div
              style="
                height: 60px;
                line-height: 60px;
                text-align: center;
                color: red;
                font-weight: 700;
                font-size: 20px;
                border-bottom: 1px solid #e4e7ed;
              "
            >
              调班申请表
            </div>
            <div style="padding: 20px; margin-top: 10px; height: 580px">
              <el-form
                ref="ruleFormRef"
                :model="form1"
                :rules="formRules"
                label-width="9vw"
              >
                <div style="display: flex">
                  <el-form-item prop="createBy" label="申请人：">
                    <el-input
                      disabled
                      v-model="form1.createBy"
                      style="width: 15vw"
                    />
                  </el-form-item>
                  <el-form-item
                    label-width="6vw"
                    prop="deptId"
                    label="所在处室："
                  >
                    <el-tree-select
                      disabled
                      v-model="form1.deptId"
                      style="width: 15vw"
                      :data="deptOptions"
                      :props="{
                        value: 'id',
                        label: 'label',
                        children: 'children',
                      }"
                      value-key="id"
                      placeholder="请选择所在处室"
                      check-strictly
                    />
                  </el-form-item>
                </div>

                <!--                <el-form-item prop="srcDate" label="值班日期：">
                  <el-col :span="24">
                    <el-date-picker
                      :disabled="showTable !== undefined"
                      style="width: 25vw"
                      v-model="form1.srcDate"
                      type="date"
                      format="YYYY-MM-DD"
                      value-format="YYYY-MM-DD"
                      placeholder="值班日期"
                      :disabled-date="disabledDate"
                    />
                  </el-col>
                </el-form-item>-->
                <!-- <el-form-item prop="status" label="值班类型：">
                  <el-col :span="24">
                    <el-select
                      style="width: 25vw"
                      v-model="form1.status"
                      placeholder="请选择"
                    >
                      <el-option
                        v-for="item in optionsData"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                      >
                      </el-option>
                    </el-select>
                  </el-col>
                </el-form-item> -->
                <div style="display: flex">
                  <el-form-item prop="targetDate" label="调班日期：">
                    <el-col :span="24">
                      <el-date-picker
                        :disabled="showTable !== undefined"
                        style="width: 15vw"
                        v-model="form1.targetDate"
                        type="date"
                        format="YYYY-MM-DD"
                        value-format="YYYY-MM-DD"
                        placeholder="调班日期"
                        @change="workPerson"
                        :disabled-date="disabledDate"
                      />
                    </el-col>
                  </el-form-item>
                  <el-form-item
                    label-width="6vw"
                    prop="adjustUserId"
                    label="调班人："
                  >
                    <el-col :span="17">
                      <el-select
                        v-model="form1.adjustUserId"
                        filterable
                        placeholder="请选择调班人"
                        style="width: 15vw"
                      >
                        <el-option
                          v-for="item in WorkData"
                          :key="item.value"
                          :label="item.status + '--' + item.name"
                          :value="item.userId"
                        />
                      </el-select>
                      <!-- <el-table
                      style="margin-top: 10px; height: 250px"
                      :data="WorkData"
                      ref="multipleTable1"
                      :row-key="getRowKeys"
                      @selection-change="handleSelectionChange"
                      @select="setSelectRows"
                      @select-all="selectAll"
                    >
                      <el-table-column
                        type="selection"
                        width="55"
                      ></el-table-column>
                      <el-table-column
                        label="值班类型"
                        min-width="15vw"
                        align="center"
                        prop="status"
                      >
                      </el-table-column>
                      <el-table-column
                        label="值班人员"
                        min-width="20vw"
                        prop="name"
                        align="center"
                      >
                      </el-table-column>
                    </el-table> -->
                    </el-col>
                  </el-form-item>
                </div>
                <el-form-item prop="nickName" label="替换人：">
                  <div>
                    <el-input
                      disabled
                      placeholder="请选择替换人"
                      v-model="form1.nickName"
                      style="width: 15vw"
                    />
                    <el-button
                      style="margin-left: 10px"
                      size="mini"
                      type="primary"
                      @click="getWorkData"
                      >选择</el-button
                    >
                  </div>
                </el-form-item>
                <div v-if="leaveTrue !== true">
                  <div v-if="leaveClear == true">
                    <el-form-item
                      v-if="showTable !== undefined"
                      label="下一步节点："
                    >
                      <el-select
                        v-model="selNextNode"
                        placeholder="请选择下一步节点"
                      >
                        <el-option
                          v-for="item in options"
                          :key="item.NodeID"
                          :label="item.Name"
                          :value="item.NodeID"
                      /></el-select>
                    </el-form-item>
                    <el-form-item label="销假日期：">
                      <el-date-picker
                        v-model="valDate"
                        type="date"
                        placeholder="请选择销假日期"
                        :size="size"
                      />
                    </el-form-item>
                  </div>
                  <div v-else>
                    <el-form-item
                      v-if="showTable !== undefined"
                      label="下一步节点："
                    >
                      <el-select
                        v-model="selNextNode"
                        placeholder="请选择下一步节点"
                      >
                        <el-option
                          v-for="item in options"
                          :key="item.NodeID"
                          :label="item.Name"
                          :value="item.NodeID"
                      /></el-select>
                    </el-form-item>
                    <el-form-item v-if="showTable" label="审核意见：">
                      <el-col :span="23">
                        <el-input
                          v-model="reviewMsg"
                          style="width: 20vw"
                          type="textarea"
                        />
                      </el-col>
                    </el-form-item>
                  </div>
                  <div
                    v-if="showTable !== undefined"
                    style="text-align: center; margin-top: 8vh"
                  >
                    <el-form-item>
                      <el-button
                        style="margin-top: 4vh"
                        type="primary"
                        @click="sendNext"
                        >提交</el-button
                      >
                      <el-button
                        style="margin-top: 4vh"
                        type="danger"
                        @click="sendBack"
                        >退回</el-button
                      >
                    </el-form-item>
                  </div>
                  <div v-else style="text-align: center; width: 100%">
                    <el-button
                      style="padding: 0 35px; margin-top: 8vh"
                      type="primary"
                      @click="onSubmit"
                      >提交</el-button
                    >
                  </div>
                </div>
              </el-form>

              <el-table
                :data="tableData"
                v-if="showTable !== undefined"
                style="width: 100%"
                ref="multipleTable1"
                :row-key="getRowKeys"
              >
                <el-table-column
                  type="index"
                  align="center"
                  label="序号"
                  width="80"
                />
                <el-table-column
                  prop="NodeName"
                  align="center"
                  label="处理步骤"
                />
                <el-table-column prop="EmpName" align="center" label="处理人" />
                <el-table-column
                  prop="DeptName"
                  align="center"
                  label="处理部门"
                />
                <el-table-column prop="" align="center" label="到达日期">
                  <template #default="scope">
                    {{ parseTime(scope.row.RDT, "{y}-{m}-{d} ") }}
                  </template>
                </el-table-column>
                <el-table-column prop="" align="center" label="处理日期" />
              </el-table>
              <div style="text-align: center" v-if="closeDialog == true">
                <el-button
                  style="padding: 0 30px; margin: 0px; margin-top: 2vh"
                  type="primary"
                  @click="closeLeaveDialog"
                  >关闭</el-button
                >
              </div>
            </div>
          </div></el-col
        >
        <el-col :span="4"><div class="grid-content ep-bg-purple" /></el-col>
      </el-row>
      <select-user
        @ok="SubmitSelect"
        @closeDialogf="closeSelUser"
        ref="selectRef"
      ></select-user>
      <!-- 退回 -->
      <el-dialog title="退回" v-model="dialogBack" width="40%">
        <el-form>
          <el-form-item label-width="200" label="退回节点：">
            <el-select
              v-model="nodeValue"
              placeholder="请选择退回节点信息"
              style="width: 240px"
            >
              <el-option
                v-for="item in nodeData"
                :key="item.No"
                :label="item.Name"
                :value="item.No"
              />
            </el-select>
          </el-form-item>
          <el-form-item
            label-width="200"
            label="退回原因："
            placeholder="请输入退回原因"
          >
            <el-input v-model="returnMsg" style="width: 20vw" type="textarea" />
          </el-form-item>
        </el-form>
        <span
          style="position: relative; left: 28vw"
          slot="footer"
          class="dialog-footer"
        >
          <el-button @click="dialogBack = false">取 消</el-button>
          <el-button type="primary" @click="submitNodeBack">确 定</el-button>
        </span>
      </el-dialog>
      <el-dialog
        v-model="dialogVisibleTh"
        title="选择替换人"
        width="1200px"
        style="height: 850px"
        :before-close="handleClose"
      >
        <el-row :gutter="20">
          <el-col
            style="
              padding: 0;
              width: 250px;
              border: 1px solid #e7eaec;
              border-radius: 5px;
              min-height: 680px;
            "
            :span="4.5"
            :xs="24"
          >
            <div
              style="
                display: flex;
                width: 250px;
                height: 40px;
                line-height: 40px;
                border-bottom: 1px solid #e7eaec;
                margin-bottom: 10px;
              "
            >
              <div
                style="
                  font-size: 17px;
                  margin-left: 15px;
                  padding-left: 10px;
                  height: 40px;
                  width: 110px;
                  border-right: 1px solid #e7eaec;
                  cursor: pointer;
                "
              >
                所属部门
              </div>
            </div>

            <div class="head-container"></div>

            <!-- 部门 -->
            <div class="head-container">
              <el-tree
                :data="deptOptionsDept"
                :props="{ label: 'label', children: 'children' }"
                :expand-on-click-node="false"
                :filter-node-method="filterNode"
                ref="dept"
                node-key="id"
                highlight-current
                default-expand-all
                @node-click="handleNodeClick"
                :current-node-key="currentNodeKey"
                :default-expanded-keys="expandedKeys"
              />
            </div>
            <!-- 常用联系人 -->
          </el-col>

          <!-- 所属部门 -->
          <el-col
            style="margin-left: 40px; margin-top: 5px"
            :span="17"
            :xs="10"
          >
            <el-form
              :model="queryParams"
              ref="queryRef"
              :inline="true"
              label-width="68px"
              style="margin-bottom: 20px"
            >
              <el-form-item label="用户姓名" prop="nickName">
                <el-input
                  v-model="queryParams.nickName"
                  placeholder="请输入用户姓名"
                  clearable
                  style="width: 240px"
                />
              </el-form-item>
              <el-form-item>
                <el-button type="primary" icon="Search" @click="handleQuery"
                  >搜索</el-button
                >
                <el-button icon="RefreshRight" @click="resetQuery"
                  >重置</el-button
                >
              </el-form-item>
            </el-form>

            <el-table
              ref="multipleTable2"
              v-loading="loading"
              :row-key="getRowKeys1"
              :data="userList"
              @selection-change="handleSelectionChange"
              @select="setSelectRows"
              @select-all="selectAll"
            >
              <el-table-column
                :selectable="getSelectable"
                :reserve-selection="true"
                type="selection"
                width="50"
                align="center"
              />
              <el-table-column
                label="用户姓名"
                align="center"
                key="nickName"
                prop="nickName"
                v-if="columns[2].visible"
                :show-overflow-tooltip="true"
              />
              <el-table-column
                :show-overflow-tooltip="true"
                align="center"
                prop="phonenumber"
                label="联系方式"
              ></el-table-column>
              <el-table-column
                label="所属部门"
                align="center"
                key="deptName"
                prop="dept.deptName"
                v-if="columns[3].visible"
                :show-overflow-tooltip="true"
              />
            </el-table>
            <div style="float: right; margin-top: 20px; margin-right: 20px">
              <el-pagination
                v-model:current-page="queryParams.pageNum"
                v-model:page-size="queryParams.pageSize"
                :page-sizes="[10, 20, 30, 50, 100]"
                :small="small"
                :disabled="disabled"
                :background="background"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
              />
            </div>
          </el-col>
        </el-row>

        <template #footer>
          <span class="dialog-footer">
            <el-button @click="quxiao">取消</el-button>
            <el-button type="primary" @click="submitUserList"> 确认 </el-button>
          </span>
        </template>
      </el-dialog>
    </div>
  </div>
</template>

<script>
import {
  addWork,
  getConditionUsers,
  execAdjustDuty,
  updateYwDutyAdjustAudit,
} from "@/api/workApply";
import {
  generNextStepNode,
  generNextStepAllNode,
  sendFlowToNext,
  sendFlowToNextLeave,
  node_ReturnWork,
} from "@/api/liucheng";
import { ElMessage } from "element-plus";
import selectUser from "@/views/clocking/selectUserDb.vue";
import { getJToken } from "@/utils/auth";
import { getInfo } from "@/api/login";
import { useDict } from "@/utils/dict";
import { get } from "@vueuse/core";
import { ColorStyle } from "quill";
import { listUser2, deptTreeSelect, deptTreeSelect2 } from "@/api/system/user";
export default {
  name: "YinetoaLeaveApplication",
  props: [
    "dialogVisible",
    "name",
    "showTable",
    "WorkId",
    "FK_Flow",
    "nodeName",
    "trueLeave",
    "closeDialog",
  ],
  components: { selectUser },
  data() {
    var validator2 = (rule, val, callback) => {
      if (!val) {
        callback(new Error("请输入用车天数"));
      } else {
        const reg = /^([0-9])*$/; //
        if (reg.test(val)) {
          return callback();
        } else {
          callback(new Error("格式错误，仅支持输入纯数字"));
        }
      }
    };
    var validator3 = (rule, val, callback) => {
      if (!val) {
        callback(new Error("请输入乘车人数"));
      } else {
        const reg = /^([0-9])*$/; //
        if (reg.test(val)) {
          return callback();
        } else {
          callback(new Error("格式错误，仅支持输入纯数字"));
        }
      }
    };

    return {
      columns: [
        { key: 0, label: `用户编号`, visible: true },
        { key: 1, label: `用户名称`, visible: true },
        { key: 2, label: `用户昵称`, visible: true },
        { key: 3, label: `部门`, visible: true },
        { key: 4, label: `手机号码`, visible: true },
        { key: 5, label: `状态`, visible: true },
        { key: 6, label: `创建时间`, visible: true },
      ],
      form: {},
      selection: [],
      userList: [],
      loading: false,
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        userName: undefined,
        phonenumber: undefined,
        status: undefined,
        deptId: undefined,
        nickName: undefined,
      },
      dateRange: [],
      deptOptionsDept: [],
      optionsData: [
        {
          value: "0",
          label: "白天",
        },
        {
          value: "1",
          label: "夜晚",
        },
        {
          value: "3",
          label: "带班干部",
        },
        {
          value: "2",
          label: "应急值班",
        },
        {
          value: "4",
          label: "值班司机",
        },
      ],
      value: "",
      dialogVisibleTh: false,
      WorkData: [],
      createBy: "",
      deptOptions: undefined,
      flowDatas: {
        FK_Flow: null,
        toNodeId: "",
        WorkID: "",
      },
      Fzr: null,
      Jld: null,
      total: 0,
      YorN: "1",
      form1: {
        leaveTime: null,
      },
      form: { params: {} },
      options: [],
      leaveTime: "",
      formRules: {
        createBy: [
          { required: true, trigger: "blur", message: "请输入您的姓名" },
        ],
        // deptId: [{ required: true, trigger: "blur", message: "请输入联系方式" }],

        deptId: [
          {
            required: true,
            message: "请选择所在处室",
            trigger: "change",
          },
        ],

        targetDate: [
          {
            required: true,
            message: "请选择调班日期",
            trigger: "change",
          },
        ],
        adjustUserId: [
          {
            required: true,
            message: "请选择调班人员",
            trigger: "change",
          },
        ],
        nickName: [
          { required: true, message: "请选择替换人员", trigger: "change" },
        ],

        // status: [
        //   {
        //     required: true,
        //     message: "请选择值班类型",
        //     trigger: "change",
        //   },
        // ],
      },
    };
  },

  created() {
    this.getUserInfo();
    this.getDeptTree();
  },
  watch: {},

  mounted() {
    this.getUserInfo();
    this.getDeptTree();
  },

  methods: {
    quxiao() {
      this.dialogVisibleTh = false;
      this.form.replaceUserId = null;
      this.form1.nickName = null;
    },
    submitUserList() {
      this.dialogVisibleTh = false;
    },
    /** * 表格单行返回是否可以勾选 */
    getSelectable(row) {
      return row.status !== "REJECT";
    },
    // /** 节点单击事件 */
    handleNodeClick(data) {
      this.queryParams.deptId = data.id;
      this.handleQuery();
    },

    // /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    // /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.resetForm("queryRef");
      this.queryParams.deptId = undefined;
      this.$nextTick(() => {
        this.$refs.deptTreeRef.setCurrentKey(null);
      });
      this.handleQuery();
    },
    //分页
    handleSizeChange(newPage) {
      this.queryParams.pageSize = newPage;
      this.getList();
    },
    handleCurrentChange(val) {
      this.queryParams.pageNum = val;
      this.getList();
    },
    async getList() {
      this.loading = true;
      await listUser2(this.addDateRange(this.queryParams, this.dateRange)).then(
        (res) => {
          this.loading = false;
          this.userList = res.rows;
          //console.log("this.userList", this.userList);
          this.total = res.total;
        }
      );
      this.selection = [];
    },
    // /** 查询部门下拉树结构 */
    getDeptTree() {
      deptTreeSelect2().then((response) => {
        this.deptOptionsDept = response.data;
      });
    },
    getWorkData() {
      deptTreeSelect2().then((response) => {
        this.deptOptionsDept = response.data;
      });
      this.getList();
      this.dialogVisibleTh = true;
    },
    disabledDate(time) {
      // 获取今天的日期，不包括时间
      const today = new Date();
      today.setHours(0, 0, 0, 0);
      // 禁用所有早于今天的日期
      return time.getTime() < today.getTime();
    },
    getRowKeys(row) {
      return row.userId;
    },
    getRowKeys1(row) {
      return row.userId;
    },
    // el-table只能选一个

    setSelectRows(selection) {
      if (selection.length > 1) {
        const del_row = selection.shift();
        this.$refs.multipleTable2.toggleRowSelection(del_row, false); //设置这一行取消选中
      }
    },

    // 点击表头的全选复选框触发
    selectAll(selection) {
      this.$modal.msgError("人员只能选一个！");
      this.$refs.multipleTable2.clearSelection();
      return;
    },
    handleSelectionChange(selection) {
      console.log("selection", selection);
      if (selection.length != 0) {
        this.form.replaceUserId = selection[0].userId;
        this.form1.nickName =
          selection[0].dept.deptName + " -- " + selection[0].nickName;
      } else {
        this.form.replaceUserId = null;
        this.form1.nickName = null;
      }
    },
    workPerson(val) {
      console.log(val);
      getConditionUsers({ dateStr: val }).then((res) => {
        console.log("res", res);
        this.WorkData = res.rows;
      });
    },
    getDeptTree() {
      deptTreeSelect().then((response) => {
        this.deptOptions = response.data;
      });
    },
    changeDate(val) {
      var d1 = new Date(val[0]);
      var d2 = new Date(val[1]);
      var diff = d2 - d1;
      var days = diff / (1000 * 60 * 60 * 24);
      this.form1.dayNum = Math.floor(days) + 1;
    },
    getUserInfo() {
      getInfo().then((res) => {
        this.form1.createBy = res.user.nickName;
        this.createBy = res.user.nickName;
        this.form1.userId = res.user.userId;
        this.form1.deptId = res.user.deptId;
        this.Fzr = res.roles.filter((item) => item == "chushifzr").length > 0;
        this.Jld = res.roles.filter((item) => item == "jld").length > 0;
      });
    },
    onSubmit() {
      this.$refs["ruleFormRef"].validate((valid) => {
        // this.form.createBy = this.form1.createBy;
        this.form.deptId = this.form1.deptId;
        this.form.userId = this.form1.userId;
        // this.form.srcDate = this.form1.srcDate;
        this.form.targetDate = this.form1.targetDate;
        this.form.adjustUserId = this.form1.adjustUserId;
        console.log("this.form", this.form);
        // if (
        //   this.form.adjustUserId == null ||
        //   this.form.adjustUserId == "" ||
        //   this.form.adjustUserId == undefined
        // ) {
        //   this.$modal.msgError("请选择调班人");
        //   return;
        // }
        if (valid) {
          if (this.Jld) {
            addWork(this.form)
              .then((response) => {
                if (response.data.VarToNodeID == 2004) {
                  console.log(response.data.workid);
                  //最后一步调班
                  updateYwDutyAdjustAudit({
                    workId: response.data.workid,
                    status: this.YorN,
                    msg: "无",
                  });
                  if (this.YorN == 1) {
                    execAdjustDuty({ workId: response.data.workid }).then(
                      (res) => {
                        // if(res.code==200){
                        //   ElMessage({
                        //     message: "调班成功",
                        //     type: "success",
                        //   });
                        // }
                      }
                    );
                  }
                }
                ElMessage({
                  message:
                    "已发送到" +
                    response.data.VarToNodeName +
                    "节点，接收人：" +
                    response.data.VarAcceptersName,
                  type: "success",
                });
                this.$emit("change1");
                this.$refs.ruleFormRef.resetFields();
                this.$modal.closeLoading();
                this.reset();
              })
              .catch(() => {
                this.$modal.closeLoading();
              });
          } else {
            console.log(getJToken());
            this.flowDatas.token = getJToken();
            this.flowDatas.WorkID = this.workId;
            this.flowDatas.FK_Flow = "020";
            this.flowDatas.toNodeId = null;
            console.log(this.flowDatas);
            // this.$modal.closeLoading();
            this.$refs["selectRef"].show1(this.flowDatas);
          }
          // if (this.Fzr) {
          //   this.$modal.loading("提交中...");
          //   console.log(getJToken());
          //   this.flowDatas.token = getJToken();
          //   this.flowDatas.WorkID = this.workId;
          //   this.flowDatas.FK_Flow = "020";
          //   this.flowDatas.toNodeId = null;
          //   console.log(this.flowDatas);
          //   // this.$modal.closeLoading();
          //   this.$refs["selectRef"].show1(this.flowDatas);
          // } else {
          //   addWork(this.form)
          //     .then((response) => {
          //       this.$modal.loading("提交中...");
          //       if (response.data.VarToNodeID == 2004) {
          //         console.log(response.data.workid);
          //         //最后一步调班
          //         updateYwDutyAdjustAudit({
          //           workId: response.data.workid,
          //           status: this.YorN,
          //           msg: "无",
          //         });
          //         if (this.YorN == 1) {
          //           execAdjustDuty({ workId: response.data.workid }).then(
          //             (res) => {
          //               // if(res.code==200){
          //               //   ElMessage({
          //               //     message: "调班成功",
          //               //     type: "success",
          //               //   });
          //               // }
          //             }
          //           );
          //         }
          //       }
          //       ElMessage({
          //         message:
          //           "已发送到" +
          //           response.data.VarToNodeName +
          //           "节点，接收人：" +
          //           response.data.VarAcceptersName,
          //         type: "success",
          //       });
          //       this.$refs.ruleFormRef.resetFields();
          //       this.$modal.closeLoading();
          //       this.$emit("change1");
          //       this.reset();
          //     })
          //     .catch(() => {
          //       this.$modal.closeLoading();
          //     });
          // }
        } else {
          this.$modal.closeLoading();
        }
      });
    },

    reset() {
      this.form1 = {
        createBy: this.createBy,
        userId: this.form.userId,
        deptId: this.form.deptId,
      };
      this.WorkData = [];
      this.$refs.multipleTable1.clearSelection();
    },
    SubmitSelect(selUsers) {
      this.form.params["toEmps"] = selUsers;
      if (selUsers != undefined && selUsers != "") {
        console.log(this.form);
        this.$modal.loading("提交中...");
        addWork(this.form)
          .then((res) => {
            this.$modal.msgSuccess(
              "已发送到" +
                res.data.VarToNodeName +
                "节点," +
                "处理人:" +
                res.data.VarAcceptersName
            );
            this.$nextTick(() => {
              this.reset();
              this.$emit("change1");
              this.$refs.ruleFormRef.resetFields();
            });
            this.$emit("change1");
            this.$modal.closeLoading();
          })
          .catch(() => {
            this.$modal.closeLoading();
          });
      }
    },
  },
};
</script>

<style lang="scss" scoped></style>
