Browse Source

feat: 样品管理

32197351@qq.com 1 year ago
parent
commit
a013987b14
23 changed files with 1601 additions and 0 deletions
  1. 198 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/controller/ItdmInventoryBarcodeController.java
  2. 239 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/controller/ItdmInventoryLogController.java
  3. 187 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/controller/ItdmSampleInventoryController.java
  4. 80 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/entity/ItdmInventoryBarcode.java
  5. 104 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/entity/ItdmInventoryLog.java
  6. 106 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/entity/ItdmSampleInventory.java
  7. 17 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/mapper/ItdmInventoryBarcodeMapper.java
  8. 17 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/mapper/ItdmInventoryLogMapper.java
  9. 17 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/mapper/ItdmSampleInventoryMapper.java
  10. 5 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/mapper/xml/ItdmInventoryBarcodeMapper.xml
  11. 5 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/mapper/xml/ItdmInventoryLogMapper.xml
  12. 5 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/mapper/xml/ItdmSampleInventoryMapper.xml
  13. 14 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/service/IItdmInventoryBarcodeService.java
  14. 14 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/service/IItdmInventoryLogService.java
  15. 14 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/service/IItdmSampleInventoryService.java
  16. 19 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/service/impl/ItdmInventoryBarcodeServiceImpl.java
  17. 19 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/service/impl/ItdmInventoryLogServiceImpl.java
  18. 19 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/service/impl/ItdmSampleInventoryServiceImpl.java
  19. 213 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/vue/ItdmInventoryLogList.vue
  20. 26 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/vue/ItdmInventoryLog_menu_insert.sql
  21. 139 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/vue/modules/ItdmInventoryLogForm.vue
  22. 84 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/vue/modules/ItdmInventoryLogModal.Style#Drawer.vue
  23. 60 0
      itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/vue/modules/ItdmInventoryLogModal.vue

+ 198 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/controller/ItdmInventoryBarcodeController.java

@@ -0,0 +1,198 @@
+package org.jeecg.modules.inventory.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+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 com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.inventory.entity.ItdmInventoryBarcode;
+import org.jeecg.modules.inventory.entity.ItdmSampleInventory;
+import org.jeecg.modules.inventory.service.IItdmInventoryBarcodeService;
+
+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.jeecg.modules.inventory.service.IItdmSampleInventoryService;
+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.transaction.annotation.Transactional;
+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;
+
+ /**
+ * @Description: 库存条码
+ * @Author: jeecg-boot
+ * @Date:   2023-06-26
+ * @Version: V1.0
+ */
+@Api(tags="库存条码")
+@RestController
+@RequestMapping("/inventory/itdmInventoryBarcode")
+@Slf4j
+public class ItdmInventoryBarcodeController extends JeecgController<ItdmInventoryBarcode, IItdmInventoryBarcodeService> {
+	@Autowired
+	private IItdmInventoryBarcodeService itdmInventoryBarcodeService;
+	 @Autowired
+	 private IItdmSampleInventoryService itdmSampleInventoryService;
+	/**
+	 * 分页列表查询
+	 *
+	 * @param itdmInventoryBarcode
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "库存条码-分页列表查询")
+	@ApiOperation(value="库存条码-分页列表查询", notes="库存条码-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<ItdmInventoryBarcode>> queryPageList(ItdmInventoryBarcode itdmInventoryBarcode,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<ItdmInventoryBarcode> queryWrapper = QueryGenerator.initQueryWrapper(itdmInventoryBarcode, req.getParameterMap());
+		Page<ItdmInventoryBarcode> page = new Page<ItdmInventoryBarcode>(pageNo, pageSize);
+		IPage<ItdmInventoryBarcode> pageList = itdmInventoryBarcodeService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param itdmInventoryBarcode
+	 * @return
+	 */
+	@AutoLog(value = "库存条码-添加")
+	@ApiOperation(value="库存条码-添加", notes="库存条码-添加")
+	//@RequiresPermissions("org.jeecg.modules:itdm_inventory_barcode:add")
+	@PostMapping(value = "/add")
+	@Transactional
+	public Result<String> add(@RequestBody ItdmInventoryBarcode itdmInventoryBarcode) {
+		ItdmSampleInventory itdmSampleInventory = itdmSampleInventoryService.getById(itdmInventoryBarcode.getInventoryId());
+
+		long count= itdmInventoryBarcodeService.count(Wrappers.lambdaQuery(ItdmInventoryBarcode.class).eq(ItdmInventoryBarcode::getInventoryId, itdmInventoryBarcode.getInventoryId()));
+
+
+
+		itdmInventoryBarcode.setBarCode(itdmSampleInventory.getBatchNumber() + String.format("%04d", count + 1));
+		itdmInventoryBarcode.setDisableStatus("0");
+		itdmInventoryBarcode.setUseStatus("0");
+		itdmInventoryBarcode.setNum("1");
+		itdmInventoryBarcodeService.save(itdmInventoryBarcode);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param itdmInventoryBarcode
+	 * @return
+	 */
+	@AutoLog(value = "库存条码-编辑")
+	@ApiOperation(value="库存条码-编辑", notes="库存条码-编辑")
+	//@RequiresPermissions("org.jeecg.modules:itdm_inventory_barcode:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody ItdmInventoryBarcode itdmInventoryBarcode) {
+		itdmInventoryBarcodeService.updateById(itdmInventoryBarcode);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "库存条码-通过id删除")
+	@ApiOperation(value="库存条码-通过id删除", notes="库存条码-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:itdm_inventory_barcode:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+
+
+
+		itdmInventoryBarcodeService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "库存条码-批量删除")
+	@ApiOperation(value="库存条码-批量删除", notes="库存条码-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:itdm_inventory_barcode:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.itdmInventoryBarcodeService.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<ItdmInventoryBarcode> queryById(@RequestParam(name="id",required=true) String id) {
+		ItdmInventoryBarcode itdmInventoryBarcode = itdmInventoryBarcodeService.getById(id);
+		if(itdmInventoryBarcode==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(itdmInventoryBarcode);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param itdmInventoryBarcode
+    */
+    //@RequiresPermissions("org.jeecg.modules:itdm_inventory_barcode:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, ItdmInventoryBarcode itdmInventoryBarcode) {
+        return super.exportXls(request, itdmInventoryBarcode, ItdmInventoryBarcode.class, "库存条码");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("itdm_inventory_barcode:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, ItdmInventoryBarcode.class);
+    }
+
+}

+ 239 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/controller/ItdmInventoryLogController.java

@@ -0,0 +1,239 @@
+package org.jeecg.modules.inventory.controller;
+
+import java.util.*;
+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 com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.exception.JeecgBootException;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.inventory.entity.ItdmInventoryBarcode;
+import org.jeecg.modules.inventory.entity.ItdmInventoryLog;
+import org.jeecg.modules.inventory.entity.ItdmSampleInventory;
+import org.jeecg.modules.inventory.service.IItdmInventoryBarcodeService;
+import org.jeecg.modules.inventory.service.IItdmInventoryLogService;
+
+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.jeecg.modules.inventory.service.IItdmSampleInventoryService;
+import org.jeecg.modules.system.util.SecurityUtil;
+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.transaction.annotation.Transactional;
+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;
+
+ /**
+ * @Description: 库存日志
+ * @Author: jeecg-boot
+ * @Date:   2023-06-26
+ * @Version: V1.0
+ */
+@Api(tags="库存日志")
+@RestController
+@RequestMapping("/inventory/itdmInventoryLog")
+@Slf4j
+public class ItdmInventoryLogController extends JeecgController<ItdmInventoryLog, IItdmInventoryLogService> {
+	@Autowired
+	private IItdmInventoryLogService itdmInventoryLogService;
+
+	 @Autowired
+	 private IItdmInventoryBarcodeService itdmInventoryBarcodeService;
+	 @Autowired
+	 private IItdmSampleInventoryService itdmSampleInventoryService;
+
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param itdmInventoryLog
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "库存日志-分页列表查询")
+	@ApiOperation(value="库存日志-分页列表查询", notes="库存日志-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<ItdmInventoryLog>> queryPageList(ItdmInventoryLog itdmInventoryLog,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<ItdmInventoryLog> queryWrapper = QueryGenerator.initQueryWrapper(itdmInventoryLog, req.getParameterMap());
+		Page<ItdmInventoryLog> page = new Page<ItdmInventoryLog>(pageNo, pageSize);
+		IPage<ItdmInventoryLog> pageList = itdmInventoryLogService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param itdmInventoryLog
+	 * @return
+	 */
+	@AutoLog(value = "库存日志-添加")
+	@ApiOperation(value="库存日志-添加", notes="库存日志-添加")
+	//@RequiresPermissions("org.jeecg.modules:itdm_inventory_log:add")
+	@PostMapping(value = "/add")
+	@Transactional
+	public Result<String> add(@RequestBody ItdmInventoryLog itdmInventoryLog) {
+		ItdmInventoryBarcode itdmInventoryBarcode = itdmInventoryBarcodeService.getOne(Wrappers.lambdaQuery(ItdmInventoryBarcode.class)
+				.eq(ItdmInventoryBarcode::getBarCode, itdmInventoryLog.getBarCode()));
+
+		if (itdmInventoryBarcode == null) {
+			throw new JeecgBootException("条码不存在");
+
+		}
+
+
+
+
+		// 库存-1
+		ItdmSampleInventory itdmSampleInventory = itdmSampleInventoryService.getById(itdmInventoryBarcode.getInventoryId());
+
+		if (Objects.equals(itdmInventoryLog.getType(), "1")) {
+			itdmSampleInventory.setSampleNum(itdmSampleInventory.getSampleNum() + 1);
+			if (itdmInventoryBarcode.getUseStatus().equals("1")) {
+				throw new JeecgBootException("当前条码是入库状态不能再次入库");
+
+			}
+
+		}
+		if (Objects.equals(itdmInventoryLog.getType(), "2")) {
+			if (itdmSampleInventory.getSampleNum() <= 0) {
+				throw new JeecgBootException("库存为0不能出库");
+			}
+			if (itdmInventoryBarcode.getUseStatus().equals("2")) {
+				throw new JeecgBootException("当前条码是出库状态不能再次出库");
+
+			}
+			itdmSampleInventory.setSampleNum(itdmSampleInventory.getSampleNum() - 1);
+
+		}
+
+
+
+		itdmSampleInventoryService.updateById(itdmSampleInventory);
+
+		itdmInventoryLog.setInventoryId(itdmInventoryBarcode.getInventoryId());
+		itdmInventoryBarcode.setUseStatus(itdmInventoryLog.getType());
+		itdmInventoryBarcodeService.updateById(itdmInventoryBarcode);
+
+		itdmInventoryLog.setUseTime(new Date());
+		LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+		itdmInventoryLog.setWarehouseBy(user.getUsername());
+		itdmInventoryLog.setNum("1");
+		itdmInventoryLogService.save(itdmInventoryLog);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param itdmInventoryLog
+	 * @return
+	 */
+	@AutoLog(value = "库存日志-编辑")
+	@ApiOperation(value="库存日志-编辑", notes="库存日志-编辑")
+	//@RequiresPermissions("org.jeecg.modules:itdm_inventory_log:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody ItdmInventoryLog itdmInventoryLog) {
+		itdmInventoryLogService.updateById(itdmInventoryLog);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "库存日志-通过id删除")
+	@ApiOperation(value="库存日志-通过id删除", notes="库存日志-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:itdm_inventory_log:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		itdmInventoryLogService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "库存日志-批量删除")
+	@ApiOperation(value="库存日志-批量删除", notes="库存日志-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:itdm_inventory_log:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.itdmInventoryLogService.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<ItdmInventoryLog> queryById(@RequestParam(name="id",required=true) String id) {
+		ItdmInventoryLog itdmInventoryLog = itdmInventoryLogService.getById(id);
+		if(itdmInventoryLog==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(itdmInventoryLog);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param itdmInventoryLog
+    */
+    //@RequiresPermissions("org.jeecg.modules:itdm_inventory_log:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, ItdmInventoryLog itdmInventoryLog) {
+        return super.exportXls(request, itdmInventoryLog, ItdmInventoryLog.class, "库存日志");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("itdm_inventory_log:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, ItdmInventoryLog.class);
+    }
+
+}

+ 187 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/controller/ItdmSampleInventoryController.java

@@ -0,0 +1,187 @@
+package org.jeecg.modules.inventory.controller;
+
+import java.util.Arrays;
+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 com.baomidou.mybatisplus.core.toolkit.Sequence;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.inventory.entity.ItdmSampleInventory;
+import org.jeecg.modules.inventory.service.IItdmSampleInventoryService;
+
+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;
+
+/**
+ * @Description: 样品库存
+ * @Author: jeecg-boot
+ * @Date: 2023-06-25
+ * @Version: V1.0
+ */
+@Api(tags = "样品库存")
+@RestController
+@RequestMapping("/inventory/itdmSampleInventory")
+@Slf4j
+public class ItdmSampleInventoryController extends JeecgController<ItdmSampleInventory, IItdmSampleInventoryService> {
+    @Autowired
+    private IItdmSampleInventoryService itdmSampleInventoryService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param itdmSampleInventory
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    //@AutoLog(value = "样品库存-分页列表查询")
+    @ApiOperation(value = "样品库存-分页列表查询", notes = "样品库存-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<ItdmSampleInventory>> queryPageList(ItdmSampleInventory itdmSampleInventory,
+                                                            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                            HttpServletRequest req) {
+        QueryWrapper<ItdmSampleInventory> queryWrapper = QueryGenerator.initQueryWrapper(itdmSampleInventory, req.getParameterMap());
+        Page<ItdmSampleInventory> page = new Page<ItdmSampleInventory>(pageNo, pageSize);
+        IPage<ItdmSampleInventory> pageList = itdmSampleInventoryService.page(page, queryWrapper);
+        return Result.OK(pageList);
+    }
+
+    /**
+     * 添加
+     *
+     * @param itdmSampleInventory
+     * @return
+     */
+    @AutoLog(value = "样品库存-添加")
+    @ApiOperation(value = "样品库存-添加", notes = "样品库存-添加")
+    //@RequiresPermissions("org.jeecg.modules:itdm_sample_inventory:add")
+    @PostMapping(value = "/add")
+    public Result<String> add(@RequestBody ItdmSampleInventory itdmSampleInventory) {
+        itdmSampleInventory.setStatus("0");
+
+        itdmSampleInventory.setSampleNum(0);
+        itdmSampleInventory.setBatchNumber(new Sequence(1L, 1L).nextId() + "");
+        itdmSampleInventoryService.save(itdmSampleInventory);
+        return Result.OK("添加成功!");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param itdmSampleInventory
+     * @return
+     */
+    @AutoLog(value = "样品库存-编辑")
+    @ApiOperation(value = "样品库存-编辑", notes = "样品库存-编辑")
+    //@RequiresPermissions("org.jeecg.modules:itdm_sample_inventory:edit")
+    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+    public Result<String> edit(@RequestBody ItdmSampleInventory itdmSampleInventory) {
+        itdmSampleInventory.setSampleNum(null);
+        itdmSampleInventory.setBatchNumber(null);
+        itdmSampleInventory.setStatus(null);
+
+        itdmSampleInventoryService.updateById(itdmSampleInventory);
+        return Result.OK("编辑成功!");
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "样品库存-通过id删除")
+    @ApiOperation(value = "样品库存-通过id删除", notes = "样品库存-通过id删除")
+    //@RequiresPermissions("org.jeecg.modules:itdm_sample_inventory:delete")
+    @DeleteMapping(value = "/delete")
+    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
+        itdmSampleInventoryService.removeById(id);
+        return Result.OK("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "样品库存-批量删除")
+    @ApiOperation(value = "样品库存-批量删除", notes = "样品库存-批量删除")
+    //@RequiresPermissions("org.jeecg.modules:itdm_sample_inventory:deleteBatch")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.itdmSampleInventoryService.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<ItdmSampleInventory> queryById(@RequestParam(name = "id", required = true) String id) {
+        ItdmSampleInventory itdmSampleInventory = itdmSampleInventoryService.getById(id);
+        if (itdmSampleInventory == null) {
+            return Result.error("未找到对应数据");
+        }
+        return Result.OK(itdmSampleInventory);
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param itdmSampleInventory
+     */
+    //@RequiresPermissions("org.jeecg.modules:itdm_sample_inventory:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, ItdmSampleInventory itdmSampleInventory) {
+        return super.exportXls(request, itdmSampleInventory, ItdmSampleInventory.class, "样品库存");
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    //@RequiresPermissions("itdm_sample_inventory:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, ItdmSampleInventory.class);
+    }
+
+}

+ 80 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/entity/ItdmInventoryBarcode.java

@@ -0,0 +1,80 @@
+package org.jeecg.modules.inventory.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 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:   2023-06-26
+ * @Version: V1.0
+ */
+@Data
+@TableName("itdm_inventory_barcode")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="itdm_inventory_barcode对象", description="库存条码")
+public class ItdmInventoryBarcode implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private java.lang.String id;
+	/**库存id*/
+	@Excel(name = "库存id", width = 15)
+    @ApiModelProperty(value = "库存id")
+    private java.lang.String inventoryId;
+	/**条码*/
+	@Excel(name = "条码", width = 15)
+    @ApiModelProperty(value = "条码")
+    private java.lang.String barCode;
+	/**状态*/
+	@Excel(name = "状态", width = 15)
+    @ApiModelProperty(value = "状态")
+    private java.lang.String disableStatus;
+	/**数量*/
+	@Excel(name = "数量", width = 15)
+    @ApiModelProperty(value = "数量")
+    private java.lang.String num;
+	/**当前使用状态(未使用、入库、出库)*/
+	@Excel(name = "当前使用状态(未使用、入库、出库)", width = 15)
+    @ApiModelProperty(value = "当前使用状态(未使用、入库、出库)")
+    @Dict(dicCode = "barcode_status")
+
+    private java.lang.String useStatus;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private java.lang.String createBy;
+	/**创建日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private java.util.Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private java.lang.String updateBy;
+	/**更新日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private java.util.Date updateTime;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private java.lang.String sysOrgCode;
+}

+ 104 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/entity/ItdmInventoryLog.java

@@ -0,0 +1,104 @@
+package org.jeecg.modules.inventory.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 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:   2023-06-26
+ * @Version: V1.0
+ */
+@Data
+@TableName("itdm_inventory_log")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="itdm_inventory_log对象", description="库存日志")
+public class ItdmInventoryLog implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private java.lang.String id;
+	/**类型(入库、出库)*/
+	@Excel(name = "类型(入库、出库)", width = 15)
+    @ApiModelProperty(value = "类型(入库、出库)")
+    @Dict(dicCode = "inventory_type")
+
+    private java.lang.String type;
+	/**条码*/
+	@Excel(name = "条码", width = 15)
+    @ApiModelProperty(value = "条码")
+    private java.lang.String barCode;
+	/**样品库存id*/
+	@Excel(name = "样品库存id", width = 15)
+    @ApiModelProperty(value = "样品库存id")
+
+    @Dict(dicCode = "id",dictTable = "itdm_sample_inventory",dicText = "sample_name")
+
+    private java.lang.String inventoryId;
+	/**数量 用来同步*/
+	@Excel(name = "数量 用来同步", width = 15)
+    @ApiModelProperty(value = "数量 用来同步")
+    private java.lang.String num;
+	/**使用人员(入库借出和出库归还)*/
+	@Excel(name = "使用人员(入库借出和出库归还)", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
+    @ApiModelProperty(value = "使用人员(入库借出和出库归还)")
+
+    @Dict(dicCode = "username",dictTable = "sys_user",dicText = "realname")
+
+    private java.lang.String useBy;
+    /**
+     * 库管人员(当前登录或者自己填写)
+     */
+    @Excel(name = "库管人员(当前登录或者自己填写)", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
+    @ApiModelProperty(value = "库管人员(当前登录或者自己填写)")
+    @Dict(dicCode = "username", dictTable = "sys_user", dicText = "realname")
+
+    private java.lang.String warehouseBy;
+	/**使用时间*/
+	@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 java.util.Date useTime;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+    @ApiModelProperty(value = "备注")
+    private java.lang.String remark;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private java.lang.String createBy;
+	/**创建日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private java.util.Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private java.lang.String updateBy;
+	/**更新日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private java.util.Date updateTime;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private java.lang.String sysOrgCode;
+}

+ 106 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/entity/ItdmSampleInventory.java

@@ -0,0 +1,106 @@
+package org.jeecg.modules.inventory.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 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:   2023-06-25
+ * @Version: V1.0
+ */
+@Data
+@TableName("itdm_sample_inventory")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="itdm_sample_inventory对象", description="样品库存")
+public class ItdmSampleInventory implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+	/**样品名称*/
+	@Excel(name = "样品名称", width = 15)
+    @ApiModelProperty(value = "样品名称")
+    private String sampleName;
+	/**样品规格*/
+	@Excel(name = "样品规格", width = 15)
+    @ApiModelProperty(value = "样品规格")
+    private String sampleSpecifications;
+	/**样品数量*/
+	@Excel(name = "样品数量", width = 15)
+    @ApiModelProperty(value = "样品数量")
+    private Integer sampleNum;
+	/**生产厂家*/
+	@Excel(name = "生产厂家", width = 15)
+    @ApiModelProperty(value = "生产厂家")
+    private String sampleManufacturer;
+	/**批次号*/
+	@Excel(name = "批次号", width = 15)
+    @ApiModelProperty(value = "批次号")
+    private String batchNumber;
+	/**样品分类*/
+	@Excel(name = "样品分类", width = 15)
+    @ApiModelProperty(value = "样品分类")
+    private String sampleClassifications;
+	/**样品单位*/
+	@Excel(name = "样品单位", width = 15)
+    @ApiModelProperty(value = "样品单位")
+    private String sampleUnit;
+	/**样品状态(是否损坏)*/
+	@Excel(name = "样品状态(是否损坏)", width = 15)
+    @ApiModelProperty(value = "样品状态(是否损坏)")
+    private String sampleStatus;
+	/**样品类型(用来判断生成条码)*/
+	@Excel(name = "样品类型(用来判断生成条码)", width = 15)
+    @ApiModelProperty(value = "样品类型(用来判断生成条码)")
+    private String sampleType;
+	/**样品存放位置*/
+	@Excel(name = "样品存放位置", width = 15)
+    @ApiModelProperty(value = "样品存放位置")
+    private String samplePosition;
+	/**状态*/
+	@Excel(name = "状态", width = 15)
+    @ApiModelProperty(value = "状态")
+    private String status;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+    @ApiModelProperty(value = "备注")
+    private String remark;
+	/**创建人*/
+    @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;
+}

+ 17 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/mapper/ItdmInventoryBarcodeMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.inventory.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.inventory.entity.ItdmInventoryBarcode;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 库存条码
+ * @Author: jeecg-boot
+ * @Date:   2023-06-26
+ * @Version: V1.0
+ */
+public interface ItdmInventoryBarcodeMapper extends BaseMapper<ItdmInventoryBarcode> {
+
+}

+ 17 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/mapper/ItdmInventoryLogMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.inventory.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.inventory.entity.ItdmInventoryLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 库存日志
+ * @Author: jeecg-boot
+ * @Date:   2023-06-26
+ * @Version: V1.0
+ */
+public interface ItdmInventoryLogMapper extends BaseMapper<ItdmInventoryLog> {
+
+}

+ 17 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/mapper/ItdmSampleInventoryMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.inventory.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.inventory.entity.ItdmSampleInventory;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 样品库存
+ * @Author: jeecg-boot
+ * @Date:   2023-06-25
+ * @Version: V1.0
+ */
+public interface ItdmSampleInventoryMapper extends BaseMapper<ItdmSampleInventory> {
+
+}

+ 5 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/mapper/xml/ItdmInventoryBarcodeMapper.xml

@@ -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.inventory.mapper.ItdmInventoryBarcodeMapper">
+
+</mapper>

+ 5 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/mapper/xml/ItdmInventoryLogMapper.xml

@@ -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.inventory.mapper.ItdmInventoryLogMapper">
+
+</mapper>

+ 5 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/mapper/xml/ItdmSampleInventoryMapper.xml

@@ -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.inventory.mapper.ItdmSampleInventoryMapper">
+
+</mapper>

+ 14 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/service/IItdmInventoryBarcodeService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.inventory.service;
+
+import org.jeecg.modules.inventory.entity.ItdmInventoryBarcode;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 库存条码
+ * @Author: jeecg-boot
+ * @Date:   2023-06-26
+ * @Version: V1.0
+ */
+public interface IItdmInventoryBarcodeService extends IService<ItdmInventoryBarcode> {
+
+}

+ 14 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/service/IItdmInventoryLogService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.inventory.service;
+
+import org.jeecg.modules.inventory.entity.ItdmInventoryLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 库存日志
+ * @Author: jeecg-boot
+ * @Date:   2023-06-26
+ * @Version: V1.0
+ */
+public interface IItdmInventoryLogService extends IService<ItdmInventoryLog> {
+
+}

+ 14 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/service/IItdmSampleInventoryService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.inventory.service;
+
+import org.jeecg.modules.inventory.entity.ItdmSampleInventory;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 样品库存
+ * @Author: jeecg-boot
+ * @Date:   2023-06-25
+ * @Version: V1.0
+ */
+public interface IItdmSampleInventoryService extends IService<ItdmSampleInventory> {
+
+}

+ 19 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/service/impl/ItdmInventoryBarcodeServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.inventory.service.impl;
+
+import org.jeecg.modules.inventory.entity.ItdmInventoryBarcode;
+import org.jeecg.modules.inventory.mapper.ItdmInventoryBarcodeMapper;
+import org.jeecg.modules.inventory.service.IItdmInventoryBarcodeService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 库存条码
+ * @Author: jeecg-boot
+ * @Date:   2023-06-26
+ * @Version: V1.0
+ */
+@Service
+public class ItdmInventoryBarcodeServiceImpl extends ServiceImpl<ItdmInventoryBarcodeMapper, ItdmInventoryBarcode> implements IItdmInventoryBarcodeService {
+
+}

+ 19 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/service/impl/ItdmInventoryLogServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.inventory.service.impl;
+
+import org.jeecg.modules.inventory.entity.ItdmInventoryLog;
+import org.jeecg.modules.inventory.mapper.ItdmInventoryLogMapper;
+import org.jeecg.modules.inventory.service.IItdmInventoryLogService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 库存日志
+ * @Author: jeecg-boot
+ * @Date:   2023-06-26
+ * @Version: V1.0
+ */
+@Service
+public class ItdmInventoryLogServiceImpl extends ServiceImpl<ItdmInventoryLogMapper, ItdmInventoryLog> implements IItdmInventoryLogService {
+
+}

+ 19 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/service/impl/ItdmSampleInventoryServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.inventory.service.impl;
+
+import org.jeecg.modules.inventory.entity.ItdmSampleInventory;
+import org.jeecg.modules.inventory.mapper.ItdmSampleInventoryMapper;
+import org.jeecg.modules.inventory.service.IItdmSampleInventoryService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 样品库存
+ * @Author: jeecg-boot
+ * @Date:   2023-06-25
+ * @Version: V1.0
+ */
+@Service
+public class ItdmSampleInventoryServiceImpl extends ServiceImpl<ItdmSampleInventoryMapper, ItdmSampleInventory> implements IItdmSampleInventoryService {
+
+}

+ 213 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/vue/ItdmInventoryLogList.vue

@@ -0,0 +1,213 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('库存日志')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <itdm-inventory-log-modal ref="modalForm" @ok="modalFormOk"></itdm-inventory-log-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import ItdmInventoryLogModal from './modules/ItdmInventoryLogModal'
+
+  export default {
+    name: 'ItdmInventoryLogList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      ItdmInventoryLogModal
+    },
+    data () {
+      return {
+        description: '库存日志管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'类型(入库、出库)',
+            align:"center",
+            dataIndex: 'type'
+          },
+          {
+            title:'条码',
+            align:"center",
+            dataIndex: 'barCode'
+          },
+          {
+            title:'样品库存id',
+            align:"center",
+            dataIndex: 'inventoryId'
+          },
+          {
+            title:'数量 用来同步',
+            align:"center",
+            dataIndex: 'num'
+          },
+          {
+            title:'使用人员(入库借出和出库归还)',
+            align:"center",
+            dataIndex: 'useBy'
+          },
+          {
+            title:'库管人员(当前登录或者自己填写)',
+            align:"center",
+            dataIndex: 'warehouseBy'
+          },
+          {
+            title:'使用时间',
+            align:"center",
+            dataIndex: 'useTime'
+          },
+          {
+            title:'备注',
+            align:"center",
+            dataIndex: 'remark'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/inventory/itdmInventoryLog/list",
+          delete: "/inventory/itdmInventoryLog/delete",
+          deleteBatch: "/inventory/itdmInventoryLog/deleteBatch",
+          exportXlsUrl: "/inventory/itdmInventoryLog/exportXls",
+          importExcelUrl: "inventory/itdmInventoryLog/importExcel",
+          
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'string',value:'type',text:'类型(入库、出库)',dictCode:''})
+        fieldList.push({type:'string',value:'barCode',text:'条码',dictCode:''})
+        fieldList.push({type:'string',value:'inventoryId',text:'样品库存id',dictCode:''})
+        fieldList.push({type:'string',value:'num',text:'数量 用来同步',dictCode:''})
+        fieldList.push({type:'string',value:'useBy',text:'使用人员(入库借出和出库归还)',dictCode:''})
+        fieldList.push({type:'string',value:'warehouseBy',text:'库管人员(当前登录或者自己填写)',dictCode:''})
+        fieldList.push({type:'datetime',value:'useTime',text:'使用时间'})
+        fieldList.push({type:'Text',value:'remark',text:'备注',dictCode:''})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 26 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/vue/ItdmInventoryLog_menu_insert.sql

@@ -0,0 +1,26 @@
+-- 注意:该页面对应的前台目录为views/inventory文件夹下
+-- 如果你想更改到其他目录,请修改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 ('2023062602466520060', NULL, '库存日志', '/inventory/itdmInventoryLogList', 'module-iTDM/inventory/ItdmInventoryLogList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 1, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-06-26 14:46:06', 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 ('2023062602466520061', '2023062602466520060', '新增', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_inventory_log:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-06-26 14:46:06', 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 ('2023062602466520062', '2023062602466520060', '编辑', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_inventory_log:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-06-26 14:46:06', 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 ('2023062602466520063', '2023062602466520060', '删除', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_inventory_log:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-06-26 14:46:06', 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 ('2023062602466520064', '2023062602466520060', '批量删除', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_inventory_log:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-06-26 14:46:06', 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 ('2023062602466520065', '2023062602466520060', '导出excel', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_inventory_log:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-06-26 14:46:06', 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 ('2023062602466520066', '2023062602466520060', '导入excel', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_inventory_log:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-06-26 14:46:06', NULL, NULL, 0, 0, '1', 0);

+ 139 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/vue/modules/ItdmInventoryLogForm.vue

@@ -0,0 +1,139 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="类型(入库、出库)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
+              <a-input v-model="model.type" placeholder="请输入类型(入库、出库)"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="条码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="barCode">
+              <a-input v-model="model.barCode" placeholder="请输入条码"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="样品库存id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId">
+              <a-input v-model="model.inventoryId" placeholder="请输入样品库存id"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="数量 用来同步" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
+              <a-input v-model="model.num" placeholder="请输入数量 用来同步"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="使用人员(入库借出和出库归还)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="useBy">
+              <a-input v-model="model.useBy" placeholder="请输入使用人员(入库借出和出库归还)"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="库管人员(当前登录或者自己填写)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warehouseBy">
+              <a-input v-model="model.warehouseBy" placeholder="请输入库管人员(当前登录或者自己填写)"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="使用时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="useTime">
+              <j-date placeholder="请选择使用时间"  v-model="model.useTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
+              <a-input v-model="model.remark" placeholder="请输入备注"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'ItdmInventoryLogForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+        },
+        url: {
+          add: "/inventory/itdmInventoryLog/add",
+          edit: "/inventory/itdmInventoryLog/edit",
+          queryById: "/inventory/itdmInventoryLog/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/vue/modules/ItdmInventoryLogModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <itdm-inventory-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></itdm-inventory-log-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import ItdmInventoryLogForm from './ItdmInventoryLogForm'
+
+  export default {
+    name: 'ItdmInventoryLogModal',
+    components: {
+      ItdmInventoryLogForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/inventory/vue/modules/ItdmInventoryLogModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <itdm-inventory-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></itdm-inventory-log-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import ItdmInventoryLogForm from './ItdmInventoryLogForm'
+  export default {
+    name: 'ItdmInventoryLogModal',
+    components: {
+      ItdmInventoryLogForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>