<template>
  <div>
    <xy-dialog ref="dialog" :is-show.sync="isShow" :type="'form'" title="发起任务" :form="form">
      <template v-slot:contents>
        <el-divider>大纲信息</el-divider>
        <el-descriptions class="margin-top" :column="4" border>
          <el-descriptions-item span="2">
            <template slot="label">
              工作项目：
            </template>
            {{showform.menu?showform.menu:''}}
          </el-descriptions-item>
          <el-descriptions-item span="2">
            <template slot="label">
              性质级别：
            </template>
            {{showform.level?showform.level:''}}
          </el-descriptions-item>
          <el-descriptions-item span="2">
            <template slot="label">
              工作周期：
            </template>
            {{showform.period?showform.period:''}}
          </el-descriptions-item>
          <el-descriptions-item span="2">
            <template slot="label">
              完成时间：
            </template>
            {{showform.end_time?showform.end_time:''}}
          </el-descriptions-item>
          <el-descriptions-item span="2">
            <template slot="label">
              主要内容：
            </template>
            {{showform.content?showform.content:''}}
          </el-descriptions-item>

          <el-descriptions-item span="2">
            <template slot="label">
              工作要求：
            </template>
            {{showform.require?showform.require:''}}
          </el-descriptions-item>
          <el-descriptions-item span='2'>
            <template slot="label">
              责任科室：
            </template>
            {{showform.duty_dep_id?showform.duty_dep_id:''}}
          </el-descriptions-item>
          <el-descriptions-item span='2'>
            <template slot="label">
              参与科室：
            </template>
            {{showform.join_dep_id?showform.join_dep_id:''}}
          </el-descriptions-item>
          <el-descriptions-item span='4'>
            <template slot="label">
              具体流程概述：
            </template>
            {{showform.flow?showform.flow:''}}
          </el-descriptions-item>
          <el-descriptions-item span='4'>
            <template slot="label">
              所需资源概述：
            </template>
            {{showform.resource?showform.resource:''}}
          </el-descriptions-item>
        </el-descriptions>
      </template>
      <template v-slot:missionlist>
        <el-divider>任务情况</el-divider>
        <Button :disabled="hasLocked" type="primary" style='margin-right:5px;margin-bottom:5px;'
          @click="editorUnit('add')">发布年度计划任务</Button>
        <Button :disabled="hasLocked" type="primary" style='margin-right:5px;margin-bottom:5px;'
          @click="editorUnit('add')">发布专项专题任务</Button>
        <!-- <xy-table :list="mission_log" stripe :table-item="missionLogTable" :isPage='false'>
          <template v-slot:btns>
            <el-table-column align='center' label="操作" width="120" header-align="center">
              <template slot-scope="scope">
                <template>
                  <div>
                    <Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
                      @click="checkUnits(scope.row.id,'show')">查看</Button>
                  </div>
                  <div>
                    <Button type="primary" :disabled="hasLocked" style='margin-right:5px;margin-bottom:5px;'
                      size="small" @click="editorUnit('editor',scope.row.id)">编辑</Button>
                  </div>
                  <div>
                  </div>
                </template>
              </template>
            </el-table-column>
          </template>
        </xy-table> -->
      </template>
    </xy-dialog>
  </div>
</template>

<script>
  import {
    Message
  } from 'element-ui'
  import {
    show
  } from '@/api/task/newplan.js'
  export default {
    components: {

    },
    data() {
      return {
        isShow: false,
        type: 'add',
        id: '',
        showform: {},
        form: {
          contents: '',
          missionlist: ''
        },
      }
    },
    created() {},
    methods: {

      getDetail() {
        show({
          id: this.id,
          table_name: 'new_plans',
        }).then(res => {
          this.showform = res
        })
      }
    },
    watch: {
      isShow(newVal) {
        if (newVal) {
          this.getDetail()
        } else {
          this.id = ''
          this.$refs['dialog'].reset()
        }
      },
    }

  }
</script>

<style scoped lang="scss">
  ::v-deep .contents,
  ::v-deep .missionlist {
    flex-basis: 100%;
  }

  ::v-deep .el-form>div {
    align-items: flex-start !important;
  }

  .xy-table-item {
    padding-right: 0
  }

  ::v-deep .xy-table-item-label {
    padding-right: 0
  }
</style>
