<template>
  <div class="testdiv">
    <!-- 查询条件 -->
    <div class="divborder newSearchDiv" style="margin: 0px">
      <!-- 任务编号 -->
      <div class="filter">
        <label>任务编号：</label>
        <Input class="searchInput" v-model="taskNo" />
      </div>
      <!-- 执行人员 -->
      <div class="filter">
        <label>实际执行人：</label>
        <Input class="searchInput" v-model="executive" />
      </div>
      <!-- 派工日期范围 -->
      <div class="filter">
        <label>创建时间：</label>
        <DatePicker
          type="daterange"
          :value="dispatchDateRange"
          class="searchInput middleWidth"
          @on-change="dispatchDateRangeChange"
        ></DatePicker>
      </div>
      <!-- 任务名称 -->
      <div class="filter">
        <label>任务名称：</label>
        <Input class="searchInput" v-model="taskName" />
      </div>
      <!-- 按钮组 -->
      <div class="searchBtn">
        <!-- 查询 -->
        <Button
          type="primary"
          class="twoWord"
          icon="ios-search-outline"
          @click="search()"
          >查询</Button
        >
        <!-- 新增任务 -->
        <Button
          type="success"
          class="fourWord"
          icon="ios-add-circle-outline"
          @click="add()"
          >新增任务</Button
        >
        <!-- 作废 -->
        <Button
          type="error"
          class="twoWord intervalRight"
          icon="ios-close-circle-outline"
          @click="close()"
          >作废</Button
        >
        <!-- 打印任务单 -->
        <Button
          type="primary"
          class="fourWord"
          icon="ios-print-outline"
          @click="print()"
          >打印任务单</Button
        >
        <!-- 报工 -->
        <Button
          type="primary"
          class="twoWord"
          icon="ios-add-circle-outline"
          @click="report()"
          >报工</Button
        >
        <!-- 审核 -->
        <Button
          type="primary"
          class="twoWord"
          icon="ios-checkmark-circle-outline"
          @click="audit()"
          >审核</Button
        >
      </div>
    </div>
    <div class="divborder newTableDiv">
      <!-- 主体表格 -->
      <Table
        class="tableClass"
        @on-current-change="handleRowChange"
        highlight-row
        :data="tableData"
        :columns="tableColumns"
      ></Table>
      <!-- 分页器 -->
      <div class="pageDiv">
        <div class="pageDirection">
          <Page
            :total="total"
            :current="page"
            @on-change="changePage"
            show-elevator
            show-sizer
            show-total
            @on-page-size-change="handlePageSize"
            :page-size-opts="[10, 20, 30, 40, 100]"
          ></Page>
        </div>
      </div>
    </div>
    <!-- 新增任务弹框 -->
    <Modal
      class="newModalClass addModal dispatchOutsideModal"
      v-model="addModal"
      :styles="{ width: '900px' }"
    >
      <p slot="header">
        <span>新增计划外任务单</span>
      </p>
      <div class="modal_body add">
        <div>
          <div class="filter">
            <label><i>*</i>班组：</label>
            <Select
              v-model="addObj.team"
              class="searchSelect"
              @on-change="teamChange"
            >
              <Option v-for="(v, i) in teamList" :key="i" :value="v.id">{{
                v.name
              }}</Option>
            </Select>
          </div>
          <div class="filter">
            <label> <i>*</i> 操作者： </label>
            <Select v-model="addObj.operator" class="searchSelect" clearable>
              <Option v-for="(v, i) in operatorList" :key="i" :value="v.id">{{
                v.name
              }}</Option>
            </Select>
          </div>
          <div class="filter">
            <label>
              <i>*</i>
              预计工时：
            </label>
            <InputNumber
              v-model="addObj.expectWorkTime"
              class="searchInput"
              :min="0"
            ></InputNumber>
          </div>
        </div>
        <div style="margin-top: 16px">
          <div>
            <label> <i>*</i> 任务名称： </label>
            <Input
              class="echo_width_80"
              v-model="addObj.taskName"
              type="textarea"
              :maxlength="50"
              show-word-limit
              :autosize="{ minRows: 2, maxRows: 2 }"
            />
          </div>
        </div>
        <div style="margin-top: 16px">
          <div>
            <label> <i>*</i> 任务内容： </label>
            <Input
              class="echo_width_80"
              v-model="addObj.taskContent"
              type="textarea"
              :maxlength="150"
              show-word-limit
              :autosize="{ minRows: 4, maxRows: 4 }"
            />
          </div>
        </div>
      </div>
      <div slot="footer">
        <Button size="large" @click="addModal = false" v-text="$t(1033)"
          >取消</Button
        >
        <Button
          type="primary"
          :loading="loading_add"
          size="large"
          @click="addTask()"
          >保存</Button
        >
      </div>
    </Modal>
    <!-- 报工弹框 -->
    <Modal
      class="newModalClass reportModal"
      v-model="reportModal"
      :styles="{ width: '900px' }"
    >
      <p slot="header">
        <span>计划外任务单报工</span>
      </p>
      <div class="modal_body report">
        <div>
          <div class="filter">
            <label>班组：</label>
            <Input v-model="reportObj.team" class="searchInput" disabled />
          </div>
          <div class="filter">
            <label>操作者：</label>
            <Input v-model="reportObj.operator" class="searchInput" disabled />
          </div>
          <div class="filter">
            <label>预计工时：</label>
            <Input
              v-model="reportObj.expectWorkTime"
              class="searchInput"
              type="number"
              disabled
            />
          </div>
        </div>
        <div style="margin-top: 16px">
          <div class="echo">
            <label>任务名称：</label>
            <Input
              class="echo_width_80"
              v-model="reportObj.taskName"
              type="textarea"
              :autosize="{ minRows: 2, maxRows: 2 }"
              disabled
            />
          </div>
        </div>
        <div style="margin-top: 16px">
          <div class="echo">
            <label>任务内容：</label>
            <Input
              class="echo_width_80"
              v-model="reportObj.taskContent"
              type="textarea"
              :autosize="{ minRows: 4, maxRows: 4 }"
              disabled
            />
          </div>
        </div>
        <div style="margin-top: 16px">
          <div class="echo filter">
            <label>
              <i>*</i>
              实际工时：
            </label>
            <InputNumber
              class="echo_width_80"
              v-model="reportObj.actualWorkTime"
              placeholder="请录入实际工时"
              :min="0"
            ></InputNumber>
          </div>
        </div>
        <div style="margin-top: 16px">
          <div class="echo filter">
            <label> <i>*</i> 实际执行人： </label>
            <!-- <Input
              class="echo_width_80"
              v-model="reportObj.actualExecutor"
              placeholder="请录入实际执行人"
            /> -->
            <Select
              filterable
              class="echo_width_80"
              v-model="reportObj.actualExecutor"
            >
              <Option v-for="(v, i) in userList" :value="v.mid" :key="i">{{
                v.name
              }}</Option>
            </Select>
          </div>
        </div>
      </div>
      <div slot="footer">
        <Button size="large" @click="reportModal = false" v-text="$t(1033)"
          >取消</Button
        >
        <Button
          type="primary"
          size="large"
          :loading="loading_report"
          @click="reportTask()"
          >保存</Button
        >
      </div>
    </Modal>
    <!-- 审核弹框 -->
    <Modal
      class="newModalClass"
      v-model="auditModal"
      :styles="{ width: '600px' }"
    >
      <p slot="header">
        <span>审核</span>
      </p>
      <div class="modal_body">
        <div>
          <div class="filter">
            <label>
              <i>*</i>
              是否通过审核：
            </label>
            <Select class="searchSelect" v-model="auditResult">
              <Option value="1">通过</Option>
              <Option value="2">未通过</Option>
            </Select>
          </div>
        </div>
      </div>
      <div slot="footer">
        <Button size="large" @click="auditModal = false">{{ $t(1033) }}</Button>
        <Button
          type="primary"
          size="large"
          :loading="loading_audit"
          @click="auditTask()"
          >确认</Button
        >
      </div>
    </Modal>
    <!-- 打印任务单弹框 -->
    <Modal
      class="newModalClass printModal"
      v-model="printModal"
      :styles="{ width: '800px' }"
    >
      <div class="modal_body">
        <div id="printContent">
          <h1 style="text-align: center">计划外任务单</h1>
          <div
            style="
              margin-top: -50px;
              display: flex;
              align-items: baseline;
              justify-content: space-between;
              font-size: 16px;
            "
          >
            <div>
              <span style="font-weight: bold">派工日期：</span>
              <span>{{ row.createTime }}</span>
            </div>
            <div>
              <span style="font-weight: bold">任务编号：</span>
              <span
                id="taskNoQR"
                style="display: inline-block; width: 88px; height: 88px"
              ></span>
            </div>
          </div>
          <table
            style="width: 100%; margin-top: 12px"
            border="1"
            cellspacing="0"
          >
            <tr
              style="
                height: 34px;
                text-align: center;
                background-color: #d7d7d7;
                font-size: 16px;
                font-weight: bold;
              "
            >
              <td>任务编号</td>
              <td>创建人</td>
              <td>派工时间</td>
              <td>计划执行人</td>
              <td>预计工时（分钟）</td>
              <td>实际工时</td>
            </tr>
            <tr style="height: 44px; text-align: center; font-size: 16px">
              <td>{{ row.taskNo }}</td>
              <td>{{ row.createBy }}</td>
              <td>{{ row.createTime }}</td>
              <td>{{ row.expectExecutor }}</td>
              <td>{{ row.expectWorkTime }}</td>
              <td>{{ row.actualWorkTime }}</td>
            </tr>
            <tr
              style="
                height: 34px;
                background-color: #d7d7d7;
                font-size: 16px;
                font-weight: bold;
              "
            >
              <td colspan="6" style="padding-left: 24px">任务名称</td>
            </tr>
            <tr style="font-size: 16px">
              <td colspan="6" style="padding-left: 24px">{{ row.taskName }}</td>
            </tr>
            <tr
              style="
                height: 34px;
                background-color: #d7d7d7;
                font-size: 16px;
                font-weight: bold;
              "
            >
              <td colspan="6" style="padding-left: 24px">任务内容</td>
            </tr>
            <tr style="font-size: 16px">
              <td colspan="6" style="padding-left: 24px">
                {{ row.taskContent }}
              </td>
            </tr>
          </table>
        </div>
      </div>
      <div slot="footer">
        <Button size="large" @click="printModal = false" v-text="$t('1033')"
          >取消</Button
        >
        <Button type="primary" size="large" @click="output()">打印</Button>
      </div>
    </Modal>
  </div>
</template>

<script>
import QRCode from "qrcodejs2";
import { getLodop } from "@/assets/js/LodopFuncs.js";

export default {
  inject: ["reload"],
  data() {
    return {
      // 加载标志位
      loading_add: false,
      loading_report: false,
      loading_audit: false,
      // 任务编号
      taskNo: "",
      // 执行人员
      executive: "",
      // 派工日期范围
      dispatchDateRange: [],
      // 任务名称
      taskName: "",
      // 数据总量
      total: 0,
      // 页码
      page: 1,
      // 页距
      pagesize: 10,
      // 当前选中的行数据
      row: {},
      // 主体表格数据
      tableData: [],
      // 主体表格列字段
      tableColumns: [
        {
          type: "sort",
          title: this.$t(1008),
          render: (h, params) => {
            return h(
              "span",
              params.index + (this.page - 1) * this.pagesize + 1
            );
          },
          width: 88,
        },
        {
          title: "任务编号",
          key: "taskNo",
        },
        {
          title: "任务名称",
          key: "taskName",
        },
        {
          title: "任务内容",
          key: "taskContent",
        },
        {
          title: "创建人",
          key: "createBy",
        },
        {
          title: "创建时间",
          key: "createTime",
        },
        {
          title: "计划执行人",
          key: "expectExecutor",
        },
        {
          title: "预计工时（分钟）",
          key: "expectWorkTime",
        },
        {
          title: "实际执行人",
          key: "actualExecutor",
        },
        {
          title: "实际工时",
          key: "actualWorkTime",
        },
        {
          title: "报工时间",
          key: "reportTime",
        },
        {
          title: "状态",
          key: "status",
          align: "center",
          render: (h, params) => {
            let status, bg;
            switch (params.row.status) {
              case 1:
                status = "未报工";
                bg = "#F59A23";
                break;
              case 2:
                status = "已报工";
                bg = "#02A7F0";
                break;
              case 3:
                status = "审核已通过";
                bg = "#04D919";
                break;
              case 4:
                status = "审核未通过";
                bg = "#D9001B";
                break;
              case 5:
                status = "已作废";
                bg = "#585858";
                break;
            }
            return h(
              "div",
              {
                style: {
                  backgroundColor: bg,
                  color: "#fff",
                  width: "100%",
                  height: "36px",
                  lineHeight: "36px",
                  textAlign: "center",
                },
              },
              status
            );
          },
        },
      ],
      // 新增任务弹框是否显示
      addModal: false,
      // 新增任务对象
      addObj: {
        team: "",
        operator: "",
        expectWorkTime: null,
        taskName: "",
        taskContent: "",
      },
      // 报工弹框是否显示
      reportModal: false,
      // 报工对象
      reportObj: {
        team: "",
        operator: "",
        expectWorkTime: "",
        taskName: "",
        taskContent: "",
        actualWorkTime: null,
        actualExecutor: "",
      },
      // 打印任务单弹框是否弹出
      printModal: false,
      // 班组下拉列表
      teamList: [],
      // 操作者下拉列表
      operatorList: [],
      // 审核弹框是否显示
      auditModal: false,
      // 审核结果
      auditResult: "",
      // 执行人下拉列表
      userList: [],
    };
  },
  mounted() {
    // 首次进入组件页面，查询
    this.search();
    // 格式化表格列字段
    this.tableColumns = this.$time.initTableTitle(this.tableColumns);
    // 获取班组下拉列表
    this.getTeamList();
    // 获取执行人下拉列表
    this.getUserList();
  },
  methods: {
    // 监听派工日期范围变化
    dispatchDateRangeChange(v) {
      this.dispatchDateRange = v;
    },
    // 获取主体表格数据
    search() {
      // 拿到当前组件实例
      const _this = this;
      // 解构取值
      let {
        taskNo,
        executive,
        dispatchDateRange,
        taskName,
        page,
        pagesize,
      } = this;
      // 组装请求入参
      let params = {
        tasknumber: taskNo,
        executive,
        starttime: dispatchDateRange[0],
        endtime: dispatchDateRange[1],
        taskname: taskName,
        page,
        pagesize,
      };
      _this.axios
        .request({
          url: "cnc/ProductPlanOutDispatch/GetOutDataList",
          params,
          method: "get",
        })
        .then((res) => {
          let result = res.data;
          if (result.ret == 1) {
            _this.page = result.page;
            _this.pagesize = result.pagesize;
            _this.total = result.total;
            let data = result.data;
            _this.tableData = [];
            if (Array.isArray(data) && data.length) {
              data.forEach((v, i) => {
                _this.tableData.push({
                  id: v.id,
                  taskNo: v.tasknumber,
                  taskName: v.taskname,
                  taskContent: v.taskcontent,
                  createBy: v.createuser,
                  createTime: v.createtime,
                  expectExecutor: v.planexecutor,
                  expectWorkTime: v.expectedtime,
                  actualExecutor: v.actualexecutor,
                  actualWorkTime: v.actualtime,
                  reportTime: v.reportingtime,
                  status: v.state,
                });
              });
            }
          } else {
            _this.$Message.error(_this.$t(result.msg));
          }
        });
    },
    // 监听页码变化
    changePage(value) {
      this.page = value;
      this.search();
    },
    // 监听页距变化
    handlePageSize(value) {
      this.pagesize = value;
      this.search();
    },
    // 选中表格一行数据
    handleRowChange(currentRow) {
      this.row = currentRow;
    },
    // 点击新增任务按钮，弹出框弹出
    add() {
      const _this = this;
      _this.addObj = {
        team: "",
        operator: "",
        expectWorkTime: null,
        taskName: "",
        taskContent: "",
      };
      // 弹出框弹出
      _this.addModal = true;
      // 加载标志位复位
      _this.loading_add = false;
    },
    // 点击作废按钮，删除任务
    close() {
      const _this = this;
      // 解构取到当前选择的行数据
      let { row } = this;
      // 如果当前未选择行;
      if (JSON.stringify(row) == "{}") {
        _this.$Message.error(_this.$t(9000396));
        return false;
      }
      _this.$Modal.confirm({
        title: _this.$t(444449),
        content: "",
        width: "290px",
        closable: true,
        okText: _this.$t(444450),
        onOk: () => {
          _this.axios
            .request({
              url: "cnc/ProductPlanOutDispatch/ToVoid",
              params: {
                id: row.id,
              },
              method: "get",
            })
            .then((res) => {
              let result = res.data;
              if (result.ret == 1) {
                _this.$Message.success(_this.$t(result.msg));
                _this.reload();
              } else {
                _this.$Message.error(_this.$t(result.msg));
              }
            });
        },
      });
    },
    // 点击报工按钮，对任务进行报工
    report() {
      const _this = this;
      // 解构取到当前选择的行数据
      let { row } = this;
      // 如果当前未选择行
      if (JSON.stringify(row) == "{}") {
        _this.$Message.error(_this.$t(9000396));
        return false;
      }
      _this.axios
        .request({
          url: "cnc/ProductPlanOutDispatch/GetReportData",
          params: { id: row.id },
          method: "get",
        })
        .then((res) => {
          let result = res.data;
          if (result.ret == 1) {
            let data = result.data;
            if (data) {
              _this.reportObj.team = data.groupname;
              _this.reportObj.operator = data.planexecutor;
              _this.reportObj.expectWorkTime = data.expectedtime;
              _this.reportObj.taskName = data.taskname;
              _this.reportObj.taskContent = data.taskcontent;
            }
          } else {
            _this.$Message.error(_this.$t(result.msg));
          }
        });
      // 弹出框弹出
      _this.reportModal = true;
    },
    // 点击审核按钮，进行任务审核
    audit() {
      const _this = this;
      // 解构取到当前选择的行数据
      let { row } = this;
      // 如果当前未选择行
      if (JSON.stringify(row) == "{}") {
        _this.$Message.error(_this.$t(9000396));
        return false;
      }
      if (row.status != 2) {
        _this.$Message.error("未报工任务不能进行审核");
        return false;
      }
      // 弹框弹出
      _this.auditModal = true;
    },
    // 点击打印任务单按钮
    print() {
      const _this = this;
      // 解构取到当前选择的行数据
      let { row } = this;
      // 如果当前未选择行
      if (JSON.stringify(row) == "{}") {
        _this.$Message.error(_this.$t(9000396));
        return false;
      }
      // 弹出框弹出
      _this.printModal = true;
      _this.generateORCode("taskNoQR", row.taskNo, 88, 88);
    },
    // 生成二维码
    generateORCode(id, text, w, h) {
      // 清空区域内容
      document.getElementById(id).innerHTML = "";
      // 生成二维码
      let qrcode = new QRCode(id, {
        width: w,
        height: h,
        // 二维码内容
        text: text,
        // 前景色
        colorDark: "#000",
        // 背景色
        colorLight: "#fff",
        // 容错等级
        correctLevel: QRCode.CorrectLevel.L,
      });
      console.log(qrcode);
    },
    // 打印
    output() {
      const _this = this;
      let { $t } = this;
      if (!getLodop()) {
        _this.$Modal.confirm({
          title: $t(600013),
          content: $t(444454),
          width: 360,
          closable: true,
          okText: $t(444455),
          onOk: () => {
            let link = document.createElement("a");
            link.style.display = "none";
            link.href = "/static/lodop/clodop_setup.exe";
            document.body.appendChild(link);
            link.click();
            document.body.removeChild(link);
            _this.printModal = false;
            return false;
          },
        });
        return false;
      }
      LODOP = getLodop();
      console.log(LODOP);
      LODOP.PRINT_INIT("打印任务单");
      LODOP.ADD_PRINT_HTM(
        "24px",
        "2%",
        "96%",
        "100%",
        document.getElementById("printContent").innerHTML
      );
      LODOP.PREVIEW();
    },
    // 获取班组下拉列表
    getTeamList() {
      // 拿到当前组件实例
      const _this = this;
      let params = {
        departid: 0,
      };

      _this.axios
        .request({
          url: "config/WorkingGroup/GetAllWorkGroup",
          params,
          method: "get",
        })
        .then((res) => {
          let result = res.data;
          if (result.ret == 1) {
            let data = result.data;
            _this.teamList = [];
            if (Array.isArray(data) && data.length) {
              data.forEach((v, i) => {
                _this.teamList.push({
                  id: v.id,
                  name: v.name,
                });
              });
            }
          } else {
            _this.$Message.error(_this.$t(result.msg));
          }
        });
    },
    // 监听当前选择班组
    teamChange() {
      // 从而获取操作者列表数据
      this.getOperatorList(this.addObj.team);
    },
    // 获取操作者下拉列表
    getOperatorList(teamId) {
      if (!teamId) {
        return false;
      }
      // 拿到当前组件实例
      const _this = this;
      let params = {
        id: teamId,
      };
      _this.axios
        .request({
          url: "config/WorkingGroup/GetAllUsersByWorkGroup",
          params,
          method: "get",
        })
        .then((res) => {
          let result = res.data;
          if (result.ret == 1) {
            let data = result.data;
            _this.operatorList = [];
            if (Array.isArray(data) && data.length) {
              data.forEach((v, i) => {
                _this.operatorList.push({
                  id: v.id,
                  name: v.name,
                });
              });
            }
          } else {
            _this.$Message.error(_this.$t(result.msg));
          }
        });
    },
    // 确认新增任务
    addTask() {
      // 拿到当前组件实例
      const _this = this;
      // 简单封装下报错方法
      function errorMsg(code) {
        _this.$Message.error(_this.$t(code));
      }

      // 表单必填项验证
      if (!_this.addObj.team) {
        errorMsg(444451);
        return false;
      }
      if (!_this.addObj.operator) {
        errorMsg(444415);
        return false;
      }
      if (!_this.addObj.expectWorkTime) {
        errorMsg(444416);
        return false;
      }
      if (!_this.addObj.taskName) {
        errorMsg(444417);
        return false;
      }
      if (!_this.addObj.taskContent) {
        errorMsg(444418);
        return false;
      }
      // 打开加载标志位
      _this.loading_add = true;
      // 组装请求参数
      let data = {
        planexecutor: _this.addObj.operator,
        expectedtime: _this.addObj.expectWorkTime,
        taskname: _this.addObj.taskName,
        taskcontent: _this.addObj.taskContent,
        group: _this.addObj.team,
      };
      _this.axios
        .request({
          url: "cnc/ProductPlanOutDispatch/AddData",
          data,
          method: "post",
        })
        .then((res) => {
          let result = res.data;
          if (result.ret == 1) {
            _this.$Message.success(_this.$t(result.msg));
            _this.loading_add = false;
            _this.addModal = false;
            _this.reload();
          } else {
            errorMsg(result.msg);
            _this.loading_add = false;
          }
        });
    },
    // 确认报工任务
    reportTask() {
      // 拿到当前组件实例
      const _this = this;
      // 简单封装下报错方法
      function errorMsg(code) {
        _this.$Message.error(_this.$t(code));
      }
      if (_this.reportObj.actualWorkTime === 0) {
        _this.$Message.error("实际工时不能为0");
        return false;
      }
      // 表单必填项验证
      if (!_this.reportObj.actualWorkTime) {
        errorMsg(444419);
        return false;
      }
      if (!_this.reportObj.actualExecutor) {
        errorMsg(444420);
        return false;
      }
      // 打开加载标志位
      _this.loading_report = true;
      // 组装请求参数
      let params = {
        id: _this.row.id,
        actualtime: _this.reportObj.actualWorkTime,
        actualexecutor: _this.reportObj.actualExecutor,
      };
      _this.axios
        .request({
          url: "cnc/ProductPlanOutDispatch/ToReport",
          params,
          method: "get",
        })
        .then((res) => {
          let result = res.data;
          if (result.ret == 1) {
            _this.$Message.success(_this.$t(result.msg));
            _this.loading_report = false;
            _this.reportModal = false;
            _this.reload();
          } else {
            errorMsg(result.msg);
            _this.loading_report = false;
          }
        });
    },
    // 确认审核任务
    auditTask() {
      // 拿到当前组件实例
      const _this = this;
      // 简单封装下报错方法
      function errorMsg(code) {
        _this.$Message.error(_this.$t(code));
      }
      // 表单必填项验证
      if (!_this.auditResult) {
        errorMsg(444421);
        return false;
      }
      // 打开加载标志位
      _this.loading_audit = true;
      // 组装请求参数
      let params = {
        id: _this.row.id,
        yesorno: _this.auditResult,
      };
      _this.axios
        .request({
          url: "cnc/ProductPlanOutDispatch/ToExamine",
          params,
          method: "get",
        })
        .then((res) => {
          let result = res.data;
          if (result.ret == 1) {
            _this.$Message.success(_this.$t(result.msg));
            _this.loading_audit = false;
            _this.auditModal = false;
            _this.reload();
          } else {
            errorMsg(result.msg);
            _this.loading_audit = false;
          }
        });
    },
    // 获取执行人列表
    getUserList() {
      const _this = this;
      _this.axios
        .request({
          url: "Config/ProjectUser/GetAllUser",
          method: "get",
        })
        .then((res) => {
          let result = res.data;
          if (result.ret == 1) {
            let data = result.data;
            _this.userList = [];
            if (data && Array.isArray(data) && data.length) {
              _this.userList = data;
            }
          } else {
            _this.$Message.error(_this.$t(result.msg));
          }
        });
    },
  },
};
</script>

<style>
.echo {
  display: block !important;
}

.add > div > .filter input[disabled] {
  background-color: #fff;
  color: #515a6e;
}

.addModal .ivu-modal .ivu-modal-body {
  padding: 30px 40px;
}

.echo_width_80 {
  width: 80% !important;
}

.report > div > .filter input[disabled] {
  background-color: #fff;
  color: #515a6e;
}

.report > div > .echo textarea[disabled] {
  background-color: #fff;
  color: #515a6e;
}

.reportModal .ivu-modal .ivu-modal-body {
  padding: 30px 40px;
}

.printModal .ivu-modal .ivu-modal-body {
  padding: 30px 40px;
}

.dispatchOutsideModal .ivu-input-word-count {
  float: right;
}
</style>
