|  |  | 
 |  |  | <template> | 
 |  |  |    <view> | 
 |  |  |       <!-- 搜索框 --> | 
 |  |  |       <view class="status_bar"> | 
 |  |  |          <!-- 这里是状态栏 --> | 
 |  |  |       </view> | 
 |  |  |       <uni-nav-bar left-icon="left" title="规划申请单" @clickLeft="back" @clickRight="scan"  :fixed="true" | 
 |  |  |          :border="false" rightWidth="160rpx" leftWidth="160rpx" | 
 |  |  |          > | 
 |  |  |          <block slot="right"> | 
 |  |  |             <view class="city"> | 
 |  |  |                <view> | 
 |  |  |                   <text class="uni-nav-bar-text">{{user.username}}</text> | 
 |  |  |                </view> | 
 |  |  |                <uni-icons type="arrowdown" color="#333333" size="20" /> | 
 |  |  |             </view> | 
 |  |  |          </block> | 
 |  |  |        </uni-nav-bar> | 
 |  |  |       <!-- 搜索框 --> | 
 |  |  |       <view class="search-bg"> | 
 |  |  |          <uni-search-bar placeholder="客户代号/名称" bgColor="#f4f4f4"  @confirm="search" /> | 
 |  |  |          <u-search placeholder="输入" v-model="keyword" :clearabled="true" @custom="search()" @search="search()"></u-search> | 
 |  |  |       </view> | 
 |  |  |       <view> | 
 |  |  |          <!-- 客户列表 --> | 
 |  |  |          <view class="c-list" @click="getDetails(item.id)" v-for="(item,index) in csmtrList" :key="index"> | 
 |  |  |             <view class="titles"> | 
 |  |  |                <y-title :title="item.name"></y-title> | 
 |  |  |          <view class="c-list" v-for="(item,index) in csmtrList" :key="index"> | 
 |  |  |             <view class="titles" @click="getDetails(item.id)"> | 
 |  |  |                <view style="flex: 1;"> | 
 |  |  |                   <y-title :title="item.name"></y-title> | 
 |  |  |                </view> | 
 |  |  |                <uni-icons class="opt-icon" type="right" size="20" color="#b9b9b9"></uni-icons> | 
 |  |  |             </view> | 
 |  |  |             <view style="display: grid;grid-template-columns: 1fr 3fr;"> | 
 |  |  |                <view class="list-item1">客户代号</view><view class="list-item2">{{item.uuid}}</view> | 
 |  |  |                <view class="list-item1">详细地址</view><view class="list-item2">{{item.addr}}</view> | 
 |  |  |                <view class="list-item1">电话</view><view class="list-item2">{{item.tel}}</view> | 
 |  |  |                <view class="list-item1">备注</view><view class="list-item2">{{item.remarks  ? item.remarks : '--'}}</view> | 
 |  |  |                <view class="list-item1">客户类别</view><view class="list-item2">{{item.cstmrType$}}</view> | 
 |  |  |                <view class="list-item1">创建人</view><view class="list-item2">{{item.createBy$}}</view> | 
 |  |  |                <view class="list-item1">创建时间</view><view class="list-item2">{{item.createTime$}}</view> | 
 |  |  |                <view class="list-item1">ID</view><view class="list-item2">{{item.id}}</view> | 
 |  |  |                <view class="list-item1">业务员</view><view class="list-item2">{{item.userId$}}</view> | 
 |  |  |                <view class="list-item1">业务类型</view><view class="list-item2">{{item.planType$}}</view> | 
 |  |  |                <view class="list-item1">规划单号</view><view class="list-item2">{{item.uuid}}</view> | 
 |  |  |                <view class="list-item1">所需</view><view class="list-item2">{{item.planNeed$}}</view> | 
 |  |  |                <view class="list-item1">规划员</view><view class="list-item2">{{item.planner$}}</view> | 
 |  |  |                <view class="list-item1">跟踪项目</view><view class="list-item2 color-main"  | 
 |  |  |                   @click="goDetls(item.orderId)">{{item.orderId$}}</view> | 
 |  |  |                <view class="list-item1">申请日期</view><view class="list-item2">{{item.appleTime$}}</view> | 
 |  |  |                <view class="list-item1">进度</view><view class="list-item2">{{item.settle$}}</view> | 
 |  |  |                <view class="list-item1">状态</view><view class="list-item2">{{item.status$}}</view> | 
 |  |  |                <view class="list-item1">修改人</view><view class="list-item2">{{item.updateBy$}}</view> | 
 |  |  |                <view class="list-item1">关联流程</view><view class="list-item2 color-main" | 
 |  |  |                   @click="lookAssistantPlan(item.id)">查看关联流程</view> | 
 |  |  |                <view class="list-item1">主副标记</view><view class="list-item2">{{item.assistantHostSign$}}</view> | 
 |  |  |             </view> | 
 |  |  |          </view> | 
 |  |  |       </view> | 
 |  |  |       <uni-load-more :status="status" :icon-size="16" :content-text="contentText" /> | 
 |  |  |       <!-- <uni-load-more :status="status" :icon-size="16" :content-text="contentText" /> --> | 
 |  |  |       <u-empty v-if="true" icon="../../../static/image/emptyList.png" v-show="csmtrList.length <= 0" /> | 
 |  |  |       <view> | 
 |  |  |          <!-- 普通弹窗 --> | 
 |  |  |          <!-- 添加弹窗 --> | 
 |  |  |          <uni-popup ref="popup" background-color="#fff"> | 
 |  |  |             <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }"> | 
 |  |  |             <view class="popup-content"> | 
 |  |  |                <view> | 
 |  |  |                   <button v-for="item in planType" class="button btnn" type="primary" @click="add(item.value)">{{item.name}}</button> | 
 |  |  |                </view> | 
 |  |  |             </view> | 
 |  |  |          </uni-popup> | 
 |  |  |       </view> | 
 |  |  | 		 | 
 |  |  |       <view> | 
 |  |  |          <!-- 关联流程弹窗 --> | 
 |  |  |          <uni-popup ref="assistantPlan"> | 
 |  |  |             <view class="popup-bottom"> | 
 |  |  |                <view style="height: 10rpx;"></view> | 
 |  |  |                <!-- 客户列表 --> | 
 |  |  |                <view class="c-list" v-for="(item,index) in assCsmtr" :key="index"> | 
 |  |  |                   <view class="titles" @click="getDetails(item.id)"> | 
 |  |  |                      <view style="flex: 1;"> | 
 |  |  |                         <y-title :title="item.name"></y-title> | 
 |  |  |                      </view> | 
 |  |  |                      <uni-icons class="opt-icon" type="right" size="20" color="#b9b9b9"></uni-icons> | 
 |  |  |                   </view> | 
 |  |  |                   <view style="display: grid;grid-template-columns: 1fr 3fr;"> | 
 |  |  |                      <view class="list-item1">ID</view><view class="list-item2">{{item.id}}</view> | 
 |  |  |                      <view class="list-item1">业务员</view><view class="list-item2">{{item.userId$}}</view> | 
 |  |  |                      <view class="list-item1">业务类型</view><view class="list-item2">{{item.planType$}}</view> | 
 |  |  |                      <view class="list-item1">规划单号</view><view class="list-item2">{{item.uuid}}</view> | 
 |  |  |                      <view class="list-item1">所需</view><view class="list-item2">{{item.planNeed$}}</view> | 
 |  |  |                      <view class="list-item1">规划员</view><view class="list-item2">{{item.planner$}}</view> | 
 |  |  |                      <view class="list-item1">跟踪项目</view><view class="list-item2 color-main"  | 
 |  |  |                         @click="goDetls(item.orderId)">{{item.orderId$}}</view> | 
 |  |  |                      <view class="list-item1">申请日期</view><view class="list-item2">{{item.appleTime$}}</view> | 
 |  |  |                      <view class="list-item1">进度</view><view class="list-item2">{{item.settle$}}</view> | 
 |  |  |                      <view class="list-item1">状态</view><view class="list-item2">{{item.status$}}</view> | 
 |  |  |                      <view class="list-item1">修改人</view><view class="list-item2">{{item.updateBy$}}</view> | 
 |  |  |                      <!-- <view class="list-item1">关联流程</view><view class="list-item2 color-main" | 
 |  |  |                         @click="lookAssistantPlan(item.id)">查看关联流程</view> --> | 
 |  |  |                      <view class="list-item1">主副标记</view><view class="list-item2">{{item.assistantHostSign$}}</view> | 
 |  |  |                   </view> | 
 |  |  |                </view> | 
 |  |  |                <view style="height: 5rpx;"></view> | 
 |  |  |             </view> | 
 |  |  |          </uni-popup> | 
 |  |  |       </view> | 
 |  |  | 		 | 
 |  |  |       <view style="height: 5rpx;"></view> | 
 |  |  |       <view class="fxbtn"> | 
 |  |  |          <uni-icons type="plusempty" color="#fff" @click="gotoggle()" ></uni-icons> | 
 |  |  |       </view> | 
 |  |  |    </view> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | <script> | 
 |  |  |    import user from '@/pages/api/user/user.js' | 
 |  |  |    export default {  | 
 |  |  |       data() { | 
 |  |  |          return { | 
 |  |  |             keyword: '', | 
 |  |  |             user: { | 
 |  |  |                username: '', | 
 |  |  |                id: 0, | 
 |  |  |                type: 'user_id' | 
 |  |  |             }, | 
 |  |  |             falg: true, | 
 |  |  |             csmtrList: [], | 
 |  |  |             assCsmtr: [], | 
 |  |  |             last_id: '', | 
 |  |  |             reload: false, | 
 |  |  |             status: 'more', | 
 |  |  | 
 |  |  |             ] | 
 |  |  |          } | 
 |  |  |       }, | 
 |  |  |       // 新建按钮事件 | 
 |  |  |       onNavigationBarButtonTap(e) { | 
 |  |  |          this.toggle('right') | 
 |  |  |          // uni.navigateTo({ | 
 |  |  |          //    url:'/pages/business/cstmr/addCsmtr', | 
 |  |  |          // }) | 
 |  |  | 			 | 
 |  |  |       }, | 
 |  |  |       onLoad() { | 
 |  |  |           | 
 |  |  |       }, | 
 |  |  |       onShow() { | 
 |  |  |          let that = this | 
 |  |  |          uni.$on('isRefresh',function(data){ | 
 |  |  |             that.user.username = data.title | 
 |  |  |             that.user.id = data.id | 
 |  |  |             that.user.type = data.key | 
 |  |  |             that.falg = false | 
 |  |  |          }) | 
 |  |  |          if (this.falg) { | 
 |  |  |             this.getDetail() | 
 |  |  |          } | 
 |  |  |          setTimeout(()=> { | 
 |  |  |             this.getCsmtr1() | 
 |  |  |          },500) | 
 |  |  |          },50) | 
 |  |  |       }, | 
 |  |  |       onReachBottom() { | 
 |  |  |          this.status = 'more'; | 
 |  |  |          this.getCsmtr() | 
 |  |  |       }, | 
 |  |  |       methods: { | 
 |  |  |          async getDetail() { | 
 |  |  |             let res = await user.getDetail() | 
 |  |  |             if (res.code === 200) { | 
 |  |  |                this.user.username = res.data.username | 
 |  |  |                this.user.id = res.data.id | 
 |  |  |             } else if (res.code === 403) { | 
 |  |  |                this.backLogin(res) | 
 |  |  |             } | 
 |  |  |          }, | 
 |  |  |          gotoggle() { | 
 |  |  |             this.toggle('right') | 
 |  |  |          }, | 
 |  |  |          add(val) { | 
 |  |  |             let addPlan = 'addPlan' | 
 |  |  |             if (val > 1) { | 
 |  |  | 
 |  |  |          getCsmtr1(e) { | 
 |  |  |             let that = this | 
 |  |  |             that.csmtrList = [] | 
 |  |  |             uni.showLoading({}) | 
 |  |  |             let param = {curr:1,limit:4,dept_id: 0,user_id: 67} | 
 |  |  |             if (this.user.type == 'user_id') { | 
 |  |  |                param = {curr:1,limit:4,user_id: that.user.id} | 
 |  |  |             } else if(this.user.type == 'dept_id') { | 
 |  |  |                param = {curr:1,limit:4,dept_id: that.user.id} | 
 |  |  |             } else { | 
 |  |  |                param = {curr:1,limit:4} | 
 |  |  |             } | 
 |  |  |             uni.request({ | 
 |  |  |                url: that.baseUrl + '/plan/page/auth', | 
 |  |  |                header: {'token' : uni.getStorageSync('token'),}, | 
 |  |  |                data: {curr:1,limit:4,deptId:19}, | 
 |  |  |                data: param, | 
 |  |  |                method:'GET', | 
 |  |  |                success(result) { | 
 |  |  |                   if (result.statusCode ===  404) { | 
 |  |  | 
 |  |  |                      }); | 
 |  |  |                   }, 1000); | 
 |  |  |                }, | 
 |  |  |                complete() { | 
 |  |  |                   uni.hideLoading() | 
 |  |  |                } | 
 |  |  |             }) | 
 |  |  |          }, | 
 |  |  |          getCsmtr() { | 
 |  |  |             let that = this | 
 |  |  |             uni.showLoading({}) | 
 |  |  |             let param = {curr:that.curr,limit:4,dept_id: 0,user_id: 67} | 
 |  |  |             if (this.user.type == 'user_id') { | 
 |  |  |                param = {curr:that.curr,limit:4,user_id: that.user.id} | 
 |  |  |             } else if(this.user.type == 'dept_id') { | 
 |  |  |                param = {curr:that.curr,limit:4,dept_id: that.user.id} | 
 |  |  |             } else { | 
 |  |  |                param = {curr:that.curr,limit:4} | 
 |  |  |             } | 
 |  |  |             uni.request({ | 
 |  |  |                url: that.baseUrl + '/plan/page/auth', | 
 |  |  |                header: {'token' : uni.getStorageSync('token'),}, | 
 |  |  |                data: {curr:that.curr,limit:4}, | 
 |  |  |                data: param, | 
 |  |  |                method:'GET', | 
 |  |  |                success(result) { | 
 |  |  |                   if (result.statusCode ===  404) { | 
 |  |  | 
 |  |  |                      }); | 
 |  |  |                   }, 1000); | 
 |  |  |                }, | 
 |  |  |                complete() { | 
 |  |  |                   uni.hideLoading() | 
 |  |  |                } | 
 |  |  |             }) | 
 |  |  |          }, | 
 |  |  |          getDetails(id) { | 
 |  |  | 
 |  |  |                url: '/pages/business/plan/planDetails?id=' + id | 
 |  |  |             }) | 
 |  |  |          }, | 
 |  |  |          goDetls(id) { | 
 |  |  |             uni.navigateTo({ | 
 |  |  |                url: '/pages/business/saleManage/saleManageDetails?id=' + id | 
 |  |  |             }) | 
 |  |  |          }, | 
 |  |  |          lookAssistantPlan(id) { | 
 |  |  |             let _this = this | 
 |  |  |             uni.request({ | 
 |  |  |                url: `${_this.baseUrl}/plan/assistantPlan/view/auth`, | 
 |  |  |                header: {'token' : uni.getStorageSync('token')}, | 
 |  |  |                data: {hostPlanId:id}, | 
 |  |  |                success(res) { | 
 |  |  |                   res = res.data  | 
 |  |  |                   if (res.code === 200) { | 
 |  |  |                      _this.assCsmtr = res.data.records | 
 |  |  |                      if (_this.assCsmtr.length > 0) { | 
 |  |  |                         _this.$refs.assistantPlan.open('bottom') | 
 |  |  |                      } else { | 
 |  |  |                         uni.showToast({title: '无关联流程', icon: "none", position: 'center'}) | 
 |  |  |                      } | 
 |  |  | 							 | 
 |  |  |                   } | 
 |  |  |                } | 
 |  |  |             }) | 
 |  |  |          }, | 
 |  |  |          // --- | 
 |  |  |          search() { | 
 |  |  |              | 
 |  |  |          } | 
 |  |  |          }, | 
 |  |  |          back() { | 
 |  |  |             uni.navigateBack({ | 
 |  |  |             }) | 
 |  |  |          }, | 
 |  |  |          scan() { | 
 |  |  |             uni.navigateTo({ | 
 |  |  |                url: '/pages/authority/authority' | 
 |  |  |             }) | 
 |  |  |          }, | 
 |  |  |       } | 
 |  |  |    } | 
 |  |  | </script> | 
 |  |  | 
 |  |  |       margin-top: 20px; | 
 |  |  |    } | 
 |  |  |    .popup-content { | 
 |  |  |       width: 60vw; | 
 |  |  |       margin-top: 260rpx; | 
 |  |  |       display:  flex; | 
 |  |  |       align-items: center; | 
 |  |  |       justify-content: center; | 
 |  |  |       background-color: #fff; | 
 |  |  |    } | 
 |  |  |    .popup-bottom { | 
 |  |  |       height: 60vh; | 
 |  |  |       background-color: #fff; | 
 |  |  |       border-radius: 20rpx 20rpx 0 0; | 
 |  |  |    } | 
 |  |  |    .popup-height { | 
 |  |  |       display: height; | 
 |  |  | 
 |  |  |       margin-bottom: 20px; | 
 |  |  |    } | 
 |  |  |    .list-item1 { | 
 |  |  | 		 | 
 |  |  |       height: 45rpx; | 
 |  |  |       min-height: 45rpx; | 
 |  |  |       line-height: 45rpx; | 
 |  |  |       color: #909399; | 
 |  |  |       text-indent: 30rpx; | 
 |  |  |    } | 
 |  |  |    .list-item2 { | 
 |  |  |       height: 45rpx; | 
 |  |  |       min-height: 45rpx; | 
 |  |  |       line-height: 45rpx; | 
 |  |  |       color: black; | 
 |  |  |    } | 
 |  |  |    .color-main { | 
 |  |  |       color: #55aaff | 
 |  |  |    } | 
 |  |  |    .titles { | 
 |  |  |       padding-left: 10rpx; | 
 |  |  |       text-indent: 5rpx; | 
 |  |  |       margin-top: 10rpx; | 
 |  |  |       display: flex; | 
 |  |  |    } | 
 |  |  |    /* .title { | 
 |  |  |       height: 60rpx; |