Commit a0581383 by crushh

update: dist

parent f427480c
......@@ -101,20 +101,25 @@ export default {
},
pickerOptionsMonth: {
onPick(time) {
console.log(time);
// 起始时间:仅半年范围内 && 结束时间:跨度最多3个月,即所选起始时间往后+90天为上限;
if (!time.maxDate) {
const minTimeRange = 90 * 24 * 60 * 60 * 1000; // 3个月
const maxTimeRange = 180 * 24 * 60 * 60 * 1000; // 6个月
minTimeMonth = time.minDate.getTime() - minTimeRange > new Date(new Date().toLocaleDateString()).getTime() ? time.minDate.getTime() - minTimeRange : new Date(new Date().toLocaleDateString()).getTime();
maxTimeMonth = time.minDate.getTime() + minTimeRange < new Date().getTime() + maxTimeRange ? time.minDate.getTime() + minTimeRange : new Date().getTime() + maxTimeRange;
const maxRange = new Date().getMonth() + 5;
const selectRange = new Date(time.minDate).getMonth() + 2;
console.log(new Date(time.minDate).getMonth());
console.log(new Date().getMonth());
// minTimeMonth = new Date(time.minDate).getMonth() - new Date().getMonth() >= 3 ? new Date(time.minDate).getMonth() - 1 : new Date().getMonth() + 1;
minTimeMonth = new Date(time.minDate).getMonth() - new Date().getMonth() >= 3 ? new Date(time.minDate).getMonth() - 1 : new Date().getMonth();
maxTimeMonth = maxRange - selectRange > 0 ? (maxRange - selectRange >= 3 ? selectRange : maxRange - selectRange) : maxRange;
}
},
disabledDate: time => {
const maxTimeRange = 180 * 24 * 60 * 60 * 1000; // 6个月
if (maxTimeMonth) {
return time.getTime() < minTimeMonth || time.getTime() > maxTimeMonth;
let month = new Date(time).getMonth();
if (minTimeMonth && maxTimeMonth) {
return month < minTimeMonth || month > maxTimeMonth || new Date(time).getFullYear() != new Date().getFullYear();
} else {
return time.getTime() < new Date(new Date().getFullYear(), new Date().getMonth(), 1).getTime() || time.getTime() > new Date().getTime() + maxTimeRange;
return month < new Date().getMonth() || month > new Date().getMonth() + 5 || new Date(time).getFullYear() != new Date().getFullYear();
}
}
},
......@@ -138,13 +143,14 @@ export default {
computed: {
activeTime() {
let str = '';
if (this.form.birth_type == 1 && this.form.birthDate1 && this.form.birthDate1.length) {
str = formatDateTimeByType(this.form.birthDate1[0], 'yyyy-MM-dd') + ' 至 ' + formatDateTimeByType(this.form.birthDate1[1], 'yyyy-MM-dd');
} else if (this.form.birth_type == 2 && this.form.birthDate2 && this.form.birthDate2.length) {
str = formatDateTimeByType(this.form.birthDate2[0], 'yyyy-MM-dd') + ' 至 ' + formatDateTimeByType(this.form.birthDate2[1], 'yyyy-MM-dd');
} else if (this.form.birth_type == 3 && this.form.birthDate1 && this.form.birthDate1.length) {
let start = this.form.birthDate1[0] - this.form.birth_days * 24 * 60 * 60 * 1000;
let end = this.form.birthDate1[1] - this.form.birth_days * 24 * 60 * 60 * 1000;
const { birth_type, birthDate1, birth_days, birthDate2 } = this.form;
if (birth_type == 1 && birthDate1 && birthDate1.length) {
str = formatDateTimeByType(birthDate1[0], 'yyyy-MM-dd') + ' 至 ' + formatDateTimeByType(birthDate1[1], 'yyyy-MM-dd');
} else if (birth_type == 2 && birthDate2 && birthDate2.length) {
str = formatDateTimeByType(new Date(birthDate2[0]).getMonth() + 1 == new Date().getMonth() + 1 ? this.currentTime : birthDate2[0], 'yyyy-MM-dd') + ' 至 ' + formatDateTimeByType(birthDate2[1], 'yyyy-MM-dd');
} else if (birth_type == 3 && birthDate1 && birthDate1.length) {
let start = birthDate1[0] - birth_days * 24 * 60 * 60 * 1000;
let end = birthDate1[1] - birth_days * 24 * 60 * 60 * 1000;
str = formatDateTimeByType(start, 'yyyy-MM-dd') + ' 至 ' + formatDateTimeByType(end, 'yyyy-MM-dd');
}
return str;
......@@ -180,7 +186,7 @@ export default {
obj.startDate = birthDate1[0] - birth_days * 24 * 60 * 60 * 1000;
obj.endDate = birthDate1[1] - birth_days * 24 * 60 * 60 * 1000;
} else if (birth_type == 2) {
obj.startDate = this.currentTime;
obj.startDate = new Date(birthDate2[0]).getMonth() + 1 == new Date().getMonth() + 1 ? this.currentTime : birthDate2[0];
obj.endDate = birthDate2[1];
} else {
obj.startDate = birthDate1[0];
......
......@@ -265,7 +265,7 @@ export default {
}
],
money: 0,
disableCreate: 1
canCreate: 0
};
},
mounted() {
......@@ -320,7 +320,7 @@ export default {
},
methods: {
create(scene, id) {
if (this.disableCreate) {
if (!this.canCreate) {
this.$confirm(`当前账户已无可用余额,请充值后再${id ? '复制' : '创建'}外呼任务`, '提示', {
confirmButtonText: '去充值',
cancelButtonText: '取消',
......@@ -353,7 +353,7 @@ export default {
async getAiAccountCheck() {
const { result } = await aiAccountCheck();
console.log(result);
this.disableCreate = result;
this.canCreate = result;
},
async getTableData() {
this.loading = true;
......@@ -382,8 +382,8 @@ export default {
obj[element.activityId] = element;
});
this.tableData.forEach(item => {
if (obj[item.activityPlanStatus]) {
const { marketingNumber, outboundNumber, totalConnectionNumber, telephoneConnectionRate, connectionIntentionRate } = obj[item.activityPlanStatus];
if (obj[item.activityId]) {
const { marketingNumber, outboundNumber, totalConnectionNumber, telephoneConnectionRate, connectionIntentionRate } = obj[item.activityId];
item.marketingNumber = marketingNumber;
item.outboundNumber = outboundNumber;
item.totalConnectionNumber = totalConnectionNumber;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment