<template>
  <div class="eleStyle">
    <!---------------------------查看------------------------------>
    <div v-show="queryLay" style="height:100%;width:80%; background:#ffffff; margin: 3% 9% 9% 9%; border-radius: 8px;">
      <div style="margin:0% 2%;">
        <div style=" padding-top:2%;font-size:18px;color:#000000;">任务信息</div>
        <el-divider />
        <div width="70%" style="padding-top:30px;">
          <div style="padding-bottom:5px; diaplay: flex;">
            <span style="flex:1;">状态</span>
            <el-select v-model="form.status" style="width: 100px;" size="mini" placeholder="状态" @change="updateaddTaskData(form)">
              <el-option v-for="item in processStatusEnumList" :key="item.code" :label="item.name" :value="item.code" />
            </el-select>
            <span style="flex:1;">优先级</span>
            <el-select v-model="form.priority" style="width: 100px;" size="mini" placeholder="优先级" @change="updateaddTaskData(form)">
              <el-option v-for="item in bugLevelStr" :key="item.code" :label="item.name" :value="item.code" />
            </el-select>
            <el-button type="primary" size="small" @click="createReport(1, form)">新建提测报告</el-button>
            <el-button type="primary" size="small" @click="createReport(2, form)">新建日报报告</el-button>
            <el-button type="primary" size="small" @click="createReport(3, form)">新建准出报告</el-button>
            <el-button type="primary" size="small" @click="createReport(4, form)">新建bug</el-button>
            <el-button type="primary" size="small" style="float:right;margin-right:7%" @click="queryTaskData(form)">编辑</el-button>
          </div>
          <el-divider />
          <el-form :model="form" size="mini">
            <div style="display:flex;">
              <el-form style="flex:1; padding-left: 130px;" size="mini" label="right" label-width="110px">
                <el-form-item label="任务名称 : " :label-width="formLabelWidth1">{{ form.name }}</el-form-item>
                <el-form-item label="进展 : " :label-width="formLabelWidth1">{{ form.stageString }}</el-form-item>
                <el-form-item label="PM : " :label-width="formLabelWidth1">{{ form.pm }}</el-form-item>
                <el-form-item label="RD : " :label-width="formLabelWidth1">{{ form.rd }}</el-form-item>
                <el-form-item label="QA : " :label-width="formLabelWidth1">{{ form.qa }}</el-form-item>
                <el-form-item label="打回次数 : " :label-width="formLabelWidth1">{{ form.reopen }}</el-form-item>
              </el-form>
              <el-form style="flex:1;" label="right" size="mini" label-width="110px">
                <el-form-item label="业务线 : " :label-width="formLabelWidth1">{{ form.bizIdString }}</el-form-item>
                <el-form-item label="任务类型 : " :label-width="formLabelWidth1">{{ form.taskType }}</el-form-item>
                <el-form-item label="平台类型 : " :label-width="formLabelWidth1">{{ form.type }}</el-form-item>
                <el-form-item label="是否免测 : " :label-width="formLabelWidth1">{{ form.noTestString }}</el-form-item>
                <el-form-item v-if="business" label="业务模块 : " :label-width="formLabelWidth1">{{ form.clientType }}</el-form-item>
                <el-form-item v-if="osTypeShow" label="端类型 : " :label-width="formLabelWidth1">{{ form.osType }}</el-form-item>
              </el-form>
            </div>
            <el-form label="right" style="margin-left:130px;" size="mini" label-width="210px">
              <el-form-item label="需求文档 : " :label-width="formLabelWidth1" style="width:60vw;">{{ form.mrdUrl }}</el-form-item>
              <el-form-item label="技术文档 : " :label-width="formLabelWidth1" style="width:60vw;">{{ form.devUrl }}</el-form-item>
              <el-form-item label="描述 : " :label-width="formLabelWidth1" style="width:60vw;">{{ form.description }}</el-form-item>
              <el-form-item label="备注 : " :label-width="formLabelWidth1" style="width:60vw;">{{ form.remark }}</el-form-item>

            </el-form>
            <el-button type="primary" round size="mini" icon="el-icon-arrow-down" style="cursor: pointer;" @click="show2 = !show2">详细查看</el-button>
            <el-form label="right" size="mini" label-width="110px">
              <transition name="el-zoom-in-top">
                <div v-show="show2" style="display: flex;margin-left:90px; width:93%; padding-top:30px;">
                  <div style="flex:1;">
                    <el-form-item label="标签 : " :label-width="formLabelWidth1">{{ form.tag }}</el-form-item>
                    <el-form-item label="需求评审时间 : " :label-width="formLabelWidth1">{{ form.mrdTime }}</el-form-item>
                    <el-form-item label="计划开始开发时间 : " :label-width="formLabelWidth1">{{ form.startDevPlanTime }}</el-form-item>
                    <el-form-item label="计划测试完成时间 : " :label-width="formLabelWidth1">{{ form.testFinishPlanTime }}</el-form-item>
                    <el-form-item label="计划提测时间 : " :label-width="formLabelWidth1">{{ form.launchTestPlanTime }}</el-form-item>
                    <el-form-item label="计划上线时间 : " :label-width="formLabelWidth1">{{ form.onlinePlanTime }}</el-form-item>
                  </div>
                  <div style="flex:1;">
                    <el-form-item label="分组 : " :label-width="formLabelWidth1">{{ form.group }}</el-form-item>
                    <el-form-item label="关注人 : " prop="focusPenson" :label-width="formLabelWidth1">{{ form.focusPenson }}</el-form-item>
                    <el-form-item label="实际开始开发时间 : " :label-width="formLabelWidth1">{{ form.startDevRealTime }}</el-form-item>
                    <el-form-item label="实际测试完成时间 : " :label-width="formLabelWidth1">{{ form.testFinishRealTime }}</el-form-item>
                    <el-form-item label="冒烟测试完成时间 : " :label-width="formLabelWidth1">{{ form.smokeTestFinishTime }}</el-form-item>
                    <el-form-item label="实际提测时间 : " :label-width="formLabelWidth1">{{ form.launchTestRealTime }}</el-form-item>
                    <el-form-item label="实际上线时间 : " :label-width="formLabelWidth1">{{ form.onlineRealTime }}</el-form-item>
                  </div>
                </div>
              </transition>
            </el-form>

          </el-form>
          <div style="margin-top:20px; width=100%">
            <el-tabs tab-position="top" style="height: 200px; width:100%;">
              <el-tab-pane label="提测报告">
                <el-table :data="listTaskDatas" style="width: 100%" max-height="390">
                  <el-table-column label="ID" prop="id" align="center" min-width="60"><template slot-scope="scope">{{ scope.row.id }}</template></el-table-column>
                  <el-table-column label="标题" prop="name" align="center" min-width="100"><template slot-scope="scope"><el-tag style="cursor: pointer;" @click="JumpDetection(scope.row)">{{ scope.row.name }}</el-tag></template></el-table-column>
                  <el-table-column label="创建时间" prop="gmtCreate" align="center" min-width="150"><template slot-scope="scope">{{ scope.row.gmtCreate }}</template></el-table-column>
                  <el-table-column label="状态" prop="statusString" align="center" min-width="80"><template slot-scope="scope">{{ scope.row.statusString }}</template></el-table-column>
                  <el-table-column label="操作" align="center" min-width="150">
                    <template slot-scope="scope">
                      <el-button type="primary" size="small" disabled>查看</el-button>
                      <el-button type="primary" size="small" @click="yesCallBack1(2,scope.row.id)">打回</el-button>
                      <el-button type="primary" size="small" @click="yesCallBack(1,scope.row.id)">通过</el-button>
                    </template>
                  </el-table-column>
                </el-table>
              </el-tab-pane>
              <el-tab-pane label="日报报告">
                <el-table :data="dailyTestReports" max-height="390" style="width: 100%">
                  <el-table-column label="ID" prop="id" align="center" min-width="60"><template slot-scope="scope">{{ scope.row.id }}</template></el-table-column>
                  <el-table-column label="标题" prop="name" align="center" min-width="100"><template slot-scope="scope"><el-tag style="cursor: pointer;" @click="JumpDaily(scope.row)">{{ scope.row.reportName }}</el-tag></template></el-table-column>
                  <el-table-column label="创建时间" prop="gmtCreate" align="center" min-width="150"><template slot-scope="scope">{{ scope.row.gmtCreate }}</template></el-table-column>
                </el-table>
              </el-tab-pane>
              <el-tab-pane label="准出报告">
                <el-table :data="projectTestReports" max-height="390" style="width: 100%">
                  <el-table-column label="ID" prop="id" align="center" min-width="60"><template slot-scope="scope">{{ scope.row.id }}</template></el-table-column>
                  <el-table-column label="标题" prop="name" align="center" min-width="100"><template slot-scope="scope"><el-tag style="cursor: pointer;" @click="JumpOut(scope.row)">{{ scope.row.reportName }}</el-tag></template></el-table-column>
                  <el-table-column label="创建时间" prop="gmtCreate" align="center" min-width="150"><template slot-scope="scope">{{ scope.row.gmtCreate }}</template></el-table-column>
                  <el-table-column label="状态" prop="status" align="center" min-width="80"><template slot-scope="scope">{{ scope.row.statusString }}</template></el-table-column>
                </el-table>
              </el-tab-pane>
              <el-tab-pane label="bug报告">
                <el-table :data="projectBug" max-height="390" style="width: 100%" @row-click="queryBugData">
                  <el-table-column label="ID" align="center" min-width="60"><template slot-scope="scope">{{ scope.row.id }}</template></el-table-column>
                  <el-table-column label="标题" align="center" min-width="100"><template slot-scope="scope">{{ scope.row.bugName }}</template></el-table-column>
                  <el-table-column label="状态" align="center" min-width="80"><template slot-scope="scope">{{ scope.row.status }}</template></el-table-column>
                  <el-table-column label="当前处理人" align="center" min-width="100"><template slot-scope="scope">{{ scope.row.currentHandler }}</template></el-table-column>
                  <el-table-column label="创建时间" align="center" min-width="150"><template slot-scope="scope">{{ scope.row.gmtCreate }}</template></el-table-column>
                </el-table>
              </el-tab-pane>
            </el-tabs>
            <div style="height:5%; text-align:center;">
              <el-button type="primary" style="margin:15% 0 3% 0;" @click="clickOut">关 闭</el-button>
            </div>
          </div>
        </div>
      </div>

      <!--------------------------------- 编辑 ---------------------------------->
      <el-dialog title="任务信息" width="80%" :visible.sync="dialogFormTaskVisible" @close="Refresh">
        <el-form ref="fromCode" :model="fromCode" :rules="serviceDataRules">
          <el-form-item label="任务名称" prop="name" label-width="100px" style="width:93%;">
            <el-input v-model="fromCode.name" placeholder="任务名称" autocomplete="off" />
          </el-form-item>
          <div style="display: flex;">
            <div style="flex:1;">
              <el-form-item label="业务线" prop="bizId" label-width="100px">
                <el-select v-model="fromCode.bizId" placeholder="业务线" @change="bizId(fromCode.bizId)">
                  <el-option v-for="item in bizIdEnumList" :key="item.code" :label="item.name" :value="item.code" />
                </el-select>
              </el-form-item>
              <el-form-item label="优先级" prop="priority" label-width="100px">
                <el-select v-model="fromCode.priority" placeholder="优先级">
                  <el-option v-for="item in bugLevelStr" :key="item.code" :label="item.name" :value="item.code" />
                </el-select>
              </el-form-item>
              <el-form-item label="进展" prop="stage" label-width="100px">
                <el-select v-model="fromCode.stage" placeholder="进展">
                  <el-option v-for="item in stageEnumList" :key="item.code" :label="item.name" :value="item.code" />
                </el-select>
              </el-form-item>
            </div>
            <div style="flex:1;">
              <el-form-item label="平台类型" prop="type" label-width="100px">
                <el-select v-model="fromCode.type" placeholder="平台类型" @change="changeType(fromCode.type)">
                  <el-option v-for="item in typeString" :key="item.code" :label="item.name" :value="item.name" />
                </el-select>
              </el-form-item>
              <el-form-item label="状态" prop="status" label-width="100px">
                <el-select v-model="fromCode.status" placeholder="状态">
                  <el-option v-for="item in processStatusEnumList" :key="item.code" :label="item.name" :value="item.code" />
                </el-select>
              </el-form-item>
              <el-form-item label="任务类型" prop="taskType" label-width="100px">
                <el-select v-model="fromCode.taskType" placeholder="任务类型">
                  <el-option v-for="item in taskAndRoutineEnumList" :key="item.code" :label="item.name" :value="item.name" />
                </el-select>
              </el-form-item>
            </div>
            <div style="flex:1;">
              <el-form-item v-if="business" label="业务模块" prop="clientType" label-width="100px">
                <el-select v-model="fromCode.clientType" placeholder="业务模块" @change="clientType(fromCode.clientType)">
                  <el-option v-for="item in businessTypeStr" :key="item.code" :label="item.name" :value="item.name" />
                </el-select>
              </el-form-item>
              <el-form-item label="是否免测" prop="notest" label-width="100px">
                <el-select v-model="fromCode.notest" placeholder="是否免测">
                  <el-option v-for="item in noTestEnumList" :key="item.code" :label="item.name" :value="item.code" />
                </el-select>
              </el-form-item>
              <el-form-item v-if="osTypeShow" label="端类型" prop="osType" label-width="100px">
                <el-select v-model="fromCode.osType" placeholder="端类型">
                  <el-option v-for="item in osTypeEnum" :key="item.code" :label="item.name" :value="item.name" />
                </el-select>
              </el-form-item>
            </div>
          </div>
          <el-form-item label="需求文档" style="width:72vw;" label-width="100px">
            <el-input v-model="fromCode.mrdUrl" autocomplete="off" />
          </el-form-item>
          <el-form-item label="技术文档" style="width:72vw;" label-width="100px">
            <el-input v-model="fromCode.devUrl" autocomplete="off" />
          </el-form-item>
          <el-button type="primary" round size="mini" icon="el-icon-arrow-down" style="cursor: pointer;" @click="show2 = !show2">详细添加</el-button>
          <transition name="el-zoom-in-top">
            <div v-show="show2" style="display: flex; width:93%; padding-top:30px;">
              <div style="flex:1;">
                <el-form-item label="标签" :label-width="formLabelWidth">
                  <el-input v-model="fromCode.tag" style="width:220px;" autocomplete="off" />
                </el-form-item>
                <el-form-item label="RD" :label-width="formLabelWidth">
                  <el-input v-model="fromCode.rd" style="width:220px;" autocomplete="off" />
                </el-form-item>
                <el-form-item label="QA" :label-width="formLabelWidth">
                  <el-input v-model="fromCode.qa" style="width:220px;" autocomplete="off" />
                </el-form-item>
                <el-form-item label="需求评审时间" :label-width="formLabelWidth">
                  <el-date-picker v-model="fromCode.mrdTime" type="datetime" placeholder="选择日期" />
                </el-form-item>
                <el-form-item label="计划开始开发时间" :label-width="formLabelWidth">
                  <el-date-picker v-model="fromCode.startDevPlanTime" type="datetime" placeholder="选择日期" />
                </el-form-item>
                <el-form-item label="计划测试完成时间" :label-width="formLabelWidth">
                  <el-date-picker v-model="fromCode.testFinishPlanTime" type="datetime" placeholder="选择日期" />
                </el-form-item>
                <el-form-item label="计划提测时间" :label-width="formLabelWidth">
                  <el-date-picker v-model="fromCode.launchTestPlanTime" type="datetime" placeholder="选择日期" />
                </el-form-item>
                <el-form-item label="计划上线时间" :label-width="formLabelWidth">
                  <el-date-picker v-model="fromCode.onlinePlanTime" type="datetime" placeholder="选择日期" />
                </el-form-item>
              </div>
              <div style="flex:1;">
                <el-form-item label="分组" :label-width="formLabelWidth">
                  <el-input v-model="fromCode.group" style="width:220px;" autocomplete="off" />
                </el-form-item>
                <el-form-item label="PM" :label-width="formLabelWidth">
                  <el-input v-model="fromCode.pm" style="width:220px;" autocomplete="off" />
                </el-form-item>
                <el-form-item label="关注人" prop="focusPenson" :label-width="formLabelWidth">
                  <el-input v-model="fromCode.focusPenson" style="width:220px;" autocomplete="off" />
                </el-form-item>
                <el-form-item label="实际开始开发时间" :label-width="formLabelWidth">
                  <el-date-picker v-model="fromCode.startDevRealTime" type="datetime" placeholder="选择日期" />
                </el-form-item>
                <el-form-item label="实际测试完成时间" :label-width="formLabelWidth">
                  <el-date-picker v-model="fromCode.testFinishRealTime" type="datetime" placeholder="选择日期" />
                </el-form-item>
                <el-form-item label="冒烟测试完成时间" :label-width="formLabelWidth">
                  <el-date-picker v-model="fromCode.smokeTestFinishTime" type="datetime" placeholder="选择日期" />
                </el-form-item>
                <el-form-item label="实际提测时间" :label-width="formLabelWidth">
                  <el-date-picker v-model="fromCode.launchTestRealTime" type="datetime" placeholder="选择日期" />
                </el-form-item>
                <el-form-item label="实际上线时间" :label-width="formLabelWidth">
                  <el-date-picker v-model="fromCode.onlineRealTime" type="datetime" placeholder="选择日期" />
                </el-form-item>
              </div>
            </div>
          </transition>
          <dir style="display:flex; width:93%;">
            <el-form-item label="备注" style="flex:1;" label-width="60px">
              <el-input v-model="fromCode.remark" type="textarea" :rows="4" placeholder="备注" />
            </el-form-item>
            <el-form-item label="描述" style="flex:1;" label-width="60px">
              <el-input v-model="fromCode.description" type="textarea" :rows="4" placeholder="请输入内容" />
            </el-form-item>
          </dir>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormTaskVisible = false">取 消</el-button>
          <el-button type="primary" @click="updateaddTaskData1(fromCode)">确 定</el-button>
        </div>
      </el-dialog>

      <!-- 打回 -->
      <el-dialog title="打回原因" :visible.sync="centerDialogVisible" width="30%" center>
        <el-input v-model="CallBackTheReason" type="textarea" :rows="2" />
        <span slot="footer" class="dialog-footer">
          <el-button @click="centerDialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="yesCallBack(2, CallBackTheReason)">确 定</el-button>
        </span>
      </el-dialog>
    </div>
  </div>
</template>

<script>
import { updateTaskList, getTaskData, launchTestUpdate, projectGetTypeMap } from '@/api/projectPage.js'
import { bugGetEnum } from '@/api/defectManage' // 下拉菜单data
export default {
  name: 'TaskQuery',
  data() {
    return {
      bugTypeStr: [],
      bugStatusStr: [],
      bugLevelStr: [],
      serviceDataRules: {
        notest: [{ required: true, message: '是否免测不能为空', trigger: 'change' }],
        type: [{ required: true, message: '平台类型不能为空', trigger: 'change' }],
        name: [{ required: true, message: '项目名称不能为空', trigger: 'change' }],
        bizId: [{ required: true, message: '业务线不能为空', trigger: 'change' }],
        status: [{ required: true, message: '状态不能为空', trigger: 'change' }],
        priority: [{ required: true, message: '优先级不能为空', trigger: 'change' }],
        stage: [{ required: true, message: '进展不能为空', trigger: 'change' }],
        pm: [{ required: true, message: 'pm不能为空', trigger: 'change' }],
        taskType: [{ required: true, message: '任务类型不能为空', trigger: 'change' }],
        clientType: [{ required: true, message: '业务模块不能为空', trigger: 'change' }],
        osType: [{ required: true, message: '端类型不能为空', trigger: 'change' }]
      },
      processStatusEnumList: [],
      reasonStr: [],
      platformTypeStr: [],
      stageStr: [],
      osTypeEnum: [],
      discoveryMethodStr: [],
      repairResultStr: [],
      bizIdEnumList: [],
      listTaskDatas: [],
      projectTestReports: [],
      dailyTestReports: [],
      taskTypeStr: [],
      noTestEnumList: [],
      projectBug: [],
      typeString: [],
      clientTypeEnumList: [],
      serviceTypeEnumList: [],
      businessTypeStr: [],
      stageEnumList: [],
      taskAndRoutineEnumList: [],
      userInformation: localStorage.getItem('username'),
      userNames: localStorage.getItem('realname'),
      bizJson: localStorage.getItem('key'),
      form: {},
      fromCode: {},
      dialogFormTaskVisible: false,
      centerDialogVisible: false,
      statusShow: false,
      repairShow: false,
      queryLay: true,
      reatedLay: false,
      osTypeShow: false,
      business: false,
      formLabelWidth1: '160px',
      formLabelWidth: '160px',
      formLabelWidths: '160px',
      formTask: {},
      CallBackTheReason: '',
      objData: '',
      userData: '',
      taskIdStr: '',
      url: '',
      arrurl: '',
      show2: false,
      cun: ''
    }
  },
  created() {
    this.bugListSelect()
    this.getList()
  },
  methods: {
    getList() {
      this.beforeCreate()
      this.url = window.location.href // 获取url中"?"符后的字串
      this.arrurl = this.url.split('?id=')
      getTaskData(this.arrurl[1]).then(res => {
        this.listTaskDatas = res.data.launchTestInfoList
        this.listTaskDatas.statusString = this.form.statusString
        this.projectTestReports = res.data.projectTestReports
        this.projectTestReports.statusString = this.form.statusString
        this.dailyTestReports = res.data.dailyTestReports
        this.projectBug = res.data.bugBaseInfoDOS
        this.form = res.data
        this.fromCode = res.data

        for (var s of this.bizIdEnumList) { // 获取bizId
          this.form.bizId === s.code ? this.typeString = s.child : ''
        }
        this.fromCode.osType === '' ? this.osTypeShow = false : this.osTypeShow = true
        this.form.clientType !== '' ? this.business = true : this.business = false
        this.business === false ? this.osTypeShow = false : ''
      })
    },

    // 编辑 提交
    updateaddTaskData1(vel) {
      this.$refs['fromCode'].validate((valid) => {
        if (valid) {
          this.fromCode = vel
          this.osTypeShow === false ? this.$set(this.fromCode, 'osType', '') : ''
          this.business === false ? this.$set(this.fromCode, 'clientType', '') : ''
          this.userData = { id: '', ename: this.userInformation, name: this.userNames }
          this.objData = { taskInfo: this.fromCode, user: this.userData }
          updateTaskList(this.objData).then(response => {
            if (response.code === 200) {
              this.getList()
              this.successFun(response.msg)
              this.dialogFormTaskVisible = false
            } else {
              this.errorFun(response.msg)
            }
          })
        }
      })
    },

    // change 业务线
    bizId(e) {
      for (var a of this.bizIdEnumList) {
        if (e === a.code) {
          this.typeString = a.child
        }
      }
      this.business = false
      this.osTypeShow = false
      this.$set(this.fromCode, 'type', '')
    },

    // chnage 平台类型
    changeType(e) {
      for (var b of this.typeString) {
        if (e === b.name) {
          this.businessTypeStr = b.child
          b.child !== null ? this.business = true : this.business = false
        }

        this.$set(this.fromCode, 'clientType', '')
        this.$set(this.fromCode, 'osType', '')
        this.osTypeShow = false
      }
    },

    // 业务模块
    clientType(e) {
      for (var a of this.businessTypeStr) {
        if (e === a.name) {
          this.osTypeEnum = a.child
          a.child !== null ? this.osTypeShow = true : this.osTypeShow = false
        }
        this.$set(this.fromCode, 'osType', '')
      }
    },

    // 任务编辑
    queryTaskData(ele) {
      this.dialogFormTaskVisible = true
      projectGetTypeMap().then(res => {
        this.bizIdEnumList = res.data
        ele.clientType !== '' ? this.business = true : this.business = false
        this.osTypeShow === false ? this.$set(this.fromCode, 'osType', '') : ''
        ele.osType !== '' ? this.osTypeShow = true : this.osTypeShow = false
        for (var b of this.bizIdEnumList) {
          ele.bizId === b.code ? this.typeString = b.child : ''
        }
        for (var s of this.typeString) {
          ele.type === s.name ? this.businessTypeStr = s.child : ''
        }
        for (var c of this.businessTypeStr) {
          ele.clientType === c.name ? this.osTypeEnum = c.child : ''
        }
      })
    },

    // 查看页面更改状态 优先级
    updateaddTaskData(vel) {
      this.formTask = vel
      this.userData = { id: '', ename: this.userInformation, name: this.userNames }
      this.objData = { taskInfo: this.formTask, user: this.userData }
      updateTaskList(this.objData).then(response => {
        if (response.code === 200) {
          this.getList()
          this.successFun(response.msg)
        } else {
          this.errorFun(response.msg)
        }
      })
    },

    // 通过
    yesCallBack(e, ele) {
      this.centerDialogVisible = false
      if (e === 1) {
        this.tt = { status: 1, id: ele }
      } else {
        this.tt = { status: 2, id: this.CallBackId, launchRepulseInfo: ele }
      }
      this.userData = { id: '', ename: this.userInformation, name: this.userNames }
      this.objData = { launchTestInfo: this.tt, user: this.userData }
      launchTestUpdate(this.objData).then(res => {
        res.code === 200 ? this.successFun() : this.errorFun(res.msg)
      })
    },

    // 打回
    yesCallBack1(e, ele) {
      this.centerDialogVisible = true
      this.CallBackStatus = e
      this.CallBackId = ele
    },

    // bug报告跳转
    queryBugData(ele) {
      this.$router.push({ path: '/Platform/presentation/defectManageQuery', query: { id: ele.id }})
    },

    // 创建日报 提测 准出报告跳转
    createReport(e, ele) {
      if (ele.typeString !== '服务端') {
        switch (e) {
          case 1:
            this.$router.push({ path: '/Platform/presentation/PresentReport', query: { task: ele }}) // 客户端提测
            break
          case 2:
            this.$router.push({ path: '/Platform/presentation/DailyNewsAdded', query: { task: ele }}) // 客户端日报
            break
          case 3:
            this.$router.push({ path: '/Platform/presentation/ClientAcceptance', query: { task: ele }}) // 客户端准出
            break
          case 4:
<<<<<<< HEAD
            this.$router.push({ path: '/Platform/defectManagement', query: { id: ele.id, code: 4 }}) // 缺陷报告
=======
            this.$router.push({ path: '/Platform/defectManagement/bugCreate', query: { id: ele.id }}) // 缺陷报告
>>>>>>> test
            break
        }
      } else {
        switch (e) {
          case 1:
            this.$router.push({ path: '/Platform/presentation/presentationReport', query: { task: ele }}) // 服务端提测
            break
          case 2:
            this.$router.push({ path: '/Platform/presentation/DailyNewsAdded', query: { task: ele }}) // 服务端日报
            break
          case 3:
            this.$router.push({ path: '/Platform/presentation/Acceptance', query: { task: ele }}) // 服务端准出
            break
          case 4:
<<<<<<< HEAD
            this.$router.push({ path: '/Platform/defectManagement', query: { id: ele.id, code: 4 }}) // 缺陷报告
=======
            this.$router.push({ path: '/Platform/defectManagement/bugCreate', query: { id: ele.id }}) // 缺陷报告
>>>>>>> test
            break
        }
      }
    },

    // 返回
    clickOut() {
      this.$router.push({ path: '/Platform/projectPage' })
    },
    successFun(e) {
      this.$notify({ title: 'Success', message: e, type: 'success', duration: 2000 })
    },
    errorFun(e) {
      this.$notify({ title: 'Failed', message: e, type: 'error', duration: 2000 })
    },
    beforeCreate() {
      projectGetTypeMap().then(res => {
        this.bizIdEnumList = res.data
      })
      document.querySelector('body').setAttribute('style', 'background-color:#fff')
    },

    // 提测预览跳转
    JumpDetection(val) {
      val.taskId = this.arrurl
      this.$router.push({ path: '/Platform/presentation/acceptTheReport', query: { data: val }})
    },

    // 日报预览跳转
    JumpDaily(val) {
      val.taskId = this.arrurl
      this.$router.push({ path: '/Platform/presentation/testPresenyL', query: { data: val }})
    },

    // 准出预览跳转
    JumpOut(val) {
      val.taskId = this.arrurl
      this.$router.push({ path: '/Platform/presentation/ResultPageyL', query: { data: val }})
    },

    // Dialog 关闭的回调
    Refresh() {
      this.fromCode.osType === '' ? this.$set(this.fromCode, 'osType', '') : ''
      this.getList()
    },

    // 所有下拉菜单数据
    bugListSelect() {
      bugGetEnum().then(res => {
        this.serviceTypeEnumList = res.data.serviceTypeEnumList
        this.clientTypeEnumList = res.data.clientTypeEnumList
        // this.bizIdEnumList = res.data.bizIdEnumList // 优先级
        this.bugStatusStr = res.data.bugEnumList
        this.stageStr = res.data.bugStageEnumList
        this.reasonStr = res.data.reasonEnumList
        this.platformTypeStr = res.data.platformTypeEnumList
        this.bugTypeStr = res.data.bugTypeEnumList
        this.bugLevelStr = res.data.priorityEnumList
        this.discoveryMethodStr = res.data.discoveryMethodEnumList
        this.repairResultStr = res.data.repairResultEnumList
        this.stageEnumList = res.data.stageEnumList
        this.taskAndRoutineEnumList = res.data.taskAndRoutineEnumList
        this.noTestEnumList = res.data.noTestEnumList
        this.processStatusEnumList = res.data.processStatusEnumList
        this.osTypeEnum = res.data.osTypeEnum
      })
    }
  }
}
</script>

<style scoped>
  .eleStyle {
    width: 100%;
    height:100%;
    background:#F2F3F6;
    /* position:fixed; */
    display: inline-block;
  }
  .el-divider--horizontal {
    margin: 0px;
    background: #F2F3F6;
  }
</style>
