<template>
  <div>
    <div class="topbar">
      <div class="topbar_left" @click="goback">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-fanhui"></use>
        </svg>
      </div>
      <div class="topbar_middle">
        任务
      </div>
      <div class="topbar_right">
        <!-- <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-caidan"></use>
        </svg> -->
      </div>
    </div>

    <div class="taskview_toparea" :class="colortop">
      <div class="taskview_top_type" v-if="tasktype==0">临时任务</div>
      <div class="taskview_top_type" v-if="tasktype==1">客户走访</div>
      <div class="taskview_top_type" v-if="tasktype==2">稽核检查</div>
      <div class="taskview_top_delay" v-if="taskflag_dt=='未完成'">超期</div>
      <div class="taskview_top_flag">{{taskflag_dt}}</div>
    </div>
    <div class="taskview_toparea_sec" :class="colortop_sec"></div>
    <div class="taskview_toparea_thr" :class="colortop_thr"></div>

    <div class="taskview">

      <div class="taskview_main">
        <div class="taskview_info">
          <span v-if="tasktype==0">跟设计公司沟通，定好最新一季宣传画册的设计。</span>
          <span v-if="tasktype==1">了解客户上一批货的销售情况及质量反馈，并介绍本季最新产品。</span>
          <span v-if="tasktype==2">按6S标准检查车间清洁是否达标。</span>
        </div>


        <div v-if="tasktype==2">
          <div class="taskview_check_title">及格标准</div>
          <div class="taskview_check_dscrp">
            <span>地面清洁无灰尘、无垃圾、无油污、无积水、无死角。墙壁(角)清洁无污染、无蛛网、无死角。门窗明亮干净、无积灰、无污迹、无蛛网。</span>
          </div>
        </div>

        <!-- 下面是附件区域，根据实际是否有附件决定显示与否 -->
        <div style="margin-top:10px;">
          <div class="taskview_fjlist">
            <div v-if="tasktype!=2">
              <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-yasuobao"></use>
              </svg>
              新产品照片_190802_01.rar
            </div>

            <div v-if="tasktype==2">
              <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-tupian"></use>
              </svg>
              及格标准图片1.jpg
            </div>

            <div class="taskview_fjsize">
              <span v-if="tasktype!=2">30.2M</span>
              <span v-if="tasktype==2">1.4M</span>
            </div>

          </div>

          <div class="taskview_fjlist">
            <div v-if="tasktype!=2">
              <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-yasuobao"></use>
              </svg>
              新产品照片_190802_02.rar
            </div>

            <div v-if="tasktype==2">
              <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-tupian"></use>
              </svg>
              及格标准图片2.jpg
            </div>

            <div class="taskview_fjsize">
              <span v-if="tasktype!=2">30.2M</span>
              <span v-if="tasktype==2">1.4M</span>
            </div>

          </div>
        </div>

        <!-- 客户信息 -->
        <div v-if="tasktype==1">

          <div class="liubai_dt"></div>
          <div class="taskview_flex">
            <div class="taskview_title">客户</div>
            <div class="taskview_item">红岸家私城</div>
          </div>

          <div class="taskview_flex">
            <div class="taskview_title">联系人</div>
            <div class="taskview_item">章北海</div>

          </div>

          <div class="taskview_flex">
            <div class="taskview_title">电话</div>
            <div class="taskview_item">13600138779</div>
            <div class="taskview_pzbtn">
              <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-dianhua"></use>
              </svg>
            </div>
          </div>

          <div class="taskview_flex">
            <div class="taskview_title">地址</div>
            <div class="taskview_item">佛山市佛山大道189号</div>
            <div class="taskview_pzbtn">
              <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-icon_daohang-copy"></use>
              </svg>
            </div>
          </div>


          <div class="taskview_flex">
            <div class="taskview_title">走访类型</div>
            <div class="taskview_item">电话回访</div>
          </div>
        </div>


        <div class="liubai_dt"></div>

        <div class="taskview_flex">
          <div class="taskview_title">任务人</div>
          <div class="taskview_item">张小千</div>
        </div>


        <div class="taskview_flex">
          <div class="taskview_title">时间</div>
          <div class="taskview_item">8月2日 09:00-12:00</div>
        </div>

        <div class="taskview_flex" v-if="taskflag_dt=='未完成'">
          <div class="taskview_title">提醒</div>
          <div class="taskview_item">提前30分钟</div>
          <div class="taskview_pzbtn">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-iconfontjiantou2"></use>
            </svg>
          </div>
        </div>

        <div class="taskview_flex" v-if="taskflag_dt!='未完成'" style="align-items: center">
          <div class="taskview_title">完成时间</div>
          <div class="taskview_item">8月2日 16:28</div>
          <div class="taskview_finish_delay">超期</div>
        </div>


        <div class="taskview_flex" v-if="taskflag_dt!='未完成'">
          <div class="taskview_title">
            <span v-if="tasktype!=2">任务汇报</span>
            <span v-if="tasktype==2">检查结果</span>
          </div>
          <div class="taskview_item">
            <span v-if="tasktype==0">已沟通好设计方案，详情见附件</span>
            <span v-if="tasktype==1">已电话回访客户，销售情况及质量都比较理想，并对我司新一季产品感兴趣。</span>
            <span v-if="tasktype==2">合格</span>
          </div>
        </div>

        <div class="taskview_fjlist" v-if="taskflag_dt!='未完成'">
          <div v-if="tasktype==0">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-tupian"></use>
            </svg>
            设计方案草图.jpg
          </div>

          <div v-if="tasktype==1">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-tupian"></use>
            </svg>
            通话记录截图.jpg
          </div>

          <div v-if="tasktype==2">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-tupian"></use>
            </svg>
            车间现场照片.jpg
          </div>

          <div class="taskview_fjsize">
            <span>1.4M</span>
          </div>

        </div>


        <div class="liubai_dt"></div>
        <div class="taskview_flex">
          <div class="taskview_title">验收人</div>
          <div class="taskview_item">李学朋</div>
        </div>

        <div class="taskview_flex" v-if="taskflag_dt=='已验收'">
          <div class="taskview_title">评分</div>
          <div class="taskview_item" style="font-size:22px;">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-xing1"></use>
            </svg>
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-xing1"></use>
            </svg>
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-xing1"></use>
            </svg>
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-xing"></use>
            </svg>
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-xing"></use>
            </svg>
          </div>
        </div>

        <div class="taskview_flex" v-if="taskflag_dt=='已验收'">
          <div class="taskview_title">评语</div>
          <div class="taskview_item">人在做，天在看，下次记得准时完成任务。</div>
        </div>

      </div>

    </div>

    <div class="quote_edit_btn_wrap" v-if="taskflag_dt!='已验收'">
      <div class="quote_edit_btn">
        <span v-if="taskflag_dt=='未完成'">完成任务</span>
        <span v-if="taskflag_dt=='待验收'">验收</span>
      </div>
    </div>

    <!-- 完成任务、验收任务弹出界面 -->
    <div v-if="ifresponse>0">
      <div class="taskview_mask"></div>

      <div class="taskview_response">
        <div style="display:flex;align-items: center;">
          <div style="font-size:15px;padding:0 20px;color:#888">
            <span v-if="ifresponse==2">任务验收</span>
            <span v-if="ifresponse==1">完成任务</span>
          </div>
          <div style="position: absolute;right: 20px;color: #ccc;font-size: 12px;">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-guanbi"></use>
            </svg>
          </div>
        </div>

        <!-- 评价星级 -->
        <div class="taskview_flex" style="margin-top:15px;" v-if="ifresponse==2">
          <div class="taskview_title">评分</div>
          <div class="taskview_item" style="font-size:22px;">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-xing1"></use>
            </svg>
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-xing1"></use>
            </svg>
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-xing1"></use>
            </svg>
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-xing"></use>
            </svg>
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-xing"></use>
            </svg>
          </div>
        </div>

        <!-- 评语 或 汇报 录入 -->
        <div style="width: 100%;text-align: center;">
          <textarea name="banreason" rows="5" placeholder="请填写评语" style="width: 90%;font-size: 15px;margin: 10px;"
            v-if="ifresponse==2">
            </textarea>

          <textarea name="banreason" rows="5" placeholder="请填写任务汇报" style="width: 90%;font-size: 15px;margin: 10px;"
            v-if="ifresponse==1">
            </textarea>

        </div>

        <!-- 完成任务时添加附件 -->
        <div v-if="ifresponse==1" class="taskedit_fjarea" style="padding:0 0 0 20px;color:#666">
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-fujian"></use>
          </svg>
          添加附件
        </div>

        <!-- 提交按钮 -->
        <div class="quote_edit_btn_wrap">
          <div class="quote_edit_btn">
            <span v-if="ifresponse==2">验收</span>
            <span v-if="ifresponse==1">完成</span>
          </div>
        </div>

      </div>
    </div>



  </div>
</template>
<script>
  export default {
    name: 'taskview',
    data() {
      return {
        tasktype: 2, //0-临时任务 1-客户走访 2-稽核检查
        taskflag_dt: "已验收", //未完成,待验收,已验收
        ifresponse: 0 //弹窗 0：不弹  1：完成任务界面 2：验收任务界面
      }
    },
    computed: {
      colortop: function () {
        return {
          taskview_toparea_green: this.taskflag_dt == "待验收",
          taskview_toparea_blue: this.taskflag_dt == "已验收"
        };
      },
      colortop_sec: function () {
        return {
          taskview_toparea_green_sec: this.taskflag_dt == "待验收",
          taskview_toparea_blue_sec: this.taskflag_dt == "已验收"
        };
      },
      colortop_thr: function () {
        return {
          taskview_toparea_green_thr: this.taskflag_dt == "待验收",
          taskview_toparea_blue_thr: this.taskflag_dt == "已验收"
        };
      }
    }

  }

</script>
<style>
  body {
    margin: 0;
    padding: 0;
    background-color: #fff;
    font-family: "微软雅黑";
    font-size: 14px;
  }

  .taskview_mask {
    height: 100%;
    width: 100%;
    background-color: #1d1d1d;
    opacity: 0.8;
    position: fixed;
    top: 0px;
    z-index: 9998;
  }

  .taskview_response {
    z-index: 9999;
    background-color: #ffffff;
    position: fixed;
    bottom: 0px;
    height: 220px;
    width: 100%;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    padding: 10px 0;
  }

  .topbar {
    min-height: 44px;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
    position: fixed;
    width: 100%;
    z-index: 9997;
    display: flex;
    font-size: 18px;
    align-items: center;
  }

  .topbar_left {
    flex: 0 0 20px;
    margin-left: 10px;
  }

  .topbar_middle {
    /* text-align: center; */
    padding: 0 0 0 10px;
    flex: 0 0 89%;
  }

  .topbar_right {
    flex: 0 0 20px;
    position: absolute;
    right: 10px;
  }

  .taskview_info {
    font-size: 16px;
    padding: 5px 20px;
  }

  .taskview_toparea {
    position: absolute;
    top: 44px;
    width: 100%;
    display: flex;
    color: #fff;
    background-color: #fc4e2c;
    font-size: 16px;
    font-weight: bold;
    align-items: center;
    height: 35px;
  }

  .taskview_toparea_green {
    background-color: #8dc026;
  }

  .taskview_toparea_blue {
    background-color: #46a4da;
  }

  .taskview_toparea_sec {
    position: absolute;
    top: 79px;
    height: 5px;
    background-color: #fd8e78;
    width: 100%;
  }

  .taskview_toparea_green_sec {
    background-color: #bbe26e;
  }

  .taskview_toparea_blue_sec {
    background-color: #90cef1;
  }

  .taskview_toparea_thr {
    position: absolute;
    top: 84px;
    height: 5px;
    background-color: #ffdbd4;
    width: 100%;
  }

  .taskview_toparea_green_thr {
    background-color: #e3f8b8;
  }

  .taskview_toparea_blue_thr {
    background-color: #d1edfd;
  }

  .taskview_top_type {
    padding: 0 0 0 20px;
  }

  .taskview_top_flag {
    position: absolute;
    right: 20px;
  }

  .taskview_top_delay {
    position: absolute;
    right: 80px;
    font-size: 12px;
    height: 24px;
    line-height: 24px;
    background-color: #fdd1cd;
    color: #ff6f61;
    width: 45px;
    border-radius: 15px;
    text-align: center;
  }

  .taskview_finish_delay {
    margin: 0 0 0 10px;
    font-size: 12px;
    height: 18px;
    line-height: 18px;
    background-color: #fdd1cd;
    color: #ff6f61;
    width: 40px;
    border-radius: 15px;
    text-align: center;
  }

  .taskview {
    position: absolute;
    top: 90px;
    width: 100%;
    margin-bottom: 80px;
  }

  .taskview_main {
    padding: 0px 0px;
  }

  .taskview_flex {
    display: flex;
    line-height: 25px;
    align-items: flex-start;
    padding: 0px 20px;
  }


  .taskview_title {
    font-size: 14px;
    font-weight: bold;
    flex: 0 0 60px;
    text-align: justify;
    text-align-last: justify;
  }

  .taskview_check_title {
    font-size: 14px;
    font-weight: bold;
    padding: 5px 0 0 20px;
  }

  .taskview_check_dscrp {
    color: #777;
    padding: 0 20px;
  }

  .taskview_item {
    /* flex: 0 0 80%; */
    /* border-bottom: 1px solid #e5e5e5; */
    margin: 0 0 0 10px;
    color: #777
  }

  .taskview_pzbtn {
    /* position: absolute;
    right: 20px; */
    margin-left: 20px;
    color: #ccc;
    font-size: 16px;
  }

  .taskview_date {
    position: absolute;
    right: 40px;
    color: #777
  }

  .taskview_dscrp {
    padding: 10px;
    line-height: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    margin: 5px 0 5px 10px;
    height: 100px;
    color: #777;
    width: 100%
  }

  .color_sub {
    color: #999
  }

  .quote_edit_btn_wrap {
    display: flex;
    position: fixed;
    bottom: 0;
    /* background-color: #fc4e2c; */
    width: 100%;
    z-index: 9990;
    align-items: center;
    justify-content: center;
    /* padding: 5px 0 2px 0; */
    box-shadow: 0 -1px 3px #f1f1f1;
  }

  .quote_edit_btn {
    /* background-color: #ffb732; */
    background-color: #fc4e2c;
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    padding: 8px;
    width: 100%;
  }

  .taskview_fjarea {
    margin: 10px 20px;
    color: #777
  }

  .taskview_fjlist {
    padding: 0px 0 0 20px;
    align-items: center;
    display: flex;
    font-size: 14px;
    height: 25px;
    line-height: 25px;
  }

  .taskview_fjsize {
    font-size: 14px;
    color: #aaa;
    margin-left: 10px;
  }

  .taskview_fjdel {
    font-size: 15px;
    color: #fc4e2c;
    position: absolute;
    right: 20px;
  }

  .liubai_dt {
    width: 100%;
    height: 10px;
    background-color: #f6f6f6;
    margin: 10px 0;
  }

</style>
