|
|
@@ -9,8 +9,6 @@
|
|
|
<el-form-item label="销售公司" prop="companyIds">
|
|
|
<el-select
|
|
|
v-model="queryParams.companyIds"
|
|
|
- multiple
|
|
|
- collapse-tags
|
|
|
filterable
|
|
|
clearable
|
|
|
placeholder="请选择销售公司"
|
|
|
@@ -244,7 +242,7 @@ export default {
|
|
|
createTimePickerOptions: {
|
|
|
disabledDate: (time) => {
|
|
|
const minDate = new Date()
|
|
|
- minDate.setMonth(minDate.getMonth() - 3)
|
|
|
+ minDate.setMonth(minDate.getMonth() - 2)
|
|
|
minDate.setHours(0, 0, 0, 0)
|
|
|
const tomorrow = new Date()
|
|
|
tomorrow.setDate(tomorrow.getDate() + 1)
|
|
|
@@ -291,7 +289,7 @@ export default {
|
|
|
logType: 2,
|
|
|
externalUserName: null,
|
|
|
companyUserId: null,
|
|
|
- companyIds: [],
|
|
|
+ companyIds: null,
|
|
|
courseId: null,
|
|
|
sTime: null,
|
|
|
eTime: null,
|
|
|
@@ -301,7 +299,7 @@ export default {
|
|
|
qecETime: null,
|
|
|
scheduleStartTime: null,
|
|
|
scheduleEndTime: null,
|
|
|
- sendType: '2',
|
|
|
+ sendType: '1',
|
|
|
isVip: null,
|
|
|
sopId: null,
|
|
|
periodId: null
|
|
|
@@ -333,14 +331,14 @@ export default {
|
|
|
const d = String(date.getDate()).padStart(2, '0')
|
|
|
return `${y}-${m}-${d}`
|
|
|
},
|
|
|
- getDefaultThreeMonthsRange() {
|
|
|
+ getDefaultTwoMonthsRange() {
|
|
|
const end = new Date()
|
|
|
const start = new Date()
|
|
|
- start.setMonth(start.getMonth() - 3)
|
|
|
+ start.setMonth(start.getMonth() - 2)
|
|
|
return [this.formatDate(start), this.formatDate(end)]
|
|
|
},
|
|
|
initDefaultCreateTime() {
|
|
|
- const range = this.getDefaultThreeMonthsRange()
|
|
|
+ const range = this.getDefaultTwoMonthsRange()
|
|
|
this.createTime = range
|
|
|
this.queryParams.sTime = range[0]
|
|
|
this.queryParams.eTime = range[1]
|
|
|
@@ -350,14 +348,22 @@ export default {
|
|
|
},
|
|
|
getDefaultCompanyIds() {
|
|
|
const firstId = this.getFirstCompanyId()
|
|
|
- return firstId != null ? [firstId] : []
|
|
|
+ return firstId != null ? firstId : null
|
|
|
},
|
|
|
buildQueryParams() {
|
|
|
const params = { ...this.queryParams }
|
|
|
params.companyId = null
|
|
|
params.allCompany = 0
|
|
|
+ if (params.companyIds) {
|
|
|
+ params.companyIds = [params.companyIds]
|
|
|
+ } else {
|
|
|
+ params.companyIds = []
|
|
|
+ }
|
|
|
if (!params.companyIds || params.companyIds.length === 0) {
|
|
|
- params.companyIds = this.getDefaultCompanyIds()
|
|
|
+ const defaultId = this.getDefaultCompanyIds()
|
|
|
+ if (defaultId) {
|
|
|
+ params.companyIds = [defaultId]
|
|
|
+ }
|
|
|
}
|
|
|
return params
|
|
|
},
|
|
|
@@ -382,23 +388,24 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handleCompanyIdsChange(val) {
|
|
|
- if (!val || val.length === 0) {
|
|
|
- const defaultIds = this.getDefaultCompanyIds()
|
|
|
+ if (!val) {
|
|
|
+ const defaultId = this.getDefaultCompanyIds()
|
|
|
this.$nextTick(() => {
|
|
|
- this.queryParams.companyIds = defaultIds
|
|
|
+ this.queryParams.companyIds = defaultId
|
|
|
})
|
|
|
- if (defaultIds.length === 0) {
|
|
|
+ if (!defaultId) {
|
|
|
return
|
|
|
}
|
|
|
+ val = defaultId
|
|
|
}
|
|
|
this.queryParams.periodId = null
|
|
|
this.loadPeriodOptions()
|
|
|
},
|
|
|
loadPeriodOptions() {
|
|
|
const params = { pageNum: 1, pageSize: 9999 }
|
|
|
- const companyIds = this.queryParams.companyIds || []
|
|
|
- if (companyIds.length === 1) {
|
|
|
- params.companyId = companyIds[0]
|
|
|
+ const companyId = this.queryParams.companyIds
|
|
|
+ if (companyId) {
|
|
|
+ params.companyId = companyId
|
|
|
}
|
|
|
listPeriod(params).then(response => {
|
|
|
this.periodOptions = response.rows || []
|
|
|
@@ -426,12 +433,12 @@ export default {
|
|
|
createChange(val) {
|
|
|
if (val) {
|
|
|
const minDate = new Date()
|
|
|
- minDate.setMonth(minDate.getMonth() - 3)
|
|
|
+ minDate.setMonth(minDate.getMonth() - 2)
|
|
|
minDate.setHours(0, 0, 0, 0)
|
|
|
let start = new Date(val[0])
|
|
|
let end = new Date(val[1])
|
|
|
if (start.getTime() < minDate.getTime()) {
|
|
|
- this.$message.warning('创建时间最早只能选近三个月')
|
|
|
+ this.$message.warning('创建时间最早只能选近两个月')
|
|
|
start = minDate
|
|
|
}
|
|
|
const today = new Date()
|