<template>
  <div id="taskdetail">
    <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 id="content">
      <div class="toparea_dt" :class="colortop">
        <div class="taskcode_dt">
          FXXS1990305001
          <svg class="icon" aria-hidden="true" v-if="ifnew==1">
            <use xlink:href="#icon-ziyuan"></use>
          </svg>
        </div>
        <div class="taskflag_dt">
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-weikaishi" v-if="taskflag_dt=='待接收'"></use>
            <use xlink:href="#icon-jindu" v-if="taskflag_dt=='在进行'"></use>
            <use xlink:href="#icon-CombinedShape" v-if="taskflag_dt=='已完成'"></use>
          </svg>
          {{taskflag_dt}}
        </div>
      </div>
      <div class="taskinfo_dt">
        <div class="cust_dt">
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-kehu"></use>
          </svg>
          安吉富和家具有限公司
        </div>
      </div>
      <div class="reptel_dt">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-address"></use>
        </svg>
        <span>云天明</span>
        <span style="margin-left:10px;">13800138000</span>
      </div>
      <div class="address_dt">送货地址：广东省顺德市芙蓉中路二段115号</div>

      <!-- <div class="liubai_dt"></div> -->
      <div class="middlearea">
        <div class="taskinfo_dtflex">
          <div class="taskinfo_dttitle_dt">
            <div class="title_dt">订货日期：</div>
            <div class="taskinfo_dtitem leftsize">2019-03-10</div>
          </div>
          <div class="taskinfo_dttitle_dt">
            <div class="title_dt rightside">交货日期：</div>
            <div class="taskinfo_dtitem requiredate">2019-03-15</div>
          </div>
        </div>
        <div class="taskinfo_dtamt">
          <div class="taskinfo_dttitle_dt">
            <div class="title_dt">金额：</div>
            <div class="taskinfo_dtitem taskamt leftsize">¥3500</div>
          </div>
          <div class="taskinfo_dttitle_dt rightside">
            <div class="title_dt">结算方式：</div>
            <div class="taskinfo_dtitem">款到发货</div>
          </div>
        </div>
        <div class="taskinfo_dtflex">
          <div class="taskinfo_dttitle_dt">
            <div class="title_dt">相关号：</div>
            <div class="taskinfo_dtitem leftsize">GG99887</div>
          </div>
        </div>
      </div>

      <!-- <div class="dscrp">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-wentibuchong"></use>
        </svg>
        我是备注信息，如果没有，就不显示这一个div了。
      </div> -->

      <div class="cses-spt-detail-fj">
        <div>附件</div>

        <div class="cses-spt-detail-fj-item">
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-yasuobao"></use>
          </svg>
          唛头信息_1923179021.rar
          <span>30.2M</span>
        </div>

        <div class="cses-spt-detail-fj-item">
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-excel"></use>
          </svg>
          采购明细详细资料_1290831.xlsx
          <span>430K</span>
        </div>

        <div class="cses-spt-detail-fj-item">
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-WORD"></use>
          </svg>
          采购合同_19218319.docx
          <span>230K</span>
        </div>

        <div class="cses-spt-detail-fj-item">
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-tupian"></use>
          </svg>
          还有图片一张298372.jpg
          <span>500K</span>
        </div>
      </div>

      <div class="liubai_dt"></div>
      <div class="subtitle_dt">订单明细</div>
      <div class="taskmx_dt">
        <div id="rowmx_dt">
          <div style="display:flex;align-items:center;">
            <div>
              <div class="mxmtrl_dt">
                <svg class="icon" aria-hidden="true">
                  <use xlink:href="#icon-dian"></use>
                </svg>
                枪钉(型号AK47,配置+配置1+配置2)
                <!-- <span class="cses-spt-detail-mx-ban" v-if="taskflag_dt=='待接收'">
              <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-guanbi"></use>
              </svg>
              回复拒绝
                </span>-->
              </div>
              <div style="font-size:15px;margin: 0 0 0 25px">
                <div>要求交期：<span style="padding:0 5px">2019-03-15</span></div>
                <div style="display:flex;align-items:center;">
                  <div>回复交期：</div>
                  <div class="cses-spt-detail-mxdate">
                    2019-03-15
                    <svg class="icon" aria-hidden="true">
                      <use xlink:href="#icon-jiaohuoriqishezhi"></use>
                    </svg>
                  </div>
                </div>
              </div>
            </div>
            <div class="cses-spt-detail-mx-swtich-text">接收</div>
            <div class="cses-spt-detail-mx-swtich">
              <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-uni_icon_kaiguan_kai"></use>
              </svg>
            </div>
          </div>

          <div class="cses_spt_detail_rqdate_his">
            <div>交期变更历史</div>
            <div class="cses_spt_detail_rqdate_his_mx">
              <div>1.</div>
              <div>2019-03-14</div>
              <div>
                <svg class="icon" aria-hidden="true">
                  <use xlink:href="#icon-youjiantou"></use>
                </svg>
              </div>
              <div>2019-03-16</div>
              <div>(2019-3-12 10:30 变更)</div>
            </div>
            <div class="cses_spt_detail_rqdate_his_mx">
              <div>2.</div>
              <div>2019-03-16</div>
              <div>
                <svg class="icon" aria-hidden="true">
                  <use xlink:href="#icon-youjiantou"></use>
                </svg>
              </div>
              <div>2019-03-15</div>
              <div>(2019-3-13 14:35 变更)</div>
            </div>
          </div>

          <div class="mxqty_dt">数量：5000粒，单价：0.1元，合计500元</div>
          <div class="mxqty_dt">备注：内容是ERP推送过来的明细备注+明细备注1</div>
          <div class="mxqty_dt" v-if="taskflag_dt=='已完成'">发货：5000粒，质检合格：4980粒，不合格：20粒，收货：4980粒</div>
          <div class="cses-spt-check" v-if="taskflag_dt=='已完成'">
            <div class="cses-spt-check-title">不合格项目：破损12粒，生锈8粒</div>
            <div class="cses-spt-check-wrap">
              <div class="cses-spt-check-mx">
                <div>
                  <img src="../../assets/timg.jpg" class="check-img-responsive">
                </div>
                <div class="cses-spt-check-item">破损</div>
              </div>
              <div class="cses-spt-check-mx">
                <div>
                  <img src="../../assets/timg22.jpg" class="check-img-responsive">
                </div>
                <div class="cses-spt-check-item">生锈</div>
              </div>
            </div>
          </div>
        </div>

        <div id="rowmx_dt">
          <div style="display:flex;align-items:center;">
            <div>
              <div class="mxmtrl_dt">
                <svg class="icon" aria-hidden="true">
                  <use xlink:href="#icon-dian"></use>
                </svg>
                角码(规格AA*BB*CC,配置+配置1+配置2)
                <!-- <span class="cses-spt-detail-mx-ban cses-spt-detail-bg-color-green" v-if="taskflag_dt=='待接收'">
              <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-huifu"></use>
              </svg>
              取消拒绝
                </span>-->
              </div>
              <div style="font-size:15px;margin: 0 0 0 25px">
                <div>要求交期：<span style="padding:0 5px">2019-03-15</span></div>
                <div style="display:flex;align-items:center;">
                  <div>回复交期：</div>
                  <div class="cses-spt-detail-mxdate">
                    2019-03-15
                    <svg class="icon" aria-hidden="true">
                      <use xlink:href="#icon-jiaohuoriqishezhi"></use>
                    </svg>
                  </div>
                </div>
              </div>
            </div>
            <div class="cses-spt-detail-mx-swtich-text">接收</div>
            <div class="cses-spt-detail-mx-swtich">
              <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-uni_icon_kaiguan_guan"></use>
              </svg>
            </div>
          </div>
          <div class="mxqty_dt">数量：2000个，单价：0.5元，合计1000元</div>
          <div class="mxqty_dt">备注：内容是ERP推送过来的明细备注+明细备注1</div>
          <div class="mxqty_dt cses-spt-detail-font-color-red">拒绝原因：模具维修中，无法生产。</div>
          <div class="mxqty_dt" v-if="taskflag_dt=='已完成'">发货：2000个，质检合格：2000个，收货：2000个</div>
        </div>

        <div id="rowmx_dt">
          <div style="display:flex;align-items:center;">
            <div>
              <div class="mxmtrl_dt">
                <svg class="icon" aria-hidden="true">
                  <use xlink:href="#icon-dian"></use>
                </svg>
                滚轮(型号AFE9980,配置+配置1+配置2)
                <!-- <span class="cses-spt-detail-mx-ban" v-if="taskflag_dt=='待接收'">
              <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-guanbi"></use>
              </svg>
              回复拒绝
                </span>-->
              </div>
              <div style="font-size:15px;margin: 0 0 0 25px">
                <div>要求交期：<span style="padding:0 5px">2019-03-15</span></div>
                <div style="display:flex;align-items:center;">
                  <div>回复交期：</div>
                  <div class="cses-spt-detail-mxdate">
                    2019-03-15
                    <svg class="icon" aria-hidden="true">
                      <use xlink:href="#icon-jiaohuoriqishezhi"></use>
                    </svg>
                  </div>
                </div>
              </div>
            </div>
            <div class="cses-spt-detail-mx-swtich-text">接收</div>
            <div class="cses-spt-detail-mx-swtich">
              <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-uni_icon_kaiguan_kai"></use>
              </svg>
            </div>
          </div>
          <div class="mxqty_dt">数量：400个，单价：5元，合计2000元</div>
          <div class="mxqty_dt">备注：内容是ERP推送过来的明细备注+明细备注1</div>
          <div class="mxqty_dt" v-if="taskflag_dt=='已完成'">发货：400个，质检合格：400个，收货：400个</div>
        </div>
      </div>

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

      <div class="subtitle_dt">订单进度跟踪</div>
      <div class="jindu">
        <div>
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-buzhoutiaowancheng"></use>
          </svg>
          下单日期：2019-03-10 09:30
        </div>
        <div>
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-buzhoutiaowancheng"></use>
          </svg>
          接收时间：2019-03-10 10:05
        </div>

        <div>
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-buzhoutiaowancheng"></use>
          </svg>
          发货开单：2019-03-14 15:00
        </div>
        <div>
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-buzhoutiaowancheng"></use>
          </svg>
          发货完成：2019-03-14 15:30
        </div>

        <div>
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-buzhoutiaowancheng"></use>
          </svg>
          质检完成：2019-03-15 09:30
        </div>

        <div>
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-buzhoutiaowancheng"></use>
          </svg>
          收货完成：2019-03-15 10:30
        </div>
        <!-- <div>
          *要求完成日期：
        </div>-->
      </div>
      <!--填写拒绝理由-->
      <div class="cses-spt-mask" v-show="ifban==1"></div>
      <div class="cses-spt-ban-reason" v-show="ifban==1">
        <div class="cses-spt-ban-reason-flex">
          <div class="cses-spt-ban-reason-title">角码，2000个，交期：2019/03/15</div>
          <div class="cses-spt-ban-reason-close">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-guanbi1"></use>
            </svg>
          </div>
        </div>
        <div style="margin: 5px 0 0 20px;font-size:15px;color:#666666">快速选择拒绝原因
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-iconfontjiantou2"></use>
          </svg>
        </div>
        <div class="cses-spt-ban-reason-edit-warp">
          <textarea name="banreason" rows="5" placeholder="请填写拒绝原因" class="cses-spt-ban-reason-edit"></textarea>
        </div>
        <div style="text-align: center;">
          <div class="cses-spt-ban-reason-btn" style="display: inline-block;">确定拒绝</div>
        </div>
      </div>
    </div>

    <div class="spt-detail-btn-wrap" v-if="taskflag_dt=='待接收'">
      <div class="spt-detail-btn" v-if="ifaccept==1">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-tongyi"></use>
        </svg>
        接收
      </div>

      <div class="spt-detail-btn" v-if="ifaccept==0">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-huifu1"></use>
        </svg>
        回复
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "saletaskDetail",
    data() {
      return {
        taskflag_dt: "待接收",
        ifnew: 0,
        ifban: 1, //控制是否弹出填写拒绝原因div的开关
        ifaccept: 0 //1-全部明细同意，整单接收  0-有明细不能接收，整单退回
      };
    },
    methods: {
      goback() {
        {
          history.back();
        }
      }
    },
    computed: {
      colortop: function () {
        return {
          bgcolorred: this.taskflag_dt == "待接收",
          bgcolorgreen: this.taskflag_dt == "在进行",
          bgcolorblue: this.taskflag_dt == "已完成"
        };
      }
    }
  };

</script>

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

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

  .topbar_left {
    /* flex: 0 0 %; */
    margin-left: 10px;
  }

  .topbar_middle {
    text-align: center;
    flex: 0 0 85%;
  }

  .topbar_right {
    /* flex: 0 0 10%; */
    position: absolute;
    right: 10px;
  }

  #taskdetail {
    background-color: #fff;
  }

  #content {
    position: absolute;
    top: 44px;
    background-color: #fff;
    width: 100%;
    padding-bottom: 60px;
  }

  .toparea_dt {
    color: white;
    background-color: #fc4e2c;
    height: 80px;
    display: flex;
  }

  .bgcolorred {
    background-color: #fc4e2c;
  }

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

  .bgcolorblue {
    background-color: #1e90ff;
  }

  .taskcode_dt {
    font-size: 22px;
    font-weight: bold;
    padding: 10px 0 10px 10px;
    line-height: 30px;
  }

  .taskflag_dt {
    font-size: 18px;
    font-weight: bold;
    padding: 10px;
    line-height: 30px;
    position: absolute;
    right: 10px;
  }

  .taskinfo_dt {
    background-color: #fff;
    width: 100%;
    height: 35px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 0px;
    border-bottom-left-radius: 0px;
    position: absolute;
    top: 50px;
  }

  .cust_dt {
    font-size: 16px;
    font-weight: bold;
    padding: 10px;
  }

  .reptel_dt {
    font-size: 14px;
    font-weight: bold;
    margin: 10px 0 2px 10px;
  }

  .address_dt {
    font-size: 13px;
    margin-left: 30px;
    margin-right: 20px;
    margin-bottom: 10px;
    color: #666666;
  }

  .hyaddress_dt {
    font-size: 13px;
    margin-left: 10px;
    margin-right: 10px;
    margin-bottom: 10px;
    color: #666666;
  }

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

  .middlearea {
    margin: 10px;
    font-size: 14px;
  }

  .taskinfo_dtflex {
    display: flex;
    /* height: 60px; */
    align-items: center;
  }

  .taskinfo_dttitle_dt {
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    flex-wrap: wrap;
  }

  .title_dt {
    width: 80px;
    text-align: right;
  }

  .taskinfo_dtitem {
    font-weight: normal;
    color: #333;
  }

  .taskinfo_dtamt {
    display: flex;
  }

  .taskamt {
    font-weight: bold;
    color: #ff0000;
  }

  .leftsize {
    width: 100px;
  }

  .dscrp {
    border-radius: 10px;
    background: #f0eded;
    padding: 10px 20px;
    margin: 0 20px 10px 20px;
    font-size: 15px;
    color: #555555;
    line-height: 18px;
  }

  .subtitle_dt {
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    margin: 0 20px;
    height: 42px;
    line-height: 43px;
  }

  .jindu {
    border-top: 1px solid #f0f0f0;
    margin: 0 20px;
    font-size: 15px;
    line-height: 30px;
    padding: 10px 0;
  }

  .jindubtn {
    margin-left: 20px;
    border: 1px solid #bbb;
    padding: 0 10px;
    border-radius: 15px;
    font-size: 13px;
  }

  .taskmx_dt {
    border-top: 1px solid #f0f0f0;
  }

  #rowmx_dt {
    margin-bottom: 15px;
  }

  .mxmtrl_dt {
    margin: 5px;
    font-size: 16px;
  }

  .mxqty_dt {
    font-size: 14px;
    color: #888888;
    margin: 0 10px 3px 25px;
  }

  .spt-detail-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;
  }

  .spt-detail-btn {
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    width: 45%;
    text-align: center;
    padding: 8px;
  }

  .spt-detail-border-right {
    border-right: 1px solid #f0f0f0;
  }

  .spt-detail-btn-on {
    color: #ff7f50;
  }

  .spt-detail-icon {
    font-size: 23px;
  }

  .cses-spt-detail-mxdate {
    padding: 2px 5px;
    background-color: #f0eded;
    border-radius: 15px;
    font-size: 15px;
    width: 110px;
  }

  .cses-spt-check {
    font-size: 14px;
    background-color: #f5f5f5;
    border-radius: 15px;
    padding: 10px;
    margin: 10px 20px;
  }

  .cses-spt-check-title {
    padding: 0 0 10px 0;
  }

  .cses-spt-check-wrap {
    display: flex;
  }

  .cses-spt-check-mx {
    text-align: center;
  }

  .check-img-responsive {
    display: inline-block;
    height: auto;
    max-width: 90%;
  }

  .cses-spt-detail-mx-ban {
    position: absolute;
    right: 30px;
    background-color: #fc4e2c;
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    padding: 2px 10px;
    border-radius: 15px;
  }

  .cses-spt-detail-font-color-red {
    color: #fc4e2c;
  }

  .cses-spt-detail-bg-color-green {
    background-color: #02b310;
  }

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

  .cses-spt-ban-reason-flex {
    display: flex;
  }

  .cses-spt-ban-reason-edit-warp {
    width: 100%;
    text-align: center;
  }

  .cses-spt-ban-reason-edit {
    width: 90%;
    font-size: 15px;
    margin: 10px;
  }

  .cses-spt-ban-reason-title {
    margin: 0 0 0 20px;
    flex: 0 0 90%;
  }

  .cses-spt-ban-reason-close {
    font-size: 16px;
    color: #818181;
    position: absolute;
    right: 20px;
  }

  .cses-spt-ban-reason-btn {
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    width: 90%;
    text-align: center;
    padding: 8px;
    background-color: #fc4e2c;
    border-radius: 20px;
  }

  .cses-spt-mask {
    height: 100%;
    width: 100%;
    background-color: #1d1d1d;
    opacity: 0.5;  
    position: fixed;
    top: 0;
    z-index: 9998;
  }

  .cses-spt-detail-mx-swtich-text {
    position: absolute;
    right: 85px;
    color: #666666;
  }

  .cses-spt-detail-mx-swtich {
    position: absolute;
    right: 30px;
    font-size: 50px;
  }

  .cses-spt-detail-fj {
    margin: 10px 20px;
  }

  .cses-spt-detail-fj-item {
    font-size: 15px;
    padding: 2px;
  }

  .cses-spt-detail-fj-item span {
    font-size: 12px;
    color: #666666;
    margin-left: 10px;
  }

  .cses_spt_detail_rqdate_his {

    border-radius: 10px;
    background: #f0eded;
    padding: 5px 10px;
    margin: 5px 20px 10px 20px;
    font-size: 13px;
    color: #555555;
    line-height: 18px;
  }

  .cses_spt_detail_rqdate_his_mx {
    font-size: 12px;
    display: flex
  }

  .cses_spt_detail_rqdate_his_mx div{
    margin: 0 2px 0 0
  }

</style>
