Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104
commit
1c31934cff
@ -0,0 +1,99 @@
|
||||
package com.flossom.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxClockLog;
|
||||
import com.flossom.common.core.utils.poi.ExcelUtil;
|
||||
import com.flossom.common.core.web.controller.BaseController;
|
||||
import com.flossom.common.core.web.domain.AjaxResult;
|
||||
import com.flossom.common.core.web.page.TableDataInfo;
|
||||
import com.flossom.common.log.annotation.Log;
|
||||
import com.flossom.common.log.enums.BusinessType;
|
||||
import com.flossom.common.security.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.flossom.system.service.IWxClockLogService;
|
||||
|
||||
/**
|
||||
* 用户打卡Controller
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/clockLog")
|
||||
public class WxClockLogController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IWxClockLogService wxClockLogService;
|
||||
|
||||
/**
|
||||
* 查询用户打卡列表
|
||||
*/
|
||||
@RequiresPermissions("system:clockLog:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WxClockLog wxClockLog) {
|
||||
startPage();
|
||||
List<WxClockLog> list = wxClockLogService.selectWxClockLogList(wxClockLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户打卡列表
|
||||
*/
|
||||
@RequiresPermissions("system:clockLog:export")
|
||||
@Log(title = "用户打卡", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WxClockLog wxClockLog) {
|
||||
List<WxClockLog> list = wxClockLogService.selectWxClockLogList(wxClockLog);
|
||||
ExcelUtil<WxClockLog> util = new ExcelUtil<WxClockLog>(WxClockLog.class);
|
||||
util.exportExcel(response, list, "用户打卡数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户打卡详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:clockLog:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(wxClockLogService.selectWxClockLogById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户打卡
|
||||
*/
|
||||
@RequiresPermissions("system:clockLog:add")
|
||||
@Log(title = "用户打卡", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WxClockLog wxClockLog) {
|
||||
return toAjax(wxClockLogService.insertWxClockLog(wxClockLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户打卡
|
||||
*/
|
||||
@RequiresPermissions("system:clockLog:edit")
|
||||
@Log(title = "用户打卡", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WxClockLog wxClockLog) {
|
||||
return toAjax(wxClockLogService.updateWxClockLog(wxClockLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户打卡
|
||||
*/
|
||||
@RequiresPermissions("system:clockLog:remove")
|
||||
@Log(title = "用户打卡", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(wxClockLogService.deleteWxClockLogByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package com.flossom.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxNursingLog;
|
||||
import com.flossom.common.core.utils.poi.ExcelUtil;
|
||||
import com.flossom.common.core.web.controller.BaseController;
|
||||
import com.flossom.common.core.web.domain.AjaxResult;
|
||||
import com.flossom.common.core.web.page.TableDataInfo;
|
||||
import com.flossom.common.log.annotation.Log;
|
||||
import com.flossom.common.log.enums.BusinessType;
|
||||
import com.flossom.common.security.annotation.RequiresPermissions;
|
||||
import com.flossom.system.service.IWxNursingLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 用户护理日志Controller
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/nursingLog")
|
||||
public class WxNursingLogController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IWxNursingLogService wxNursingLogService;
|
||||
|
||||
/**
|
||||
* 查询用户护理日志列表
|
||||
*/
|
||||
@RequiresPermissions("system:nursingLog:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WxNursingLog wxNursingLog) {
|
||||
startPage();
|
||||
List<WxNursingLog> list = wxNursingLogService.selectWxNursingLogList(wxNursingLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户护理日志列表
|
||||
*/
|
||||
@RequiresPermissions("system:nursingLog:export")
|
||||
@Log(title = "用户护理日志", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WxNursingLog wxNursingLog) {
|
||||
List<WxNursingLog> list = wxNursingLogService.selectWxNursingLogList(wxNursingLog);
|
||||
ExcelUtil<WxNursingLog> util = new ExcelUtil<WxNursingLog>(WxNursingLog.class);
|
||||
util.exportExcel(response, list, "用户护理日志数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户护理日志详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:nursingLog:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(wxNursingLogService.selectWxNursingLogById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户护理日志
|
||||
*/
|
||||
@RequiresPermissions("system:nursingLog:add")
|
||||
@Log(title = "用户护理日志", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WxNursingLog wxNursingLog) {
|
||||
return toAjax(wxNursingLogService.insertWxNursingLog(wxNursingLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户护理日志
|
||||
*/
|
||||
@RequiresPermissions("system:nursingLog:edit")
|
||||
@Log(title = "用户护理日志", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WxNursingLog wxNursingLog) {
|
||||
return toAjax(wxNursingLogService.updateWxNursingLog(wxNursingLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户护理日志
|
||||
*/
|
||||
@RequiresPermissions("system:nursingLog:remove")
|
||||
@Log(title = "用户护理日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(wxNursingLogService.deleteWxNursingLogByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.flossom.system.service;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxClockLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 用户打卡Service接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-02-21
|
||||
*/
|
||||
public interface IWxClockLogService {
|
||||
|
||||
/**
|
||||
* 查询用户打卡
|
||||
*
|
||||
* @param id 用户打卡主键
|
||||
* @return 用户打卡
|
||||
*/
|
||||
public WxClockLog selectWxClockLogById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户打卡列表
|
||||
*
|
||||
* @param wxClockLog 用户打卡
|
||||
* @return 用户打卡集合
|
||||
*/
|
||||
public List<WxClockLog> selectWxClockLogList(WxClockLog wxClockLog);
|
||||
|
||||
/**
|
||||
* 新增用户打卡
|
||||
*
|
||||
* @param wxClockLog 用户打卡
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxClockLog(WxClockLog wxClockLog);
|
||||
|
||||
/**
|
||||
* 修改用户打卡
|
||||
*
|
||||
* @param wxClockLog 用户打卡
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxClockLog(WxClockLog wxClockLog);
|
||||
|
||||
/**
|
||||
* 批量删除用户打卡
|
||||
*
|
||||
* @param ids 需要删除的用户打卡主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxClockLogByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除用户打卡信息
|
||||
*
|
||||
* @param id 用户打卡主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxClockLogById(Long id);
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.flossom.system.service;
|
||||
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxNursingLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户护理日志Service接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-02-21
|
||||
*/
|
||||
public interface IWxNursingLogService {
|
||||
|
||||
/**
|
||||
* 查询用户护理日志
|
||||
*
|
||||
* @param id 用户护理日志主键
|
||||
* @return 用户护理日志
|
||||
*/
|
||||
public WxNursingLog selectWxNursingLogById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户护理日志列表
|
||||
*
|
||||
* @param wxNursingLog 用户护理日志
|
||||
* @return 用户护理日志集合
|
||||
*/
|
||||
public List<WxNursingLog> selectWxNursingLogList(WxNursingLog wxNursingLog);
|
||||
|
||||
/**
|
||||
* 新增用户护理日志
|
||||
*
|
||||
* @param wxNursingLog 用户护理日志
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxNursingLog(WxNursingLog wxNursingLog);
|
||||
|
||||
/**
|
||||
* 修改用户护理日志
|
||||
*
|
||||
* @param wxNursingLog 用户护理日志
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxNursingLog(WxNursingLog wxNursingLog);
|
||||
|
||||
/**
|
||||
* 批量删除用户护理日志
|
||||
*
|
||||
* @param ids 需要删除的用户护理日志主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxNursingLogByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除用户护理日志信息
|
||||
*
|
||||
* @param id 用户护理日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxNursingLogById(Long id);
|
||||
}
|
||||
@ -0,0 +1,91 @@
|
||||
package com.flossom.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxClockLog;
|
||||
import com.flossom.common.core.mapper.WxClockLogMapper;
|
||||
import com.flossom.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.flossom.system.service.IWxClockLogService;
|
||||
|
||||
/**
|
||||
* 用户打卡Service业务层处理
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-02-21
|
||||
*/
|
||||
@Service
|
||||
public class WxClockLogServiceImpl implements IWxClockLogService {
|
||||
|
||||
@Autowired
|
||||
private WxClockLogMapper wxClockLogMapper;
|
||||
|
||||
/**
|
||||
* 查询用户打卡
|
||||
*
|
||||
* @param id 用户打卡主键
|
||||
* @return 用户打卡
|
||||
*/
|
||||
@Override
|
||||
public WxClockLog selectWxClockLogById(Long id) {
|
||||
return wxClockLogMapper.selectWxClockLogById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户打卡列表
|
||||
*
|
||||
* @param wxClockLog 用户打卡
|
||||
* @return 用户打卡
|
||||
*/
|
||||
@Override
|
||||
public List<WxClockLog> selectWxClockLogList(WxClockLog wxClockLog) {
|
||||
return wxClockLogMapper.selectWxClockLogList(wxClockLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户打卡
|
||||
*
|
||||
* @param wxClockLog 用户打卡
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWxClockLog(WxClockLog wxClockLog) {
|
||||
wxClockLog.setCreateTime(DateUtils.getNowDate());
|
||||
return wxClockLogMapper.insertWxClockLog(wxClockLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户打卡
|
||||
*
|
||||
* @param wxClockLog 用户打卡
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWxClockLog(WxClockLog wxClockLog) {
|
||||
wxClockLog.setUpdateTime(DateUtils.getNowDate());
|
||||
return wxClockLogMapper.updateWxClockLog(wxClockLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户打卡
|
||||
*
|
||||
* @param ids 需要删除的用户打卡主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWxClockLogByIds(Long[] ids) {
|
||||
return wxClockLogMapper.deleteWxClockLogByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户打卡信息
|
||||
*
|
||||
* @param id 用户打卡主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWxClockLogById(Long id) {
|
||||
return wxClockLogMapper.deleteWxClockLogById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,91 @@
|
||||
package com.flossom.system.service.impl;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxNursingLog;
|
||||
import com.flossom.common.core.mapper.WxNursingLogMapper;
|
||||
import com.flossom.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.flossom.system.service.IWxNursingLogService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户护理日志Service业务层处理
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-02-21
|
||||
*/
|
||||
@Service
|
||||
public class WxNursingLogServiceImpl implements IWxNursingLogService {
|
||||
|
||||
@Autowired
|
||||
private WxNursingLogMapper wxNursingLogMapper;
|
||||
|
||||
/**
|
||||
* 查询用户护理日志
|
||||
*
|
||||
* @param id 用户护理日志主键
|
||||
* @return 用户护理日志
|
||||
*/
|
||||
@Override
|
||||
public WxNursingLog selectWxNursingLogById(Long id) {
|
||||
return wxNursingLogMapper.selectWxNursingLogById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户护理日志列表
|
||||
*
|
||||
* @param wxNursingLog 用户护理日志
|
||||
* @return 用户护理日志
|
||||
*/
|
||||
@Override
|
||||
public List<WxNursingLog> selectWxNursingLogList(WxNursingLog wxNursingLog) {
|
||||
return wxNursingLogMapper.selectWxNursingLogList(wxNursingLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户护理日志
|
||||
*
|
||||
* @param wxNursingLog 用户护理日志
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWxNursingLog(WxNursingLog wxNursingLog) {
|
||||
wxNursingLog.setCreateTime(DateUtils.getNowDate());
|
||||
return wxNursingLogMapper.insertWxNursingLog(wxNursingLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户护理日志
|
||||
*
|
||||
* @param wxNursingLog 用户护理日志
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWxNursingLog(WxNursingLog wxNursingLog) {
|
||||
wxNursingLog.setUpdateTime(DateUtils.getNowDate());
|
||||
return wxNursingLogMapper.updateWxNursingLog(wxNursingLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户护理日志
|
||||
*
|
||||
* @param ids 需要删除的用户护理日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWxNursingLogByIds(Long[] ids) {
|
||||
return wxNursingLogMapper.deleteWxNursingLogByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户护理日志信息
|
||||
*
|
||||
* @param id 用户护理日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWxNursingLogById(Long id) {
|
||||
return wxNursingLogMapper.deleteWxNursingLogById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询用户打卡列表
|
||||
export function listClockLog(query) {
|
||||
return request({
|
||||
url: '/system/clockLog/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询用户打卡详细
|
||||
export function getClockLog(id) {
|
||||
return request({
|
||||
url: '/system/clockLog/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增用户打卡
|
||||
export function addClockLog(data) {
|
||||
return request({
|
||||
url: '/system/clockLog',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用户打卡
|
||||
export function updateClockLog(data) {
|
||||
return request({
|
||||
url: '/system/clockLog',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除用户打卡
|
||||
export function delClockLog(id) {
|
||||
return request({
|
||||
url: '/system/clockLog/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询用户护理日志列表
|
||||
export function listNursingLog(query) {
|
||||
return request({
|
||||
url: '/system/nursingLog/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询用户护理日志详细
|
||||
export function getNursingLog(id) {
|
||||
return request({
|
||||
url: '/system/nursingLog/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增用户护理日志
|
||||
export function addNursingLog(data) {
|
||||
return request({
|
||||
url: '/system/nursingLog',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用户护理日志
|
||||
export function updateNursingLog(data) {
|
||||
return request({
|
||||
url: '/system/nursingLog',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除用户护理日志
|
||||
export function delNursingLog(id) {
|
||||
return request({
|
||||
url: '/system/nursingLog/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,286 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="微信用户" prop="userId">
|
||||
<el-input
|
||||
v-model="queryParams.userId"
|
||||
placeholder="请输入微信用户"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="当天使用过的仪器" prop="instrumentId">
|
||||
<el-input
|
||||
v-model="queryParams.instrumentId"
|
||||
placeholder="请输入当天使用过的仪器"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="当天使用过的仪器" prop="instrumentName">
|
||||
<el-input
|
||||
v-model="queryParams.instrumentName"
|
||||
placeholder="请输入当天使用过的仪器"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:clockLog:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:clockLog:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:clockLog:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:clockLog:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="clockLogList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="${comment}" align="center" prop="id" />
|
||||
<el-table-column label="微信用户" align="center" prop="userId" />
|
||||
<el-table-column label="当天使用过的仪器" align="center" prop="instrumentId" />
|
||||
<el-table-column label="当天使用过的仪器" align="center" prop="instrumentName" />
|
||||
<el-table-column label="打卡心得" align="center" prop="clockContent" />
|
||||
<el-table-column label="状态" align="center" prop="status" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:clockLog:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:clockLog:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改用户打卡对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="微信用户" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入微信用户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当天使用过的仪器" prop="instrumentId">
|
||||
<el-input v-model="form.instrumentId" placeholder="请输入当天使用过的仪器" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当天使用过的仪器" prop="instrumentName">
|
||||
<el-input v-model="form.instrumentName" placeholder="请输入当天使用过的仪器" />
|
||||
</el-form-item>
|
||||
<el-form-item label="打卡心得">
|
||||
<editor v-model="form.clockContent" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listClockLog, getClockLog, delClockLog, addClockLog, updateClockLog } from "@/api/system/clockLog";
|
||||
|
||||
export default {
|
||||
name: "ClockLog",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 用户打卡表格数据
|
||||
clockLogList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userId: null,
|
||||
instrumentId: null,
|
||||
instrumentName: null,
|
||||
clockContent: null,
|
||||
status: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询用户打卡列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listClockLog(this.queryParams).then(response => {
|
||||
this.clockLogList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
userId: null,
|
||||
instrumentId: null,
|
||||
instrumentName: null,
|
||||
clockContent: null,
|
||||
status: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加用户打卡";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getClockLog(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改用户打卡";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateClockLog(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addClockLog(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除用户打卡编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delClockLog(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/clockLog/export', {
|
||||
...this.queryParams
|
||||
}, `clockLog_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue