<template>
  <div class="dailyDetails">
    <div class="dailyDetailsBox" v-if="setDailyDetailsBoxFlag">
      <!--        顶部条-->
      <div class="navBarTOP">
        <van-nav-bar class="navBar" title="日报详情" left-arrow @click-left="onClickLeft">
          <template #right>
            <div
              class="shareBtn"
              @click="clickShareFlag(-1)"
              v-if="reportTarget && source != 'share' && reportTarget.reportPostType == 'fx'">
              <van-icon name="share" />
            </div>
          </template>
        </van-nav-bar>
      </div>
      <div class="lineGrey"></div>
      <div class="lineGrey"></div>
      <div class="lineGrey"></div>
      <div class="lineGrey"></div>
      <div class="lineGrey"></div>
      <!--        主体内容-->
      <div class="container linep">
        <van-collapse v-model="activeNames" v-if="!YFQuota">
          <!-- YFQuota:应用服务平台 不显示各项指标 -->
          <van-collapse-item v-if="!GZQuota" title="拜访数据(实时)" name="7">
            <visitedRealTime
              :reportTargetAll="reportTargetAll"
              :powerGrade="powerGrade"
              :JZQuota="JZQuota"></visitedRealTime>
          </van-collapse-item>
          <van-collapse-item title="建店布机" v-if="!JZQuota && !GZQuota" name="2">
            <createStoreBJ :reportTargetAll="reportTargetAll"></createStoreBJ>
          </van-collapse-item>
          <van-collapse-item v-if="!JZQuota && !GZQuota" name="33" title="下单点数">
            <placeOrder :reportTargetAll="reportTargetAll"></placeOrder>
          </van-collapse-item>
          <van-collapse-item name="16" v-if="!JZQuota && !GZQuota" title="专业时时丽分销店下单">
            <ZYPlaceOrder :reportTargetAll="reportTargetAll"></ZYPlaceOrder>
          </van-collapse-item>
          <van-collapse-item v-if="type != 3 && type != 4" name="1" :title="saptitle">
            <performanceSAP :reportTargetAll="reportTargetAll" :JZQuota="JZQuota"></performanceSAP>
          </van-collapse-item>
          <van-collapse-item v-if="GZQuota" name="43" title="纯态之家SAP(千元)">
            <van-row style="margin-top: -10px">
              <van-col span="12"><span class="leftTitle">本月</span></van-col
              ><van-col span="12"><span class="rightTitle">本季</span></van-col>
              <van-col span="12"
                ><p>
                  业绩实际:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.gzCtzjMonthAct)
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  业绩实际:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.gzCtzjQuarterAct)
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  业绩成长率:<span class="colorbalck"
                    >{{ reportTargetAll.gzCtzjMonthGrowRate }}%</span
                  >
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  业绩成长率:<span class="colorbalck"
                    >{{ reportTargetAll.gzCtzjQuarterGrowRate }}%</span
                  >
                </p></van-col
              >
            </van-row>
          </van-collapse-item>
          <van-collapse-item v-if="GZQuota" name="42" title="商机关联的质感外墙业绩SAP(千元)">
            <van-row style="margin-top: -10px">
              <van-col span="12"><span class="leftTitle">本月</span></van-col
              ><van-col span="12"><span class="rightTitle">本季</span></van-col>
              <van-col span="12"
                ><p>
                  业绩实际:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.gzZgwqMonthAct)
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  业绩实际:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.gzZgwqQuarterAct)
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  业绩成长率:<span class="colorbalck"
                    >{{ reportTargetAll.gzZgwqMonthGrowRate }}%</span
                  >
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  业绩成长率:<span class="colorbalck"
                    >{{ reportTargetAll.gzZgwqQuarterGrowRate }}%</span
                  >
                </p></van-col
              >
            </van-row>
          </van-collapse-item>

          <van-collapse-item v-if="GZQuota" name="41" title="累计出货有效客户 ">
            <van-row>
              <van-col span="12"
                ><p>
                  全年实际:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.gzKhljYearAct)
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  全年目标:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.gzKhljYearTarget)
                  }}</span>
                </p></van-col
              >
              <van-col span="12"><p>&nbsp;</p></van-col>
              <van-col span="12"
                ><p>
                  目标达成率:<span class="colorbalck"
                    >{{ Micrometer(reportTargetAll.gzKhljSuccessRate) }}%</span
                  >
                </p></van-col
              >
            </van-row>
          </van-collapse-item>
          <van-collapse-item v-if="GZQuota" name="40" title="今日拜访">
            <van-row>
              <van-col span="12"
                ><p>
                  公装客户数:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.gzVisitCustomerNum)
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  工地数:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.gzVisitGdNum)
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  潜在客户数:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.gzVisitQzCustomerNum)
                  }}</span>
                </p></van-col
              >
            </van-row>
          </van-collapse-item>
          <van-collapse-item v-if="!JZQuota && !GZQuota" name="11" title="专业时时丽SAP(千元)">
            <ZYSAP :reportTargetAll="reportTargetAll"></ZYSAP>
          </van-collapse-item>
          <van-collapse-item v-if="!JZQuota && !GZQuota" name="29" title="瓷砖胶SAP(千元)">
            <van-row>
              <van-col span="12"><span class="leftTitle">本月业绩</span></van-col
              ><van-col span="12"><span class="rightTitle">本季业绩</span></van-col>
              <van-col span="12"
                ><p>
                  实际:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.czjSapMonthAct)
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  实际:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.czjSapQuarterAct)
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  达成率:<span class="colorbalck"
                    >{{ reportTargetAll.czjSapMonthSuccessRate }}%</span
                  >
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  达成率:<span class="colorbalck"
                    >{{ reportTargetAll.czjSapQuarterSuccessRate }}%</span
                  >
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  成长率:<span class="colorbalck">{{ reportTargetAll.czjSapMonthGrowRate }}%</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  成长率:<span class="colorbalck"
                    >{{ reportTargetAll.czjSapQuarterGrowRate }}%</span
                  >
                </p></van-col
              >
            </van-row>
          </van-collapse-item>
          <van-collapse-item name="17" v-if="!JZQuota && !GZQuota" title="超好贴分销店下单">
            <veryGoodPlaceOrder :reportTargetAll="reportTargetAll"></veryGoodPlaceOrder>
          </van-collapse-item>
          <van-collapse-item v-if="JZQuota" name="23" title="展厅上样">
            <van-row>
              <van-col span="24"
                ><p>
                  当月新增店数:<span class="colorbalck">{{
                    reportTargetAll.exhibitionHallMonthAct
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  全年实际店数:<span class="colorbalck"
                    >{{ Micrometer(reportTargetAll.exhibitionHallYearAct) }}%</span
                  >
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  全年达成进度率:<span class="colorbalck"
                    >{{ reportTargetAll.exhibitionHallYearRate }}%</span
                  >
                </p></van-col
              >
            </van-row>
          </van-collapse-item>
          <van-collapse-item v-if="JZQuota" name="22" title="基材粉料过账(千元)">
            <van-row>
              <van-col span="12"><span class="leftTitle">本月实际</span></van-col>
              <van-col span="12"><span class="rightTitle">本季实际</span></van-col>
              <van-col span="12"
                ><p>
                  客户数:<span class="colorbalck">{{ reportTargetAll.jcPostCustomerMonth }}</span>
                </p>
              </van-col>
              <van-col span="12"
                ><p>
                  客户数:<span class="colorbalck">{{ reportTargetAll.jcPostCustomerQuarter }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  下单数(包):<span class="colorbalck">{{
                    reportTargetAll.jcPostOrderNumMonth
                  }}</span>
                </p>
              </van-col>
              <van-col span="12"
                ><p>
                  下单数(包):<span class="colorbalck">{{
                    reportTargetAll.jcPostOrderNumQuarter
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  下单销售额:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.jcPostOrderPriceMonth)
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  下单销售额:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.jcPostOrderPriceQuarter)
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  下单率:<span class="colorbalck">{{ reportTargetAll.jcPostOrderRateMonth }}%</span>
                </p>
              </van-col>
              <van-col span="12"
                ><p>
                  下单率:<span class="colorbalck"
                    >{{ reportTargetAll.jcPostOrderRateQuarter }}%</span
                  >
                </p></van-col
              >
              <van-col span="24"><span class="leftTitle">年度累计实际</span></van-col>
              <van-col span="24"
                ><p>
                  客户数:<span class="colorbalck">{{ reportTargetAll.jcPostCustomerYear }}</span>
                </p>
              </van-col>
              <van-col span="24"
                ><p>
                  下单数(包):<span class="colorbalck">{{
                    reportTargetAll.jcPostOrderNumYear
                  }}</span>
                </p>
              </van-col>
              <van-col span="24"
                ><p>
                  下单销售额:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.jcPostOrderPriceYear)
                  }}</span>
                </p></van-col
              >
              <van-col span="24"
                ><p>
                  下单率:<span class="colorbalck">{{ reportTargetAll.jcPostOrderRateYear }}%</span>
                </p>
              </van-col>
            </van-row>
          </van-collapse-item>
          <van-collapse-item v-if="JZQuota" name="21" title="魔术漆过账(千元)">
            <van-row>
              <van-col span="12"><span class="leftTitle">本月实际</span></van-col>
              <van-col span="12"><span class="rightTitle">本季实际</span></van-col>
              <van-col span="12"
                ><p>
                  客户数:<span class="colorbalck">{{ reportTargetAll.msqPostCustomerMonth }}</span>
                </p>
              </van-col>
              <van-col span="12"
                ><p>
                  客户数:<span class="colorbalck">{{
                    reportTargetAll.msqPostCustomerQuarter
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  下单销售额:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.msqPostOrderPriceMonth)
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  下单销售额:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.msqPostOrderPriceQuarter)
                  }}</span>
                </p></van-col
              >
              <van-col span="12"
                ><p>
                  下单率:<span class="colorbalck"
                    >{{ reportTargetAll.msqPostOrderRateMonth }}%</span
                  >
                </p>
              </van-col>
              <van-col span="12"
                ><p>
                  下单率:<span class="colorbalck"
                    >{{ reportTargetAll.msqPostOrderRateQuarter }}%</span
                  >
                </p></van-col
              >
              <van-col span="24"><span class="leftTitle">年度累计实际</span></van-col>
              <van-col span="24"
                ><p>
                  客户数:<span class="colorbalck">{{ reportTargetAll.msqPostCustomerYear }}</span>
                </p>
              </van-col>
              <van-col span="24"
                ><p>
                  下单销售额:<span class="colorbalck">{{
                    Micrometer(reportTargetAll.msqPostOrderPriceYear)
                  }}</span>
                </p></van-col
              >
              <van-col span="24"
                ><p>
                  下单率:<span class="colorbalck">{{ reportTargetAll.msqPostOrderRateYear }}%</span>
                </p>
              </van-col>
            </van-row>
          </van-collapse-item>
          <van-collapse-item title="今日拜访照片" name="10" v-if="reportTarget.photos">
            <div v-for="(item, index) in reportTarget.photos" :key="index">
              <p style="margin-bottom: 10px; margin-top: 0">{{ item.taskName }}</p>
              <van-row gutter="10" class="visitIMG1">
                <van-col
                  span="6"
                  style="padding-bottom: 10px"
                  @click="pviewFn(index, indexImg)"
                  v-for="(itemImg, indexImg) in item.photos"
                  :key="indexImg">
                  <img :src="itemImg.fileUrl" alt="" />
                </van-col>
              </van-row>
            </div>
          </van-collapse-item>
        </van-collapse>
        <div class="contentContainer">
          <div v-if="GZQuota">
            <p class="contentContainerTitle">今日项目跟进数</p>
            <div style="padding: 10px 0">
              <van-field readonly v-model="projectFollowNum" type="digit" />
            </div>
            <p class="contentContainerTitle">今日TUC成功报备数量</p>
            <div style="padding: 10px 0">
              <van-field readonly v-model="tucReportingSuccessNum" type="digit" />
            </div>
          </div>
          <!-- 今日未拜访原因 如果不为空则展示，为空则不展示 -->
          <div v-if="reportTarget.notVisitReason && reportTarget.notVisitReason != ''">
            <p class="contentContainerTitle">截至日报提交时间，今日拜访0家店的原因</p>
            <div style="padding: 10px 0">
              <van-field
                readonly
                v-model="reportTarget.notVisitReason"
                rows="4"
                autosize
                type="textarea" />
            </div>
          </div>
          <p class="contentContainerTitle">今日机会与挑战总结</p>
          <div style="padding: 10px 0">
            <van-field v-model="Content" rows="4" autosize readonly type="textarea" />
          </div>
          <p class="contentContainerTitle">明日工作规划</p>
          <div style="padding: 10px 0">
            <van-field v-model="Content2" rows="4" autosize readonly type="textarea" />
          </div>
        </div>
        <div
          class="contentContainer"
          v-if="reportTarget.status > 1 || reportTarget.reportRemarks != null">
          <p class="texttitle texttitledaily">
            <span class="opint"></span>
            <span v-if="reportTarget.status == 1">待审批</span>
            <span v-if="reportTarget.status == 3">审批完成</span>
            <span v-if="reportTarget.status == 2">退回重写</span>
            <span v-if="reportTarget.status == -1">过期未汇报</span>
            <span v-if="reportTarget.status > 1"><{{ ptitle }}审批></span>
          </p>
          <div style="padding: 10px 0" v-if="reportTarget.status > 1">
            <van-rate
              v-model="reportTarget.number"
              :size="25"
              readonly
              color="#ffd21e"
              void-icon="star"
              void-color="#eee" /><span class="rateText"
              >&nbsp;&nbsp;&nbsp;&nbsp;{{ reportTarget.number }}分</span
            >
          </div>
          <p class="contentContainerTitle" v-if="reportTarget.status > 1">评语</p>
          <div style="padding: 10px 0" v-if="reportTarget.status > 1">
            <van-field v-model="successContent" rows="4" autosize readonly type="textarea" />
          </div>
        </div>
        <div class="contentContainer" v-if="reportTarget.reportRemarks != null">
          <div>
            <div v-for="(item, index) in reportTarget.reportRemarks" :key="index">
              <div class="contentContainerTitle redisplay">
                <div class="nameTitle">
                  <template v-if="item.deptName">{{ item.deptName }}-</template
                  >{{ item.postName }}-{{ item.nickName }}点评
                </div>
                <div
                  class="shareBtn"
                  @click="clickShareFlag(index)"
                  v-if="reportTarget && source != 'share' && reportTarget.reportPostType == 'fx'">
                  <van-icon name="share" />
                </div>
              </div>
              <div style="padding: 10px 0">
                <van-field
                  v-model="item.remarkContent"
                  rows="4"
                  autosize
                  readonly
                  type="textarea" />
              </div>
            </div>
          </div>
        </div>
      </div>
      <br />
      <div class="contentborder" v-if="reportTarget.status == 2">
        <van-button type="info" size="small" plain class="Btn1" @click="submint"
          >重新填写</van-button
        >
      </div>
      <br />
      <br />
    </div>
    <share
      v-if="setShareFlag"
      :reportTarget="reportTarget"
      :reportId="$route.query.reportId"
      @setShareImg="setShareImg"
      @setDailyDetailsBox="setDailyDetailsBox"
      :urlList="urlList"
      :reportRemarksIndex="reportRemarksIndex"
      :checkedPlan="checkedPlan"></share>
    <!--分享图片列表 -->
    <el-dialog
      title="选择分享的内容"
      :visible.sync="shareImgFlag"
      width="90%"
      :append-to-body="true"
      :close-on-click-modal="false"
      @close="wuliaoTableClose"
      custom-class="shareImgFlag">
      <div v-if="reportTarget.photos">
        <p style="margin-bottom: 10px; margin-top: 0; display: flex">
          今日总结&明日规划<van-checkbox
            v-model="checkedPlan"
            style="margin-left: 10px"></van-checkbox>
        </p>
        <div v-for="(item, index) in reportTarget.photos" :key="index">
          <p style="margin-bottom: 10px">{{ item.taskName }}</p>
          <div class="shareVisitImg">
            <div v-for="(itemImg, indexImg) in item.photos" :key="indexImg">
              <img :src="itemImg.fileUrl" alt="" @click="selectImg(itemImg)" />
              <van-icon
                @click.stop
                name="success"
                class="activaImg"
                color="#fff"
                size="15"
                style="
                  position: absolute;
                  right: 0;
                  bottom: 0;
                  /* margin: -15px 0 0 -15px; */
                  pointer-events: none;
                  background: #2b73cf;
                  border: 2px solid #fff;
                "
                v-if="itemImg.checked" />
            </div>
          </div>
        </div>
      </div>
      <span slot="footer" class="footer-btn">
        <van-button plain type="primary" @click="shareImgFlag = false">取 消</van-button>
        <van-button type="primary" @click="confirmShare">确 定</van-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import history from '@/assets/Icon/history.png';
import { userTodayPlanNum, loginLog, getDetailById, getReportInfo } from '@/api/index';
import { ImagePreview } from 'vant';
import visitedRealTime from '@/views/componentsTarget/visitedRealTime';
import createStoreBJ from '@/views/componentsTarget/createStoreBJ';
import placeOrder from '@/views/componentsTarget/placeOrder';
import ZYPlaceOrder from '@/views/componentsTarget/ZYPlaceOrder';
import performanceSAP from '@/views/componentsTarget/performanceSAP';
import ZYSAP from '@/views/componentsTarget/ZYSAP';
import veryGoodPlaceOrder from '@/views/componentsTarget/veryGoodPlaceOrder';
import share from '@/components/share';

export default {
  name: 'daily',
  components: {
    visitedRealTime,
    createStoreBJ,
    placeOrder,
    ZYPlaceOrder,
    performanceSAP,
    ZYSAP,
    veryGoodPlaceOrder,
    share,
  },
  data() {
    return {
      show: true,
      num: 0,
      todayGoal: {},
      progressWidth: 0,
      history: history,
      imgArr: [],
      activeNames: [
        '1',
        '2',
        '3',
        '4',
        '5',
        '6',
        '7',
        '8',
        '10',
        '16',
        '17',
        '20',
        '21',
        '22',
        '23',
        '11',
        '29',
        '33',
        '40',
        '41',
        '42',
        '43',
      ],
      value: '2',
      message: '',
      powerGrade: '',
      Content: '',
      Content2: '',
      reportTargetAll: {},
      reportContents: [{ dayContent: '' }],
      reportTarget: {},
      successContent: '',
      projectFollowNum: '',
      tucReportingSuccessNum: '',
      tucUndertakingNum: '',
      imgList: [],
      type: '-1',
      JZQuota: false,
      GZQuota: false,
      YFQuota: false, //应用服务
      titlejz: '',
      saptitle: '业绩目标SAP(千元)',
      ptitle: '',
      setShareFlag: false,
      source: '',
      reportRemarksIndex: -1,
      shareImgFlag: false,
      urlList: [],
      setDailyDetailsBoxFlag: true,
      sourceType: '',
      checkedPlan: true, //今日总结&明日规划
      //
    };
  },
  created() {
    this.getDetailById();
  },
  watch: {
    $route(to, from) {
      this.powerGrade = localStorage.getItem('powerGrade');
      if (to.path == '/dailyDetails') {
        this.getDetailById();
      }
      // &&from.path=="/dailyApprovalList"
      // if(to.path=="/dailyDetails"&&from.path=="/myHistoricalDaily"){
      //   this.getDetailById()
      // }
    },
  },
  activated() {
    this.source = this.$route.query.source || '';
    this.sourceType = this.$route.query.sourceType || '';
    this.powerGrade = localStorage.getItem('powerGrade');
    this.setDailyDetailsBoxFlag = true;
    this.shareImgFlag = false;
    this.num = 0;
    this.userTodayPlanNum();
    this.setShareFlag = false;
  },
  methods: {
    setDailyDetailsBox(flag) {
      this.setDailyDetailsBoxFlag = flag;
    },
    setShareImg(flag) {
      this.setShareFlag = flag;
    },
    // 打开分享
    clickShareFlag(index = -1) {
      this.urlList = [];
      this.reportRemarksIndex = index;
      if (this.reportTarget.photos && this.reportTarget.photos.length) {
        // 重置分享图片状态
        this.reportTarget.photos.forEach((item) => {
          item.photos.forEach((val) => {
            this.$set(val, 'checked', false);
          });
        });
        // 选择分享的图片
        this.shareImgFlag = true;
      } else {
        this.setShareFlag = true;
      }
    },
    // 确认分享
    confirmShare() {
      this.reportTarget.photos.forEach((item) => {
        item.photos.forEach((val) => {
          if (val.checked) this.urlList.push(val.fileUrl);
        });
      });
      if (this.urlList.length == 0 && !this.checkedPlan) {
        this.$notify({ type: 'warning', message: '请选择分享内容！', className: 'notifyIndex' });
        return;
      }
      this.shareImgFlag = false;
      this.setShareFlag = true;
    },
    pviewFn(val, imgVal) {
      var imgList = [];
      var photos = this.reportTarget.photos[val].photos;
      for (let i = 0; i < photos.length; i++) {
        imgList.push(photos[i].fileUrl);
      }
      ImagePreview({ images: imgList, startPosition: imgVal });
    },
    submint() {
      this.$router.push({
        path: '/daily',
        query: { reportId: this.$route.query.reportId, temporaryShow: 'N' },
      });
    },
    getDetailById() {
      let loading1 = this.$toast.loading({
        duration: 0,
        message: '加载中...',
        forbidClick: true,
      });
      getDetailById({ reportId: this.$route.query.reportId }).then((res) => {
        loading1.clear();
        this.reportTargetAll = res.data.reportTargetAll;
        this.reportTarget = res.data;
        this.JZQuota = false;
        this.GZQuota = false;
        this.YFQuota = res.data.postType == 'YF' ? true : false;
        this.ptitle = res.data.pdeptName + '-' + res.data.ppostName + '-' + res.data.pnickName;
        if (res.data.postType == 'JZ') {
          this.JZQuota = true;
        } else if (res.data.postType == 'GZ') {
          this.GZQuota = true;
          this.saptitle = '公裝业绩SAP(千元)';
        } else {
          this.saptitle = '业绩目标SAP(千元)';
        }
        this.type = res.data.userType;
        if (res.data.status == 3) {
          this.successContent = res.data.successContent;
        } else {
          this.successContent = res.data.failContent;
        }
        if (res.data.reportContents.length > 0) {
          this.Content = res.data.reportContents[0].dayContent;
          if (res.data.reportContents.length > 1) {
            this.Content2 = res.data.reportContents[1].dayContent;
          } else {
            this.Content2 = '';
          }
          if (res.data.reportContents.length > 2) {
            this.projectFollowNum = res.data.reportContents[2].projectFollowNum;
            this.tucReportingSuccessNum = res.data.reportContents[3].tucReportingSuccessNum;
          }
        } else {
          this.Content = '';
          this.Content2 = '';
        }
        this.reportContents = res.data.reportContents;
        var imgList = [];
        if (res.data.photos != null) {
          for (var k = 0; k < res.data.photos.length; k++) {
            imgList.push(res.data.photos[k].fileUrl + '');
          }
        }
        this.imgList = imgList;
        if (this.sourceType == 'daily') {
          this.$nextTick(() => {
            this.clickShareFlag(-1);
          });
        }
      });
    },
    userTodayPlanNum() {
      userTodayPlanNum().then((res) => {
        if (res.code == 200) {
          this.todayGoal = res.data;
          this.progressWidth = (this.todayGoal.finishNum / this.todayGoal.planNum) * 100 + '%';
          localStorage.setItem('nickName', res.data.user.nickName);
          localStorage.setItem('storeType', res.data.user.type);
        } else {
          this.$toast.fail(res.msg);
        }
      });
    },
    onClickLeft() {
      this.$router.replace({
        path: 'myHistoricalDaily',
      });
    },
    wuliaoTableClose() {
      this.shareImgFlag = false;
    },
    // 选中的图片
    selectImg(item) {
      this.$set(item, 'checked', !item.checked);
      console.log(item);
    },
  },
};
</script>
<style scoped lang="scss">
.dailyDetails {
  position: relative;
  // background: #fff;
  width: 100%;
  height: 100%;
  .shareBtn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    .van-icon {
      color: #fff;
    }
  }
}
.container {
  margin: 10px;
}

.container .van-collapse-item {
  margin-bottom: 10px;
  border-radius: 6px;
  overflow: hidden;
}

.linep p {
  margin: 6px 0 0 0;
  font-size: 14px;
  color: #666;
}

.linep .texttitle {
  color: #0057ba;
  position: relative;
  padding-left: 10px;
}

.linep .texttitledaily {
  color: #000;
  position: relative;
  padding-left: 10px;
}

.linep .texttitle2 {
  padding-left: 0;
}
.linep .texttitledaily .opint {
  position: absolute;
  left: 0px;
  top: 6px;
  margin-right: 6px;
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 10px;
  background-color: #0057ba;
}

.leftTitle {
  background-color: #74a4d9;
  color: #fff;
  display: inline-block;
  padding: 0 4px;
  border-radius: 2px;
}

.rightTitle {
  background-color: #e7b4bb;
  color: #fff;
  display: inline-block;
  padding: 0 4px;
  border-radius: 2px;
}
.redisplay {
  display: flex;
  align-items: center;
  justify-content: space-between;
  .nameTitle {
    flex: 1;
  }
}
</style>
<style lang="scss">
.linep .van-cell__title {
  color: #1e5398;
  font-weight: 500;
}

.linep .contentContainer {
  background-color: white;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 10px;
}

.linep .contentContainer .contentContainerTitle {
  color: #222;
}

.linep .contentContainer .contentContainerTitle span {
  font-size: 12px;
  color: #666;
}

.linep .contentContainer .van-field__control {
  background-color: #ebf4ff;
  padding: 10px;
  border-radius: 8px;
}

.linep .contentContainer .van-cell {
  padding: 0;
}

.colorbalck {
  color: #333;
}
.visitIMG1 img {
  display: block;
  width: 100%;
  height: 75px;
  border-radius: 6px;
}
.el-dialog__wrapper {
  z-index: 9999 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.5) !important;
  .shareImgFlag {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 70%;
    margin-top: 0 !important;
    .el-dialog__header {
      height: 40px;
      display: flex;
      justify-content: right;
      .el-dialog__headerbtn {
        position: static !important;
      }
    }
    .el-dialog__body {
      padding: 30px 20px !important;
      overflow-y: auto;
      flex: 1;
    }
    .cell {
      font-size: 12px;
    }
    .footer-btn {
      display: flex;
      justify-content: space-around;
    }
  }
}
.shareImgFlag {
  .shareVisitImg {
    display: flex;
    flex-wrap: wrap;
    div {
      width: 22%;
      height: 80px;
      margin-right: 3%;
      margin-top: 10px;
      position: relative;
      img {
        width: 100%;
        height: 100%;
      }
    }
  }
  .el-dialog__header {
    display: flex;
    .el-dialog__title {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
}
.notifyIndex {
  z-index: 999999 !important;
}
</style>
