Pārlūkot izejas kodu

计划外列表页面刷新优化

zhujindu 10 mēneši atpakaļ
vecāks
revīzija
043bf4acd1
1 mainītis faili ar 318 papildinājumiem un 306 dzēšanām
  1. 318 306
      src/views/deviceOutside/index.vue

+ 318 - 306
src/views/deviceOutside/index.vue

@@ -26,328 +26,335 @@
     </div>
     <!--        主体内容-->
     <div class="container content" id="content" style="margin-top: 144px" @touchmove="handleTouch">
-      <van-list
-        class="myList"
-        v-model="loading"
-        :finished="finished"
-        finished-text="--已经到底了--"
-        @load="onLoad">
-        <div class="cellcontent" v-for="(item, index) in list" :key="index">
-          <van-cell>
-            <div class="card">
-              <div class="title titlero">
-                <span @click="goOtherSystem(item)" :style="setStroeNameStyle(item)">
-                  <span>{{ item.storeName }}</span>
-                  (<span>{{ item.storeCode }}</span
-                  >)
-                </span>
-                <span class="btn" :data-clipboard-text="item.storeCode">
-                  <van-icon
-                    :name="paste"
-                    color="#ee0a24"
-                    size="20"
-                    style="top: 6px; margin-left: 4px" />
-                </span>
-                <!-- "approvalStatus": 1:已结案;0:未结案, -->
-                <!-- "processApprovalStatus": 审批状态(0=未提交,1=已提交待审核,2=审批通过,3=审批拒绝) -->
-                <template v-if="item.approvalStatus == 0">
-                  <span class="statusIcon submit" v-if="item.processApprovalStatus == 1"
-                    >已提交</span
-                  >
-                  <span class="statusIcon noSubmit" v-if="item.processApprovalStatus == 0"
-                    >未提交</span
-                  >
-                </template>
-              </div>
-              <div class="info" style="position: relative">
-                联系人:{{ item.contactName }}
-                <div style="position: absolute; bottom: 0px; right: 0px">
+      <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
+        <van-list
+          class="myList"
+          v-model="loading"
+          :finished="finished"
+          finished-text="--已经到底了--"
+          @load="onLoad">
+          <div class="cellcontent" v-for="(item, index) in list" :key="index">
+            <van-cell>
+              <div class="card">
+                <div class="title titlero">
+                  <span @click="goOtherSystem(item)" :style="setStroeNameStyle(item)">
+                    <span>{{ item.storeName }}</span>
+                    (<span>{{ item.storeCode }}</span
+                    >)
+                  </span>
+                  <span class="btn" :data-clipboard-text="item.storeCode">
+                    <van-icon
+                      :name="paste"
+                      color="#ee0a24"
+                      size="20"
+                      style="top: 6px; margin-left: 4px" />
+                  </span>
+                  <!-- "approvalStatus": 1:已结案;0:未结案, -->
+                  <!-- "processApprovalStatus": 审批状态(0=未提交,1=已提交待审核,2=审批通过,3=审批拒绝) -->
+                  <template v-if="item.approvalStatus == 0">
+                    <span class="statusIcon submit" v-if="item.processApprovalStatus == 1"
+                      >已提交</span
+                    >
+                    <span class="statusIcon noSubmit" v-if="item.processApprovalStatus == 0"
+                      >未提交</span
+                    >
+                  </template>
+                </div>
+                <div class="info" style="position: relative">
+                  联系人:{{ item.contactName }}
+                  <div style="position: absolute; bottom: 0px; right: 0px">
+                    <el-popover
+                      popper-class="zpover zpover6"
+                      placement="bottom-start"
+                      trigger="click">
+                      <div>
+                        <p>
+                          本店{{ timeData }}下单SKU数:<a
+                            @click="linkList(item)"
+                            style="text-decoration: underline"
+                            >点击查看详情</a
+                          >
+                        </p>
+                      </div>
+                      <div
+                        class="visitStoreIco"
+                        v-if="item.storeLabels.zysslNums"
+                        style="background-color: #fff; position: relative"
+                        slot="reference">
+                        <p
+                          style="
+                            width: 100%;
+                            position: absolute;
+                            z-index: 1;
+                            top: 0.2px;
+                            width: 22px;
+                            margin: 0;
+                            margin-left: 3.6px;
+                            text-align: center;
+                            font-size: 12px;
+                          ">
+                          {{ item.storeLabels.zysslNums }}
+                        </p>
+                        <van-icon :name="ord" size="26" />
+                      </div>
+                    </el-popover>
+                    <el-popover
+                      popper-class="zpover zpover5"
+                      placement="bottom"
+                      width="200"
+                      trigger="click">
+                      <div v-if="item.storeLabels">
+                        <p>已参加:</p>
+                        <p v-for="tt in (item.storeLabels.targetOne + '').split(';')">
+                          {{ tt }}
+                        </p>
+                      </div>
+                      <div
+                        class="visitStoreIco"
+                        v-if="item.storeLabels.targetOne"
+                        style="background-color: #fff"
+                        slot="reference">
+                        <van-icon :name="targetOne" size="26" />
+                      </div>
+                    </el-popover>
+                    <el-popover
+                      popper-class="zpover"
+                      placement="bottom"
+                      width="120"
+                      trigger="click"
+                      content="调色机5天未联网">
+                      <div
+                        v-if="item.storeLabels.ccmOffline"
+                        class="visitStoreIco"
+                        style="background-color: #fff"
+                        slot="reference">
+                        <van-icon :name="Network" size="26" />
+                      </div>
+                    </el-popover>
+                    <el-popover
+                      popper-class="zpover"
+                      placement="bottom"
+                      width="200"
+                      trigger="click"
+                      content="同城店近60天未下单">
+                      <div
+                        v-if="item.storeLabels.fxNoOrder"
+                        class="visitStoreIco"
+                        style="background-color: #fff"
+                        slot="reference">
+                        <van-icon :name="order60" size="26" />
+                      </div>
+                    </el-popover>
+                    <el-popover
+                      popper-class="zpover"
+                      placement="bottom"
+                      width="200"
+                      trigger="click"
+                      content="金牌店近30天未下单">
+                      <div
+                        v-if="item.storeLabels.noOrder"
+                        class="visitStoreIco"
+                        style="background-color: #fff"
+                        slot="reference">
+                        <van-icon :name="order" size="26" />
+                      </div>
+                    </el-popover>
+                    <el-popover
+                      popper-class="zpover"
+                      placement="bottom"
+                      width="200"
+                      trigger="click"
+                      content="本店本月进过专业时时丽">
+                      <div
+                        class="visitStoreIco"
+                        v-if="item.storeLabels.zyssl"
+                        style="background-color: #ed5c68"
+                        slot="reference">
+                        专
+                      </div>
+                    </el-popover>
+                    <el-popover
+                      popper-class="zpover zpover1"
+                      placement="bottom"
+                      width="200"
+                      trigger="click"
+                      content="本店本月进过超好贴">
+                      <div
+                        v-if="item.storeLabels.chtczj"
+                        class="visitStoreIco"
+                        style="background-color: #0057ba"
+                        slot="reference">
+                        超
+                      </div>
+                    </el-popover>
+                    <el-popover
+                      placement="bottom"
+                      popper-class="zpover zpover1 zpover1sb"
+                      :disabled="!item.userVisitTimesMap"
+                      trigger="click">
+                      <div
+                        v-if="item.storeLabels.visitTimes && item.storeLabels.visitTimes > 0"
+                        class="visitStoreIco"
+                        slot="reference"
+                        style="background-color: #fff; position: relative">
+                        <p
+                          style="
+                            width: 100%;
+                            position: absolute;
+                            z-index: 10;
+                            top: -2px;
+                            margin: 0;
+                            text-align: center;
+                            font-size: 12px;
+                          ">
+                          {{ item.storeLabels.visitTimes }}
+                        </p>
+                        <van-icon :name="ordernum" size="26" />
+                      </div>
+                      <el-table :data="item.userVisitTimesMap" border max-height="180px">
+                        <el-table-column label="业务员" prop="userName" />
+                        <el-table-column label="拜访次数" prop="visitTimes" width="110px" />
+                      </el-table>
+                    </el-popover>
+                  </div>
+                </div>
+                <div class="info">
+                  类型:{{ item.storeCategory }}&nbsp;
                   <el-popover
                     popper-class="zpover zpover6"
                     placement="bottom-start"
                     trigger="click">
                     <div>
                       <p>
-                        本店{{ timeData }}下单SKU数:<a
-                          @click="linkList(item)"
-                          style="text-decoration: underline"
-                          >点击查看详情</a
-                        >
-                      </p>
-                    </div>
-                    <div
-                      class="visitStoreIco"
-                      v-if="item.storeLabels.zysslNums"
-                      style="background-color: #fff; position: relative"
-                      slot="reference">
-                      <p
-                        style="
-                          width: 100%;
-                          position: absolute;
-                          z-index: 1;
-                          top: 0.2px;
-                          width: 22px;
-                          margin: 0;
-                          margin-left: 3.6px;
-                          text-align: center;
-                          font-size: 12px;
-                        ">
-                        {{ item.storeLabels.zysslNums }}
+                        本店经营品项指导:
+                        <a @click="linkimg(item)" style="text-decoration: underline">点击查看</a>
                       </p>
-                      <van-icon :name="ord" size="26" />
                     </div>
+                    <van-icon name="question-o" size="18" slot="reference" />
                   </el-popover>
-                  <el-popover
-                    popper-class="zpover zpover5"
-                    placement="bottom"
-                    width="200"
-                    trigger="click">
-                    <div v-if="item.storeLabels">
-                      <p>已参加:</p>
-                      <p v-for="tt in (item.storeLabels.targetOne + '').split(';')">
-                        {{ tt }}
-                      </p>
-                    </div>
-                    <div
-                      class="visitStoreIco"
-                      v-if="item.storeLabels.targetOne"
-                      style="background-color: #fff"
-                      slot="reference">
-                      <van-icon :name="targetOne" size="26" />
-                    </div>
-                  </el-popover>
-                  <el-popover
-                    popper-class="zpover"
-                    placement="bottom"
-                    width="120"
-                    trigger="click"
-                    content="调色机5天未联网">
-                    <div
-                      v-if="item.storeLabels.ccmOffline"
-                      class="visitStoreIco"
-                      style="background-color: #fff"
-                      slot="reference">
-                      <van-icon :name="Network" size="26" />
-                    </div>
-                  </el-popover>
-                  <el-popover
-                    popper-class="zpover"
-                    placement="bottom"
-                    width="200"
-                    trigger="click"
-                    content="同城店近60天未下单">
-                    <div
-                      v-if="item.storeLabels.fxNoOrder"
-                      class="visitStoreIco"
-                      style="background-color: #fff"
-                      slot="reference">
-                      <van-icon :name="order60" size="26" />
-                    </div>
-                  </el-popover>
-                  <el-popover
-                    popper-class="zpover"
-                    placement="bottom"
-                    width="200"
-                    trigger="click"
-                    content="金牌店近30天未下单">
-                    <div
-                      v-if="item.storeLabels.noOrder"
-                      class="visitStoreIco"
-                      style="background-color: #fff"
-                      slot="reference">
-                      <van-icon :name="order" size="26" />
-                    </div>
-                  </el-popover>
-                  <el-popover
-                    popper-class="zpover"
-                    placement="bottom"
-                    width="200"
-                    trigger="click"
-                    content="本店本月进过专业时时丽">
-                    <div
-                      class="visitStoreIco"
-                      v-if="item.storeLabels.zyssl"
-                      style="background-color: #ed5c68"
-                      slot="reference">
-                      专
-                    </div>
-                  </el-popover>
-                  <el-popover
-                    popper-class="zpover zpover1"
-                    placement="bottom"
-                    width="200"
-                    trigger="click"
-                    content="本店本月进过超好贴">
-                    <div
-                      v-if="item.storeLabels.chtczj"
-                      class="visitStoreIco"
-                      style="background-color: #0057ba"
-                      slot="reference">
-                      超
-                    </div>
-                  </el-popover>
-                  <el-popover
-                    placement="bottom"
-                    popper-class="zpover zpover1 zpover1sb"
-                    :disabled="!item.userVisitTimesMap"
-                    trigger="click">
+                </div>
+                <div class="info" v-if="item.telephone" @click="buryingPointFn(item)">
+                  联系电话:<a
+                    style="color: #0057ba; font-weight: bold; text-decoration: underline"
+                    :href="'tel:' + item.telephone"
+                    >{{ item.telephone }}<van-icon name="phone"
+                  /></a>
+                </div>
+                <div class="info">
+                  地址:{{ item.addressLine }}
+                  <img
+                    v-if="item.storeLonExist"
+                    style="width: 36px"
+                    :src="sbpmdh"
+                    @click="linkapp(item)" />
+                </div>
+                <!-- 分销店 -->
+                <template
+                  v-if="
+                    item.sfaStoreType &&
+                    item.sfaStoreType.type == 'fxd' &&
+                    item.sfaStoreChainsContactList
+                  ">
+                  <div class="info" v-if="typeShow">
+                    经销商:
                     <div
-                      v-if="item.storeLabels.visitTimes && item.storeLabels.visitTimes > 0"
-                      class="visitStoreIco"
-                      slot="reference"
-                      style="background-color: #fff; position: relative">
-                      <p
-                        style="
-                          width: 100%;
-                          position: absolute;
-                          z-index: 10;
-                          top: -2px;
-                          margin: 0;
-                          text-align: center;
-                          font-size: 12px;
-                        ">
-                        {{ item.storeLabels.visitTimes }}
-                      </p>
-                      <van-icon :name="ordernum" size="26" />
+                      class="TCFXListItem"
+                      v-for="(item, index) in item.sfaStoreChainsContactList">
+                      <el-popover
+                        popper-class="zpover zpoverStoreztype"
+                        placement="bottom-start"
+                        trigger="click">
+                        <div>
+                          <div>{{ item.chainCode }}</div>
+                          <div>{{ item.chainName }}</div>
+                        </div>
+                        <div slot="reference" :key="index">
+                          {{ item.categoryDescribe }}
+                        </div>
+                      </el-popover>
                     </div>
-                    <el-table :data="item.userVisitTimesMap" border max-height="180px">
-                      <el-table-column label="业务员" prop="userName" />
-                      <el-table-column label="拜访次数" prop="visitTimes" width="110px" />
-                    </el-table>
-                  </el-popover>
-                </div>
-              </div>
-              <div class="info">
-                类型:{{ item.storeCategory }}&nbsp;
-                <el-popover popper-class="zpover zpover6" placement="bottom-start" trigger="click">
-                  <div>
-                    <p>
-                      本店经营品项指导:
-                      <a @click="linkimg(item)" style="text-decoration: underline">点击查看</a>
-                    </p>
                   </div>
-                  <van-icon name="question-o" size="18" slot="reference" />
-                </el-popover>
+                </template>
+                <template v-else>
+                  <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
+                </template>
+                <!-- storeLonExist 门店是否存在经纬度 字段false=不显示导航和距离,true=显示 -->
+                <div class="info" v-if="item.storeLonExist">
+                  距离:{{ Micrometer(item.distance) }}m
+                </div>
               </div>
-              <div class="info" v-if="item.telephone" @click="buryingPointFn(item)">
-                联系电话:<a
-                  style="color: #0057ba; font-weight: bold; text-decoration: underline"
-                  :href="'tel:' + item.telephone"
-                  >{{ item.telephone }}<van-icon name="phone"
-                /></a>
+              <div
+                class="statstext"
+                v-if="item.stateString == '未拜访'"
+                style="background-color: #ed5c68">
+                未拜访
               </div>
-              <div class="info">
-                地址:{{ item.addressLine }}
-                <img
-                  v-if="item.storeLonExist"
-                  style="width: 36px"
-                  :src="sbpmdh"
-                  @click="linkapp(item)" />
+              <div
+                class="statstext"
+                v-if="item.stateString == '拜访中'"
+                style="background-color: white">
+                <van-icon :name="times" color="#ee0a24" size="32" />
               </div>
-              <!-- 分销店 -->
-              <template
-                v-if="
-                  item.sfaStoreType &&
-                  item.sfaStoreType.type == 'fxd' &&
-                  item.sfaStoreChainsContactList
-                ">
-                <div class="info" v-if="typeShow">
-                  经销商:
-                  <div class="TCFXListItem" v-for="(item, index) in item.sfaStoreChainsContactList">
-                    <el-popover
-                      popper-class="zpover zpoverStoreztype"
-                      placement="bottom-start"
-                      trigger="click">
-                      <div>
-                        <div>{{ item.chainCode }}</div>
-                        <div>{{ item.chainName }}</div>
-                      </div>
-                      <div slot="reference" :key="index">
-                        {{ item.categoryDescribe }}
-                      </div>
-                    </el-popover>
-                  </div>
-                </div>
-              </template>
-              <template v-else>
-                <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
-              </template>
-              <!-- storeLonExist 门店是否存在经纬度 字段false=不显示导航和距离,true=显示 -->
-              <div class="info" v-if="item.storeLonExist">
-                距离:{{ Micrometer(item.distance) }}m
+              <div class="statstext" v-if="item.stateString == '已拜访'">已拜访</div>
+              <div class="btnbox">
+                <van-row>
+                  <van-col
+                    span="5"
+                    v-if="item.stateString != '已拜访' && customerVisits"
+                    @click="storeVisit(item)">
+                    <img :src="call" style="margin: 0 auto; height: 18px; display: block" />
+                    <p style="text-align: center; margin: 0; font-size: 12px">进入拜访</p>
+                  </van-col>
+                  <van-col
+                    span="5"
+                    v-if="item.storeCategory == '公装经销商'"
+                    @click="projectOutVisit(item)">
+                    <img :src="xmgj" style="margin: 0 auto; height: 18px; display: block" />
+                    <p style="text-align: center; margin: 0; font-size: 12px">项目跟进</p>
+                  </van-col>
+                  <van-col
+                    span="5"
+                    v-if="
+                      item.stateString != '已拜访' &&
+                      item.storeCategory != '公装经销商' &&
+                      customerVisits
+                    "
+                    @click="abnormalVisit(item)">
+                    <img :src="yichang" style="margin: 0 auto; height: 18px; display: block" />
+                    <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
+                      异常拜访
+                    </p>
+                  </van-col>
+                  <van-col span="4" v-if="item.showOrderButton" @click="orderFn(item)">
+                    <img :src="xiadan" style="margin: 0 auto; height: 18px; display: block" />
+                    <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
+                      去下单
+                    </p>
+                  </van-col>
+                  <van-col span="5" v-if="item.stateString == '已拜访'" @click="Visit(item)">
+                    <img :src="bfxx" style="margin: 0 auto; height: 18px; display: block" />
+                    <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
+                      拜访信息
+                    </p>
+                  </van-col>
+                  <van-col span="5" @click="visitFn(item)">
+                    <img :src="kehuxinxi" style="margin: 0 auto; width: 18px; display: block" />
+                    <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
+                      客户信息
+                    </p>
+                  </van-col>
+                  <van-col span="5" v-if="tabVal == 1" @click="storeJoinVisit(item, index)">
+                    <img :src="jiarujihua" style="margin: 0 auto; height: 18px; display: block" />
+                    <p style="text-align: center; margin: 0; font-size: 12px">加入计划内</p>
+                  </van-col>
+                </van-row>
               </div>
-            </div>
-            <div
-              class="statstext"
-              v-if="item.stateString == '未拜访'"
-              style="background-color: #ed5c68">
-              未拜访
-            </div>
-            <div
-              class="statstext"
-              v-if="item.stateString == '拜访中'"
-              style="background-color: white">
-              <van-icon :name="times" color="#ee0a24" size="32" />
-            </div>
-            <div class="statstext" v-if="item.stateString == '已拜访'">已拜访</div>
-            <div class="btnbox">
-              <van-row>
-                <van-col
-                  span="5"
-                  v-if="item.stateString != '已拜访' && customerVisits"
-                  @click="storeVisit(item)">
-                  <img :src="call" style="margin: 0 auto; height: 18px; display: block" />
-                  <p style="text-align: center; margin: 0; font-size: 12px">进入拜访</p>
-                </van-col>
-                <van-col
-                  span="5"
-                  v-if="item.storeCategory == '公装经销商'"
-                  @click="projectOutVisit(item)">
-                  <img :src="xmgj" style="margin: 0 auto; height: 18px; display: block" />
-                  <p style="text-align: center; margin: 0; font-size: 12px">项目跟进</p>
-                </van-col>
-                <van-col
-                  span="5"
-                  v-if="
-                    item.stateString != '已拜访' &&
-                    item.storeCategory != '公装经销商' &&
-                    customerVisits
-                  "
-                  @click="abnormalVisit(item)">
-                  <img :src="yichang" style="margin: 0 auto; height: 18px; display: block" />
-                  <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
-                    异常拜访
-                  </p>
-                </van-col>
-                <van-col span="4" v-if="item.showOrderButton" @click="orderFn(item)">
-                  <img :src="xiadan" style="margin: 0 auto; height: 18px; display: block" />
-                  <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
-                    去下单
-                  </p>
-                </van-col>
-                <van-col span="5" v-if="item.stateString == '已拜访'" @click="Visit(item)">
-                  <img :src="bfxx" style="margin: 0 auto; height: 18px; display: block" />
-                  <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
-                    拜访信息
-                  </p>
-                </van-col>
-                <van-col span="5" @click="visitFn(item)">
-                  <img :src="kehuxinxi" style="margin: 0 auto; width: 18px; display: block" />
-                  <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
-                    客户信息
-                  </p>
-                </van-col>
-                <van-col span="5" v-if="tabVal == 1" @click="storeJoinVisit(item, index)">
-                  <img :src="jiarujihua" style="margin: 0 auto; height: 18px; display: block" />
-                  <p style="text-align: center; margin: 0; font-size: 12px">加入计划内</p>
-                </van-col>
-              </van-row>
-            </div>
-          </van-cell>
-          <div class="lineGrey"></div>
-        </div>
-        <van-empty v-if="list.length == 0" />
-      </van-list>
+            </van-cell>
+            <div class="lineGrey"></div>
+          </div>
+          <van-empty v-if="list.length == 0" />
+        </van-list>
+      </van-pull-refresh>
     </div>
     <van-popup v-model="showPicker" position="bottom" class="textsize">
       <van-row
@@ -658,6 +665,7 @@ export default {
       timeData: '',
       customerVisits: true,
       objectPath: '',
+      isLoading: false,
     };
   },
   watch: {
@@ -802,6 +810,10 @@ export default {
     );
   },
   methods: {
+    onRefresh() {
+      this.onSearch();
+      this.isLoading = false;
+    },
     handleTouch(e) {
       e._isScroller = true;
     },