<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
      <!-- <el-form-item label="受检单位_id" prop="inspectedUnitId">
        <el-input
          v-model="queryParams.inspectedUnitId"
          placeholder="请输入受检单位_id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="受检单位" prop="inspectedUnit">
        <el-input
          v-model="queryParams.inspectedUnit"
          placeholder="请输入受检单位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="类型" prop="inspectionType">
        <el-select v-model="queryParams.inspectionType" placeholder="请选择类型" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="单位检查_id" prop="unitCheckId">
        <el-input
          v-model="queryParams.unitCheckId"
          placeholder="请输入单位检查_id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="检查单位" prop="unitCheck">
        <el-input
          v-model="queryParams.unitCheck"
          placeholder="请输入检查单位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="检查时间" prop="inspectionTime">
        <el-input
          v-model="queryParams.inspectionTime"
          placeholder="请输入检查时间"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="检查地点" prop="inspectionSite">
        <el-input
          v-model="queryParams.inspectionSite"
          placeholder="请输入检查地点"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="分值" prop="score">
        <el-input
          v-model="queryParams.score"
          placeholder="请输入分值"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="整改时间" prop="rectificationTime">
        <el-input
          v-model="queryParams.rectificationTime"
          placeholder="请输入整改时间"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="当前状态" prop="currentState">
        <el-input
          v-model="queryParams.currentState"
          placeholder="请输入当前状态"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是由" prop="question">
        <el-input
          v-model="queryParams.question"
          placeholder="请输入是由"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建人ID" prop="createUserId">
        <el-input
          v-model="queryParams.createUserId"
          placeholder="请输入创建人ID"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建人" prop="createUser">
        <el-input
          v-model="queryParams.createUser"
          placeholder="请输入创建人"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="负责人ID" prop="chargePeopleId">
        <el-input
          v-model="queryParams.chargePeopleId"
          placeholder="请输入负责人ID"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="负责人" prop="chargePeople">
        <el-input
          v-model="queryParams.chargePeople"
          placeholder="请输入负责人"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="图片举证" prop="pictureProof">
        <el-input
          v-model="queryParams.pictureProof"
          placeholder="请输入图片举证"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文件举证" prop="documentProof">
        <el-input
          v-model="queryParams.documentProof"
          placeholder="请输入文件举证"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
      <!-- <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>-->
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5" class="isSubmit">
        <el-radio-group v-model="queryParams.caoZuoType" @change="caoZuoTypefun">
          <el-radio-button label="0">减分</el-radio-button>
          <el-radio-button label="1">加分</el-radio-button>
        </el-radio-group>
      </el-col>
    </el-row>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="success"
          v-if="queryParams.caoZuoType==0"
          style="background:rgb(255 106 0)"
          @click="handleAdd"
        >减分录入</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          v-if="queryParams.caoZuoType==1"
          style="background: rgb(3 157 3)"
          @click="handleAdd"
        >加分录入</el-button>
      </el-col>
      <!-- <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['bdglregular:regularinfo:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['bdglregular:regularinfo:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          :loading="exportLoading"
          @click="handleExport"
          v-hasPermi="['bdglregular:regularinfo:export']"
        >导出</el-button>
      </el-col>-->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table
      v-loading="loading"
      :data="regularinfoList"
      :header-cell-style="{ background: '#003C69', color: 'white' }"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="序号" align="center" type="index" />
      <!-- <el-table-column label="主键ID" align="center" prop="id" /> -->
      <!-- <el-table-column label="受检单位_id" align="center" prop="inspectedUnitId" /> -->
      <el-table-column label="受检单位" align="center" prop="inspectedUnit" />
      <el-table-column label="类型" align="center" prop="inspectionType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.inspectionType" :value="scope.row.inspectionType" />
        </template>
      </el-table-column>
      <!-- <el-table-column label="单位检查_id" align="center" prop="unitCheckId" /> -->
      <el-table-column label="检查单位" align="center" prop="unitCheck" />
      <el-table-column label="检查时间" align="center" prop="inspectionTime" />
      <el-table-column label="检查地点" align="center" prop="inspectionSite" />
      <el-table-column label="分值" align="center" :key="Math.random()" prop="score">
        <template slot-scope="scope">
          <div style="color:rgb(255 106 0);" v-if="queryParams.caoZuoType==0">{{scope.row.score}}</div>
          <div style="color:rgb(2 255 2);" v-if="queryParams.caoZuoType==1">{{scope.row.score}}</div>
        </template>
      </el-table-column>
      <el-table-column
        label="当前状态"
        align="center"
        prop="currentState"
        :key="Math.random()"
        v-if="queryParams.caoZuoType==0"
      >
        <template slot-scope="scope">
          <div
            style="color:#ff0000;"
            v-if="scope.row.currentState=='未通过'"
          >{{scope.row.currentState}}</div>
          <div
            style="color:#ffa500;"
            v-if="scope.row.currentState=='待处理'"
          >{{scope.row.currentState}}</div>
          <div
            style="color:#3498db;"
            v-if="scope.row.currentState=='待验收'"
          >{{scope.row.currentState}}</div>
          <div
            style="color:#38d764;"
            v-if="scope.row.currentState=='已通过'"
          >{{scope.row.currentState}}</div>
          <div
            style="color:#909399;"
            v-if="scope.row.currentState=='过期未整改'"
          >{{scope.row.currentState}}</div>
        </template>
      </el-table-column>
      <el-table-column label="事由" show-overflow-tooltip align="center" prop="question" />
      <el-table-column
        label="整改时间"
        align="center"
        prop="rectificationTime"
        :key="Math.random()"
        v-if="queryParams.caoZuoType==0"
      />
      <!-- <el-table-column label="创建人ID" align="center" prop="createUserId" />
      <el-table-column label="创建人" align="center" prop="createUser" />
      <el-table-column label="负责人ID" align="center" prop="chargePeopleId" />
      <el-table-column label="负责人" align="center" prop="chargePeople" />
      <el-table-column label="整改措施" align="center" prop="correctiveAction" />
      <el-table-column label="图片举证" align="center" prop="pictureProof" />
      <el-table-column label="文件举证" align="center" prop="documentProof" />-->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="btk"
            type="text"
            v-if="scope.row.caoZuoType=='0'&&scope.row.isCaoZuoDept==0&&(scope.row.currentState=='未通过'||scope.row.currentState=='待处理')"
            @click="handleUpdate(scope.row)"
          >整改</el-button>
          <el-button
            size="btu"
            type="text"
            @click="shenpifun(scope.row)"
            v-if="queryParams.caoZuoType==0&&scope.row.isShenPi==0&&scope.row.currentState=='待验收'"
          >审批</el-button>
          <el-button size="btd" type="text" @click="handleDelete(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改经常性检查对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" :inline="true" label-width="120px">
        <div class="jiben">基本信息</div>
        <el-form-item label="检查单位" prop="unitCheck">
          <el-select
            v-model="form.unitCheck"
            @change="unitCheckIdfun"
            clearable
            placeholder="请选择受检单位"
            :disabled="disabled"
          >
            <el-option
              v-for="dict in unitId"
              :key="dict.deptId"
              :label="dict.deptName"
              :value="dict"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="受检单位" prop="inspectedUnit">
          <el-select
            v-model="form.inspectedUnit"
            @change="inspectedUnitfun"
            clearable
            placeholder="请选择受检单位"
            :disabled="disabled"
          >
            <el-option
              v-for="dict in unitId"
              :key="dict.deptId"
              :label="dict.deptName"
              :value="dict"
            ></el-option>
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="检查单位" prop="unitCheck">
          <el-select v-model="form.unitCheck" clearable placeholder="请选择检查单位">
            <el-option
              v-for="dict in unitId"
              :key="dict.deptId"
              :label="dict.deptName"
              :value="dict.deptId"
            ></el-option>
          </el-select>
        </el-form-item>-->
        <!-- <el-form-item label="受检单位" prop="inspectedUnit">
          <el-select v-model="form.inspectedUnit" clearable placeholder="请选择受检单位">
            <el-option
              v-for="dict in unitId"
              :key="dict.deptId"
              :label="dict.deptName"
              :value="dict.deptId"
            ></el-option>
          </el-select>
        </el-form-item>-->
        <el-form-item label="类型" prop="inspectionType">
          <el-select
            v-model="form.inspectionType"
            :disabled="disabled"
            clearable
            placeholder="请选择类型"
          >
            <el-option
              v-for="dict in inspectionType"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="单位检查_id" prop="unitCheckId">
          <el-input v-model="form.unitCheckId" placeholder="请输入单位检查_id" />
        </el-form-item>-->
        <el-form-item label="检查时间" prop="inspectionTime">
          <el-date-picker
            clearable
            size="small"
            v-model="form.inspectionTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择检查时间"
            :disabled="disabled"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="检查地点" prop="inspectionSite">
          <el-input v-model="form.inspectionSite" :disabled="disabled" placeholder="请输入检查地点" />
        </el-form-item>
        <el-form-item label="分值" prop="score" v-if="jiannum==0">
          <!-- <el-input v-model="form.score" type="number" @blur="scoreblur" :disabled="disabled" placeholder="请输入分值" /> -->
          <el-input-number v-model="form.score" controls-position="right" :min="0"></el-input-number>
        </el-form-item>
        <el-form-item label="整改时间" prop="rectificationTime" v-if="queryParams.caoZuoType==0">
          <el-date-picker
            clearable
            size="small"
            v-model="form.rectificationTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择整改时间"
            :disabled="disabled"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="负责人" prop="chargePeople" v-if="jiannum!=0">
          <el-select
            v-model="form.chargePeople"
            clearable
            @change="chargePeoplefun"
            placeholder="请选择负责人"
            :disabled="disabled"
          >
            <el-option v-for="dict in peopleIds" :key="dict.id" :label="dict.name" :value="dict"></el-option>
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="负责人" prop="chargePeople">
          <el-select
            v-model="form.chargePeople"
            clearable
            @change="peopleIdfun"
            ref="peopleId"
            placeholder="请选择负责人"
          >
            <el-option
              v-for="dict in peopleIds"
              :key="dict.id"
              :label="dict.name"
              :value="dict.id"
            ></el-option>
          </el-select>
        </el-form-item>-->
        <!-- <el-form-item label="当前状态" prop="currentState">
          <el-input v-model="form.currentState" placeholder="请输入当前状态" />
        </el-form-item>-->
        <!-- <el-form-item label="是由" prop="question">
          <el-input v-model="form.question" placeholder="请输入是由" />
        </el-form-item>
        <el-form-item label="创建人ID" prop="createUserId">
          <el-input v-model="form.createUserId" placeholder="请输入创建人ID" />
        </el-form-item>
        <el-form-item label="创建人" prop="createUser">
          <el-input v-model="form.createUser" placeholder="请输入创建人" />
        </el-form-item>
        <el-form-item label="负责人ID" prop="chargePeopleId">
          <el-input v-model="form.chargePeopleId" placeholder="请输入负责人ID" />
        </el-form-item>
        <el-form-item label="负责人" prop="chargePeople">
          <el-input v-model="form.chargePeople" placeholder="请输入负责人" />
        </el-form-item>-->
        <div class="jiben" v-if="queryParams.caoZuoType==0">存在问题</div>
        <div class="jiben" v-if="queryParams.caoZuoType==1">加分事由</div>
        <el-form-item label prop="question">
          <el-input
            v-model="form.question"
            :disabled="disabled"
            type="textarea"
            placeholder="请输入内容"
          />
        </el-form-item>
        <div class="jiben" v-if="jiannum!=0">整改措施</div>
        <el-form-item label prop="correctiveAction" v-if="jiannum!=0">
          <el-input
            v-model="form.correctiveAction"
            :disabled="disabled"
            type="textarea"
            placeholder="请输入内容"
          />
        </el-form-item>
        <div class="jiben" v-if="jiannum!=0">图片举证</div>
        <el-form-item label prop="pictureProof" v-if="jiannum!=0">
          <imageUpload v-model="form.pictureProof" :limit="1" />
          <!-- <el-input v-model="form.pictureProof" placeholder="请输入图片举证" /> -->
        </el-form-item>
        <div class="jiben" v-if="jiannum!=0">文件举证</div>
        <el-form-item label prop="documentProof" v-if="jiannum!=0">
          <fileUpload v-model="form.documentProof" />
          <!-- <el-input v-model="form.documentProof" placeholder="请输入文件举证" /> -->
        </el-form-item>
        <div class="jiben" v-if="currentState==1">未通过原因</div>
        <el-form-item label prop="score" v-if="currentState==1">
          <el-input
            v-model="form.reasonReturn"
            :disabled="disabled||curr"
            type="textarea"
            placeholder="请输入未通过原因"
          />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm" v-if="btnnum!=0&&btnnum!=1">确 定</el-button>
        <el-button type="primary" @click="tongguofun" v-if="btnnum==0">通 过</el-button>
        <el-button type="primary" @click="zhenggaifun" v-if="btnnum==0">重新整改</el-button>
        <el-button type="primary" @click="weitongguofun" v-if="btnnum==1">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listRegularinfo,
  getRegularinfo,
  delRegularinfo,
  addRegularinfo,
  updateRegularinfo,
  exportRegularinfo,
  getDept,
  listPeople,
  editquestion,
  editissuccess,
  editisfalse,
  bumenlist
} from "@/api/bdglregular/regularinfo";

export default {
  name: "Regularinfo",
  dicts: ["inspectionType"],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 经常性检查表格数据
      regularinfoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        inspectedUnitId: null,
        inspectedUnit: null,
        inspectionType: null,
        unitCheckId: null,
        unitCheck: null,
        inspectionTime: null,
        inspectionSite: null,
        score: null,
        rectificationTime: null,
        currentState: null,
        question: null,
        createUserId: null,
        createUser: null,
        chargePeopleId: null,
        chargePeople: null,
        correctiveAction: null,
        pictureProof: null,
        documentProof: null,
        caoZuoType: 0
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        unitCheck: [
          { required: true, message: "检查单位不能为空", trigger: "change" }
        ],
        inspectedUnit: [
          { required: true, message: "受检单位不能为空", trigger: "change" }
        ],
        inspectionType: [
          { required: true, message: "类型不能为空", trigger: "change" }
        ],
        inspectionTime: [
          { required: true, message: "检查时间不能为空", trigger: "change" }
        ],
        inspectionSite: [
          { required: true, message: "检查地点不能为空", trigger: "blur" }
        ],
        score: [{ required: true, message: "分值不能为空", trigger: "blur" }],
        rectificationTime: [
          { required: true, message: "整改时间不能为空", trigger: "change" }
        ],
        chargePeople: [
          { required: true, message: "负责人不能为空", trigger: "change" }
        ]
      },
      //单位
      unitId: [],
      //检查类型
      inspectionType: [],
      //调动人员对象
      peopleIds: [],
      //区分减分、增改
      jiannum: null,
      btnnum: null,
      disabled: false,
      currentState:null,
      curr:null,
    };
  },
  created() {
    //部门数据
    getDept().then(res => {
      if (res.code == 200) {
        this.unitId = res.data;
      }
    });
    //调动人员对象
    listPeople().then(res => {
      if (res.code == 200) {
        this.peopleIds = res.rows;
      }
    });
    //检查类型
    this.getDicts("inspectionType").then(response => {
      this.inspectionType = response.data;
    });

    if (this.$route.query.id) {
      bumenlist(this.$route.query.id).then(res => {
        console.log(1);
        this.regularinfoList = res.rows;
        this.total = res.total;
        this.loading = false;
      });
    } else {
      this.getList();
    }
  },
  methods: {
    /** 查询经常性检查列表 */
    getList() {
      this.loading = true;
      listRegularinfo(this.queryParams).then(response => {
        this.regularinfoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
      this.jiannum = null;
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        inspectedUnitId: null,
        inspectedUnit: null,
        inspectionType: null,
        unitCheckId: null,
        unitCheck: null,
        inspectionTime: null,
        inspectionSite: null,
        score: null,
        rectificationTime: null,
        currentState: null,
        question: null,
        createTime: null,
        createUserId: null,
        createUser: null,
        updateTime: null,
        chargePeopleId: null,
        chargePeople: null,
        correctiveAction: null,
        pictureProof: null,
        documentProof: null,
        reasonReturn: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "经常性检查";
      this.jiannum = 0;
      this.btnnum = null;
    },
    /** 整改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids;
      getRegularinfo(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改经常性检查";
        this.jiannum = 1;
        this.btnnum = null;
        if (this.form.currentState == "未通过") {
          this.currentState = 1;
          this.curr=true
        }
      });
    },
    /** 审批按钮操作 */
    shenpifun(row) {
      this.reset();
      const id = row.id || this.ids;
      getRegularinfo(id).then(response => {
        this.disabled = true;
        this.form = response.data;
        this.open = true;
        this.title = "修改经常性检查";
        this.jiannum = 1;
        this.btnnum = 0;
      });
    },
    //通过
    tongguofun() {
      editissuccess(this.form).then(res => {
        if (res.code == 200) {
          this.$modal.msgSuccess("审批成功");
          this.open = false;
          this.getList();
        }
      });
    },
    //重新整改
    zhenggaifun() {
      this.jiannum = 0;
      this.btnnum = 1;
      this.disabled = false;
      this.currentState=1;
      this.curr=false;
      // this.reset();
      // editissuccess().then(res => {
      //   if (res.code == 200) {
      //     this.$modal.msgSuccess("审批成功");
      //   }
      // });
    },
    //未通过提交
    weitongguofun() {
      editisfalse(this.form).then(res => {
        this.$modal.msgSuccess("操作成功");
        this.open = false;
        this.getList();
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            this.form.caoZuoType = this.queryParams.caoZuoType;
            editquestion(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            this.form.caoZuoType = this.queryParams.caoZuoType;
            addRegularinfo(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal
        .confirm('是否确认删除经常性检查编号为"' + ids + '"的数据项？')
        .then(function() {
          return delRegularinfo(ids);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$modal
        .confirm("是否确认导出所有经常性检查数据项？")
        .then(() => {
          this.exportLoading = true;
          return exportRegularinfo(queryParams);
        })
        .then(response => {
          this.$download.name(response.msg);
          this.exportLoading = false;
        })
        .catch(() => {});
    },
    //检查单位
    unitCheckIdfun(val) {
      this.form.unitCheckId = val.deptId;
      this.form.unitCheck = val.deptName;
    },
    //受检单位
    inspectedUnitfun(val) {
      this.form.inspectedUnitId = val.deptId;
      this.form.inspectedUnit = val.deptName;
    },
    //负责人
    chargePeoplefun(val) {
      console.log(val);
      this.form.chargePeopleId = val.id;
      this.form.chargePeople = val.name;
    },
    caoZuoTypefun() {
      this.getList();
    },
    scoreblur() {
      if (this.form.score < 0) {
        this.form.score = null;
      }
    }
  }
};
</script>
<style scoped>
::v-deep .el-dialog {
  width: 1030px !important;
  background-color: #004d86;
}

::v-deep .el-dialog__header {
  border-bottom: 1px solid #718a9d;
}
::v-deep .el-dialog__title {
  color: #fff;
  font: 18px;
}
::v-deep .el-dialog__headerbtn .el-dialog__close {
  color: #fff;
}
.el-form-item ::v-deep .el-input__inner {
  width: 200px;
  height: 36px;
  background: #004d86;
  color: #fff;
  border: 1px solid #fff !important;
}
::v-deep .el-date-editor.el-input {
  width: 200px;
  height: 36px;
}
::v-deep .el-upload--picture-card {
  height: 210px;
  width: 170px;
  line-height: 210px;
}
.el-upload--picture-card /deep/ .el-upload--picture-card i {
  font-size: 48px;
}
::v-deep .el-upload__tip {
  display: none;
}
::v-deep .el-textarea__inner {
  width: 980px;
  height: 104px;
}
.div-box-title span {
  width: 25px;
  height: 25px;
  display: inline-block;
  background-color: #1c86e1;
  line-height: 25px;
  text-align: center;
  font-size: 16px;
  cursor: pointer;
  margin-left: 865px;
}
.el-select-dropdown__item:hover {
  color: #1c86e1;
}
.el-select-dropdown__item {
  color: #000;
}
.el-tree {
  background-color: #00365f;
  color: #fff;
}
::v-deep .el-tree-node__content:hover {
  color: #1c86e1;
}
::v-deep .el-upload-list--picture-card .el-upload-list__item {
  height: 210px;
  width: 170px;
}
::v-deep .radiogroup {
  height: 36px;
}
::v-deep .radiogroup .el-radio-button {
  height: 36px;
}
::v-deep .el-input-number__increase {
  background-color: transparent !important;
  border: none;
  color: #cccccc;
  border-bottom: none !important;
}
::v-deep .el-input-number__decrease {
  background-color: transparent !important;
  border: none !important;
  color: #cccccc;
}
</style>
