|
@@ -61,19 +61,22 @@
|
|
|
</el-form-item> -->
|
|
</el-form-item> -->
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<!-- <el-date-picker
|
|
<!-- <el-date-picker
|
|
|
- v-model="queryForm.followUpDate"
|
|
|
|
|
- placeholder="最后跟进时间"
|
|
|
|
|
- style="width: 100%"
|
|
|
|
|
- type="date"
|
|
|
|
|
-
|
|
|
|
|
- value-format="yyyy-MM-dd" /> -->
|
|
|
|
|
|
|
+ v-model="queryForm.followUpDate"
|
|
|
|
|
+ end-placeholder="跟进结束时间"
|
|
|
|
|
+ placeholder="时间范围"
|
|
|
|
|
+ start-placeholder="跟进开始时间"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ type="daterange"
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
|
+ @keyup.enter.native="fetchData" /> -->
|
|
|
<el-date-picker
|
|
<el-date-picker
|
|
|
v-model="queryForm.followUpDate"
|
|
v-model="queryForm.followUpDate"
|
|
|
end-placeholder="跟进结束时间"
|
|
end-placeholder="跟进结束时间"
|
|
|
range-separator="至"
|
|
range-separator="至"
|
|
|
start-placeholder="跟进开始时间"
|
|
start-placeholder="跟进开始时间"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
- type="daterange" />
|
|
|
|
|
|
|
+ type="daterange"
|
|
|
|
|
+ value-format="yyyy-MM-dd" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button icon="el-icon-plus" type="primary" @click="handleSearch">查询</el-button>
|
|
<el-button icon="el-icon-plus" type="primary" @click="handleSearch">查询</el-button>
|
|
@@ -230,7 +233,7 @@
|
|
|
custName: '', //客户名称
|
|
custName: '', //客户名称
|
|
|
custIndustry: '', // 客户类型 ()
|
|
custIndustry: '', // 客户类型 ()
|
|
|
custLevel: '', //客户级别
|
|
custLevel: '', //客户级别
|
|
|
- followUpDate: [new Date(this.getLastMonth(new Date())), new Date()], //最后跟进时间
|
|
|
|
|
|
|
+ followUpDate: [], //最后跟进时间
|
|
|
isPublic: true,
|
|
isPublic: true,
|
|
|
custProvince: '',
|
|
custProvince: '',
|
|
|
province: {},
|
|
province: {},
|
|
@@ -345,18 +348,6 @@
|
|
|
this.getOptions()
|
|
this.getOptions()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- getLastMonth(date) {
|
|
|
|
|
- const now = new Date(date)
|
|
|
|
|
- const year = now.getFullYear()
|
|
|
|
|
- const month = now.getMonth() + 1
|
|
|
|
|
- const day = now.getDate()
|
|
|
|
|
- const nowMonthDay = new Date(year, month, 0).getDate() // 当前月的总天数
|
|
|
|
|
- if (month - 1 <= 0) return year - 1 + '-' + 12 + '-' + day // 如果是1月,年数往前推一年
|
|
|
|
|
- const lastMonthDay = new Date(year, parseInt(month) - 1, 0).getDate()
|
|
|
|
|
- if (lastMonthDay >= day) return year + '-' + (month - 1) + '-' + day
|
|
|
|
|
- if (day < nowMonthDay) return year + '-' + (month - 1) + '-' + (lastMonthDay - (nowMonthDay - day)) // 1个月前所在月的总天数小于现在的天日期
|
|
|
|
|
- return year + '-' + (month - 1) + '-' + lastMonthDay // 当前天日期小于当前月总天数
|
|
|
|
|
- },
|
|
|
|
|
getOptions() {
|
|
getOptions() {
|
|
|
Promise.all([api.getProvinceDetail(), this.getDicts('cust_level'), this.getDicts('cust_idy')])
|
|
Promise.all([api.getProvinceDetail(), this.getDicts('cust_level'), this.getDicts('cust_idy')])
|
|
|
.then(([province, level, industry, sell]) => {
|
|
.then(([province, level, industry, sell]) => {
|
|
@@ -370,22 +361,12 @@
|
|
|
async fetchData() {
|
|
async fetchData() {
|
|
|
this.listLoading = true
|
|
this.listLoading = true
|
|
|
const params = { ...this.queryForm }
|
|
const params = { ...this.queryForm }
|
|
|
- let _this = this
|
|
|
|
|
- let CreateOn = []
|
|
|
|
|
- if (!_this.queryForm.followUpDate) {
|
|
|
|
|
- _this.queryForm.followUpDate = []
|
|
|
|
|
- }
|
|
|
|
|
- // 解析时间
|
|
|
|
|
- if (_this.queryForm.followUpDate.length === 2) {
|
|
|
|
|
- _this.queryForm.followUpDate[1].setHours(23)
|
|
|
|
|
- _this.queryForm.followUpDate[1].setMinutes(59)
|
|
|
|
|
- _this.queryForm.followUpDate[1].setSeconds(59)
|
|
|
|
|
- CreateOn.push(_this.formatDateTime(_this.queryForm.followUpDate[0]))
|
|
|
|
|
- CreateOn.push(_this.formatDateTime(_this.queryForm.followUpDate[1]))
|
|
|
|
|
|
|
+ if (!params.followUpDate) params.followUpDate = null
|
|
|
|
|
+ if (this.queryForm.followUpDate && this.queryForm.followUpDate.length === 2) {
|
|
|
|
|
+ params.beginTime = this.queryForm.followUpDate[0]
|
|
|
|
|
+ params.endTime = this.queryForm.followUpDate[1]
|
|
|
}
|
|
}
|
|
|
- params['CreateOn'] = CreateOn.join(',')
|
|
|
|
|
params.custProvince = params.province.distName ? params.province.distName : ''
|
|
params.custProvince = params.province.distName ? params.province.distName : ''
|
|
|
- if (!params.followUpDate) params.followUpDate = null
|
|
|
|
|
const [err, res] = await to(api.getPublicList(params))
|
|
const [err, res] = await to(api.getPublicList(params))
|
|
|
if (err) return (this.listLoading = false)
|
|
if (err) return (this.listLoading = false)
|
|
|
this.list = res.data.list || []
|
|
this.list = res.data.list || []
|
|
@@ -393,17 +374,6 @@
|
|
|
this.listLoading = false
|
|
this.listLoading = false
|
|
|
this.$nextTick(() => this.$refs.table.doLayout())
|
|
this.$nextTick(() => this.$refs.table.doLayout())
|
|
|
},
|
|
},
|
|
|
- formatDateTime(date) {
|
|
|
|
|
- var y = date.getFullYear()
|
|
|
|
|
- var m = date.getMonth() + 1
|
|
|
|
|
- m = m < 10 ? '0' + m : m
|
|
|
|
|
- var d = date.getDate()
|
|
|
|
|
- d = d < 10 ? '0' + d : d
|
|
|
|
|
- var h = date.getHours()
|
|
|
|
|
- var minute = date.getMinutes()
|
|
|
|
|
- minute = minute < 10 ? '0' + minute : minute
|
|
|
|
|
- return y + '-' + m + '-' + d + ' ' + h + ':' + minute
|
|
|
|
|
- },
|
|
|
|
|
handleSearch() {
|
|
handleSearch() {
|
|
|
this.queryForm.pageNum = 1
|
|
this.queryForm.pageNum = 1
|
|
|
this.fetchData()
|
|
this.fetchData()
|
|
@@ -431,7 +401,7 @@
|
|
|
custName: '', //客户名称
|
|
custName: '', //客户名称
|
|
|
custIndustry: '', // 客户类型 ()
|
|
custIndustry: '', // 客户类型 ()
|
|
|
custLevel: '', //客户级别
|
|
custLevel: '', //客户级别
|
|
|
- followUpDate: [new Date(this.getLastMonth(new Date())), new Date()], //最后跟进时间
|
|
|
|
|
|
|
+ followUpDate: [], //最后跟进时间
|
|
|
isPublic: true,
|
|
isPublic: true,
|
|
|
custProvince: '',
|
|
custProvince: '',
|
|
|
custCity: '',
|
|
custCity: '',
|