ソースを参照

feat:改按钮拖拽的表单

hmc 1 年間 前
コミット
cb745269ae
37 ファイル変更4770 行追加167 行削除
  1. 6 2
      zkqy-business/src/main/java/com/zkqy/business/service/impl/DragTableServiceImpl.java
  2. 30 4
      zkqy-business/src/main/resources/mapper/dragmapper/DragTableBtnMapper.xml
  3. 1 0
      zkqy-custom-business/src/main/java/com/zkqy/business/controller/InboundRecordsController.java
  4. 89 99
      zkqy-custom-business/src/main/java/com/zkqy/business/controller/MaterialInventoryController.java
  5. 2 0
      zkqy-custom-business/src/main/java/com/zkqy/business/controller/OutboundRecordsController.java
  6. 113 0
      zkqy-custom-business/src/main/java/com/zkqy/business/controller/PurchaseController.java
  7. 128 0
      zkqy-custom-business/src/main/java/com/zkqy/business/controller/PurchaseInfoController.java
  8. 26 0
      zkqy-custom-business/src/main/java/com/zkqy/business/domain/InboundRecords.java
  9. 23 1
      zkqy-custom-business/src/main/java/com/zkqy/business/domain/MaterialInventory.java
  10. 26 0
      zkqy-custom-business/src/main/java/com/zkqy/business/domain/OutboundRecords.java
  11. 405 0
      zkqy-custom-business/src/main/java/com/zkqy/business/domain/Purchase.java
  12. 237 0
      zkqy-custom-business/src/main/java/com/zkqy/business/domain/PurchaseInfo.java
  13. 15 1
      zkqy-custom-business/src/main/java/com/zkqy/business/domain/vo/MaterialInventoryVo.java
  14. 158 0
      zkqy-custom-business/src/main/java/com/zkqy/business/domain/vo/PurchaseInfoVo.java
  15. 7 0
      zkqy-custom-business/src/main/java/com/zkqy/business/mapper/MaterialInventoryMapper.java
  16. 1 1
      zkqy-custom-business/src/main/java/com/zkqy/business/mapper/OutboundRecordsMapper.java
  17. 72 0
      zkqy-custom-business/src/main/java/com/zkqy/business/mapper/PurchaseInfoMapper.java
  18. 63 0
      zkqy-custom-business/src/main/java/com/zkqy/business/mapper/PurchaseMapper.java
  19. 13 3
      zkqy-custom-business/src/main/java/com/zkqy/business/service/IMaterialInventoryService.java
  20. 71 0
      zkqy-custom-business/src/main/java/com/zkqy/business/service/IPurchaseInfoService.java
  21. 61 0
      zkqy-custom-business/src/main/java/com/zkqy/business/service/IPurchaseService.java
  22. 1 0
      zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/InboundRecordsServiceImpl.java
  23. 201 13
      zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/MaterialInventoryServiceImpl.java
  24. 1 1
      zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/OutboundRecordsServiceImpl.java
  25. 109 0
      zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/PurchaseInfoServiceImpl.java
  26. 97 0
      zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/PurchaseServiceImpl.java
  27. 3 0
      zkqy-custom-business/src/main/resources/mapper/business/InboundRecordsMapper.xml
  28. 30 0
      zkqy-custom-business/src/main/resources/mapper/business/MaterialInventoryMapper.xml
  29. 4 0
      zkqy-custom-business/src/main/resources/mapper/business/OutboundRecordsMapper.xml
  30. 176 0
      zkqy-custom-business/src/main/resources/mapper/business/PurchaseInfoMapper.xml
  31. 202 0
      zkqy-custom-business/src/main/resources/mapper/business/PurchaseMapper.xml
  32. 10 0
      zkqy-ui/src/api/tablelist/purchaseInfo.js
  33. 0 1
      zkqy-ui/src/views/orderMange/approve.vue
  34. 0 1
      zkqy-ui/src/views/orderMange/financeApprove.vue
  35. 1 40
      zkqy-ui/src/views/orderMange/purchase/index.vue
  36. 2272 0
      zkqy-ui/src/views/orderMange/purchase/listInfoTwo.vue
  37. 116 0
      zkqy-ui/src/views/orderMange/purchase/print.js

+ 6 - 2
zkqy-business/src/main/java/com/zkqy/business/service/impl/DragTableServiceImpl.java

@@ -79,7 +79,7 @@ public class DragTableServiceImpl implements IDragTableService {
     public CommonEntity dragTableInfo(String tableKey) {
         //DragTable dragTable = dragTableMapper.selectDragTableBySqlKey(sqlKey);
         //根据tableKey查询动态表格结构数据
-        PageUtils.clearPage();
+//        PageUtils.clearPage();
         DragTable dragTable = dragTableMapper.selectDragTableByTableKey(tableKey);
         //得到模板数据
         Map<String, Object> resultMap = new HashMap<>();
@@ -107,9 +107,13 @@ public class DragTableServiceImpl implements IDragTableService {
         // 动态表格按钮信息
         //根据tableKey获取根节点信息
         List<String> btnKeys = dragTableBtnRelevanceMapper.selectBtnKeyByTableKey(dragTable.getTableKey());
+        List<String> newBtnKeys=new ArrayList<>();
+        btnKeys.forEach(btnKey -> {
+            newBtnKeys.add(btnKey.trim());
+        });
         //获取根节点数据
         if(btnKeys.size() > 0){
-            List<DragTableBtn> rootNodes = dragTableBtnMapper.selectDragTableBtnListByBtnKey(btnKeys);
+            List<DragTableBtn> rootNodes = dragTableBtnMapper.selectDragTableBtnListByBtnKey(newBtnKeys);
             //查询子节点
             List<Long> ids = rootNodes.stream().map(m -> m.getId()).collect(Collectors.toList());
             if (ids.isEmpty()){

+ 30 - 4
zkqy-business/src/main/resources/mapper/dragmapper/DragTableBtnMapper.xml

@@ -185,11 +185,37 @@
     </update>
 
     <select id="selectDragTableBtnListByBtnKey" resultMap="DragTableBtnResult">
-        <include refid="selectDragTableBtnVo"></include>
+        SELECT
+        id,
+        btn_parent_id,
+        ancestors_id,
+        btn_key,
+        btn_group_type,
+        btn_group_name,
+        btn_name,
+        btn_type,
+        btn_icon,
+        btn_form_key,
+        btn_form_type,
+        btn_process_key,
+        btn_table_key,
+        btn_script_key,
+        btn_show_condition,
+        btn_params,
+        btn_has_permi,
+        btn_sort,
+        del_flag,
+        create_by,
+        create_by_id,
+        create_time,
+        update_by,
+        update_by_id,
+        update_time,
+        remark
+        FROM
+        {DBNAME}.drag_table_btn
         where del_flag = '0' and btn_key in
-        <foreach collection="list" item="btnKey" open="(" close=")" separator=",">
-            #{btnKey}
-        </foreach>
+        <foreach collection="list" item="btnKey" open="(" close=")" separator=",">#{btnKey}</foreach>
     </select>
 
     <select id="selectChildNodeById" resultMap="DragTableBtnResult">

+ 1 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/controller/InboundRecordsController.java

@@ -39,6 +39,7 @@ import com.zkqy.common.core.page.TableDataInfo;
 @Api(value = "/system/records", description = "入库记录-接口")
 public class InboundRecordsController extends BaseController
 {
+
     @Autowired
     private IInboundRecordsService inboundRecordsService;
 

+ 89 - 99
zkqy-custom-business/src/main/java/com/zkqy/business/controller/MaterialInventoryController.java

@@ -38,14 +38,9 @@ import com.zkqy.common.core.page.TableDataInfo;
 @RequestMapping("/system/inventory")
 @Api(value = "/system/inventory", description = "物料库存-接口")
 public class MaterialInventoryController extends BaseController {
+
     @Autowired
     private IMaterialInventoryService materialInventoryService;
-    @Autowired
-    private InboundRecordsMapper inboundRecordsMapper;
-    @Autowired
-    private OutboundRecordsMapper outboundRecordsMapper;
-    @Autowired
-    private MaterielMapper materielMapper;
 
     /**
      * 扫码入库
@@ -55,52 +50,54 @@ public class MaterialInventoryController extends BaseController {
     @RequestMapping(value = "/insertMaterialInventory", method = RequestMethod.POST)
     @ApiOperation(value = "新增物料库存")
     public AjaxResult insertMaterialInventory(@RequestBody MaterialInventoryVo materialInventoryVo) {
-        String replace = materialInventoryVo.getQtCodeNumber().replace("/r", "");
-        materialInventoryVo.setQtCodeNumber(replace);
-        //1、禁止重复入库
-        InboundRecords inboundRecords = inboundRecordsMapper.selectInboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
-        if (inboundRecords != null) {
-            return AjaxResult.success("不可以重复扫码入库");
-        }
-        //2、判断是第一次入库还是第二次入库这个同类商品(这是一个连表语句)
-        MaterialInventory materialInventory
-                = materialInventoryService.selectMaterialInventoryByMaterialCodeAndSpecifications(materialInventoryVo.getMaterialCode(), materialInventoryVo.getSpecifications());
-        int count = 0;
-        if (materialInventory != null) { //证明已经入库过相同的产品了---库存叠加操作
-            Double quantityOld = materialInventory.getQuantity();
-            Double quantity = materialInventoryVo.getQuantity();
-            Double newQuantity =quantityOld+quantity;
-            materialInventory.setQuantity(newQuantity);
-            materialInventory.setUpdateTime(new Date());
-            materialInventory.setUpdateById(SecurityUtils.getUserId());
-            count = materialInventoryService.updateMaterialInventory(materialInventory);
-        } else { //第一次入库走插入操作) ()
-            MaterialInventory materialInventoryObj = new MaterialInventory();
-            materialInventoryObj.setStockNumber(String.valueOf(new Date().getTime()));//库存编号
-            materialInventoryObj.setWarehouseEntryNumber(UUID.randomUUID().toString());//入库单编号
-            materialInventoryObj.setMaterialCode(materialInventoryVo.getMaterialCode());//物料编号
-            materialInventoryObj.setQuantity(materialInventoryVo.getQuantity());//数量
-            materialInventoryObj.setCreateById(SecurityUtils.getUserId());
-            materialInventoryObj.setCreateTime(new Date());
-            count = materialInventoryService.insertMaterialInventory(materialInventoryObj);
-        }
-        if (count > 0) {
-            InboundRecords inboundRecords1 = new InboundRecords();
-            inboundRecords1.setInboundTime(new Date());//入库时间
-            //物料名称需要根据物料编码查询下
-            Materiel materiel = materielMapper.selectMaterielByMaterielCode(materialInventoryVo.getMaterialCode());
-            inboundRecords1.setInboundAterialsName(materiel.getMaterielName());//物料名称
-            inboundRecords1.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
-            inboundRecords1.setInboundUnit(materialInventoryVo.getInboundUnit());//单位
-            inboundRecords1.setInboundQuantity(materialInventoryVo.getQuantity().toString());//入库数量
-            inboundRecords1.setInboundLeader(SecurityUtils.getUsername());//仓管员
-            inboundRecords1.setCreateById(SecurityUtils.getUserId());//创建人
-            inboundRecords1.setCreateTime(new Date());//创建时间
-            inboundRecords1.setQtCodeNumber(materialInventoryVo.getQtCodeNumber());
-            inboundRecordsMapper.insertInboundRecords(inboundRecords1); //插入入库日志信息
-            return AjaxResult.success("入库成功");
-        }
-        return AjaxResult.error("入库失败");
+        //入库操作
+        return materialInventoryService.insertMaterialInventory(materialInventoryVo);
+//        String replace = materialInventoryVo.getQtCodeNumber().replace("/r", "");
+//        materialInventoryVo.setQtCodeNumber(replace);
+//        //1、禁止重复入库
+//        InboundRecords inboundRecords = inboundRecordsMapper.selectInboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
+//        if (inboundRecords != null) {
+//            return AjaxResult.success("不可以重复扫码入库");
+//        }
+//        //2、判断是第一次入库还是第二次入库这个同类商品(这是一个连表语句)
+//        MaterialInventory materialInventory
+//                = materialInventoryService.selectMaterialInventoryByMaterialCodeAndSpecifications(materialInventoryVo.getMaterialCode(), materialInventoryVo.getSpecifications());
+//        int count = 0;
+//        if (materialInventory != null) { //证明已经入库过相同的产品了---库存叠加操作
+//            Double quantityOld = materialInventory.getQuantity();
+//            Double quantity = materialInventoryVo.getQuantity();
+//            Double newQuantity =quantityOld+quantity;
+//            materialInventory.setQuantity(newQuantity);
+//            materialInventory.setUpdateTime(new Date());
+//            materialInventory.setUpdateById(SecurityUtils.getUserId());
+//            count = materialInventoryService.updateMaterialInventory(materialInventory);
+//        } else { //第一次入库走插入操作) ()
+//            MaterialInventory materialInventoryObj = new MaterialInventory();
+//            materialInventoryObj.setStockNumber(String.valueOf(new Date().getTime()));//库存编号
+//            materialInventoryObj.setWarehouseEntryNumber(UUID.randomUUID().toString());//入库单编号
+//            materialInventoryObj.setMaterialCode(materialInventoryVo.getMaterialCode());//物料编号
+//            materialInventoryObj.setQuantity(materialInventoryVo.getQuantity());//数量
+//            materialInventoryObj.setCreateById(SecurityUtils.getUserId());
+//            materialInventoryObj.setCreateTime(new Date());
+//            count = materialInventoryService.insertMaterialInventory(materialInventoryObj);
+//        }
+//        if (count > 0) {
+//            InboundRecords inboundRecords1 = new InboundRecords();
+//            inboundRecords1.setInboundTime(new Date());//入库时间
+//            //物料名称需要根据物料编码查询下
+//            Materiel materiel = materielMapper.selectMaterielByMaterielCode(materialInventoryVo.getMaterialCode());
+//            inboundRecords1.setInboundAterialsName(materiel.getMaterielName());//物料名称
+//            inboundRecords1.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
+//            inboundRecords1.setInboundUnit(materialInventoryVo.getInboundUnit());//单位
+//            inboundRecords1.setInboundQuantity(materialInventoryVo.getQuantity().toString());//入库数量
+//            inboundRecords1.setInboundLeader(SecurityUtils.getUsername());//仓管员
+//            inboundRecords1.setCreateById(SecurityUtils.getUserId());//创建人
+//            inboundRecords1.setCreateTime(new Date());//创建时间
+//            inboundRecords1.setQtCodeNumber(materialInventoryVo.getQtCodeNumber());
+//            inboundRecordsMapper.insertInboundRecords(inboundRecords1); //插入入库日志信息
+//            return AjaxResult.success("入库成功");
+//        }
+//        return AjaxResult.error("入库失败");
     }
 
 
@@ -112,55 +109,48 @@ public class MaterialInventoryController extends BaseController {
     @RequestMapping(value = "/deliveryFromStorage",method = RequestMethod.POST)
     @ApiOperation(value = "扫码出库")
     public AjaxResult deliveryFromStorage(@RequestBody MaterialInventoryVo materialInventoryVo) {
-        //1、禁止重复入库
-        InboundRecords inboundRecords = inboundRecordsMapper.selectInboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
-        if (inboundRecords == null) {
-            return AjaxResult.success("此货品还没有入库,不能出库");
-        }
-        //2、是否重复入库
-        OutboundRecords outboundRecords = outboundRecordsMapper.selectOutboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
-        if (outboundRecords != null) {
-            return AjaxResult.success("此货品不能重复出库");
-        }
-        //3、根据物料编码跟规则查询库存信息
-        MaterialInventory materialInventory
-                = materialInventoryService.selectMaterialInventoryByMaterialCodeAndSpecifications(materialInventoryVo.getMaterialCode(), materialInventoryVo.getSpecifications());
-        //4、出库多少减去这个数量
-        Double quantityOld = materialInventory.getQuantity();
-        Double quantity = materialInventoryVo.getQuantity();
-        Double newQuantity =quantityOld-quantity;
-        materialInventory.setQuantity(newQuantity);
-        int count = materialInventoryService.updateMaterialInventory(materialInventory);
-        if (count > 0) {
-            OutboundRecords outboundRecords1 = new OutboundRecords();
-            outboundRecords1.setOutboundTime(new Date());//出库时间
-            //物料名称需要根据物料编码查询下
-            Materiel materiel = materielMapper.selectMaterielByMaterielCode(materialInventoryVo.getMaterialCode());
-            outboundRecords1.setQtCodeNumber(materialInventoryVo.getQtCodeNumber());
-            outboundRecords1.setOutboundAterialsName(materiel.getMaterielName());//物料名称
-            outboundRecords1.setOutboundNo(UUID.randomUUID().toString());//出库编号
-            outboundRecords1.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
-            outboundRecords1.setOutboundUnit(materialInventoryVo.getInboundUnit());//单位
-            outboundRecords1.setOutboundQuantity(materialInventoryVo.getQuantity().toString());//出库数量
-            outboundRecords1.setOutboundLeader(SecurityUtils.getUsername());//仓管员
-            outboundRecords1.setCreateById(SecurityUtils.getUserId());//创建人
-            outboundRecords1.setCreateTime(new Date());//创建时间
-            outboundRecordsMapper.insertOutboundRecords(outboundRecords1); //插出库库日志信息
-            return AjaxResult.success("出库成功");
-        }
-        return AjaxResult.error("出库失败");
+        //入库操作
+        return materialInventoryService.outMaterialInventory(materialInventoryVo);
+//        //1、禁止重复入库
+//        InboundRecords inboundRecords = inboundRecordsMapper.selectInboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
+//        if (inboundRecords == null) {
+//            return AjaxResult.success("此货品还没有入库,不能出库");
+//        }
+//        //2、是否重复入库
+//        OutboundRecords outboundRecords = outboundRecordsMapper.selectOutboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
+//        if (outboundRecords != null) {
+//            return AjaxResult.success("此货品不能重复出库");
+//        }
+//        //3、根据物料编码跟规则查询库存信息
+//        MaterialInventory materialInventory
+//                = materialInventoryService.selectMaterialInventoryByMaterialCodeAndSpecifications(materialInventoryVo.getMaterialCode(), materialInventoryVo.getSpecifications());
+//        //4、出库多少减去这个数量
+//        Double quantityOld = materialInventory.getQuantity();
+//        Double quantity = materialInventoryVo.getQuantity();
+//        Double newQuantity =quantityOld-quantity;
+//        materialInventory.setQuantity(newQuantity);
+//        int count = materialInventoryService.updateMaterialInventory(materialInventory);
+//        if (count > 0) {
+//            OutboundRecords outboundRecords1 = new OutboundRecords();
+//            outboundRecords1.setOutboundTime(new Date());//出库时间
+//            //物料名称需要根据物料编码查询下
+//            Materiel materiel = materielMapper.selectMaterielByMaterielCode(materialInventoryVo.getMaterialCode());
+//            outboundRecords1.setQtCodeNumber(materialInventoryVo.getQtCodeNumber());
+//            outboundRecords1.setOutboundAterialsName(materiel.getMaterielName());//物料名称
+//            outboundRecords1.setOutboundNo(UUID.randomUUID().toString());//出库编号
+//            outboundRecords1.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
+//            outboundRecords1.setOutboundUnit(materialInventoryVo.getInboundUnit());//单位
+//            outboundRecords1.setOutboundQuantity(materialInventoryVo.getQuantity().toString());//出库数量
+//            outboundRecords1.setOutboundLeader(SecurityUtils.getUsername());//仓管员
+//            outboundRecords1.setCreateById(SecurityUtils.getUserId());//创建人
+//            outboundRecords1.setCreateTime(new Date());//创建时间
+//            outboundRecordsMapper.insertOutboundRecords(outboundRecords1); //插出库库日志信息
+//            return AjaxResult.success("出库成功");
+//        }
+//        return AjaxResult.error("出库失败");
     }
 
-    /**
-     * 新增物料库存
-     */
-    @PreAuthorize("@ss.hasPermi('system:inventory:add')")
-    @Log(title = "物料库存", businessType = BusinessType.INSERT)
-    @PostMapping
-    @ApiOperation(value = "新增物料库存")
-    public AjaxResult add(@RequestBody MaterialInventory materialInventory) {
-        return toAjax(materialInventoryService.insertMaterialInventory(materialInventory));
-    }
+
 
     /**
      * 查询物料库存列表

+ 2 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/controller/OutboundRecordsController.java

@@ -36,6 +36,7 @@ import com.zkqy.common.core.page.TableDataInfo;
 @Api(value = "/system/records", description = "出库记录-接口")
 public class OutboundRecordsController extends BaseController {
 
+
     @Autowired
     private IOutboundRecordsService outboundRecordsService;
 
@@ -106,4 +107,5 @@ public class OutboundRecordsController extends BaseController {
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(outboundRecordsService.deleteOutboundRecordsByIds(ids));
     }
+
 }

+ 113 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/controller/PurchaseController.java

@@ -0,0 +1,113 @@
+package com.zkqy.business.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.zkqy.common.annotation.Log;
+import com.zkqy.common.core.controller.BaseController;
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.enums.BusinessType;
+import com.zkqy.business.domain.Purchase;
+import com.zkqy.business.service.IPurchaseService;
+import com.zkqy.common.utils.poi.ExcelUtil;
+import com.zkqy.common.core.page.TableDataInfo;
+
+/**
+ * 采购Controller
+ *
+ * @author zkqy
+ * @date 2024-04-12
+ */
+@RestController
+@RequestMapping("/business/采购表")
+@Api(value = "/business/采购表", description = "采购-接口")
+public class PurchaseController extends BaseController
+{
+    @Autowired
+    private IPurchaseService purchaseService;
+
+/**
+ * 查询采购列表
+ */
+@PreAuthorize("@ss.hasPermi('business:采购表:list')")
+@GetMapping("/list")
+@ApiOperation(value = "查询采购列表")
+    public TableDataInfo list(Purchase purchase)
+    {
+        startPage();
+        List<Purchase> list = purchaseService.selectPurchaseList(purchase);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出采购列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:采购表:export')")
+    @Log(title = "采购", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ApiOperation(value = "导出采购列表")
+    public void export(HttpServletResponse response, Purchase purchase)
+    {
+        List<Purchase> list = purchaseService.selectPurchaseList(purchase);
+        ExcelUtil<Purchase> util = new ExcelUtil<Purchase>(Purchase.class);
+        util.exportExcel(response, list, "采购数据");
+    }
+
+    /**
+     * 获取采购详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:采购表:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation(value = "获取采购详细信息")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return success(purchaseService.selectPurchaseById(id));
+    }
+
+    /**
+     * 新增采购
+     */
+    @PreAuthorize("@ss.hasPermi('business:采购表:add')")
+    @Log(title = "采购", businessType = BusinessType.INSERT)
+    @PostMapping
+    @ApiOperation(value = "新增采购")
+    public AjaxResult add(@RequestBody Purchase purchase)
+    {
+        return toAjax(purchaseService.insertPurchase(purchase));
+    }
+
+    /**
+     * 修改采购
+     */
+    @PreAuthorize("@ss.hasPermi('business:采购表:edit')")
+    @Log(title = "采购", businessType = BusinessType.UPDATE)
+    @PutMapping
+    @ApiOperation(value = "修改采购")
+    public AjaxResult edit(@RequestBody Purchase purchase)
+    {
+        return toAjax(purchaseService.updatePurchase(purchase));
+    }
+
+    /**
+     * 删除采购
+     */
+    @PreAuthorize("@ss.hasPermi('business:采购表:remove')")
+    @Log(title = "采购", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    @ApiOperation(value = "删除采购")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        return toAjax(purchaseService.deletePurchaseByIds(ids));
+    }
+}

+ 128 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/controller/PurchaseInfoController.java

@@ -0,0 +1,128 @@
+package com.zkqy.business.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.zkqy.business.domain.vo.PurchaseInfoVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.zkqy.common.annotation.Log;
+import com.zkqy.common.core.controller.BaseController;
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.enums.BusinessType;
+import com.zkqy.business.domain.PurchaseInfo;
+import com.zkqy.business.service.IPurchaseInfoService;
+import com.zkqy.common.utils.poi.ExcelUtil;
+import com.zkqy.common.core.page.TableDataInfo;
+
+/**
+ * 采购详情Controller
+ *
+ * @author zkqy
+ * @date 2024-04-12
+ */
+@RestController
+@RequestMapping("/business/purchaseInfo")
+@Api(value = "/business/采购详情表", description = "采购详情-接口")
+public class PurchaseInfoController extends BaseController
+{
+    @Autowired
+    private IPurchaseInfoService purchaseInfoService;
+
+    /**
+     * 查询采购详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:采购详情表:list')")
+    @GetMapping("/list")
+    @ApiOperation(value = "查询采购详情列表")
+    public TableDataInfo list(PurchaseInfo purchaseInfo)
+    {
+        startPage();
+        List<PurchaseInfo> list = purchaseInfoService.selectPurchaseInfoList(purchaseInfo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询采购详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:采购详情表:list')")
+    @GetMapping("/listInfo")
+    @ApiOperation(value = "查询采购详情列表")
+    public AjaxResult PurchaseInfoList(PurchaseInfo purchaseInfo)
+    {
+        List<PurchaseInfoVo> list = purchaseInfoService.selectPurchaseInfoListAndPurchaseAndMaterial(purchaseInfo);
+        return  AjaxResult.success(list);
+    }
+
+
+    /**
+     * 导出采购详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:采购详情表:export')")
+    @Log(title = "采购详情", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ApiOperation(value = "导出采购详情列表")
+    public void export(HttpServletResponse response, PurchaseInfo purchaseInfo)
+    {
+        List<PurchaseInfo> list = purchaseInfoService.selectPurchaseInfoList(purchaseInfo);
+        ExcelUtil<PurchaseInfo> util = new ExcelUtil<PurchaseInfo>(PurchaseInfo.class);
+        util.exportExcel(response, list, "采购详情数据");
+    }
+
+    /**
+     * 获取采购详情详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:采购详情表:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation(value = "获取采购详情详细信息")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(purchaseInfoService.selectPurchaseInfoById(id));
+    }
+
+    /**
+     * 新增采购详情
+     */
+    @PreAuthorize("@ss.hasPermi('business:采购详情表:add')")
+    @Log(title = "采购详情", businessType = BusinessType.INSERT)
+    @PostMapping
+    @ApiOperation(value = "新增采购详情")
+    public AjaxResult add(@RequestBody PurchaseInfo purchaseInfo)
+    {
+        return toAjax(purchaseInfoService.insertPurchaseInfo(purchaseInfo));
+    }
+
+    /**
+     * 修改采购详情
+     */
+    @PreAuthorize("@ss.hasPermi('business:采购详情表:edit')")
+    @Log(title = "采购详情", businessType = BusinessType.UPDATE)
+    @PutMapping
+    @ApiOperation(value = "修改采购详情")
+    public AjaxResult edit(@RequestBody PurchaseInfo purchaseInfo)
+    {
+        return toAjax(purchaseInfoService.updatePurchaseInfo(purchaseInfo));
+    }
+
+    /**
+     * 删除采购详情
+     */
+    @PreAuthorize("@ss.hasPermi('business:采购详情表:remove')")
+    @Log(title = "采购详情", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    @ApiOperation(value = "删除采购详情")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(purchaseInfoService.deletePurchaseInfoByIds(ids));
+    }
+}

+ 26 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/domain/InboundRecords.java

@@ -15,6 +15,7 @@ import com.zkqy.common.annotation.Excel;
  */
 public class InboundRecords extends BaseEntity
 {
+
     private static final long serialVersionUID = 1L;
 
     /** 主键 */
@@ -45,6 +46,12 @@ public class InboundRecords extends BaseEntity
     @Excel(name = "单位")
     private String inboundUnit;
 
+
+    /** 色号 */
+    @Excel(name = "色号")
+    private String colorNumber;
+
+
     /** 入库数量/重量 */
     @Excel(name = "入库数量/重量")
     private String inboundQuantity;
@@ -115,6 +122,25 @@ public class InboundRecords extends BaseEntity
     @Excel(name = "二维码编码")
     private String qtCodeNumber;
 
+    @Excel(name = "批号")
+    private String LotNumber;
+
+    public String getLotNumber() {
+        return LotNumber;
+    }
+
+    public void setLotNumber(String lotNumber) {
+        LotNumber = lotNumber;
+    }
+
+    public String getColorNumber() {
+        return colorNumber;
+    }
+
+    public void setColorNumber(String colorNumber) {
+        this.colorNumber = colorNumber;
+    }
+
     public String getQtCodeNumber() {
         return qtCodeNumber;
     }

+ 23 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/domain/MaterialInventory.java

@@ -65,7 +65,29 @@ public class MaterialInventory extends BaseEntity
     @Excel(name = "任务节点编码")
     private String taskNodeKey;
 
-    public void setId(Long id) 
+    @Excel(name = "批号")
+    private String lotNumber;
+
+    @Excel(name = "原材料id")
+    private String materialId;
+
+    public String getMaterialId() {
+        return materialId;
+    }
+
+    public void setMaterialId(String materialId) {
+        this.materialId = materialId;
+    }
+
+    public String getLotNumber() {
+        return lotNumber;
+    }
+
+    public void setLotNumber(String lotNumber) {
+        this.lotNumber = lotNumber;
+    }
+
+    public void setId(Long id)
     {
         this.id = id;
     }

+ 26 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/domain/OutboundRecords.java

@@ -15,6 +15,7 @@ import com.zkqy.common.annotation.Excel;
  */
 public class OutboundRecords extends BaseEntity
 {
+
     private static final long serialVersionUID = 1L;
 
     /** 主键 */
@@ -103,6 +104,31 @@ public class OutboundRecords extends BaseEntity
     @Excel(name = "二维码编码")
     private String qtCodeNumber;
 
+    @Excel(name = "批号")
+    private String lotNumber;
+
+    @Excel(name = "原材料id")
+    private String materielId;
+
+    public String getMaterielId() {
+        return materielId;
+    }
+
+    public void setMaterielId(String materielId) {
+        this.materielId = materielId;
+    }
+
+    public String getLotNumber() {
+        return lotNumber;
+    }
+
+
+
+    public void setLotNumber(String lotNumber) {
+        this.lotNumber = lotNumber;
+    }
+
+
     public String getQtCodeNumber() {
         return qtCodeNumber;
     }

+ 405 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/domain/Purchase.java

@@ -0,0 +1,405 @@
+package com.zkqy.business.domain;
+
+import com.zkqy.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.zkqy.common.annotation.Excel;
+
+/**
+ * 采购对象 purchase
+ * 
+ * @author zkqy
+ * @date 2024-04-12
+ */
+public class Purchase extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键自增 */
+    private String id;
+
+    /** 采购序号 */
+    @Excel(name = "采购序号")
+    private String serialNumber;
+
+    /** 品名 */
+    @Excel(name = "品名")
+    private String buyName;
+
+    /** 供应商编号 */
+    @Excel(name = "供应商编号")
+    private String supplierNo;
+
+    /** 使用部门 */
+    @Excel(name = "使用部门")
+    private String useDepartment;
+
+    /** 使用部门编号 */
+    @Excel(name = "使用部门编号")
+    private Long useDepartmentId;
+
+    /** 申报人员(未使用) */
+    @Excel(name = "申报人员(未使用)")
+    private String declarant;
+
+    /** 审核人(未使用) */
+    @Excel(name = "审核人(未使用)")
+    private String reviewer;
+
+    /** 审核状态(未使用) */
+    @Excel(name = "审核状态(未使用)")
+    private String reviewerState;
+
+    /** 审核备注(未使用) */
+    @Excel(name = "审核备注(未使用)")
+    private String reviewerNotes;
+
+    /** 审批备注(未使用) */
+    @Excel(name = "审批备注(未使用)")
+    private String approver;
+
+    /** 审批状态(未使用) */
+    @Excel(name = "审批状态(未使用)")
+    private String approverState;
+
+    /** 审批备注(未使用) */
+    @Excel(name = "审批备注(未使用)")
+    private String approverNoets;
+
+    /** 物料编号 */
+    @Excel(name = "物料编号")
+    private String materielId;
+
+    /** 单位 */
+    @Excel(name = "单位")
+    private String units;
+
+    /** 规格代号 */
+    @Excel(name = "规格代号")
+    private String specification;
+
+    /** 数量/重量 */
+    @Excel(name = "数量/重量")
+    private Long quantity;
+
+    /** 单价 */
+    @Excel(name = "单价")
+    private Long unitPrice;
+
+    /** 金额 */
+    @Excel(name = "金额")
+    private Long amount;
+
+    /** 数据条审批状态(默认字段 0:未提交 1:已提交 2:已撤销 3:已通过) */
+    @Excel(name = "数据条审批状态", readConverterExp = "默=认字段,0=:未提交,1=:已提交,2=:已撤销,3=:已通过")
+    private String dataApprovalStatus;
+
+    /** 创建者id */
+    @Excel(name = "创建者id")
+    private Long createById;
+
+    /** 更新者id */
+    @Excel(name = "更新者id")
+    private Long updateById;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private String delFlag;
+
+    /** 任务编码 */
+    @Excel(name = "任务编码")
+    private String taskProcessKey;
+
+    /** 任务节点编码 */
+    @Excel(name = "任务节点编码")
+    private String taskNodeKey;
+
+    /** 流程编码 */
+    @Excel(name = "流程编码")
+    private String processKey;
+
+    /** 采购批号 */
+    @Excel(name = "采购批号")
+    private String lotNumber;
+
+    public void setId(String id) 
+    {
+        this.id = id;
+    }
+
+    public String getId() 
+    {
+        return id;
+    }
+    public void setSerialNumber(String serialNumber) 
+    {
+        this.serialNumber = serialNumber;
+    }
+
+    public String getSerialNumber() 
+    {
+        return serialNumber;
+    }
+    public void setBuyName(String buyName) 
+    {
+        this.buyName = buyName;
+    }
+
+    public String getBuyName() 
+    {
+        return buyName;
+    }
+    public void setSupplierNo(String supplierNo) 
+    {
+        this.supplierNo = supplierNo;
+    }
+
+    public String getSupplierNo() 
+    {
+        return supplierNo;
+    }
+    public void setUseDepartment(String useDepartment) 
+    {
+        this.useDepartment = useDepartment;
+    }
+
+    public String getUseDepartment() 
+    {
+        return useDepartment;
+    }
+    public void setUseDepartmentId(Long useDepartmentId) 
+    {
+        this.useDepartmentId = useDepartmentId;
+    }
+
+    public Long getUseDepartmentId() 
+    {
+        return useDepartmentId;
+    }
+    public void setDeclarant(String declarant) 
+    {
+        this.declarant = declarant;
+    }
+
+    public String getDeclarant() 
+    {
+        return declarant;
+    }
+    public void setReviewer(String reviewer) 
+    {
+        this.reviewer = reviewer;
+    }
+
+    public String getReviewer() 
+    {
+        return reviewer;
+    }
+    public void setReviewerState(String reviewerState) 
+    {
+        this.reviewerState = reviewerState;
+    }
+
+    public String getReviewerState() 
+    {
+        return reviewerState;
+    }
+    public void setReviewerNotes(String reviewerNotes) 
+    {
+        this.reviewerNotes = reviewerNotes;
+    }
+
+    public String getReviewerNotes() 
+    {
+        return reviewerNotes;
+    }
+    public void setApprover(String approver) 
+    {
+        this.approver = approver;
+    }
+
+    public String getApprover() 
+    {
+        return approver;
+    }
+    public void setApproverState(String approverState) 
+    {
+        this.approverState = approverState;
+    }
+
+    public String getApproverState() 
+    {
+        return approverState;
+    }
+    public void setApproverNoets(String approverNoets) 
+    {
+        this.approverNoets = approverNoets;
+    }
+
+    public String getApproverNoets() 
+    {
+        return approverNoets;
+    }
+    public void setMaterielId(String materielId) 
+    {
+        this.materielId = materielId;
+    }
+
+    public String getMaterielId() 
+    {
+        return materielId;
+    }
+    public void setUnits(String units) 
+    {
+        this.units = units;
+    }
+
+    public String getUnits() 
+    {
+        return units;
+    }
+    public void setSpecification(String specification) 
+    {
+        this.specification = specification;
+    }
+
+    public String getSpecification() 
+    {
+        return specification;
+    }
+    public void setQuantity(Long quantity) 
+    {
+        this.quantity = quantity;
+    }
+
+    public Long getQuantity() 
+    {
+        return quantity;
+    }
+    public void setUnitPrice(Long unitPrice) 
+    {
+        this.unitPrice = unitPrice;
+    }
+
+    public Long getUnitPrice() 
+    {
+        return unitPrice;
+    }
+    public void setAmount(Long amount) 
+    {
+        this.amount = amount;
+    }
+
+    public Long getAmount() 
+    {
+        return amount;
+    }
+    public void setDataApprovalStatus(String dataApprovalStatus) 
+    {
+        this.dataApprovalStatus = dataApprovalStatus;
+    }
+
+    public String getDataApprovalStatus() 
+    {
+        return dataApprovalStatus;
+    }
+    public void setCreateById(Long createById) 
+    {
+        this.createById = createById;
+    }
+
+    public Long getCreateById() 
+    {
+        return createById;
+    }
+    public void setUpdateById(Long updateById) 
+    {
+        this.updateById = updateById;
+    }
+
+    public Long getUpdateById() 
+    {
+        return updateById;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+    public void setTaskProcessKey(String taskProcessKey) 
+    {
+        this.taskProcessKey = taskProcessKey;
+    }
+
+    public String getTaskProcessKey() 
+    {
+        return taskProcessKey;
+    }
+    public void setTaskNodeKey(String taskNodeKey) 
+    {
+        this.taskNodeKey = taskNodeKey;
+    }
+
+    public String getTaskNodeKey() 
+    {
+        return taskNodeKey;
+    }
+    public void setProcessKey(String processKey) 
+    {
+        this.processKey = processKey;
+    }
+
+    public String getProcessKey() 
+    {
+        return processKey;
+    }
+    public void setLotNumber(String lotNumber) 
+    {
+        this.lotNumber = lotNumber;
+    }
+
+    public String getLotNumber() 
+    {
+        return lotNumber;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("serialNumber", getSerialNumber())
+            .append("buyName", getBuyName())
+            .append("supplierNo", getSupplierNo())
+            .append("useDepartment", getUseDepartment())
+            .append("useDepartmentId", getUseDepartmentId())
+            .append("declarant", getDeclarant())
+            .append("reviewer", getReviewer())
+            .append("reviewerState", getReviewerState())
+            .append("reviewerNotes", getReviewerNotes())
+            .append("approver", getApprover())
+            .append("approverState", getApproverState())
+            .append("approverNoets", getApproverNoets())
+            .append("materielId", getMaterielId())
+            .append("units", getUnits())
+            .append("specification", getSpecification())
+            .append("quantity", getQuantity())
+            .append("unitPrice", getUnitPrice())
+            .append("amount", getAmount())
+            .append("dataApprovalStatus", getDataApprovalStatus())
+            .append("remark", getRemark())
+            .append("createById", getCreateById())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateById", getUpdateById())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("delFlag", getDelFlag())
+            .append("taskProcessKey", getTaskProcessKey())
+            .append("taskNodeKey", getTaskNodeKey())
+            .append("processKey", getProcessKey())
+            .append("lotNumber", getLotNumber())
+            .toString();
+    }
+}

+ 237 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/domain/PurchaseInfo.java

@@ -0,0 +1,237 @@
+package com.zkqy.business.domain;
+
+import com.zkqy.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.zkqy.common.annotation.Excel;
+
+/**
+ * 采购详情对象 purchase_info
+ * 
+ * @author zkqy
+ * @date 2024-04-12
+ */
+public class PurchaseInfo extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 编号 */
+    private Long id;
+
+    /** 采购单编号(用到了) */
+    @Excel(name = "采购单编号", readConverterExp = "用=到了")
+    private String purchaseId;
+
+    /** 供应商编号(用到了) */
+    @Excel(name = "供应商编号", readConverterExp = "用=到了")
+    private String supplierNo;
+
+    /** 物料编号(用到了) */
+    @Excel(name = "物料编号", readConverterExp = "用=到了")
+    private Long materielId;
+
+    /** 单位 */
+    @Excel(name = "单位")
+    private String units;
+
+    /** 规格及代号 */
+    @Excel(name = "规格及代号")
+    private String specification;
+
+    /** 数量/重量 (用到了) */
+    @Excel(name = "数量/重量 ", readConverterExp = "用=到了")
+    private Long quantity;
+
+    /** 单价 */
+    @Excel(name = "单价")
+    private Long unitPrice;
+
+    /** 金额 */
+    @Excel(name = "金额")
+    private Long amount;
+
+    /** 创建者id */
+    @Excel(name = "创建者id")
+    private Long createById;
+
+    /** 更新者id */
+    @Excel(name = "更新者id")
+    private Long updateById;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private String delFlag;
+
+    /** 任务编码 */
+    @Excel(name = "任务编码")
+    private String taskProcessKey;
+
+    /** 任务节点编码 */
+    @Excel(name = "任务节点编码")
+    private String taskNodeKey;
+
+    /** 批号 */
+    @Excel(name = "批号")
+    private String lotNumber;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setPurchaseId(String purchaseId) 
+    {
+        this.purchaseId = purchaseId;
+    }
+
+    public String getPurchaseId() 
+    {
+        return purchaseId;
+    }
+    public void setSupplierNo(String supplierNo) 
+    {
+        this.supplierNo = supplierNo;
+    }
+
+    public String getSupplierNo() 
+    {
+        return supplierNo;
+    }
+    public void setMaterielId(Long materielId) 
+    {
+        this.materielId = materielId;
+    }
+
+    public Long getMaterielId() 
+    {
+        return materielId;
+    }
+    public void setUnits(String units) 
+    {
+        this.units = units;
+    }
+
+    public String getUnits() 
+    {
+        return units;
+    }
+    public void setSpecification(String specification) 
+    {
+        this.specification = specification;
+    }
+
+    public String getSpecification() 
+    {
+        return specification;
+    }
+    public void setQuantity(Long quantity) 
+    {
+        this.quantity = quantity;
+    }
+
+    public Long getQuantity() 
+    {
+        return quantity;
+    }
+    public void setUnitPrice(Long unitPrice) 
+    {
+        this.unitPrice = unitPrice;
+    }
+
+    public Long getUnitPrice() 
+    {
+        return unitPrice;
+    }
+    public void setAmount(Long amount) 
+    {
+        this.amount = amount;
+    }
+
+    public Long getAmount() 
+    {
+        return amount;
+    }
+    public void setCreateById(Long createById) 
+    {
+        this.createById = createById;
+    }
+
+    public Long getCreateById() 
+    {
+        return createById;
+    }
+    public void setUpdateById(Long updateById) 
+    {
+        this.updateById = updateById;
+    }
+
+    public Long getUpdateById() 
+    {
+        return updateById;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+    public void setTaskProcessKey(String taskProcessKey) 
+    {
+        this.taskProcessKey = taskProcessKey;
+    }
+
+    public String getTaskProcessKey() 
+    {
+        return taskProcessKey;
+    }
+    public void setTaskNodeKey(String taskNodeKey) 
+    {
+        this.taskNodeKey = taskNodeKey;
+    }
+
+    public String getTaskNodeKey() 
+    {
+        return taskNodeKey;
+    }
+    public void setLotNumber(String lotNumber) 
+    {
+        this.lotNumber = lotNumber;
+    }
+
+    public String getLotNumber() 
+    {
+        return lotNumber;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("purchaseId", getPurchaseId())
+            .append("supplierNo", getSupplierNo())
+            .append("materielId", getMaterielId())
+            .append("units", getUnits())
+            .append("specification", getSpecification())
+            .append("quantity", getQuantity())
+            .append("unitPrice", getUnitPrice())
+            .append("amount", getAmount())
+            .append("remark", getRemark())
+            .append("createById", getCreateById())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateById", getUpdateById())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("delFlag", getDelFlag())
+            .append("taskProcessKey", getTaskProcessKey())
+            .append("taskNodeKey", getTaskNodeKey())
+            .append("lotNumber", getLotNumber())
+            .toString();
+    }
+}

+ 15 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/domain/vo/MaterialInventoryVo.java

@@ -1,6 +1,7 @@
 package com.zkqy.business.domain.vo;
 
 import com.zkqy.business.domain.MaterialInventory;
+import com.zkqy.common.annotation.Excel;
 
 /**
  * 物料库存对象 material_inventory
@@ -9,7 +10,8 @@ import com.zkqy.business.domain.MaterialInventory;
  * @date 2024-03-07
  */
 public class MaterialInventoryVo extends MaterialInventory {
-    //销售单编号
+
+    //采购单编号
     private String serialNumber;
     //物料名称
     private String materielName;
@@ -19,6 +21,18 @@ public class MaterialInventoryVo extends MaterialInventory {
     private String inboundUnit;
     //规格
     private String specifications;
+    //色号
+    private String colorNumber;
+
+
+
+    public String getColorNumber() {
+        return colorNumber;
+    }
+
+    public void setColorNumber(String colorNumber) {
+        this.colorNumber = colorNumber;
+    }
 
     public String getSerialNumber() {
         return serialNumber;

+ 158 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/domain/vo/PurchaseInfoVo.java

@@ -0,0 +1,158 @@
+package com.zkqy.business.domain.vo;
+
+public class PurchaseInfoVo {
+
+    /**
+     * 采购单编号
+     */
+    private  String purchaseId;
+
+    /**
+     * 母粒id
+     */
+    private  String materielId;
+
+
+    /**
+     * 母粒编码
+     */
+    private  String materielCode;
+
+    /**
+     * 物料名称
+     */
+    private  String materielName;
+
+    /**
+     * 物料种类
+     */
+    private  String materielSpecies;
+
+    /**
+     * 单位
+     */
+    private  String units;
+
+    /**
+     * 价格
+     */
+    private  String specificationModel;
+
+    /**
+     * 母粒编码
+     */
+    private  String materieEncoding;
+
+    /**
+     * 色号
+     */
+    private  String materieColorNumber;
+
+    /**
+     * 材料类型
+     */
+    private  String materielSpeciesName;
+
+    /**
+     * 总金额
+     */
+    private  String totalAmount;
+
+    private  String  quantity;
+
+    public String getMaterielId() {
+        return materielId;
+    }
+
+    public void setMaterielId(String materielId) {
+        this.materielId = materielId;
+    }
+
+    public String getQuantity() {
+        return quantity;
+    }
+
+    public void setQuantity(String quantity) {
+        this.quantity = quantity;
+    }
+
+    public String getPurchaseId() {
+        return purchaseId;
+    }
+
+    public void setPurchaseId(String purchaseId) {
+        this.purchaseId = purchaseId;
+    }
+
+    public String getMaterielCode() {
+        return materielCode;
+    }
+
+    public void setMaterielCode(String materielCode) {
+        this.materielCode = materielCode;
+    }
+
+    public String getMaterielName() {
+        return materielName;
+    }
+
+    public void setMaterielName(String materielName) {
+        this.materielName = materielName;
+    }
+
+    public String getMaterielSpecies() {
+        return materielSpecies;
+    }
+
+    public void setMaterielSpecies(String materielSpecies) {
+        this.materielSpecies = materielSpecies;
+    }
+
+    public String getUnits() {
+        return units;
+    }
+
+    public void setUnits(String units) {
+        this.units = units;
+    }
+
+    public String getSpecificationModel() {
+        return specificationModel;
+    }
+
+    public void setSpecificationModel(String specificationModel) {
+        this.specificationModel = specificationModel;
+    }
+
+    public String getMaterieEncoding() {
+        return materieEncoding;
+    }
+
+    public void setMaterieEncoding(String materieEncoding) {
+        this.materieEncoding = materieEncoding;
+    }
+
+    public String getMaterieColorNumber() {
+        return materieColorNumber;
+    }
+
+    public void setMaterieColorNumber(String materieColorNumber) {
+        this.materieColorNumber = materieColorNumber;
+    }
+
+    public String getMaterielSpeciesName() {
+        return materielSpeciesName;
+    }
+
+    public void setMaterielSpeciesName(String materielSpeciesName) {
+        this.materielSpeciesName = materielSpeciesName;
+    }
+
+    public String getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(String totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+}

+ 7 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/MaterialInventoryMapper.java

@@ -55,6 +55,13 @@ public interface MaterialInventoryMapper
      */
     public int updateMaterialInventory(MaterialInventory materialInventory);
 
+    /**
+     * 更新库存信息
+     * @param materialInventory
+     * @return
+     */
+    public int updateMaterialInventoryByMaterialId(MaterialInventory materialInventory);
+
     /**
      * 删除物料库存
      * 

+ 1 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/OutboundRecordsMapper.java

@@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
  * @author zkqy
  * @date 2024-03-08
  */
-
+@Mapper
 public interface OutboundRecordsMapper 
 {
     /**

+ 72 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/PurchaseInfoMapper.java

@@ -0,0 +1,72 @@
+package com.zkqy.business.mapper;
+
+import java.util.List;
+import com.zkqy.business.domain.PurchaseInfo;
+import com.zkqy.business.domain.vo.PurchaseInfoVo;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 采购详情Mapper接口
+ * 
+ * @author zkqy
+ * @date 2024-04-12
+ */
+@Mapper
+public interface PurchaseInfoMapper 
+{
+    /**
+     * 查询采购详情
+     * 
+     * @param id 采购详情主键
+     * @return 采购详情
+     */
+    public PurchaseInfo selectPurchaseInfoById(Long id);
+
+    /**
+     * 查询采购详情列表
+     * 
+     * @param purchaseInfo 采购详情
+     * @return 采购详情集合
+     */
+    public List<PurchaseInfo> selectPurchaseInfoList(PurchaseInfo purchaseInfo);
+
+    /**
+     * 查询采购详情列表
+     *
+     * @param purchaseInfo 采购详情
+     * @return 采购详情集合
+     */
+    public List<PurchaseInfoVo> selectPurchaseInfoListAndPurchaseAndMaterial(PurchaseInfo purchaseInfo);
+
+    /**
+     * 新增采购详情
+     * 
+     * @param purchaseInfo 采购详情
+     * @return 结果
+     */
+    public int insertPurchaseInfo(PurchaseInfo purchaseInfo);
+
+    /**
+     * 修改采购详情
+     * 
+     * @param purchaseInfo 采购详情
+     * @return 结果
+     */
+    public int updatePurchaseInfo(PurchaseInfo purchaseInfo);
+
+    /**
+     * 删除采购详情
+     * 
+     * @param id 采购详情主键
+     * @return 结果
+     */
+    public int deletePurchaseInfoById(Long id);
+
+    /**
+     * 批量删除采购详情
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deletePurchaseInfoByIds(Long[] ids);
+}

+ 63 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/PurchaseMapper.java

@@ -0,0 +1,63 @@
+package com.zkqy.business.mapper;
+
+import java.util.List;
+import com.zkqy.business.domain.Purchase;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 采购Mapper接口
+ * 
+ * @author zkqy
+ * @date 2024-04-12
+ */
+@Mapper
+public interface PurchaseMapper 
+{
+    /**
+     * 查询采购
+     * 
+     * @param id 采购主键
+     * @return 采购
+     */
+    public Purchase selectPurchaseById(String id);
+
+    /**
+     * 查询采购列表
+     * 
+     * @param purchase 采购
+     * @return 采购集合
+     */
+    public List<Purchase> selectPurchaseList(Purchase purchase);
+
+    /**
+     * 新增采购
+     * 
+     * @param purchase 采购
+     * @return 结果
+     */
+    public int insertPurchase(Purchase purchase);
+
+    /**
+     * 修改采购
+     * 
+     * @param purchase 采购
+     * @return 结果
+     */
+    public int updatePurchase(Purchase purchase);
+
+    /**
+     * 删除采购
+     * 
+     * @param id 采购主键
+     * @return 结果
+     */
+    public int deletePurchaseById(String id);
+
+    /**
+     * 批量删除采购
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deletePurchaseByIds(String[] ids);
+}

+ 13 - 3
zkqy-custom-business/src/main/java/com/zkqy/business/service/IMaterialInventoryService.java

@@ -2,6 +2,8 @@ package com.zkqy.business.service;
 
 import java.util.List;
 import com.zkqy.business.domain.MaterialInventory;
+import com.zkqy.business.domain.vo.MaterialInventoryVo;
+import com.zkqy.common.core.domain.AjaxResult;
 import org.apache.ibatis.annotations.Param;
 
 /**
@@ -29,12 +31,20 @@ public interface IMaterialInventoryService
     public List<MaterialInventory> selectMaterialInventoryList(MaterialInventory materialInventory);
 
     /**
-     * 新增物料库存
+     * 入库
      * 
-     * @param materialInventory 物料库存
+     * @param materialInventoryVo 物料库存
      * @return 结果
      */
-    public int insertMaterialInventory(MaterialInventory materialInventory);
+    public AjaxResult insertMaterialInventory(MaterialInventoryVo materialInventoryVo);
+
+
+    /**
+     * 出库
+     * @param materialInventoryVo
+     * @return
+     */
+    public AjaxResult outMaterialInventory(MaterialInventoryVo materialInventoryVo);
 
     /**
      * 修改物料库存

+ 71 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/IPurchaseInfoService.java

@@ -0,0 +1,71 @@
+package com.zkqy.business.service;
+
+import java.util.List;
+import com.zkqy.business.domain.PurchaseInfo;
+import com.zkqy.business.domain.vo.PurchaseInfoVo;
+
+/**
+ * 采购详情Service接口
+ * 
+ * @author zkqy
+ * @date 2024-04-12
+ */
+public interface IPurchaseInfoService 
+{
+    /**
+     * 查询采购详情
+     * 
+     * @param id 采购详情主键
+     * @return 采购详情
+     */
+    public PurchaseInfo selectPurchaseInfoById(Long id);
+
+    /**
+     * 查询采购详情列表
+     * 
+     * @param purchaseInfo 采购详情
+     * @return 采购详情集合
+     */
+    public List<PurchaseInfo> selectPurchaseInfoList(PurchaseInfo purchaseInfo);
+
+    /**
+     * 查询采购详情列表
+     *
+     * @param purchaseInfo 采购详情
+     * @return 采购详情集合
+     */
+    public List<PurchaseInfoVo> selectPurchaseInfoListAndPurchaseAndMaterial(PurchaseInfo purchaseInfo);
+
+
+    /**
+     * 新增采购详情
+     * 
+     * @param purchaseInfo 采购详情
+     * @return 结果
+     */
+    public int insertPurchaseInfo(PurchaseInfo purchaseInfo);
+
+    /**
+     * 修改采购详情
+     * 
+     * @param purchaseInfo 采购详情
+     * @return 结果
+     */
+    public int updatePurchaseInfo(PurchaseInfo purchaseInfo);
+
+    /**
+     * 批量删除采购详情
+     * 
+     * @param ids 需要删除的采购详情主键集合
+     * @return 结果
+     */
+    public int deletePurchaseInfoByIds(Long[] ids);
+
+    /**
+     * 删除采购详情信息
+     * 
+     * @param id 采购详情主键
+     * @return 结果
+     */
+    public int deletePurchaseInfoById(Long id);
+}

+ 61 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/IPurchaseService.java

@@ -0,0 +1,61 @@
+package com.zkqy.business.service;
+
+import java.util.List;
+import com.zkqy.business.domain.Purchase;
+
+/**
+ * 采购Service接口
+ * 
+ * @author zkqy
+ * @date 2024-04-12
+ */
+public interface IPurchaseService 
+{
+    /**
+     * 查询采购
+     * 
+     * @param id 采购主键
+     * @return 采购
+     */
+    public Purchase selectPurchaseById(String id);
+
+    /**
+     * 查询采购列表
+     * 
+     * @param purchase 采购
+     * @return 采购集合
+     */
+    public List<Purchase> selectPurchaseList(Purchase purchase);
+
+    /**
+     * 新增采购
+     * 
+     * @param purchase 采购
+     * @return 结果
+     */
+    public int insertPurchase(Purchase purchase);
+
+    /**
+     * 修改采购
+     * 
+     * @param purchase 采购
+     * @return 结果
+     */
+    public int updatePurchase(Purchase purchase);
+
+    /**
+     * 批量删除采购
+     * 
+     * @param ids 需要删除的采购主键集合
+     * @return 结果
+     */
+    public int deletePurchaseByIds(String[] ids);
+
+    /**
+     * 删除采购信息
+     * 
+     * @param id 采购主键
+     * @return 结果
+     */
+    public int deletePurchaseById(String id);
+}

+ 1 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/InboundRecordsServiceImpl.java

@@ -51,6 +51,7 @@ public class InboundRecordsServiceImpl implements IInboundRecordsService {
      */
     @Override
     public int insertInboundRecords(InboundRecords inboundRecords) {
+
         inboundRecords.setCreateTime(DateUtils.getNowDate());
         return inboundRecordsMapper.insertInboundRecords(inboundRecords);
     }

+ 201 - 13
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/MaterialInventoryServiceImpl.java

@@ -1,14 +1,25 @@
 package com.zkqy.business.service.impl;
 
+import java.util.Date;
 import java.util.List;
+import java.util.UUID;
 
+import com.zkqy.business.domain.InboundRecords;
+import com.zkqy.business.domain.Materiel;
+import com.zkqy.business.domain.OutboundRecords;
+import com.zkqy.business.domain.vo.MaterialInventoryVo;
 import com.zkqy.business.mapper.InboundRecordsMapper;
+import com.zkqy.business.mapper.MaterielMapper;
+import com.zkqy.business.mapper.OutboundRecordsMapper;
+import com.zkqy.common.core.domain.AjaxResult;
 import com.zkqy.common.utils.DateUtils;
+import com.zkqy.common.utils.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.zkqy.business.mapper.MaterialInventoryMapper;
 import com.zkqy.business.domain.MaterialInventory;
 import com.zkqy.business.service.IMaterialInventoryService;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 物料库存Service业务层处理
@@ -21,8 +32,197 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
 {
     @Autowired
     private MaterialInventoryMapper materialInventoryMapper;
+
     @Autowired
     private InboundRecordsMapper inboundRecordsMapper;
+
+    @Autowired
+    private OutboundRecordsMapper outboundRecordsMapper;
+
+    @Autowired
+    private MaterielMapper materielMapper;
+    /**
+     * 入库
+     *
+     * @param materialInventoryVo 物料库存
+     * @return 结果
+     */
+    @Override
+    @Transactional
+    public AjaxResult insertMaterialInventory(MaterialInventoryVo materialInventoryVo)
+    {
+        //创建时间
+        materialInventoryVo.setCreateTime(DateUtils.getNowDate());
+        //1、如果有证明当前这个批次的码已经被扫过了
+        InboundRecords inboundRecords = inboundRecordsMapper.selectInboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
+        if (inboundRecords != null) {
+            return  AjaxResult.error("二维码不可以重复扫描,请从新生成相关批号的二维码信息");
+        }
+        //2、判断是第一次入库还是第二次入库这个同类商品(这是一个连表语句)(同一个批次查询)
+        InboundRecords inboundRecords1=new InboundRecords();
+        inboundRecords1.setLotNumber(materialInventoryVo.getLotNumber());
+        inboundRecords1.setMaterielId(materialInventoryVo.getMaterialId());
+        List<InboundRecords> inboundRecords2 = inboundRecordsMapper.selectInboundRecordsList(inboundRecords1);
+        //3、判断是走新增还是修改
+        int count = 0;
+        if(inboundRecords2.size()>0){
+            //已经入过库存了,绝对会有这个信息
+            MaterialInventory materialInventory=new MaterialInventory();
+            materialInventory.setMaterialId(materialInventoryVo.getMaterialId());
+            List<MaterialInventory> materialInventories = materialInventoryMapper.selectMaterialInventoryList(materialInventory);
+            if(materialInventories.size()>0){
+                //没更新的物料信息
+                MaterialInventory oldMaterialInventory   = materialInventories.get(0);
+                //更新物料信息数量
+                oldMaterialInventory.setQuantity(oldMaterialInventory.getQuantity()+materialInventoryVo.getQuantity());
+                //执行更新操作
+                count = materialInventoryMapper.updateMaterialInventory(oldMaterialInventory);
+            }
+        //没有入过库走新增操作
+        }else {
+            MaterialInventory materialInventoryObj = new MaterialInventory();
+            materialInventoryObj.setStockNumber(String.valueOf(new Date().getTime()));//库存编号
+            materialInventoryObj.setWarehouseEntryNumber(UUID.randomUUID().toString());//入库单编号
+            materialInventoryObj.setMaterialCode(materialInventoryVo.getMaterialCode());//物料编号
+            materialInventoryObj.setQuantity(materialInventoryVo.getQuantity());//数量
+            materialInventoryObj.setCreateById(SecurityUtils.getUserId());
+            materialInventoryObj.setLotNumber(materialInventoryVo.getLotNumber());//批号
+            materialInventoryObj.setMaterialId(materialInventoryVo.getMaterialId());//物料id
+            materialInventoryObj.setCreateTime(new Date());
+            count = materialInventoryMapper.insertMaterialInventory(materialInventoryObj);
+        }
+        if(count>0){
+            InboundRecords inboundRecords3 = new InboundRecords();
+            inboundRecords3.setInboundTime(new Date());//入库时间
+            //物料名称需要根据物料编码查询下
+            Materiel materiel = materielMapper.selectMaterielById(Long.valueOf(materialInventoryVo.getMaterialId()));
+            inboundRecords3.setInboundAterialsName(materiel.getMaterielName());//物料名称
+            inboundRecords3.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
+            inboundRecords3.setInboundUnit(materialInventoryVo.getInboundUnit());//单位
+            inboundRecords3.setInboundQuantity(materialInventoryVo.getQuantity().toString());//入库数量
+            inboundRecords3.setInboundLeader(SecurityUtils.getUsername());//仓管员
+            inboundRecords3.setCreateById(SecurityUtils.getUserId());//创建人
+            inboundRecords3.setCreateTime(new Date());//创建时间
+            inboundRecords3.setLotNumber(materialInventoryVo.getLotNumber());//批号
+            inboundRecords3.setMaterielId(materialInventoryVo.getMaterialId());//母粒id
+            inboundRecords3.setQtCodeNumber(materialInventoryVo.getQtCodeNumber());//二维码唯一编码
+            inboundRecordsMapper.insertInboundRecords(inboundRecords3); //插入入库日志信息
+            return  AjaxResult.success("入库成功");
+        }
+        return  AjaxResult.error("入库失败");
+     //   String replace = materialInventoryVo.getQtCodeNumber().replace("/r", "");
+//        materialInventoryVo.setQtCodeNumber(replace);
+//        //1、禁止重复入库
+//        InboundRecords inboundRecords = inboundRecordsMapper.selectInboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
+//        if (inboundRecords != null) {
+//            return AjaxResult.success("不可以重复扫码入库");
+//        }
+//        //2、判断是第一次入库还是第二次入库这个同类商品(这是一个连表语句)
+//        MaterialInventory materialInventory
+//                = materialInventoryService.selectMaterialInventoryByMaterialCodeAndSpecifications(materialInventoryVo.getMaterialCode(), materialInventoryVo.getSpecifications());
+//        int count = 0;
+//        if (materialInventory != null) { //证明已经入库过相同的产品了---库存叠加操作
+//            Double quantityOld = materialInventory.getQuantity();
+//            Double quantity = materialInventoryVo.getQuantity();
+//            Double newQuantity =quantityOld+quantity;
+//            materialInventory.setQuantity(newQuantity);
+//            materialInventory.setUpdateTime(new Date());
+//            materialInventory.setUpdateById(SecurityUtils.getUserId());
+//            count = materialInventoryService.updateMaterialInventory(materialInventory);
+//        } else { //第一次入库走插入操作) ()
+//            MaterialInventory materialInventoryObj = new MaterialInventory();
+//            materialInventoryObj.setStockNumber(String.valueOf(new Date().getTime()));//库存编号
+//            materialInventoryObj.setWarehouseEntryNumber(UUID.randomUUID().toString());//入库单编号
+//            materialInventoryObj.setMaterialCode(materialInventoryVo.getMaterialCode());//物料编号
+//            materialInventoryObj.setQuantity(materialInventoryVo.getQuantity());//数量
+//            materialInventoryObj.setCreateById(SecurityUtils.getUserId());
+//            materialInventoryObj.setCreateTime(new Date());
+//            count = materialInventoryService.insertMaterialInventory(materialInventoryObj);
+//        }
+//        if (count > 0) {
+//            InboundRecords inboundRecords1 = new InboundRecords();
+//            inboundRecords1.setInboundTime(new Date());//入库时间
+//            //物料名称需要根据物料编码查询下
+//            Materiel materiel = materielMapper.selectMaterielByMaterielCode(materialInventoryVo.getMaterialCode());
+//            inboundRecords1.setInboundAterialsName(materiel.getMaterielName());//物料名称
+//            inboundRecords1.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
+//            inboundRecords1.setInboundUnit(materialInventoryVo.getInboundUnit());//单位
+//            inboundRecords1.setInboundQuantity(materialInventoryVo.getQuantity().toString());//入库数量
+//            inboundRecords1.setInboundLeader(SecurityUtils.getUsername());//仓管员
+//            inboundRecords1.setCreateById(SecurityUtils.getUserId());//创建人
+//            inboundRecords1.setCreateTime(new Date());//创建时间
+//            inboundRecords1.setQtCodeNumber(materialInventoryVo.getQtCodeNumber());
+//            inboundRecordsMapper.insertInboundRecords(inboundRecords1); //插入入库日志信息
+//            return AjaxResult.success("入库成功");
+//        }
+//        return AjaxResult.error("入库失败");
+    }
+
+    /**
+     * 出库
+     *
+     * @param materialInventoryVo 物料库存
+     * @return 结果
+     */
+    @Override
+    @Transactional
+    public AjaxResult outMaterialInventory(MaterialInventoryVo materialInventoryVo)
+    {
+          materialInventoryVo.setCreateTime(DateUtils.getNowDate());
+          //1、没有对应的入库记录
+          InboundRecords inboundRecords = inboundRecordsMapper.selectInboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
+          if (inboundRecords == null) {
+                return AjaxResult.error("此货品还没有入库,不能出库");
+          }
+          //2、二维码是否重复使用
+//          OutboundRecords outboundRecords = outboundRecordsMapper.selectOutboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
+//          if (outboundRecords != null) {
+//                return"此货品不能重复出库";
+//          }
+         //3、根据物料编码跟规则查询库存信息
+          MaterialInventory materialInventory=new MaterialInventory();
+          materialInventory.setMaterialId(materialInventoryVo.getMaterialId());
+          List<MaterialInventory> materialInventories = materialInventoryMapper.selectMaterialInventoryList(materialInventory);
+          if(materialInventories.size()>0){
+              Double oldQuantity = materialInventories.get(0).getQuantity();
+              if(materialInventoryVo.getQuantity()>oldQuantity){
+                  return AjaxResult.error("库存不足"+materialInventoryVo.getQuantity()+"个");
+              }
+              Double outboundQuantity = materialInventoryVo.getQuantity();
+              //出库后剩余数量
+              Double newQuantity =oldQuantity-outboundQuantity;
+              //更新数量
+              MaterialInventory doubleMaterialInventory = new MaterialInventory();
+              doubleMaterialInventory.setQuantity(newQuantity);
+              doubleMaterialInventory.setMaterialId(materialInventoryVo.getMaterialId());
+              //执行sql语句
+              int count = materialInventoryMapper.updateMaterialInventoryByMaterialId(doubleMaterialInventory);
+              //代表出库成功
+              if(count>0){
+                    OutboundRecords outboundRecords1 = new OutboundRecords();
+                    outboundRecords1.setOutboundTime(new Date());//出库时间
+                    //物料名称需要根据物料编码查询下
+                    Materiel materiel = materielMapper.selectMaterielById(Long.valueOf(materialInventoryVo.getMaterialId()));
+                    outboundRecords1.setQtCodeNumber(materialInventoryVo.getQtCodeNumber());
+                    outboundRecords1.setOutboundAterialsName(materiel.getMaterielName());//物料名称
+                    outboundRecords1.setOutboundNo(UUID.randomUUID().toString());//出库编号
+                    outboundRecords1.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
+                    outboundRecords1.setOutboundUnit(materialInventoryVo.getInboundUnit());//单位
+                    outboundRecords1.setOutboundQuantity(materialInventoryVo.getQuantity().toString());//出库数量
+                    outboundRecords1.setOutboundLeader(SecurityUtils.getUsername());//仓管员
+                    outboundRecords1.setCreateById(SecurityUtils.getUserId());//创建人
+                    outboundRecords1.setCreateTime(new Date());//创建时间
+                    outboundRecords1.setLotNumber(materialInventoryVo.getLotNumber());//批号
+                    outboundRecords1.setQtCodeNumber(materialInventoryVo.getQtCodeNumber());//二维码
+                    outboundRecords1.setMaterielId(materialInventoryVo.getMaterialId());//母粒iD
+                    outboundRecordsMapper.insertOutboundRecords(outboundRecords1); //插出库库日志信息
+                    return AjaxResult.success("出库成功");
+              }
+          }
+        return AjaxResult.error("出库失败");
+    }
+
+
     /**
      * 查询物料库存
      * 
@@ -47,19 +247,7 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
         return materialInventoryMapper.selectMaterialInventoryList(materialInventory);
     }
 
-    /**
-     * 新增物料库存
-     * 
-     * @param materialInventory 物料库存
-     * @return 结果
-     */
-    @Override
-    public int insertMaterialInventory(MaterialInventory materialInventory)
-    {
-        materialInventory.setCreateTime(DateUtils.getNowDate());
-        //查询二维码是否被使用过了
-        return materialInventoryMapper.insertMaterialInventory(materialInventory);
-    }
+
 
     /**
      * 修改物料库存

+ 1 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/OutboundRecordsServiceImpl.java

@@ -9,7 +9,7 @@ import com.zkqy.business.domain.OutboundRecords;
 import com.zkqy.business.service.IOutboundRecordsService;
 
 /**
- * 出库记录Service业务层处理
+ * 原材料出库记录Service业务层处理
  * 
  * @author zkqy
  * @date 2024-03-08

+ 109 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/PurchaseInfoServiceImpl.java

@@ -0,0 +1,109 @@
+package com.zkqy.business.service.impl;
+
+import java.util.List;
+
+import com.zkqy.business.domain.vo.PurchaseInfoVo;
+import com.zkqy.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.zkqy.business.mapper.PurchaseInfoMapper;
+import com.zkqy.business.domain.PurchaseInfo;
+import com.zkqy.business.service.IPurchaseInfoService;
+
+/**
+ * 采购详情Service业务层处理
+ * 
+ * @author zkqy
+ * @date 2024-04-12
+ */
+@Service
+public class PurchaseInfoServiceImpl implements IPurchaseInfoService 
+{
+    @Autowired
+    private PurchaseInfoMapper purchaseInfoMapper;
+
+    /**
+     * 查询采购详情
+     * 
+     * @param id 采购详情主键
+     * @return 采购详情
+     */
+    @Override
+    public PurchaseInfo selectPurchaseInfoById(Long id)
+    {
+        return purchaseInfoMapper.selectPurchaseInfoById(id);
+    }
+
+    /**
+     * 查询采购详情列表
+     * 
+     * @param purchaseInfo 采购详情
+     * @return 采购详情
+     */
+    @Override
+    public List<PurchaseInfo> selectPurchaseInfoList(PurchaseInfo purchaseInfo)
+    {
+        return purchaseInfoMapper.selectPurchaseInfoList(purchaseInfo);
+    }
+
+    /**
+     * 查询这个采购单的具体产品
+     * @param purchaseInfo 采购详情
+     * @return
+     */
+    @Override
+    public List<PurchaseInfoVo> selectPurchaseInfoListAndPurchaseAndMaterial(PurchaseInfo purchaseInfo) {
+        List<PurchaseInfoVo> purchaseInfos = purchaseInfoMapper.selectPurchaseInfoListAndPurchaseAndMaterial(purchaseInfo);
+        return purchaseInfos;
+    }
+
+    /**
+     * 新增采购详情
+     * 
+     * @param purchaseInfo 采购详情
+     * @return 结果
+     */
+    @Override
+    public int insertPurchaseInfo(PurchaseInfo purchaseInfo)
+    {
+        purchaseInfo.setCreateTime(DateUtils.getNowDate());
+        return purchaseInfoMapper.insertPurchaseInfo(purchaseInfo);
+    }
+
+    /**
+     * 修改采购详情
+     * 
+     * @param purchaseInfo 采购详情
+     * @return 结果
+     */
+    @Override
+    public int updatePurchaseInfo(PurchaseInfo purchaseInfo)
+    {
+        purchaseInfo.setUpdateTime(DateUtils.getNowDate());
+        return purchaseInfoMapper.updatePurchaseInfo(purchaseInfo);
+    }
+
+    /**
+     * 批量删除采购详情
+     * 
+     * @param ids 需要删除的采购详情主键
+     * @return 结果
+     */
+    @Override
+    public int deletePurchaseInfoByIds(Long[] ids)
+    {
+        return purchaseInfoMapper.deletePurchaseInfoByIds(ids);
+    }
+
+    /**
+     * 删除采购详情信息
+     * 
+     * @param id 采购详情主键
+     * @return 结果
+     */
+    @Override
+    public int deletePurchaseInfoById(Long id)
+    {
+        return purchaseInfoMapper.deletePurchaseInfoById(id);
+    }
+}

+ 97 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/PurchaseServiceImpl.java

@@ -0,0 +1,97 @@
+package com.zkqy.business.service.impl;
+
+import java.util.List;
+import com.zkqy.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.zkqy.business.mapper.PurchaseMapper;
+import com.zkqy.business.domain.Purchase;
+import com.zkqy.business.service.IPurchaseService;
+
+/**
+ * 采购Service业务层处理
+ * 
+ * @author zkqy
+ * @date 2024-04-12
+ */
+@Service
+public class PurchaseServiceImpl implements IPurchaseService 
+{
+
+    @Autowired
+    private PurchaseMapper purchaseMapper;
+
+    /**
+     * 查询采购
+     * 
+     * @param id 采购主键
+     * @return 采购
+     */
+    @Override
+    public Purchase selectPurchaseById(String id)
+    {
+        return purchaseMapper.selectPurchaseById(id);
+    }
+
+    /**
+     * 查询采购列表
+     * 
+     * @param purchase 采购
+     * @return 采购
+     */
+    @Override
+    public List<Purchase> selectPurchaseList(Purchase purchase)
+    {
+        return purchaseMapper.selectPurchaseList(purchase);
+    }
+
+    /**
+     * 新增采购
+     * 
+     * @param purchase 采购
+     * @return 结果
+     */
+    @Override
+    public int insertPurchase(Purchase purchase)
+    {
+        purchase.setCreateTime(DateUtils.getNowDate());
+        return purchaseMapper.insertPurchase(purchase);
+    }
+
+    /**
+     * 修改采购
+     * 
+     * @param purchase 采购
+     * @return 结果
+     */
+    @Override
+    public int updatePurchase(Purchase purchase)
+    {
+        purchase.setUpdateTime(DateUtils.getNowDate());
+        return purchaseMapper.updatePurchase(purchase);
+    }
+
+    /**
+     * 批量删除采购
+     * 
+     * @param ids 需要删除的采购主键
+     * @return 结果
+     */
+    @Override
+    public int deletePurchaseByIds(String[] ids)
+    {
+        return purchaseMapper.deletePurchaseByIds(ids);
+    }
+
+    /**
+     * 删除采购信息
+     * 
+     * @param id 采购主键
+     * @return 结果
+     */
+    @Override
+    public int deletePurchaseById(String id)
+    {
+        return purchaseMapper.deletePurchaseById(id);
+    }
+}

+ 3 - 0
zkqy-custom-business/src/main/resources/mapper/business/InboundRecordsMapper.xml

@@ -62,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="inboundPresenter != null  and inboundPresenter != ''"> and inbound_presenter = #{inboundPresenter}</if>
             <if test="inboundLeader != null  and inboundLeader != ''"> and inbound_leader = #{inboundLeader}</if>
             <if test="materielId != null  and materielId != ''"> and materiel_id = #{materielId}</if>
+            <if test="lotNumber != null  and lotNumber != ''"> and lot_number = #{lotNumber}</if>
             <if test="serialNumber != null  and serialNumber != ''"> and serialNumber = #{serialNumber}</if>
             <if test="createById != null "> and create_by_id = #{createById}</if>
             <if test="updateById != null "> and update_by_id = #{updateById}</if>
@@ -113,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="taskProcessKey != null">task_process_key,</if>
             <if test="taskNodeKey != null">task_node_key,</if>
             <if test="qtCodeNumber != null">qtCodeNumber,</if>
+            <if test="lotNumber != null">lot_number,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="inboundUnitName != null">#{inboundUnitName},</if>
@@ -144,6 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="taskProcessKey != null">#{taskProcessKey},</if>
             <if test="taskNodeKey != null">#{taskNodeKey},</if>
             <if test="qtCodeNumber != null">#{qtCodeNumber},</if>
+            <if test="lotNumber != null">#{lotNumber},</if>
          </trim>
     </insert>
 

+ 30 - 0
zkqy-custom-business/src/main/resources/mapper/business/MaterialInventoryMapper.xml

@@ -78,6 +78,8 @@
                 #{warehouseEntryNumber}
             </if>
             <if test="materialCode != null  and materialCode != ''">and material_code = #{materialCode}</if>
+            <if test="materialId != null  and materialId != ''">and material_id = #{materialId}</if>
+            <if test="lotNumber != null  and lotNumber != ''">and lot_number = #{lotNumber}</if>
             <if test="subordinateUnit != null ">and subordinate_unit = #{subordinateUnit}</if>
             <if test="quantity != null ">and quantity = #{quantity}</if>
             <if test="warehouseNo != null  and warehouseNo != ''">and warehouse_no = #{warehouseNo}</if>
@@ -140,6 +142,8 @@
             <if test="createTime != null">create_time,</if>
             <if test="taskProcessKey != null">task_process_key,</if>
             <if test="taskNodeKey != null">task_node_key,</if>
+            <if test="lotNumber != null">lot_number,</if>
+            <if test="materialId != null">material_id,</if>
             del_flag
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -156,6 +160,8 @@
             <if test="createTime != null">#{createTime},</if>
             <if test="taskProcessKey != null">#{taskProcessKey},</if>
             <if test="taskNodeKey != null">#{taskNodeKey},</if>
+            <if test="lotNumber != null">#{lotNumber},</if>
+            <if test="materialId != null">#{materialId},</if>
             '0'
         </trim>
     </insert>
@@ -166,6 +172,7 @@
             <if test="stockNumber != null">stock_number = #{stockNumber},</if>
             <if test="warehouseEntryNumber != null">warehouse_entry_number = #{warehouseEntryNumber},</if>
             <if test="materialCode != null">material_code = #{materialCode},</if>
+            <if test="materialId != null">material_id = #{materialId},</if>
             <if test="subordinateUnit != null">subordinate_unit = #{subordinateUnit},</if>
             <if test="quantity != null">quantity = #{quantity},</if>
             <if test="warehouseNo != null">warehouse_no = #{warehouseNo},</if>
@@ -184,6 +191,29 @@
         where id = #{id}
     </update>
 
+    <update id="updateMaterialInventoryByMaterialId" parameterType="com.zkqy.business.domain.MaterialInventory">
+        update {DBNAME}.material_inventory
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="stockNumber != null">stock_number = #{stockNumber},</if>
+            <if test="warehouseEntryNumber != null">warehouse_entry_number = #{warehouseEntryNumber},</if>
+            <if test="materialCode != null">material_code = #{materialCode},</if>
+            <if test="subordinateUnit != null">subordinate_unit = #{subordinateUnit},</if>
+            <if test="quantity != null">quantity = #{quantity},</if>
+            <if test="warehouseNo != null">warehouse_no = #{warehouseNo},</if>
+            <if test="regionNo != null">region_no = #{regionNo},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="createById != null">create_by_id = #{createById},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateById != null">update_by_id = #{updateById},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
+            <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
+        </trim>
+        where material_id = #{materialId}
+    </update>
     <delete id="deleteMaterialInventoryById" parameterType="Long">
         delete
         from {DBNAME}.material_inventory

+ 4 - 0
zkqy-custom-business/src/main/resources/mapper/business/OutboundRecordsMapper.xml

@@ -100,6 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="taskProcessKey != null">task_process_key,</if>
             <if test="taskNodeKey != null">task_node_key,</if>
             <if test="qtCodeNumber != null">qtCodeNumber,</if>
+            <if test="lotNumber != null">lot_number,</if>
+            <if test="materielId != null">materiel_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="outboundNo != null">#{outboundNo},</if>
@@ -128,6 +130,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="taskProcessKey != null">#{taskProcessKey},</if>
             <if test="taskNodeKey != null">#{taskNodeKey},</if>
             <if test="qtCodeNumber != null">#{qtCodeNumber},</if>
+            <if test="lotNumber != null">#{lotNumber},</if>
+            <if test="materielId != null">#{materielId},</if>
          </trim>
     </insert>
 

+ 176 - 0
zkqy-custom-business/src/main/resources/mapper/business/PurchaseInfoMapper.xml

@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zkqy.business.mapper.PurchaseInfoMapper">
+    
+    <resultMap type="com.zkqy.business.domain.PurchaseInfo" id="PurchaseInfoResult">
+        <result property="id"    column="id"    />
+        <result property="purchaseId"    column="purchase_id"    />
+        <result property="supplierNo"    column="supplier_no"    />
+        <result property="materielId"    column="materiel_id"    />
+        <result property="units"    column="units"    />
+        <result property="specification"    column="specification"    />
+        <result property="quantity"    column="quantity"    />
+        <result property="unitPrice"    column="unit_price"    />
+        <result property="amount"    column="amount"    />
+        <result property="remark"    column="remark"    />
+        <result property="createById"    column="create_by_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateById"    column="update_by_id"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="taskProcessKey"    column="task_process_key"    />
+        <result property="taskNodeKey"    column="task_node_key"    />
+        <result property="lotNumber"    column="lot_number"    />
+    </resultMap>
+
+    <resultMap type="com.zkqy.business.domain.vo.PurchaseInfoVo" id="PurchaseInfoResultVo">
+        <result property="purchaseId"    column="purchase_id"    />
+        <result property="materielCode"    column="materiel_code"    />
+        <result property="materielId"    column="materiel_id" />
+        <result property="materielName"    column="materiel_name"    />
+        <result property="materielSpecies"    column="materiel_species"    />
+        <result property="units"    column="units"    />
+        <result property="specificationModel"    column="specification_model"/>
+        <result property="materieEncoding"    column="materie_encoding"/>
+        <result property="materieColorNumber"    column="materie_color_number"/>
+        <result property="materielSpeciesName"    column="dict_label"/>
+        <result property="quantity"   column="quantity"/>
+    </resultMap>
+
+    <sql id="selectPurchaseInfoVo">
+        select id, purchase_id, supplier_no, materiel_id, units, specification, quantity, unit_price, amount, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, task_process_key, task_node_key, lot_number from purchase_info
+    </sql>
+
+    <select id="selectPurchaseInfoList" parameterType="com.zkqy.business.domain.PurchaseInfo" resultMap="PurchaseInfoResult">
+        <include refid="selectPurchaseInfoVo"/>
+        <where>  
+            <if test="purchaseId != null  and purchaseId != ''"> and purchase_id = #{purchaseId}</if>
+            <if test="supplierNo != null  and supplierNo != ''"> and supplier_no = #{supplierNo}</if>
+            <if test="materielId != null "> and materiel_id = #{materielId}</if>
+            <if test="units != null  and units != ''"> and units = #{units}</if>
+            <if test="specification != null  and specification != ''"> and specification = #{specification}</if>
+            <if test="quantity != null "> and quantity = #{quantity}</if>
+            <if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
+            <if test="amount != null "> and amount = #{amount}</if>
+            <if test="createById != null "> and create_by_id = #{createById}</if>
+            <if test="updateById != null "> and update_by_id = #{updateById}</if>
+            <if test="taskProcessKey != null  and taskProcessKey != ''"> and task_process_key = #{taskProcessKey}</if>
+            <if test="taskNodeKey != null  and taskNodeKey != ''"> and task_node_key = #{taskNodeKey}</if>
+            <if test="lotNumber != null  and lotNumber != ''"> and lot_number = #{lotNumber}</if>
+        </where>
+    </select>
+    
+    <select id="selectPurchaseInfoById" parameterType="Long" resultMap="PurchaseInfoResult">
+        <include refid="selectPurchaseInfoVo"/>
+        where id = #{id}
+    </select>
+
+    <select id="selectPurchaseInfoListAndPurchaseAndMaterial"
+            resultMap="PurchaseInfoResultVo" parameterType="com.zkqy.business.domain.PurchaseInfo">
+        SELECT
+            p.purchase_id AS purchase_id,
+            m.materiel_code AS materiel_code,
+            m.id as  materiel_id,
+            m.materiel_name AS materiel_name,
+            m.materiel_species as materiel_species,
+            m.units as units,
+            m.specification_model as specification_model,
+            m.materie_encoding as materie_encoding,
+            m.materie_color_number as materie_color_number,
+            sdd.dict_label as dict_label,
+            p.quantity as `quantity`
+        FROM
+            {DBNAME}.purchase_info AS p
+                INNER JOIN {DBNAME}.materiel AS m ON (
+                p.materiel_id = m.id)
+                inner join {DBNAME}.sys_dict_data  as sdd on(sdd.dict_value=m.materiel_species)
+        where sdd.dict_type='sys_materiel_species' and  purchase_id=#{purchaseId}
+    </select>
+
+    <insert id="insertPurchaseInfo" parameterType="com.zkqy.business.domain.PurchaseInfo" useGeneratedKeys="true" keyProperty="id">
+        insert into purchase_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="purchaseId != null">purchase_id,</if>
+            <if test="supplierNo != null">supplier_no,</if>
+            <if test="materielId != null">materiel_id,</if>
+            <if test="units != null">units,</if>
+            <if test="specification != null">specification,</if>
+            <if test="quantity != null">quantity,</if>
+            <if test="unitPrice != null">unit_price,</if>
+            <if test="amount != null">amount,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createById != null">create_by_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateById != null">update_by_id,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="taskProcessKey != null">task_process_key,</if>
+            <if test="taskNodeKey != null">task_node_key,</if>
+            <if test="lotNumber != null">lot_number,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="purchaseId != null">#{purchaseId},</if>
+            <if test="supplierNo != null">#{supplierNo},</if>
+            <if test="materielId != null">#{materielId},</if>
+            <if test="units != null">#{units},</if>
+            <if test="specification != null">#{specification},</if>
+            <if test="quantity != null">#{quantity},</if>
+            <if test="unitPrice != null">#{unitPrice},</if>
+            <if test="amount != null">#{amount},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createById != null">#{createById},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateById != null">#{updateById},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="taskProcessKey != null">#{taskProcessKey},</if>
+            <if test="taskNodeKey != null">#{taskNodeKey},</if>
+            <if test="lotNumber != null">#{lotNumber},</if>
+         </trim>
+    </insert>
+
+    <update id="updatePurchaseInfo" parameterType="com.zkqy.business.domain.PurchaseInfo">
+        update purchase_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="purchaseId != null">purchase_id = #{purchaseId},</if>
+            <if test="supplierNo != null">supplier_no = #{supplierNo},</if>
+            <if test="materielId != null">materiel_id = #{materielId},</if>
+            <if test="units != null">units = #{units},</if>
+            <if test="specification != null">specification = #{specification},</if>
+            <if test="quantity != null">quantity = #{quantity},</if>
+            <if test="unitPrice != null">unit_price = #{unitPrice},</if>
+            <if test="amount != null">amount = #{amount},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="createById != null">create_by_id = #{createById},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateById != null">update_by_id = #{updateById},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
+            <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
+            <if test="lotNumber != null">lot_number = #{lotNumber},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deletePurchaseInfoById" parameterType="Long">
+        delete from purchase_info where id = #{id}
+    </delete>
+
+    <delete id="deletePurchaseInfoByIds" parameterType="String">
+        delete from purchase_info where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 202 - 0
zkqy-custom-business/src/main/resources/mapper/business/PurchaseMapper.xml

@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zkqy.business.mapper.PurchaseMapper">
+    
+    <resultMap type="com.zkqy.business.domain.Purchase" id="PurchaseResult">
+        <result property="id"    column="id"    />
+        <result property="serialNumber"    column="serial_number"    />
+        <result property="buyName"    column="buy_name"    />
+        <result property="supplierNo"    column="supplier_no"    />
+        <result property="useDepartment"    column="use_department"    />
+        <result property="useDepartmentId"    column="use_department_id"    />
+        <result property="declarant"    column="declarant"    />
+        <result property="reviewer"    column="reviewer"    />
+        <result property="reviewerState"    column="reviewer_state"    />
+        <result property="reviewerNotes"    column="reviewer_notes"    />
+        <result property="approver"    column="approver"    />
+        <result property="approverState"    column="approver_state"    />
+        <result property="approverNoets"    column="approver_noets"    />
+        <result property="materielId"    column="materiel_id"    />
+        <result property="units"    column="units"    />
+        <result property="specification"    column="specification"    />
+        <result property="quantity"    column="quantity"    />
+        <result property="unitPrice"    column="unit_price"    />
+        <result property="amount"    column="amount"    />
+        <result property="dataApprovalStatus"    column="data_approval_status"    />
+        <result property="remark"    column="remark"    />
+        <result property="createById"    column="create_by_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateById"    column="update_by_id"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="taskProcessKey"    column="task_process_key"    />
+        <result property="taskNodeKey"    column="task_node_key"    />
+        <result property="processKey"    column="process_key"    />
+        <result property="lotNumber"    column="lot_number"    />
+    </resultMap>
+
+    <sql id="selectPurchaseVo">
+        select id, serial_number, buy_name, supplier_no, use_department, use_department_id, declarant, reviewer, reviewer_state, reviewer_notes, approver, approver_state, approver_noets, materiel_id, units, specification, quantity, unit_price, amount, data_approval_status, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, task_process_key, task_node_key, process_key, lot_number from purchase
+    </sql>
+
+    <select id="selectPurchaseList" parameterType="com.zkqy.business.domain.Purchase" resultMap="PurchaseResult">
+        <include refid="selectPurchaseVo"/>
+        <where>  
+            <if test="serialNumber != null  and serialNumber != ''"> and serial_number = #{serialNumber}</if>
+            <if test="buyName != null  and buyName != ''"> and buy_name like concat('%', #{buyName}, '%')</if>
+            <if test="supplierNo != null  and supplierNo != ''"> and supplier_no = #{supplierNo}</if>
+            <if test="useDepartment != null  and useDepartment != ''"> and use_department = #{useDepartment}</if>
+            <if test="useDepartmentId != null "> and use_department_id = #{useDepartmentId}</if>
+            <if test="declarant != null  and declarant != ''"> and declarant = #{declarant}</if>
+            <if test="reviewer != null  and reviewer != ''"> and reviewer = #{reviewer}</if>
+            <if test="reviewerState != null  and reviewerState != ''"> and reviewer_state = #{reviewerState}</if>
+            <if test="reviewerNotes != null  and reviewerNotes != ''"> and reviewer_notes = #{reviewerNotes}</if>
+            <if test="approver != null  and approver != ''"> and approver = #{approver}</if>
+            <if test="approverState != null  and approverState != ''"> and approver_state = #{approverState}</if>
+            <if test="approverNoets != null  and approverNoets != ''"> and approver_noets = #{approverNoets}</if>
+            <if test="materielId != null  and materielId != ''"> and materiel_id = #{materielId}</if>
+            <if test="units != null  and units != ''"> and units = #{units}</if>
+            <if test="specification != null  and specification != ''"> and specification = #{specification}</if>
+            <if test="quantity != null "> and quantity = #{quantity}</if>
+            <if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
+            <if test="amount != null "> and amount = #{amount}</if>
+            <if test="dataApprovalStatus != null  and dataApprovalStatus != ''"> and data_approval_status = #{dataApprovalStatus}</if>
+            <if test="createById != null "> and create_by_id = #{createById}</if>
+            <if test="updateById != null "> and update_by_id = #{updateById}</if>
+            <if test="taskProcessKey != null  and taskProcessKey != ''"> and task_process_key = #{taskProcessKey}</if>
+            <if test="taskNodeKey != null  and taskNodeKey != ''"> and task_node_key = #{taskNodeKey}</if>
+            <if test="processKey != null  and processKey != ''"> and process_key = #{processKey}</if>
+            <if test="lotNumber != null  and lotNumber != ''"> and lot_number = #{lotNumber}</if>
+        </where>
+    </select>
+    
+    <select id="selectPurchaseById" parameterType="String" resultMap="PurchaseResult">
+        <include refid="selectPurchaseVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertPurchase" parameterType="com.zkqy.business.domain.Purchase">
+        insert into purchase
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="serialNumber != null">serial_number,</if>
+            <if test="buyName != null">buy_name,</if>
+            <if test="supplierNo != null">supplier_no,</if>
+            <if test="useDepartment != null">use_department,</if>
+            <if test="useDepartmentId != null">use_department_id,</if>
+            <if test="declarant != null">declarant,</if>
+            <if test="reviewer != null">reviewer,</if>
+            <if test="reviewerState != null">reviewer_state,</if>
+            <if test="reviewerNotes != null">reviewer_notes,</if>
+            <if test="approver != null">approver,</if>
+            <if test="approverState != null">approver_state,</if>
+            <if test="approverNoets != null">approver_noets,</if>
+            <if test="materielId != null">materiel_id,</if>
+            <if test="units != null">units,</if>
+            <if test="specification != null">specification,</if>
+            <if test="quantity != null">quantity,</if>
+            <if test="unitPrice != null">unit_price,</if>
+            <if test="amount != null">amount,</if>
+            <if test="dataApprovalStatus != null">data_approval_status,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createById != null">create_by_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateById != null">update_by_id,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="taskProcessKey != null">task_process_key,</if>
+            <if test="taskNodeKey != null">task_node_key,</if>
+            <if test="processKey != null">process_key,</if>
+            <if test="lotNumber != null">lot_number,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="serialNumber != null">#{serialNumber},</if>
+            <if test="buyName != null">#{buyName},</if>
+            <if test="supplierNo != null">#{supplierNo},</if>
+            <if test="useDepartment != null">#{useDepartment},</if>
+            <if test="useDepartmentId != null">#{useDepartmentId},</if>
+            <if test="declarant != null">#{declarant},</if>
+            <if test="reviewer != null">#{reviewer},</if>
+            <if test="reviewerState != null">#{reviewerState},</if>
+            <if test="reviewerNotes != null">#{reviewerNotes},</if>
+            <if test="approver != null">#{approver},</if>
+            <if test="approverState != null">#{approverState},</if>
+            <if test="approverNoets != null">#{approverNoets},</if>
+            <if test="materielId != null">#{materielId},</if>
+            <if test="units != null">#{units},</if>
+            <if test="specification != null">#{specification},</if>
+            <if test="quantity != null">#{quantity},</if>
+            <if test="unitPrice != null">#{unitPrice},</if>
+            <if test="amount != null">#{amount},</if>
+            <if test="dataApprovalStatus != null">#{dataApprovalStatus},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createById != null">#{createById},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateById != null">#{updateById},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="taskProcessKey != null">#{taskProcessKey},</if>
+            <if test="taskNodeKey != null">#{taskNodeKey},</if>
+            <if test="processKey != null">#{processKey},</if>
+            <if test="lotNumber != null">#{lotNumber},</if>
+         </trim>
+    </insert>
+
+    <update id="updatePurchase" parameterType="com.zkqy.business.domain.Purchase">
+        update purchase
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="serialNumber != null">serial_number = #{serialNumber},</if>
+            <if test="buyName != null">buy_name = #{buyName},</if>
+            <if test="supplierNo != null">supplier_no = #{supplierNo},</if>
+            <if test="useDepartment != null">use_department = #{useDepartment},</if>
+            <if test="useDepartmentId != null">use_department_id = #{useDepartmentId},</if>
+            <if test="declarant != null">declarant = #{declarant},</if>
+            <if test="reviewer != null">reviewer = #{reviewer},</if>
+            <if test="reviewerState != null">reviewer_state = #{reviewerState},</if>
+            <if test="reviewerNotes != null">reviewer_notes = #{reviewerNotes},</if>
+            <if test="approver != null">approver = #{approver},</if>
+            <if test="approverState != null">approver_state = #{approverState},</if>
+            <if test="approverNoets != null">approver_noets = #{approverNoets},</if>
+            <if test="materielId != null">materiel_id = #{materielId},</if>
+            <if test="units != null">units = #{units},</if>
+            <if test="specification != null">specification = #{specification},</if>
+            <if test="quantity != null">quantity = #{quantity},</if>
+            <if test="unitPrice != null">unit_price = #{unitPrice},</if>
+            <if test="amount != null">amount = #{amount},</if>
+            <if test="dataApprovalStatus != null">data_approval_status = #{dataApprovalStatus},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="createById != null">create_by_id = #{createById},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateById != null">update_by_id = #{updateById},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
+            <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
+            <if test="processKey != null">process_key = #{processKey},</if>
+            <if test="lotNumber != null">lot_number = #{lotNumber},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deletePurchaseById" parameterType="String">
+        delete from purchase where id = #{id}
+    </delete>
+
+    <delete id="deletePurchaseByIds" parameterType="String">
+        delete from purchase where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 10 - 0
zkqy-ui/src/api/tablelist/purchaseInfo.js

@@ -0,0 +1,10 @@
+import request from "@/utils/request";
+
+export function getPurchaseInfo(data) {
+  return request({
+    url: '/business/purchaseInfo/listInfo',
+    method: 'get',
+    params: data,
+    baseURL: process.env.VUE_APP_BASE_API1
+  })
+}

+ 0 - 1
zkqy-ui/src/views/orderMange/approve.vue

@@ -169,7 +169,6 @@
         </template>
       </el-table-column>
       <el-table-column
-        v-if="isShowExcuteCol"
         label="操作"
         align="center"
         class-name="small-padding fixed-width"

+ 0 - 1
zkqy-ui/src/views/orderMange/financeApprove.vue

@@ -183,7 +183,6 @@
         </template>
       </el-table-column>
       <el-table-column
-        v-if="isShowExcuteCol"
         label="操作"
         align="center"
         class-name="small-padding fixed-width"

+ 1 - 40
zkqy-ui/src/views/orderMange/purchase/index.vue

@@ -567,7 +567,6 @@ export default {
     },
     // 打印
     async toPrint() {
-      //
       console.log(this.printRow,'printRow');
       console.log(this.printRow.materielSpecificationModel,'materielSpecificationModel');
       console.log(this.printRow.purchaseQuantity,'quantity');
@@ -650,45 +649,7 @@ export default {
               ],
             });
           }
-          // for (let i = 0; i < Number(this.printForm.num); i++) {
-          //   let stringInner =
-          //     printData.id +
-          //     "@" +
-          //     printData.materielId +
-          //     "@" +
-          //     printData.units +
-          //     "@" +
-          //     printData.quantity +
-          //     "@" +
-          //     printData.specificationModel +
-          //     "@" +
-          //     (i + 1) +
-          //     "@" +
-          //     new Date().getTime() +
-          //     i;
-          //   console.log(stringInner);
-          //   // return ;
-          //   allPringtData.push({
-          //     codeData: stringInner,
-          //     showMsg: [
-          //       {
-          //         label: "编号",
-          //         value: printData.materielId,
-          //       },
-          //       {
-          //         label: "名称",
-          //         value: printData.materielName,
-          //       },
-          //       {
-          //         label: "序号",
-          //         value: i + 1,
-          //       },
-          //     ],
-          //   });
-          // }
-          // console.log(allPringtData);
-
-          console.log(allPringtData,'allPringtData')
+          // console.log(allPringtData,'allPringtData')
           qrCodeList(allPringtData, "printDom");
         } else {
           console.log("error submit!!");

+ 2272 - 0
zkqy-ui/src/views/orderMange/purchase/listInfoTwo.vue

@@ -0,0 +1,2272 @@
+<template>
+  <div class="app-container">
+    <!-- 上传表单-->
+    <el-dialog
+      :title="upload.title"
+      :visible.sync="upload.open"
+      width="400px"
+      append-to-body
+    >
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="
+          upload.url +
+          '?updateSupport=' +
+          upload.updateSupport +
+          '&tableName=' +
+          tableName +
+          '&sqlKey=' +
+          tableKey
+        "
+        v-loading="upload.isUploading"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        :onChange="handleChange"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <!--          <div class="el-upload__tip" slot="tip">-->
+          <!--            <el-checkbox v-model="upload.updateSupport"/>-->
+          <!--            是否更新已经存在的用户数据-->
+          <!--          </div>-->
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <el-link
+            type="primary"
+            :underline="false"
+            style="font-size: 12px; vertical-align: baseline"
+            @click="importTemplate"
+            >下载模板
+          </el-link>
+        </div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 查询表单-->
+    <Queryfrom
+      :form-vals="templateInfo.where"
+      :statisticList="statisticList"
+      :showCount="showCount"
+      :showSearch="showSearch"
+      @getList="getList"
+      ref="mychild"
+    />
+    <!-- 头部按钮-->
+    <el-row :gutter="10" class="mb8">
+      <!-- 按钮行 start -->
+      <btn-menu-list
+        @topBtnHandler="topBtnHandler"
+        :topBtnArr="topBtnArr"
+        :selection="selection"
+      ></btn-menu-list>
+      <!-- 按钮行 end -->
+      <!-- <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          >新增
+        </el-button>
+      </el-col>
+      <el-col :span="1.5" v-if="false">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          >修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleBatchDelete"
+          >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          plain
+          icon="el-icon-upload2"
+          size="mini"
+          @click="upload.open = true"
+          >导入
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          >导出
+        </el-button>
+      </el-col> -->
+      <right-toolbar
+        :showCount.sync="showCount"
+        :showSearch.sync="showSearch"
+        :counts="true"
+        @queryTable="pageList"
+      ></right-toolbar>
+    </el-row>
+    <!-- 表格-->
+    <el-table
+      v-loading="loading"
+      :data="tableList"
+      @selection-change="handleSelectionChange"
+      ref="tableRef"
+      :cell-style="cellStyle"
+      :reserve-selection="true"
+      :row-key="getRowKey"
+    >
+      <el-table-column
+        type="selection"
+        width="55"
+        reserve-selection
+        align="center"
+      >
+      </el-table-column>
+      <!-- <span v-for="(key, val) in columns" :key="key">
+        <el-table-column :label="key" align="center" :prop="val" />
+      </span> -->
+      <el-table-column
+        v-for="item in columns"
+        :key="item.key"
+        :label="item.value"
+        align="center"
+        :prop="item.key"
+      >
+        <template slot-scope="scope">
+          <!-- 存在字段样式或字典样式 -->
+          <template
+            v-if="
+              scope.row.styleFieldObj != undefined &&
+              scope.row.styleFieldObj[item.key]
+            "
+          >
+            <!-- 字段样式 -->
+            <template v-if="scope.row.styleFieldObj[item.key].styleType == 1">
+              <!-- 一般字体样式 -->
+              <template
+                v-if="scope.row.styleFieldObj[item.key].fieldStyleType == 0"
+              >
+                <span
+                  :style="`color:${
+                    scope.row.styleFieldObj[item.key].fontColor
+                  }`"
+                  >{{ scope.row[item.key] }}</span
+                >
+              </template>
+              <!-- 标签字体样式 -->
+              <template
+                v-else-if="
+                  scope.row.styleFieldObj[item.key].fieldStyleType == 1
+                "
+              >
+                <el-tag
+                  :type="scope.row.styleFieldObj[item.key].tagType"
+                  :effect="
+                    scope.row.styleFieldObj[item.key].isTagFullBg
+                      ? 'dark'
+                      : 'light'
+                  "
+                >
+                  {{ scope.row[item.key] }}
+                </el-tag>
+              </template>
+            </template>
+            <!-- 字典样式 -->
+            <template
+              v-else-if="scope.row.styleFieldObj[item.key].styleType == 2"
+            >
+              <span
+                v-if="
+                  scope.row.styleFieldObj[item.key].listClass == '' ||
+                  scope.row.styleFieldObj[item.key].listClass == 'default'
+                "
+                >{{ scope.row.styleFieldObj[item.key].dictLabel }}</span
+              >
+              <el-tag
+                v-else
+                :type="
+                  scope.row.styleFieldObj[item.key].listClass == 'primary'
+                    ? ''
+                    : scope.row.styleFieldObj[item.key].listClass
+                "
+                >{{ scope.row.styleFieldObj[item.key].dictLabel }}
+              </el-tag>
+            </template>
+          </template>
+          <!-- 显示默认值 -->
+          <template v-else>
+            {{ scope.row[item.key] }}
+          </template>
+        </template>
+      </el-table-column>
+      <el-table-column
+        v-if="isShowExcuteCol"
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <Menu
+            :row="scope.row"
+            v-for="btnObj in excuteBtnArr"
+            :key="btnObj.id"
+            :listAll="btnObj"
+            @excuteHandler="excuteHandler"
+          ></Menu>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 分页器-->
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="pageList"
+    />
+
+    <!-- k-form-build 组件渲染弹窗-->
+    <el-dialog :title="title" :visible.sync="open" append-to-body>
+      <!-- <iframe
+        :src="iframeUrl"
+        width="100%"
+        height="600px"
+        style="border: none"
+        scrolling="no"
+      >
+      </iframe> -->
+      <!-- <template v-else> -->
+      <template>
+        <FormList
+          v-show="formType == 'dragFormGroup'"
+          ref="formGroupRef"
+          :formList="formList"
+        ></FormList>
+        <!-- <el-button @click="showValue">test</el-button> -->
+      </template>
+      <template>
+        <k-form-build
+          v-if="jsonData && formType == 'dragForm'"
+          class="formBuild"
+          ref="addFromRef"
+          :dynamicData="dynamicData"
+          :defaultValue="defaultValue"
+          @submit="tempSubBtn"
+          @change="formChangeHandler"
+          :value="jsonData"
+        />
+      </template>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="editConfirmHandler">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 绑定按钮dialog -->
+    <el-dialog
+      title="提示"
+      :visible.sync="btnDialogVisible"
+      :before-close="handleClose"
+    >
+      <DialogTemplate
+        ref="dialogRef"
+        :groupKey="groupKey"
+        :rowobj="rowobj"
+        :subCount="subCount"
+        :tableCount="tableCount"
+        :subTableName="subTableName"
+        @addList="addListHandler"
+      >
+      </DialogTemplate>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="btnDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="btnComfirm">确 定</el-button>
+      </span>
+    </el-dialog>
+
+    <!-- 自定义弹窗 -->
+    <el-dialog
+      title="提示"
+      :visible.sync="btnDialogVisible"
+      :before-close="handleClose"
+    >
+      <DialogTemplate
+        ref="dialogRef"
+        :groupKey="groupKey"
+        :rowobj="rowobj"
+        :subCount="subCount"
+        :tableCount="tableCount"
+        :subTableName="subTableName"
+        @addList="addListHandler"
+      >
+      </DialogTemplate>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="btnDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="btnComfirm">确 定</el-button>
+      </span>
+    </el-dialog>
+
+    <!-- 打印弹窗 -->
+    <el-dialog title="采购单详情" :visible.sync="viewPurchaseOrderDetailsShow" width="1000px">
+       <div class="titleDiv">
+<!--            <h3><i>采购单编号:</i><span>{{particularsOfSalesNote.purchaseOrderNumber}}</span></h3>-->
+            <h3><i>供应商:</i><span>{{particularsOfSalesNote.supplierName}}</span></h3>
+            <h3><i>采购批号:</i><span>{{particularsOfSalesNote.purchaseLotNumber}}</span></h3>
+            <h3><i>采购时间:</i><span>{{particularsOfSalesNote.purchaseTiem }}</span></h3>
+       </div>
+       <div class="tableDiv">
+         <el-table
+           :data="purchaseInfo"
+           style="width: 100%">
+           <el-table-column
+             prop="materielCode"
+             align="center"
+             label="物料编码">
+           </el-table-column>
+           <el-table-column
+             prop="materielName"
+             align="center"
+             label="物料名称">
+           </el-table-column>
+           <el-table-column
+             prop="materieEncoding"
+             align="center"
+             label="转码名称">
+           </el-table-column>
+           <el-table-column
+             prop="materieColorNumber"
+             align="center"
+             label="色号">
+           </el-table-column>
+           <el-table-column
+             prop="specificationModel"
+             align="center"
+             label="规格型号">
+           </el-table-column>
+           <el-table-column
+             prop="units"
+             align="center"
+             label="单位">
+           </el-table-column>
+           <el-table-column
+             prop="quantity"
+             align="center"
+             label="数量/重量">
+           </el-table-column>
+<!--           <el-table-column-->
+<!--             prop="totalAmount"-->
+<!--             align="center"-->
+<!--             label="总金额">-->
+<!--           </el-table-column>-->
+           <el-table-column label="操作" width="100px" align="center">
+             <template slot-scope="scope">
+               <el-button
+                 size="mini"
+                 type="danger"
+                 @click.stop.prevent="toPrint(scope.$index, scope.row)">打印</el-button>
+             </template>
+           </el-table-column>
+         </el-table>
+       </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="printShow = false">取 消</el-button>
+        <el-button type="primary">确认</el-button>
+      </span>
+    </el-dialog>
+
+    <!-- print -->
+    <div id="printDom" style="width: 160px; height: 160px"></div>
+  </div>
+</template>
+<script>
+import {
+  delTableData,
+  dragTableInfo,
+  listTable,
+  unionListTableData,
+  getInfoBySqlKey,
+  btnCommonApi,
+  addTableData,
+  batchEdit,
+  getStatisticList,
+} from "@/api/tablelist/commonTable";
+import { listData } from "@/api/system/tenant/data";
+import { getPurchaseInfo } from "@/api/tablelist/purchaseInfo";
+import { getToken } from "@/utils/auth";
+import Queryfrom from "@/views/tablelist/commonTable/queryfrom.vue";
+import { camelCase, toUnderline } from "@/utils";
+import { inputDisableComplete } from "@/utils/other";
+import Menu from "@/views/tablelist/commonTable/BtnMenu.vue";
+import BtnMenuList from "@/views/tablelist/commonTable/BtnMenuList.vue";
+import { checkRole } from "@/utils/permission";
+import DialogTemplate from "@/views/dialogTemplate/components/index.vue";
+import FormList from "@/components/FormGroup/formList.vue";
+import { v4 as uuidv4 } from "uuid";
+import printHtml from "./print";
+import { Base64 } from 'js-base64'
+import qrCodeList from "@/utils/print/qrCodeList";
+
+export default {
+  name: "listInfo",
+  components: { Queryfrom, Menu, DialogTemplate, FormList, BtnMenuList },
+  data() {
+    return {
+      particularsOfSalesNote:{
+         purchaseOrderNumber:"",
+         supplierName:"",
+         purchaseLotNumber:"",
+         purchaseTiem:"采购时间"
+      },
+      purchaseInfo:[],
+      //是否显示销售单详情表单
+      viewPurchaseOrderDetailsShow:false,
+      // 顶部按钮数据
+      topBtnArr: [], //顶部按钮数据
+      selection: [], //选中数组
+      printShow: false, //打印页面
+      printHtml: "", //打印的html
+      // 自动生成字段
+      theAutoField: [
+        "id",
+        "createBy",
+        "createById",
+        "createTime",
+        "delFlag",
+        "updateBy",
+        "updateById",
+        "updateTime",
+        "del_flag",
+        "create_by",
+        "create_by_id",
+        "create_time",
+        "data_approval_status",
+        "update_by",
+        "update_by_id",
+        "update_time",
+      ],
+      // 绑定按钮dialog
+      btnDialogVisible: false,
+      // 绑定修改dialog
+      groupKey: "",
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示统计
+      showCount: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 用户表格数据
+      tableList: [],
+      // 弹出层标题
+      title: "",
+      // 日期范围
+      dateRange: [],
+      // 表单参数
+      form: {},
+      rules: {},
+      // cru 弹窗
+      open: false,
+      // excel共通导入数据
+      upload: {
+        // 是否显示弹出层
+        open: false,
+        // 弹出层标题(
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API1 + "common/uploadData",
+      },
+      // 排序方式 默认降序
+      sortOrder: true,
+      // 共通查询参数接受子组件的参数
+      queryParams: {
+        pageNum: 1, // 第几页
+        pageSize: 10, // 每页大小
+        orderByColumn: "", // 根据某列排序
+        isAsc: "", // desc(降序)或 asc(升序)
+        // 基本查询参数
+        basicMap: {
+          tableName: "drag_form",
+        },
+        // 当前表字段筛选参数
+        queryMap: {
+          // 当前查询基本参数
+          // ... key : value         当前页面的筛选条件
+          // 超级查询的唯一值
+          queryCriteriaValue: "",
+        },
+      },
+      // 列信息
+      columns: {},
+      // 当前模版信息
+      templateInfo: {},
+      // 查询条件
+      queryFromWhere: {},
+      // 当前table唯一标识
+      tableKey: null,
+      // 当前表名称
+      tableName: null,
+      //存放html代码块
+      iframeUrl: "",
+      //存放表单渲染数据
+      jsonData: {},
+      // 回显表格数据,
+      defaultValue: {},
+      // 统计card
+      statisticList: [],
+      // 样式表
+      styleList: [],
+      // 字典样式对象
+      dictStyleObj: {},
+      // 操作列 按钮数据
+      excuteBtnArr: [],
+      // 下拉框动态数据
+      dynamicData: {},
+      // 当前点击按钮的数据
+      currentBtnData: {},
+      // 修改选中行
+      rowobj: {},
+      // 该行的统计信息
+      subCount: [],
+      tableCount: [],
+      // 弹窗新增数据
+      addLists: [],
+      subTableName: "",
+      // 当前点击行的数据
+      currentRow: {},
+      // 操作列是否显示隐藏
+      isShowExcuteCol: false,
+      // 表单组数据
+      formList: [],
+      formType: "dragFormGroup",
+      FormNameList: [], //表单组中表格名称
+      FormListDefaultValue: {}, //表单组的默认表单数据
+    };
+  },
+  created() {
+    // 得到当前展示的table的唯一标识
+    this.tableKey = this.$route.query.tableKey;
+  },
+  watch: {},
+  computed: {
+    // isShowExcuteCol() {
+    //   let res = false;
+    //   if (!this.excuteBtnArr || !this.excuteBtnArr.length) {
+    //     res = false;
+    //   } else {
+    //     res = !this.excuteBtnArr?.every((arr) => arr.children.length == 0);
+    //   }
+    //   this.$nextTick(() => {
+    //     // console.log(res);
+    //     this.$refs.tableRef.doLayout();
+    //   });
+    //   return res;
+    // },
+  },
+  methods: {
+    //打印逻辑方法
+    toPrint(rwoIndex,row){
+      console.log(rwoIndex,row);
+      //拼接码内容 采购单号,编码号,单位,规格型号,数量,
+      let stringInner =this.particularsOfSalesNote.purchaseLotNumber
+      let timeCode= new Date().getTime().toString();
+      //二维码内容
+      //采购单编号         批号                                         母粒编码                   色号                       规格                       单位              数量         时间戳
+      let codeString=
+        row.purchaseId+"@"+
+        row.materieEncoding+"@"+
+        row.units+"@"+
+        row.quantity+"@"+
+        row.specificationModel+"@"+
+        timeCode+"@"+
+        stringInner +"@"+
+        row.materieColorNumber +"@"+
+        row.materielId
+      alert(codeString)
+      // const encodePwd = Base64.encode(codeString);//加密
+      const encodePwd = encodeURIComponent(codeString)
+
+      //声明一个数组对象
+      let allPringtData = [];
+      //添加内容
+      allPringtData.push({
+        codeData: encodePwd,
+        showMsg: [
+          {label: "批号", value: stringInner},
+          {label: "母粒编码", value: row.materieEncoding},
+          {label: "色号", value: row.materieColorNumber},
+        ],
+      });
+      qrCodeList(allPringtData, "printDom");
+    },
+    viewPurchaseOrderDetails(btnData, row){
+      console.log(this.currentRow,btnData,row);
+      this.particularsOfSalesNote.purchaseOrderNumber=row.purchaseId
+      this.particularsOfSalesNote.supplierName=row.supplierSupplierName
+      this.particularsOfSalesNote.purchaseLotNumber=row.purchaseLotNumber
+      this.particularsOfSalesNote.purchaseTiem=row.purchaseCreateTime
+      this.viewPurchaseOrderDetailsShow=true;
+      getPurchaseInfo({"purchaseId":row.purchaseId}).then(resp=>{
+        this.purchaseInfo=resp.data
+        console.log(this.purchaseInfo)
+      })
+    },
+    // test
+    showValue() {
+      // console.log(this.$refs.formGroupRef);
+      this.$refs.formGroupRef.setDefaultValue();
+    },
+    // 计算操作列的显示与隐藏
+    calcuteExcuteCol() {
+      if (!this.excuteBtnArr || !this.excuteBtnArr.length) {
+        this.isShowExcuteCol = false;
+      } else {
+        this.isShowExcuteCol = !this.excuteBtnArr?.every(
+          (arr) => arr.children.length == 0
+        );
+      }
+    },
+    // 获取row-key
+    getRowKey(row) {
+      return row[
+        camelCase(this.tableName + "_" + this.templateInfo.template?.primaryKey)
+      ];
+    },
+    /** 查询列表 */
+    getList(queryParams) {
+      this.loading = true;
+      // 序列化当前查询参数列表
+      queryParams && (this.queryParams.queryMap = queryParams.queryMap);
+      // 获取当前表单结构信息
+      dragTableInfo({ queryMap: { tableKey: this.tableKey } })
+        .then((res) => {
+          console.log(res);
+          // 得到当前模版信息 --- sql columns queryWhere
+          this.templateInfo = res.data.resultMap;
+          this.styleList = res.data.resultMap.style?.map((item) => {
+            item.styleField = camelCase(
+              item.styleField.replace(".", "_") || ""
+            );
+            return item;
+          });
+          // 获取操作列的按钮数据
+          this.excuteBtnArr = res.data.resultMap.button?.filter(
+            (item) => item.btnGroupType == "right"
+          );
+          this.excuteBtnArr[0].children.push({
+            btnName: "采购单详情",
+            btnType: "viewPurchaseOrderDetails",
+            btnIcon: "el-icon-edit",
+            btnShowCondition: "",
+            children: [],
+          });
+          this.topBtnArr = res.data.resultMap.button?.filter(
+            (item) => item.btnGroupType == "top"
+          );
+          this.calcuteExcuteCol();
+          this.$nextTick(() => {
+            this.$refs.tableRef.doLayout();
+          });
+          this.queryParams.orderByColumn =
+            res.data.resultMap.querySql.orderByColumn;
+          this.sortOrder = JSON.parse(res.data.resultMap.querySql.sortOrder);
+          // 根据拖拽时设置当前列表排列顺序
+          this.queryParams.isAsc = this.sortOrder ? "DESC" : "ASC";
+          this.tableName = this.templateInfo.template.dtTableName;
+          // 得到查询条件
+          this.queryFromWhere = res.data.resultMap.where;
+          //  得到当前列表信息
+          this.columns = this.columnsHandler(
+            JSON.parse(this.templateInfo.template.dtColumnName)
+          );
+        })
+        .finally((fes) => {
+          if (this.templateInfo == {}) return;
+          // 调用查询需要携带当前table的唯一标识
+          this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
+          this.queryParams.orderByColumn = camelCase(
+            this.queryParams.orderByColumn || ""
+          );
+          // 根据sql语句查询当前表数据
+          unionListTableData(this.queryParams).then(async (res) => {
+            this.tableList = [];
+            res.rows.forEach((item) => {
+              this.tableList.push(item.resultMap);
+            });
+            // 驼峰转换
+            let tempTableList = [];
+            tempTableList = this.tableList.map((item) => {
+              let kv = {};
+              for (let itemKey in item) {
+                kv[camelCase(itemKey)] = item[itemKey];
+              }
+              return kv;
+            });
+            this.tableList = await this.setFieldStyleData(tempTableList);
+            this.total = res.total;
+            this.loading = false;
+          });
+
+          // 查询统计信息
+          getStatisticList({
+            queryMap: {
+              tableKey: this.templateInfo.template.tableKey,
+              queryCriteriaValue: this.queryParams.queryMap.queryCriteriaValue,
+            },
+          }).then((res) => {
+            this.statisticList = res.data;
+          });
+        });
+    },
+    isUpperCase(char) {
+      return char === char.toUpperCase();
+    },
+    // 下划线命名转驼峰命名
+    toUnderScoreCase(str) {
+      if (str === null) {
+        return null;
+      }
+      let sb = "";
+      // 前置字符是否大写
+      let preCharIsUpperCase = true;
+      // 当前字符是否大写
+      let curreCharIsUpperCase = true;
+      // 下一字符是否大写
+      let nexteCharIsUpperCase = true;
+      for (let i = 0; i < str.length; i++) {
+        let c = str.charAt(i);
+        if (i > 0) {
+          preCharIsUpperCase = isUpperCase(str.charAt(i - 1));
+        } else {
+          preCharIsUpperCase = false;
+        }
+
+        curreCharIsUpperCase = isUpperCase(c);
+
+        if (i < str.length - 1) {
+          nexteCharIsUpperCase = isUpperCase(str.charAt(i + 1));
+        }
+
+        if (
+          preCharIsUpperCase &&
+          curreCharIsUpperCase &&
+          !nexteCharIsUpperCase
+        ) {
+          sb += SEPARATOR;
+        } else if (i !== 0 && !preCharIsUpperCase && curreCharIsUpperCase) {
+          sb += SEPARATOR;
+        }
+        sb += c.toLowerCase();
+      }
+
+      return sb;
+    },
+    // 处理列表信息
+    columnsHandler(columns) {
+      let resArr = [];
+      columns.forEach((item) => {
+        for (const key in item) {
+          let tempObj = {};
+          tempObj.key = camelCase(key);
+          tempObj.value = item[key];
+          resArr.push(tempObj);
+        }
+      });
+      return resArr;
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      // this.reset();
+    },
+    // 分页查询
+    pageList(row) {
+      // 调用子组件-》携带子组件参数请求后台
+      this.$refs.mychild.pageList(
+        row == undefined
+          ? {
+              limit: this.queryParams.pageSize,
+              page: this.queryParams.pageNum,
+            }
+          : row
+      );
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(
+        (item) =>
+          item[
+            camelCase(
+              this.tableName + "_" + this.templateInfo.template?.primaryKey
+            )
+          ]
+      );
+      this.selection = selection;
+      this.single = selection.length != 1;
+      this.multiple = !selection.length;
+    },
+
+    // 更多操作触发
+    handleCommand(command, row) {
+      switch (command) {
+        case "handleResetPwd":
+          this.handleResetPwd(row);
+          break;
+        case "handleAuthRole":
+          this.handleAuthRole(row);
+          break;
+        default:
+          break;
+      }
+    },
+    /** 新增按钮操作 */
+    handleAdd(row) {
+      // this.reset();
+      this.defaultValue = {};
+      this.formType = "dragForm";
+      let payLoad = {
+        basicMap: {
+          btnType: this.currentBtnData.btnType,
+          btnKey: this.currentBtnData.btnKey,
+          visible: "false",
+          sqlKey: this.templateInfo.template.sqlKey,
+          tableName: this.tableName,
+        },
+      };
+      // getInfoBySqlKey(this.templateInfo.template.sqlKey)
+      btnCommonApi(payLoad).then(({ data }) => {
+        if (!data || !data.dfVueTemplate) {
+          this.jsonData = false;
+          this.$message.error("当前表格未绑定表单!");
+          return;
+        }
+        if (data.dfFormSql) {
+          let dynamicData = JSON.parse(data.dfFormSql);
+          Object.assign(this.dynamicData, dynamicData);
+        }
+        this.jsonData = JSON.parse(data.dfVueTemplate);
+        this.open = true;
+        this.title = "添加信息";
+        this.form.password = this.initPassword;
+        this.$nextTick(() => {
+          this.$refs.addFromRef.reset();
+          inputDisableComplete();
+        });
+      });
+    },
+    longestCommonSubstring(strs) {
+      if (!strs || strs.includes("")) return "";
+      let str1_Length = strs[0].length;
+      let str_Nums = strs.length;
+      let flag = 0;
+      for (let i = 0; i < str1_Length && flag == 0; i++) {
+        let char = strs[0][i];
+        for (var j = 1; j < str_Nums; j++) {
+          if (char !== strs[j][i] || i == strs[j].length) {
+            return strs[1].substring(0, i);
+          }
+        }
+      }
+      return strs[0];
+    },
+    // 绑定dialog对话框关闭
+    handleClose() {
+      this.btnDialogVisible = false;
+    },
+    getLastUppercaseWord(text) {
+      const pattern = /\b[A-Z][a-z]*\b/g;
+      const matches = [...text.matchAll(pattern)];
+      if (matches.length > 0) {
+        const lastMatch = matches[matches.length - 1][0];
+        return lastMatch;
+      } else {
+        return null;
+      }
+    },
+    // 延迟
+    sleep(ms) {
+      var unixtime_ms = new Date().getTime();
+      while (new Date().getTime() < unixtime_ms + ms) {}
+      return "";
+    },
+    /** 修改按钮操作 */
+    async handleUpdate(row, btnData) {
+      let nameTable = this.templateInfo.template.dtTableName;
+      this.rowobj = {};
+      let obj = {};
+      this.formList = [];
+      for (let key in row) {
+        let modifiedTable = key
+          .replace(/[A-Z]/g, (match) => `_${match}`)
+          .toLowerCase();
+
+        this.rowobj[modifiedTable] = row[key];
+
+        let str = modifiedTable.substring(nameTable.length + 1);
+        obj[str] = row[key];
+      }
+      // getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
+      //   if (!data || !data.dfVueTemplate) {
+      //     this.$message.error("当前表格未绑定表单!");
+      //     return;
+      //   }});
+
+      // 新的修改请求
+      try {
+        // console.log("btnData", btnData);
+        let { btnFormType } = btnData;
+        this.formType = btnFormType;
+        let payLoad = {};
+        let primary = camelCase(
+          this.tableName + "_" + this.templateInfo.template?.primaryKey
+        );
+        // if (btnFormType == "dragFormGroup") {
+        //   payLoad.updateCommonEntityList = {
+        //     basicMap: {
+        //       btnType: this.currentBtnData.btnType,
+        //       btnKey: this.currentBtnData.btnKey,
+        //       visible: "false",
+        //       sqlKey: this.templateInfo.template.sqlKey,
+        //       tableName: this.tableName,
+        //     },
+        //     conditionMap: {},
+        //   };
+        //   payLoad.updateCommonEntityList.conditionMap[
+        //     this.templateInfo.template?.primaryKey
+        //   ] = row[primary];
+        // } else {
+        payLoad = {
+          basicMap: {
+            btnType: this.currentBtnData.btnType,
+            btnKey: this.currentBtnData.btnKey,
+            visible: "false",
+            sqlKey: this.templateInfo.template.sqlKey,
+            tableName: this.tableName,
+          },
+          conditionMap: {},
+        };
+        payLoad.conditionMap[this.templateInfo.template?.primaryKey] =
+          row[primary];
+        // }
+
+        let res = await btnCommonApi(payLoad);
+        // 判断是否绑定dialog弹窗
+        if (!this.currentBtnData.btnTableFormGroupKey) {
+          if ((!res.data || !res.data.template) && !res.data?.mainForm) {
+            this.$message.error("当前按钮未绑定表单!");
+            return;
+          }
+          if (btnFormType == "dragFormGroup") {
+            //表单组
+            if (res.code == 200) {
+              if (res.data.mainForm) {
+                //表单组
+                // console.log(res.data);
+                this.transformDataFormat(res.data);
+                this.tableName = res.data.mainForm.showTemplate.dfTableName;
+              } else {
+                this.formList = res.data;
+                this.tableName = res.data.dfTableName;
+              }
+              // console.log(this.formList);
+              this.open = true;
+              // this.$nextTick(() => {
+              //   // this.sleep(1000);
+              //   this.$refs.formGroupRef.setDefaultValue();
+              // });
+            } else {
+              console.error(res);
+              this.$message.error("网络异常,请稍后再试");
+            }
+          } else {
+            //单个表单
+            res.data.template.dfFormSql &&
+              (this.dynamicData = JSON.parse(res.data.template.dfFormSql));
+            this.addRealFieldName(res.data.result.resultMap);
+            let resultMap = res.data.result.resultMap;
+
+            Object.assign(this.defaultValue, resultMap);
+            this.jsonData = JSON.parse(res.data.template.dfVueTemplate);
+            this.open = true;
+            this.title = "修改信息";
+            this.form.password = this.initPassword;
+            this.$nextTick(() => {
+              this.$refs.addFromRef.setData(res.data.result.resultMap);
+            });
+          }
+        } else {
+          this.subTableName = res.data.result.dragTables[1].dtTableName;
+          this.btnDialogVisible = true;
+          this.groupKey = this.currentBtnData.btnTableFormGroupKey;
+          this.$nextTick(() => {
+            let refChild = this.$refs.dialogRef;
+            refChild.getLists(this.groupKey);
+          });
+
+          let tablesubKey = res.data.result.dragTables[1].tableKey;
+
+          // 查询统计信息
+          getStatisticList({
+            queryMap: {
+              tableKey: tablesubKey,
+            },
+          }).then((res) => {
+            this.subCount = res.data;
+          });
+
+          let prmKey = this.templateInfo.template.primaryKey;
+          let pkey = prmKey.replace(/_([a-z])/g, (match, p1) =>
+            p1.toUpperCase()
+          );
+
+          let data = {
+            queryMap: {
+              tableKey: res.data.result.dragTables[2].tableKey,
+            },
+          };
+
+          let key =
+            "#{" +
+            this.templateInfo.template.dtTableName +
+            "." +
+            this.templateInfo.template.primaryKey;
+
+          data.queryMap[key] =
+            "'" + obj[this.templateInfo.template.primaryKey] + "'";
+
+          getStatisticList(data).then((res) => {
+            this.tableCount = res.data;
+          });
+        }
+
+        // let fieldList = Object.keys(resultMap);
+        // let tableName = this.longestCommonSubstring(fieldList);
+        // fieldList.forEach((field) => {
+        //   let realField = field.replace(tableName, "");
+        //   realField = realField[0].toLocaleLowerCase() + realField.substring(1);
+        //   resultMap[realField] = resultMap[field];
+        // });
+      } catch (error) {
+        this.$message.error("网络异常,请稍后再试");
+        console.error(error);
+      }
+      return;
+      // getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
+      //   if (!data || !data.dfVueTemplate) {
+      //     this.$message.error("当前表格未绑定表单!");
+      //     return;
+      //   }
+      //   // let fieldList = Object.keys(row);
+      //   // let tableName = this.longestCommonSubstring(fieldList);
+      //   // fieldList.forEach((field) => {
+      //   //   let realField = field.replace(tableName, "");
+      //   //   realField = realField[0].toLocaleLowerCase() + realField.substring(1);
+      //   //   row[realField] = row[field];
+      //   // });
+      //   this.addRealFieldName(row);
+      //   Object.assign(this.defaultValue, row);
+      //   this.jsonData = JSON.parse(data.dfVueTemplate);
+      //   this.open = true;
+      //   this.title = "修改信息";
+      //   this.form.password = this.initPassword;
+      //   this.$nextTick(() => {
+      //     this.$refs.addFromRef.setData(row);
+      //   });
+      // });
+      // return;
+      this.reset();
+      const userId = row.userId || this.ids;
+      getUser(userId).then((response) => {
+        this.form = response.data;
+        this.postOptions = response.posts;
+        this.roleOptions = response.roles;
+        this.$set(this.form, "postIds", response.postIds);
+        this.$set(this.form, "roleIds", response.roleIds);
+        this.open = true;
+        this.title = "修改当前信息";
+        this.form.password = "";
+      });
+    },
+    // 将表单组数据转换成符合单个表单的数据格式
+    transformDataFormat(data) {
+      this.FormNameList = [];
+      let { mainForm, subFormList } = data;
+      this.formList = [];
+      let showValue = null;
+      if (mainForm.showValue) {
+        showValue = mainForm.showValue[0]?.resultMap;
+      }
+
+      if (showValue) {
+        for (const key of Object.keys(showValue)) {
+          showValue[toUnderline(key)] = showValue[key];
+        }
+        mainForm.showTemplate.resultMap = [showValue];
+      }
+
+      this.formList.push({
+        template: mainForm.showTemplate,
+        tableName: mainForm.mainFormTable,
+      });
+      this.FormNameList.push({
+        tableName: mainForm.mainFormTable,
+        formItem: mainForm.mainFormItem,
+        relateFormItem: null,
+        formType: mainForm.showTemplate.spare == "2" ? "batch" : "normal",
+        defaultValue: mainForm.showValue ? mainForm.showValue[0].resultMap : {},
+      });
+      if (subFormList && subFormList.length > 0) {
+        subFormList.forEach((item) => {
+          let showValue = null;
+          if (item.showValue) {
+            showValue = item.showValue[0];
+          }
+          let defaultValue = {};
+          if (showValue) {
+            if (item.showTemplate.spare == "2") {
+              //动态表格表单
+              let batch = {},
+                tableName = item.formItem?.split(".")?.[0];
+              batch[tableName] = item.showValue.map((item) => item.resultMap);
+              defaultValue = JSON.parse(JSON.stringify(batch));
+              console.log(JSON.parse(JSON.stringify(batch)));
+              // 所有字段驼峰转下划线
+              batch[tableName].forEach((i) => {
+                for (const key of Object.keys(i)) {
+                  i[toUnderline(key)] = i[key];
+                  if (toUnderline(key) != key) {
+                    delete i[key];
+                  }
+                }
+              });
+              item.showTemplate.resultMap = [
+                {
+                  batch,
+                },
+              ];
+            } else {
+              for (const key of Object.keys(item.showValue[0].resultMap)) {
+                item.showValue[0].resultMap[toUnderline(key)] =
+                  item.showValue[0].resultMap[key];
+              }
+
+              item.showTemplate.resultMap = [item.showValue[0].resultMap];
+            }
+          }
+          this.formList.push({
+            template: item.showTemplate,
+            tableName: item.formItem?.split(".")?.[0],
+          });
+          this.FormNameList.push({
+            tableName: item.formItem?.split(".")?.[0],
+            formItem: item.formItem,
+            relateFormItem: item.relateMainItem,
+            formType: item.showTemplate.spare == "2" ? "batch" : "normal",
+            defaultValue,
+            insertMap: item.insertMap,
+          });
+        });
+      }
+    },
+    // 添加真正的字段名
+    addRealFieldName(row) {
+      let fieldList = Object.keys(row);
+      // let tableName = this.longestCommonSubstring(fieldList);
+      let tableName = camelCase(this.tableName);
+      fieldList.forEach((field) => {
+        let realField = field.replace(tableName, "");
+        realField = realField[0].toLocaleLowerCase() + realField.substring(1);
+        row[realField] = row[field];
+      });
+    },
+
+    /** 提交按钮 */
+    submitForm: function () {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (this.form.userId != undefined) {
+            updateUser(this.form).then((response) => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addUser(this.form).then((response) => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作
+     *
+     * 删除提示信息语句(标识)
+     * */
+    handleDelete(row, btnData) {
+      let delIds = this.ids;
+      let primary = camelCase(this.templateInfo.template?.primaryKey);
+      // let realyKey=
+      this.addRealFieldName(row);
+      if (row[primary] != undefined && row[primary] != null) {
+        delIds = [];
+        delIds.push(row[primary]);
+      }
+      let data = {
+        basicMap: {
+          btnType: btnData.btnType,
+          btnKey: btnData.btnKey,
+          tableName: this.tableName,
+        },
+        conditionMap: {
+          // id: delIds,
+        },
+        btnParametersMap: {},
+      };
+      if (this.currentBtnData.btnParams) {
+        let btnParams =
+          JSON.parse(this.currentBtnData.btnParams)?.commonFieldData || [];
+        let conditionData =
+          JSON.parse(this.currentBtnData.btnParams).conditionData || [];
+        conditionData.forEach((item) => {
+          data.conditionMap[item.fieldName.split(".")[1]] = item.fieldValue
+            ? item.fieldValue
+            : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
+        });
+        btnParams.forEach((item) => {
+          data.btnParametersMap[item.fieldName.split(".")[1]] = item.fieldValue
+            ? item.fieldValue
+            : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
+        });
+      }
+      // data.conditionMap[this.templateInfo.template?.primaryKey] = delIds;
+      this.$modal
+        .confirm('是否确认删除"' + delIds + '"的数据项?')
+        .then(function () {
+          // return delTableData(data);
+          return btnCommonApi(data);
+        })
+        .then(() => {
+          // 调用子组件查询方法 目的是携带上子组件中的查询参数
+          this.$refs.mychild.pageList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+    // 批量删除接口
+    handleBatchDelete() {
+      let delIds = this.ids;
+      let primary = camelCase(this.templateInfo.template?.primaryKey);
+      // if (row && row[primary] != undefined && row[primary] != null) {
+      //   delIds = [];
+      //   delIds.push(row[primary]);
+      // }
+      let data = {
+        basicMap: {
+          tableName: this.tableName,
+        },
+        conditionMap: {
+          // id: delIds,
+        },
+      };
+      // if (this.currentBtnData.btnParams) {
+      //   let btnParams = JSON.parse(this.currentBtnData.btnParams);
+      //   btnParams.forEach((item) => {
+      //     data.btnParametersMap[
+      //       this.formatField(item.fieldName, camelCase(this.tableName))
+      //     ] = item.fieldValue
+      //       ? item.fieldValue
+      //       : this.currentRow[item.fieldName];
+      //   });
+      // }
+      data.conditionMap[this.templateInfo.template?.primaryKey] = delIds;
+      this.$modal
+        .confirm('是否确认删除"' + delIds + '"的数据项?')
+        .then(function () {
+          return delTableData(data);
+          // return btnCommonApi(data);
+        })
+        .then(() => {
+          // 调用子组件查询方法 目的是携带上子组件中的查询参数
+          this.$refs.mychild.pageList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      let primary = camelCase(this.templateInfo.template?.primaryKey);
+      let realyKey = camelCase(this.tableName + "_" + primary);
+      if (this.ids.length > 0) {
+        this.queryParams["execlMap"] = [];
+        this.ids.forEach((item) => {
+          this.queryParams.execlMap.push(
+            this.tableList.find((ttem) => {
+              return ttem[realyKey] === item;
+            })
+          );
+        });
+      } else {
+        this.$message.warning("请至少勾选一条导出数据");
+        return;
+      }
+      this.queryParams.execlMap = JSON.stringify(this.queryParams.execlMap);
+      this.download(
+        process.env.VUE_APP_BASE_API1 + "common/export",
+        {
+          ...this.queryParams,
+        },
+        `文件名称_${new Date().getTime()}.xlsx`
+      );
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = "当前导入";
+      this.upload.open = true;
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      this.download(
+        process.env.VUE_APP_BASE_API1 +
+          `common/exportTemplate?tableName=${this.tableName}&sqlkey=${this.templateInfo.template.sqlKey}`,
+        {},
+        `下载模版名称${new Date().getTime()}.xlsx`
+      );
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(
+        "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+          response.msg +
+          "</div>",
+        "导入结果",
+        { dangerouslyUseHTMLString: true }
+      );
+      this.$refs.mychild.pageList({
+        limit: this.queryParams.pageSize,
+        page: this.queryParams.pageNum,
+      });
+    },
+    //重点在这里
+    handleChange(file, fileList) {
+      file.name = this.tableName + "." + file.name.split(".")[1];
+      fileList.forEach((item) => {
+        item.name = this.tableName + "." + file.name.split(".")[1];
+      });
+      let newFile = new File(
+        [file],
+        this.tableName + "." + file.name.split(".")[1]
+      ); //创建出来也是不可编辑的file对象
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    // 弹窗新增的数
+    addListHandler(val) {
+      this.addLists.push(...val);
+    },
+    // 绑定弹窗Dialog确定按钮
+    btnComfirm() {
+      // let data = {
+      //   addListMap:[],
+      //   basicMap:{
+      //     btnType: 10,
+      //     tableName: this.subTableName,
+      //     visible: true,
+      //   },
+      //   commMap: {},
+      //   conditionMap: {},
+      // }
+      // // data.addListMap =
+      // btnCommonApi(data).then(res => {
+      //   // console.log('弹窗确定', res);
+      // })
+    },
+    // 去掉表名 开头字母小写
+    formatField(field = "", tableName) {
+      let temp = field.replace(tableName, "");
+      return toUnderline(temp[0].toLowerCase() + temp.slice(1));
+    },
+    // 处理 动态表单 动态表格 新增数据
+    getInsertBatchData(values, data) {
+      if (Object.keys(values.batch).length == 0) return data;
+      let tableName = Object.keys(values.batch)[0];
+      data.basicMap.tableName = tableName;
+      data.addListMap = values.batch[tableName].map((item) => {
+        delete item.key;
+        return item;
+      });
+      return data;
+    },
+    // 添加插入的数据
+    addInsertData(insertMap, result, res) {
+      console.log(insertMap, result, res);
+      result.addListMap.forEach((i) => {
+        insertMap.forEach((j) => {
+          i[j.fieldName?.split(".")[1]] = res.find(
+            (k) => k.tableName == j.tableName
+          )?.data[j.relaField.split(".")[1]];
+        });
+      });
+    },
+    // 处理 动态表单 动态表格 修改数据
+    getEditBatchData(values, data) {},
+    // 处理 表单组  含有动态表格  新增数据
+    getFormGroupBatchData(values, index, result) {
+      console.log(values, index, result);
+      let tableName = Object.keys(values.data.batch)[0];
+      let res = {
+        basicMap: {
+          tableName,
+        },
+        addListMap: [],
+      };
+      let { formItem, relateFormItem } = values;
+      res.addListMap = values.data.batch[tableName].map((item) => {
+        delete item.key;
+        console.log(formItem.split(".")[1], relateFormItem.split(".")[1]);
+        item[formItem.split(".")[1]] =
+          result[0].data[relateFormItem.split(".")[1]]; //将主表单的关联值赋值给从表单
+        return item;
+      });
+      return res;
+    },
+    //提交编辑结果按钮回调
+    async editConfirmHandler() {
+      if (this.$refs.addFromRef && this.formType == "dragForm") {
+        this.$refs.addFromRef
+          .getData()
+          .then(async (values) => {
+            // console.log("dragForm", values);
+
+            // return;
+            let data = {
+              basicMap: {
+                tableName: this.tableName,
+                // btnKey: btnData.btnKey,
+                btnKey: this.currentBtnData.btnKey,
+              },
+              addListMap: [values],
+              conditionMap: {},
+              commMap: {},
+              btnParametersMap: {},
+            };
+
+            if (this.currentBtnData.btnParams) {
+              let btnParams =
+                JSON.parse(this.currentBtnData.btnParams)?.commonFieldData ||
+                [];
+              let conditionData =
+                JSON.parse(this.currentBtnData.btnParams).conditionData || [];
+              // let
+              btnParams.forEach((item) => {
+                data.btnParametersMap[item.fieldName.split(".")[1]] =
+                  item.fieldValue
+                    ? item.fieldValue
+                    : this.currentRow[
+                        camelCase(item.fieldName.replace(".", "_"))
+                      ];
+              });
+              conditionData.forEach((item) => {
+                data.conditionMap[item.fieldName.split(".")[1]] =
+                  item.fieldValue
+                    ? item.fieldValue
+                    : this.currentRow[
+                        camelCase(item.fieldName.replace(".", "_"))
+                      ];
+              });
+            }
+            if (Object.keys(this.defaultValue).length) {
+              //修改
+              // data.conditionMap[this.templateInfo.template?.primaryKey] =
+              //   this.defaultValue[this.templateInfo.template?.primaryKey];
+              if (values.batch) {
+                //动态表单的修改
+                data = this.getEditBatchData(values, data);
+              } else {
+                Object.keys(values).map((k) => {
+                  data.commMap[k] = values[k];
+                });
+              }
+              data.basicMap.btnType = this.currentBtnData.btnType;
+              data.basicMap.visible = true;
+            } else {
+              // 处理 动态表格
+              // start
+              if (values.batch) {
+                data = this.getInsertBatchData(values, data);
+              }
+              // end
+              //新增
+              data.basicMap.btnType = "INSERT";
+              data.basicMap.visible = true;
+            }
+            try {
+              let res = await btnCommonApi(data);
+              if (res.code == 200) {
+                this.$message.success("操作成功");
+              } else {
+                this.$message.error("网络异常,请稍后再试");
+              }
+            } catch (error) {
+              // console.log(error);
+              this.$message.error("网络异常,请稍后再试");
+            }
+            this.getList();
+            this.defaultValue = {};
+            this.open = false;
+          })
+          .catch((res) => {
+            console.log(res);
+            this.$modal.msgError("表单校验失败,请规范填写数据");
+          });
+      } else if (this.formType == "dragFormGroup") {
+        //表单组
+        // // console.log(this.$refs.formGroupRef);
+
+        let promiseArray = this.FormNameList.map((item) => {
+          return this.$refs.formGroupRef?.getFormData(item);
+        });
+        Promise.all(promiseArray).then(
+          async (res) => {
+            // 获取到所有表单数据
+            // console.log(res);
+            let mainFormData = res[0].data;
+            let data = {
+              basicMap: {
+                tableName: this.tableName,
+                // btnKey: btnData.btnKey,
+                btnKey: this.currentBtnData.btnKey,
+                BpmRunNodeFormDateVo: {},
+              },
+              conditionMap: {},
+              commMap: {},
+              btnParametersMap: {},
+            };
+
+            let btnParams =
+              JSON.parse(this.currentBtnData.btnParams)?.commonFieldData || [];
+            let conditionData =
+              JSON.parse(this.currentBtnData.btnParams)?.conditionData || [];
+            Object.keys(mainFormData).map((k) => {
+              data.commMap[k] = mainFormData[k];
+            });
+            btnParams.forEach((item) => {
+              data.btnParametersMap[item.fieldName.split(".")[1]] =
+                item.fieldValue
+                  ? item.fieldValue
+                  : this.currentRow[
+                      camelCase(item.fieldName.replace(".", "_"))
+                    ];
+            });
+            conditionData.forEach((item) => {
+              data.conditionMap[item.fieldName.split(".")[1]] = item.fieldValue
+                ? item.fieldValue
+                : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
+            });
+            data.basicMap.btnType = this.currentBtnData.btnType;
+            data.basicMap.visible = true;
+            let payLoad = {
+              insertCommonEntityList: [],
+              updateCommonEntityList: [],
+              deleteCommonEntityList: [],
+            };
+            if (this.currentBtnData.btnType == "UPDATE") {
+              // 准备删除数据
+              res.forEach((item, index) => {
+                let result = {};
+                if (index == 0) {
+                  //主表  主表不会是动态表格
+                  result = {
+                    basicMap: {
+                      tableName: item.tableName,
+                    },
+                    commMap: {
+                      ...item.data,
+                    },
+                    conditionMap: {},
+                  };
+                  //主表条件
+                  let conditionData =
+                    JSON.parse(this.currentBtnData.btnParams).conditionData ||
+                    [];
+                  conditionData.forEach((item) => {
+                    result.conditionMap[item.fieldName.split(".")[1]] =
+                      item.fieldValue
+                        ? item.fieldValue
+                        : this.currentRow[
+                            camelCase(item.fieldName.replace(".", "_"))
+                          ];
+                  });
+                  payLoad.updateCommonEntityList.push(result);
+                } else {
+                  // 从表条件
+                  let {
+                    formItem,
+                    relateFormItem,
+                    formType,
+                    defaultValue,
+                    tableName,
+                  } = item;
+                  if (formType == "batch") {
+                    //动态表格的修改
+                    let result = {};
+                    // 准备删除数据
+                    if (defaultValue[tableName]?.length) {
+                      let ids = defaultValue[tableName].map((item) => item.id);
+                      result = {
+                        basicMap: {
+                          tableName,
+                        },
+                        conditionMap: {
+                          id: ids,
+                        },
+                      };
+                      payLoad.deleteCommonEntityList.push(result);
+                    }
+                    // 准备新增数据
+                    result = this.getFormGroupBatchData(item, index, res);
+                    if (item.insertMap.length) {
+                      this.addInsertData(item.insertMap, result, res);
+                    }
+                    // 去除未修改数据的自动生成字段
+                    this.removeAutoField(result);
+                    console.log(result);
+                    payLoad.insertCommonEntityList.push(result);
+                  } else {
+                    //普通表格的修改
+                    result = {
+                      basicMap: {
+                        tableName: item.tableName,
+                      },
+                      commMap: {
+                        ...item.data,
+                      },
+                      conditionMap: {},
+                    };
+                    let fieldName = formItem.split(".")[1];
+                    let value =
+                      this.currentRow[
+                        camelCase(relateFormItem.replace(".", "_"))
+                      ];
+                    result.conditionMap[fieldName] = value;
+                    payLoad.updateCommonEntityList.push(result);
+                  }
+                }
+              });
+            } else if (this.currentBtnData.btnType == "INSERT") {
+              // 新增
+              let uuid = uuidv4().replace("-", "");
+              // console.log(uuid);
+              res.forEach((item, index) => {});
+              payLoad.insertCommonEntityList = res.map((item, index) => {
+                let result = {};
+                console.log(item);
+                // return;
+                if (item.data.batch) {
+                  //动态表格
+                  result = this.getFormGroupBatchData(item, index, res);
+                } else {
+                  result = {
+                    basicMap: {
+                      tableName: item.tableName,
+                    },
+                    addListMap: [
+                      {
+                        ...item.data,
+                      },
+                    ],
+                  };
+                  let { formItem, relateFormItem } = item;
+                  if (index == 0) {
+                    //主表单
+                    // 添加新增数据的关联条件
+
+                    // console.log(formItem);
+                    let mainFormKey = res[0].data[formItem.split(".")[1]];
+                    if (mainFormKey) {
+                      result.addListMap[0][formItem.split(".")[1]] =
+                        mainFormKey;
+                    } else {
+                      res[0].data[formItem.split(".")[1]] = uuid;
+                      result.addListMap[0][formItem.split(".")[1]] = uuid;
+                    }
+                  } else {
+                    //子表单
+                    result.addListMap[0][formItem.split(".")[1]] =
+                      res[0].data[relateFormItem.split(".")[1]];
+                  }
+                }
+                if (item.insertMap?.length) {
+                  this.addInsertData(item.insertMap, result, res);
+                }
+                return result;
+              });
+            } else if (this.currentBtnData.btnType == "INITIATED") {
+              // 按照单独的表单投产逻辑收集主表单数据
+              // let mainFormData = res[0].data;//主表单数据
+              // payLoad = {
+              //   basicMap: {
+              //     tableName: this.tableName,
+              //     // btnKey: btnData.btnKey,
+              //     btnKey: this.currentBtnData.btnKey,
+              //   },
+              //   addListMap: mainFormData,
+              //   conditionMap: {},
+              //   commMap: {},
+              //   btnParametersMap: {},
+              // };
+              // if (this.currentBtnData.btnParams) {
+              //   let btnParams =
+              //     JSON.parse(this.currentBtnData.btnParams)?.commonFieldData ||
+              //     [];
+              //   let conditionData =
+              //     JSON.parse(this.currentBtnData.btnParams).conditionData || [];
+              //   // let
+              //   btnParams.forEach((item) => {
+              //     payLoad.btnParametersMap[item.fieldName.split(".")[1]] =
+              //       item.fieldValue
+              //         ? item.fieldValue
+              //         : this.currentRow[
+              //             camelCase(item.fieldName.replace(".", "_"))
+              //           ];
+              //   });
+              //   conditionData.forEach((item) => {
+              //     payLoad.conditionMap[item.fieldName.split(".")[1]] =
+              //       item.fieldValue
+              //         ? item.fieldValue
+              //         : this.currentRow[
+              //             camelCase(item.fieldName.replace(".", "_"))
+              //           ];
+              //   });
+              // }
+              // if (Object.keys(this.defaultValue).length) {
+              //   // data.conditionMap[this.templateInfo.template?.primaryKey] =
+              //   //   this.defaultValue[this.templateInfo.template?.primaryKey];
+              //   Object.keys(mainFormData).map((k) => {
+              //     data.commMap[k] = mainFormData[k];
+              //   });
+              //   data.basicMap.btnType = this.currentBtnData.btnType;
+              //   data.basicMap.visible = true;
+              // } else {
+              //   data.basicMap.btnType = "INSERT";
+              //   data.basicMap.visible = true;
+              // }
+              // 添加表单组数据处理逻辑
+              payLoad.updateCommonEntityList = res.map((item, index) => {
+                let result = {
+                  basicMap: {
+                    tableName: item.tableName,
+                  },
+                  commMap: {
+                    ...item.data,
+                  },
+                  conditionMap: {},
+                };
+                if (index == 0) {
+                  //主表条件
+                  let conditionData =
+                    JSON.parse(this.currentBtnData.btnParams).conditionData ||
+                    [];
+                  conditionData.forEach((item) => {
+                    result.conditionMap[item.fieldName.split(".")[1]] =
+                      item.fieldValue
+                        ? item.fieldValue
+                        : this.currentRow[
+                            camelCase(item.fieldName.replace(".", "_"))
+                          ];
+                  });
+                } else {
+                  // 从表条件
+                  let { formItem, relateFormItem } = item;
+                  let fieldName = formItem.split(".")[1];
+                  let value =
+                    this.currentRow[
+                      camelCase(relateFormItem.replace(".", "_"))
+                    ];
+                  result.conditionMap[fieldName] = value;
+                }
+                return result;
+              });
+            }
+
+            data.basicMap.BpmRunNodeFormDateVo = payLoad;
+            // return;
+            try {
+              let res = await btnCommonApi(data);
+              if (res.code == 200) {
+                this.$message.success("操作成功");
+                this.getList();
+                this.defaultValue = {};
+                this.open = false;
+              } else {
+                console.log(res);
+                this.$message.error("网络异常,请稍后再试");
+              }
+            } catch (error) {
+              console.log(error);
+              this.$message.error("网络异常,请稍后再试");
+            }
+          },
+          (err) => {
+            // console.log(err);
+          }
+        );
+      } else {
+        // 没有绑定表单
+        let data = {
+          basicMap: {
+            tableName: this.tableName,
+            // btnKey: btnData.btnKey,
+            btnKey: this.currentBtnData.btnKey,
+            btnType: this.currentBtnData.btnType,
+            visible: true,
+          },
+          addListMap: [],
+          conditionMap: {},
+          commMap: {},
+          btnParametersMap: {},
+        };
+        if (this.currentBtnData.btnParams) {
+          let btnParams =
+            JSON.parse(this.currentBtnData.btnParams)?.commonFieldData || [];
+          let conditionData =
+            JSON.parse(this.currentBtnData.btnParams).conditionData || [];
+          conditionData.forEach((item) => {
+            data.conditionMap[item.fieldName.split(".")[1]] = item.fieldValue
+              ? item.fieldValue
+              : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
+          });
+          btnParams.forEach((item) => {
+            data.btnParametersMap[item.fieldName.split(".")[1]] =
+              item.fieldValue
+                ? item.fieldValue
+                : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
+          });
+        }
+        // data.basicMap.btnType = this.currentBtnData.btnType;
+        // data.basicMap.visible = true;
+        try {
+          let res = await btnCommonApi(data);
+          if (res.code == 200) {
+            this.$message.success("操作成功");
+          } else {
+            console.log(res);
+            this.$message.error("网络异常,请稍后再试");
+          }
+        } catch (error) {
+          console.log(error);
+          this.$message.error("网络异常,请稍后再试");
+        }
+        this.getList();
+        this.defaultValue = {};
+        this.open = false;
+      }
+    },
+    // 去除多余字段
+    removeAutoField(result) {
+      result.addListMap.forEach((item) => {
+        this.theAutoField.forEach((field) => {
+          delete item[field];
+        });
+      });
+    },
+    // 使用提交数据类型的按钮获取数据
+    tempSubBtn(getData) {
+      getData()
+        .then((values) => {
+          // console.log("验证通过", values);
+        })
+        .catch(() => {
+          // console.log("验证未通过,获取失败");
+        });
+    },
+    // 判断是否生效行样式
+    cellStyle({ row, column, rowIndex, columnIndex }) {
+      let rowStyleList = this.styleList.filter((item) => item.styleType == 0);
+      if (!rowStyleList.length) return "";
+      let mainTableName = this.templateInfo.querySql.tableAlias; //主表名
+      for (let i = 0; i < rowStyleList.length; i++) {
+        let item = rowStyleList[i];
+        let judgeRes = this.determineCondition(item.styleCondtion, row);
+        if (judgeRes) {
+          let styleCode = JSON.parse(item.styleCode);
+          return `background-color:${styleCode.rowBgColor};`;
+        }
+      }
+    },
+    // 获取生效条件组结果
+    determineCondition(conditionStr, row) {
+      let conditionList = JSON.parse(conditionStr);
+      if (!conditionList.length) return false;
+      return conditionList.every((item) => this.judgeOneCondition(item, row));
+    },
+    // 获取单个判断条件结果
+    judgeOneCondition(item, row) {
+      let fullField = camelCase(item.tableName + "_" + item.fieldName);
+      switch (item.condition) {
+        case 1:
+          return row[fullField] > item.flagValue;
+        case 2:
+          return row[fullField] < item.flagValue;
+        case 3:
+          return row[fullField] == item.flagValue;
+        case 4:
+          return row[fullField] >= item.flagValue;
+        case 5:
+          return row[fullField] <= item.flagValue;
+        default:
+          return true; //默认为true
+      }
+    },
+    // 设置表格字段样式
+    async setFieldStyleData(tableList) {
+      // console.log(JSON.parse(JSON.stringify(tableList)));
+      let fieldConditionList = this.styleList.filter(
+        (item) => item.styleType == 1 || item.styleType == 2
+      );
+      if (!fieldConditionList.length) return tableList;
+      let res = await this.setDictStyleData();
+
+      this.dictStyleObj = res.reduce((pre, item) => {
+        return {
+          ...pre,
+          ...item,
+        };
+      }, {});
+      // // console.log("this.dictStyleObj", this.dictStyleObj);
+      tableList.forEach((row) => {
+        // if (!row.styleFieldObj) row.styleFieldObj = {};
+        for (let i = 0; i < fieldConditionList.length; i++) {
+          let item = fieldConditionList[i];
+          if (item.styleType == 1) {
+            //字段样式
+            let judgeRes = this.determineCondition(item.styleCondtion, row);
+            if (judgeRes) {
+              let styleCode = JSON.parse(item.styleCode);
+              if (!row.styleFieldObj) row.styleFieldObj = {};
+              row.styleFieldObj[item.styleField] = {
+                styleType: item.styleType,
+                fieldStyleType: styleCode.fieldStyleType,
+                fontColor: styleCode.fontColor,
+                isTagFullBg: styleCode.isTagFullBg,
+                tagType: styleCode.tagType,
+              };
+              // row.styleField = item.styleField; //样式生效字段
+              // row.styleType = item.styleType; //0:行样式 1:字段样式 2:字典样式
+              // row.fieldStyleType = styleCode.fieldStyleType; //0:文本  1:标签
+              // row.fontColor = styleCode.fontColor;
+              // row.isTagFullBg = styleCode.isTagFullBg; //true/false
+              // row.tagType = styleCode.tagType; //string
+            }
+          } else {
+            //字典样式
+            let dicStyle = this.dictStyleObj[item.styleField]?.find((dict) => {
+              return dict.dictValue == row[item.styleField];
+            });
+            if (dicStyle) {
+              if (!row.styleFieldObj) row.styleFieldObj = {};
+              row.styleFieldObj[item.styleField] = dicStyle; //设置该字段应该显示的字典样式
+              row.styleFieldObj[item.styleField].styleType = 2;
+            }
+          }
+        }
+      });
+      return tableList;
+    },
+    //设置表格字典相关数据
+    setDictStyleData() {
+      let fieldConditionList = this.styleList.filter(
+        (item) => item.styleType == 2
+      );
+      if (!fieldConditionList.length) return;
+      let PromiseList = fieldConditionList.map((item) => {
+        return new Promise((resolve, reject) => {
+          let temp = {};
+          try {
+            listData({
+              isEnablePaging: false,
+              dictType: item.styleCondtion,
+            }).then((res) => {
+              temp[item.styleField] = res.rows;
+              resolve(temp);
+            });
+          } catch (error) {
+            reject(error);
+          }
+        });
+      });
+      return Promise.all(PromiseList);
+    },
+    // 内链页面跳转
+    routerHandler(btnData, type) {
+      let { url, commonFieldData } = JSON.parse(btnData.btnParams);
+      let tempArr = [];
+      if (commonFieldData) {
+        let queryArr = JSON.parse(commonFieldData);
+
+        tempArr = queryArr.map((item) => {
+          let key = this.formatField(item.fieldName, camelCase(this.tableName));
+          let value = item.fieldValue
+            ? item.fieldValue
+            : this.currentRow[item.fieldName];
+          return key + "=" + value;
+        });
+      }
+      if (tempArr.length) {
+        url += "?" + tempArr.join("&");
+      }
+      // let link = btnData.btnParams;
+      if (type == "INNERLINK") {
+        this.$router.push(url);
+      } else {
+        window.open("http://" + url, "_blank");
+      }
+    },
+    // 操作列回调
+    excuteHandler(btnData, row) {
+      // console.log("btnData", btnData, row);
+      let { btnType, btnParams, btnFormType } = btnData;
+      this.currentBtnData = btnData;
+      this.currentRow = JSON.parse(JSON.stringify(row));
+      // 无表单
+      if (btnFormType == "noNeed" && btnType != "UPDATE") {
+        this.noNeedHandler(btnData, row);
+        return;
+      }
+
+      switch (btnType) {
+        case "INNERLINK":
+          this.routerHandler(btnData, btnType);
+          break;
+        case "OUTLINK":
+          this.routerHandler(btnData, btnType);
+          break;
+        case "UPDATE":
+          this.handleUpdate(row, btnData);
+          break;
+        case "EXECUTE":
+          this.handleUpdate(row, btnData);
+          break;
+        case "INITIATED":
+          this.handleUpdate(row, btnData);
+          break;
+        case "DELETE":
+          this.handleDelete(row, btnData);
+          break;
+        case "INSERT":
+          this.handleUpdate(row, btnData);
+          break;
+        case "PRINT":
+          this.printHandler(btnData, row);
+          break;
+        case "viewPurchaseOrderDetails":
+          this.viewPurchaseOrderDetails(btnData, row);
+          break;
+        default:
+          break;
+      }
+    },
+    // 顶部按钮回调
+    topBtnHandler(btnData) {
+      console.log(btnData);
+      let { btnType, btnParams, btnFormType } = btnData;
+      let row = this.selection[0] || [];
+      this.currentBtnData = btnData;
+      this.currentRow = JSON.parse(JSON.stringify(row));
+      // 无表单
+      if (
+        btnFormType == "noNeed" &&
+        btnType != "IMPORT" &&
+        btnType != "EXPORT" &&
+        btnType != "DELETE" &&
+        btnType != "UPDATE" &&
+        btnType != "INSERT" &&
+        btnType != "PRINT"
+      ) {
+        this.noNeedHandler(btnData, row);
+        return;
+      }
+
+      switch (btnType) {
+        case "INNERLINK":
+          this.routerHandler(btnData, btnType);
+          break;
+        case "OUTLINK":
+          this.routerHandler(btnData, btnType);
+          break;
+        case "UPDATE":
+          this.handleUpdate(row, btnData);
+          break;
+        case "EXECUTE":
+          this.handleUpdate(row, btnData);
+          break;
+        case "INITIATED":
+          this.handleUpdate(row, btnData);
+          break;
+        case "DELETE":
+          this.handleBatchDelete();
+          break;
+        case "INSERT":
+          this.handleUpdate(row, btnData);
+          break;
+        case "IMPORT":
+          this.upload.open = true;
+          break;
+        case "EXPORT":
+          this.handleExport();
+          break;
+        case "PRINT":
+          this.printHandler(btnData, row);
+          break;
+        default:
+          break;
+      }
+    },
+    // 打印回调
+    printHandler(btnData, row) {
+      // 发送请求获取打印数据
+      this.printShow = true;
+      this.printHtml = printHtml;
+      this.$nextTick(() => {
+        this.$refs.detailTable.innerHTML = this.printHtml;
+      });
+    },
+    // 确认打印回调
+    confirmPrint() {
+      document.body.innerHTML = document.getElementById("printDom").innerHTML =
+        this.printHtml;
+      window.print(); //打印
+      window.location.reload();
+      return false;
+    },
+    noNeedHandler(btnData, row) {
+      this.$modal
+        .confirm("是否确认执行该操作?")
+        .then(async () => {
+          // 获取默认参数
+          let data = {
+            basicMap: {
+              tableName: this.tableName,
+              // btnKey: btnData.btnKey,
+              btnKey: this.currentBtnData.btnKey,
+            },
+            conditionMap: {},
+            commMap: {},
+            btnParametersMap: {},
+          };
+          // console.log(this.currentBtnData, this.currentRow);
+          if (this.currentBtnData.btnParams) {
+            let conditionData =
+              JSON.parse(this.currentBtnData.btnParams).conditionData || [];
+            // let
+            let commonData =
+              JSON.parse(this.currentBtnData.btnParams).commonFieldData || [];
+
+            conditionData.forEach((item) => {
+              data.conditionMap[item.fieldName.split(".")[1]] = item.fieldValue
+                ? item.fieldValue
+                : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
+            });
+            commonData.forEach((item) => {
+              data.btnParametersMap[item.fieldName.split(".")[1]] =
+                item.fieldValue
+                  ? item.fieldValue
+                  : this.currentRow[
+                      camelCase(item.fieldName.replace(".", "_"))
+                    ];
+            });
+          }
+          data.basicMap.btnType = this.currentBtnData.btnType;
+          data.basicMap.visible = true;
+          try {
+            let res = await btnCommonApi(data);
+            if (res.code == 200) {
+              this.$message.success(res.msg);
+            } else {
+              console.error(res.msg);
+              this.$message.error("网络异常,请稍后再试");
+            }
+          } catch (error) {
+            console.error(error);
+            this.$message.error("网络异常,请稍后再试");
+          }
+        })
+        .then(() => {
+          // 调用子组件查询方法 目的是携带上子组件中的查询参数
+          this.$refs.mychild.pageList();
+          // this.$modal.msgSuccess("操作成功");
+        })
+        .catch(() => {});
+    },
+
+    // k-form-build表单变化回调
+    formChangeHandler(value, label) {
+      // // console.log(value, label);
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.tableDiv{
+  margin-top: 20px;
+}
+.titleDiv{
+  display: flex;
+  justify-content: space-between;
+  i{
+    font-style: normal;
+    font-weight: 900;
+    color: #000000;
+  }
+}
+::v-deep .el-dialog:not(.is-fullscreen) {
+  min-width: 610px !important;
+}
+
+</style>

+ 116 - 0
zkqy-ui/src/views/orderMange/purchase/print.js

@@ -0,0 +1,116 @@
+let printHtml = `<div class="table" style="display: flex;">
+    <table style="width:900px; border-collapse:collapse;" border="1" cellpadding="10" align="center">
+      <tbody>
+        <tr>
+          <td width="900px" colspan="6" style="font-size: 20px;font-weight: 700;text-align: center;">检验单</td>
+
+        </tr>
+        <tr align="center">
+          <td width="300px" colspan="2">产品名称</td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+        </tr>
+        <!-- 物理指标 -->
+        <tr align="center">
+          <td width="150px" rowspan="5">物理指标</td>
+          <td width="150px">强度</td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+        </tr>
+        <tr align="center">
+          <td width="150px">伸长率</td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+        </tr>
+        <tr align="center">
+          <td width="150px">纤度</td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+        </tr>
+        <tr align="center">
+          <td width="150px">含油率</td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+        </tr>
+        <tr align="center">
+          <td width="150px">沸水收缩率</td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+        </tr>
+        <!-- 外观指标 -->
+        <tr align="center">
+          <td width="150px" rowspan="7">外观指标</td>
+          <td width="150px">毛丝</td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+        </tr>
+        <tr align="center">
+          <td width="150px">圈丝</td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+        </tr>
+        <tr align="center">
+          <td width="150px">蛛网丝</td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+        </tr>
+        <tr align="center">
+          <td width="150px">成形不良</td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+        </tr>
+        <tr align="center">
+          <td width="150px">无油</td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+        </tr>
+        <tr align="center">
+          <td width="150px">色差丝</td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+        </tr>
+        <tr align="center">
+          <td width="150px">污丝</td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+          <td width="150px"></td>
+        </tr>
+        <tr align="center">
+          <td width="150px">检验时间</td>
+          <td width="150px"></td>
+          <td width="150px">检验人员</td>
+          <td width="150px"></td>
+          <td width="150px">备注</td>
+          <td width="150px"></td>
+        </tr>
+
+      </tbody>
+    </table>
+  </div>`
+
+export default printHtml