Bladeren bron

客户编辑

shengxuefei 4 jaren geleden
bovenliggende
commit
2fbd776ee7

+ 9 - 0
src/common/api/loginApi.js

@@ -265,4 +265,13 @@ export function CheckSaClientRepeat(data) {
     method: 'post',
     data
   })
+}
+
+/* 获取业务员列表*/
+export function GetProjectUserList(data) {
+  return request({
+    url: '/GetProjectUserList',
+    method: 'post',
+    data
+  })
 }

+ 338 - 0
src/components/filterclient.vue

@@ -0,0 +1,338 @@
+<template>
+  <div>
+    <van-nav-bar
+      @click-left="onClickLeft"
+      @click-right="onClickRight"
+      style="background-color: #1989fa"
+    >
+      <template #title>
+        <van-col style="color: #ffffff">筛选客户</van-col>
+      </template>
+      <template #left>
+        <i
+          class="fa fa-arrow-circle-left"
+          aria-hidden="true"
+          style="color: #ffffff; font-size: 18px"
+        ></i>
+      </template>
+      
+    </van-nav-bar>
+    <van-form @submit="onSubmit">
+        <van-field
+            v-model="name"            
+            label="姓名"
+            placeholder="请输入"
+            input-align="right"
+            label-class="title1"
+        />
+        <van-field
+            v-model="phone"            
+            label="电话"
+            placeholder="请输入"
+            input-align="right"
+            label-class="title1"
+        />
+        <van-cell
+        title="业务员"
+        :value="salseUserCode"
+        is-link
+        title-class="title1"
+        value-class="value1"
+        @click="showSalseUserCode = true"
+      ></van-cell>
+      <van-popup v-model="showSalseUserCode" round position="bottom">
+        <van-picker
+          show-toolbar
+          title="请选择"
+          :columns="salseUserCodeData"
+          @cancel="showSalseUserCode = false"
+          @confirm="onConfirmSalseUserCode"
+        />
+      </van-popup>
+        <van-cell
+        title="意向强度"
+        :value="intentionName"
+        is-link
+        title-class="title1"
+        value-class="value1"
+        @click="showIntention = true"
+      ></van-cell>
+      <van-popup v-model="showIntention" round position="bottom">
+        <van-picker
+          show-toolbar
+          title="请选择"
+          
+          :columns="intentionData"
+          @cancel="showIntention = false"
+          @confirm="onConfirmIntention"
+        />
+      </van-popup>
+      <van-cell
+        title="购买状态"
+        :value="saleState"
+        is-link
+        title-class="title1"
+        value-class="value1"
+        @click="showSaleState = true"
+      ></van-cell>
+      <van-popup v-model="showSaleState" round position="bottom">
+        <van-picker
+          show-toolbar
+          title="请选择"
+         
+          :columns="saleStateData"
+          @cancel="showSaleState = false"
+          @confirm="onConfirmSaleState"
+        />
+      </van-popup>
+       <van-cell
+        title="登记日期起"
+        :value="registerDateRange0"
+        is-link
+        title-class="title1"
+        value-class="value1"
+        @click="showRegisterDateRange0 = true"
+      ></van-cell>
+      <van-popup v-model="showRegisterDateRange0" round position="bottom">
+        <van-datetime-picker
+          type="date"
+          title="选择年月日"
+           v-model="currentDate"
+          :min-date="minDate"
+          :max-date="maxDate"
+          @cancel="showRegisterDateRange0 = false"
+          @confirm="onConfirmRegisterDateRange0"
+        />
+      </van-popup>
+       <van-cell
+        title="登记日期止"
+        :value="registerDateRange1"
+        is-link
+        title-class="title1"
+        value-class="value1"
+        @click="showRegisterDateRange1 = true"
+      ></van-cell>
+      <van-popup v-model="showRegisterDateRange1" round position="bottom">
+        <van-datetime-picker
+          type="date"
+          title="选择年月日"
+           v-model="currentDate"
+          :min-date="minDate"
+          :max-date="maxDate"
+          @cancel="showRegisterDateRange1 = false"
+          @confirm="onConfirmRegisterDateRange1"
+        />
+      </van-popup> 
+      <van-cell
+        title="跟进日期起"
+        :value="visitDateRange0"
+        is-link
+        title-class="title1"
+        value-class="value1"
+        @click="showVisitDateRange0 = true"
+      ></van-cell>
+      <van-popup v-model="showVisitDateRange0" round position="bottom">
+        <van-datetime-picker
+          type="date"
+          title="选择年月日"
+           v-model="currentDate"
+          :min-date="minDate"
+          :max-date="maxDate"
+          @cancel="showVisitDateRange0 = false"
+          @confirm="onConfirmVisitDateRange0"
+        />
+      </van-popup>
+       <van-cell
+        title="跟进日期止"
+        :value="visitDateRange1"
+        is-link
+        title-class="title1"
+        value-class="value1"
+        @click="showVisitDateRange1 = true"
+      ></van-cell>
+      <van-popup v-model="showVisitDateRange1" round position="bottom">
+        <van-datetime-picker
+          type="date"
+          title="选择年月日"
+           v-model="currentDate"
+          :min-date="minDate"
+          :max-date="maxDate"
+          @cancel="showVisitDateRange1 = false"
+          @confirm="onConfirmVisitDateRange1"
+        />
+      </van-popup> 
+        <div style="margin: 16px;">
+            <van-button round block type="info" native-type="submit">查询</van-button>
+        </div>
+    </van-form>
+   
+  </div>
+</template>
+
+<script>
+import { GetProjectUserList ,GetSaClientSummary,GetSaRoomList} from "@/common/api/loginApi.js";
+export default {
+  name: "login",
+  data() {
+    return {
+      name:'',
+      phone:'',
+      salseUserCode:'',
+      salseUserCodeData:[],
+      showSalseUserCode:false,
+      intention:'',
+      intentionName:'',
+      intentionData:[{id:0,text:'无意向'},{id:1,text:'☆'},{id:2,text:'☆☆'},{id:3,text:'☆☆☆'},{id:4,text:'☆☆☆☆'},{id:5,text:'☆☆☆☆☆'}],
+      showIntention:false,
+      saleState:'',
+      saleStateData:[],
+      showSaleState:false,
+      registerDateRange0:'',
+      showRegisterDateRange0:false,
+      registerDateRange1:'',
+      showRegisterDateRange1:false,
+      visitDateRange0:'',
+      showVisitDateRange0:false,
+      visitDateRange1:'' ,
+      showVisitDateRange1:false,
+      minDate: new Date(1900, 0, 1),
+      maxDate: new Date(2025, 10, 1), 
+      currentDate:new Date()
+    };
+  },
+  created: function () {
+    console.info("created");
+    //console.info(this.$util);
+    this.$util.persistLogin(this);
+    this.GetProjectUserList();
+    this.GetSaClientSummary();
+  },
+  computed:{   //计算属性
+    
+   
+  },
+  methods: {
+    //获业务员列表
+    GetProjectUserList: function () {
+      var that = this;
+      var data = {
+          userCode:that.$store.state.data.userCode ,
+        projectId: that.$store.state.projectId       
+      };
+      console.info("data", data);
+      GetProjectUserList(data).then((res) => {
+        console.info("GetProjectUserList", res);
+        if (!res.result) {
+          that.$toast(res.msg);
+          return;
+        }
+        // res.data.forEach(function (item, index, array) {
+        //   that.$set(that.buildingData, index, item);
+        // });
+       
+      });
+    },
+    //购买状态
+    GetSaClientSummary: function () {
+      var that = this;
+      var data = {
+        userCode:that.$store.state.data.userCode ,
+        projectId: that.$store.state.projectId      
+      };
+      console.info("data", data);
+      GetSaClientSummary(data).then((res) => {
+        console.info("GetSaClientSummary", res);
+        if (!res.result) {
+          that.$toast(res.msg);
+          return;
+        }
+        res.data.forEach(function (item, index, array) {
+            if(item.visible==0){
+                //that.$set(that.saleStateData, index, item);
+                that.saleStateData.push(item.saleState);
+            }
+          
+        });
+       
+      });
+    },
+    onConfirmSaleState:function(value,index){   //购买状态
+        console.info("onConfirmSaleState", value);
+      this.saleState = value;
+      this.showSaleState = false;
+    },
+    onConfirmIntention:function(value,index){   //意向强度
+        console.info("onConfirmIntention", value);
+      this.intention = value.id;
+      this.intentionName=value.text;
+      console.info("intention", this.intention);
+      this.showIntention = false;
+    },
+    onConfirmSalseUserCode:function(value,index){   //业务员
+        console.info("onConfirmSalseUserCode", value);
+        this.showSalseUserCode=false;
+    },
+   onConfirmRegisterDateRange0: function (value, index) {
+      //登记日期起
+      console.info("onConfirmRegisterDateRange0", value);
+      this.registerDateRange0 = this.$util.getDate(value);
+      this.showRegisterDateRange0 = false;
+    },
+    onConfirmRegisterDateRange1: function (value, index) {
+      //登记日期止
+      console.info("onConfirmRegisterDateRange1", value);
+      this.registerDateRange1 = this.$util.getDate(value);
+      this.showRegisterDateRange1 = false;
+    },
+    onConfirmVisitDateRange0: function (value, index) {
+      //跟进日期起
+      console.info("onConfirmVisitDateRange0", value);
+      this.visitDateRange0 = this.$util.getDate(value);
+      this.showVisitDateRange0 = false;
+    },
+    onConfirmVisitDateRange1: function (value, index) {
+      //跟进日期止
+      console.info("onConfirmVisitDateRange1", value);
+      this.visitDateRange1 = this.$util.getDate(value);
+      this.showVisitDateRange1 = false;
+    },
+    onSubmit() {    //提交按钮  查询房源
+     
+      var that = this;
+      let name=this.name;
+      let phone=this.phone;
+      
+      let jsonQuery={name:name,phone:phone,salseUserCode:that.salseUserCode,intention:that.intention,saleState:that.saleState,registerDateRange0:this.registerDateRange0,registerDateRange1:this.registerDateRange1,visitDateRange0:this.visitDateRange0,visitDateRange1:this.visitDateRange1};
+      console.info('onSubmit jsonQuery',jsonQuery);
+      //return;
+      this.$router.push({path:'/getsaclientlist1',query:jsonQuery});
+     
+    },
+    onClickLeft() {
+      // this.$toast('返回')
+      console.info("left");
+      this.$router.go(-1);
+    },
+    onClickRight() {
+      this.$router.go(0);
+    },
+  },
+};
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped>
+.title1 {
+  color: #999;
+  text-align: left;
+}
+.value1 {
+  color: #1732cf;
+  font-size: 18px;
+  font-weight: 800;
+}
+.size{
+    font-size:16px;
+}
+</style>
+s

+ 2 - 1
src/components/getproject.vue

@@ -64,7 +64,8 @@ export default {
        console.info('routerto radio',this.radio);
        console.info('routerTo projectname',projectname);
        this.$store.commit('setProjectId',this.radio);   //给项目ID赋值
-       this.$router.push({path:'/saleindex',query:{projectId:this.radio,projectname:projectname}});
+       this.$store.commit('setProjectName',projectname);   //给项目名赋值
+       this.$router.push('/saleindex');
     },
     onClickLeft () {
       // this.$toast('返回')

+ 1 - 1
src/components/getremindarrearage.vue

@@ -36,7 +36,7 @@
         >
           <template #default>
             <van-row>
-              <van-cell :title="item.name" is-link arrow-direction border />
+              <van-cell :title="item.name" is-link arrow-direction border :to="'/clientdetail?id='+item.clientId+'&name='+item.name"  />
             </van-row>
             <van-row class="borderTop">
               <van-col span="20">

+ 1 - 1
src/components/getremindbuycontract.vue

@@ -36,7 +36,7 @@
         >
           <template #default>
             <van-row>
-              <van-cell :title="item.name" is-link arrow-direction border />
+              <van-cell :title="item.name" is-link arrow-direction border :to="'/clientdetail?id='+item.clientId+'&name='+item.name"  />
             </van-row>
             <van-row class="borderTop">
               <van-col span="20">

+ 1 - 1
src/components/getremindsigncontract.vue

@@ -36,7 +36,7 @@
         >
           <template #default>
             <van-row>
-              <van-cell :title="item.name" is-link arrow-direction border />
+              <van-cell :title="item.name" is-link arrow-direction border :to="'/clientdetail?id='+item.clientId+'&name='+item.name"  />
             </van-row>
             <van-row class="borderTop">
               <van-col span="20">

+ 1 - 1
src/components/getremindvisit.vue

@@ -36,7 +36,7 @@
         >
           <template #default>
             <van-row>
-              <van-cell :title="item.name" is-link arrow-direction border />
+              <van-cell :title="item.name" is-link arrow-direction border :to="'/clientdetail?id='+item.clientId+'&name='+item.name"/>
             </van-row>
             <van-row class="borderTop">
               <van-col span="20">

+ 196 - 0
src/components/getsaclientlist1.vue

@@ -0,0 +1,196 @@
+<template>
+  <div>
+      <van-nav-bar
+      @click-left="onClickLeft"
+      @click-right="onClickRight"
+      style="background-color: #1989fa"
+    >
+      <template #title>
+        <van-col style="color: #ffffff">客户</van-col>
+      </template>
+      <template #left>
+        <i
+          class="fa fa-arrow-circle-left"
+          aria-hidden="true"
+          style="color: #ffffff; font-size: 18px"
+        ></i>
+      </template>
+      
+    </van-nav-bar>
+    <form action="/">
+      <van-col span="24" class="bgBlue">           
+            <div v-if="totalCount>0" class="textLeft">查询结果:共查询到{{totalCount}}条数据</div>
+      </van-col>
+    </form>
+
+   
+        <van-list
+        v-model="loading"
+        :finished="finished"
+        loading-text="加载中..."
+        finished-text="我是有底线的~"
+        @load="onLoad"
+        >
+        <van-cell
+            v-for="item in listdata"
+            :key="item.clientId"
+            :to="'/clientdetail?id='+item.clientId+'&name='+item.name"
+        >
+            <template #title>
+            <van-col span="24" class="title1">{{item.name}}</van-col>
+            <van-col span="24">
+                <van-row>
+                    <van-col span="9" class="title2">业务员:</van-col>
+                    <van-col span="15" class="title2">{{item.cUserName}}</van-col>
+                </van-row>
+                </van-col>
+            </template>
+            <template #default>
+                <van-col span="24" class="star" > 
+                    <span v-for="i in item.intention" :key="i+'x'" class="size">★</span>
+                    <span v-for="i in 5-item.intention" :key="i" class="size">☆</span>
+                </van-col>           
+            </template>
+        </van-cell>
+        </van-list>
+   
+  </div>
+</template>
+
+<script>
+import { GetSaClientList } from "@/common/api/loginApi.js";
+import Decimal from "decimal.js";
+export default {
+  name: "login",
+  data() {
+    return {
+      listdata: [], 
+      loading: false,
+      finished: false,
+      isLoading: false,
+      page:1,
+      searchstr:'' ,  //搜索串
+      totalCount:0
+    };
+  },
+  created: function () {
+    console.info("created");
+    //console.info(this.$util);
+    this.$util.persistLogin(this);
+   
+  },
+  methods: {
+    GetSaClientList: function () {
+      var that = this;
+      let query=this.$route.query;
+      
+      let jsonQuery={name:query.name,phone:query.phone,salseUserCode:query.salseUserCode,intention:query.intention,saleState:query.saleState,registerDateRange0:query.registerDateRange0,registerDateRange1:query.registerDateRange1,visitDateRange0:query.visitDateRange0,visitDateRange1:query.visitDateRange1};
+      var data = {
+        userCode: that.$store.state.data.userCode,
+        projectId: that.$store.state.projectId,
+        page: that.page,
+        pageCount: "10",
+        jsonQuery: JSON.stringify(jsonQuery),
+        sortby: "",
+      };
+      console.info("data", data);
+      //return;
+      GetSaClientList(data).then((res) => {
+        console.info("GetSaClientList", res);
+        if (!res.result) {
+          that.$toast(res.msg);
+          return;
+        }
+        if(res.data!=null&&res.data.listdata.length>0){
+          that.loading=false;
+          that.totalCount=res.data.page.totalCount;
+          res.data.listdata.forEach(function (item, index, array) {
+            that.listdata.push(item);
+            
+            if(res.data.listdata.length-1==index){
+              that.page++;
+              console.info('that.page:',that.page);
+              if(res.data.page.totalPages==that.page-1){
+                  
+                  that.finished=true;
+                  console.info('that.finished1:',that.finished);
+              }
+            }
+          });
+          console.info('listdata',that.listdata);
+          if(res.data==null||res.data.listdata==null||res.data.listdata.length==0){
+              
+              that.finished = true;
+              console.info('that.finished2:',that.finished);
+          }
+          
+        }
+         else{
+          that.finished=true;
+          console.info('that.finished3:',that.finished);
+          that.page=1;
+          that.totalCount=0;
+        }
+      });
+    },
+    // 列表加载
+    onLoad () {
+      setTimeout(() => {
+        this.GetSaClientList()
+        this.loading = true
+      }, 500)
+    },
+     onSearch(val) {     //搜索事件
+      console.info('onSearch',val);
+      this.listdata=[];
+      this.page=1;
+      this.finished=false;
+      this.GetSaClientList();
+    },
+    onCancel() {      //搜索的取消事件
+      console.info('onCancel');
+      this.$router.push('/getsaclientsummary');
+    },
+     onClickLeft() {
+      // this.$toast('返回')
+      console.info("left");
+      this.$router.go(-1);
+    },
+    onClickRight() {
+      this.$router.go(0);
+    },
+  },
+};
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped>
+.title1 {
+   color:#0f0fa7;
+    font-size:16px;
+    font-weight:900;
+    text-align: left;
+    margin-left:15px;
+    height:35px;
+}
+.star{
+    height:35px;
+}
+.size{
+    font-size:16px;
+    color:orange;
+}
+.title2{
+    color:#999;
+    
+}
+.bgBlue{
+    padding-top:15px;
+    padding-bottom: 15px;
+}
+.textLeft{
+    padding-left:15px;
+    font-size:15px;
+    font-weight: 100;
+}
+</style>

+ 8 - 2
src/components/getsaclientsummary.vue

@@ -34,13 +34,19 @@
     </form>
     <van-row class="iconArea">
       <van-col span="24">
-        <van-col span="5">
+        <van-col span="8">
           <router-link to="/addsaclient">
             <van-icon name="friends" badge="+" size="50"/><br/>
             <span>添加</span>
           </router-link>
         </van-col>
-         <van-col span="19">
+        <van-col span="8">
+          <router-link to="/filterclient">
+            <van-icon name="search"  size="50"/><br/>
+            <span>筛选</span>
+          </router-link>
+        </van-col>
+         <van-col span="8">
          
         </van-col>
       </van-col>

+ 37 - 6
src/components/saleindex.vue

@@ -2,7 +2,7 @@
   <div>
     <van-row gutter="20" style="padding-top: 10px">
       <van-col span="10"
-        >剩余<span style="font-size: 20px; color: #1989fa">274</span>套</van-col
+        >剩余<span style="font-size: 20px; color: #1989fa">{{remainNum}}</span>套</van-col
       >
       <van-col span="14" style="padding-right: 15px">
         <span
@@ -130,7 +130,7 @@
         </router-link>
       </van-grid-item>
       <van-grid-item>
-        <router-link to="/getoverduesummary">
+        <router-link to="/getsaclientlist">
           <van-image
             :src="require('@/assets/img/search.png')"
             width="50"
@@ -154,7 +154,7 @@
 </template>
 
 <script>
-import { SaReportToday } from "@/common/api/loginApi.js";
+import { SaReportToday,GetSaRoomList } from "@/common/api/loginApi.js";
 import Decimal from "decimal.js";
 export default {
   name: "login",
@@ -166,15 +166,18 @@ export default {
       saleprompt: {}, //销售目标
       vistitcount: {}, //访问计数
       currentRate: 0, //当前进度
+      remainNum:0,          //剩余套数
     };
   },
   created: function () {
     console.info("created");
     this.$util.persistLogin(this);
     console.info(this.$route.query);
-    this.projectId = this.$route.query.projectId;
-    this.projectname = this.$route.query.projectname;
+    this.projectId = this.$store.state.projectId;
+    this.projectname = this.$store.state.projectName;
+    console.info('projectname',this.projectname);
     this.SaReportToday();
+    this.GetSaRoomList();
   },
   computed: {
     text() {
@@ -201,9 +204,37 @@ export default {
         that.currentRate = Decimal(that.saleprompt.complete).toNumber();
       });
     },
+    GetSaRoomList:function () {
+      //房源套数
+      var that = this;
+      let jsonQuery={rState:2};
+      var data = {
+        userCode: that.$store.state.data.userCode,
+        projectId: that.$store.state.projectId,
+        page:'',
+        pageCount:'',
+        jsonQuery:JSON.stringify(jsonQuery)
+      };
+      //console.info("data", data);
+      GetSaRoomList(data).then((res) => {
+        console.info("GetSaRoomList", res);
+        if (!res.result) {
+          that.$toast(res.msg);
+          return;
+        }
+        that.remainNum=0;
+        if(res.data!=null&&res.data.list!=null&&res.data.list.length>0){
+          res.data.list.forEach(function(item,index,arr) {
+             if(item.rState==2){
+               that.remainNum++;
+             }
+          });
+        }
+      });
+    },
     // 单选按钮点击事件
     routeToProject: function () {
-      this.$router.push("/getproject");
+      this.$router.push("/getproject");  
     },
     onClickLeft() {
       // this.$toast('返回')

+ 13 - 0
src/router/index.js

@@ -28,6 +28,9 @@ import getremindbuycontracttoday from '@/components/getremindbuycontracttoday'
 import getremindarrearagetoday from '@/components/getremindarrearagetoday'
 import getremindvisittoday from '@/components/getremindvisittoday'
 import getremindallocation from '@/components/getremindallocation'
+import filterclient from '@/components/filterclient'
+import getsaclientlist1 from '@/components/getsaclientlist1'
+
 Vue.use(Router)
 
 export default new Router({
@@ -172,5 +175,15 @@ export default new Router({
       name: 'getremindallocation',
       component: getremindallocation
     },
+    {     //筛选客户
+      path: '/filterclient',
+      name: 'filterclient',
+      component: filterclient
+    },
+    {     //客户查询
+      path: '/getsaclientlist1',
+      name: 'getsaclientlist1',
+      component: getsaclientlist1
+    },
   ]
 })

+ 6 - 2
src/store/index.js

@@ -10,7 +10,8 @@ const store = new Vuex.Store({
     	code: '',     
 		msg: '',         //获取成功失败时返回的错误信息
 		data: {},   //{userId,userName,userCode}
-		projectId:''   //项目id
+		projectId:'',   //项目id
+		projectName:''   //项目名
 	},
 	mutations: {
 		setResult(state, result){
@@ -29,7 +30,10 @@ const store = new Vuex.Store({
 		},
 		setProjectId(state,projectId){
 			state.projectId=projectId;
-		}
+		},
+		setProjectName(state,projectname){    //项目名
+			state.projectName=projectname;
+		},
   },
   getters:{