<template>
  <el-container>
    <el-main>
      <el-tabs v-model="activeName" @tab-click="handleClick" :style="{padding:'20px',height:'90%'}">
        <el-tab-pane label="分包商单位信息" name="first">
          <bns-sub-info-tabs
            :items="subUnitInformationItems"
            :showAdditionalInput="true"
            :disabled="false"
            v-on:reason="changeReason"
          >
          </bns-sub-info-tabs>
        </el-tab-pane>
        <el-tab-pane label="企业资质" name="second">
          <bns-file-list-tabs
            :items="enterpriseQualificationItems">
          </bns-file-list-tabs>
        </el-tab-pane>
        <el-tab-pane label="安全协议书" name="third">
          <bns-file-list-tabs
            :items="securityAgreementFileItems">
          </bns-file-list-tabs>
        </el-tab-pane>
        <el-tab-pane label="四措两案" name="fourth">
          <bns-file-list-tabs
            :items="fourMeasuresAndTwoMeasuresFileItems">
          </bns-file-list-tabs>
        </el-tab-pane>
        <el-tab-pane label="施工人员信息" name="five">
          <div class="app-container">
            <el-form :model="personQueryParams" ref="personQueryForm" size="small" :inline="true" label-width="68px">
              <el-form-item label="施工人员姓名" label-width="140px" prop="supervisorName">
                <el-input
                  v-model="personQueryParams.name"
                  placeholder="请输入施工人员姓名"
                  maxlength="20"
                  show-word-limit
                  clearable
                  v-no-whitespace
                  @keyup.enter.native="handleQueryPerson"
                />
              </el-form-item>
              <el-form-item label="状态" prop="status">
                <el-select v-model="personQueryParams.status" placeholder="请选择状态" clearable>
                  <el-option label="在场" value="1" />
                  <el-option label="离场" value="0" />
                </el-select>
              </el-form-item>
              <el-form-item label="人员进场时间范围" label-width="150px" prop="supervisorName">
                <el-date-picker
                  v-model="timeRange"
                  type="daterange"
                  align="right"
                  unlink-panels
                  :editable="false"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                  :picker-options="pickerOptions"
                >
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryPerson">搜索</el-button>
                <el-button icon="el-icon-refresh" size="mini" @click="resetQueryPerson">重置</el-button>
                <el-button
                  type="primary"
                  plain
                  icon="el-icon-download"
                  size="mini"
                  @click="handleExportPerosn"
                >导出
                </el-button>
              </el-form-item>
            </el-form>
            <el-table v-loading="loading" :data="personList">
              <el-table-column
                type="index"
                width="55"
                label="序号"
                align="center"
                :index="indexContinuous(personQueryParams.pageNum, personQueryParams.pageSize)"
              />
              <el-table-column label="姓名" width="70" align="center" prop="name" />
              <el-table-column label="岗位" width="100" align="center" prop="postName" />
              <el-table-column label="特殊工种种类" width="100" align="center" prop="specialJobType" />
              <el-table-column label="体检文件" width="100" align="center">
                <template slot-scope="scope">
                  <el-button size="mini" @click="handleShow(scope.row,1)">查看</el-button>
                </template>
              </el-table-column>
              <el-table-column label="保险文件" width="100" align="center">
                <template slot-scope="scope">
                  <el-button size="mini" @click="handleShow(scope.row,2)">查看</el-button>
                </template>
              </el-table-column>
              <el-table-column label="特殊工种文件" width="100" align="center">
                <template slot-scope="scope">
                  <el-button size="mini" @click="handleShow(scope.row,3)">查看</el-button>
                </template>
              </el-table-column>
              <el-table-column label="其他文件" width="100" align="center">
                <template slot-scope="scope">
                  <el-button size="mini" @click="handleShow(scope.row,4)">查看</el-button>
                </template>
              </el-table-column>
              <el-table-column label="性别" width="50" align="center" prop="sex" />
              <el-table-column label="年龄" width="50" align="center" prop="age" />
              <el-table-column label="联系方式" width="120" align="center">
                <template slot-scope="scope">
                  <!-- 检查是否存在身份证号 -->
                  <span v-if="scope.row.phone">{{ hideSensitiveInfo(scope.row.phone) }}</span>
                  <span v-else>-</span>
                </template>
              </el-table-column>
              <el-table-column label="籍贯" width="70" align="center" prop="nativePlace" />
              <el-table-column label="身份证号码" width="160" align="center">
                <template slot-scope="scope">
                  <!-- 检查是否存在身份证号 -->
                  <span v-if="scope.row.idCard">{{ hideSensitiveInfo(scope.row.idCard) }}</span>
                  <span v-else>-</span>
                </template>
              </el-table-column>
              <el-table-column label="民族" width="70" align="center" prop="nation" />
              <el-table-column label="家庭地址" width="200" align="center" prop="homeAddress" />
              <el-table-column label="现地址" width="200" align="center" prop="currentAddress" />
              <el-table-column label="人脸照片" align="center" prop="faceUrl">
                <template slot-scope="scope">
                  <el-popover placement="right" title="" trigger="hover">
                    <img :src="`${scope.row.faceUrl ? lookFaceFile+scope.row.faceUrl : ''}`" :min-width="300" :height="300" alt="照片" />
                    <img slot="reference" :src="`${scope.row.faceUrl ? lookFaceFile+scope.row.faceUrl : ''}`" style="max-height: 50px; max-width: 50px"
                         :alt="`${scope.row.faceUrl ? lookFaceFile+scope.row.faceUrl : ''}`"
                    />
                  </el-popover>
                </template>
              </el-table-column>
            </el-table>

            <pagination
              v-show="total>0"
              :total="total"
              :page.sync="personQueryParams.pageNum"
              :limit.sync="personQueryParams.pageSize"
              @pagination="getSubPersonList"
            />
            <!--施工人员基本信息查看-->
            <el-dialog title="'查看详情'" :visible.sync="constructionPersonnelOpen" width="60%">
              <el-form ref="elForm" size="medium" label-width="100px">
                <el-row type="flex" justify="start" align="top" :gutter="gutterValue">
                  <el-col :span="11">
                    <el-form-item label-width="120px" label="姓名" prop="name">
                      <el-input v-model="personItems.name" placeholder="请输入姓名" clearable show-word-limit maxlength="20"
                                :style="{width: '100%'}" v-no-whitespace
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="11">
                    <el-form-item label-width="120px" label="性别" prop="sex">
                      <el-input v-model="personItems.sex" placeholder="请输入性别" clearable
                                :style="{width: '100%'}" v-no-whitespace
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row type="flex" justify="start" align="top" :gutter="gutterValue">
                  <el-col :span="11">
                    <el-form-item label-width="120px" label="年龄" prop="age">
                      <el-input v-model="personItems.age" placeholder="请输入年龄" clearable show-word-limit maxlength="2"
                                :style="{width: '100%'}" v-no-whitespace
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="11">
                    <el-form-item label-width="120px" label="身份证号码" prop="idCard">
                      <el-input v-model="personItems.idCard" placeholder="请输入身份证号码" clearable maxlength="18" show-word-limit
                                :style="{width: '100%'}" v-no-whitespace
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row type="flex" justify="start" align="top" :gutter="gutterValue">
                  <el-col :span="11">
                    <el-form-item label-width="120px" label="联系方式" prop="phone">
                      <el-input v-model="personItems.phone" placeholder="请输入联系方式" clearable maxlength="11" show-word-limit
                                :style="{width: '100%'}" v-no-whitespace
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="11">
                    <el-form-item label-width="120px" label="岗位" prop="postName">
                      <el-input v-model="personItems.postName" placeholder="请输入岗位" clearable
                                :style="{width: '100%'}"  maxlength="40" show-word-limit v-no-whitespace
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row type="flex" justify="start" align="top" :gutter="gutterValue">
                  <el-col :span="11">
                    <el-form-item label-width="120px" label="特殊工种种类" prop="specialJob">
                      <el-input v-model="personItems.specialJob" placeholder="请输入特殊工种种类" clearable
                                :style="{width: '100%'}" maxlength="40" show-word-limit v-no-whitespace
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row type="flex" justify="start" align="top" :gutter="gutterValue">
                  <el-col :span="24">
                    <el-form-item label-width="120px" label="人脸照片" :style="{width:'100%'}">
                    </el-form-item>
                    <uploadFile :limit="1" :accept="` .png, .jpg, .jpeg`" :uploadList.sync="personItems.facePhoto"
                                @picturePreview="picturePreview"
                    ></uploadFile>
                  </el-col>
                </el-row>
                <el-row type="flex" justify="start" align="top" :gutter="gutterValue">
                  <el-col :span="24">
                    <el-form-item label-width="120px" label="体检文件">
                    </el-form-item>
                    <uploadFile :limit="5" :accept="accept" :uploadList.sync="personItems.physicalExaminationFile"
                                @picturePreview="picturePreview"
                    ></uploadFile>
                  </el-col>
                </el-row>
                <el-row type="flex" justify="start" align="top" :gutter="gutterValue">
                  <el-col :span="24">
                    <el-form-item label-width="120px" label="保险文件">
                    </el-form-item>
                    <uploadFile :limit="5" :accept="accept" :uploadList.sync="personItems.insuranceFile"
                                @picturePreview="picturePreview"
                    ></uploadFile>
                  </el-col>
                </el-row>
                <el-row type="flex" justify="start" align="top" :gutter="gutterValue">
                  <el-col :span="24">
                    <el-form-item label-width="120px" label="特殊工种文件">
                    </el-form-item>
                    <uploadFile :limit="5" :accept="accept" :uploadList.sync="personItems.specialTypeOfWorkList"
                                @picturePreview="picturePreview"
                    ></uploadFile>
                  </el-col>
                </el-row>
                <el-row type="flex" justify="start" align="top" :gutter="gutterValue">
                  <el-col :span="24">
                    <el-form-item label-width="120px" label="其他文件">
                    </el-form-item>
                    <uploadFile :limit="5" :accept="accept" :uploadList.sync="personItems.otherFile"
                                @picturePreview="picturePreview"
                    ></uploadFile>
                  </el-col>
                </el-row>
              </el-form>
            </el-dialog>
            <!--生成工作证-->
            <el-dialog title="生成工作证" :visible.sync="workCardOpen" width="30%">
              <el-form ref="elForm" :model="formData" size="medium" label-width="100px">
                <bns-generate-work-card-tabs
                  :items="workCardItems"
                ></bns-generate-work-card-tabs>
              </el-form>
            </el-dialog>
            <el-dialog title="文件查看" :visible.sync="document" width="80%" top="5vh" append-to-body>
              <div style="width: 100%;height:720px">
                <bns-file-list-tabs :items="fileList" />
              </div>
            </el-dialog>
            <el-dialog title="文件查看" :visible.sync="documentPreview" width="80%" top="5vh" append-to-body>
              <div style="width: 100%;height:720px">
                <bns-kkFile-preview :items="kkFilePreview"></bns-kkFile-preview>
              </div>
            </el-dialog>
          </div>
        </el-tab-pane>
        <el-tab-pane label="其他材料" name="seven">
          <bns-file-list-tabs :items="otherFileItems"></bns-file-list-tabs>
        </el-tab-pane>
        <el-tab-pane label="审批信息" name="eight">
          <bns-timeline-tabs :is-examine="false" :btn-show="false"
                             final-check="0"
                             :show-type="1"
                             :items="approvalItems"
          />
        </el-tab-pane>
      </el-tabs>
    </el-main>
    <el-footer style="position: absolute;top: 90%;width: 100%" v-if="this.paramsData.type !== 'view'">
      <el-button type="primary" plain style="float:right">取消</el-button>
      <el-button type="primary" @click="submit('提交')" style="float:right;margin-right: 20px;" v-preventReClick="5000">提交审核</el-button>
      <el-button type="primary" @click="submit('保存')" style="float:right;margin-right: 20px;" v-preventReClick="5000">保存</el-button>
    </el-footer>
  </el-container>
</template>
<script>
import { getParams, hideSensitiveInfo, indexContinuous, lookFaceFile } from '@/utils/bonus'
import bnsSubInfoTabs from '@/components/pro-tabs/bns-sub-info-tabs.vue'
import bnsConsInfoTabs from '@/components/pro-tabs/bns-cons-info-tabs.vue'
import bnsFileListTabs from '@/components/pro-tabs/bns-file-list-tabs.vue'
import bnsGenerateWorkCardTabs from '@/components/pro-tabs/bns-generate-work-card-tabs.vue'
import uploadFile from '@/views/pro/admissionRequest/uploadFile.vue'
import { getSubPersonList, getSubDetailsInfo, getSubPersonnelDetails } from '@/api/pro/outsourcingPro'
import { subOutApply} from '@/api/pro/sub/subList'
import { selectFile } from '@/api/tool/select'
import BnsConsPersonDetailsTabs from '@/components/pro-tabs/bns-cons-person-details-tabs.vue'
import { submitApproval } from '@/api/pro/admissionRequest'

import { decryptCBC } from '@/utils/aescbc'
import bnsKkFilePreview from '@/components/pro-tabs/bns-kkFile-preview.vue'
import BnsTimelineTabs from '@/components/pro-tabs/bns-timeline-tabs.vue'
import { approvalHistory } from '@/api/terminalEquipment/deviceInformation'

export default {
  components: {
    BnsTimelineTabs,
    bnsKkFilePreview,
    BnsConsPersonDetailsTabs,
    bnsConsInfoTabs,
    bnsSubInfoTabs,
    bnsFileListTabs,
    bnsGenerateWorkCardTabs,
    uploadFile
  },
  computed: {
    labelText() {
      return (
        <span><i style="color:red">*</i>企业资质</span>
      )
    },
    labelText1() {
      return (
        <span><i style="color:red">*</i>安全协议书</span>
      )
    },
    labelText2() {
      return (
        <span><i style="color:red">*</i>四措两案</span>
      )
    }
  },
  data() {
    return {
      paramsData:{},
      id: undefined,
      proId: undefined,
      consId: undefined,
      accept: '.pdf, .doc, .docx, .png, .jpg, .jpeg',
      timeRange: [],
      equipOpen: false,
      document: false,
      documentPreview: false,
      fileList: [],
      kkFilePreview: {
        filePreviewUrl: '',
        fileName: '',
        showDownloadButton: false
      },
      reason:'',
      equipItem: {
        fileList: [],
        specialTypeOfWorkList: [],
        detectionTime: [],
        nextDetectionTime: []
      },
      personItems: {
        name: undefined,
        sex: undefined,
        phone: undefined,
        idCard: undefined,
        native: undefined,
        homeAddress: undefined,
        currentAddress: undefined,
        postName: undefined,
        specialJob: undefined,
        facePhoto: [],
        physicalExaminationFile: [],
        insuranceFile: [],
        specialTypeOfWorkList: [],
        otherFilesList: []
      },
      //当前激活的标签页
      activeName: 'first',
      //监理信息单位弹出层
      constructionPersonnelOpen: false,
      //生成工作证弹出层
      workCardOpen: false,
      //时间范围选择器
      pickerOptions: {
        shortcuts: [{
          text: '最近一周',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近一个月',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近三个月',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
            picker.$emit('pick', [start, end])
          }
        }]
      },
      gutterValue: parseInt('21', 10),
      // 遮罩层
      loading: false,
      // 总条数
      total: 0,
      equipTotal: 0,
      //分包商单位信息
      subUnitInformationItems: {},
      // 施工人员基本信息查询参数
      personQueryParams: {
        pageNum: 1,
        pageSize: 10,
        name: undefined,
        status: undefined,
        startDate: undefined,
        endDate: undefined
      },
      equipQueryParams: {
        pageNum: 1,
        pageSize: 10,
        equipName: undefined
      },
      //企业资质
      enterpriseQualificationItems: [],
      //安全协议书
      securityAgreementFileItems: [],
      //四措两案
      fourMeasuresAndTwoMeasuresFileItems: [],
      otherFileItems: [],
      // 施工人员基本信息表格数据
      personList: [],
      equipList: [],
      //工作证信息
      workCardItems: {},
      // 人员详情  表单参数
      formData: {},
      // 表单校验
      rules: {
        equipName: [
          { required: true, message: '请输入工器具名称', trigger: 'blur' }
        ],
        model: [
          { required: true, message: '请输入工器具型号', trigger: 'blur' }
        ],
        unit: [
          { required: true, message: '请输入工器具单位', trigger: 'blur' }
        ],
        num: [
          { required: true, message: '请输入工器具数量', trigger: 'blur' }
        ],
        equipType: [
          { required: true, message: '请输入工器具类型', trigger: 'blur' }
        ],
        detectionTime: [
          { required: true, message: '请选择检测时间', trigger: 'blur' }
        ],
        nextDetectionTime: [
          { required: true, message: '请选择下次检测时间', trigger: 'blur' }
        ],
        specialTypeOfWorkList: [
          { required: true, message: '请选择特殊工种文件', trigger: 'change' }
        ],
        isForceDetection: [
          { required: true, message: '请选择是否强制检测检验', trigger: 'blur' }
        ]

      },
      lookFaceFile:'',
      approvalItems: []
    }
  },
  created() {
    this.lookFaceFile = lookFaceFile()
    const params = this.$route.params && this.$route.params.data
    this.paramsData = JSON.parse(decryptCBC(params))
    this.id = this.paramsData.id
    this.proId = this.paramsData.proId
    this.consId = this.paramsData.consId
    this.getSubDetailsInfo()
    this.getEnterpriseQualificationFile()
    this.getSecurityAgreementFile()
    this.getFourMeasuresAndTwoMeasuresFile()
    this.getSubPersonList()
    this.approvalHistory()
  },
  methods: {
    indexContinuous,
    lookFaceFile,
    hideSensitiveInfo,
    getParams,
    approvalHistory() {
      console.log('this.paramsData.taskId:' + this.paramsData.taskId)
      approvalHistory({ taskId: this.paramsData.taskId }).then(res => {
        this.approvalItems = res.data
      })
    },
    /** 文件查看按钮操作 */
    handleShow(row, informationType) {
      this.loading = true
      const arr = {
        1: '体检文件',
        2: '保险文件',
        3: '特殊工种文件',
        4: '其他文件'
      }
      selectFile({
        classification: 9,
        uuid: row.uuid,
        informationType: informationType,
        fromType: 2
      }).then(response => {
        console.log(response)
        if (response.data.length === 0) {
          this.fileList = []
          this.$message.warning(arr[informationType] + '暂无')
        } else if (response.data.length === 1) {
          this.kkFilePreview = {
            filePreviewUrl: response.data[0].filePath,
            fileName: response.data[0].fileName,
            showDownloadButton: false
          }
          this.documentPreview = true
        } else {
          this.fileList = response.data
          this.document = true
        }
        this.loading = false
      })
    },
    changeReason(e){
      this.reason = e
    },
    //上传组件-图片查看
    picturePreview(file) {
      console.log(file)
      this.dialogImageUrl = file.url
      this.dialogVisible = true
    },
    changTime() {
      this.personQueryParams.admissionDate = this.timeRange[0]
      this.personQueryParams.departureDate = this.timeRange[1]
    },
    /**分包商信息查询*/
    getSubDetailsInfo() {
      this.loading = true
      const params = {
       uuid: this.$store.state.user.thisIds.uuid
      }
      getSubDetailsInfo(params).then(response => {
        console.log(response)
        this.subUnitInformationItems = response
        this.reason = this.subUnitInformationItems.reason
        this.loading = false
      })
    },
    /**获取企业资质文件*/
    getEnterpriseQualificationFile() {
      const params = {
        uuid: this.$store.state.user.thisIds.uuid,
        classification: '3',
        fromType: '1',
        informationType: '1'
      }
      selectFile(params).then(response => {
        this.enterpriseQualificationItems = response.data
      })
    },
    /**获取安全协议书文件*/
    getSecurityAgreementFile() {
      const params = {
        uuid: this.$store.state.user.thisIds.uuid,
        classification: '3',
        fromType: '1',
        informationType: '2'
      }
      selectFile(params).then(response => {
        this.securityAgreementFileItems = response.data
      })
    },
    /**获取四措两案文件*/
    getFourMeasuresAndTwoMeasuresFile() {
      const params = {
        uuid: this.$store.state.user.thisIds.uuid,
        classification: '3',
        fromType: '1',
        informationType: '3'
      }
      selectFile(params).then(response => {
        this.fourMeasuresAndTwoMeasuresFileItems = response.data
      })
    },
    /**施工人员信息查询*/
    getSubPersonList() {
      this.loading = true
      this.personQueryParams.uuid= this.$store.state.user.thisIds.uuid,
      this.personQueryParams.proId= this.$store.state.user.thisIds.proId,
      this.personQueryParams.consUuid= this.$store.state.user.thisIds.consUuid,
      this.personQueryParams.subUuid= this.$store.state.user.thisIds.subUuid,
      this.personQueryParams.userType= this.$store.state.user.userType,
      this.changTime()
      getSubPersonList(this.personQueryParams).then(response => {
        this.personList = response.rows
        this.personTotal = response.total
        this.loading = false
      })
    },
    handleQueryPerson() {
      this.personQueryParams.pageNum = 1
      this.getSubPersonList()
    },
    /** 重置按钮操作 */
    resetQueryPerson() {
      this.personQueryParams.name = undefined
      this.personQueryParams.status = undefined
      this.timeRange = []
      this.personQueryParams.startDate = undefined
      this.personQueryParams.endDate = undefined
      this.handleQueryPerson()
    },
    /** 人员新增 */
    handleAddPerson() {

    },
    /** 导出按钮操作 */
    handleExportPerosn() {
      this.derive('system/post/export', {
        ...this.queryParams
      }, `post_${new Date().getTime()}.xlsx`)
    },
    // 点击tab事件  切换tab
    handleClick(tab, event) {
      console.log(tab, event)
    },
    /**人员编辑*/
    handleEdit(row) {
      this.constructionPersonnelOpen = true
      this.workCardOpen = false
      const params = {
        id: row.id,
        subId: this.id,
        consId: this.consId,
        proId: this.proId
      }
      getSubPersonnelDetails(params).then(response => {
        console.log(response)
        this.formData = response.data
        this.loading = false
      })
    },
    close() {
      this.constructionPersonnelOpen = false
      this.workCardOpen = false
    },
    equipHandleQuery() {
      this.equipQueryParams.pageNum = 1
      // this.getEquipList();
    },
    equipResetQuery() {
      this.equipQueryParams.equipName = undefined
      // this.equipHandleQuery();
    },
    equipHandleExport() {
      // this.download('system/post/export', {
      //   ...this.queryParams
      // }, `post_${new Date().getTime()}.xlsx`)
    },
    submit(type){
      if (this.subUnitInformationItems.reason === ''){
        this.$message.error('请填写离场原因')
        return
      }
      const params = {
        reason: this.reason,
        uuid: this.$store.state.user.thisIds.uuid,
        status: type === '保存' ? '9' : '8'
      }
      subOutApply(params).then(response => {
        if (type === '保存'){
          if (response.msg === '此审核类型未配置相对应的审核流，请联系管理员配置后再次提交'){
            this.$modal.msgError(response.msg)
          }else{
            this.$modal.msgSuccess('提交成功')
          }
          this.$store.state.user.thisIds.outStatus = params.status
          this.$tab.closePage()
        }else{
          this.submitApply()
        }
      })
    },
    submitApply() {
      const param = {
        ...this.getParams(),
        taskId: this.subUnitInformationItems.taskId,
        taskType: '12',
      }
      console.log("param="+JSON.stringify(param))
      submitApproval(param).then(response => {
        console.log("response="+JSON.stringify(response))
        if (response.code === 200) {
          if (response.msg === '此审核类型未配置相对应的审核流，请联系管理员配置后再次提交'){
            this.$modal.msgError(response.msg)
          }else{
            this.$modal.msgSuccess('提交成功')
          }
        } else {
          this.$modal.msgError(response.msg)
        }
        this.$tab.closePage()
        this.$router.push({ path: '/index', query: { result: 1 } })
      }).catch((error) =>{
        console.log("error="+JSON.stringify(error))
      })

    },
    equipCancel() {
      this.equipItem = {}
      this.equipItem.fileList = []
      this.equipItem.specialTypeOfWorkList = []
      this.equipOpen = false
    }
  }
}
</script>
<style scoped>
</style>
