|
@@ -291,6 +291,28 @@
|
|
|
>批量移除标签</el-button>
|
|
>批量移除标签</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ <el-col :span="1.5" v-if="queryParams.sendType == 2">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="success"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="handleBatchUpdateNotes"
|
|
|
|
|
+ v-hasPermi="['qw:externalContact:edit']"
|
|
|
|
|
+ >批量修改备注
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1.5" v-if="queryParams.sendType == 2">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="success"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="handleBatchUpdateNotesFilter"
|
|
|
|
|
+ v-hasPermi="['qw:externalContact:edit']"
|
|
|
|
|
+ >批量修改备注(筛选条件)
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
@@ -518,7 +540,7 @@
|
|
|
@click="tagSelection(tagItem)"
|
|
@click="tagSelection(tagItem)"
|
|
|
:class="{ 'tag-selected': tagItem.isSelected }"
|
|
:class="{ 'tag-selected': tagItem.isSelected }"
|
|
|
>
|
|
>
|
|
|
- {{ tagItem.name }}
|
|
|
|
|
|
|
+ {{ tagItem.name }} 【{{tagItem.corpName}}】
|
|
|
</a>
|
|
</a>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -587,7 +609,53 @@
|
|
|
<el-button @click="resultDialogVisible = false">关闭</el-button>
|
|
<el-button @click="resultDialogVisible = false">关闭</el-button>
|
|
|
</span>
|
|
</span>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
-
|
|
|
|
|
|
|
+ <el-dialog title="批量添加客户备注" :visible.sync="notesOpen.open" width="800px" append-to-body>
|
|
|
|
|
+ <el-card>
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col>
|
|
|
|
|
+ <el-radio-group v-model="notesOpen.nameType" style="margin-bottom: 2%">
|
|
|
|
|
+ <el-radio :label="1">
|
|
|
|
|
+ 客户名称添加在【新备注】【前】
|
|
|
|
|
+ </el-radio>
|
|
|
|
|
+ <el-radio :label="2">
|
|
|
|
|
+ 客户名称添加在【新备注】【后】
|
|
|
|
|
+ </el-radio>
|
|
|
|
|
+ <el-radio :label="3">
|
|
|
|
|
+ 不添加客户名称
|
|
|
|
|
+ </el-radio>
|
|
|
|
|
+ </el-radio-group>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col>
|
|
|
|
|
+ <el-radio-group v-model="notesOpen.type">
|
|
|
|
|
+ <el-radio
|
|
|
|
|
+ :label="1"
|
|
|
|
|
+ >添加【新备注】在最【前】面
|
|
|
|
|
+ </el-radio>
|
|
|
|
|
+ <el-radio
|
|
|
|
|
+ :label="2"
|
|
|
|
|
+ >添加【新备注】在最【后】面
|
|
|
|
|
+ </el-radio>
|
|
|
|
|
+ <el-radio
|
|
|
|
|
+ :label="3"
|
|
|
|
|
+ >替换所有备注
|
|
|
|
|
+ </el-radio>
|
|
|
|
|
+ </el-radio-group>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col>
|
|
|
|
|
+ <el-input v-model="notesOpen.notes" placeholder="请输入客户备注(最多20个字,含已有的)" clearable size="small"
|
|
|
|
|
+ maxlength="20" show-word-limit style="width: 500px;margin-top: 3%"/>
|
|
|
|
|
+ <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
|
|
|
|
|
+ <i class="el-icon-info"></i>
|
|
|
|
|
+ 由于企业微信官方限制,备注最多20个字,且自动会去除末尾超出的字
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button type="primary" @click="notesSubmitForm()">确 定</el-button>
|
|
|
|
|
+ <el-button @click="notesCancel()">取消</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -605,7 +673,7 @@ import {courseList, myListCourseRedPacketLog, videoList} from '@/api/course/cour
|
|
|
import {myListLogs} from "@/api/course/courseAnswerlogs";
|
|
import {myListLogs} from "@/api/course/courseAnswerlogs";
|
|
|
import {getMyQwUserList} from "@/api/qw/user";
|
|
import {getMyQwUserList} from "@/api/qw/user";
|
|
|
import {searchTags} from "../../../api/qw/tag";
|
|
import {searchTags} from "../../../api/qw/tag";
|
|
|
-import {addTagByWatch, delTagByWatch} from "../../../api/qw/externalContact";
|
|
|
|
|
|
|
+import {addTagByWatch, delTagByWatch,batchUpdateExternalContactNotes,batchUpdateExternalContactNotesByWatchLog} from "../../../api/qw/externalContact";
|
|
|
import {allListTagGroup} from "../../../api/qw/tagGroup";
|
|
import {allListTagGroup} from "../../../api/qw/tagGroup";
|
|
|
import Vue from 'vue'
|
|
import Vue from 'vue'
|
|
|
import Calendar from 'vue-mobile-calendar'
|
|
import Calendar from 'vue-mobile-calendar'
|
|
@@ -781,7 +849,15 @@ export default {
|
|
|
// 表单参数
|
|
// 表单参数
|
|
|
form: {},
|
|
form: {},
|
|
|
// 表单校验
|
|
// 表单校验
|
|
|
- rules: {}
|
|
|
|
|
|
|
+ rules: {},
|
|
|
|
|
+ notesOpen: {
|
|
|
|
|
+ type: 1,
|
|
|
|
|
+ nameType: 3,
|
|
|
|
|
+ addType: 0,
|
|
|
|
|
+ filter: false,
|
|
|
|
|
+ open: false,
|
|
|
|
|
+ notes: null,
|
|
|
|
|
+ },
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -854,10 +930,10 @@ export default {
|
|
|
this.qecCreateTime = [];
|
|
this.qecCreateTime = [];
|
|
|
this.periodTime = [];
|
|
this.periodTime = [];
|
|
|
|
|
|
|
|
- this.scheduleTimeText = '';
|
|
|
|
|
- this.createTimeText = '';
|
|
|
|
|
- this.updateTimeText = '';
|
|
|
|
|
- this.qecCreateTimeText = '';
|
|
|
|
|
|
|
+ this.scheduleTimeText = [];
|
|
|
|
|
+ this.createTimeText = [];
|
|
|
|
|
+ this.updateTimeText = [];
|
|
|
|
|
+ this.qecCreateTimeText = [];
|
|
|
this.periodTimeText = [];
|
|
this.periodTimeText = [];
|
|
|
|
|
|
|
|
// 强制刷新日历组件
|
|
// 强制刷新日历组件
|
|
@@ -904,31 +980,48 @@ export default {
|
|
|
// 营期时间
|
|
// 营期时间
|
|
|
handleScheduleTimeChange(scheduleTime) {
|
|
handleScheduleTimeChange(scheduleTime) {
|
|
|
if (scheduleTime && scheduleTime.length >= 2) {
|
|
if (scheduleTime && scheduleTime.length >= 2) {
|
|
|
|
|
+ if(!this.checkDateRangeLimit(scheduleTime)){
|
|
|
|
|
+ this.scheduleTimeText = null;
|
|
|
|
|
+ this.queryParams.scheduleStartTime=null;
|
|
|
|
|
+ this.queryParams.scheduleStartTime=null;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// this.scheduleTimeText = this.formatDateRange(scheduleTime);
|
|
// this.scheduleTimeText = this.formatDateRange(scheduleTime);
|
|
|
this.queryParams.scheduleStartTime = scheduleTime[0] || null;
|
|
this.queryParams.scheduleStartTime = scheduleTime[0] || null;
|
|
|
this.queryParams.scheduleEndTime = scheduleTime[1] || null;
|
|
this.queryParams.scheduleEndTime = scheduleTime[1] || null;
|
|
|
- console.log(this.queryParams.scheduleStartTime)
|
|
|
|
|
- console.log(this.queryParams.scheduleEndTime)
|
|
|
|
|
} else {
|
|
} else {
|
|
|
this.scheduleTimeText = [];
|
|
this.scheduleTimeText = [];
|
|
|
this.queryParams.scheduleStartTime = null;
|
|
this.queryParams.scheduleStartTime = null;
|
|
|
this.queryParams.scheduleEndTime = null;
|
|
this.queryParams.scheduleEndTime = null;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ checkDateRangeLimit(dateRange) {
|
|
|
|
|
+ if (dateRange && dateRange.length >= 2) {
|
|
|
|
|
+ const startDate = new Date(dateRange[0]);
|
|
|
|
|
+ const endDate = new Date(dateRange[1]);
|
|
|
|
|
+
|
|
|
|
|
+ // 设置时间为当天开始,避免时间部分影响计算
|
|
|
|
|
+ startDate.setHours(0, 0, 0, 0);
|
|
|
|
|
+ endDate.setHours(0, 0, 0, 0);
|
|
|
|
|
+
|
|
|
|
|
+ const timeDiff = Math.abs(endDate - startDate);
|
|
|
|
|
+ const diffDays = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
|
|
|
|
|
+
|
|
|
|
|
+ if (diffDays > 31) { // maxDays-1 因为包含起始日
|
|
|
|
|
+ this.$message.warning('时间区间不能超过一个月');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ },
|
|
|
// 创建时间
|
|
// 创建时间
|
|
|
createChange(createTime) {
|
|
createChange(createTime) {
|
|
|
if (createTime && createTime.length >= 2) {
|
|
if (createTime && createTime.length >= 2) {
|
|
|
- const startDate = new Date(createTime[0]);
|
|
|
|
|
- const endDate = new Date(createTime[1]);
|
|
|
|
|
- const timeDiff = Math.abs(endDate.getTime() - startDate.getTime());
|
|
|
|
|
- const diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
|
|
|
|
|
-
|
|
|
|
|
- // 限制时间区间为一个月
|
|
|
|
|
- if (diffDays > 31) {
|
|
|
|
|
- this.$message.warning('创建时间区间不能超过一个月');
|
|
|
|
|
|
|
+ if(!this.checkDateRangeLimit(createTime)){
|
|
|
this.createTimeText = null;
|
|
this.createTimeText = null;
|
|
|
- this.queryParams.sTime = null;
|
|
|
|
|
- this.queryParams.eTime = null;
|
|
|
|
|
|
|
+ this.queryParams.sTime=null;
|
|
|
|
|
+ this.queryParams.eTime=null;
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -945,6 +1038,13 @@ export default {
|
|
|
// 更新时间
|
|
// 更新时间
|
|
|
updateChange(updateTime) {
|
|
updateChange(updateTime) {
|
|
|
if (updateTime && updateTime.length >= 2) {
|
|
if (updateTime && updateTime.length >= 2) {
|
|
|
|
|
+ if(!this.checkDateRangeLimit(updateTime)){
|
|
|
|
|
+ this.updateTimeText = null;
|
|
|
|
|
+ this.queryParams.upSTime=null;
|
|
|
|
|
+ this.queryParams.upETime=null;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// this.updateTimeText = this.formatDateRange(updateTime);
|
|
// this.updateTimeText = this.formatDateRange(updateTime);
|
|
|
this.queryParams.upSTime = updateTime[0] || null;
|
|
this.queryParams.upSTime = updateTime[0] || null;
|
|
|
this.queryParams.upETime = updateTime[1] || null;
|
|
this.queryParams.upETime = updateTime[1] || null;
|
|
@@ -1057,11 +1157,14 @@ export default {
|
|
|
|
|
|
|
|
/** 查询短链课程看课记录列表 */
|
|
/** 查询短链课程看课记录列表 */
|
|
|
getList() {
|
|
getList() {
|
|
|
- // xgb 看课数据量太大必须限制时间
|
|
|
|
|
- if (!this.createTimeText) {
|
|
|
|
|
- this.$message.warning('请选择创建时间');
|
|
|
|
|
|
|
+ // xgb 看课数据量太大必须限制时间if (this.isEmptyArray(this.createTimeText) &&
|
|
|
|
|
+ if (this.isEmptyArray(this.createTimeText) &&
|
|
|
|
|
+ this.isEmptyArray(this.updateTimeText) &&
|
|
|
|
|
+ this.isEmptyArray(this.scheduleTimeText)) {
|
|
|
|
|
+ this.$message.warning('请选择创建时间或营期时间或最新更新时间');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
let param = JSON.parse(JSON.stringify(this.queryParams));
|
|
let param = JSON.parse(JSON.stringify(this.queryParams));
|
|
|
if (param.logType == "10") {
|
|
if (param.logType == "10") {
|
|
@@ -1071,6 +1174,8 @@ export default {
|
|
|
this.courseWatchLogList = response.rows;
|
|
this.courseWatchLogList = response.rows;
|
|
|
this.total = response.total;
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.loading = false;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 取消按钮
|
|
// 取消按钮
|
|
@@ -1196,10 +1301,17 @@ export default {
|
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ // 添加辅助方法
|
|
|
|
|
+ isEmptyArray(arr) {
|
|
|
|
|
+ return !arr || arr.length === 0;
|
|
|
|
|
+ },
|
|
|
/** 导出按钮操作 */
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
handleExport() {
|
|
|
- if (!this.createTimeText) {
|
|
|
|
|
- this.$message.warning('请选择创建时间');
|
|
|
|
|
|
|
+ // xgb 看课数据量太大必须限制时间
|
|
|
|
|
+ if (this.isEmptyArray(this.createTimeText) &&
|
|
|
|
|
+ this.isEmptyArray(this.updateTimeText) &&
|
|
|
|
|
+ this.isEmptyArray(this.scheduleTimeText)) {
|
|
|
|
|
+ this.$message.warning('请选择创建时间或营期时间或最新更新时间');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
const queryParams = this.queryParams;
|
|
const queryParams = this.queryParams;
|
|
@@ -1486,6 +1598,69 @@ export default {
|
|
|
this.queryParams.sopId = null;
|
|
this.queryParams.sopId = null;
|
|
|
this.sopSearchText = '';
|
|
this.sopSearchText = '';
|
|
|
},
|
|
},
|
|
|
|
|
+ handleBatchUpdateNotesFilter() {
|
|
|
|
|
+ this.notesOpen.open = true;
|
|
|
|
|
+ this.notesOpen.filter = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ handleBatchUpdateNotes() {
|
|
|
|
|
+
|
|
|
|
|
+ if (this.ids == null || this.ids == "") {
|
|
|
|
|
+ return this.$message('请选择需要添加备注的客户');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.notesOpen.open = true;
|
|
|
|
|
+ this.notesOpen.filter = false;
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ notesCancel(){
|
|
|
|
|
+ this.notesOpen={
|
|
|
|
|
+ open: false,
|
|
|
|
|
+ notes: null,
|
|
|
|
|
+ type: 1,
|
|
|
|
|
+ nameType:3,
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ notesSubmitForm() {
|
|
|
|
|
+
|
|
|
|
|
+ if (this.notesOpen.notes == null || this.notesOpen.notes == "") {
|
|
|
|
|
+ return this.$message.error("请输入备注内容");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // let loadingRock = this.$loading({
|
|
|
|
|
+ // lock: true,
|
|
|
|
|
+ // text: '正在执行中请稍后~~请不要刷新页面!!',
|
|
|
|
|
+ // spinner: 'el-icon-loading',
|
|
|
|
|
+ // background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
+ // });
|
|
|
|
|
+
|
|
|
|
|
+ let obj = JSON.parse(JSON.stringify(this.queryParams))
|
|
|
|
|
+ console.log(obj);
|
|
|
|
|
+ if(obj.tagIds !== null && obj.tagIds !== undefined && obj.tagIds !== ''){
|
|
|
|
|
+ obj.tagIds = obj.tagIds.split(",");
|
|
|
|
|
+ }
|
|
|
|
|
+ batchUpdateExternalContactNotesByWatchLog({
|
|
|
|
|
+ // addType: 0,
|
|
|
|
|
+ watchLogIds: this.ids,
|
|
|
|
|
+ notes: this.notesOpen.notes,
|
|
|
|
|
+ type: this.notesOpen.type,
|
|
|
|
|
+ nameType: this.notesOpen.nameType,
|
|
|
|
|
+ filter: this.notesOpen.filter,
|
|
|
|
|
+ watchLogParam: obj,
|
|
|
|
|
+ fromMyList:1
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+
|
|
|
|
|
+ this.resultMessage = res.msg;
|
|
|
|
|
+ this.$message.success("正在执行中...");
|
|
|
|
|
+ // this.resultDialogVisible = true; // 显示弹窗
|
|
|
|
|
+ // this.resultTitle = '批量修改备注结果';
|
|
|
|
|
+
|
|
|
|
|
+ }).finally(res => {
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ // loadingRock.close();
|
|
|
|
|
+ this.notesCancel();
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|