Browse Source

1.疫苗预约弹框,以及状态操作

2.小程序疫苗功能相关接口
3.svg图标
master
ma-zhongxu 2 weeks ago
parent
commit
6f78981d61
  1. 121
      chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuVacController.java
  2. 73
      chenhai-admin/src/main/java/com/chenhai/web/controller/system/SensitiveWordApiTest.java
  3. 104
      chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysSlaughterInfoController.java
  4. 33
      chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysVacRegistrationController.java
  5. 10
      chenhai-common/pom.xml
  6. 161
      chenhai-system/src/main/java/com/chenhai/system/domain/SysSlaughterInfo.java
  7. 61
      chenhai-system/src/main/java/com/chenhai/system/mapper/SysSlaughterInfoMapper.java
  8. 2
      chenhai-system/src/main/java/com/chenhai/system/mapper/SysVacRegistrationMapper.java
  9. 61
      chenhai-system/src/main/java/com/chenhai/system/service/ISysSlaughterInfoService.java
  10. 26
      chenhai-system/src/main/java/com/chenhai/system/service/ISysVacRegistrationService.java
  11. 96
      chenhai-system/src/main/java/com/chenhai/system/service/impl/SysSlaughterInfoServiceImpl.java
  12. 69
      chenhai-system/src/main/java/com/chenhai/system/service/impl/SysVacRegistrationServiceImpl.java
  13. 110
      chenhai-system/src/main/resources/mapper/system/SysSlaughterInfoMapper.xml
  14. 24
      chenhai-ui/src/api/system/VacRegistration.js
  15. 44
      chenhai-ui/src/api/system/slaughterInfo.js
  16. 1
      chenhai-ui/src/assets/icons/svg/slaughter.svg
  17. 139
      chenhai-ui/src/views/system/VacRegistration/index.vue
  18. 342
      chenhai-ui/src/views/system/slaughterInfo/index.vue
  19. 80
      chenhai-ui/src/views/system/vacInfo/index.vue
  20. 15
      pom.xml

121
chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuVacController.java

@ -0,0 +1,121 @@
package com.chenhai.web.controller.muhu;
import com.chenhai.common.annotation.Log;
import com.chenhai.common.core.controller.BaseController;
import com.chenhai.common.core.domain.AjaxResult;
import com.chenhai.common.core.page.TableDataInfo;
import com.chenhai.common.enums.BusinessType;
import com.chenhai.common.utils.DateUtils;
import com.chenhai.common.utils.poi.ExcelUtil;
import com.chenhai.system.domain.SysVacCategory;
import com.chenhai.system.domain.SysVacInfo;
import com.chenhai.system.domain.SysVacRegistration;
import com.chenhai.system.service.ISysVacCategoryService;
import com.chenhai.system.service.ISysVacInfoService;
import com.chenhai.system.service.ISysVacRegistrationService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 疫苗预约Controller
*
* @author ruoyi
* @date 2026-01-28
*/
@RestController
@RequestMapping("/muhu/VacRegistration")
public class MuhuVacController extends BaseController
{
@Autowired
private ISysVacRegistrationService sysVacRegistrationService;
@Autowired
private ISysVacInfoService sysVacInfoService;
@Autowired
private ISysVacCategoryService sysVacCategoryService;
/**
* 查询疫苗信息列表
*/
@PreAuthorize("@ss.hasRole('muhu')")
@GetMapping("/getVacInfoList")
public TableDataInfo getVacInfoList(SysVacInfo sysVacInfo)
{
startPage();
List<SysVacInfo> list = sysVacInfoService.selectSysVacInfoList(sysVacInfo);
return getDataTable(list);
}
/**
* 获取疫苗信息详细信息
*/
@PreAuthorize("@ss.hasPermi('system:vacInfo:query')")
@GetMapping(value = "/getVacInfo/{id}")
public AjaxResult getVacInfo(@PathVariable("id") Long id)
{
return success(sysVacInfoService.selectSysVacInfoById(id));
}
/**
* 获取疫苗类别列表
*/
@PreAuthorize("@ss.hasRole('muhu')")
@GetMapping("/getVacCategoryList")
public TableDataInfo getVacCategoryList(SysVacCategory sysVacCategory)
{
startPage();
List<SysVacCategory> list = sysVacCategoryService.selectSysVacCategoryList(sysVacCategory);
return getDataTable(list);
}
/**
* 查询疫苗预约列表
*/
@PreAuthorize("@ss.hasRole('muhu')")
@GetMapping("/getVacRegistrationList")
public TableDataInfo getVacRegistrationList(SysVacRegistration sysVacRegistration)
{
startPage();
List<SysVacRegistration> list = sysVacRegistrationService.selectSysVacRegistrationList(sysVacRegistration);
return getDataTable(list);
}
/**
* 获取疫苗预约详细信息
*/
@PreAuthorize("@ss.hasRole('muhu')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sysVacRegistrationService.selectSysVacRegistrationById(id));
}
/**
* 新增疫苗预约
*/
@PreAuthorize("@ss.hasRole('muhu')")
@Log(title = "新增疫苗预约", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult addVacRegistration(@RequestBody SysVacRegistration sysVacRegistration)
{
sysVacRegistration.setUserId(getUserId());
sysVacRegistration.setRegistrationTime(DateUtils.getNowDate());
return toAjax(sysVacRegistrationService.insertSysVacRegistration(sysVacRegistration));
}
/**
* 修改疫苗预约
*/
@PreAuthorize("@ss.hasPermi('system:VacRegistration:edit')")
@Log(title = "疫苗预约", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysVacRegistration sysVacRegistration)
{
return toAjax(sysVacRegistrationService.updateSysVacRegistration(sysVacRegistration));
}
}

73
chenhai-admin/src/main/java/com/chenhai/web/controller/system/SensitiveWordApiTest.java

@ -0,0 +1,73 @@
package com.chenhai.web.controller.system;
import com.github.houbb.sensitive.word.api.IWordReplace;
import com.github.houbb.sensitive.word.core.SensitiveWordHelper;
import org.junit.jupiter.api.Test;
/**
* @author : mazhongxu
* @date : 2026-02-04 18:28
* @modyified By :
*/
public class SensitiveWordApiTest {
/**
* 判断是否包含敏感词
*/
@Test
public void testContains() {
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前";
System.out.println(SensitiveWordHelper.contains(text));
}
/**
* 返回第一个敏感词
*/
@Test
public void testFindFirst() {
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前";
System.out.println(SensitiveWordHelper.findFirst(text));
}
/**
* 返回所有敏感词
*/
@Test
public void testFindAll() {
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前";
System.out.println(SensitiveWordHelper.findAll(text));
}
/**
* 默认的替换策略
*/
@Test
public void testReplaceDefault() {
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前";
System.out.println(SensitiveWordHelper.replace(text));
}
/**
* 指定替换敏感词所用的字符
*/
@Test
public void testReplace() {
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前";
System.out.println(SensitiveWordHelper.replace(text, '0'));
}
// /**
// * 自定义替换策略(自定义替换策略类需要实现 IWordReplace 接口 )
// */
// @Test
// public void defineReplaceTest() {
// final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前";
//
// IWordReplace customWordReplace = new CustomWordReplace();
// System.out.println(SensitiveWordHelper.replace(text, customWordReplace));
// }
}

104
chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysSlaughterInfoController.java

@ -0,0 +1,104 @@
package com.chenhai.web.controller.system;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
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.chenhai.common.annotation.Log;
import com.chenhai.common.core.controller.BaseController;
import com.chenhai.common.core.domain.AjaxResult;
import com.chenhai.common.enums.BusinessType;
import com.chenhai.system.domain.SysSlaughterInfo;
import com.chenhai.system.service.ISysSlaughterInfoService;
import com.chenhai.common.utils.poi.ExcelUtil;
import com.chenhai.common.core.page.TableDataInfo;
/**
* 屠宰信息Controller
*
* @author ruoyi
* @date 2026-02-03
*/
@RestController
@RequestMapping("/system/slaughterInfo")
public class SysSlaughterInfoController extends BaseController
{
@Autowired
private ISysSlaughterInfoService sysSlaughterInfoService;
/**
* 查询屠宰信息列表
*/
@PreAuthorize("@ss.hasPermi('system:slaughterInfo:list')")
@GetMapping("/list")
public TableDataInfo list(SysSlaughterInfo sysSlaughterInfo)
{
startPage();
List<SysSlaughterInfo> list = sysSlaughterInfoService.selectSysSlaughterInfoList(sysSlaughterInfo);
return getDataTable(list);
}
/**
* 导出屠宰信息列表
*/
@PreAuthorize("@ss.hasPermi('system:slaughterInfo:export')")
@Log(title = "屠宰信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SysSlaughterInfo sysSlaughterInfo)
{
List<SysSlaughterInfo> list = sysSlaughterInfoService.selectSysSlaughterInfoList(sysSlaughterInfo);
ExcelUtil<SysSlaughterInfo> util = new ExcelUtil<SysSlaughterInfo>(SysSlaughterInfo.class);
util.exportExcel(response, list, "屠宰信息数据");
}
/**
* 获取屠宰信息详细信息
*/
@PreAuthorize("@ss.hasPermi('system:slaughterInfo:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sysSlaughterInfoService.selectSysSlaughterInfoById(id));
}
/**
* 新增屠宰信息
*/
@PreAuthorize("@ss.hasPermi('system:slaughterInfo:add')")
@Log(title = "屠宰信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SysSlaughterInfo sysSlaughterInfo)
{
return toAjax(sysSlaughterInfoService.insertSysSlaughterInfo(sysSlaughterInfo));
}
/**
* 修改屠宰信息
*/
@PreAuthorize("@ss.hasPermi('system:slaughterInfo:edit')")
@Log(title = "屠宰信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysSlaughterInfo sysSlaughterInfo)
{
return toAjax(sysSlaughterInfoService.updateSysSlaughterInfo(sysSlaughterInfo));
}
/**
* 删除屠宰信息
*/
@PreAuthorize("@ss.hasPermi('system:slaughterInfo:remove')")
@Log(title = "屠宰信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sysSlaughterInfoService.deleteSysSlaughterInfoByIds(ids));
}
}

33
chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysVacRegistrationController.java

@ -101,4 +101,37 @@ public class SysVacRegistrationController extends BaseController
{
return toAjax(sysVacRegistrationService.deleteSysVacRegistrationByIds(ids));
}
/**
* 确认预约
*/
@PreAuthorize("@ss.hasPermi('system:VacRegistration:confirm')")
@Log(title = "疫苗预约", businessType = BusinessType.UPDATE)
@PutMapping("/confirm/{id}")
public AjaxResult confirm(@PathVariable Long id)
{
return toAjax(sysVacRegistrationService.confirmRegistration(id));
}
/**
* 完成预约
*/
@PreAuthorize("@ss.hasPermi('system:VacRegistration:complete')")
@Log(title = "疫苗预约", businessType = BusinessType.UPDATE)
@PutMapping("/complete/{id}")
public AjaxResult complete(@PathVariable Long id)
{
return toAjax(sysVacRegistrationService.completeRegistration(id));
}
/**
* 取消预约
*/
@PreAuthorize("@ss.hasPermi('system:VacRegistration:cancel')")
@Log(title = "疫苗预约", businessType = BusinessType.UPDATE)
@PutMapping("/cancel/{id}")
public AjaxResult cancel(@PathVariable Long id)
{
return toAjax(sysVacRegistrationService.cancelRegistration(id));
}
}

10
chenhai-common/pom.xml

@ -113,6 +113,16 @@
<artifactId>jakarta.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>sensitive-word</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>
</dependencies>
</project>

161
chenhai-system/src/main/java/com/chenhai/system/domain/SysSlaughterInfo.java

@ -0,0 +1,161 @@
package com.chenhai.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.chenhai.common.annotation.Excel;
import com.chenhai.common.core.domain.BaseEntity;
/**
* 屠宰信息对象 sys_slaughter_info
*
* @author ruoyi
* @date 2026-02-03
*/
public class SysSlaughterInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 标题 */
@Excel(name = "标题")
private String title;
/** 内容详情 */
@Excel(name = "内容详情")
private String content;
/** 联系人 */
@Excel(name = "联系人")
private String contactPerson;
/** 联系电话 */
@Excel(name = "联系电话")
private String contactPhone;
/** 详细地址 */
@Excel(name = "详细地址")
private String address;
/** 服务时间 */
@Excel(name = "服务时间")
private String serviceTime;
/** 状态(0正常 1停用) */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 删除标志(0代表存在 2代表删除) */
private String delFlag;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
public void setContent(String content)
{
this.content = content;
}
public String getContent()
{
return content;
}
public void setContactPerson(String contactPerson)
{
this.contactPerson = contactPerson;
}
public String getContactPerson()
{
return contactPerson;
}
public void setContactPhone(String contactPhone)
{
this.contactPhone = contactPhone;
}
public String getContactPhone()
{
return contactPhone;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
public void setServiceTime(String serviceTime)
{
this.serviceTime = serviceTime;
}
public String getServiceTime()
{
return serviceTime;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("title", getTitle())
.append("content", getContent())
.append("contactPerson", getContactPerson())
.append("contactPhone", getContactPhone())
.append("address", getAddress())
.append("serviceTime", getServiceTime())
.append("status", getStatus())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

61
chenhai-system/src/main/java/com/chenhai/system/mapper/SysSlaughterInfoMapper.java

@ -0,0 +1,61 @@
package com.chenhai.system.mapper;
import java.util.List;
import com.chenhai.system.domain.SysSlaughterInfo;
/**
* 屠宰信息Mapper接口
*
* @author ruoyi
* @date 2026-02-03
*/
public interface SysSlaughterInfoMapper
{
/**
* 查询屠宰信息
*
* @param id 屠宰信息主键
* @return 屠宰信息
*/
public SysSlaughterInfo selectSysSlaughterInfoById(Long id);
/**
* 查询屠宰信息列表
*
* @param sysSlaughterInfo 屠宰信息
* @return 屠宰信息集合
*/
public List<SysSlaughterInfo> selectSysSlaughterInfoList(SysSlaughterInfo sysSlaughterInfo);
/**
* 新增屠宰信息
*
* @param sysSlaughterInfo 屠宰信息
* @return 结果
*/
public int insertSysSlaughterInfo(SysSlaughterInfo sysSlaughterInfo);
/**
* 修改屠宰信息
*
* @param sysSlaughterInfo 屠宰信息
* @return 结果
*/
public int updateSysSlaughterInfo(SysSlaughterInfo sysSlaughterInfo);
/**
* 删除屠宰信息
*
* @param id 屠宰信息主键
* @return 结果
*/
public int deleteSysSlaughterInfoById(Long id);
/**
* 批量删除屠宰信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSysSlaughterInfoByIds(Long[] ids);
}

2
chenhai-system/src/main/java/com/chenhai/system/mapper/SysVacRegistrationMapper.java

@ -58,4 +58,6 @@ public interface SysVacRegistrationMapper
* @return 结果
*/
public int deleteSysVacRegistrationByIds(Long[] ids);
}

61
chenhai-system/src/main/java/com/chenhai/system/service/ISysSlaughterInfoService.java

@ -0,0 +1,61 @@
package com.chenhai.system.service;
import java.util.List;
import com.chenhai.system.domain.SysSlaughterInfo;
/**
* 屠宰信息Service接口
*
* @author ruoyi
* @date 2026-02-03
*/
public interface ISysSlaughterInfoService
{
/**
* 查询屠宰信息
*
* @param id 屠宰信息主键
* @return 屠宰信息
*/
public SysSlaughterInfo selectSysSlaughterInfoById(Long id);
/**
* 查询屠宰信息列表
*
* @param sysSlaughterInfo 屠宰信息
* @return 屠宰信息集合
*/
public List<SysSlaughterInfo> selectSysSlaughterInfoList(SysSlaughterInfo sysSlaughterInfo);
/**
* 新增屠宰信息
*
* @param sysSlaughterInfo 屠宰信息
* @return 结果
*/
public int insertSysSlaughterInfo(SysSlaughterInfo sysSlaughterInfo);
/**
* 修改屠宰信息
*
* @param sysSlaughterInfo 屠宰信息
* @return 结果
*/
public int updateSysSlaughterInfo(SysSlaughterInfo sysSlaughterInfo);
/**
* 批量删除屠宰信息
*
* @param ids 需要删除的屠宰信息主键集合
* @return 结果
*/
public int deleteSysSlaughterInfoByIds(Long[] ids);
/**
* 删除屠宰信息信息
*
* @param id 屠宰信息主键
* @return 结果
*/
public int deleteSysSlaughterInfoById(Long id);
}

26
chenhai-system/src/main/java/com/chenhai/system/service/ISysVacRegistrationService.java

@ -58,4 +58,30 @@ public interface ISysVacRegistrationService
* @return 结果
*/
public int deleteSysVacRegistrationById(Long id);
/**
* 确认预约
*
* @param id 预约ID
* @return 结果
*/
int confirmRegistration(Long id);
/**
* 完成预约
*
* @param id 预约ID
* @return 结果
*/
int completeRegistration(Long id);
/**
* 取消预约
*
* @param id 预约ID
* @return 结果
*/
int cancelRegistration(Long id);
}

96
chenhai-system/src/main/java/com/chenhai/system/service/impl/SysSlaughterInfoServiceImpl.java

@ -0,0 +1,96 @@
package com.chenhai.system.service.impl;
import java.util.List;
import com.chenhai.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.chenhai.system.mapper.SysSlaughterInfoMapper;
import com.chenhai.system.domain.SysSlaughterInfo;
import com.chenhai.system.service.ISysSlaughterInfoService;
/**
* 屠宰信息Service业务层处理
*
* @author ruoyi
* @date 2026-02-03
*/
@Service
public class SysSlaughterInfoServiceImpl implements ISysSlaughterInfoService
{
@Autowired
private SysSlaughterInfoMapper sysSlaughterInfoMapper;
/**
* 查询屠宰信息
*
* @param id 屠宰信息主键
* @return 屠宰信息
*/
@Override
public SysSlaughterInfo selectSysSlaughterInfoById(Long id)
{
return sysSlaughterInfoMapper.selectSysSlaughterInfoById(id);
}
/**
* 查询屠宰信息列表
*
* @param sysSlaughterInfo 屠宰信息
* @return 屠宰信息
*/
@Override
public List<SysSlaughterInfo> selectSysSlaughterInfoList(SysSlaughterInfo sysSlaughterInfo)
{
return sysSlaughterInfoMapper.selectSysSlaughterInfoList(sysSlaughterInfo);
}
/**
* 新增屠宰信息
*
* @param sysSlaughterInfo 屠宰信息
* @return 结果
*/
@Override
public int insertSysSlaughterInfo(SysSlaughterInfo sysSlaughterInfo)
{
sysSlaughterInfo.setCreateTime(DateUtils.getNowDate());
return sysSlaughterInfoMapper.insertSysSlaughterInfo(sysSlaughterInfo);
}
/**
* 修改屠宰信息
*
* @param sysSlaughterInfo 屠宰信息
* @return 结果
*/
@Override
public int updateSysSlaughterInfo(SysSlaughterInfo sysSlaughterInfo)
{
sysSlaughterInfo.setUpdateTime(DateUtils.getNowDate());
return sysSlaughterInfoMapper.updateSysSlaughterInfo(sysSlaughterInfo);
}
/**
* 批量删除屠宰信息
*
* @param ids 需要删除的屠宰信息主键
* @return 结果
*/
@Override
public int deleteSysSlaughterInfoByIds(Long[] ids)
{
return sysSlaughterInfoMapper.deleteSysSlaughterInfoByIds(ids);
}
/**
* 删除屠宰信息信息
*
* @param id 屠宰信息主键
* @return 结果
*/
@Override
public int deleteSysSlaughterInfoById(Long id)
{
return sysSlaughterInfoMapper.deleteSysSlaughterInfoById(id);
}
}

69
chenhai-system/src/main/java/com/chenhai/system/service/impl/SysVacRegistrationServiceImpl.java

@ -93,4 +93,73 @@ public class SysVacRegistrationServiceImpl implements ISysVacRegistrationService
{
return sysVacRegistrationMapper.deleteSysVacRegistrationById(id);
}
/**
* 确认预约
*
* @param id 预约ID
* @return 结果
*/
@Override
public int confirmRegistration(Long id)
{
SysVacRegistration registration = sysVacRegistrationMapper.selectSysVacRegistrationById(id);
if (registration == null) {
return 0;
}
// 只能确认待确认状态的预约
if (registration.getStatus() != 1) {
return 0;
}
registration.setStatus(2); // 已确认
registration.setConfirmedTime(DateUtils.getNowDate()); // 设置确认时间
registration.setUpdateTime(DateUtils.getNowDate());
return sysVacRegistrationMapper.updateSysVacRegistration(registration);
}
/**
* 完成预约
*
* @param id 预约ID
* @return 结果
*/
@Override
public int completeRegistration(Long id)
{
SysVacRegistration registration = sysVacRegistrationMapper.selectSysVacRegistrationById(id);
if (registration == null) {
return 0;
}
// 只能完成已确认状态的预约
if (registration.getStatus() != 2) {
return 0;
}
registration.setStatus(3); // 已完成
registration.setCompletedTime(DateUtils.getNowDate()); // 设置完成时间
registration.setUpdateTime(DateUtils.getNowDate());
return sysVacRegistrationMapper.updateSysVacRegistration(registration);
}
/**
* 取消预约
*
* @param id 预约ID
* @return 结果
*/
@Override
public int cancelRegistration(Long id)
{
SysVacRegistration registration = sysVacRegistrationMapper.selectSysVacRegistrationById(id);
if (registration == null) {
return 0;
}
// 只能取消待确认或已确认状态的预约
if (registration.getStatus() != 1 && registration.getStatus() != 2) {
return 0;
}
registration.setStatus(4); // 已取消
registration.setCancelTime(DateUtils.getNowDate()); // 设置取消时间
registration.setUpdateTime(DateUtils.getNowDate());
return sysVacRegistrationMapper.updateSysVacRegistration(registration);
}
}

110
chenhai-system/src/main/resources/mapper/system/SysSlaughterInfoMapper.xml

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chenhai.system.mapper.SysSlaughterInfoMapper">
<resultMap type="SysSlaughterInfo" id="SysSlaughterInfoResult">
<result property="id" column="id" />
<result property="title" column="title" />
<result property="content" column="content" />
<result property="contactPerson" column="contact_person" />
<result property="contactPhone" column="contact_phone" />
<result property="address" column="address" />
<result property="serviceTime" column="service_time" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSysSlaughterInfoVo">
select id, title, content, contact_person, contact_phone, address, service_time, status, del_flag, create_by, create_time, update_by, update_time, remark from sys_slaughter_info
</sql>
<select id="selectSysSlaughterInfoList" parameterType="SysSlaughterInfo" resultMap="SysSlaughterInfoResult">
<include refid="selectSysSlaughterInfoVo"/>
<where>
<if test="title != null and title != ''"> and title = #{title}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="contactPerson != null and contactPerson != ''"> and contact_person = #{contactPerson}</if>
<if test="contactPhone != null and contactPhone != ''"> and contact_phone = #{contactPhone}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="serviceTime != null and serviceTime != ''"> and service_time = #{serviceTime}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectSysSlaughterInfoById" parameterType="Long" resultMap="SysSlaughterInfoResult">
<include refid="selectSysSlaughterInfoVo"/>
where id = #{id}
</select>
<insert id="insertSysSlaughterInfo" parameterType="SysSlaughterInfo" useGeneratedKeys="true" keyProperty="id">
insert into sys_slaughter_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">title,</if>
<if test="content != null">content,</if>
<if test="contactPerson != null">contact_person,</if>
<if test="contactPhone != null">contact_phone,</if>
<if test="address != null">address,</if>
<if test="serviceTime != null">service_time,</if>
<if test="status != null">status,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">#{title},</if>
<if test="content != null">#{content},</if>
<if test="contactPerson != null">#{contactPerson},</if>
<if test="contactPhone != null">#{contactPhone},</if>
<if test="address != null">#{address},</if>
<if test="serviceTime != null">#{serviceTime},</if>
<if test="status != null">#{status},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSysSlaughterInfo" parameterType="SysSlaughterInfo">
update sys_slaughter_info
<trim prefix="SET" suffixOverrides=",">
<if test="title != null and title != ''">title = #{title},</if>
<if test="content != null">content = #{content},</if>
<if test="contactPerson != null">contact_person = #{contactPerson},</if>
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
<if test="address != null">address = #{address},</if>
<if test="serviceTime != null">service_time = #{serviceTime},</if>
<if test="status != null">status = #{status},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysSlaughterInfoById" parameterType="Long">
delete from sys_slaughter_info where id = #{id}
</delete>
<delete id="deleteSysSlaughterInfoByIds" parameterType="String">
delete from sys_slaughter_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

24
chenhai-ui/src/api/system/VacRegistration.js

@ -42,3 +42,27 @@ export function delVacRegistration(id) {
method: 'delete'
})
}
// 确认预约
export function confirmRegistration(id) {
return request({
url: '/system/VacRegistration/confirm/' + id,
method: 'put'
})
}
// 完成预约
export function completeRegistration(id) {
return request({
url: '/system/VacRegistration/complete/' + id,
method: 'put'
})
}
// 取消预约
export function cancelRegistration(id) {
return request({
url: '/system/VacRegistration/cancel/' + id,
method: 'put'
})
}

44
chenhai-ui/src/api/system/slaughterInfo.js

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询屠宰信息列表
export function listSlaughterInfo(query) {
return request({
url: '/system/slaughterInfo/list',
method: 'get',
params: query
})
}
// 查询屠宰信息详细
export function getSlaughterInfo(id) {
return request({
url: '/system/slaughterInfo/' + id,
method: 'get'
})
}
// 新增屠宰信息
export function addSlaughterInfo(data) {
return request({
url: '/system/slaughterInfo',
method: 'post',
data: data
})
}
// 修改屠宰信息
export function updateSlaughterInfo(data) {
return request({
url: '/system/slaughterInfo',
method: 'put',
data: data
})
}
// 删除屠宰信息
export function delSlaughterInfo(id) {
return request({
url: '/system/slaughterInfo/' + id,
method: 'delete'
})
}

1
chenhai-ui/src/assets/icons/svg/slaughter.svg

@ -0,0 +1 @@
<svg t="1770113206884" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5126" width="200" height="200"><path d="M512.6 96.5L64.2 400.7v72.5h74.4v454.4H886V473.9h74.4v-72.8L512.6 96.5z m215 444.2c-21.4 21.4-55.1 23-78.4 4.8l-37.7 36.3c0.1 0.4 0.3 0.7 0.4 1.1 4.5 12.1 6.9 25.1 6.9 38.8 0 36.6-17.6 69.1-44.9 89.6-1.3 84.7-70.3 153.1-155.3 153.1-85.8 0-155.4-69.6-155.4-155.4 0-85.7 69.5-155.3 155.2-155.4 20.4-26.5 52.5-43.6 88.6-43.6 11.6 0 22.9 1.8 33.4 5.1 0.2 0.1 0.5 0.2 0.7 0.2l39.4-38.1c-19.2-23.3-17.9-57.8 3.9-79.6 23.1-23.1 60.7-23.1 83.9 0 11.6 11.6 17.3 26.7 17.4 41.9 15.2 0 30.3 5.8 41.9 17.4 23.2 23 23.2 60.6 0 83.8z" p-id="5127" fill="#6CAB86"></path></svg>

139
chenhai-ui/src/views/system/VacRegistration/index.vue

@ -1,22 +1,22 @@
<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="vaccineId">
<el-input
v-model="queryParams.vaccineId"
placeholder="请输入疫苗信息ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<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="vaccineId">-->
<!-- <el-input-->
<!-- v-model="queryParams.vaccineId"-->
<!-- placeholder="请输入疫苗信息ID"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <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="牲畜类型" prop="livestockType">
<el-select v-model="queryParams.livestockType" placeholder="请选择牲畜类型" clearable>
<el-option
@ -51,8 +51,8 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态:1-待确认 2-已确认 3-已完成 4-已取消" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态:1-待确认 2-已确认 3-已完成 4-已取消" clearable>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option
v-for="dict in dict.type.vaccine_registration_status"
:key="dict.value"
@ -147,9 +147,9 @@
<el-table v-loading="loading" :data="VacRegistrationList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="预约记录ID" align="center" prop="id" />
<el-table-column label="疫苗信息ID" align="center" prop="vaccineId" />
<el-table-column label="牧户用户ID" align="center" prop="userId" />
<!-- <el-table-column label="预约记录ID" align="center" prop="id" />-->
<!-- <el-table-column label="疫苗信息ID" align="center" prop="vaccineId" />-->
<!-- <el-table-column label="牧户用户ID" align="center" prop="userId" />-->
<el-table-column label="牲畜类型" align="center" prop="livestockType">
<template slot-scope="scope">
<dict-tag :options="dict.type.livestock_type" :value="scope.row.livestockType"/>
@ -158,7 +158,7 @@
<el-table-column label="牲畜数量" align="center" prop="livestockCount" />
<el-table-column label="联系人姓名" align="center" prop="contactName" />
<el-table-column label="联系电话" align="center" prop="contactPhone" />
<el-table-column label="状态:1-待确认 2-已确认 3-已完成 4-已取消" align="center" prop="status">
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.vaccine_registration_status" :value="scope.row.status"/>
</template>
@ -186,20 +186,48 @@
<el-table-column label="备注" align="center" prop="remark" />
<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:VacRegistration:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['system:VacRegistration:remove']"-->
<!-- >删除</el-button>-->
<!-- 状态操作按钮 -->
<el-button
v-if="scope.row.status === 1"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:VacRegistration:edit']"
>修改</el-button>
icon="el-icon-check"
@click="handleConfirm(scope.row)"
style="color: #67C23A;"
v-hasPermi="['system:VacRegistration:confirm']"
>确认</el-button>
<el-button
v-if="scope.row.status === 2"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:VacRegistration:remove']"
>删除</el-button>
icon="el-icon-success"
@click="handleComplete(scope.row)"
style="color: #409EFF;"
v-hasPermi="['system:VacRegistration:complete']"
>完成</el-button>
<el-button
v-if="scope.row.status === 1 || scope.row.status === 2"
size="mini"
type="text"
icon="el-icon-close"
@click="handleCancel(scope.row)"
style="color: #F56C6C;"
v-hasPermi="['system:VacRegistration:cancel']"
>取消</el-button>
</template>
</el-table-column>
</el-table>
@ -215,12 +243,12 @@
<!-- 添加或修改疫苗预约对话框 -->
<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="vaccineId">
<el-input v-model="form.vaccineId" placeholder="请输入疫苗信息ID" />
</el-form-item>
<el-form-item label="牧户用户ID" prop="userId">
<el-input v-model="form.userId" placeholder="请输入牧户用户ID" />
</el-form-item>
<!-- <el-form-item label="疫苗信息ID" prop="vaccineId">-->
<!-- <el-input v-model="form.vaccineId" placeholder="请输入疫苗信息ID" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="牧户用户ID" prop="userId">-->
<!-- <el-input v-model="form.userId" placeholder="请输入牧户用户ID" />-->
<!-- </el-form-item>-->
<el-form-item label="牲畜类型" prop="livestockType">
<el-select v-model="form.livestockType" placeholder="请选择牲畜类型">
<el-option
@ -240,8 +268,8 @@
<el-form-item label="联系电话" prop="contactPhone">
<el-input v-model="form.contactPhone" placeholder="请输入联系电话" />
</el-form-item>
<el-form-item label="状态:1-待确认 2-已确认 3-已完成 4-已取消" prop="status">
<el-select v-model="form.status" placeholder="请选择状态:1-待确认 2-已确认 3-已完成 4-已取消">
<el-form-item label="状态" prop="status">
<el-select v-model="form.status" placeholder="请选择状态">
<el-option
v-for="dict in dict.type.vaccine_registration_status"
:key="dict.value"
@ -298,7 +326,7 @@
</template>
<script>
import { listVacRegistration, getVacRegistration, delVacRegistration, addVacRegistration, updateVacRegistration } from "@/api/system/VacRegistration"
import { listVacRegistration, getVacRegistration, delVacRegistration, addVacRegistration, updateVacRegistration, confirmRegistration, completeRegistration, cancelRegistration } from "@/api/system/VacRegistration"
export default {
name: "VacRegistration",
@ -362,7 +390,7 @@ export default {
{ required: true, message: "联系电话不能为空", trigger: "blur" }
],
status: [
{ required: true, message: "状态:1-待确认 2-已确认 3-已完成 4-已取消不能为空", trigger: "change" }
{ required: true, message: "状态", trigger: "change" }
],
registrationTime: [
{ required: true, message: "预约时间不能为空", trigger: "blur" }
@ -479,7 +507,36 @@ export default {
this.download('system/VacRegistration/export', {
...this.queryParams
}, `VacRegistration_${new Date().getTime()}.xlsx`)
}
},
/** 确认预约 */
handleConfirm(row) {
this.$modal.confirm('是否确认该预约?').then(() => {
return confirmRegistration(row.id);
}).then(() => {
this.$modal.msgSuccess("确认成功");
this.getList();
}).catch(() => {});
},
/** 完成预约 */
handleComplete(row) {
this.$modal.confirm('是否标记为已完成?').then(() => {
return completeRegistration(row.id);
}).then(() => {
this.$modal.msgSuccess("完成成功");
this.getList();
}).catch(() => {});
},
/** 取消预约 */
handleCancel(row) {
this.$modal.confirm('是否取消该预约?').then(() => {
return cancelRegistration(row.id);
}).then(() => {
this.$modal.msgSuccess("取消成功");
this.getList();
}).catch(() => {});
},
}
}
</script>

342
chenhai-ui/src/views/system/slaughterInfo/index.vue

@ -0,0 +1,342 @@
<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="title">
<el-input
v-model="queryParams.title"
placeholder="请输入标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系人" prop="contactPerson">
<el-input
v-model="queryParams.contactPerson"
placeholder="请输入联系人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系电话" prop="contactPhone">
<el-input
v-model="queryParams.contactPhone"
placeholder="请输入联系电话"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="服务时间" prop="serviceTime">
<el-input
v-model="queryParams.serviceTime"
placeholder="请输入服务时间"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option
v-for="dict in dict.type.sys_notice_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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:slaughterInfo: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:slaughterInfo: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:slaughterInfo: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:slaughterInfo:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="slaughterInfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键ID" align="center" prop="id" />-->
<el-table-column label="标题" align="center" prop="title" />
<el-table-column label="内容详情" align="center" prop="content" />
<el-table-column label="联系人" align="center" prop="contactPerson" />
<el-table-column label="联系电话" align="center" prop="contactPhone" />
<el-table-column label="详细地址" align="center" prop="address" />
<el-table-column label="服务时间" align="center" prop="serviceTime" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_notice_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<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:slaughterInfo:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:slaughterInfo: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="title">
<el-input v-model="form.title" placeholder="请输入标题" />
</el-form-item>
<el-form-item label="内容详情">
<editor v-model="form.content" :min-height="192"/>
</el-form-item>
<el-form-item label="联系人" prop="contactPerson">
<el-input v-model="form.contactPerson" placeholder="请输入联系人" />
</el-form-item>
<el-form-item label="联系电话" prop="contactPhone">
<el-input v-model="form.contactPhone" placeholder="请输入联系电话" />
</el-form-item>
<el-form-item label="详细地址" prop="address">
<el-input v-model="form.address" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="服务时间" prop="serviceTime">
<el-input v-model="form.serviceTime" placeholder="请输入服务时间" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.sys_notice_status"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="删除标志" prop="delFlag">
<el-input v-model="form.delFlag" placeholder="请输入删除标志" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" 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 { listSlaughterInfo, getSlaughterInfo, delSlaughterInfo, addSlaughterInfo, updateSlaughterInfo } from "@/api/system/slaughterInfo"
export default {
name: "SlaughterInfo",
dicts: ['sys_notice_status'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
slaughterInfoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
title: null,
content: null,
contactPerson: null,
contactPhone: null,
address: null,
serviceTime: null,
status: null,
},
//
form: {},
//
rules: {
title: [
{ required: true, message: "标题不能为空", trigger: "blur" }
],
}
}
},
created() {
this.getList()
},
methods: {
/** 查询屠宰信息列表 */
getList() {
this.loading = true
listSlaughterInfo(this.queryParams).then(response => {
this.slaughterInfoList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
title: null,
content: null,
contactPerson: null,
contactPhone: null,
address: null,
serviceTime: null,
status: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: 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
getSlaughterInfo(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) {
updateSlaughterInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addSlaughterInfo(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 delSlaughterInfo(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('system/slaughterInfo/export', {
...this.queryParams
}, `slaughterInfo_${new Date().getTime()}.xlsx`)
}
}
}
</script>

80
chenhai-ui/src/views/system/vacInfo/index.vue

@ -180,7 +180,7 @@
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
<template slot-scope="scope">
<el-button
size="mini"
@ -196,6 +196,14 @@
@click="handleDelete(scope.row)"
v-hasPermi="['system:vacInfo:remove']"
>删除</el-button>
<!-- 新增预约列表按钮 -->
<el-button
size="mini"
type="text"
icon="el-icon-s-order"
@click="handleRegistrationList(scope.row)"
v-hasPermi="['system:vacInfo:list']"
>预约列表</el-button>
</template>
</el-table-column>
</el-table>
@ -384,15 +392,42 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 疫苗预约列表弹窗 -->
<el-dialog
:title="registrationDialogTitle"
:visible.sync="registrationDialogVisible"
width="1600px"
append-to-body
@close="handleRegistrationClose"
class="registration-dialog"
>
<!-- 直接引入第一个文件作为组件 -->
<div v-if="registrationDialogVisible" style="height: 70vh; overflow-y: auto;">
<VacRegistration
:key="currentVaccineId"
ref="registrationComponent"
/>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleRegistrationClose"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listVacInfo, getVacInfo, delVacInfo, addVacInfo, updateVacInfo } from "@/api/system/vacInfo"
import { getVacCategorylist } from "@/api/system/vacInfo"
// - index.vue
import VacRegistration from '@/views/system/VacRegistration/index.vue'
export default {
name: "VacInfo",
components: {
VacRegistration
},
dicts: ['vaccine_type', 'vaccine_info_status', 'livestock_type'],
data() {
return {
@ -418,6 +453,12 @@ export default {
vaccineTypeOptions: [],
//
selectedVaccine: null,
//
registrationDialogVisible: false,
currentVaccineId: null,
registrationDialogTitle: "",
//
queryParams: {
pageNum: 1,
@ -529,11 +570,13 @@ export default {
/** 加载疫苗选项 */
loadVaccineOptions(livestockType) {
const query = { livestockType: livestockType };
getVacCategorylist(query).then(response => {
return getVacCategorylist(query).then(response => {
this.vaccineTypeOptions = response.rows || [];
return this.vaccineTypeOptions;
}).catch(() => {
this.vaccineTypeOptions = [];
this.$message.error('获取疫苗列表失败');
return [];
});
},
/** 更新选中的疫苗详细信息 */
@ -545,6 +588,30 @@ export default {
this.selectedVaccine = null;
}
},
/** 预约列表按钮操作 */
handleRegistrationList(row) {
this.currentVaccineId = row.id;
this.registrationDialogTitle = `疫苗预约列表 - ${row.title}`;
this.registrationDialogVisible = true;
//
this.$nextTick(() => {
if (this.$refs.registrationComponent) {
this.$refs.registrationComponent.queryParams.vaccineId = row.id;
this.$refs.registrationComponent.getList();
}
});
},
/** 关闭预约列表弹窗 */
handleRegistrationClose() {
this.registrationDialogVisible = false;
this.currentVaccineId = null;
//
if (this.$refs.registrationComponent) {
this.$refs.registrationComponent.queryParams.vaccineId = null;
}
},
//
cancel() {
this.open = false
@ -656,3 +723,12 @@ export default {
}
}
</script>
<style>
/* 调整弹窗样式 */
.registration-dialog .el-dialog__body {
padding: 20px;
max-height: 70vh;
overflow-y: auto;
}
</style>

15
pom.xml

@ -35,6 +35,8 @@
<jaxb-api.version>2.3.1</jaxb-api.version>
<jakarta.version>6.0.0</jakarta.version>
<springdoc.version>2.8.14</springdoc.version>
<sensitive-word.version>0.23.0</sensitive-word.version>
<jupiter.version>5.12.2</jupiter.version>
</properties>
<!-- 依赖声明 -->
@ -193,6 +195,19 @@
<version>${chenhai.version}</version>
</dependency>
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>sensitive-word</artifactId>
<version>${sensitive-word.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${jupiter.version}</version>
<!-- <scope>test</scope>-->
</dependency>
</dependencies>
</dependencyManagement>

Loading…
Cancel
Save