<template>
  <div>
    <dialog-edit :visible.sync="dialogVisible" :title="$t('taskManage.todoTask.todoTaskTitle')" width="1480px"
                 :form="form" :api="api" :editModel="editModel" :footerBtnShow="false" :formRules="formRules" ref="dialog">
      <div class="dialog-tab">
        <el-tabs v-model="activityName" type="card" @tab-click="tabClick">
          <div class="title">
            <span>{{$t('taskManage.todoTask.' + tabsTitle)}}</span>
          </div>
          <el-divider></el-divider>

          <!-- 付款确认书信息 -->
          <el-tab-pane :label="$t('taskManage.todoTask.paymentConfirmation')" name="paymentConfirmation">
            <!--        <paymentConfirmation type="offline" ref="paymentConfirmation"></paymentConfirmation>-->
            <payment-info :keyId="assetInfoId" :titleShow="false" ref="paymentConfirmation"></payment-info>
            <div class="paymentConfirmationButton">
              <auth-button size="medium" type="primary" :label="$t('taskManage.todoTask.relevantFileDownload')" @click="relevantFileDownload"></auth-button>
              <auth-button v-if="showHandoverBtn" size="medium" type="primary" :label="$t('taskManage.todoTask.downloadHandover')" @click="downloadHandover"></auth-button>
              <auth-button size="medium" type="primary" :label="$t('taskManage.todoTask.activeProcess')" @click="showEdit"></auth-button>
            </div>
          </el-tab-pane>

          <!-- 发票信息 -->
          <el-tab-pane :label="$t('taskManage.todoTask.invoice')" name="invoice">
            <invoice ref="invoice"></invoice>
          </el-tab-pane>

          <!-- 供应商信息 -->
          <el-tab-pane :label="$t('taskManage.todoTask.supplierInfo')" name="supplierInfo">
            <supplierInfo ref="supplierInfo"></supplierInfo>
          </el-tab-pane>

          <!-- 付款确认书信息变更 -->
          <el-tab-pane :label="$t('taskManage.todoTask.paymentConfirmationChange')" name="paymentConfirmationChange">
            <paymentConfirmationChange ref="paymentConfirmationChange"></paymentConfirmationChange>
          </el-tab-pane>

          <!-- 线上历史审核意见 -->
          <el-tab-pane :label="$t('taskManage.todoTask.onlineAuditOpinionHistory')" name="onlineAuditOpinionHistory">
            <onlineAuditOpinionHistory ref="onlineAuditOpinionHistory" class="bottomDiv"></onlineAuditOpinionHistory>
          </el-tab-pane>

          <!-- 线下历史审核意见 -->
          <el-tab-pane :label="$t('taskManage.todoTask.offlineAuditOpinionHistory')" name="offlineAuditOpinionHistory">
            <offlineAuditOpinionHistory :assetInfoId="assetInfoId" ref="offlineAuditOpinionHistory" class="bottomDiv"></offlineAuditOpinionHistory>
          </el-tab-pane>

          <!-- 归档信息 -->
          <el-tab-pane :label="$t('taskManage.todoTask.archiveInfo')" name="archiveInfo">
            <archiveInfo ref="archiveInfo" class="bottomDiv"></archiveInfo>
          </el-tab-pane>
        </el-tabs>
      </div>

      <div class="coll-title coll-body">
        <el-form :model="fileForm" :rules="formRules" ref="fileForm" :show-message="false">
          <el-collapse v-model="activityNames">
            <el-collapse-item :title="$t('taskManage.todoTask.auditList')" name="auditList">
              <!-- 审核信息列表 -->
              <div class="table-form">
                <vxe-grid
                  border
                  show-overflow
                  highlight-cell
                  ref="offlineGrid"
                  class="vxeTable"
                  element-loading-text="拼命加载中"
                  element-loading-spinner="el-icon-loading"
                  element-loading-background="rgba(255, 255, 255, 1)"
                  :columns="auditCol"
                  cell-class-name="common-table-cell"
                  header-cell-class-name="common-table-header"
                  max-height="500"
                  :data="fileForm.auditData"
                  :optimization="{scrollY: {gt: 10}}">
                  <!-- 表格上方操作按钮 -->
                  <template v-slot:top>
                    <div class="btn-right bottomDiv">
                      <auth-button type="primary" size="medium" icon="iconfont iconzancun" :loading="tsLoading"
                                   :label="$t('common.staging')" @click="tempSave"></auth-button>
                      <btn-batch-download type="primary" size="medium" :classType="true" :fileID="allFileIds" :beforeBtchDownload="beforeBtchDownload"
                                          :icon="'iconfont iconxiazai1'" :downloadButtonMsg="$t('taskManage.todoTask.fileAllDownload')"></btn-batch-download>
                      <auth-button type="primary" size="medium" icon="iconfont iconfuzhi1"
                                   :label="$t('taskManage.todoTask.copyLastAuditOpinion')" @click="copy"></auth-button>
                    </div>
                  </template>
                  <!-- 列表操作按钮 -->
                  <template v-slot:operation="{ row }">
                    <div class="btn-operate">
                      <btn-upload :uploadApi="uploadApi" :classType="true" :fileID="bindFileId(row)" @uploadSuccess="importSuccess" :rowData="row"
                                  :icon="showFileId(row) ? 'iconfont iconzhongxinshangchuan' : 'iconfont iconshangchuan1'"></btn-upload>
                      <btn-download :openPerms="false" v-if="showFileId(row)" :fileID="bindFileId(row)"></btn-download>
                      <!-- 删除附件 -->
                      <auth-button v-if="showFileId(row)" class="iconCircleDel"
                                   icon="iconfont iconshanchufujian" :title="$t('taskManage.todoTask.delFile')" @click="delFile(row, 'audit')"></auth-button>
                      <auth-button v-if="row.necessaryType !== 1" class="iconCircleDel" icon="iconfont iconjian" :title="$t('common.del')" @click="delAuditInfo(row)"></auth-button>
                    </div>
                  </template>
                  <!-- 显示总数项 -->
                  <template slot="bottom">
                    <span>{{$t('common.viewTip1')}}{{startNum1}}{{$t('common.viewTip2')}}{{endNum1}}{{$t('common.viewTip3')}}{{endNum1}}{{$t('common.viewTip4')}}</span>
                  </template>
                </vxe-grid>
              </div>
            </el-collapse-item>

            <el-collapse-item :title="$t('taskManage.todoTask.otherFile')" name="otherFile">
              <!-- 另需供应商或项目公司提供文件 -->
              <div class="table-form">
                <vxe-grid
                  border
                  show-overflow
                  highlight-cell
                  ref="xGrid"
                  class="vxeTable"
                  element-loading-text="拼命加载中"
                  element-loading-spinner="el-icon-loading"
                  element-loading-background="rgba(255, 255, 255, 1)"
                  :columns="fileCol"
                  cell-class-name="common-table-cell"
                  header-cell-class-name="common-table-header"
                  max-height="300"
                  :data="fileForm.fileData"
                  :optimization="{scrollY: {gt: 10}}"
                  @checkbox-change="selectionData"
                  @checkbox-all="selectionData">
                  <!-- 表格上方操作按钮 -->
                  <template v-slot:top>
                    <div class="btn-right bottomDiv">
                      <auth-button type="primary" size="medium" icon="iconfont iconxinzeng" :label="$t('common.create')" @click="add"></auth-button>
                      <auth-button type="danger" size="medium" icon="iconfont iconshanchu" :label="$t('common.del')" @click="del"></auth-button>
                    </div>
                  </template>
                  <!-- 列表操作按钮 -->
                  <template v-slot:operation="{ row, rowIndex }">
                    <auth-button class="iconCircle table-btn" @click="onClick(row, rowIndex)"
                                 :icon="!UtilJs.isEmpty(row.newFileId) && row.newFileId !== '0' ? 'iconfont iconzhongxinshangchuan' : 'iconfont iconshangchuan1'"
                                 :title="!UtilJs.isEmpty(row.newFileId) && row.newFileId !== '0' ? $t('common.reUpload') : $t('common.upload')"></auth-button>
                    <btn-upload v-show="false" :ref="'upload' + rowIndex" :uploadApi="uploadApi" :classType="true" :fileType="row.fileType"
                                :rowData="row" @uploadSuccess="uploadSuccess"></btn-upload>
                    <btn-download v-if="!UtilJs.isEmpty(row.newFileId) && row.newFileId !== '0'" :fileID="row.newFileId"></btn-download>
                    <!-- 删除附件 -->
                    <auth-button v-if="!UtilJs.isEmpty(row.newFileId) && row.newFileId !== '0'" class="iconCircleDel"
                                 icon="iconfont iconshanchufujian" :title="$t('taskManage.todoTask.delFile')" @click="delFile(row, 'other')"></auth-button>
                  </template>
                  <!-- 显示总数项 -->
                  <template slot="bottom">
                    <span>{{$t('common.viewTip1')}}{{startNum2}}{{$t('common.viewTip2')}}{{endNum2}}{{$t('common.viewTip3')}}{{endNum2}}{{$t('common.viewTip4')}}</span>
                  </template>
                </vxe-grid>
              </div>
            </el-collapse-item>
          </el-collapse>
        </el-form>
      </div>
      <template slot="footer">
        <auth-button :loading="loading" type="primary" size="medium" :label="$t('common.submit')" @click="submit"></auth-button>
        <auth-button size="medium" :label="$t('common.close')" @click="dialogVisible = false"></auth-button>
      </template>
    </dialog-edit>
    <process-activity-edit :visible.sync="showDetail" :editModel="showModel" :form="item"></process-activity-edit>
  </div>
</template>
<script>
import BaseEdit from '@/pages/baseEditPage.js'
import { DialogEdit, authButton, paymentInfo, DataTable, btnUpload, btnDownload, btnBatchDownload, SelectDictionary } from 'newepoch-components'
import paymentConfirmation from '@/pages/dataAudit/taskManage/common/paymentConfirmation.vue'
import invoice from '@/pages/dataAudit/taskManage/offlineAudit/invoice.vue'
import supplierInfo from '@/pages/dataAudit/taskManage/common/supplierInfo.vue'
import paymentConfirmationChange from '@/pages/dataAudit/taskManage/common/paymentConfirmationChange.vue'
import onlineAuditOpinionHistory from '@/pages/dataAudit/taskManage/common/onlineAuditOpinionHistory.vue'
import offlineAuditOpinionHistory from '@/pages/dataAudit/taskManage/offlineAudit/offlineAuditOpinionHistory.vue'
import archiveInfo from '@/pages/dataAudit/taskManage/offlineAudit/archiveInfo.vue'
import processActivityEdit from '@/pages/dataAudit/taskManage/common/processActivityEdit.vue'
import SelectFileName from '@/components/element/dataAduit/SelectFileName.vue'
import taskManageApi from '@/api/dataAudit/taskManageApi.js'
import fileDownloadApi from '@/api/fileApi.js'
import { downFile } from '@/utils/devUtils.js'
import { UPLOAD_API } from '@/constant.js'
import * as format from '@/filters/index'
import { regExp } from '@/validator/index.js'
import cn from '@/i18n/langs/cn.js'

const { common, taskManage: { todoTask } } = cn
const STAMP_TYPE = {
  1: 'suppliersStampType',
  2: 'factorStampType',
  3: 'projectStampType',
  4: 'coreEnterpriseStampType'
}
export default {
  name: 'onlineAuditEdit',
  extends: new BaseEdit(),
  components: {
    DialogEdit,
    authButton,
    paymentInfo,
    paymentConfirmation,
    invoice,
    supplierInfo,
    paymentConfirmationChange,
    onlineAuditOpinionHistory,
    offlineAuditOpinionHistory,
    archiveInfo,
    processActivityEdit,
    DataTable,
    btnUpload,
    btnDownload,
    btnBatchDownload,
    SelectDictionary,
    SelectFileName
  },
  methods: {
    // 文件ID绑定
    bindFileId (row) {
      return this.UtilJs.isEmpty(row.newFileId) || row.newFileId === '0' ? row.originalFileId === '0' ? '' : row.originalFileId : row.newFileId
    },
    // 文件ID是否显示
    showFileId (row) {
      return !this.UtilJs.isEmpty(row.newFileId) && row.newFileId !== '0' ? true : !this.UtilJs.isEmpty(row.originalFileId) && row.originalFileId !== '0'
    },
    // 切换Tab时调用接口
    tabClick (val) {
      let _this = this
      const { name } = val
      const { form: { assetInfoId, auditOfflineInfoId, suppliersId } } = this
      _this.tabsTitle = name
      _this.activityName = name
      _this.$nextTick(() => {
        if (val.name === 'paymentConfirmationChange') {
          _this.$refs[val.name].loadData(assetInfoId)
        } else if (val.name === 'archiveInfo') {
          _this.$refs[val.name].loadData(assetInfoId)
        } else if (val.name === 'invoice') {
          _this.$refs[val.name].loadData(assetInfoId)
          _this.$refs[val.name].loadFormData(auditOfflineInfoId)
        } else if (val.name === 'supplierInfo') {
          let params = {
            supplierId: suppliersId,
            auditOfflineInfoId: auditOfflineInfoId,
            assetInfoId: assetInfoId
          }
          _this.$refs[val.name].loadData(params)
        } else if (val.name === 'offlineAuditOpinionHistory') {
          _this.$refs[val.name].loadData(assetInfoId)
        } else if (val.name === 'onlineAuditOpinionHistory') {
          _this.$refs[val.name].loadData(assetInfoId)
        }
      })
    },
    // 相关文件下载
    relevantFileDownload () {
      let _this = this
      let paras = {
        assetInfoId: _this.form.assetInfoId,
        auditType: 3,
        // 供应商盖章方式
        stampWay: _this.form.suppliersStampType
      }
      _this.api.downloadFile(paras).then(res => {
        if (res && res.data) {
          if (res.data.length > 0) {
            let arr = res.data.filter(it => it !== '0')
            if (arr.length === 0) {
              _this.warning(todoTask.noRelevantFileDownloadMsg)
            } else {
              fileDownloadApi.file.batchDownload({ keyIds: arr }).then(fileRes => {
                downFile(fileRes)
              })
            }
          } else {
            _this.warning(todoTask.noRelevantFileDownloadMsg)
          }
        }
      })
    },
    showHandoverBtn () {
      let _this = this
      if (!_this.UtilJs.isEmpty(_this.form.productType)) {
        return _this.form.suppliersStampType === 2 || _this.form.productType === '2'
      } else {
        return _this.form.suppliersStampType === 2
      }
    },
    // 生成下载交接表
    downloadHandover () {
      let _this = this
      let params = {
        assetInfoId: this.form.assetInfoId,
        assetPoolId: this.form.assetPoolId,
        assetCode: this.form.assetCode,
        auditOfflineInfoId: this.form.auditOfflineInfoId
      }
      _this.api.generateTable(params).then(res => {
        if (res && res.data) {
          if (res.data.length > 0) {
            fileDownloadApi.file.batchDownload({ keyIds: res.data }).then(fileRes => {
              downFile(fileRes)
            })
          } else {
            _this.warning(todoTask.noDownloadHandoverMsg)
          }
        }
      })
    },
    // 查看活动流程信息
    showEdit () {
      this.showModel = 'V'
      this.showDetail = true
      this.item = Object.assign({}, this.form)
    },
    // 加载审核列表数据
    loadAuditData () {
      let _this = this
      _this.api.getAssetsList({ auditOfflineInfoId: _this.form.auditOfflineInfoId, taskType: _this.form.taskType }).then(res => {
        if (res && res.data) {
          let pageRes = _this.calPage(res.data.informationDtos, _this.startNum1, _this.endNum1)
          _this.startNum1 = pageRes[0]
          _this.endNum1 = pageRes[1]
          // 将字典ID转换为字符串
          res.data.informationDtos.forEach(it => {
            if (it.auditOpinions === undefined) {
              _this.$set(it, 'auditOpinions', '')
            }
            it.ifsEffectiveElecChapter = it.ifsEffectiveElecChapter + ''
            it.ifsEffectiveScanFile = it.ifsEffectiveScanFile + ''
            it.ifsNeedScanFile = it.ifsNeedScanFile + ''
            it.ifsScanFile = it.ifsScanFile + ''
            _this.selectData.push(it.fileCode)
          })
          _this.fileForm.auditData = res.data.informationDtos
        }
      })
    },
    // 查询另需数据
    loadOtherData () {
      let _this = this
      _this.api.getAssetsList({ auditOfflineInfoId: _this.form.auditOfflineInfoId, taskType: _this.form.taskType }).then(res => {
        if (res && res.data) {
          let pageRes = _this.calPage(res.data.provideDtos, _this.startNum2, _this.endNum2)
          _this.startNum2 = pageRes[0]
          _this.endNum2 = pageRes[1]
          // 将字典ID转换为字符串
          res.data.provideDtos.forEach(it => {
            if (it.auditOpinions === undefined) {
              _this.$set(it, 'auditOpinions', '')
            }
            it.ifsNeedScanFile = it.ifsNeedScanFile + ''
            it.ifsEffectiveElecChapter = it.ifsEffectiveElecChapter + ''
            _this.selectData.push(it.fileCode)
          })
          _this.fileForm.fileData = res.data.provideDtos
        }
      })
    },
    // 计算分页
    calPage (arr, start, end) {
      let res = [start, end]
      if (arr.length > 0) {
        res[0] = 1
        res[1] = arr.length
      } else {
        res[0] = 0
        res[1] = 0
      }
      return res
    },
    // 下拉框禁用选择项
    optionDisabled () {
      let _this = this
      return function (item) {
        let arr = [...new Set(_this.selectData)]
        if (arr.indexOf(item.fileCode) !== -1) {
          return true
        } else {
          return false
        }
      }
    },
    // 提交
    submit () {
      let _this = this
      _this.$refs['fileForm'].validate((valid) => {
        if (valid) {
          // 校验 是否重复新增文件
          let result = _this.isRepeat()
          if (result.length > 0) {
            let fileMsg = '文件名称为：'
            result.forEach(res => {
              fileMsg = fileMsg + res.fileName + '，'
            })
            fileMsg = fileMsg.substring(0, fileMsg.length - 1)
            _this.warning(fileMsg + '不能重复新增！')
            return
          }
          // 校验 文件来源为保理商的是否上传pdf附件
          let pdfCheckMsg = _this.checkFilePdf(_this.fileForm.fileData)
          if (pdfCheckMsg.length > 0) {
            _this.warning('文件名称为' + pdfCheckMsg + '没有上传附件！请上传相关PDF附件')
            return
          }
          // 判断 审核信息列表中哪些文件名称的本次接收份数与本次有效份数 不一致
          let tipMsg = '文件名称为：'
          let count = 0
          if (_this.fileForm.auditData.length > 0) {
            _this.fileForm.auditData.forEach(it => {
              if (it.ifsScanFile === '0' && it.stampWay !== 1) {
                if (it.effectiveNumber !== it.receptionNumber) {
                  tipMsg = tipMsg + it.fileName + '，'
                  count++
                }
              }
            })
          }
          if (count > 0) {
            tipMsg = tipMsg.substring(0, tipMsg.length - 1)
            tipMsg = tipMsg + ' 的本次接收份数与本次有效份数不一致，是否继续提交？'
            _this.$confirm(tipMsg, common.tip, {
              type: 'warning'
            }).then(() => {
              // 审核轮数为第一轮时
              if (this.form.auditRound === 1) {
                _this.$confirm('另需文件是否确认已添加完整？', common.tip, {
                  confirmButtonText: '是',
                  cancelButtonText: '否',
                  type: 'warning'
                }).then(() => {
                  _this.submitMethod()
                }).catch(() => {})
              } else {
                _this.submitMethod()
              }
            }).catch(() => {})
          } else {
            // 审核轮数为第一轮时
            if (this.form.auditRound === 1) {
              _this.$confirm('另需文件是否确认已添加完整？', common.tip, {
                confirmButtonText: '是',
                cancelButtonText: '否',
                type: 'warning'
              }).then(() => {
                _this.submitMethod()
              }).catch(() => {})
            } else {
              _this.submitMethod()
            }
          }
        } else {
          _this.error(todoTask.submitMsg)
        }
      })
    },
    submitMethod () {
      let _this = this
      _this.submitDto.auditOfflineDetailSaveDtos = _this.buildList()
      _this.submitDto.assetInfoId = _this.form.assetInfoId
      _this.submitDto.auditOfflineInfoId = _this.form.auditOfflineInfoId
      _this.submitDto.taskType = _this.form.taskType
      _this.submitDto.taskId = _this.form.taskId
      _this.submitDto.auditUserName = _this.$store.getters.nikeName
      _this.loading = true
      _this.api.auditSubmit(_this.submitDto).then(res => {
        if (res && res.data) {
          _this.success(common.saveSuccess)
          _this.dialogVisible = false
          _this.$emit('submit-success')
        } else {
          _this.error(common.saveError)
        }
        _this.loading = false
      }).catch(fail => {
        _this.loading = false
      })
    },
    // 校验pdf文件
    checkFilePdf (data) {
      let msg = ''
      data.forEach(it => {
        if (it.fileSource === 2) {
          if (this.UtilJs.isEmpty(it.newFileId)) {
            msg = msg + it.fileName + '，'
          }
        }
      })
      if (msg.length > 0) {
        msg = msg.substring(0, msg.length - 1)
      }
      return msg
    },
    // 数组判重
    isRepeat () {
      let _this = this
      let arr = []
      _this.fileForm.auditData.forEach(audit => {
        arr.push({
          fileCode: audit.fileCode,
          fileName: audit.fileName
        })
      })
      _this.fileForm.fileData.forEach(file => {
        arr.push({
          fileCode: file.fileCode,
          fileName: file.fileName
        })
      })
      let hash = {}
      let res = []
      arr.forEach(it => {
        if (hash[it.fileCode]) {
          res.push(it)
        }
        // 不存在该元素，则赋值为true，可以赋任意值，相应的修改if判断条件即可
        hash[it.fileCode] = true
      })
      return res
    },
    // 暂存
    tempSave () {
      let _this = this
      let validResult = _this.tempSavePropsValidate()
      if (validResult) {
        let result = _this.isRepeat()
        if (result.length > 0) {
          let fileMsg = '文件名称为：'
          result.forEach(res => {
            fileMsg = fileMsg + res.fileName + '，'
          })
          fileMsg = fileMsg.substring(0, fileMsg.length - 1)
          _this.warning(fileMsg + '不能重复新增！')
          return
        }
        _this.tempSaveList = _this.buildList()
        _this.tsLoading = true
        _this.api.saveInfos(_this.tempSaveList).then(res => {
          if (res && res.data) {
            _this.success(common.saveSuccess)
            _this.loadAuditData()
            _this.loadOtherData()
          } else {
            _this.error(common.saveError)
          }
          _this.tsLoading = false
        }).catch(() => {
          _this.tsLoading = false
        })
      } else {
        _this.error(todoTask.tempSaveMsg)
      }
    },
    tempSavePropsValidate () {
      let _this = this
      let props = []
      let validCot = 0
      if (_this.fileForm.auditData.length > 0) {
        _this.fileForm.auditData.forEach((it, index) => {
          if (it.ifsScanFile === '0' && it.stampWay !== 1) {
            props.push(`auditData.` + index + `.effectiveNumber`)
          }
        })
      }
      if (_this.fileForm.fileData.length > 0) {
        _this.fileForm.fileData.forEach((it, idx) => {
          props.push(`fileData.` + idx + `.effectiveNumber`)
          props.push(`fileData.` + idx + `.fileCode`)
        })
      }
      _this.$refs.fileForm.validateField(props, (valid) => {
        if (!_this.UtilJs.isEmpty(valid)) {
          validCot++
        }
      })
      return validCot === 0
    },
    buildList () {
      let _this = this
      let result = []
      _this.fileForm.auditData.forEach(audit => {
        result.push(Object.assign({
          auditOfflineInfoId: _this.form.auditOfflineInfoId,
          ifsOther: 0
        }, audit))
      })
      _this.fileForm.fileData.forEach(file => {
        result.push(Object.assign({
          auditOfflineInfoId: _this.form.auditOfflineInfoId,
          ifsOther: 1
        }, file))
      })
      return result
    },
    // 附件一键下载
    beforeBtchDownload () {
      let _this = this
      _this.allFileIds.splice(0, _this.allFileIds.length)
      if (_this.fileForm.auditData.length > 0 || _this.fileForm.fileData.length > 0) {
        _this.fileForm.auditData.forEach(it => {
          if (!_this.UtilJs.isEmpty(it.newFileId) && it.newFileId !== '0') {
            _this.allFileIds.push(it.newFileId)
          } else {
            if (!_this.UtilJs.isEmpty(it.originalFileId) && it.originalFileId !== '0') {
              _this.allFileIds.push(it.originalFileId)
            }
          }
        })
        _this.fileForm.fileData.forEach(item => {
          if (!_this.UtilJs.isEmpty(item.newFileId) && item.newFileId !== '0') {
            _this.allFileIds.push(item.newFileId)
          }
        })
      }
      return _this.allFileIds
    },
    // 复制上轮审核意见
    copy () {
      let _this = this
      _this.api.getPreviousAudit({ auditOfflineInfoId: _this.form.auditOfflineInfoId }).then(res => {
        if (res && res.data) {
          if (res.data.length > 0) {
            res.data.forEach(it => {
              _this.fileForm.auditData.forEach(audit => {
                if (audit.fileCode === it.fileCode) {
                  _this.$set(audit, 'auditOpinions', it.auditOpinions)
                }
              })
              _this.fileForm.fileData.forEach(file => {
                if (file.fileCode === it.fileCode) {
                  _this.$set(file, 'auditOpinions', it.auditOpinions)
                }
              })
            })
          } else {
            _this.warning(todoTask.auditEmptyMsg)
          }
        }
      })
    },
    // 上传审核文件成功
    importSuccess (returnData, rowData) {
      let _this = this
      if (_this.UtilJs.isEmpty(rowData.fileCode)) {
        _this.warning(todoTask.uploadMsg)
        return
      }
      let auditFileUploadDto = {
        fileCode: rowData.fileCode,
        fileId: returnData.fileID,
        auditOfflineInfoId: _this.form.auditOfflineInfoId
      }
      _this.api.uploadAuditInfo(auditFileUploadDto).then(res => {
        if (res && res.data) {
          _this.success(common.uploadSuccess)
          _this.$set(rowData, 'newFileId', returnData.fileID)
          // _this.loadAuditData()
        } else {
          _this.error(common.uploadError)
        }
      })
    },
    // 删除附件
    delFile (row, model) {
      let _this = this
      _this.$confirm(todoTask.delFileTip, common.tip, {
        type: 'warning'
      }).then(() => {
        if (row.date) {
          row.newFileId = ''
        } else {
          _this.api.delAuditFile({ auditOfflineInfoId: _this.form.auditOfflineInfoId, fileCode: row.fileCode }).then(res => {
            if (res && res.data) {
              if (!this.UtilJs.isEmpty(row.newFileId) && row.newFileId !== '0') {
                row.newFileId = ''
              }
              if (!this.UtilJs.isEmpty(row.originalFileId) && row.originalFileId !== '0') {
                row.originalFileId = ''
              }
              _this.success(common.delSuccess)
              // if (model === 'audit') {
              //   _this.loadAuditData()
              // } else {
              //   _this.loadOtherData()
              // }
            } else {
              _this.error(common.delFailure)
            }
          })
        }
      }).catch(() => {})
    },
    // 删除审核信息
    delAuditInfo (data) {
      let _this = this
      _this.$confirm(common.delTip, common.tip, {
        type: 'warning'
      }).then(() => {
        let arr = []
        arr.push(data.fileCode)
        _this.api.delAuditInfo({ auditOfflineInfoId: _this.form.auditOfflineInfoId, fileCode: arr, ifsOther: 0 }).then(res => {
          if (res && res.data) {
            _this.success(common.delSuccess)
            _this.loadAuditData()
          } else {
            _this.error(common.delFailure)
          }
        })
      }).catch(() => {})
    },
    // 另需文件上传
    onClick (data, index) {
      if (this.UtilJs.isEmpty(data.fileCode)) {
        this.warning(todoTask.uploadMsg)
      } else {
        this.$refs['upload' + index].upload()
      }
    },
    uploadSuccess (returnData, rowData) {
      let _this = this
      let auditFileUploadDto = {
        fileCode: rowData.fileCode,
        fileId: returnData.fileID,
        auditOfflineInfoId: _this.form.auditOfflineInfoId
      }
      _this.api.uploadAuditInfo(auditFileUploadDto).then(res => {
        if (res && res.data) {
          _this.$set(rowData, 'newFileId', returnData.fileID)
          // rowData.newFileId = returnData.fileID
          _this.success(common.uploadSuccess)
        } else {
          _this.error(common.uploadError)
        }
      })
    },
    // 有效份数校验
    effectiveNumberCheck (rule, value, callback) {
      if (regExp.sequence.test(value)) {
        callback()
      } else {
        callback(new Error(todoTask.effectiveNumberMsg))
      }
    },
    // 表头下拉框change 电子章是否有效
    eleChapterChanged (val) {
      if (!this.UtilJs.isEmpty(val)) {
        this.fileForm.auditData.forEach(it => {
          if (it.stampWay === 1) {
            this.$set(it, 'ifsEffectiveElecChapter', val)
          }
        })
      }
    },
    // 表头下拉框change 是否另需扫描件
    selectChanged (val) {
      if (!this.UtilJs.isEmpty(val)) {
        this.fileForm.auditData.forEach(it => {
          if (it.ifsScanFile === '0') {
            this.$set(it, 'ifsNeedScanFile', val)
          }
        })
      }
    },
    // 文件名称下拉change
    projFileChanged (val, name, data, index) {
      let _this = this
      if (this.UtilJs.isEmpty(val)) {
        _this.fileForm.fileData[index].fileName = ''
        _this.fileForm.fileData[index].needCopies = ''
        _this.fileForm.fileData[index].necessaryType = ''
        _this.fileForm.fileData[index].fileSource = ''
        _this.fileForm.fileData[index].ifsScanningDeliveryStandard = ''
        _this.fileForm.fileData[index].deliveryStandardCopies = ''
        _this.fileForm.fileData[index].ifsDeliveryMust = ''
        _this.fileForm.fileData[index].fileType = null
        _this.$set(_this.fileForm.fileData[index], 'materialGroupId', '')
        _this.$set(_this.fileForm.fileData[index], 'materialGroupDetailId', '')
        _this.$set(_this.fileForm.fileData[index], 'materialFileId', '')
        _this.fileForm.fileData[index].ifsEffectiveElecChapter = ''
      } else {
        const { fileName, needCopies, necessaryType, fileSource, ifsScanningDeliveryStandard,
          deliveryStandardCopies, ifsDeliveryMust, materialGroupId, materialGroupDetailId, materialFileId } = data
        if (fileSource === 2) {
          _this.warning('该文件来源是保理商，请上传附件，附件格式只能是pdf！')
          _this.fileForm.fileData[index].fileType = '.pdf'
        } else {
          _this.fileForm.fileData[index].fileType = null
        }
        _this.fileForm.fileData[index].fileName = fileName
        _this.fileForm.fileData[index].needCopies = needCopies
        _this.fileForm.fileData[index].necessaryType = necessaryType
        _this.fileForm.fileData[index].fileSource = fileSource
        _this.fileForm.fileData[index].ifsScanningDeliveryStandard = ifsScanningDeliveryStandard
        _this.fileForm.fileData[index].deliveryStandardCopies = deliveryStandardCopies
        _this.fileForm.fileData[index].ifsDeliveryMust = ifsDeliveryMust
        _this.$set(_this.fileForm.fileData[index], 'materialGroupId', materialGroupId)
        _this.$set(_this.fileForm.fileData[index], 'materialGroupDetailId', materialGroupDetailId)
        _this.$set(_this.fileForm.fileData[index], 'materialFileId', materialFileId)
        if (_this.form[STAMP_TYPE[_this.fileForm.fileData[index].fileSource]] === 1) {
          _this.fileForm.fileData[index].ifsEffectiveElecChapter = '0'
        } else {
          _this.fileForm.fileData[index].ifsEffectiveElecChapter = ''
        }
      }
      _this.fileForm.fileData[index].effectiveNumber = 0
      _this.fileForm.fileData[index].ifsNeedScanFile = ''
    },
    // 新增另需文件
    add () {
      let _this = this
      let addObj = {}
      let filedMap = _this.fileCol.map(it => { return it.field }).filter(item => item)
      filedMap.forEach(it => { it === 'effectiveNumber' ? addObj[it] = 0 : addObj[it] = '' })
      console.log(addObj)
      _this.fileForm.fileData.push(Object.assign(addObj, {
        newFileId: '',
        fileCode: '',
        fileSource: '',
        ifsScanningDeliveryStandard: '',
        necessaryType: '',
        deliveryStandardCopies: '',
        ifsDeliveryMust: '',
        fileType: null,
        date: new Date().valueOf(),
        status: true,
        checkFlag: false
      }))
      _this.startNum2 = 1
      _this.endNum2 = _this.fileForm.fileData.length
    },
    // 删除另需文件
    del () {
      let _this = this
      if (_this.selectedFileRows.length === 0) {
        _this.warning(common.delSelectedTip)
        return
      }
      _this.$confirm(common.confirmTip, common.tip, {
        type: 'warning'
      }).then(() => {
        let obj = _this.filterData(_this.selectedFileRows)
        if (obj.keyArr.length > 0) {
          _this.api.delAuditInfo({ auditOfflineInfoId: _this.form.auditOfflineInfoId, fileCode: obj.keyArr, ifsOther: 1 }).then(res => {
            if (res && res.data) {
              _this.success(common.delSuccess)
              _this.loadOtherData()
              _this.selectedFileRows = []
            }
          })
        } else {
          _this.fileForm.fileData = _this.fileForm.fileData.filter(item => {
            if (obj.dateArr.indexOf(item.date) === -1) {
              return true
            }
          })
          if (_this.fileForm.fileData.length === 0) {
            _this.startNum2 = 0
            _this.endNum2 = 0
          } else {
            _this.startNum2 = 1
            _this.endNum2 = _this.fileForm.fileData.length
          }
          _this.success(common.delSuccess)
        }
      }).catch(() => {})
    },
    filterData (rows) {
      let arr1 = []
      let arr2 = []
      rows.forEach(item => {
        if (item.keyId) {
          arr1.push(item.fileCode)
        } else {
          arr2.push(item.date)
        }
      })
      return {
        keyArr: arr1,
        dateArr: arr2
      }
    },
    selectionData ({ records }) {
      this.selectedFileRows = records
    },
    // 根据输入的有效份数判断 是否必填审核意见
    changeAuditCheck (event, data, index) {
      if (!this.UtilJs.isEmpty(data.needCopies)) {
        if (data.effectiveNumber < data.needCopies) {
          data.checkFlag = true
        } else {
          data.checkFlag = false
        }
      }
    },
    // 审核列表--审核意见校验
    auditOpinionsCheck (rule, value, callback) {
      // 盖章方式为鲜章 且 不是扫描件
      if (rule.row.ifsScanFile === '0' && rule.row.stampWay !== 1) {
        // 有效份数小于接收份数
        if ((rule.row.effectiveNumber + +rule.row.validCopies) < +rule.row.needCopies) {
          if (this.UtilJs.isEmpty(value)) {
            callback(new Error(common.pleaseInput + todoTask.auditOpinion))
          } else {
            callback()
          }
        } else {
          callback()
        }
        // 盖章方式为电子章 且为 否 时
      } else if (rule.row.stampWay === 1) {
        if (rule.row.ifsEffectiveElecChapter === '0' || rule.row.ifsEffectiveElecChapter === '2') {
          if (this.UtilJs.isEmpty(value)) {
            callback(new Error(common.pleaseInput + todoTask.auditOpinion))
          } else {
            callback()
          }
        } else {
          callback()
        }
      } else {
        callback()
      }
    },
    // 另需文件--审核意见校验
    otherAuditOpinionsCheck (rule, value, callback) {
      // 有效份数小于需求份数，电子章是否有效：否，否-可交单
      let checkFlag = !this.UtilJs.isEmpty(rule.row.effectiveNumber) && !this.UtilJs.isEmpty(rule.row.needCopies)
        ? rule.row.effectiveNumber < rule.row.needCopies
        : false
      if (checkFlag || rule.row.ifsEffectiveElecChapter === '0' || rule.row.ifsEffectiveElecChapter === '2') {
        if (this.UtilJs.isEmpty(value)) {
          callback(new Error(common.pleaseInput + todoTask.auditOpinion))
        } else {
          callback()
        }
      } else {
        callback()
      }
    },
    // 是否显示上传按钮
    showUploadBtn (row) {
      // 盖章方式为鲜章，是扫描件时
      return row.stampWay !== 1 || row.ifsScanFile === '1'
    }
  },
  watch: {
    visible (val) {
      let _this = this
      const { form: { assetInfoId } } = this
      if (val) {
        _this.$nextTick(() => {
          _this.activityName = 'paymentConfirmation'
          _this.assetInfoId = assetInfoId
        })
        _this.projParas.assetInfoId = assetInfoId
        _this.loadAuditData()
        _this.loadOtherData()
      } else {
        _this.search = ''
        _this.eleChapter = ''
        _this.assetInfoId = ''
        _this.selectData = []
        _this.submitDto = {
          taskId: '',
          assetInfoId: '',
          auditOfflineInfoId: '',
          taskType: '',
          auditUserName: '',
          auditOfflineDetailSaveDtos: []
        }
        _this.tempSaveList = []
        _this.selectedFileRows = []
        _this.startNum1 = 0
        _this.endNum1 = 0
        _this.startNum2 = 0
        _this.endNum2 = 0
        _this.$refs.fileForm.clearValidate()
      }
    }
  },
  data () {
    return {
      showDetail: false,
      loading: false,
      tsLoading: false,
      showModel: '',
      item: {},
      assetInfoId: '',
      activityName: 'paymentConfirmation',
      activityNames: ['auditList', 'otherFile'],
      tabsTitle: 'paymentConfirmation',
      formRules: {
        threeCertificatesNumber: [{ required: false, trigger: 'blur', message: common.input + todoTask.threeCertificatesNumber }],
        businessLicenseNumber: [{ required: true, trigger: 'blur', message: common.input + todoTask.businessLicenseNumber }],
        organizationNumber: [{ required: true, trigger: 'blur', message: common.input + todoTask.organizationNumber }],
        fileCode: [{ required: true, message: todoTask.selectFileMsg, trigger: 'change' }],
        effectiveNumber: [{ required: true, validator: this.effectiveNumberCheck, trigger: 'blur' }]
      },
      projParas: {
        assetInfoId: ''
      },
      submitDto: {
        taskId: '',
        assetInfoId: '',
        auditOfflineInfoId: '',
        taskType: '',
        auditUserName: '',
        auditOfflineDetailSaveDtos: []
      },
      tempSaveList: [],
      allFileIds: [],
      selectData: [],
      startNum1: 0,
      endNum1: 0,
      search: '',
      eleChapter: '',
      uploadApi: UPLOAD_API,
      auditCol: [
        // 审核文件名称
        {
          field: 'fileName',
          align: 'left',
          headerAlign: 'center',
          minWidth: '280px',
          showOverflow: 'title',
          title: todoTask.auditFile
        },
        // 需求份数
        {
          field: 'needCopies',
          align: 'right',
          headerAlign: 'center',
          minWidth: '80px',
          title: todoTask.neededNumber
        },
        // 已有份数
        {
          field: 'validCopies',
          align: 'right',
          headerAlign: 'center',
          minWidth: '80px',
          title: todoTask.existNumber
        },
        // 交单标准份数
        {
          field: 'deliveryStandardCopies',
          align: 'right',
          headerAlign: 'center',
          minWidth: '110px',
          title: todoTask.deliveryStandardCopies
        },
        // 是否交单必须
        {
          field: 'ifsDeliveryMust',
          align: 'center',
          headerAlign: 'center',
          minWidth: '110px',
          title: todoTask.ifsDeliveryMust,
          formatter: ({ cellValue }) => {
            return format.formatDict(cellValue, 'ZDZD0024')
          }
        },
        // 是否扫描件
        {
          field: 'ifsScanFile',
          align: 'center',
          headerAlign: 'center',
          minWidth: '100px',
          title: todoTask.scan,
          formatter: ({ cellValue }) => {
            return format.formatDict(cellValue, 'ZDZD0024')
          }
        },
        // 本次接收份数
        {
          field: 'receptionNumber',
          align: 'right',
          headerAlign: 'center',
          minWidth: '110px',
          title: todoTask.receivedNumber,
          formatter: ({ cellValue, row }) => {
            return row.stampWay === 1 ? '-' : cellValue
          }
        },
        // 本次有效份数
        {
          field: 'effectiveNumber',
          align: 'right',
          headerAlign: 'center',
          minWidth: '110px',
          title: todoTask.effectiveNumber,
          slots: {
            default: ({ row, rowIndex }) => {
              return [
                <el-form-item prop={'auditData.' + rowIndex + '.effectiveNumber'} label-width="0"
                  rules={row.ifsScanFile === '0' && row.stampWay !== 1 ? this.formRules.effectiveNumber : { required: false }}>
                  {row.ifsScanFile === '0' && row.stampWay !== 1
                    ? <el-input v-model_trim_number={row.effectiveNumber} size="medium" placeholder={common.pleaseInput}></el-input>
                    : <span>-</span>
                  }
                </el-form-item>
              ]
            }
          }
        },
        // 是否有效
        {
          field: 'ifsEffectiveElecChapter',
          align: 'center',
          headerAlign: 'center',
          minWidth: '130px',
          title: todoTask.ifsElecChapterValid,
          slots: {
            default: ({ row, rowIndex }) => {
              return [
                <el-form-item label-width="0">
                  {row.ifsScanFile === '0' && row.stampWay === 1
                    ? <select-dictionary v-model={row.ifsEffectiveElecChapter} dictTypeCode="effective_elec_chapter"></select-dictionary>
                    : <span>{'-'}</span>
                  }
                </el-form-item>
              ]
            },
            header: ({ column }) => {
              return [
                <div>
                  {todoTask.ifsElecChapterValid}
                  <select-dictionary size="mini" class="table_head_dict" v-model={this.eleChapter} name="chapterAll" v-on:selectChanged={this.eleChapterChanged} dictTypeCode="effective_elec_chapter"></select-dictionary>
                </div>
              ]
            }
          }
        },
        // 扫描件是否有效
        {
          field: 'ifsEffectiveScanFile',
          align: 'center',
          headerAlign: 'center',
          minWidth: '120px',
          title: todoTask.effectiveScan,
          slots: {
            default: ({ row, rowIndex }) => {
              return [
                <el-form-item label-width="0">
                  {row.stampWay !== 1 && row.ifsScanFile === '1'
                    ? <select-dictionary v-model={row.ifsEffectiveScanFile} dictTypeCode="ZDZD0024"></select-dictionary>
                    : <span>{'-'}</span>
                  }
                </el-form-item>
              ]
            }
          }
        },
        // 是否另需扫描件
        {
          field: 'ifsNeedScanFile',
          align: 'center',
          headerAlign: 'center',
          minWidth: '130px',
          title: todoTask.otherScan,
          slots: {
            default: ({ row, rowIndex }) => {
              return [
                <el-form-item label-width="0">
                  {row.stampWay !== 1 && row.ifsScanFile === '0'
                    ? <select-dictionary v-model={row.ifsNeedScanFile} dictTypeCode="ZDZD0024"></select-dictionary>
                    : <span>{'-'}</span>
                  }
                </el-form-item>
              ]
            },
            header: ({ column }) => {
              return [
                <div>
                  {todoTask.otherScan}
                  <select-dictionary size="mini" class="table_head_dict" v-model={this.search} name="selectAll" v-on:selectChanged={this.selectChanged} dictTypeCode="ZDZD0024"></select-dictionary>
                </div>
              ]
            }
          }
        },
        // 审核意见
        {
          field: 'auditOpinions',
          align: 'left',
          headerAlign: 'center',
          minWidth: '250px',
          title: todoTask.auditOpinion,
          slots: {
            default: ({ row, rowIndex }) => {
              return [
                <el-form-item label-width="0" prop={'auditData.' + rowIndex + '.auditOpinions'}
                  rules={{ validator: this.auditOpinionsCheck, trigger: 'blur', row: row }}>
                  <el-input v-model_trim={row.auditOpinions} size="medium" maxlength="1000" placeholder={todoTask.auditOpinionMsg}></el-input>
                </el-form-item>
              ]
            }
          }
        },
        {
          title: common.operate,
          minWidth: '200px',
          fixed: 'right',
          align: 'center',
          slots: { default: 'operation' }
        }
      ],
      startNum2: 0,
      endNum2: 0,
      selectedFileRows: [],
      fileForm: {
        auditData: [],
        fileData: []
      },
      fileCol: [
        // 复选框
        {
          type: 'checkbox',
          align: 'center',
          width: '50px'
        },
        // 文件名称
        {
          field: 'fileName',
          align: 'left',
          headerAlign: 'center',
          minWidth: '280px',
          title: todoTask.file,
          showOverflow: 'title',
          slots: {
            default: ({ row, rowIndex }) => {
              return [
                <el-form-item label-width="0" prop={'fileData.' + rowIndex + '.fileCode'}
                  rules={ row.status ? this.formRules.fileCode : {}}>
                  {row.status
                    ? <select-file-name v-model={row.fileCode} v-on:selectChanged={this.projFileChanged} rowIndex={rowIndex} queryParas={this.projParas}
                      placeholder={common.pleaseSelect} optionDisabled={this.optionDisabled} class="dymForm"></select-file-name>
                    : <span>{row.fileName}</span>
                  }
                </el-form-item>
              ]
            }
          }
        },
        // 需求份数
        {
          field: 'needCopies',
          align: 'right',
          headerAlign: 'center',
          minWidth: '120px',
          title: todoTask.neededNumber,
          formatter: ({ cellValue }) => { return cellValue === '' ? '-' : cellValue }
        },
        // 有效份数
        {
          field: 'effectiveNumber',
          align: 'right',
          headerAlign: 'center',
          minWidth: '120px',
          title: todoTask.effectiveNumbers,
          slots: {
            default: ({ row, rowIndex }) => {
              return [
                <el-form-item label-width="0" prop={'fileData.' + rowIndex + '.effectiveNumber'}
                  rules={ this.UtilJs.isEmpty(row.fileSource)
                    ? this.formRules.effectiveNumber
                    : this.form[STAMP_TYPE[row.fileSource]] === 1
                      ? { required: false }
                      : this.formRules.effectiveNumber }>
                  {this.UtilJs.isEmpty(row.fileSource)
                    ? <el-input v-model_trim_number={row.effectiveNumber} size="medium" placeholder={common.pleaseInput}></el-input>
                    : this.form[STAMP_TYPE[row.fileSource]] === 1
                      ? <span>{'-'}</span>
                      : <el-input v-model_trim_number={row.effectiveNumber} size="medium" placeholder={common.pleaseInput}></el-input>
                  }
                </el-form-item>
                // onBlur={(...arg) => this.changeAuditCheck(...arg, row, rowIndex)}
              ]
            }
          }
        },
        // 是否有效
        {
          field: 'ifsEffectiveElecChapter',
          align: 'center',
          headerAlign: 'center',
          minWidth: '120px',
          title: todoTask.ifsElecChapterValid,
          slots: {
            default: ({ row, rowIndex }) => {
              let innerHtml
              if (this.UtilJs.isEmpty(row.fileSource)) {
                innerHtml = <select-dictionary v-model={row.ifsEffectiveElecChapter} dictTypeCode="effective_elec_chapter"></select-dictionary>
              } else {
                if (this.form[STAMP_TYPE[row.fileSource]] === 1) {
                  innerHtml = <select-dictionary v-model={row.ifsEffectiveElecChapter} dictTypeCode="effective_elec_chapter"></select-dictionary>
                } else {
                  innerHtml = <span>{'-'}</span>
                }
              }
              return [
                <el-form-item label-width="0">
                  {innerHtml}
                </el-form-item>
              ]
            }
          }
        },
        // 是否另需扫描件
        {
          field: 'ifsNeedScanFile',
          align: 'center',
          headerAlign: 'center',
          minWidth: '120px',
          title: todoTask.otherScan,
          slots: {
            default: ({ row, rowIndex }) => {
              return [
                <el-form-item label-width="0">
                  {this.UtilJs.isEmpty(row.fileSource)
                    ? <select-dictionary v-model={row.ifsNeedScanFile} dictTypeCode="ZDZD0024"></select-dictionary>
                    : this.form[STAMP_TYPE[row.fileSource]] === 1
                      ? <span>{'-'}</span>
                      : <select-dictionary v-model={row.ifsNeedScanFile} dictTypeCode="ZDZD0024"></select-dictionary>
                  }
                </el-form-item>
              ]
            }
          }
        },
        // 审核意见
        {
          field: 'auditOpinions',
          align: 'left',
          headerAlign: 'center',
          minWidth: '250px',
          title: todoTask.auditOpinion,
          slots: {
            default: ({ row, rowIndex }) => {
              return [
                <el-form-item label-width="0" prop={'fileData.' + rowIndex + '.auditOpinions'}
                  rules={{ validator: this.otherAuditOpinionsCheck, trigger: 'blur', row: row }}>
                  <el-input v-model_trim={row.auditOpinions} size="medium" maxlength="1000" placeholder={todoTask.auditOpinionMsg}></el-input>
                </el-form-item>
              ]
            }
          }
        },
        {
          title: common.operate,
          minWidth: '120px',
          align: 'center',
          fixed: 'right',
          slots: { default: 'operation' }
        }
      ]
    }
  },
  computed: {
    api () {
      return taskManageApi.offLine
    }
  }
}
</script>
<style scoped lang="scss" src="@/styles/dataAudit/taskManage/offlineTaskManageEdit.scss">
</style>
