@ -0,0 +1,180 @@ |
||||
package org.jeecg.modules.demo.depadminlx.controller; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.io.IOException; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.URLDecoder; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.system.query.QueryRuleEnum; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
import org.jeecg.modules.demo.depadminlx.entity.Depadminlx; |
||||
import org.jeecg.modules.demo.depadminlx.service.IDepadminlxService; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil; |
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
import org.jeecgframework.poi.excel.entity.ImportParams; |
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
import com.alibaba.fastjson.JSON; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
||||
/** |
||||
* @Description: 单位基本情况联系人 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="单位基本情况联系人") |
||||
@RestController |
||||
@RequestMapping("/depadminlx/depadminlx") |
||||
@Slf4j |
||||
public class DepadminlxController extends JeecgController<Depadminlx, IDepadminlxService> { |
||||
@Autowired |
||||
private IDepadminlxService depadminlxService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param depadminlx |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
//@AutoLog(value = "单位基本情况联系人-分页列表查询")
|
||||
@ApiOperation(value="单位基本情况联系人-分页列表查询", notes="单位基本情况联系人-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<IPage<Depadminlx>> queryPageList(Depadminlx depadminlx, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<Depadminlx> queryWrapper = QueryGenerator.initQueryWrapper(depadminlx, req.getParameterMap()); |
||||
Page<Depadminlx> page = new Page<Depadminlx>(pageNo, pageSize); |
||||
IPage<Depadminlx> pageList = depadminlxService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param depadminlx |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "单位基本情况联系人-添加") |
||||
@ApiOperation(value="单位基本情况联系人-添加", notes="单位基本情况联系人-添加") |
||||
@RequiresPermissions("depadminlx:depadminlx:add") |
||||
@PostMapping(value = "/add") |
||||
public Result<String> add(@RequestBody Depadminlx depadminlx) { |
||||
depadminlxService.save(depadminlx); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param depadminlx |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "单位基本情况联系人-编辑") |
||||
@ApiOperation(value="单位基本情况联系人-编辑", notes="单位基本情况联系人-编辑") |
||||
@RequiresPermissions("depadminlx:depadminlx:edit") |
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
||||
public Result<String> edit(@RequestBody Depadminlx depadminlx) { |
||||
depadminlxService.updateById(depadminlx); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "单位基本情况联系人-通过id删除") |
||||
@ApiOperation(value="单位基本情况联系人-通过id删除", notes="单位基本情况联系人-通过id删除") |
||||
@RequiresPermissions("depadminlx:depadminlx:delete") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
||||
depadminlxService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "单位基本情况联系人-批量删除") |
||||
@ApiOperation(value="单位基本情况联系人-批量删除", notes="单位基本情况联系人-批量删除") |
||||
@RequiresPermissions("depadminlx:depadminlx:deleteBatch") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.depadminlxService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
//@AutoLog(value = "单位基本情况联系人-通过id查询")
|
||||
@ApiOperation(value="单位基本情况联系人-通过id查询", notes="单位基本情况联系人-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<Depadminlx> queryById(@RequestParam(name="id",required=true) String id) { |
||||
Depadminlx depadminlx = depadminlxService.getById(id); |
||||
if(depadminlx==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(depadminlx); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param depadminlx |
||||
*/ |
||||
@RequiresPermissions("depadminlx:depadminlx:exportXls") |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, Depadminlx depadminlx) { |
||||
return super.exportXls(request, depadminlx, Depadminlx.class, "单位基本情况联系人"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
@RequiresPermissions("depadminlx:depadminlx:importExcel") |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, Depadminlx.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,101 @@ |
||||
package org.jeecg.modules.demo.depadminlx.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.baomidou.mybatisplus.annotation.TableLogic; |
||||
import org.jeecg.common.constant.ProvinceCityArea; |
||||
import org.jeecg.common.util.SpringContextUtils; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Description: 单位基本情况联系人 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("depadminlx") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="depadminlx对象", description="单位基本情况联系人") |
||||
public class Depadminlx implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private String sysOrgCode; |
||||
/**编制数*/ |
||||
@Excel(name = "编制数", width = 15) |
||||
@ApiModelProperty(value = "编制数") |
||||
private String bzs; |
||||
/**在职职工人数:*/ |
||||
@Excel(name = "在职职工人数:", width = 15) |
||||
@ApiModelProperty(value = "在职职工人数:") |
||||
private String zzzgrs; |
||||
/**中级职称以上研究人员数*/ |
||||
@Excel(name = "中级职称以上研究人员数", width = 15) |
||||
@ApiModelProperty(value = "中级职称以上研究人员数") |
||||
private String zjzcysyjrys; |
||||
/**单位联系人姓名*/ |
||||
@Excel(name = "单位联系人姓名", width = 15) |
||||
@ApiModelProperty(value = "单位联系人姓名") |
||||
private String dwlxrxm; |
||||
/**单位联系人职称*/ |
||||
@Excel(name = "单位联系人职称", width = 15) |
||||
@ApiModelProperty(value = "单位联系人职称") |
||||
private String dwlxrzc; |
||||
/**单位联系人职务*/ |
||||
@Excel(name = "单位联系人职务", width = 15) |
||||
@ApiModelProperty(value = "单位联系人职务") |
||||
private String dwlxrzw; |
||||
/**单位联系人电话*/ |
||||
@Excel(name = "单位联系人电话", width = 15) |
||||
@ApiModelProperty(value = "单位联系人电话") |
||||
private String dwlxrdh; |
||||
/**单位联系人手机*/ |
||||
@Excel(name = "单位联系人手机", width = 15) |
||||
@ApiModelProperty(value = "单位联系人手机") |
||||
private String dwlxrsj; |
||||
/**单位联系人邮箱*/ |
||||
@Excel(name = "单位联系人邮箱", width = 15) |
||||
@ApiModelProperty(value = "单位联系人邮箱") |
||||
private String dwlxryx; |
||||
/**部门*/ |
||||
@Excel(name = "部门", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@ApiModelProperty(value = "部门") |
||||
private String depid; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.depadminlx.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.depadminlx.entity.Depadminlx; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 单位基本情况联系人 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface DepadminlxMapper extends BaseMapper<Depadminlx> { |
||||
|
||||
} |
@ -0,0 +1,5 @@ |
||||
<?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="org.jeecg.modules.demo.depadminlx.mapper.DepadminlxMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.depadminlx.service; |
||||
|
||||
import org.jeecg.modules.demo.depadminlx.entity.Depadminlx; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 单位基本情况联系人 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IDepadminlxService extends IService<Depadminlx> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.depadminlx.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.depadminlx.entity.Depadminlx; |
||||
import org.jeecg.modules.demo.depadminlx.mapper.DepadminlxMapper; |
||||
import org.jeecg.modules.demo.depadminlx.service.IDepadminlxService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 单位基本情况联系人 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class DepadminlxServiceImpl extends ServiceImpl<DepadminlxMapper, Depadminlx> implements IDepadminlxService { |
||||
|
||||
} |
@ -0,0 +1,180 @@ |
||||
package org.jeecg.modules.demo.depfile.controller; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.io.IOException; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.URLDecoder; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.system.query.QueryRuleEnum; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
import org.jeecg.modules.demo.depfile.entity.Depfile; |
||||
import org.jeecg.modules.demo.depfile.service.IDepfileService; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil; |
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
import org.jeecgframework.poi.excel.entity.ImportParams; |
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
import com.alibaba.fastjson.JSON; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
||||
/** |
||||
* @Description: 单位技术研究资质情况 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="单位技术研究资质情况") |
||||
@RestController |
||||
@RequestMapping("/depfile/depfile") |
||||
@Slf4j |
||||
public class DepfileController extends JeecgController<Depfile, IDepfileService> { |
||||
@Autowired |
||||
private IDepfileService depfileService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param depfile |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
//@AutoLog(value = "单位技术研究资质情况-分页列表查询")
|
||||
@ApiOperation(value="单位技术研究资质情况-分页列表查询", notes="单位技术研究资质情况-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<IPage<Depfile>> queryPageList(Depfile depfile, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<Depfile> queryWrapper = QueryGenerator.initQueryWrapper(depfile, req.getParameterMap()); |
||||
Page<Depfile> page = new Page<Depfile>(pageNo, pageSize); |
||||
IPage<Depfile> pageList = depfileService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param depfile |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "单位技术研究资质情况-添加") |
||||
@ApiOperation(value="单位技术研究资质情况-添加", notes="单位技术研究资质情况-添加") |
||||
@RequiresPermissions("depfile:depfile:add") |
||||
@PostMapping(value = "/add") |
||||
public Result<String> add(@RequestBody Depfile depfile) { |
||||
depfileService.save(depfile); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param depfile |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "单位技术研究资质情况-编辑") |
||||
@ApiOperation(value="单位技术研究资质情况-编辑", notes="单位技术研究资质情况-编辑") |
||||
@RequiresPermissions("depfile:depfile:edit") |
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
||||
public Result<String> edit(@RequestBody Depfile depfile) { |
||||
depfileService.updateById(depfile); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "单位技术研究资质情况-通过id删除") |
||||
@ApiOperation(value="单位技术研究资质情况-通过id删除", notes="单位技术研究资质情况-通过id删除") |
||||
@RequiresPermissions("depfile:depfile:delete") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
||||
depfileService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "单位技术研究资质情况-批量删除") |
||||
@ApiOperation(value="单位技术研究资质情况-批量删除", notes="单位技术研究资质情况-批量删除") |
||||
@RequiresPermissions("depfile:depfile:deleteBatch") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.depfileService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
//@AutoLog(value = "单位技术研究资质情况-通过id查询")
|
||||
@ApiOperation(value="单位技术研究资质情况-通过id查询", notes="单位技术研究资质情况-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<Depfile> queryById(@RequestParam(name="id",required=true) String id) { |
||||
Depfile depfile = depfileService.getById(id); |
||||
if(depfile==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(depfile); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param depfile |
||||
*/ |
||||
@RequiresPermissions("depfile:depfile:exportXls") |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, Depfile depfile) { |
||||
return super.exportXls(request, depfile, Depfile.class, "单位技术研究资质情况"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
@RequiresPermissions("depfile:depfile:importExcel") |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, Depfile.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,83 @@ |
||||
package org.jeecg.modules.demo.depfile.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.baomidou.mybatisplus.annotation.TableLogic; |
||||
import org.jeecg.common.constant.ProvinceCityArea; |
||||
import org.jeecg.common.util.SpringContextUtils; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Description: 单位技术研究资质情况 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("depfile") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="depfile对象", description="单位技术研究资质情况") |
||||
public class Depfile implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private String sysOrgCode; |
||||
/**部门名称*/ |
||||
@Excel(name = "部门名称", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@ApiModelProperty(value = "部门名称") |
||||
private String depid; |
||||
/**名称*/ |
||||
@Excel(name = "名称", width = 15) |
||||
@ApiModelProperty(value = "名称") |
||||
private String filename; |
||||
/**认定部门及批号*/ |
||||
@Excel(name = "认定部门及批号", width = 15) |
||||
@ApiModelProperty(value = "认定部门及批号") |
||||
private String depnumber; |
||||
/**认定时间*/ |
||||
@Excel(name = "认定时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "认定时间") |
||||
private Date rdtime; |
||||
/**文件*/ |
||||
@Excel(name = "文件", width = 15) |
||||
@ApiModelProperty(value = "文件") |
||||
private String upfile; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.depfile.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.depfile.entity.Depfile; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 单位技术研究资质情况 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface DepfileMapper extends BaseMapper<Depfile> { |
||||
|
||||
} |
@ -0,0 +1,5 @@ |
||||
<?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="org.jeecg.modules.demo.depfile.mapper.DepfileMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.depfile.service; |
||||
|
||||
import org.jeecg.modules.demo.depfile.entity.Depfile; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 单位技术研究资质情况 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IDepfileService extends IService<Depfile> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.depfile.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.depfile.entity.Depfile; |
||||
import org.jeecg.modules.demo.depfile.mapper.DepfileMapper; |
||||
import org.jeecg.modules.demo.depfile.service.IDepfileService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 单位技术研究资质情况 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class DepfileServiceImpl extends ServiceImpl<DepfileMapper, Depfile> implements IDepfileService { |
||||
|
||||
} |
@ -0,0 +1,180 @@ |
||||
package org.jeecg.modules.demo.depsbncz.controller; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.io.IOException; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.URLDecoder; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.system.query.QueryRuleEnum; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
import org.jeecg.modules.demo.depsbncz.entity.Depsbncz; |
||||
import org.jeecg.modules.demo.depsbncz.service.IDepsbnczService; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil; |
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
import org.jeecgframework.poi.excel.entity.ImportParams; |
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
import com.alibaba.fastjson.JSON; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
||||
/** |
||||
* @Description: 上年度(末)主要财务数据 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="上年度(末)主要财务数据") |
||||
@RestController |
||||
@RequestMapping("/depsbncz/depsbncz") |
||||
@Slf4j |
||||
public class DepsbnczController extends JeecgController<Depsbncz, IDepsbnczService> { |
||||
@Autowired |
||||
private IDepsbnczService depsbnczService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param depsbncz |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
//@AutoLog(value = "上年度(末)主要财务数据-分页列表查询")
|
||||
@ApiOperation(value="上年度(末)主要财务数据-分页列表查询", notes="上年度(末)主要财务数据-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<IPage<Depsbncz>> queryPageList(Depsbncz depsbncz, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<Depsbncz> queryWrapper = QueryGenerator.initQueryWrapper(depsbncz, req.getParameterMap()); |
||||
Page<Depsbncz> page = new Page<Depsbncz>(pageNo, pageSize); |
||||
IPage<Depsbncz> pageList = depsbnczService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param depsbncz |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "上年度(末)主要财务数据-添加") |
||||
@ApiOperation(value="上年度(末)主要财务数据-添加", notes="上年度(末)主要财务数据-添加") |
||||
@RequiresPermissions("depsbncz:depsbncz:add") |
||||
@PostMapping(value = "/add") |
||||
public Result<String> add(@RequestBody Depsbncz depsbncz) { |
||||
depsbnczService.save(depsbncz); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param depsbncz |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "上年度(末)主要财务数据-编辑") |
||||
@ApiOperation(value="上年度(末)主要财务数据-编辑", notes="上年度(末)主要财务数据-编辑") |
||||
@RequiresPermissions("depsbncz:depsbncz:edit") |
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
||||
public Result<String> edit(@RequestBody Depsbncz depsbncz) { |
||||
depsbnczService.updateById(depsbncz); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "上年度(末)主要财务数据-通过id删除") |
||||
@ApiOperation(value="上年度(末)主要财务数据-通过id删除", notes="上年度(末)主要财务数据-通过id删除") |
||||
@RequiresPermissions("depsbncz:depsbncz:delete") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
||||
depsbnczService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "上年度(末)主要财务数据-批量删除") |
||||
@ApiOperation(value="上年度(末)主要财务数据-批量删除", notes="上年度(末)主要财务数据-批量删除") |
||||
@RequiresPermissions("depsbncz:depsbncz:deleteBatch") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.depsbnczService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
//@AutoLog(value = "上年度(末)主要财务数据-通过id查询")
|
||||
@ApiOperation(value="上年度(末)主要财务数据-通过id查询", notes="上年度(末)主要财务数据-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<Depsbncz> queryById(@RequestParam(name="id",required=true) String id) { |
||||
Depsbncz depsbncz = depsbnczService.getById(id); |
||||
if(depsbncz==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(depsbncz); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param depsbncz |
||||
*/ |
||||
@RequiresPermissions("depsbncz:depsbncz:exportXls") |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, Depsbncz depsbncz) { |
||||
return super.exportXls(request, depsbncz, Depsbncz.class, "上年度(末)主要财务数据"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
@RequiresPermissions("depsbncz:depsbncz:importExcel") |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, Depsbncz.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,105 @@ |
||||
package org.jeecg.modules.demo.depsbncz.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.baomidou.mybatisplus.annotation.TableLogic; |
||||
import org.jeecg.common.constant.ProvinceCityArea; |
||||
import org.jeecg.common.util.SpringContextUtils; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Description: 上年度(末)主要财务数据 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("depsbncz") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="depsbncz对象", description="上年度(末)主要财务数据") |
||||
public class Depsbncz implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private String sysOrgCode; |
||||
/**部门*/ |
||||
@Excel(name = "部门", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@ApiModelProperty(value = "部门") |
||||
private String depid; |
||||
/**单位开办费*/ |
||||
@Excel(name = "单位开办费", width = 15) |
||||
@ApiModelProperty(value = "单位开办费") |
||||
private String dwkbf; |
||||
/**资产合计*/ |
||||
@Excel(name = "资产合计", width = 15) |
||||
@ApiModelProperty(value = "资产合计") |
||||
private String zchj; |
||||
/**负债合计*/ |
||||
@Excel(name = "负债合计", width = 15) |
||||
@ApiModelProperty(value = "负债合计") |
||||
private String fzhj; |
||||
/**净资产*/ |
||||
@Excel(name = "净资产", width = 15) |
||||
@ApiModelProperty(value = "净资产") |
||||
private String jzc; |
||||
/**财政拨款*/ |
||||
@Excel(name = "财政拨款", width = 15) |
||||
@ApiModelProperty(value = "财政拨款") |
||||
private String czbk; |
||||
/**财政拨款专项支出*/ |
||||
@Excel(name = "财政拨款专项支出", width = 15) |
||||
@ApiModelProperty(value = "财政拨款专项支出") |
||||
private String czbkzxzc; |
||||
/**经营收入*/ |
||||
@Excel(name = "经营收入", width = 15) |
||||
@ApiModelProperty(value = "经营收入") |
||||
private String jysr; |
||||
/**经营支出*/ |
||||
@Excel(name = "经营支出", width = 15) |
||||
@ApiModelProperty(value = "经营支出") |
||||
private String jyzc; |
||||
/**经营结余*/ |
||||
@Excel(name = "经营结余", width = 15) |
||||
@ApiModelProperty(value = "经营结余") |
||||
private String jyjy; |
||||
/**纳税总额*/ |
||||
@Excel(name = "纳税总额", width = 15) |
||||
@ApiModelProperty(value = "纳税总额") |
||||
private String nsze; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.depsbncz.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.depsbncz.entity.Depsbncz; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 上年度(末)主要财务数据 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface DepsbnczMapper extends BaseMapper<Depsbncz> { |
||||
|
||||
} |
@ -0,0 +1,5 @@ |
||||
<?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="org.jeecg.modules.demo.depsbncz.mapper.DepsbnczMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.depsbncz.service; |
||||
|
||||
import org.jeecg.modules.demo.depsbncz.entity.Depsbncz; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 上年度(末)主要财务数据 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IDepsbnczService extends IService<Depsbncz> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.depsbncz.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.depsbncz.entity.Depsbncz; |
||||
import org.jeecg.modules.demo.depsbncz.mapper.DepsbnczMapper; |
||||
import org.jeecg.modules.demo.depsbncz.service.IDepsbnczService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 上年度(末)主要财务数据 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class DepsbnczServiceImpl extends ServiceImpl<DepsbnczMapper, Depsbncz> implements IDepsbnczService { |
||||
|
||||
} |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 743 B |
After Width: | Height: | Size: 709 B |
After Width: | Height: | Size: 895 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 811 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 808 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 142 KiB |
After Width: | Height: | Size: 529 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 142 KiB |
After Width: | Height: | Size: 6.3 MiB |
After Width: | Height: | Size: 393 B |
After Width: | Height: | Size: 371 B |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 615 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 505 KiB |
After Width: | Height: | Size: 191 KiB |
After Width: | Height: | Size: 700 KiB |
After Width: | Height: | Size: 234 KiB |
After Width: | Height: | Size: 784 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 191 KiB |
After Width: | Height: | Size: 234 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,72 @@ |
||||
import { defHttp } from '/@/utils/http/axios'; |
||||
import { useMessage } from "/@/hooks/web/useMessage"; |
||||
|
||||
const { createConfirm } = useMessage(); |
||||
|
||||
enum Api { |
||||
list = '/depadminlx/depadminlx/list', |
||||
save='/depadminlx/depadminlx/add', |
||||
edit='/depadminlx/depadminlx/edit', |
||||
deleteOne = '/depadminlx/depadminlx/delete', |
||||
deleteBatch = '/depadminlx/depadminlx/deleteBatch', |
||||
importExcel = '/depadminlx/depadminlx/importExcel', |
||||
exportXls = '/depadminlx/depadminlx/exportXls', |
||||
} |
||||
|
||||
/** |
||||
* 导出api |
||||
* @param params |
||||
*/ |
||||
export const getExportUrl = Api.exportXls; |
||||
|
||||
/** |
||||
* 导入api |
||||
*/ |
||||
export const getImportUrl = Api.importExcel; |
||||
|
||||
/** |
||||
* 列表接口 |
||||
* @param params |
||||
*/ |
||||
export const list = (params) => defHttp.get({ url: Api.list, params }); |
||||
|
||||
/** |
||||
* 删除单个 |
||||
* @param params |
||||
* @param handleSuccess |
||||
*/ |
||||
export const deleteOne = (params,handleSuccess) => { |
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { |
||||
handleSuccess(); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* @param params |
||||
* @param handleSuccess |
||||
*/ |
||||
export const batchDelete = (params, handleSuccess) => { |
||||
createConfirm({ |
||||
iconType: 'warning', |
||||
title: '确认删除', |
||||
content: '是否删除选中数据', |
||||
okText: '确认', |
||||
cancelText: '取消', |
||||
onOk: () => { |
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { |
||||
handleSuccess(); |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 保存或者更新 |
||||
* @param params |
||||
* @param isUpdate |
||||
*/ |
||||
export const saveOrUpdate = (params, isUpdate) => { |
||||
let url = isUpdate ? Api.edit : Api.save; |
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false }); |
||||
} |
@ -0,0 +1,72 @@ |
||||
import {BasicColumn} from '/@/components/Table'; |
||||
import {FormSchema} from '/@/components/Table'; |
||||
import { rules} from '/@/utils/helper/validator'; |
||||
import { render } from '/@/utils/common/renderUtils'; |
||||
import { getWeekMonthQuarterYear } from '/@/utils'; |
||||
//列表数据 |
||||
export const columns: BasicColumn[] = [ |
||||
{ |
||||
title: '编制数', |
||||
align: "center", |
||||
dataIndex: 'bzs' |
||||
}, |
||||
{ |
||||
title: '在职职工人数:', |
||||
align: "center", |
||||
dataIndex: 'zzzgrs' |
||||
}, |
||||
{ |
||||
title: '中级职称以上研究人员数', |
||||
align: "center", |
||||
dataIndex: 'zjzcysyjrys' |
||||
}, |
||||
{ |
||||
title: '单位联系人姓名', |
||||
align: "center", |
||||
dataIndex: 'dwlxrxm' |
||||
}, |
||||
{ |
||||
title: '单位联系人职称', |
||||
align: "center", |
||||
dataIndex: 'dwlxrzc' |
||||
}, |
||||
{ |
||||
title: '单位联系人职务', |
||||
align: "center", |
||||
dataIndex: 'dwlxrzw' |
||||
}, |
||||
{ |
||||
title: '单位联系人电话', |
||||
align: "center", |
||||
dataIndex: 'dwlxrdh' |
||||
}, |
||||
{ |
||||
title: '单位联系人手机', |
||||
align: "center", |
||||
dataIndex: 'dwlxrsj' |
||||
}, |
||||
{ |
||||
title: '单位联系人邮箱', |
||||
align: "center", |
||||
dataIndex: 'dwlxryx' |
||||
}, |
||||
{ |
||||
title: '部门', |
||||
align: "center", |
||||
dataIndex: 'depid_dictText' |
||||
}, |
||||
]; |
||||
|
||||
// 高级查询数据 |
||||
export const superQuerySchema = { |
||||
bzs: {title: '编制数',order: 0,view: 'text', type: 'string',}, |
||||
zzzgrs: {title: '在职职工人数:',order: 1,view: 'text', type: 'string',}, |
||||
zjzcysyjrys: {title: '中级职称以上研究人员数',order: 2,view: 'text', type: 'string',}, |
||||
dwlxrxm: {title: '单位联系人姓名',order: 3,view: 'text', type: 'string',}, |
||||
dwlxrzc: {title: '单位联系人职称',order: 4,view: 'text', type: 'string',}, |
||||
dwlxrzw: {title: '单位联系人职务',order: 5,view: 'text', type: 'string',}, |
||||
dwlxrdh: {title: '单位联系人电话',order: 6,view: 'text', type: 'string',}, |
||||
dwlxrsj: {title: '单位联系人手机',order: 7,view: 'text', type: 'string',}, |
||||
dwlxryx: {title: '单位联系人邮箱',order: 8,view: 'text', type: 'string',}, |
||||
depid: {title: '部门',order: 9,view: 'sel_search', type: 'string',dictTable: "sys_depart", dictCode: 'id', dictText: 'depart_name',}, |
||||
}; |
@ -0,0 +1,256 @@ |
||||
<template> |
||||
<div class="p-2"> |
||||
<!--查询区域--> |
||||
<div class="jeecg-basic-table-form-container"> |
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol"> |
||||
<a-row :gutter="24"> |
||||
<a-col :lg="6"> |
||||
<a-form-item name="depid"> |
||||
<template #label><span title="部门">部门</span></template> |
||||
<j-search-select placeholder="请选择部门" v-model:value="queryParam.depid" dict="sys_depart,depart_name,id" allow-clear /> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons"> |
||||
<a-col :lg="6"> |
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button> |
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button> |
||||
<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px"> |
||||
{{ toggleSearchStatus ? '收起' : '展开' }} |
||||
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" /> |
||||
</a> |
||||
</a-col> |
||||
</span> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!--引用表格--> |
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection"> |
||||
<!--插槽:table标题--> |
||||
<template #tableTitle> |
||||
<a-button type="primary" v-auth="'depadminlx:depadminlx:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> |
||||
<a-button type="primary" v-auth="'depadminlx:depadminlx:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> |
||||
<j-upload-button type="primary" v-auth="'depadminlx:depadminlx:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> |
||||
<a-dropdown v-if="selectedRowKeys.length > 0"> |
||||
<template #overlay> |
||||
<a-menu> |
||||
<a-menu-item key="1" @click="batchHandleDelete"> |
||||
<Icon icon="ant-design:delete-outlined"></Icon> |
||||
删除 |
||||
</a-menu-item> |
||||
</a-menu> |
||||
</template> |
||||
<a-button v-auth="'depadminlx:depadminlx:deleteBatch'">批量操作 |
||||
<Icon icon="mdi:chevron-down"></Icon> |
||||
</a-button> |
||||
</a-dropdown> |
||||
<!-- 高级查询 --> |
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" /> |
||||
</template> |
||||
<!--操作栏--> |
||||
<template #action="{ record }"> |
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> |
||||
</template> |
||||
<template v-slot:bodyCell="{ column, record, index, text }"> |
||||
</template> |
||||
</BasicTable> |
||||
<!-- 表单区域 --> |
||||
<DepadminlxModal ref="registerModal" @success="handleSuccess"></DepadminlxModal> |
||||
</div> |
||||
</template> |
||||
|
||||
<script lang="ts" name="depadminlx-depadminlx" setup> |
||||
import { ref, reactive } from 'vue'; |
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
||||
import { useListPage } from '/@/hooks/system/useListPage'; |
||||
import { columns, superQuerySchema } from './Depadminlx.data'; |
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Depadminlx.api'; |
||||
import { downloadFile } from '/@/utils/common/renderUtils'; |
||||
import DepadminlxModal from './components/DepadminlxModal.vue' |
||||
import { useUserStore } from '/@/store/modules/user'; |
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; |
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue'; |
||||
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue'; |
||||
|
||||
const formRef = ref(); |
||||
const queryParam = reactive<any>({}); |
||||
const toggleSearchStatus = ref<boolean>(false); |
||||
const registerModal = ref(); |
||||
const userStore = useUserStore(); |
||||
//注册table数据 |
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ |
||||
tableProps: { |
||||
title: '单位基本情况联系人', |
||||
api: list, |
||||
columns, |
||||
canResize:false, |
||||
useSearchForm: false, |
||||
actionColumn: { |
||||
width: 120, |
||||
fixed: 'right', |
||||
}, |
||||
beforeFetch: async (params) => { |
||||
return Object.assign(params, queryParam); |
||||
}, |
||||
}, |
||||
exportConfig: { |
||||
name: "单位基本情况联系人", |
||||
url: getExportUrl, |
||||
params: queryParam, |
||||
}, |
||||
importConfig: { |
||||
url: getImportUrl, |
||||
success: handleSuccess |
||||
}, |
||||
}); |
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext; |
||||
const labelCol = reactive({ |
||||
xs:24, |
||||
sm:4, |
||||
xl:6, |
||||
xxl:4 |
||||
}); |
||||
const wrapperCol = reactive({ |
||||
xs: 24, |
||||
sm: 20, |
||||
}); |
||||
|
||||
// 高级查询配置 |
||||
const superQueryConfig = reactive(superQuerySchema); |
||||
|
||||
/** |
||||
* 高级查询事件 |
||||
*/ |
||||
function handleSuperQuery(params) { |
||||
Object.keys(params).map((k) => { |
||||
queryParam[k] = params[k]; |
||||
}); |
||||
searchQuery(); |
||||
} |
||||
|
||||
/** |
||||
* 新增事件 |
||||
*/ |
||||
function handleAdd() { |
||||
registerModal.value.disableSubmit = false; |
||||
registerModal.value.add(); |
||||
} |
||||
|
||||
/** |
||||
* 编辑事件 |
||||
*/ |
||||
function handleEdit(record: Recordable) { |
||||
registerModal.value.disableSubmit = false; |
||||
registerModal.value.edit(record); |
||||
} |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
function handleDetail(record: Recordable) { |
||||
registerModal.value.disableSubmit = true; |
||||
registerModal.value.edit(record); |
||||
} |
||||
|
||||
/** |
||||
* 删除事件 |
||||
*/ |
||||
async function handleDelete(record) { |
||||
await deleteOne({ id: record.id }, handleSuccess); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除事件 |
||||
*/ |
||||
async function batchHandleDelete() { |
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess); |
||||
} |
||||
|
||||
/** |
||||
* 成功回调 |
||||
*/ |
||||
function handleSuccess() { |
||||
(selectedRowKeys.value = []) && reload(); |
||||
} |
||||
|
||||
/** |
||||
* 操作栏 |
||||
*/ |
||||
function getTableAction(record) { |
||||
return [ |
||||
{ |
||||
label: '编辑', |
||||
onClick: handleEdit.bind(null, record), |
||||
auth: 'depadminlx:depadminlx:edit' |
||||
}, |
||||
]; |
||||
} |
||||
|
||||
/** |
||||
* 下拉操作栏 |
||||
*/ |
||||
function getDropDownAction(record) { |
||||
return [ |
||||
{ |
||||
label: '详情', |
||||
onClick: handleDetail.bind(null, record), |
||||
}, { |
||||
label: '删除', |
||||
popConfirm: { |
||||
title: '是否确认删除', |
||||
confirm: handleDelete.bind(null, record), |
||||
placement: 'topLeft', |
||||
}, |
||||
auth: 'depadminlx:depadminlx:delete' |
||||
} |
||||
] |
||||
} |
||||
|
||||
/** |
||||
* 查询 |
||||
*/ |
||||
function searchQuery() { |
||||
reload(); |
||||
} |
||||
|
||||
/** |
||||
* 重置 |
||||
*/ |
||||
function searchReset() { |
||||
formRef.value.resetFields(); |
||||
selectedRowKeys.value = []; |
||||
//刷新数据 |
||||
reload(); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style lang="less" scoped> |
||||
.jeecg-basic-table-form-container { |
||||
padding: 0; |
||||
.table-page-search-submitButtons { |
||||
display: block; |
||||
margin-bottom: 24px; |
||||
white-space: nowrap; |
||||
} |
||||
.query-group-cust{ |
||||
min-width: 100px !important; |
||||
} |
||||
.query-group-split-cust{ |
||||
width: 30px; |
||||
display: inline-block; |
||||
text-align: center |
||||
} |
||||
.ant-form-item:not(.ant-form-item-with-help){ |
||||
margin-bottom: 16px; |
||||
height: 32px; |
||||
} |
||||
:deep(.ant-picker),:deep(.ant-input-number){ |
||||
width: 100%; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,26 @@ |
||||
-- 注意:该页面对应的前台目录为views/depadminlx文件夹下 |
||||
-- 如果你想更改到其他目录,请修改sql中component字段对应的值 |
||||
|
||||
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) |
||||
VALUES ('2024110110148950120', NULL, '单位基本情况联系人', '/depadminlx/depadminlxList', 'depadminlx/DepadminlxList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-11-01 10:14:12', NULL, NULL, 0); |
||||
|
||||
-- 权限控制sql |
||||
-- 新增 |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110110148950121', '2024110110148950120', '添加单位基本情况联系人', NULL, NULL, 0, NULL, NULL, 2, 'depadminlx:depadminlx:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 10:14:12', NULL, NULL, 0, 0, '1', 0); |
||||
-- 编辑 |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110110148950122', '2024110110148950120', '编辑单位基本情况联系人', NULL, NULL, 0, NULL, NULL, 2, 'depadminlx:depadminlx:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 10:14:12', NULL, NULL, 0, 0, '1', 0); |
||||
-- 删除 |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110110148950123', '2024110110148950120', '删除单位基本情况联系人', NULL, NULL, 0, NULL, NULL, 2, 'depadminlx:depadminlx:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 10:14:12', NULL, NULL, 0, 0, '1', 0); |
||||
-- 批量删除 |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110110148950124', '2024110110148950120', '批量删除单位基本情况联系人', NULL, NULL, 0, NULL, NULL, 2, 'depadminlx:depadminlx:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 10:14:12', NULL, NULL, 0, 0, '1', 0); |
||||
-- 导出excel |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110110148950125', '2024110110148950120', '导出excel_单位基本情况联系人', NULL, NULL, 0, NULL, NULL, 2, 'depadminlx:depadminlx:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 10:14:12', NULL, NULL, 0, 0, '1', 0); |
||||
-- 导入excel |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110110148950126', '2024110110148950120', '导入excel_单位基本情况联系人', NULL, NULL, 0, NULL, NULL, 2, 'depadminlx:depadminlx:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 10:14:12', NULL, NULL, 0, 0, '1', 0); |
@ -0,0 +1,202 @@ |
||||
<template> |
||||
<a-spin :spinning="confirmLoading"> |
||||
<JFormContainer :disabled="disabled"> |
||||
<template #detail> |
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="DepadminlxForm"> |
||||
<a-row> |
||||
<a-col :span="24"> |
||||
<a-form-item label="编制数" v-bind="validateInfos.bzs" id="DepadminlxForm-bzs" name="bzs"> |
||||
<a-input v-model:value="formData.bzs" placeholder="请输入编制数" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="在职职工人数:" v-bind="validateInfos.zzzgrs" id="DepadminlxForm-zzzgrs" name="zzzgrs"> |
||||
<a-input v-model:value="formData.zzzgrs" placeholder="请输入在职职工人数:" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="中级职称以上研究人员数" v-bind="validateInfos.zjzcysyjrys" id="DepadminlxForm-zjzcysyjrys" name="zjzcysyjrys"> |
||||
<a-input v-model:value="formData.zjzcysyjrys" placeholder="请输入中级职称以上研究人员数" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="单位联系人姓名" v-bind="validateInfos.dwlxrxm" id="DepadminlxForm-dwlxrxm" name="dwlxrxm"> |
||||
<a-input v-model:value="formData.dwlxrxm" placeholder="请输入单位联系人姓名" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="单位联系人职称" v-bind="validateInfos.dwlxrzc" id="DepadminlxForm-dwlxrzc" name="dwlxrzc"> |
||||
<a-input v-model:value="formData.dwlxrzc" placeholder="请输入单位联系人职称" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="单位联系人职务" v-bind="validateInfos.dwlxrzw" id="DepadminlxForm-dwlxrzw" name="dwlxrzw"> |
||||
<a-input v-model:value="formData.dwlxrzw" placeholder="请输入单位联系人职务" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="单位联系人电话" v-bind="validateInfos.dwlxrdh" id="DepadminlxForm-dwlxrdh" name="dwlxrdh"> |
||||
<a-input v-model:value="formData.dwlxrdh" placeholder="请输入单位联系人电话" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="单位联系人手机" v-bind="validateInfos.dwlxrsj" id="DepadminlxForm-dwlxrsj" name="dwlxrsj"> |
||||
<a-input v-model:value="formData.dwlxrsj" placeholder="请输入单位联系人手机" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="单位联系人邮箱" v-bind="validateInfos.dwlxryx" id="DepadminlxForm-dwlxryx" name="dwlxryx"> |
||||
<a-input v-model:value="formData.dwlxryx" placeholder="请输入单位联系人邮箱" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="部门" v-bind="validateInfos.depid" id="DepadminlxForm-depid" name="depid"> |
||||
<j-search-select v-model:value="formData.depid" dict="sys_depart,depart_name,id" allow-clear /> |
||||
</a-form-item> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</template> |
||||
</JFormContainer> |
||||
</a-spin> |
||||
</template> |
||||
|
||||
<script lang="ts" setup> |
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue'; |
||||
import { defHttp } from '/@/utils/http/axios'; |
||||
import { useMessage } from '/@/hooks/web/useMessage'; |
||||
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue'; |
||||
import { getValueType } from '/@/utils'; |
||||
import { saveOrUpdate } from '../Depadminlx.api'; |
||||
import { Form } from 'ant-design-vue'; |
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue'; |
||||
const props = defineProps({ |
||||
formDisabled: { type: Boolean, default: false }, |
||||
formData: { type: Object, default: () => ({})}, |
||||
formBpm: { type: Boolean, default: true } |
||||
}); |
||||
const formRef = ref(); |
||||
const useForm = Form.useForm; |
||||
const emit = defineEmits(['register', 'ok']); |
||||
const formData = reactive<Record<string, any>>({ |
||||
id: '', |
||||
bzs: '', |
||||
zzzgrs: '', |
||||
zjzcysyjrys: '', |
||||
dwlxrxm: '', |
||||
dwlxrzc: '', |
||||
dwlxrzw: '', |
||||
dwlxrdh: '', |
||||
dwlxrsj: '', |
||||
dwlxryx: '', |
||||
depid: '', |
||||
}); |
||||
const { createMessage } = useMessage(); |
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } }); |
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } }); |
||||
const confirmLoading = ref<boolean>(false); |
||||
//表单验证 |
||||
const validatorRules = reactive({ |
||||
dwlxrsj: [{ required: false}, { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'},], |
||||
dwlxryx: [{ required: false}, { pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/, message: '请输入正确的电子邮件!'},], |
||||
}); |
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false }); |
||||
|
||||
// 表单禁用 |
||||
const disabled = computed(()=>{ |
||||
if(props.formBpm === true){ |
||||
if(props.formData.disabled === false){ |
||||
return false; |
||||
}else{ |
||||
return true; |
||||
} |
||||
} |
||||
return props.formDisabled; |
||||
}); |
||||
|
||||
|
||||
/** |
||||
* 新增 |
||||
*/ |
||||
function add() { |
||||
edit({}); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
*/ |
||||
function edit(record) { |
||||
nextTick(() => { |
||||
resetFields(); |
||||
const tmpData = {}; |
||||
Object.keys(formData).forEach((key) => { |
||||
if(record.hasOwnProperty(key)){ |
||||
tmpData[key] = record[key] |
||||
} |
||||
}) |
||||
//赋值 |
||||
Object.assign(formData, tmpData); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 提交数据 |
||||
*/ |
||||
async function submitForm() { |
||||
try { |
||||
// 触发表单验证 |
||||
await validate(); |
||||
} catch ({ errorFields }) { |
||||
if (errorFields) { |
||||
const firstField = errorFields[0]; |
||||
if (firstField) { |
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' }); |
||||
} |
||||
} |
||||
return Promise.reject(errorFields); |
||||
} |
||||
confirmLoading.value = true; |
||||
const isUpdate = ref<boolean>(false); |
||||
//时间格式化 |
||||
let model = formData; |
||||
if (model.id) { |
||||
isUpdate.value = true; |
||||
} |
||||
//循环数据 |
||||
for (let data in model) { |
||||
//如果该数据是数组并且是字符串类型 |
||||
if (model[data] instanceof Array) { |
||||
let valueType = getValueType(formRef.value.getProps, data); |
||||
//如果是字符串类型的需要变成以逗号分割的字符串 |
||||
if (valueType === 'string') { |
||||
model[data] = model[data].join(','); |
||||
} |
||||
} |
||||
} |
||||
await saveOrUpdate(model, isUpdate.value) |
||||
.then((res) => { |
||||
if (res.success) { |
||||
createMessage.success(res.message); |
||||
emit('ok'); |
||||
} else { |
||||
createMessage.warning(res.message); |
||||
} |
||||
}) |
||||
.finally(() => { |
||||
confirmLoading.value = false; |
||||
}); |
||||
} |
||||
|
||||
|
||||
defineExpose({ |
||||
add, |
||||
edit, |
||||
submitForm, |
||||
}); |
||||
</script> |
||||
|
||||
<style lang="less" scoped> |
||||
.antd-modal-form { |
||||
padding: 14px; |
||||
} |
||||
</style> |
@ -0,0 +1,77 @@ |
||||
<template> |
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"> |
||||
<DepadminlxForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></DepadminlxForm> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script lang="ts" setup> |
||||
import { ref, nextTick, defineExpose } from 'vue'; |
||||
import DepadminlxForm from './DepadminlxForm.vue' |
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue'; |
||||
|
||||
const title = ref<string>(''); |
||||
const width = ref<number>(800); |
||||
const visible = ref<boolean>(false); |
||||
const disableSubmit = ref<boolean>(false); |
||||
const registerForm = ref(); |
||||
const emit = defineEmits(['register', 'success']); |
||||
|
||||
/** |
||||
* 新增 |
||||
*/ |
||||
function add() { |
||||
title.value = '新增'; |
||||
visible.value = true; |
||||
nextTick(() => { |
||||
registerForm.value.add(); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* @param record |
||||
*/ |
||||
function edit(record) { |
||||
title.value = disableSubmit.value ? '详情' : '编辑'; |
||||
visible.value = true; |
||||
nextTick(() => { |
||||
registerForm.value.edit(record); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 确定按钮点击事件 |
||||
*/ |
||||
function handleOk() { |
||||
registerForm.value.submitForm(); |
||||
} |
||||
|
||||
/** |
||||
* form保存回调事件 |
||||
*/ |
||||
function submitCallback() { |
||||
handleCancel(); |
||||
emit('success'); |
||||
} |
||||
|
||||
/** |
||||
* 取消按钮回调事件 |
||||
*/ |
||||
function handleCancel() { |
||||
visible.value = false; |
||||
} |
||||
|
||||
defineExpose({ |
||||
add, |
||||
edit, |
||||
disableSubmit, |
||||
}); |
||||
</script> |
||||
|
||||
<style lang="less"> |
||||
/**隐藏样式-modal确定按钮 */ |
||||
.jee-hidden { |
||||
display: none !important; |
||||
} |
||||
</style> |
||||
<style lang="less" scoped></style> |
@ -0,0 +1,72 @@ |
||||
import { defHttp } from '/@/utils/http/axios'; |
||||
import { useMessage } from "/@/hooks/web/useMessage"; |
||||
|
||||
const { createConfirm } = useMessage(); |
||||
|
||||
enum Api { |
||||
list = '/depfile/depfile/list', |
||||
save='/depfile/depfile/add', |
||||
edit='/depfile/depfile/edit', |
||||
deleteOne = '/depfile/depfile/delete', |
||||
deleteBatch = '/depfile/depfile/deleteBatch', |
||||
importExcel = '/depfile/depfile/importExcel', |
||||
exportXls = '/depfile/depfile/exportXls', |
||||
} |
||||
|
||||
/** |
||||
* 导出api |
||||
* @param params |
||||
*/ |
||||
export const getExportUrl = Api.exportXls; |
||||
|
||||
/** |
||||
* 导入api |
||||
*/ |
||||
export const getImportUrl = Api.importExcel; |
||||
|
||||
/** |
||||
* 列表接口 |
||||
* @param params |
||||
*/ |
||||
export const list = (params) => defHttp.get({ url: Api.list, params }); |
||||
|
||||
/** |
||||
* 删除单个 |
||||
* @param params |
||||
* @param handleSuccess |
||||
*/ |
||||
export const deleteOne = (params,handleSuccess) => { |
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { |
||||
handleSuccess(); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* @param params |
||||
* @param handleSuccess |
||||
*/ |
||||
export const batchDelete = (params, handleSuccess) => { |
||||
createConfirm({ |
||||
iconType: 'warning', |
||||
title: '确认删除', |
||||
content: '是否删除选中数据', |
||||
okText: '确认', |
||||
cancelText: '取消', |
||||
onOk: () => { |
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { |
||||
handleSuccess(); |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 保存或者更新 |
||||
* @param params |
||||
* @param isUpdate |
||||
*/ |
||||
export const saveOrUpdate = (params, isUpdate) => { |
||||
let url = isUpdate ? Api.edit : Api.save; |
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false }); |
||||
} |
@ -0,0 +1,42 @@ |
||||
import {BasicColumn} from '/@/components/Table'; |
||||
import {FormSchema} from '/@/components/Table'; |
||||
import { rules} from '/@/utils/helper/validator'; |
||||
import { render } from '/@/utils/common/renderUtils'; |
||||
import { getWeekMonthQuarterYear } from '/@/utils'; |
||||
//列表数据 |
||||
export const columns: BasicColumn[] = [ |
||||
{ |
||||
title: '部门名称', |
||||
align: "center", |
||||
dataIndex: 'depid_dictText' |
||||
}, |
||||
{ |
||||
title: '名称', |
||||
align: "center", |
||||
dataIndex: 'filename' |
||||
}, |
||||
{ |
||||
title: '认定部门及批号', |
||||
align: "center", |
||||
dataIndex: 'depnumber' |
||||
}, |
||||
{ |
||||
title: '认定时间', |
||||
align: "center", |
||||
dataIndex: 'rdtime' |
||||
}, |
||||
{ |
||||
title: '文件', |
||||
align: "center", |
||||
dataIndex: 'upfile', |
||||
}, |
||||
]; |
||||
|
||||
// 高级查询数据 |
||||
export const superQuerySchema = { |
||||
depid: {title: '部门名称',order: 0,view: 'sel_search', type: 'string',dictTable: "sys_depart", dictCode: 'id', dictText: 'depart_name',}, |
||||
filename: {title: '名称',order: 1,view: 'text', type: 'string',}, |
||||
depnumber: {title: '认定部门及批号',order: 2,view: 'text', type: 'string',}, |
||||
rdtime: {title: '认定时间',order: 3,view: 'datetime', type: 'string',}, |
||||
upfile: {title: '文件',order: 4,view: 'file', type: 'string',}, |
||||
}; |
@ -0,0 +1,241 @@ |
||||
<template> |
||||
<div class="p-2"> |
||||
<!--查询区域--> |
||||
<div class="jeecg-basic-table-form-container"> |
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol"> |
||||
<a-row :gutter="24"> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!--引用表格--> |
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection"> |
||||
<!--插槽:table标题--> |
||||
<template #tableTitle> |
||||
<a-button type="primary" v-auth="'depfile:depfile:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> |
||||
<a-button type="primary" v-auth="'depfile:depfile:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> |
||||
<j-upload-button type="primary" v-auth="'depfile:depfile:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> |
||||
<a-dropdown v-if="selectedRowKeys.length > 0"> |
||||
<template #overlay> |
||||
<a-menu> |
||||
<a-menu-item key="1" @click="batchHandleDelete"> |
||||
<Icon icon="ant-design:delete-outlined"></Icon> |
||||
删除 |
||||
</a-menu-item> |
||||
</a-menu> |
||||
</template> |
||||
<a-button v-auth="'depfile:depfile:deleteBatch'">批量操作 |
||||
<Icon icon="mdi:chevron-down"></Icon> |
||||
</a-button> |
||||
</a-dropdown> |
||||
<!-- 高级查询 --> |
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" /> |
||||
</template> |
||||
<!--操作栏--> |
||||
<template #action="{ record }"> |
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> |
||||
</template> |
||||
<template v-slot:bodyCell="{ column, record, index, text }"> |
||||
<template v-if="column.dataIndex==='upfile'"> |
||||
<!--文件字段回显插槽--> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
||||
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button> |
||||
</template> |
||||
</template> |
||||
</BasicTable> |
||||
<!-- 表单区域 --> |
||||
<DepfileModal ref="registerModal" @success="handleSuccess"></DepfileModal> |
||||
</div> |
||||
</template> |
||||
|
||||
<script lang="ts" name="depfile-depfile" setup> |
||||
import { ref, reactive } from 'vue'; |
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
||||
import { useListPage } from '/@/hooks/system/useListPage'; |
||||
import { columns, superQuerySchema } from './Depfile.data'; |
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Depfile.api'; |
||||
import { downloadFile } from '/@/utils/common/renderUtils'; |
||||
import DepfileModal from './components/DepfileModal.vue' |
||||
import { useUserStore } from '/@/store/modules/user'; |
||||
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue'; |
||||
|
||||
const formRef = ref(); |
||||
const queryParam = reactive<any>({}); |
||||
const toggleSearchStatus = ref<boolean>(false); |
||||
const registerModal = ref(); |
||||
const userStore = useUserStore(); |
||||
//注册table数据 |
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ |
||||
tableProps: { |
||||
title: '单位技术研究资质情况', |
||||
api: list, |
||||
columns, |
||||
canResize:false, |
||||
useSearchForm: false, |
||||
actionColumn: { |
||||
width: 120, |
||||
fixed: 'right', |
||||
}, |
||||
beforeFetch: async (params) => { |
||||
return Object.assign(params, queryParam); |
||||
}, |
||||
}, |
||||
exportConfig: { |
||||
name: "单位技术研究资质情况", |
||||
url: getExportUrl, |
||||
params: queryParam, |
||||
}, |
||||
importConfig: { |
||||
url: getImportUrl, |
||||
success: handleSuccess |
||||
}, |
||||
}); |
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext; |
||||
const labelCol = reactive({ |
||||
xs:24, |
||||
sm:4, |
||||
xl:6, |
||||
xxl:4 |
||||
}); |
||||
const wrapperCol = reactive({ |
||||
xs: 24, |
||||
sm: 20, |
||||
}); |
||||
|
||||
// 高级查询配置 |
||||
const superQueryConfig = reactive(superQuerySchema); |
||||
|
||||
/** |
||||
* 高级查询事件 |
||||
*/ |
||||
function handleSuperQuery(params) { |
||||
Object.keys(params).map((k) => { |
||||
queryParam[k] = params[k]; |
||||
}); |
||||
searchQuery(); |
||||
} |
||||
|
||||
/** |
||||
* 新增事件 |
||||
*/ |
||||
function handleAdd() { |
||||
registerModal.value.disableSubmit = false; |
||||
registerModal.value.add(); |
||||
} |
||||
|
||||
/** |
||||
* 编辑事件 |
||||
*/ |
||||
function handleEdit(record: Recordable) { |
||||
registerModal.value.disableSubmit = false; |
||||
registerModal.value.edit(record); |
||||
} |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
function handleDetail(record: Recordable) { |
||||
registerModal.value.disableSubmit = true; |
||||
registerModal.value.edit(record); |
||||
} |
||||
|
||||
/** |
||||
* 删除事件 |
||||
*/ |
||||
async function handleDelete(record) { |
||||
await deleteOne({ id: record.id }, handleSuccess); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除事件 |
||||
*/ |
||||
async function batchHandleDelete() { |
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess); |
||||
} |
||||
|
||||
/** |
||||
* 成功回调 |
||||
*/ |
||||
function handleSuccess() { |
||||
(selectedRowKeys.value = []) && reload(); |
||||
} |
||||
|
||||
/** |
||||
* 操作栏 |
||||
*/ |
||||
function getTableAction(record) { |
||||
return [ |
||||
{ |
||||
label: '编辑', |
||||
onClick: handleEdit.bind(null, record), |
||||
auth: 'depfile:depfile:edit' |
||||
}, |
||||
]; |
||||
} |
||||
|
||||
/** |
||||
* 下拉操作栏 |
||||
*/ |
||||
function getDropDownAction(record) { |
||||
return [ |
||||
{ |
||||
label: '详情', |
||||
onClick: handleDetail.bind(null, record), |
||||
}, { |
||||
label: '删除', |
||||
popConfirm: { |
||||
title: '是否确认删除', |
||||
confirm: handleDelete.bind(null, record), |
||||
placement: 'topLeft', |
||||
}, |
||||
auth: 'depfile:depfile:delete' |
||||
} |
||||
] |
||||
} |
||||
|
||||
/** |
||||
* 查询 |
||||
*/ |
||||
function searchQuery() { |
||||
reload(); |
||||
} |
||||
|
||||
/** |
||||
* 重置 |
||||
*/ |
||||
function searchReset() { |
||||
formRef.value.resetFields(); |
||||
selectedRowKeys.value = []; |
||||
//刷新数据 |
||||
reload(); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style lang="less" scoped> |
||||
.jeecg-basic-table-form-container { |
||||
padding: 0; |
||||
.table-page-search-submitButtons { |
||||
display: block; |
||||
margin-bottom: 24px; |
||||
white-space: nowrap; |
||||
} |
||||
.query-group-cust{ |
||||
min-width: 100px !important; |
||||
} |
||||
.query-group-split-cust{ |
||||
width: 30px; |
||||
display: inline-block; |
||||
text-align: center |
||||
} |
||||
.ant-form-item:not(.ant-form-item-with-help){ |
||||
margin-bottom: 16px; |
||||
height: 32px; |
||||
} |
||||
:deep(.ant-picker),:deep(.ant-input-number){ |
||||
width: 100%; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,26 @@ |
||||
-- 注意:该页面对应的前台目录为views/depfile文件夹下 |
||||
-- 如果你想更改到其他目录,请修改sql中component字段对应的值 |
||||
|
||||
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) |
||||
VALUES ('2024110109297380210', NULL, '单位技术研究资质情况', '/depfile/depfileList', 'depfile/DepfileList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-11-01 09:29:21', NULL, NULL, 0); |
||||
|
||||
-- 权限控制sql |
||||
-- 新增 |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110109297380211', '2024110109297380210', '添加单位技术研究资质情况', NULL, NULL, 0, NULL, NULL, 2, 'depfile:depfile:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 09:29:21', NULL, NULL, 0, 0, '1', 0); |
||||
-- 编辑 |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110109297380212', '2024110109297380210', '编辑单位技术研究资质情况', NULL, NULL, 0, NULL, NULL, 2, 'depfile:depfile:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 09:29:21', NULL, NULL, 0, 0, '1', 0); |
||||
-- 删除 |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110109297380213', '2024110109297380210', '删除单位技术研究资质情况', NULL, NULL, 0, NULL, NULL, 2, 'depfile:depfile:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 09:29:21', NULL, NULL, 0, 0, '1', 0); |
||||
-- 批量删除 |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110109297380214', '2024110109297380210', '批量删除单位技术研究资质情况', NULL, NULL, 0, NULL, NULL, 2, 'depfile:depfile:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 09:29:21', NULL, NULL, 0, 0, '1', 0); |
||||
-- 导出excel |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110109297380215', '2024110109297380210', '导出excel_单位技术研究资质情况', NULL, NULL, 0, NULL, NULL, 2, 'depfile:depfile:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 09:29:21', NULL, NULL, 0, 0, '1', 0); |
||||
-- 导入excel |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110109297380216', '2024110109297380210', '导入excel_单位技术研究资质情况', NULL, NULL, 0, NULL, NULL, 2, 'depfile:depfile:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 09:29:21', NULL, NULL, 0, 0, '1', 0); |
@ -0,0 +1,171 @@ |
||||
<template> |
||||
<a-spin :spinning="confirmLoading"> |
||||
<JFormContainer :disabled="disabled"> |
||||
<template #detail> |
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="DepfileForm"> |
||||
<a-row> |
||||
<a-col :span="24"> |
||||
<a-form-item label="部门名称" v-bind="validateInfos.depid" id="DepfileForm-depid" name="depid"> |
||||
<j-search-select v-model:value="formData.depid" dict="sys_depart,depart_name,id" allow-clear /> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="名称" v-bind="validateInfos.filename" id="DepfileForm-filename" name="filename"> |
||||
<a-input v-model:value="formData.filename" placeholder="请输入名称" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="认定部门及批号" v-bind="validateInfos.depnumber" id="DepfileForm-depnumber" name="depnumber"> |
||||
<a-input v-model:value="formData.depnumber" placeholder="请输入认定部门及批号" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="认定时间" v-bind="validateInfos.rdtime" id="DepfileForm-rdtime" name="rdtime"> |
||||
<a-date-picker placeholder="请选择认定时间" v-model:value="formData.rdtime" showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" allow-clear /> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="文件" v-bind="validateInfos.upfile" id="DepfileForm-upfile" name="upfile"> |
||||
<j-upload v-model:value="formData.upfile" ></j-upload> |
||||
</a-form-item> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</template> |
||||
</JFormContainer> |
||||
</a-spin> |
||||
</template> |
||||
|
||||
<script lang="ts" setup> |
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue'; |
||||
import { defHttp } from '/@/utils/http/axios'; |
||||
import { useMessage } from '/@/hooks/web/useMessage'; |
||||
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue'; |
||||
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue'; |
||||
import { getValueType } from '/@/utils'; |
||||
import { saveOrUpdate } from '../Depfile.api'; |
||||
import { Form } from 'ant-design-vue'; |
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue'; |
||||
const props = defineProps({ |
||||
formDisabled: { type: Boolean, default: false }, |
||||
formData: { type: Object, default: () => ({})}, |
||||
formBpm: { type: Boolean, default: true } |
||||
}); |
||||
const formRef = ref(); |
||||
const useForm = Form.useForm; |
||||
const emit = defineEmits(['register', 'ok']); |
||||
const formData = reactive<Record<string, any>>({ |
||||
id: '', |
||||
depid: '', |
||||
filename: '', |
||||
depnumber: '', |
||||
rdtime: '', |
||||
upfile: '', |
||||
}); |
||||
const { createMessage } = useMessage(); |
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } }); |
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } }); |
||||
const confirmLoading = ref<boolean>(false); |
||||
//表单验证 |
||||
const validatorRules = reactive({ |
||||
}); |
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false }); |
||||
|
||||
// 表单禁用 |
||||
const disabled = computed(()=>{ |
||||
if(props.formBpm === true){ |
||||
if(props.formData.disabled === false){ |
||||
return false; |
||||
}else{ |
||||
return true; |
||||
} |
||||
} |
||||
return props.formDisabled; |
||||
}); |
||||
|
||||
|
||||
/** |
||||
* 新增 |
||||
*/ |
||||
function add() { |
||||
edit({}); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
*/ |
||||
function edit(record) { |
||||
nextTick(() => { |
||||
resetFields(); |
||||
const tmpData = {}; |
||||
Object.keys(formData).forEach((key) => { |
||||
if(record.hasOwnProperty(key)){ |
||||
tmpData[key] = record[key] |
||||
} |
||||
}) |
||||
//赋值 |
||||
Object.assign(formData, tmpData); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 提交数据 |
||||
*/ |
||||
async function submitForm() { |
||||
try { |
||||
// 触发表单验证 |
||||
await validate(); |
||||
} catch ({ errorFields }) { |
||||
if (errorFields) { |
||||
const firstField = errorFields[0]; |
||||
if (firstField) { |
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' }); |
||||
} |
||||
} |
||||
return Promise.reject(errorFields); |
||||
} |
||||
confirmLoading.value = true; |
||||
const isUpdate = ref<boolean>(false); |
||||
//时间格式化 |
||||
let model = formData; |
||||
if (model.id) { |
||||
isUpdate.value = true; |
||||
} |
||||
//循环数据 |
||||
for (let data in model) { |
||||
//如果该数据是数组并且是字符串类型 |
||||
if (model[data] instanceof Array) { |
||||
let valueType = getValueType(formRef.value.getProps, data); |
||||
//如果是字符串类型的需要变成以逗号分割的字符串 |
||||
if (valueType === 'string') { |
||||
model[data] = model[data].join(','); |
||||
} |
||||
} |
||||
} |
||||
await saveOrUpdate(model, isUpdate.value) |
||||
.then((res) => { |
||||
if (res.success) { |
||||
createMessage.success(res.message); |
||||
emit('ok'); |
||||
} else { |
||||
createMessage.warning(res.message); |
||||
} |
||||
}) |
||||
.finally(() => { |
||||
confirmLoading.value = false; |
||||
}); |
||||
} |
||||
|
||||
|
||||
defineExpose({ |
||||
add, |
||||
edit, |
||||
submitForm, |
||||
}); |
||||
</script> |
||||
|
||||
<style lang="less" scoped> |
||||
.antd-modal-form { |
||||
padding: 14px; |
||||
} |
||||
</style> |
@ -0,0 +1,77 @@ |
||||
<template> |
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"> |
||||
<DepfileForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></DepfileForm> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script lang="ts" setup> |
||||
import { ref, nextTick, defineExpose } from 'vue'; |
||||
import DepfileForm from './DepfileForm.vue' |
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue'; |
||||
|
||||
const title = ref<string>(''); |
||||
const width = ref<number>(800); |
||||
const visible = ref<boolean>(false); |
||||
const disableSubmit = ref<boolean>(false); |
||||
const registerForm = ref(); |
||||
const emit = defineEmits(['register', 'success']); |
||||
|
||||
/** |
||||
* 新增 |
||||
*/ |
||||
function add() { |
||||
title.value = '新增'; |
||||
visible.value = true; |
||||
nextTick(() => { |
||||
registerForm.value.add(); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* @param record |
||||
*/ |
||||
function edit(record) { |
||||
title.value = disableSubmit.value ? '详情' : '编辑'; |
||||
visible.value = true; |
||||
nextTick(() => { |
||||
registerForm.value.edit(record); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 确定按钮点击事件 |
||||
*/ |
||||
function handleOk() { |
||||
registerForm.value.submitForm(); |
||||
} |
||||
|
||||
/** |
||||
* form保存回调事件 |
||||
*/ |
||||
function submitCallback() { |
||||
handleCancel(); |
||||
emit('success'); |
||||
} |
||||
|
||||
/** |
||||
* 取消按钮回调事件 |
||||
*/ |
||||
function handleCancel() { |
||||
visible.value = false; |
||||
} |
||||
|
||||
defineExpose({ |
||||
add, |
||||
edit, |
||||
disableSubmit, |
||||
}); |
||||
</script> |
||||
|
||||
<style lang="less"> |
||||
/**隐藏样式-modal确定按钮 */ |
||||
.jee-hidden { |
||||
display: none !important; |
||||
} |
||||
</style> |
||||
<style lang="less" scoped></style> |
@ -0,0 +1,72 @@ |
||||
import { defHttp } from '/@/utils/http/axios'; |
||||
import { useMessage } from "/@/hooks/web/useMessage"; |
||||
|
||||
const { createConfirm } = useMessage(); |
||||
|
||||
enum Api { |
||||
list = '/depsbncz/depsbncz/list', |
||||
save='/depsbncz/depsbncz/add', |
||||
edit='/depsbncz/depsbncz/edit', |
||||
deleteOne = '/depsbncz/depsbncz/delete', |
||||
deleteBatch = '/depsbncz/depsbncz/deleteBatch', |
||||
importExcel = '/depsbncz/depsbncz/importExcel', |
||||
exportXls = '/depsbncz/depsbncz/exportXls', |
||||
} |
||||
|
||||
/** |
||||
* 导出api |
||||
* @param params |
||||
*/ |
||||
export const getExportUrl = Api.exportXls; |
||||
|
||||
/** |
||||
* 导入api |
||||
*/ |
||||
export const getImportUrl = Api.importExcel; |
||||
|
||||
/** |
||||
* 列表接口 |
||||
* @param params |
||||
*/ |
||||
export const list = (params) => defHttp.get({ url: Api.list, params }); |
||||
|
||||
/** |
||||
* 删除单个 |
||||
* @param params |
||||
* @param handleSuccess |
||||
*/ |
||||
export const deleteOne = (params,handleSuccess) => { |
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { |
||||
handleSuccess(); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* @param params |
||||
* @param handleSuccess |
||||
*/ |
||||
export const batchDelete = (params, handleSuccess) => { |
||||
createConfirm({ |
||||
iconType: 'warning', |
||||
title: '确认删除', |
||||
content: '是否删除选中数据', |
||||
okText: '确认', |
||||
cancelText: '取消', |
||||
onOk: () => { |
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { |
||||
handleSuccess(); |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 保存或者更新 |
||||
* @param params |
||||
* @param isUpdate |
||||
*/ |
||||
export const saveOrUpdate = (params, isUpdate) => { |
||||
let url = isUpdate ? Api.edit : Api.save; |
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false }); |
||||
} |
@ -0,0 +1,78 @@ |
||||
import {BasicColumn} from '/@/components/Table'; |
||||
import {FormSchema} from '/@/components/Table'; |
||||
import { rules} from '/@/utils/helper/validator'; |
||||
import { render } from '/@/utils/common/renderUtils'; |
||||
import { getWeekMonthQuarterYear } from '/@/utils'; |
||||
//列表数据 |
||||
export const columns: BasicColumn[] = [ |
||||
{ |
||||
title: '部门', |
||||
align: "center", |
||||
dataIndex: 'depid_dictText' |
||||
}, |
||||
{ |
||||
title: '单位开办费', |
||||
align: "center", |
||||
dataIndex: 'dwkbf' |
||||
}, |
||||
{ |
||||
title: '资产合计', |
||||
align: "center", |
||||
dataIndex: 'zchj' |
||||
}, |
||||
{ |
||||
title: '负债合计', |
||||
align: "center", |
||||
dataIndex: 'fzhj' |
||||
}, |
||||
{ |
||||
title: '净资产', |
||||
align: "center", |
||||
dataIndex: 'jzc' |
||||
}, |
||||
{ |
||||
title: '财政拨款', |
||||
align: "center", |
||||
dataIndex: 'czbk' |
||||
}, |
||||
{ |
||||
title: '财政拨款专项支出', |
||||
align: "center", |
||||
dataIndex: 'czbkzxzc' |
||||
}, |
||||
{ |
||||
title: '经营收入', |
||||
align: "center", |
||||
dataIndex: 'jysr' |
||||
}, |
||||
{ |
||||
title: '经营支出', |
||||
align: "center", |
||||
dataIndex: 'jyzc' |
||||
}, |
||||
{ |
||||
title: '经营结余', |
||||
align: "center", |
||||
dataIndex: 'jyjy' |
||||
}, |
||||
{ |
||||
title: '纳税总额', |
||||
align: "center", |
||||
dataIndex: 'nsze' |
||||
}, |
||||
]; |
||||
|
||||
// 高级查询数据 |
||||
export const superQuerySchema = { |
||||
depid: {title: '部门',order: 0,view: 'sel_search', type: 'string',dictTable: "sys_depart", dictCode: 'id', dictText: 'depart_name',}, |
||||
dwkbf: {title: '单位开办费',order: 1,view: 'text', type: 'string',}, |
||||
zchj: {title: '资产合计',order: 2,view: 'text', type: 'string',}, |
||||
fzhj: {title: '负债合计',order: 3,view: 'text', type: 'string',}, |
||||
jzc: {title: '净资产',order: 4,view: 'text', type: 'string',}, |
||||
czbk: {title: '财政拨款',order: 5,view: 'text', type: 'string',}, |
||||
czbkzxzc: {title: '财政拨款专项支出',order: 6,view: 'text', type: 'string',}, |
||||
jysr: {title: '经营收入',order: 7,view: 'text', type: 'string',}, |
||||
jyzc: {title: '经营支出',order: 8,view: 'text', type: 'string',}, |
||||
jyjy: {title: '经营结余',order: 9,view: 'text', type: 'string',}, |
||||
nsze: {title: '纳税总额',order: 10,view: 'text', type: 'string',}, |
||||
}; |
@ -0,0 +1,236 @@ |
||||
<template> |
||||
<div class="p-2"> |
||||
<!--查询区域--> |
||||
<div class="jeecg-basic-table-form-container"> |
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol"> |
||||
<a-row :gutter="24"> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!--引用表格--> |
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection"> |
||||
<!--插槽:table标题--> |
||||
<template #tableTitle> |
||||
<a-button type="primary" v-auth="'depsbncz:depsbncz:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> |
||||
<a-button type="primary" v-auth="'depsbncz:depsbncz:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> |
||||
<j-upload-button type="primary" v-auth="'depsbncz:depsbncz:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> |
||||
<a-dropdown v-if="selectedRowKeys.length > 0"> |
||||
<template #overlay> |
||||
<a-menu> |
||||
<a-menu-item key="1" @click="batchHandleDelete"> |
||||
<Icon icon="ant-design:delete-outlined"></Icon> |
||||
删除 |
||||
</a-menu-item> |
||||
</a-menu> |
||||
</template> |
||||
<a-button v-auth="'depsbncz:depsbncz:deleteBatch'">批量操作 |
||||
<Icon icon="mdi:chevron-down"></Icon> |
||||
</a-button> |
||||
</a-dropdown> |
||||
<!-- 高级查询 --> |
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" /> |
||||
</template> |
||||
<!--操作栏--> |
||||
<template #action="{ record }"> |
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> |
||||
</template> |
||||
<template v-slot:bodyCell="{ column, record, index, text }"> |
||||
</template> |
||||
</BasicTable> |
||||
<!-- 表单区域 --> |
||||
<DepsbnczModal ref="registerModal" @success="handleSuccess"></DepsbnczModal> |
||||
</div> |
||||
</template> |
||||
|
||||
<script lang="ts" name="depsbncz-depsbncz" setup> |
||||
import { ref, reactive } from 'vue'; |
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
||||
import { useListPage } from '/@/hooks/system/useListPage'; |
||||
import { columns, superQuerySchema } from './Depsbncz.data'; |
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Depsbncz.api'; |
||||
import { downloadFile } from '/@/utils/common/renderUtils'; |
||||
import DepsbnczModal from './components/DepsbnczModal.vue' |
||||
import { useUserStore } from '/@/store/modules/user'; |
||||
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue'; |
||||
|
||||
const formRef = ref(); |
||||
const queryParam = reactive<any>({}); |
||||
const toggleSearchStatus = ref<boolean>(false); |
||||
const registerModal = ref(); |
||||
const userStore = useUserStore(); |
||||
//注册table数据 |
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ |
||||
tableProps: { |
||||
title: '上年度(末)主要财务数据', |
||||
api: list, |
||||
columns, |
||||
canResize:false, |
||||
useSearchForm: false, |
||||
actionColumn: { |
||||
width: 120, |
||||
fixed: 'right', |
||||
}, |
||||
beforeFetch: async (params) => { |
||||
return Object.assign(params, queryParam); |
||||
}, |
||||
}, |
||||
exportConfig: { |
||||
name: "上年度(末)主要财务数据", |
||||
url: getExportUrl, |
||||
params: queryParam, |
||||
}, |
||||
importConfig: { |
||||
url: getImportUrl, |
||||
success: handleSuccess |
||||
}, |
||||
}); |
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext; |
||||
const labelCol = reactive({ |
||||
xs:24, |
||||
sm:4, |
||||
xl:6, |
||||
xxl:4 |
||||
}); |
||||
const wrapperCol = reactive({ |
||||
xs: 24, |
||||
sm: 20, |
||||
}); |
||||
|
||||
// 高级查询配置 |
||||
const superQueryConfig = reactive(superQuerySchema); |
||||
|
||||
/** |
||||
* 高级查询事件 |
||||
*/ |
||||
function handleSuperQuery(params) { |
||||
Object.keys(params).map((k) => { |
||||
queryParam[k] = params[k]; |
||||
}); |
||||
searchQuery(); |
||||
} |
||||
|
||||
/** |
||||
* 新增事件 |
||||
*/ |
||||
function handleAdd() { |
||||
registerModal.value.disableSubmit = false; |
||||
registerModal.value.add(); |
||||
} |
||||
|
||||
/** |
||||
* 编辑事件 |
||||
*/ |
||||
function handleEdit(record: Recordable) { |
||||
registerModal.value.disableSubmit = false; |
||||
registerModal.value.edit(record); |
||||
} |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
function handleDetail(record: Recordable) { |
||||
registerModal.value.disableSubmit = true; |
||||
registerModal.value.edit(record); |
||||
} |
||||
|
||||
/** |
||||
* 删除事件 |
||||
*/ |
||||
async function handleDelete(record) { |
||||
await deleteOne({ id: record.id }, handleSuccess); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除事件 |
||||
*/ |
||||
async function batchHandleDelete() { |
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess); |
||||
} |
||||
|
||||
/** |
||||
* 成功回调 |
||||
*/ |
||||
function handleSuccess() { |
||||
(selectedRowKeys.value = []) && reload(); |
||||
} |
||||
|
||||
/** |
||||
* 操作栏 |
||||
*/ |
||||
function getTableAction(record) { |
||||
return [ |
||||
{ |
||||
label: '编辑', |
||||
onClick: handleEdit.bind(null, record), |
||||
auth: 'depsbncz:depsbncz:edit' |
||||
}, |
||||
]; |
||||
} |
||||
|
||||
/** |
||||
* 下拉操作栏 |
||||
*/ |
||||
function getDropDownAction(record) { |
||||
return [ |
||||
{ |
||||
label: '详情', |
||||
onClick: handleDetail.bind(null, record), |
||||
}, { |
||||
label: '删除', |
||||
popConfirm: { |
||||
title: '是否确认删除', |
||||
confirm: handleDelete.bind(null, record), |
||||
placement: 'topLeft', |
||||
}, |
||||
auth: 'depsbncz:depsbncz:delete' |
||||
} |
||||
] |
||||
} |
||||
|
||||
/** |
||||
* 查询 |
||||
*/ |
||||
function searchQuery() { |
||||
reload(); |
||||
} |
||||
|
||||
/** |
||||
* 重置 |
||||
*/ |
||||
function searchReset() { |
||||
formRef.value.resetFields(); |
||||
selectedRowKeys.value = []; |
||||
//刷新数据 |
||||
reload(); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style lang="less" scoped> |
||||
.jeecg-basic-table-form-container { |
||||
padding: 0; |
||||
.table-page-search-submitButtons { |
||||
display: block; |
||||
margin-bottom: 24px; |
||||
white-space: nowrap; |
||||
} |
||||
.query-group-cust{ |
||||
min-width: 100px !important; |
||||
} |
||||
.query-group-split-cust{ |
||||
width: 30px; |
||||
display: inline-block; |
||||
text-align: center |
||||
} |
||||
.ant-form-item:not(.ant-form-item-with-help){ |
||||
margin-bottom: 16px; |
||||
height: 32px; |
||||
} |
||||
:deep(.ant-picker),:deep(.ant-input-number){ |
||||
width: 100%; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,26 @@ |
||||
-- 注意:该页面对应的前台目录为views/depsbncz文件夹下 |
||||
-- 如果你想更改到其他目录,请修改sql中component字段对应的值 |
||||
|
||||
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) |
||||
VALUES ('2024110109512550080', NULL, '上年度(末)主要财务数据', '/depsbncz/depsbnczList', 'depsbncz/DepsbnczList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-11-01 09:51:08', NULL, NULL, 0); |
||||
|
||||
-- 权限控制sql |
||||
-- 新增 |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110109512550081', '2024110109512550080', '添加上年度(末)主要财务数据', NULL, NULL, 0, NULL, NULL, 2, 'depsbncz:depsbncz:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 09:51:08', NULL, NULL, 0, 0, '1', 0); |
||||
-- 编辑 |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110109512550082', '2024110109512550080', '编辑上年度(末)主要财务数据', NULL, NULL, 0, NULL, NULL, 2, 'depsbncz:depsbncz:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 09:51:08', NULL, NULL, 0, 0, '1', 0); |
||||
-- 删除 |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110109512550083', '2024110109512550080', '删除上年度(末)主要财务数据', NULL, NULL, 0, NULL, NULL, 2, 'depsbncz:depsbncz:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 09:51:08', NULL, NULL, 0, 0, '1', 0); |
||||
-- 批量删除 |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110109512550084', '2024110109512550080', '批量删除上年度(末)主要财务数据', NULL, NULL, 0, NULL, NULL, 2, 'depsbncz:depsbncz:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 09:51:08', NULL, NULL, 0, 0, '1', 0); |
||||
-- 导出excel |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110109512550085', '2024110109512550080', '导出excel_上年度(末)主要财务数据', NULL, NULL, 0, NULL, NULL, 2, 'depsbncz:depsbncz:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 09:51:08', NULL, NULL, 0, 0, '1', 0); |
||||
-- 导入excel |
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
||||
VALUES ('2024110109512550086', '2024110109512550080', '导入excel_上年度(末)主要财务数据', NULL, NULL, 0, NULL, NULL, 2, 'depsbncz:depsbncz:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-01 09:51:08', NULL, NULL, 0, 0, '1', 0); |
@ -0,0 +1,206 @@ |
||||
<template> |
||||
<a-spin :spinning="confirmLoading"> |
||||
<JFormContainer :disabled="disabled"> |
||||
<template #detail> |
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="DepsbnczForm"> |
||||
<a-row> |
||||
<a-col :span="24"> |
||||
<a-form-item label="部门" v-bind="validateInfos.depid" id="DepsbnczForm-depid" name="depid"> |
||||
<j-search-select v-model:value="formData.depid" dict="sys_depart,depart_name,id" allow-clear /> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="单位开办费" v-bind="validateInfos.dwkbf" id="DepsbnczForm-dwkbf" name="dwkbf"> |
||||
<a-input v-model:value="formData.dwkbf" placeholder="请输入单位开办费" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="资产合计" v-bind="validateInfos.zchj" id="DepsbnczForm-zchj" name="zchj"> |
||||
<a-input v-model:value="formData.zchj" placeholder="请输入资产合计" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="负债合计" v-bind="validateInfos.fzhj" id="DepsbnczForm-fzhj" name="fzhj"> |
||||
<a-input v-model:value="formData.fzhj" placeholder="请输入负债合计" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="净资产" v-bind="validateInfos.jzc" id="DepsbnczForm-jzc" name="jzc"> |
||||
<a-input v-model:value="formData.jzc" placeholder="请输入净资产" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="财政拨款" v-bind="validateInfos.czbk" id="DepsbnczForm-czbk" name="czbk"> |
||||
<a-input v-model:value="formData.czbk" placeholder="请输入财政拨款" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="财政拨款专项支出" v-bind="validateInfos.czbkzxzc" id="DepsbnczForm-czbkzxzc" name="czbkzxzc"> |
||||
<a-input v-model:value="formData.czbkzxzc" placeholder="请输入财政拨款专项支出" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="经营收入" v-bind="validateInfos.jysr" id="DepsbnczForm-jysr" name="jysr"> |
||||
<a-input v-model:value="formData.jysr" placeholder="请输入经营收入" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="经营支出" v-bind="validateInfos.jyzc" id="DepsbnczForm-jyzc" name="jyzc"> |
||||
<a-input v-model:value="formData.jyzc" placeholder="请输入经营支出" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="经营结余" v-bind="validateInfos.jyjy" id="DepsbnczForm-jyjy" name="jyjy"> |
||||
<a-input v-model:value="formData.jyjy" placeholder="请输入经营结余" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="纳税总额" v-bind="validateInfos.nsze" id="DepsbnczForm-nsze" name="nsze"> |
||||
<a-input v-model:value="formData.nsze" placeholder="请输入纳税总额" allow-clear ></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</template> |
||||
</JFormContainer> |
||||
</a-spin> |
||||
</template> |
||||
|
||||
<script lang="ts" setup> |
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue'; |
||||
import { defHttp } from '/@/utils/http/axios'; |
||||
import { useMessage } from '/@/hooks/web/useMessage'; |
||||
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue'; |
||||
import { getValueType } from '/@/utils'; |
||||
import { saveOrUpdate } from '../Depsbncz.api'; |
||||
import { Form } from 'ant-design-vue'; |
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue'; |
||||
const props = defineProps({ |
||||
formDisabled: { type: Boolean, default: false }, |
||||
formData: { type: Object, default: () => ({})}, |
||||
formBpm: { type: Boolean, default: true } |
||||
}); |
||||
const formRef = ref(); |
||||
const useForm = Form.useForm; |
||||
const emit = defineEmits(['register', 'ok']); |
||||
const formData = reactive<Record<string, any>>({ |
||||
id: '', |
||||
depid: '', |
||||
dwkbf: '', |
||||
zchj: '', |
||||
fzhj: '', |
||||
jzc: '', |
||||
czbk: '', |
||||
czbkzxzc: '', |
||||
jysr: '', |
||||
jyzc: '', |
||||
jyjy: '', |
||||
nsze: '', |
||||
}); |
||||
const { createMessage } = useMessage(); |
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } }); |
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } }); |
||||
const confirmLoading = ref<boolean>(false); |
||||
//表单验证 |
||||
const validatorRules = reactive({ |
||||
}); |
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false }); |
||||
|
||||
// 表单禁用 |
||||
const disabled = computed(()=>{ |
||||
if(props.formBpm === true){ |
||||
if(props.formData.disabled === false){ |
||||
return false; |
||||
}else{ |
||||
return true; |
||||
} |
||||
} |
||||
return props.formDisabled; |
||||
}); |
||||
|
||||
|
||||
/** |
||||
* 新增 |
||||
*/ |
||||
function add() { |
||||
edit({}); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
*/ |
||||
function edit(record) { |
||||
nextTick(() => { |
||||
resetFields(); |
||||
const tmpData = {}; |
||||
Object.keys(formData).forEach((key) => { |
||||
if(record.hasOwnProperty(key)){ |
||||
tmpData[key] = record[key] |
||||
} |
||||
}) |
||||
//赋值 |
||||
Object.assign(formData, tmpData); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 提交数据 |
||||
*/ |
||||
async function submitForm() { |
||||
try { |
||||
// 触发表单验证 |
||||
await validate(); |
||||
} catch ({ errorFields }) { |
||||
if (errorFields) { |
||||
const firstField = errorFields[0]; |
||||
if (firstField) { |
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' }); |
||||
} |
||||
} |
||||
return Promise.reject(errorFields); |
||||
} |
||||
confirmLoading.value = true; |
||||
const isUpdate = ref<boolean>(false); |
||||
//时间格式化 |
||||
let model = formData; |
||||
if (model.id) { |
||||
isUpdate.value = true; |
||||
} |
||||
//循环数据 |
||||
for (let data in model) { |
||||
//如果该数据是数组并且是字符串类型 |
||||
if (model[data] instanceof Array) { |
||||
let valueType = getValueType(formRef.value.getProps, data); |
||||
//如果是字符串类型的需要变成以逗号分割的字符串 |
||||
if (valueType === 'string') { |
||||
model[data] = model[data].join(','); |
||||
} |
||||
} |
||||
} |
||||
await saveOrUpdate(model, isUpdate.value) |
||||
.then((res) => { |
||||
if (res.success) { |
||||
createMessage.success(res.message); |
||||
emit('ok'); |
||||
} else { |
||||
createMessage.warning(res.message); |
||||
} |
||||
}) |
||||
.finally(() => { |
||||
confirmLoading.value = false; |
||||
}); |
||||
} |
||||
|
||||
|
||||
defineExpose({ |
||||
add, |
||||
edit, |
||||
submitForm, |
||||
}); |
||||
</script> |
||||
|
||||
<style lang="less" scoped> |
||||
.antd-modal-form { |
||||
padding: 14px; |
||||
} |
||||
</style> |
@ -0,0 +1,77 @@ |
||||
<template> |
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"> |
||||
<DepsbnczForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></DepsbnczForm> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script lang="ts" setup> |
||||
import { ref, nextTick, defineExpose } from 'vue'; |
||||
import DepsbnczForm from './DepsbnczForm.vue' |
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue'; |
||||
|
||||
const title = ref<string>(''); |
||||
const width = ref<number>(800); |
||||
const visible = ref<boolean>(false); |
||||
const disableSubmit = ref<boolean>(false); |
||||
const registerForm = ref(); |
||||
const emit = defineEmits(['register', 'success']); |
||||
|
||||
/** |
||||
* 新增 |
||||
*/ |
||||
function add() { |
||||
title.value = '新增'; |
||||
visible.value = true; |
||||
nextTick(() => { |
||||
registerForm.value.add(); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* @param record |
||||
*/ |
||||
function edit(record) { |
||||
title.value = disableSubmit.value ? '详情' : '编辑'; |
||||
visible.value = true; |
||||
nextTick(() => { |
||||
registerForm.value.edit(record); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 确定按钮点击事件 |
||||
*/ |
||||
function handleOk() { |
||||
registerForm.value.submitForm(); |
||||
} |
||||
|
||||
/** |
||||
* form保存回调事件 |
||||
*/ |
||||
function submitCallback() { |
||||
handleCancel(); |
||||
emit('success'); |
||||
} |
||||
|
||||
/** |
||||
* 取消按钮回调事件 |
||||
*/ |
||||
function handleCancel() { |
||||
visible.value = false; |
||||
} |
||||
|
||||
defineExpose({ |
||||
add, |
||||
edit, |
||||
disableSubmit, |
||||
}); |
||||
</script> |
||||
|
||||
<style lang="less"> |
||||
/**隐藏样式-modal确定按钮 */ |
||||
.jee-hidden { |
||||
display: none !important; |
||||
} |
||||
</style> |
||||
<style lang="less" scoped></style> |