|
|
@@ -258,6 +258,13 @@
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['his:userCompanyUser:remove']"
|
|
|
>删除</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-refresh-left"
|
|
|
+ @click="handleClearWatchRecord(scope.row)"
|
|
|
+ v-hasPermi="['his:user:clearUserWatchRecord']"
|
|
|
+ >清除看课记录</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -387,6 +394,25 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <el-dialog title="选择项目" :visible.sync="projectSelectForClearDialogVisible" width="400px">
|
|
|
+ <el-form :model="clearWatchRecordParams" style="margin-top: 15px;">
|
|
|
+ <el-form-item label="选择项目" :label-width="100">
|
|
|
+ <el-select v-model="clearWatchRecordParams.projectId" placeholder="请选择项目" style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="option in projectOptions"
|
|
|
+ :key="option.dictValue"
|
|
|
+ :label="option.dictLabel"
|
|
|
+ :value="option.dictValue">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="projectSelectForClearDialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="confirmClearWatchRecord">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 转移导入 -->
|
|
|
<el-dialog :title="transferUploadDialog.title"
|
|
|
:visible.sync="transferUploadDialog.visible"
|
|
|
@@ -397,7 +423,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {listUserByProject, getUser, addUser, updateUser, exportUser, delUserCompanyUser,exportListProject} from "@/api/his/user";
|
|
|
+import {listUserByProject, getUser, addUser, updateUser, exportUser, delUserCompanyUser,exportListProject,clearUserWatchRecord} from "@/api/his/user";
|
|
|
import { getCompanyUserList, changeCompanyUser, getCompanyList } from '@/api/company/companyUser';
|
|
|
import userDetailsByNew from '@/views/his/user/userDetails.vue'
|
|
|
import transferUpload from './transferUpload.vue'
|
|
|
@@ -428,6 +454,15 @@ export default {
|
|
|
title:"会员详情",
|
|
|
open:false,
|
|
|
},
|
|
|
+ clearWatchRecordDialog: {
|
|
|
+ visible: false,
|
|
|
+ title: '清除看课记录',
|
|
|
+ userId: null
|
|
|
+ },
|
|
|
+ clearWatchRecordParams: {
|
|
|
+ projectId: null
|
|
|
+ },
|
|
|
+ projectSelectForClearDialogVisible: false,
|
|
|
// 用户表格数据
|
|
|
userList: [],
|
|
|
// 弹出层标题
|
|
|
@@ -560,7 +595,34 @@ export default {
|
|
|
this.companyQueryUserOptions = [];
|
|
|
}
|
|
|
},
|
|
|
+ handleClearWatchRecord(row) {
|
|
|
+ this.clearWatchRecordParams.projectId = null; // 重置项目选择
|
|
|
+ this.clearWatchRecordDialog.userId = row.userId;
|
|
|
+ this.projectSelectForClearDialogVisible = true;
|
|
|
+ },
|
|
|
+ /** 确认清除看课记录方法 */
|
|
|
+ confirmClearWatchRecord() {
|
|
|
+ this.projectSelectForClearDialogVisible = false;
|
|
|
+
|
|
|
+ // 调用后端API清除看课记录
|
|
|
+ this.clearUserWatchRecord(this.clearWatchRecordDialog.userId, this.clearWatchRecordParams.projectId);
|
|
|
+ },
|
|
|
|
|
|
+ clearUserWatchRecord(userId, projectId) {
|
|
|
+ // 将projectId转换为数值类型
|
|
|
+ const numericProjectId = projectId ? Number(projectId) : null;
|
|
|
+ clearUserWatchRecord({userId: userId, projectId: numericProjectId}).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.msgSuccess("清除看课记录成功");
|
|
|
+ this.getList(); // 刷新列表
|
|
|
+ } else {
|
|
|
+ this.$message.error(response.msg || "清除看课记录失败");
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.error('清除看课记录失败:', error);
|
|
|
+ this.$message.error('清除看课记录失败,请稍后重试');
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
/** 查询用户列表 */
|
|
|
getList() {
|