|
|
@@ -1,29 +1,24 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
-<!-- <el-form-item label="客户编号" prop="customerCode">-->
|
|
|
-<!-- <el-input-->
|
|
|
-<!-- style="width:220px"-->
|
|
|
-<!-- v-model="queryParams.customerCode"-->
|
|
|
-<!-- placeholder="请输入客户编号"-->
|
|
|
-<!-- clearable-->
|
|
|
-<!-- size="small"-->
|
|
|
-<!-- @keyup.enter.native="handleQuery"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- <el-form-item label="员工姓名" prop="companyUserNickName">-->
|
|
|
-<!-- <el-input-->
|
|
|
-<!-- style="width:220px"-->
|
|
|
-<!-- v-model="queryParams.companyUserNickName"-->
|
|
|
-<!-- placeholder="请输入员工姓名"-->
|
|
|
-<!-- clearable-->
|
|
|
-<!-- size="small"-->
|
|
|
-<!-- @keyup.enter.native="handleQuery"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
+ <!-- 短信类型选择 -->
|
|
|
+ <el-form-item label="短信类型" prop="optionType">
|
|
|
+ <el-select
|
|
|
+ style="width:220px"
|
|
|
+ v-model="queryParams.optionType"
|
|
|
+ placeholder="请选择短信类型"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @change="optionTypeChange"
|
|
|
+ >
|
|
|
+ <el-option label="课程链接短信" :value="1" />
|
|
|
+ <el-option label="获客短信" :value="2" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="手机号" prop="phone">
|
|
|
<el-input
|
|
|
- style="width:220px"
|
|
|
+ style="width:220px"
|
|
|
v-model="queryParams.phone"
|
|
|
placeholder="请输入发送手机号"
|
|
|
clearable
|
|
|
@@ -31,72 +26,106 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="销售名称" prop="companyUserName">
|
|
|
+ <el-input
|
|
|
+ style="width:220px"
|
|
|
+ v-model="queryParams.companyUserName"
|
|
|
+ placeholder="请输入销售名称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="提交时间" prop="createTime">
|
|
|
- <el-date-picker
|
|
|
- style="width:220px"
|
|
|
- clearable size="small"
|
|
|
- v-model="dateRange"
|
|
|
- type="daterange"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期">
|
|
|
- </el-date-picker>
|
|
|
+ <el-date-picker
|
|
|
+ style="width:220px"
|
|
|
+ clearable size="small"
|
|
|
+ v-model="dateRange"
|
|
|
+ type="daterange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <!-- 课程链接类型特有查询条件,根据optionType动态显示 -->
|
|
|
+ <el-form-item label="课程" prop="courseId" v-if="queryParams.optionType == 1">
|
|
|
+ <el-select v-model="queryParams.courseId" placeholder="请选择课程" style="width:220px" size="mini" @change="courseChange">
|
|
|
+ <el-option
|
|
|
+ v-for="item in courseList"
|
|
|
+ :key="item.dictValue"
|
|
|
+ :label="item.dictLabel"
|
|
|
+ :value="item.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
-<!-- <el-form-item label="是否回复" prop="isReply">-->
|
|
|
-<!-- <el-select style="width:220px" v-model="queryParams.isReply" placeholder="请选择是否回复" clearable size="small">-->
|
|
|
-<!-- <el-option :key="1" label="是" :value="1"/>-->
|
|
|
-<!-- <el-option :key="0" label="否" :value="0"/>-->
|
|
|
-<!-- </el-select>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
+
|
|
|
+ <el-form-item label="小节" prop="videoId" v-if="queryParams.optionType == 1">
|
|
|
+ <el-select v-model="queryParams.videoId" placeholder="请选择小节" size="mini" style="width:220px">
|
|
|
+ <el-option
|
|
|
+ v-for="item in videoList"
|
|
|
+ :key="item.dictValue"
|
|
|
+ :label="item.dictLabel"
|
|
|
+ :value="item.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
<el-select style="width:220px" v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
|
|
|
- <el-option
|
|
|
- v-for="dict in statusOptions"
|
|
|
- :key="dict.dictValue"
|
|
|
- :label="dict.dictLabel"
|
|
|
- :value="dict.dictValue"
|
|
|
- />
|
|
|
+ <el-option
|
|
|
+ v-for="dict in statusOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="parseInt(dict.dictValue)"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
<el-form-item>
|
|
|
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
- <el-button
|
|
|
- type="warning"
|
|
|
- icon="el-icon-download"
|
|
|
- size="mini"
|
|
|
- @click="handleExport"
|
|
|
- v-hasPermi="['company:companySmsLogs:export']"
|
|
|
- >导出</el-button>
|
|
|
+<!-- <el-button-->
|
|
|
+<!-- type="warning"-->
|
|
|
+<!-- icon="el-icon-download"-->
|
|
|
+<!-- size="mini"-->
|
|
|
+<!-- @click="handleExport"-->
|
|
|
+<!-- v-hasPermi="['company:companySmsLogs:export']"-->
|
|
|
+<!-- >导出</el-button>-->
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
<el-table height="500" border v-loading="loading" :data="companySmsLogsList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
-<!-- <el-table-column label="ID" align="center" prop="logsId" />-->
|
|
|
-<!-- <el-table-column label="客户编码" align="center" prop="customerCode" />-->
|
|
|
-<!-- <el-table-column label="客户名称" align="center" prop="customerName" :show-overflow-tooltip="true">-->
|
|
|
-<!-- <template slot-scope="scope">-->
|
|
|
-<!-- <el-link @click="handleShow(scope.row)" :underline="false" type="primary" >{{scope.row.customerName}}</el-link>-->
|
|
|
-<!-- </template>-->
|
|
|
-<!-- </el-table-column>-->
|
|
|
- <el-table-column label="手机号" align="center" prop="phone" />
|
|
|
- <el-table-column label="短信内容" show-overflow-tooltip align="center" prop="content" />
|
|
|
-<!-- <el-table-column label="发送者" align="center" prop="companyUserNickName" />-->
|
|
|
- <el-table-column label="提交时间" align="center" prop="createTime" width="180">
|
|
|
+ <el-table-column label="手机号" align="center" prop="phone" width="120" />
|
|
|
+ <el-table-column label="状态" align="center" prop="status" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag :type="scope.row.status == 1 ? 'success' : 'danger'">
|
|
|
+ {{ getStatusLabel(scope.row.status) }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="发送时间" align="center" prop="sendTime" width="180">
|
|
|
+ <el-table-column label="短信内容" show-overflow-tooltip align="center" prop="content" min-width="200" />
|
|
|
+ <el-table-column label="销售名称" align="center" prop="companyUserName" width="120" />
|
|
|
+ <!-- 根据optionType动态显示课程相关列 -->
|
|
|
+ <el-table-column v-if="queryParams.optionType == 1" label="课程名称" align="center" prop="courseName" width="150" />
|
|
|
+ <el-table-column v-if="queryParams.optionType == 1" label="小节名称" align="center" prop="videoTitle" width="150" />
|
|
|
+ <el-table-column label="提交时间" align="center" prop="createTime" width="160">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.createTime}}</span>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="状态" align="center" prop="status" >
|
|
|
+ <el-table-column label="发送时间" align="center" prop="sendTime" width="160">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag prop="status" v-for="(item, index) in statusOptions" :type="scope.row.status==1?'success':'danger'" v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
|
|
|
+ <span>{{scope.row.sendTime}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-<!-- <el-table-column label="回复内容" align="center" prop="replyContent" />-->
|
|
|
-
|
|
|
</el-table>
|
|
|
|
|
|
<pagination
|
|
|
@@ -109,29 +138,34 @@
|
|
|
|
|
|
<el-drawer
|
|
|
size="75%"
|
|
|
- :title="show.title" :visible.sync="show.open"
|
|
|
- >
|
|
|
- <customer-details ref="customerDetails" />
|
|
|
+ :title="show.title"
|
|
|
+ :visible.sync="show.open"
|
|
|
+ >
|
|
|
+ <customer-details ref="customerDetails" />
|
|
|
</el-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listCompanySmsLogs, getCompanySmsLogs, delCompanySmsLogs, addCompanySmsLogs, updateCompanySmsLogs, exportCompanySmsLogs } from "@/api/company/companySmsLogs";
|
|
|
+import { getCmsLogList, exportCompanySmsLogs } from "@/api/company/companySmsLogs";
|
|
|
+import { courseList, videoList } from "@/api/course/courseRedPacketLog";
|
|
|
import Editor from '@/components/Editor';
|
|
|
import customerDetails from '../../crm/components/customerDetails.vue';
|
|
|
|
|
|
export default {
|
|
|
name: "CompanySmsLogs",
|
|
|
- components: { customerDetails,Editor },
|
|
|
+ components: { customerDetails, Editor },
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
- show:{
|
|
|
- title:"客户详情",
|
|
|
- open:false,
|
|
|
+ show: {
|
|
|
+ title: "客户详情",
|
|
|
+ open: false,
|
|
|
},
|
|
|
- statusOptions:[],
|
|
|
+ statusOptions: [],
|
|
|
+ // 课程列表
|
|
|
+ courseList: [],
|
|
|
+ // 小节列表
|
|
|
+ videoList: [],
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 选中数组
|
|
|
@@ -144,7 +178,7 @@ export default {
|
|
|
showSearch: true,
|
|
|
// 总条数
|
|
|
total: 0,
|
|
|
- dateRange:[],
|
|
|
+ dateRange: [],
|
|
|
// 短信发送记录表格数据
|
|
|
companySmsLogsList: [],
|
|
|
// 弹出层标题
|
|
|
@@ -155,52 +189,125 @@ export default {
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
+ optionType: 1, // 默认显示课程链接短信
|
|
|
companyId: null,
|
|
|
- userId: null,
|
|
|
- customerId: null,
|
|
|
- tempId: null,
|
|
|
- tempCode: null,
|
|
|
+ companyUserName: null, // 销售名称
|
|
|
phone: null,
|
|
|
- content: null,
|
|
|
- sendTime: null,
|
|
|
status: null,
|
|
|
- isReply:null,
|
|
|
+ courseId: null,
|
|
|
+ videoId: null,
|
|
|
+ beginCreateTime: null,
|
|
|
+ endCreateTime: null
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
- rules: {
|
|
|
- }
|
|
|
+ rules: {}
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getDicts("sys_company_sms_logs_status").then((response) => {
|
|
|
this.statusOptions = response.data;
|
|
|
});
|
|
|
+ // 获取课程列表
|
|
|
+ this.getCourseList();
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
- handleShow(row){
|
|
|
- var that=this;
|
|
|
- that.show.open=true;
|
|
|
+ /** 获取状态标签 */
|
|
|
+ getStatusLabel(status) {
|
|
|
+ const statusItem = this.statusOptions.find(item => parseInt(item.dictValue) === status);
|
|
|
+ return statusItem ? statusItem.dictLabel : '未知';
|
|
|
+ },
|
|
|
+
|
|
|
+ handleShow(row) {
|
|
|
+ var that = this;
|
|
|
+ that.show.open = true;
|
|
|
setTimeout(() => {
|
|
|
- that.$refs.customerDetails.getDetails(row.customerId);
|
|
|
+ that.$refs.customerDetails.getDetails(row.customerId);
|
|
|
}, 200);
|
|
|
},
|
|
|
+
|
|
|
+ /** 获取课程列表 */
|
|
|
+ getCourseList() {
|
|
|
+ courseList().then(response => {
|
|
|
+ if (response && Array.isArray(response.list)) {
|
|
|
+ this.courseList = response.list;
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.error('获取课程列表失败:', error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 短信类型变化 */
|
|
|
+ optionTypeChange(value) {
|
|
|
+ // 切换短信类型时,清空课程和小节相关数据
|
|
|
+ this.queryParams.courseId = null;
|
|
|
+ this.queryParams.videoId = null;
|
|
|
+ this.videoList = [];
|
|
|
+
|
|
|
+ // 如果不是课程链接类型,清空课程列表
|
|
|
+ if (value !== 1) {
|
|
|
+ this.courseList = [];
|
|
|
+ this.videoList = [];
|
|
|
+ } else {
|
|
|
+ // 如果是课程链接类型,重新获取课程列表
|
|
|
+ this.getCourseList();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 重新查询
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 课程选择变化 */
|
|
|
+ courseChange(courseId) {
|
|
|
+ // 清空小节选择
|
|
|
+ this.queryParams.videoId = null;
|
|
|
+ // 清空小节列表
|
|
|
+ this.videoList = [];
|
|
|
+
|
|
|
+ if (courseId) {
|
|
|
+ // 获取对应课程的小节列表
|
|
|
+ videoList(courseId).then(response => {
|
|
|
+ if (response && Array.isArray(response.list)) {
|
|
|
+ this.videoList = response.list;
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.error('获取小节列表失败:', error);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
/** 查询短信发送记录列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- listCompanySmsLogs(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
|
|
+
|
|
|
+ // 处理日期范围参数
|
|
|
+ const params = { ...this.queryParams };
|
|
|
+ if (this.dateRange && this.dateRange.length === 2) {
|
|
|
+ params.beginCreateTime = this.dateRange[0];
|
|
|
+ params.endCreateTime = this.dateRange[1];
|
|
|
+ } else {
|
|
|
+ params.beginCreateTime = null;
|
|
|
+ params.endCreateTime = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ getCmsLogList(params).then(response => {
|
|
|
this.companySmsLogsList = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
+ }).catch(error => {
|
|
|
+ this.loading = false;
|
|
|
+ console.error('查询失败:', error);
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
|
this.reset();
|
|
|
},
|
|
|
+
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
@@ -218,89 +325,58 @@ export default {
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
+
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
+
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
this.resetForm("queryForm");
|
|
|
+ // 重置所有查询参数
|
|
|
+ this.queryParams = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ optionType: 1,
|
|
|
+ companyId: null,
|
|
|
+ companyUserName: null,
|
|
|
+ phone: null,
|
|
|
+ status: null,
|
|
|
+ courseId: null,
|
|
|
+ videoId: null,
|
|
|
+ beginCreateTime: null,
|
|
|
+ endCreateTime: null
|
|
|
+ };
|
|
|
+ this.dateRange = [];
|
|
|
+ this.videoList = [];
|
|
|
+ this.getCourseList();
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
- // 多选框选中数据
|
|
|
- handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.logsId)
|
|
|
- this.single = selection.length!==1
|
|
|
- this.multiple = !selection.length
|
|
|
- },
|
|
|
- /** 新增按钮操作 */
|
|
|
- handleAdd() {
|
|
|
- this.reset();
|
|
|
- this.open = true;
|
|
|
- this.title = "添加短信发送记录";
|
|
|
- },
|
|
|
- /** 修改按钮操作 */
|
|
|
- handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
- const logsId = row.logsId || this.ids
|
|
|
- getCompanySmsLogs(logsId).then(response => {
|
|
|
- this.form = response.data;
|
|
|
- this.open = true;
|
|
|
- this.title = "修改短信发送记录";
|
|
|
- });
|
|
|
- },
|
|
|
- /** 提交按钮 */
|
|
|
- submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- if (this.form.logsId != null) {
|
|
|
- updateCompanySmsLogs(this.form).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- addCompanySmsLogs(this.form).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- /** 删除按钮操作 */
|
|
|
- handleDelete(row) {
|
|
|
- const logsIds = row.logsId || this.ids;
|
|
|
- this.$confirm('是否确认删除短信发送记录编号为"' + logsIds + '"的数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return delCompanySmsLogs(logsIds);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- }).catch(function() {});
|
|
|
- },
|
|
|
+
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
- const queryParams = this.queryParams;
|
|
|
+ const params = { ...this.queryParams };
|
|
|
+ if (this.dateRange && this.dateRange.length === 2) {
|
|
|
+ params.beginCreateTime = this.dateRange[0];
|
|
|
+ params.endCreateTime = this.dateRange[1];
|
|
|
+ }
|
|
|
+
|
|
|
this.$confirm('是否确认导出所有短信发送记录数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return exportCompanySmsLogs(queryParams);
|
|
|
- }).then(response => {
|
|
|
- this.download(response.msg);
|
|
|
- }).catch(function() {});
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ return exportCompanySmsLogs(params);
|
|
|
+ }).then(response => {
|
|
|
+ this.download(response.msg);
|
|
|
+ }).catch(() => {});
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+/* 可以根据需要添加样式 */
|
|
|
+</style>
|