20 changed files with 1529 additions and 43 deletions
-
121chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuVacController.java
-
73chenhai-admin/src/main/java/com/chenhai/web/controller/system/SensitiveWordApiTest.java
-
104chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysSlaughterInfoController.java
-
33chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysVacRegistrationController.java
-
10chenhai-common/pom.xml
-
161chenhai-system/src/main/java/com/chenhai/system/domain/SysSlaughterInfo.java
-
61chenhai-system/src/main/java/com/chenhai/system/mapper/SysSlaughterInfoMapper.java
-
2chenhai-system/src/main/java/com/chenhai/system/mapper/SysVacRegistrationMapper.java
-
61chenhai-system/src/main/java/com/chenhai/system/service/ISysSlaughterInfoService.java
-
26chenhai-system/src/main/java/com/chenhai/system/service/ISysVacRegistrationService.java
-
96chenhai-system/src/main/java/com/chenhai/system/service/impl/SysSlaughterInfoServiceImpl.java
-
69chenhai-system/src/main/java/com/chenhai/system/service/impl/SysVacRegistrationServiceImpl.java
-
110chenhai-system/src/main/resources/mapper/system/SysSlaughterInfoMapper.xml
-
24chenhai-ui/src/api/system/VacRegistration.js
-
44chenhai-ui/src/api/system/slaughterInfo.js
-
1chenhai-ui/src/assets/icons/svg/slaughter.svg
-
139chenhai-ui/src/views/system/VacRegistration/index.vue
-
342chenhai-ui/src/views/system/slaughterInfo/index.vue
-
80chenhai-ui/src/views/system/vacInfo/index.vue
-
15pom.xml
@ -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)); |
||||
|
} |
||||
|
} |
||||
@ -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)); |
||||
|
// } |
||||
|
} |
||||
@ -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)); |
||||
|
} |
||||
|
} |
||||
@ -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(); |
||||
|
} |
||||
|
} |
||||
@ -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); |
||||
|
} |
||||
@ -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); |
||||
|
} |
||||
@ -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); |
||||
|
} |
||||
|
} |
||||
@ -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> |
||||
@ -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' |
||||
|
}) |
||||
|
} |
||||
@ -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> |
||||
@ -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> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue