Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104

master
elliott 2 years ago
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>

@ -0,0 +1,349 @@
<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="用户id" prop="userId">
<el-input
v-model="queryParams.userId"
placeholder="请输入用户id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备id" prop="instrumentId">
<el-input
v-model="queryParams.instrumentId"
placeholder="请输入设备id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否在线1在线2离线" prop="online">
<el-input
v-model="queryParams.online"
placeholder="请输入是否在线1在线2离线"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="模式ID" prop="modeId">
<el-input
v-model="queryParams.modeId"
placeholder="请输入模式ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="护理总时长" prop="nursingTime">
<el-date-picker clearable
v-model="queryParams.nursingTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择护理总时长">
</el-date-picker>
</el-form-item>
<el-form-item label="完成度" prop="completionPercentage">
<el-input
v-model="queryParams.completionPercentage"
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:nursingLog: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:nursingLog: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:nursingLog: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:nursingLog:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="nursingLogList" @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="用户id" align="center" prop="userId" />
<el-table-column label="设备id" align="center" prop="instrumentId" />
<el-table-column label="设备名称" align="center" prop="instrumentName" />
<el-table-column label="是否在线1在线2离线" align="center" prop="online" />
<el-table-column label="模式ID" align="center" prop="modeId" />
<el-table-column label="模式名称" align="center" prop="modeName" />
<el-table-column label="护理总时长" align="center" prop="nursingTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.nursingTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="完成度" align="center" prop="completionPercentage" />
<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:nursingLog:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:nursingLog: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="用户id" prop="userId">
<el-input v-model="form.userId" placeholder="请输入用户id" />
</el-form-item>
<el-form-item label="设备id" prop="instrumentId">
<el-input v-model="form.instrumentId" placeholder="请输入设备id" />
</el-form-item>
<el-form-item label="设备名称" prop="instrumentName">
<el-input v-model="form.instrumentName" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="是否在线1在线2离线" prop="online">
<el-input v-model="form.online" placeholder="请输入是否在线1在线2离线" />
</el-form-item>
<el-form-item label="模式ID" prop="modeId">
<el-input v-model="form.modeId" placeholder="请输入模式ID" />
</el-form-item>
<el-form-item label="模式名称" prop="modeName">
<el-input v-model="form.modeName" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="护理总时长" prop="nursingTime">
<el-date-picker clearable
v-model="form.nursingTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择护理总时长">
</el-date-picker>
</el-form-item>
<el-form-item label="完成度" prop="completionPercentage">
<el-input v-model="form.completionPercentage" placeholder="请输入完成度" />
</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 { listNursingLog, getNursingLog, delNursingLog, addNursingLog, updateNursingLog } from "@/api/system/nursingLog";
export default {
name: "NursingLog",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
nursingLogList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
userId: null,
instrumentId: null,
instrumentName: null,
online: null,
modeId: null,
modeName: null,
nursingTime: null,
completionPercentage: null,
status: null,
},
//
form: {},
//
rules: {
userId: [
{ required: true, message: "用户id不能为空", trigger: "blur" }
],
instrumentId: [
{ required: true, message: "设备id不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询用户护理日志列表 */
getList() {
this.loading = true;
listNursingLog(this.queryParams).then(response => {
this.nursingLogList = 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,
online: null,
modeId: null,
modeName: null,
nursingTime: null,
completionPercentage: 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
getNursingLog(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) {
updateNursingLog(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addNursingLog(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 delNursingLog(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/nursingLog/export', {
...this.queryParams
}, `nursingLog_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save