|
@@ -1,9 +1,67 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="bgcolor infoHistorVisit">
|
|
|
|
|
- <div class="header">
|
|
|
|
|
- <van-nav-bar class="navBar" title="经销商拜访" left-arrow @click-left="onClickLeft" />
|
|
|
|
|
|
|
+ <div class="bgcolor historAllVisit">
|
|
|
|
|
+ <div class="navBarTOP">
|
|
|
|
|
+ <!-- 顶部条-->
|
|
|
|
|
+ <van-nav-bar class="navBar" title="历史拜访" left-arrow @click-left="onClickLeft" />
|
|
|
|
|
+ <div class="searcTime">
|
|
|
|
|
+ <van-row class="serchInput">
|
|
|
|
|
+ <van-col span="12">
|
|
|
|
|
+ <van-cell
|
|
|
|
|
+ class="monthNow selectcell"
|
|
|
|
|
+ :title="companyName"
|
|
|
|
|
+ is-link
|
|
|
|
|
+ arrow-direction="down"
|
|
|
|
|
+ @click="regionClick" />
|
|
|
|
|
+ </van-col>
|
|
|
|
|
+ <van-col span="12">
|
|
|
|
|
+ <van-cell
|
|
|
|
|
+ class="monthNow selectcell"
|
|
|
|
|
+ :title="regionName"
|
|
|
|
|
+ is-link
|
|
|
|
|
+ @click="SalesRegionClick"
|
|
|
|
|
+ arrow-direction="down" />
|
|
|
|
|
+ </van-col>
|
|
|
|
|
+ <van-col span="12">
|
|
|
|
|
+ <van-cell
|
|
|
|
|
+ class="monthNow selectcell"
|
|
|
|
|
+ :title="deptName"
|
|
|
|
|
+ is-link
|
|
|
|
|
+ @click="SalesDepartmentClick"
|
|
|
|
|
+ arrow-direction="down" />
|
|
|
|
|
+ </van-col>
|
|
|
|
|
+ <van-col span="12">
|
|
|
|
|
+ <van-cell
|
|
|
|
|
+ class="monthNow selectcell"
|
|
|
|
|
+ :title="userName"
|
|
|
|
|
+ is-link
|
|
|
|
|
+ @click="StaffClick"
|
|
|
|
|
+ arrow-direction="down" />
|
|
|
|
|
+ </van-col>
|
|
|
|
|
+ <van-col span="12">
|
|
|
|
|
+ <div class="monthNow" @click="startTimeshow = true">
|
|
|
|
|
+ <span class="month">{{ startTime }}</span>
|
|
|
|
|
+ <!-- <van-icon class="CalendarIcon" :name="timeico" /> -->
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </van-col>
|
|
|
|
|
+ <van-col span="12">
|
|
|
|
|
+ <div class="monthNow" @click="endTimeshow = true">
|
|
|
|
|
+ <span class="month">{{ endTime }}</span>
|
|
|
|
|
+ <!-- <van-icon class="CalendarIcon" :name="timeico" /> -->
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </van-col>
|
|
|
|
|
+ </van-row>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="searchDiv">
|
|
|
|
|
+ <van-search v-model="storeName" show-action placeholder="搜索名称/编号/地址/拜访人">
|
|
|
|
|
+ <template #action>
|
|
|
|
|
+ <div @click="onSearch">搜索</div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </van-search>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="lineGrey"></div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="container">
|
|
|
|
|
|
|
+ <!-- 主体内容-->
|
|
|
|
|
+ <div class="container" style="margin-top: 262px">
|
|
|
<van-list
|
|
<van-list
|
|
|
class="myList1"
|
|
class="myList1"
|
|
|
v-model="loading"
|
|
v-model="loading"
|
|
@@ -22,43 +80,239 @@
|
|
|
}}</span
|
|
}}</span
|
|
|
>)
|
|
>)
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="info">经销商类型:{{ verifyChainType(item.typeCode2) }}</div>
|
|
|
|
|
<div class="info">拜访人:{{ item.nickName }}</div>
|
|
<div class="info">拜访人:{{ item.nickName }}</div>
|
|
|
- <div class="info">拜访时间:{{ item.visitsTime }}</div>
|
|
|
|
|
|
|
+ <div class="info">
|
|
|
|
|
+ 拜访时间:{{ item.visitsTime }}
|
|
|
|
|
+ <span class="textRight" v-if="item.status == '1' && item.taskId == null"
|
|
|
|
|
+ >审批中</span
|
|
|
|
|
+ >
|
|
|
|
|
+ <span
|
|
|
|
|
+ class="textRight"
|
|
|
|
|
+ v-if="item.status == '1' && item.taskId != null"
|
|
|
|
|
+ style="color: red"
|
|
|
|
|
+ >退回修改</span
|
|
|
|
|
+ >
|
|
|
|
|
+ <span class="textRight" style="color: #07c160" v-if="item.status == 2"
|
|
|
|
|
+ >审批完成</span
|
|
|
|
|
+ >
|
|
|
|
|
+ <span class="textRight" v-if="item.status == '3'" style="color: red">拒绝</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="info" v-if="item.dwellTime">拜访时长:{{ item.dwellTime }}</div>
|
|
|
|
|
+ <div class="info">地址:{{ item.addressLine }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!-- 分销店 -->
|
|
|
|
|
+ <template
|
|
|
|
|
+ v-if="
|
|
|
|
|
+ item.sfaStoreType &&
|
|
|
|
|
+ item.sfaStoreType.type == 'fxd' &&
|
|
|
|
|
+ item.sfaStoreChainsContactList
|
|
|
|
|
+ ">
|
|
|
|
|
+ <div class="info">
|
|
|
|
|
+ 经销商:
|
|
|
|
|
+ <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">经销商:{{ item.chainName }}</div>
|
|
|
|
|
+ </template>
|
|
|
</van-cell>
|
|
</van-cell>
|
|
|
<div class="lineGrey"></div>
|
|
<div class="lineGrey"></div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</van-list>
|
|
</van-list>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <van-popup v-model="startTimeshow" position="bottom" :style="{ height: '30%' }">
|
|
|
|
|
+ <van-datetime-picker
|
|
|
|
|
+ v-model="startcurrentDate"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ title="开始日期"
|
|
|
|
|
+ :min-date="minDate"
|
|
|
|
|
+ :max-date="startmaxDate"
|
|
|
|
|
+ @confirm="dateeconfirm"
|
|
|
|
|
+ @cancel="startTimeshow = false" />
|
|
|
|
|
+ </van-popup>
|
|
|
|
|
+ <van-popup v-model="endTimeshow" position="bottom" :style="{ height: '50%' }">
|
|
|
|
|
+ <van-datetime-picker
|
|
|
|
|
+ v-model="currentDate"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ title="开始日期"
|
|
|
|
|
+ :min-date="endminDate"
|
|
|
|
|
+ :max-date="maxDate"
|
|
|
|
|
+ @confirm="endTimeconfirm"
|
|
|
|
|
+ @cancel="endTimeshow = false" />
|
|
|
|
|
+ </van-popup>
|
|
|
|
|
+ <van-popup v-model="RegionShow" capture position="bottom">
|
|
|
|
|
+ <van-picker
|
|
|
|
|
+ show-toolbar
|
|
|
|
|
+ :columns="companyList"
|
|
|
|
|
+ value-key="deptName"
|
|
|
|
|
+ @confirm="onregionConfirm"
|
|
|
|
|
+ @cancel="RegionShow = false" />
|
|
|
|
|
+ </van-popup>
|
|
|
|
|
+ <van-popup v-model="SalesRegionShow" capture position="bottom">
|
|
|
|
|
+ <van-picker
|
|
|
|
|
+ show-toolbar
|
|
|
|
|
+ :columns="regionList"
|
|
|
|
|
+ value-key="deptName"
|
|
|
|
|
+ @confirm="onSalesRegionConfirm"
|
|
|
|
|
+ @cancel="SalesRegionShow = false" />
|
|
|
|
|
+ </van-popup>
|
|
|
|
|
+ <van-popup v-model="SalesDepartmentShow" capture position="bottom">
|
|
|
|
|
+ <van-picker
|
|
|
|
|
+ show-toolbar
|
|
|
|
|
+ :columns="deptList"
|
|
|
|
|
+ value-key="deptName"
|
|
|
|
|
+ @confirm="onSalesDepartmentConfirm"
|
|
|
|
|
+ @cancel="SalesDepartmentShow = false" />
|
|
|
|
|
+ </van-popup>
|
|
|
|
|
+ <van-popup v-model="StaffShow" capture position="bottom">
|
|
|
|
|
+ <van-picker
|
|
|
|
|
+ show-toolbar
|
|
|
|
|
+ :columns="userList"
|
|
|
|
|
+ @confirm="onStaffConfirm"
|
|
|
|
|
+ value-key="nickName"
|
|
|
|
|
+ @cancel="StaffShow = false" />
|
|
|
|
|
+ </van-popup>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import { myChainsVisits } from '@/api/info';
|
|
import { myChainsVisits } from '@/api/info';
|
|
|
|
|
+import { getvisitDeptInfo } from '@/api/index';
|
|
|
|
|
+// import timeico from '@/assets/Icon/datatims.png';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- name: 'infoHistorVisit',
|
|
|
|
|
|
|
+ name: 'index.vue',
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ // timeico: timeico,
|
|
|
|
|
+ defaultDate: new Date(),
|
|
|
|
|
+ searchValue: '',
|
|
|
|
|
+ calendarShow: '',
|
|
|
|
|
+ monthNames: [
|
|
|
|
|
+ '-01',
|
|
|
|
|
+ '-02',
|
|
|
|
|
+ '-03',
|
|
|
|
|
+ '-04',
|
|
|
|
|
+ '-05',
|
|
|
|
|
+ '-06',
|
|
|
|
|
+ '-07',
|
|
|
|
|
+ '-08',
|
|
|
|
|
+ '-09',
|
|
|
|
|
+ '-10',
|
|
|
|
|
+ '-11',
|
|
|
|
|
+ '-12',
|
|
|
|
|
+ ],
|
|
|
|
|
+ calendarIsshow: false,
|
|
|
|
|
+ tabVal: 'insidePlan',
|
|
|
list: [],
|
|
list: [],
|
|
|
loading: false,
|
|
loading: false,
|
|
|
finished: true,
|
|
finished: true,
|
|
|
|
|
+ listActive: null,
|
|
|
|
|
+ query: '',
|
|
|
|
|
+ show: false,
|
|
|
|
|
+ minDate: new Date(2022, 0, 1),
|
|
|
|
|
+ maxDate: new Date(),
|
|
|
|
|
+ currentDate: new Date(),
|
|
|
|
|
+ startcurrentDate: new Date(),
|
|
|
|
|
+ endminDate: new Date(),
|
|
|
|
|
+ startmaxDate: new Date(),
|
|
|
|
|
+ endTime: '',
|
|
|
|
|
+ startTime: '',
|
|
|
|
|
+ endTimeshow: false,
|
|
|
|
|
+ startTimeshow: false,
|
|
|
|
|
+ storeName: '',
|
|
|
|
|
+ companyName: '全部公司',
|
|
|
|
|
+ deptName: '全部销售部',
|
|
|
|
|
+ regionName: '全部大区',
|
|
|
|
|
+ userName: '全部业务员',
|
|
|
|
|
+ companyCode: '',
|
|
|
|
|
+ deptCode: '',
|
|
|
|
|
+ regionCode: '',
|
|
|
|
|
+ userCode: '',
|
|
|
|
|
+ companyList: [],
|
|
|
|
|
+ deptList: [],
|
|
|
|
|
+ regionList: [],
|
|
|
|
|
+ userList: [],
|
|
|
|
|
+ RegionShow: false,
|
|
|
|
|
+ SalesRegionShow: false,
|
|
|
|
|
+ SalesDepartmentShow: false,
|
|
|
|
|
+ StaffShow: false,
|
|
|
|
|
+ deptForm: { type: '', parentId: '' },
|
|
|
pageNum: 1, // 当前页码 int类型
|
|
pageNum: 1, // 当前页码 int类型
|
|
|
pageSize: 10, // 当前每页条数 int类型
|
|
pageSize: 10, // 当前每页条数 int类型
|
|
|
|
|
+ formData: {
|
|
|
|
|
+ companyId: '', // 公司id,必传 Long类型
|
|
|
|
|
+ regionId: '', // 大区id,必传 Long类型
|
|
|
|
|
+ deptId: '', // 部门id,如果为周报或日报为必传 Long类型
|
|
|
|
|
+ userId: '', // 业务员id,如果为日报为必传 Long类型
|
|
|
|
|
+ startTime: '', // 开始时间,必传 格式:yyyy-MM-dd String类型
|
|
|
|
|
+ endTime: '', // 结束时间,必传 格式:yyyy-MM-dd String类型
|
|
|
|
|
+ pageNum: 1, // 当前页码 int类型
|
|
|
|
|
+ pageSize: 10, // 当前每页条数 int类型
|
|
|
|
|
+ },
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
|
|
+ this.info();
|
|
|
|
|
+ this.userList = [];
|
|
|
this.pageNum = 1;
|
|
this.pageNum = 1;
|
|
|
this.list = [];
|
|
this.list = [];
|
|
|
this.powerGrade = localStorage.getItem('powerGrade');
|
|
this.powerGrade = localStorage.getItem('powerGrade');
|
|
|
- this.getVisitsListFn();
|
|
|
|
|
|
|
+ this.getDeptInfo('dept', null, () => {
|
|
|
|
|
+ this.onSearch();
|
|
|
|
|
+ });
|
|
|
|
|
+ if (this.powerGrade == 5) {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ if (this.$route.query.userCode == undefined) {
|
|
|
|
|
+ this.companyName = this.companyList[0].deptName;
|
|
|
|
|
+ this.companyCode = this.companyList[0].deptId;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.getDeptInfo('dept', 1);
|
|
|
|
|
+ }, 1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.powerGrade == 4) {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.getDeptInfo('dept', 1);
|
|
|
|
|
+ }, 1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.powerGrade == 3) {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.getDeptInfo('dept', 2);
|
|
|
|
|
+ }, 1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.powerGrade == 2 || this.powerGrade == 1) {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.getDeptInfo('user');
|
|
|
|
|
+ }, 2000);
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
|
|
+ mounted() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
|
|
+ // this.loading = false;
|
|
|
this.getVisitsListFn();
|
|
this.getVisitsListFn();
|
|
|
},
|
|
},
|
|
|
|
|
+ info() {
|
|
|
|
|
+ this.query = this.$route.query;
|
|
|
|
|
+ this.startTime = this.getDay(-7);
|
|
|
|
|
+ this.startcurrentDate = new Date(this.getDay(-7));
|
|
|
|
|
+ this.endTime = this.parseTime(new Date(), '{y}-{m}-{d}');
|
|
|
|
|
+ this.endminDate = new Date(this.getDay(-7));
|
|
|
|
|
+ },
|
|
|
detilsFn(val) {
|
|
detilsFn(val) {
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
path: '/visitHistoryDetail',
|
|
path: '/visitHistoryDetail',
|
|
@@ -76,9 +330,60 @@ export default {
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ timeBefore7(date) {
|
|
|
|
|
+ if (!date) {
|
|
|
|
|
+ date = new Date();
|
|
|
|
|
+ }
|
|
|
|
|
+ var y = date.getFullYear();
|
|
|
|
|
+ var m = date.getMonth() + 1;
|
|
|
|
|
+ var d = date.getDate() - 6;
|
|
|
|
|
+ if (d < 0) {
|
|
|
|
|
+ m = date.getMonth();
|
|
|
|
|
+ var d1 = new Date(y, m, 0);
|
|
|
|
|
+ var d2 = d1.getDate();
|
|
|
|
|
+ return y + '/' + (m < 10 ? '0' + m : m) + '/' + (d2 + d);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return y + '/' + (m < 10 ? '0' + m : m) + '/' + (d < 10 ? '0' + d : d);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ getDay(day) {
|
|
|
|
|
+ var today = new Date();
|
|
|
|
|
+ var targetday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24 * day;
|
|
|
|
|
+ today.setTime(targetday_milliseconds); //注意,这行是关键代码
|
|
|
|
|
+ var tYear = today.getFullYear();
|
|
|
|
|
+ var tMonth = today.getMonth();
|
|
|
|
|
+ var tDate = today.getDate();
|
|
|
|
|
+ tMonth = this.doHandleMonth(tMonth + 1);
|
|
|
|
|
+ tDate = this.doHandleMonth(tDate);
|
|
|
|
|
+ return tYear + '-' + tMonth + '-' + tDate;
|
|
|
|
|
+ },
|
|
|
|
|
+ doHandleMonth(month) {
|
|
|
|
|
+ var m = month;
|
|
|
|
|
+ if (month.toString().length == 1) {
|
|
|
|
|
+ m = '0' + month;
|
|
|
|
|
+ }
|
|
|
|
|
+ return m;
|
|
|
|
|
+ },
|
|
|
|
|
+ dateeconfirm() {
|
|
|
|
|
+ this.startTimeshow = false;
|
|
|
|
|
+ this.startTime = this.parseTime(this.startcurrentDate, '{yy}-{mm}-{dd}');
|
|
|
|
|
+ this.endminDate = new Date(this.startcurrentDate);
|
|
|
|
|
+ this.onSearch();
|
|
|
|
|
+ },
|
|
|
|
|
+ endTimeconfirm() {
|
|
|
|
|
+ this.endTimeshow = false;
|
|
|
|
|
+ this.endTime = this.parseTime(this.currentDate, '{yy}-{mm}-{dd}');
|
|
|
|
|
+ this.startmaxDate = new Date(this.currentDate);
|
|
|
|
|
+ this.onSearch();
|
|
|
|
|
+ },
|
|
|
onClickLeft() {
|
|
onClickLeft() {
|
|
|
this.$router.go(-1);
|
|
this.$router.go(-1);
|
|
|
},
|
|
},
|
|
|
|
|
+ onSearch() {
|
|
|
|
|
+ this.pageNum = 1;
|
|
|
|
|
+ this.list = [];
|
|
|
|
|
+ this.getVisitsListFn();
|
|
|
|
|
+ },
|
|
|
getVisitsListFn() {
|
|
getVisitsListFn() {
|
|
|
let loading1 = this.$toast.loading({
|
|
let loading1 = this.$toast.loading({
|
|
|
duration: 0,
|
|
duration: 0,
|
|
@@ -90,8 +395,15 @@ export default {
|
|
|
this.refreshing = false;
|
|
this.refreshing = false;
|
|
|
}
|
|
}
|
|
|
myChainsVisits({
|
|
myChainsVisits({
|
|
|
|
|
+ startTime: this.startTime + ' 00:00:00', //
|
|
|
|
|
+ stopTime: this.endTime + ' 24:00:00', //
|
|
|
|
|
+ storeRequest: this.storeName.trim(),
|
|
|
pageNum: this.pageNum,
|
|
pageNum: this.pageNum,
|
|
|
pageSize: this.pageSize,
|
|
pageSize: this.pageSize,
|
|
|
|
|
+ companyId: this.companyCode,
|
|
|
|
|
+ regionId: this.regionCode,
|
|
|
|
|
+ userId: this.userCode,
|
|
|
|
|
+ deptId: this.deptCode,
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
loading1.clear();
|
|
loading1.clear();
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
@@ -108,6 +420,120 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ regionClick() {
|
|
|
|
|
+ // if(this.powerGrade>4){
|
|
|
|
|
+ this.RegionShow = true;
|
|
|
|
|
+ // }
|
|
|
|
|
+ },
|
|
|
|
|
+ SalesRegionClick(val) {
|
|
|
|
|
+ // if(this.powerGrade>3){
|
|
|
|
|
+ this.SalesRegionShow = true;
|
|
|
|
|
+ // }
|
|
|
|
|
+ },
|
|
|
|
|
+ SalesDepartmentClick() {
|
|
|
|
|
+ // if(this.powerGrade>2){
|
|
|
|
|
+ this.SalesDepartmentShow = true;
|
|
|
|
|
+ // }
|
|
|
|
|
+ },
|
|
|
|
|
+ StaffClick() {
|
|
|
|
|
+ this.StaffShow = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ StartTimeClick() {
|
|
|
|
|
+ this.StartTimeShow = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ onregionConfirm(val) {
|
|
|
|
|
+ this.RegionShow = false;
|
|
|
|
|
+ this.companyName = val.deptName;
|
|
|
|
|
+ this.companyCode = val.deptId;
|
|
|
|
|
+ this.regionName = '全部大区';
|
|
|
|
|
+ this.regionCode = '';
|
|
|
|
|
+ this.deptName = '全部销售部';
|
|
|
|
|
+ this.deptCode = '';
|
|
|
|
|
+ this.userName = '全部业务员';
|
|
|
|
|
+ this.userCode = '';
|
|
|
|
|
+ this.getDeptInfo('dept', 1);
|
|
|
|
|
+ },
|
|
|
|
|
+ onSalesRegionConfirm(val) {
|
|
|
|
|
+ this.SalesRegionShow = false;
|
|
|
|
|
+ this.regionName = val.deptName;
|
|
|
|
|
+ this.regionCode = val.deptId;
|
|
|
|
|
+ if (val.deptId != '') {
|
|
|
|
|
+ this.getDeptInfo('dept', 2);
|
|
|
|
|
+ }
|
|
|
|
|
+ this.deptName = '全部销售部';
|
|
|
|
|
+ this.deptCode = '';
|
|
|
|
|
+ this.userName = '全部业务员';
|
|
|
|
|
+ this.userCode = '';
|
|
|
|
|
+ this.userList = [];
|
|
|
|
|
+ },
|
|
|
|
|
+ onSalesDepartmentConfirm(val) {
|
|
|
|
|
+ this.SalesDepartmentShow = false;
|
|
|
|
|
+ this.deptName = val.deptName;
|
|
|
|
|
+ this.deptCode = val.deptId;
|
|
|
|
|
+ if (val.deptId != '') {
|
|
|
|
|
+ this.getDeptInfo('user');
|
|
|
|
|
+ }
|
|
|
|
|
+ this.userName = '全部业务员';
|
|
|
|
|
+ this.userCode = '';
|
|
|
|
|
+ },
|
|
|
|
|
+ onStaffConfirm(val) {
|
|
|
|
|
+ this.StaffShow = false;
|
|
|
|
|
+ this.userName = val.nickName;
|
|
|
|
|
+ this.userCode = val.userId;
|
|
|
|
|
+ },
|
|
|
|
|
+ getDeptInfo(type, grade, callback) {
|
|
|
|
|
+ this.deptForm.type = type;
|
|
|
|
|
+ if (type == 'dept') {
|
|
|
|
|
+ if (grade == '1') {
|
|
|
|
|
+ this.deptForm.parentId = this.companyCode;
|
|
|
|
|
+ } else if (grade == '2') {
|
|
|
|
|
+ this.deptForm.parentId = this.regionCode;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.deptForm.type = '';
|
|
|
|
|
+ this.deptForm.parentId = '';
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (type == 'user') {
|
|
|
|
|
+ this.deptForm.parentId = this.deptCode;
|
|
|
|
|
+ }
|
|
|
|
|
+ getvisitDeptInfo(this.deptForm).then((res) => {
|
|
|
|
|
+ if (type == 'dept') {
|
|
|
|
|
+ if (grade == '1') {
|
|
|
|
|
+ if (res.data.region != null) {
|
|
|
|
|
+ this.regionList = [{ deptName: '全部大区', deptId: '' }].concat(res.data.region);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (grade == '2') {
|
|
|
|
|
+ if (res.data.dept != null) {
|
|
|
|
|
+ this.deptList = [{ deptName: '全部销售部', deptId: '' }].concat(res.data.dept);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.companyList = res.data.company;
|
|
|
|
|
+ if (this.$route.query.userCode == undefined) {
|
|
|
|
|
+ this.companyName = res.data.company[0].deptName;
|
|
|
|
|
+ this.companyCode = res.data.company[0].deptId;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (res.data.dept != null) {
|
|
|
|
|
+ this.deptName = res.data.dept[0].deptName;
|
|
|
|
|
+ this.deptCode = res.data.dept[0].deptId;
|
|
|
|
|
+ this.deptList = res.data.dept;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (res.data.region != null) {
|
|
|
|
|
+ this.regionName = res.data.region[0].deptName;
|
|
|
|
|
+ this.regionCode = res.data.region[0].deptId;
|
|
|
|
|
+ this.regionList = res.data.region;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (res.data.user != null) {
|
|
|
|
|
+ this.userList = res.data.user;
|
|
|
|
|
+ this.userCode = '';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ callback && callback();
|
|
|
|
|
+ } else if (type == 'user') {
|
|
|
|
|
+ if (res.data.user != null) {
|
|
|
|
|
+ this.userList = [{ nickName: '全部业务员', userId: '' }].concat(res.data.user);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
@@ -160,21 +586,12 @@ export default {
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
-.infoHistorVisit {
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
-}
|
|
|
|
|
.bgcolor {
|
|
.bgcolor {
|
|
|
background-color: #f5f5f5;
|
|
background-color: #f5f5f5;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.container {
|
|
.container {
|
|
|
- overflow-y: auto;
|
|
|
|
|
- flex: 1;
|
|
|
|
|
- padding-bottom: 10px;
|
|
|
|
|
|
|
+ padding-bottom: 50px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.monthNow {
|
|
.monthNow {
|