<template>
  <div class="app-container" v-if="!open">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="仓库名称" prop="fWarehouseid">
        <el-select
            v-model="queryParams.fWarehouseid"
            filterable
            placeholder="请选择仓库名称"
        >
          <el-option
              v-for="(item, index) in warehouseOptions"
              :key="index.fId"
              :label="item.fName"
              :value="item.fId"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="计划日期">
        <el-date-picker
            v-model="fPlanneddate"
            @change="planDateMethod"
            type="daterange"
            :clearable="false"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            value-format="yyyy-MM-dd HH:mm:ss"
            :default-time="['00:00:00', '23:59:59']">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="巡检人" prop="fInspectorid">
        <el-select
            v-model="queryParams.fInspectorid"
            filterable
            placeholder="请选择巡检人"
        >
          <el-option
              v-for="(item, index) in patrolInspection"
              :key="index.userId"
              :label="item.userName"
              :value="item.userId"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="巡检备注" prop="remark">
        <el-input
            v-model="queryParams.remark"
            placeholder="请输入巡检备注"
            clearable
            size="small"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="cyan" 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">
        <el-button
            type="primary"
            icon="el-icon-plus"
            size="mini"
            @click="handleAdd"
        >新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
            type="success"
            icon="el-icon-edit"
            size="mini"
            :disabled="single"
            @click="handleUpdate"
        >修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
            type="danger"
            icon="el-icon-delete"
            size="mini"
            :disabled="multiple"
            @click="handleDelete"
        >删除
        </el-button>
      </el-col>
      <!--      <el-col :span="1.5">-->
      <!--        <el-button-->
      <!--            type="warning"-->
      <!--            icon="el-icon-download"-->
      <!--            size="mini"-->
      <!--            @click="handleExport"-->
      <!--        >导出-->
      <!--        </el-button>-->
      <!--      </el-col>-->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="resetQuery"></right-toolbar>
    </el-row>
    <el-table v-loading="loading" :data="logList" @selection-change="handleSelectionChange" ref="table"
              :height="tableHeight">
      <el-table-column type="selection" width="55" align="center"/>
      <el-table-column label="序号" type="index" width="50" fixed align="center"/>
      <el-table-column label="仓库名称" align="center" prop="fWarehouseName"/>
      <el-table-column label="巡检人" align="center" prop="fInspectorName"/>
      <el-table-column label="巡检计划日期起" align="center" prop="fInspectorBeginDatetime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.fInspectorBeginDatetime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="巡检计划日期止" align="center" prop="fInspectorEndDatetime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.fInspectorEndDatetime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="制单人" align="center" prop="fCreateByName"/>
      <el-table-column label="制单日期" align="center" prop="fCreateTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.fCreateTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="更新人" align="center" prop="fUpdateByName"/>
      <el-table-column label="最新时间" align="center" prop="fUpdateTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.fUpdateTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="系统编号" align="center" prop="fSystemNo"/>
      <el-table-column label="备注" align="center" prop="fRemark"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160">
        <template slot-scope="scope">
          <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="viewDetails(scope.row)"
          >查看
          </el-button>
          <el-button
              size="mini"
              type="text"
              icon="el-icon-delete"
              @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"
    />
  </div>
  <div class="app-container" v-else>
    <!-- 添加或修改入出库状态对话框 -->
    <el-button type="danger" size="mini" @click="cancel">返回列表</el-button>
    <el-form ref="form" :model="form" :rules="rules" label-width="100px">
      <el-row>
        <el-col :span="8">
          <el-form-item label="仓库名称" prop="fWarehouseFid">
            <el-select
                v-model="form.fWarehouseFid"
                filterable
                style="width: 260px;"
                placeholder="请选择仓库名称"
            >
              <el-option
                  v-for="(item, index) in warehouseOptions"
                  :key="index.fId"
                  :label="item.fName"
                  :value="item.fId"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="巡检日期起" prop="fInspectorBeginDatetime">
            <el-date-picker
                style="width: 260px;"
                v-model="form.fInspectorBeginDatetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                type="datetime"
                placeholder="选择日期时间">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="巡检日期止" prop="fInspectorEndDatetime">
            <el-date-picker
                style="width: 260px;"
                v-model="form.fInspectorEndDatetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                type="datetime"
                placeholder="选择日期时间">
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label="巡检人" prop="fInspectorId">
            <el-select
                v-model="form.fInspectorId"
                filterable
                style="width: 260px;"
                placeholder="请选择巡检人"
            >
              <el-option
                  v-for="(item, index) in patrolInspection"
                  :key="index.userId"
                  :label="item.userName"
                  :value="item.userId"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="备注" prop="fRemark">
            <el-input v-model="form.remark" type="textarea" style="width: 260px;" placeholder="请输入内容" autosize/>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div style="width: 100%;margin: 10px auto">
      <el-button type="primary" size="mini" @click="inputDetails">录入明细</el-button>
      <el-button type="success" size="mini" @click="submitForm">保 存</el-button>
    </div>
    <div style="width: 100%;">
      <el-table
          :data="form.tWarehouseCheckItemsList"
          style="width: 100%">
        <el-table-column label="序号" type="index" width="50" fixed align="center"/>
        <el-table-column label="仓库名称" align="center" prop="fWarehouseFid">
          <template slot-scope="scope">
            <el-select
                v-model="scope.row.fWarehouseFid"
                filterable
                placeholder="请选择仓库名称"
            >
              <el-option
                  v-for="(item, index) in warehouseOptions"
                  :key="index.fId"
                  :label="item.fName"
                  :value="item.fId"
              ></el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column label="巡检人" align="center" prop="fInspectorId">
          <template slot-scope="scope">
            <el-select
                v-model="scope.row.fInspectorId"
                filterable
                placeholder="请选择巡检人"
            >
              <el-option
                  v-for="(item, index) in patrolInspection"
                  :key="index.userId"
                  :label="item.userName"
                  :value="item.userId"
              ></el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column label="计划日期" align="center" prop="fInspectionDatetime">
          <template slot-scope="scope">
            <el-date-picker
                style="width: 100%;"
                v-model="scope.row.fInspectionDatetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                type="datetime"
                placeholder="选择日期时间">
            </el-date-picker>
          </template>
        </el-table-column>
        <el-table-column label="最新巡检日期" align="center" prop="fUpdateTime">
          <template slot-scope="scope">
            <el-date-picker
                style="width: 100%;"
                disabled
                v-model="scope.row.fUpdateTime"
                value-format="yyyy-MM-dd HH:mm:ss"
                type="datetime"
                placeholder="选择日期时间">
            </el-date-picker>
          </template>
        </el-table-column>
        <el-table-column label="最新巡检人" align="center" prop="fUpdateBy">
          <template slot-scope="scope">
            <el-select
                disabled
                v-model="scope.row.fUpdateBy"
                filterable
                placeholder="最新巡检人"
            >
              <el-option
                  v-for="(item, index) in patrolInspection"
                  :key="index.userId"
                  :label="item.userName"
                  :value="item.userId"
              ></el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column label="巡检记录" align="center">
          <template slot-scope="scope" style="width: 100px;">
            <el-button
                size="mini"
                type="text"
                :disabled="!scope.row.fId"
                @click="pictureList(scope)"
                icon="el-icon-document"
            >详情
            </el-button>
          </template>
        </el-table-column>
        <!--          <el-table-column label="录入人" align="center" prop="createBy">-->
        <!--            <template slot-scope="scope">-->
        <!--              <el-input v-model="scope.row.createBy" placeholder="请输入内容"></el-input>-->
        <!--            </template>-->
        <!--          </el-table-column>-->
        <!--          <el-table-column label="录入日期" align="center" prop="createTime">-->
        <!--            <template slot-scope="scope">-->
        <!--              <el-date-picker-->
        <!--                  style="width: 100%;"-->
        <!--                  v-model="scope.row.createTime"-->
        <!--                  value-format="yyyy-MM-dd"-->
        <!--                  type="date"-->
        <!--                  placeholder="选择日期">-->
        <!--              </el-date-picker>-->
        <!--            </template>-->
        <!--          </el-table-column>-->
        <!--          <el-table-column label="更新人" align="center" prop="updateBy">-->
        <!--            <template slot-scope="scope">-->
        <!--              <el-input v-model="scope.row.updateBy" placeholder="请输入内容"></el-input>-->
        <!--            </template>-->
        <!--          </el-table-column>-->
        <!--          <el-table-column label="更新日期" align="center" prop="updateTime">-->
        <!--            <template slot-scope="scope">-->
        <!--              <el-date-picker-->
        <!--                  style="width: 100%;"-->
        <!--                  v-model="scope.row.updateTime"-->
        <!--                  value-format="yyyy-MM-dd"-->
        <!--                  type="date"-->
        <!--                  placeholder="选择日期">-->
        <!--              </el-date-picker>-->
        <!--            </template>-->
        <!--          </el-table-column>-->
        <el-table-column label="备注" align="center" prop="fRemark">
          <template slot-scope="scope">
            <el-input v-model="scope.row.fRemark" placeholder="请输入备注"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
          <template slot-scope="scope" style="width: 100px;">
            <el-button
                size="mini"
                type="text"
                icon="el-icon-delete"
                @click="singleItemDeletion(scope.$index,scope)"
            >删除
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div slot="footer" class="dialog-footer">
    </div>
    <el-dialog
        title="图片明细"
        :visible.sync="opentwo"
        append-to-body
        width="70%">
      <el-form ref="form" :model="twarehousecheckdetailList" label-width="80px"
               style="display:flex;flex-wrap: wrap;justify-content: space-between">
        <el-form-item label="仓库名称" prop="fWarehouseid">
          <el-select
              v-model="twarehousecheckdetailList.fWarehouseid"
              filterable
              disabled
              placeholder="请选择仓库名称"
              style="width: 200px;"
          >
            <el-option
                v-for="(item, index) in warehouseOptions"
                :key="index.fId"
                :label="item.fName"
                :value="item.fId"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="巡检日期" prop="fCreateTime">
          <el-date-picker
              style="width: 200px;"
              disabled
              v-model="twarehousecheckdetailList.fCreateTime"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="巡检人" prop="fInspectorid">
          <el-select
              disabled
              v-model="twarehousecheckdetailList.fInspectorid"
              filterable
              placeholder="最新巡检人"
          >
            <el-option
                v-for="(item, index) in patrolInspection"
                :key="index.userId"
                :label="item.userName"
                :value="item.userId"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="备注" prop="fRemark">
          <el-input style="width: 200px;" v-model="twarehousecheckdetailList.fRemark" type="textarea"
                    placeholder="请输入内容" autosize/>
        </el-form-item>
      </el-form>
      <div style="margin-top: 20px;border: 1px solid #cccccc;padding: 5px;border-radius: 10px">
        <el-upload
            :headers="headers"
            :action="uploadImgUrl"
            :on-success="onSuccess"
            list-type="picture-card"
            :file-list="fileList"
            accept=".jpeg,.jpg,.png,.svg,.webp"
            :limit="100"
            :on-preview="handlePictureCardPreview"
            :on-remove="handleRemove">
          <i class="el-icon-plus"></i>
        </el-upload>
        <el-dialog :visible.sync="dVisible" append-to-body>
          <img width="100%" :src="dialogImageUrl" alt="">
        </el-dialog>
      </div>
      <span slot="footer" class="dialog-footer">
    <el-button @click="closePicture">取 消</el-button>
    <el-button type="primary" @click="preservationtwo">保 存</el-button>
  </span>
    </el-dialog>
  </div>
</template>

<script>
import {
  listCorps,
  deleteMasterTable,
  delLog,
  information,
  secondDelete,
  newlyAdded,
  savePicture,
  selectUserByRole,
  addOrModifyPictureList,
  currentLogin
} from '@/api/warehouseCheck/index'
import {listWarehousesss} from "@/api/basicdata/warehouse";
import {getToken} from "@/utils/auth";

export default {
  name: "Log",
  components: {},
  data() {
    return {
      tableHeight: '600',
      headers: {
        Authorization: "Bearer " + getToken(),
      },
      patrolInspection: [],
      uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
      warehouseOptions: [],
      fPlanneddate: [],
      fileList: [],
      dialogImageUrl: '',
      dVisible: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      pictureEist: [],
      // 总条数
      total: 0,
      // 入出库状态表格数据
      logList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      opentwo: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      // 表单参数
      form: {},
      formList: [],
      // 表单校验
      rules: {},
      twarehousecheckdetailList: {},
      picturefId: ''
    };
  },
  created() {
    let date = new Date();
    let year = parseInt(date.getFullYear())
    let month = parseInt(date.getMonth() + 1)
    let currentMonth = date.getMonth()
    let nextMonth = ++currentMonth
    let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1)  // 下个月的第一天
    let oneDay = 1000 * 60 * 60 * 24
    let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天，就是上个月的最后一天
    let day = lastTime.getDate()
    if (day < 10) {
      day = '0' + day
    }
    this.fPlanneddate = [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']

    currentLogin().then(res => {
      console.log(res)
    })
    selectUserByRole().then(res => {
      this.patrolInspection = res.rows
      console.log(res)
    })
    listWarehousesss({fStatus: 0, delFlag: 0}).then((response) => {
      this.warehouseOptions = response.rows;
    });
    this.getList();
  },
  mounted() {
    this.$nextTick(() => {
      // 监听浏览器高度变化，改变表格高度
      window.onresize = () => {
        this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
      }
    })
  },
  methods: {
    // 获取当前月的第一天和最后一天
    getMonth() {
      let date = new Date();
      let year = parseInt(date.getFullYear())
      let month = parseInt(date.getMonth() + 1)
      let currentMonth = date.getMonth()
      let nextMonth = ++currentMonth
      let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1)  // 下个月的第一天
      let oneDay = 1000 * 60 * 60 * 24
      let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天，就是上个月的最后一天
      let day = lastTime.getDate()
      if (day < 10) {
        day = '0' + day
      }
      this.queryParams.timeInterval = [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']
    },
    onSuccess(response, file, fileList) {
      console.log(fileList)
      this.pictureEist = fileList
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dVisible = true;
    },
    //移除图片
    handleRemove(file, fileList) {
      console.log(fileList);
      this.pictureEist = fileList
    },
    //录入新行
    inputDetails() {
      if (this.form.tWarehouseCheckItemsList === null) this.form.tWarehouseCheckItemsList = []
      this.form.tWarehouseCheckItemsList.push({
        fWarehousename: '',
        fWarehouseFid: this.form.fWarehouseFid,
        fLatestinspectorid: '',
        fInspectorId: this.form.fInspectorId,
        fPlanneddate: '',
        fLatestinspectdate: '',
        fInspectionrecord: '',
        updateTime: '',
        createBy: '',
        createTime: '',
        updateBy: '',
        remark: '',
      })
    },
    //关闭新增图片弹窗
    closePicture() {
      this.opentwo = false
      this.fileList = []
    },
    //图片保存
    preservationtwo() {
      this.twarehousecheckdetailList.fPhotoUrl = []
      for (let item in this.pictureEist) {
        if (this.pictureEist[item].response) {
          this.twarehousecheckdetailList.fPhotoUrl.push({
            url: this.pictureEist[item].response.url
          })
        } else {
          this.twarehousecheckdetailList.fPhotoUrl.push({
            url: this.pictureEist[item].url
          })
        }
      }
      this.twarehousecheckdetailList.fPhotoUrl = JSON.stringify(this.twarehousecheckdetailList.fPhotoUrl)
      if (!this.twarehousecheckdetailList.fId) {
        addOrModifyPictureList(this.twarehousecheckdetailList, 'post').then(res => {
          console.log(res)
        })
      } else {
        addOrModifyPictureList(this.twarehousecheckdetailList, 'put').then(res => {
          console.log(res)
        })
      }
    },
    pictureList(scope) {
      let data = {
        fItemFid: scope.row.fId
      }
      savePicture(data).then(res => {
        let data = res.rows
        if (data.length === 0) {
          this.twarehousecheckdetailList = {
            fCheckFid: scope.row.fCheckFid,
            fItemFid: scope.row.fId,
            fWarehouseid: scope.row.fWarehouseFid, //仓库名称
            fCreateTime: '',
            fInspectorid: '',
            fRemark: '',
            fPhotoUrl: []
          }
        } else {
          this.twarehousecheckdetailList = res.rows[0]
          this.twarehousecheckdetailList.fWarehouseid = scope.row.fWarehouseFid
          this.fileList = []
          for (let item in JSON.parse(res.rows[0].fPhotoUrl)) {
            this.fileList.push(JSON.parse(res.rows[0].fPhotoUrl)[item])
          }
          this.pictureEist = this.fileList
        }
      })
      this.opentwo = true
    },
    //查看明细
    viewDetails(row) {
      information(row.fId).then(res => {
        this.open = true
        if (res.data.twarehousecheckitemsVOList === null) res.data.twarehousecheckitemsVOList = []
        this.form = res.data
      })
    },
    //明细删除第二弹窗
    singleItemDeletion(index, scope) {
      let this_ = this
      if (scope.row.fId) {
        secondDelete(scope.row.fId).then(res => {
          this_.$message({
            showClose: true,
            message: '删除成功',
            type: 'success'
          });
          this_.viewDetails(this_.form)
        })
      } else {
        this_.form.tWarehouseCheckItemsList.splice(index, 1);
      }
    },
    //拆分计划日期
    planDateMethod() {
      if (this.fPlanneddate) {
        this.$set(this.queryParams, 'fBegintime', this.fPlanneddate[0])
        this.$set(this.queryParams, 'fEndtime', this.fPlanneddate[1])
      }
    },
    /** 查询入出库状态列表 */
    getList() {
      listCorps(this.queryParams).then(res => {
        if (res.code === 200) {
          this.logList = res.rows
          this.loading = false
          this.total = res.total
          // 根据浏览器高度设置初始高度
          this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
          // setInterval(() => {
          //   this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
          // }, 300)
        }
      })
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.getList();
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        fId: null,
        fPid: null,
        fItmeid: null,
        fItmestatus: 0,
        fBillstatus: "0",
        createTime: null,
        createBy: null,
        updateBy: null,
        updateTime: null,
        remark: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
      }
      this.fPlanneddate = []
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.fId)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.form.tWarehouseCheckItemsList = []
      this.title = "添加巡检详情";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const fId = row.fId || this.ids
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          newlyAdded(this.form).then(response => {
            this.msgSuccess("新增成功");
            this.viewDetails({fId: response.data})
            // this.open = false;
            // this.getList();
          });
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const fIds = row.fId || this.ids;
      this.$confirm('是否确认删除入出库状态编号为"' + fIds + '"的数据项?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(function () {
        return deleteMasterTable(fIds);
      }).then(() => {
        this.getList();
        this.msgSuccess("删除成功");
      })
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有入出库状态数据项?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(function () {
        return exportLog(queryParams);
      }).then(response => {
        this.download(response.msg);
      })
    }
  }
};
</script>
