Sfoglia il codice sorgente

feat:码单列表选择仓库入库

lucky 2 mesi fa
parent
commit
4d0c57e41a

+ 20 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/controller/ProductInventoryController.java

@@ -8,8 +8,10 @@ import javax.servlet.http.HttpServletResponse;
 
 import com.zkqy.business.domain.*;
 import com.zkqy.business.domain.vo.ProductCodeListVO;
+import com.zkqy.business.domain.vo.ProductInventoryTypeTotalSubCodeList;
 import com.zkqy.business.domain.vo.ProductInventoryVo;
 import com.zkqy.business.domain.vo.ProductInvoiceVO;
+import com.zkqy.business.mapper.ProductCodeListMapper;
 import com.zkqy.business.mapper.ProductionMapper;
 import com.zkqy.common.utils.DateUtils;
 import io.swagger.annotations.Api;
@@ -42,6 +44,8 @@ public class ProductInventoryController extends BaseController {
     @Autowired
     private ProductionMapper productionMapper;
 
+
+
     /**
      * 查询产品库存列表
      */
@@ -54,6 +58,22 @@ public class ProductInventoryController extends BaseController {
         return getDataTable(list);
     }
 
+
+    @PostMapping("/selectCodeListWarehousing")
+    @ApiOperation(value = "查询产品库存列表")
+    public AjaxResult SelectCodeListWarehousing(@RequestBody ProductInventoryTypeTotalSubCodeList productInventoryTypeTotalSubCodeList) {
+
+        int i = productInventoryService.selectCodeListWarehousing(productInventoryTypeTotalSubCodeList);
+        if(i>0){
+            return AjaxResult.success("入库成功");
+        }else {
+            return AjaxResult.success("入库失败");
+        }
+
+    }
+
+
+
     /**
      * 导出产品库存列表
      */

+ 28 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/domain/vo/ProductCodeListVO.java

@@ -23,6 +23,34 @@ public class ProductCodeListVO extends BaseEntity {
     @Excel(name = "品名")
     private String productName;
 
+
+
+
+    /**
+     * 仓库姓名
+     */
+    private  String  warehouseName;
+
+    public String getWarehouseName() {
+        return warehouseName;
+    }
+
+    public void setWarehouseName(String warehouseName) {
+        this.warehouseName = warehouseName;
+    }
+
+
+    @Excel
+    private  String tabPosition;
+
+    public String getTabPosition() {
+        return tabPosition;
+    }
+
+    public void setTabPosition(String tabPosition) {
+        this.tabPosition = tabPosition;
+    }
+
     /**
      * 规格
      */

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

@@ -4,7 +4,9 @@ import java.util.List;
 
 import com.zkqy.business.domain.ProductCodeList;
 import com.zkqy.business.domain.vo.ProductCodeListVO;
+import com.zkqy.business.domain.vo.ProductInventoryTypeTotalSubCodeList;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 产品码单Mapper接口
@@ -101,7 +103,7 @@ public interface ProductCodeListMapper {
      */
     String selectMaxCodeList();
 
-    /**
+    /**++++++++
      * 根据码单号查询码单信息
      */
     List<ProductCodeList> selectProductCodeListByQrCode(String qrCode);
@@ -116,4 +118,9 @@ public interface ProductCodeListMapper {
      */
     ProductCodeListVO getProductCodeListById(Long id);
 
+    /**
+     * 根据码单号查询码单信息
+     * @return
+     */
+    List<ProductCodeList> selectProductCodeListByQrCodeIn(@Param("list") List<String> list);
 }

+ 19 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/service/IProductInventoryService.java

@@ -6,9 +6,12 @@ import java.util.Map;
 import com.zkqy.business.domain.ProductInventory;
 import com.zkqy.business.domain.ProductInvoice;
 import com.zkqy.business.domain.vo.ProductCodeListVO;
+import com.zkqy.business.domain.vo.ProductInventoryTypeTotalSubCodeList;
 import com.zkqy.business.domain.vo.ProductInventoryVo;
 import com.zkqy.business.domain.vo.ProductInvoiceVO;
+import com.zkqy.business.mapper.ProductCodeListMapper;
 import com.zkqy.common.core.domain.AjaxResult;
+import org.springframework.beans.factory.annotation.Autowired;
 
 /**
  * 产品库存Service接口
@@ -33,6 +36,14 @@ public interface IProductInventoryService {
      */
     public List<ProductInventory> selectProductInventoryList(ProductInventory productInventory);
 
+
+    /**
+     * 选择码单入库操作
+     * @param productInventoryTypeTotalSubCodeList
+     * @return
+     */
+    public int selectCodeListWarehousing(ProductInventoryTypeTotalSubCodeList productInventoryTypeTotalSubCodeList);
+
     /**
      * 新增产品库存
      *
@@ -68,7 +79,7 @@ public interface IProductInventoryService {
     /**
      * 成品入库
      */
-    void productStorage(List<ProductCodeListVO> productCodeListVOList);
+    String productStorage(List<ProductCodeListVO> productCodeListVOList);
 
     /**
      * 成品出库
@@ -167,4 +178,11 @@ public interface IProductInventoryService {
      * @return
      */
     int oldInventoryGoOut(ProductInventoryVo productInventoryVo);
+
+    /**
+     * 二次入库逻辑
+     * @param productCodeListVOList
+     * @return
+     */
+    String productStorageTwo(List<ProductCodeListVO> productCodeListVOList);
 }

+ 14 - 14
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/ProductCodeListServiceImpl.java

@@ -205,21 +205,21 @@ public class ProductCodeListServiceImpl implements IProductCodeListService {
         productCodeList.setCreateById(SecurityUtils.getUserId());
         productCodeListMapper.insertProductCodeList(productCodeList);
         // 直接入库--
-        // vo.getMachineTool();  // 当前机台
-        String bumen = vo.getMachineToolNo().split("-")[0];
-        List<SysDictData> dictDataList = dictDataMapper.selectDictDataByType("section_stash");
-        dictDataList.forEach(item -> {
-            if (item.getDictLabel().equals(bumen)) {
-                vo.setWarehouseId(Long.valueOf(item.getDictValue()));// 入库仓库ID
-            }
-        });
-        if (vo.getOtherStates() == 1) { // 如果当前打印的为总码单则不尽行累加库存
-            return productCodeList.getId();
-        }
-        List<ProductCodeListVO> productCodeListVOList = new ArrayList<>();
-        productCodeListVOList.add(vo);
+//         vo.getMachineTool();  // 当前机台
+//        String bumen = vo.getMachineToolNo().split("-")[0];
+//        List<SysDictData> dictDataList = dictDataMapper.selectDictDataByType("section_stash");
+//        dictDataList.forEach(item -> {
+//            if (item.getDictLabel().equals(bumen)) {
+//                vo.setWarehouseId(Long.valueOf(item.getDictValue()));// 入库仓库ID
+//            }
+//        });
+//        if (vo.getOtherStates() == 1) { // 如果当前打印的为总码单则不尽行累加库存
+//            return productCodeList.getId();
+//        }
+//        List<ProductCodeListVO> productCodeListVOList = new ArrayList<>();
+//        productCodeListVOList.add(vo);
         // 入库
-        iProductInventoryService.productStorage(productCodeListVOList);
+//        iProductInventoryService.productStorage(productCodeListVOList);
         return productCodeList.getId();
     }
 

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

@@ -7,6 +7,7 @@ import java.util.stream.Collectors;
 import cn.hutool.core.util.RandomUtil;
 import com.zkqy.business.domain.*;
 import com.zkqy.business.domain.vo.ProductCodeListVO;
+import com.zkqy.business.domain.vo.ProductInventoryTypeTotalSubCodeList;
 import com.zkqy.business.domain.vo.ProductInventoryVo;
 import com.zkqy.business.domain.vo.ProductInvoiceVO;
 import com.zkqy.business.mapper.*;
@@ -67,6 +68,9 @@ public class ProductInventoryServiceImpl implements IProductInventoryService {
     @Autowired
     private IProductOutboundRecordService productOutboundRecordService;
 
+    @Autowired
+    private IProductInventoryService iProductInventoryService;
+
     /**
      * 查询产品库存
      *
@@ -89,6 +93,83 @@ public class ProductInventoryServiceImpl implements IProductInventoryService {
         return productInventoryMapper.selectProductInventoryList(productInventory);
     }
 
+    @Override
+    public int selectCodeListWarehousing(ProductInventoryTypeTotalSubCodeList productInventoryTypeTotalSubCodeList) {
+
+
+//        //普通码单
+//        if(productInventoryTypeTotalSubCodeList.getOtherStates().equals("0")){
+//            //总码单信息
+//            List<ProductCodeList> productCodeLists = productCodeListMapper.selectProductCodeListByQrCodeIn(productInventoryTypeTotalSubCodeList);
+//
+//            //List容器集合
+//            List<ProductCodeListVO> productCodeListVOList = new ArrayList<>();
+//
+//            //循环Copy相关内容
+//            productCodeLists.stream().forEach(item->{
+//                ProductCodeListVO productCodeListVO=new ProductCodeListVO();
+//                BeanUtils.copyProperties(item,productCodeListVO);
+//                productCodeListVOList.add(productCodeListVO);
+//            });
+//            //入库操作Or修改库存成功
+//            String s = iProductInventoryService.productStorage(productCodeListVOList);
+//            if(s.equals("入库成功")){
+//                return 1;
+//            }
+//        }else {
+//            //子码单信息
+//            List<ProductCodeList> productCodeLists = productCodeListMapper.selectProductCodeListByQrCodeIn(productInventoryTypeTotalSubCodeList);
+//
+//            //List容器集合
+//            List<ProductCodeListVO> productCodeListVOList = new ArrayList<>();
+//
+//            //循环Copy相关内容
+//            productCodeLists.stream().forEach(item->{
+//                ProductCodeListVO productCodeListVO=new ProductCodeListVO();
+//                BeanUtils.copyProperties(item,productCodeListVO);
+//                productCodeListVOList.add(productCodeListVO);
+//            });
+//
+//            //入库操作Or修改库存成功
+//            String s = iProductInventoryService.productStorage(productCodeListVOList);
+//            if(s.equals("入库成功")){
+//                return 1;
+//            }
+//
+//        }
+
+            List<ProductCodeList> productCodeLists = productCodeListMapper.selectProductCodeListByQrCodeIn(productInventoryTypeTotalSubCodeList.getListCodeWarehousing());
+
+            //List容器集合
+            List<ProductCodeListVO> productCodeListVOList = new ArrayList<>();
+
+            //循环Copy相关内容
+            productCodeLists.stream().forEach(item->{
+
+                ProductCodeListVO productCodeListVO=new ProductCodeListVO();
+                BeanUtils.copyProperties(item,productCodeListVO);
+                //库存信息
+                productCodeListVO.setWarehouseId(Long.valueOf(productInventoryTypeTotalSubCodeList.getWarehouseId()));
+                //列表信息
+                productCodeListVOList.add(productCodeListVO);
+            });
+
+            //入库操作Or修改库存成功
+            String s = iProductInventoryService.productStorageTwo(productCodeListVOList);
+
+            //修改码单的库位信息
+
+            if(s.equals("入库成功")){
+                productCodeLists.forEach(item->{
+                       item.setWarehouseregionId(Long.valueOf(productInventoryTypeTotalSubCodeList.getWarehouseId()));
+                       productCodeListMapper.updateProductCodeList(item);//更改码单的库位信息
+                });
+                return 1;
+            }
+            //入库失败
+            return 0;
+    }
+
     /**
      * 新增产品库存
      *
@@ -137,7 +218,7 @@ public class ProductInventoryServiceImpl implements IProductInventoryService {
 
     @Override
     @Transactional
-    public void productStorage(List<ProductCodeListVO> productCodeListVOList) {
+    public String productStorage(List<ProductCodeListVO> productCodeListVOList) {
 
         for (ProductCodeListVO vo : productCodeListVOList) {
             // 日志
@@ -197,6 +278,7 @@ public class ProductInventoryServiceImpl implements IProductInventoryService {
                 productInventoryMapper.insertProductInventory(addProductInventory);
             }
         }
+        return "入库成功";
     }
 
     @Override
@@ -1017,6 +1099,69 @@ public class ProductInventoryServiceImpl implements IProductInventoryService {
         return productInventoryMapper.updateProductInventory(productInventory);
     }
 
+    @Override
+    public String productStorageTwo(List<ProductCodeListVO> productCodeListVOList) {
+        for (ProductCodeListVO vo : productCodeListVOList) {
+            // 日志
+            ProductCodeList productCodeList = new ProductCodeList(vo);
+            //校验当前货品是否已入库,已入库跳过本次循环
+            ProductWarehousingRecord productWarehousingRecord1 =
+                    productWarehousingRecordMapper.selectProductWarehousingRecordWhetherExist(productCodeList.getQrCode(), vo.getQrCodeId());
+            if (productWarehousingRecord1 != null) {
+                continue;
+            }
+            // 入库记录信息
+            ProductWarehousingRecord productWarehousingRecord = new ProductWarehousingRecord();
+            BeanUtils.copyProperties(productCodeList, productWarehousingRecord);
+            productWarehousingRecord.setQrCodeId(vo.getQrCodeId());
+            productWarehousingRecord.setCanisterNum(vo.getCanisterNum());//筒数
+            productWarehousingRecord.setSuttle(vo.getSuttle());//净重
+            productWarehousingRecord.setGrossWeight(vo.getGrossWeight());//毛重
+            productWarehousingRecord.setCreateBy(SecurityUtils.getUsername());
+            productWarehousingRecord.setCreateTime(DateUtils.getNowDate());
+            productWarehousingRecord.setCreateById(SecurityUtils.getUserId());
+            productWarehousingRecord.setDepositor(SecurityUtils.getLoginUser().getUser().getNickName());//入库人
+            productWarehousingRecord.setWarehousingTime(DateUtils.getNowDate());
+            productWarehousingRecord.setWarehouseId(vo.getWarehouseId());//入库仓库编号
+            productWarehousingRecord.setRemark(productCodeList.getRemark());
+            productWarehousingRecordMapper.insertProductWarehousingRecord(productWarehousingRecord);
+            // 库存
+            //查询当前库存是否存在,如果存在则更新,如果不存在则新增
+            ProductInventory productInventory = productInventoryMapper.selectProductInventoryByQrCode(vo.getQrCode());
+            if (productInventory != null) {
+                //计算合计箱数、筒数、净重、毛重
+                ProductInventory editProductInventory = new ProductInventory();
+                editProductInventory.setId(productInventory.getId());
+                editProductInventory.setTotalCanisterNum(productInventory.getTotalCanisterNum() == null ? vo.getCanisterNum() : productInventory.getTotalCanisterNum() + vo.getCanisterNum());//合计筒数数
+                editProductInventory.setTotalBoxNum(productInventory.getTotalBoxNum() + 1);//合计箱数
+                Double suttle = productInventory.getTotalSuttle() == null ? vo.getSuttle() : productInventory.getTotalSuttle() + vo.getSuttle();
+                DecimalFormat df = new DecimalFormat("0.00");
+                String suttle1 = df.format(suttle);
+                editProductInventory.setTotalSuttle(Double.parseDouble(suttle1));//合计净重
+                Double grossWeight = productInventory.getTotalGrossWeight() == null ? vo.getGrossWeight() : productInventory.getTotalGrossWeight() + vo.getGrossWeight();
+                String grossWeight1 = df.format(grossWeight);
+                editProductInventory.setTotalGrossWeight(Double.parseDouble(grossWeight1));//合计毛重
+                editProductInventory.setUpdateById(SecurityUtils.getUserId());
+                editProductInventory.setUpdateBy(SecurityUtils.getUsername());
+                editProductInventory.setUpdateTime(DateUtils.getNowDate());
+                productInventoryMapper.updateProductInventory(editProductInventory);
+            } else {
+                ProductInventory addProductInventory = new ProductInventory();
+                BeanUtils.copyProperties(productCodeList, addProductInventory);
+                addProductInventory.setWarehouseId(vo.getWarehouseId());
+                addProductInventory.setTotalCanisterNum(vo.getCanisterNum());//合计筒数
+                addProductInventory.setTotalBoxNum(1);//合计箱数
+                addProductInventory.setTotalSuttle(vo.getSuttle());//合计净重
+                addProductInventory.setTotalGrossWeight(vo.getGrossWeight());//合计毛重
+                addProductInventory.setCreateBy(SecurityUtils.getUsername());
+                addProductInventory.setCreateTime(DateUtils.getNowDate());
+                addProductInventory.setCreateById(SecurityUtils.getUserId());
+                productInventoryMapper.insertProductInventory(addProductInventory);
+            }
+        }
+        return "入库成功";
+    }
+
     //保留两位小数
     public Double handlingWeight(Double weight) {
         DecimalFormat df = new DecimalFormat("0.00");

+ 37 - 3
zkqy-custom-business/src/main/resources/mapper/business/ProductCodeListMapper.xml

@@ -90,6 +90,7 @@
         <result property="saleProductId" column="sale_product_id"/>
         <result property="otherStates" column="other_states"/>
         <result property="parentCode" column="parent_code"/>
+        <result property="warehouseName" column="warehouseName"/>
     </resultMap>
 
     <sql id="selectProductCodeListVo">
@@ -143,7 +144,8 @@
         pcl.product_colour as product_color,
         sc.direction_of_twist as directionOfTwist,
         p.product_name AS product_name,
-        p.product_specifications AS product_specifications
+        p.product_specifications AS product_specifications,
+        wh.warehouse_name as warehouseName
         from
         {DBNAME}.product_code_list pcl
         left join {DBNAME}.production p on
@@ -152,6 +154,8 @@
         sp.id = pcl.sale_product_id
         left join {DBNAME}.sale_craft sc on
         sp.sale_order_no = sc.sale_order_no
+        left join {DBNAME}.warehouse wh on
+        pcl.warehouseregion_id=wh.id
         WHERE
         pcl.del_flag = '0'
         AND pcl.other_states = 1
@@ -162,6 +166,12 @@
         <if test="productSpecifications != null and productSpecifications != ''">and p.product_specifications =
             #{productSpecifications}
         </if>
+        <if test="tabPosition!=0 and tabPosition==1">
+            AND pcl.warehouseregion_id is not null
+        </if>
+        <if test="tabPosition!=0 and tabPosition==2">
+            AND pcl.warehouseregion_id is null or pcl.warehouseregion_id=""
+        </if>
         <if test="productColor != null and productColor != ''">and pcl.product_colour = #{productColor}</if>
         GROUP BY
         pcl.qr_code
@@ -175,7 +185,8 @@
         p.product_name AS product_name,
         p.product_specifications AS product_specifications,
         pcl.product_colour as product_color,
-        sc.direction_of_twist as directionOfTwist
+        sc.direction_of_twist as directionOfTwist,
+        wh.warehouse_name as warehouseName
         from
         {DBNAME}.product_code_list pcl
         left join {DBNAME}.product_code_list parent on
@@ -186,6 +197,8 @@
         sp.id = pcl.sale_product_id
         left join {DBNAME}.sale_craft sc on
         sp.sale_order_no = sc.sale_order_no
+        left join {DBNAME}.warehouse wh on
+        pcl.warehouseregion_id=wh.id
         where
         pcl.other_states = 0
         and parent.id is null
@@ -198,6 +211,12 @@
         <if test="productSpecifications != null and productSpecifications != ''">and p.product_specifications =
             #{productSpecifications}
         </if>
+        <if test="tabPosition!=0 and tabPosition==1">
+            AND pcl.warehouseregion_id is not null
+        </if>
+        <if test="tabPosition!=0 and tabPosition==2">
+            AND pcl.warehouseregion_id is null or pcl.warehouseregion_id=""
+        </if>
         <if test="productColor != null and productColor != ''">and pcl.product_colour = #{productColor}</if>
         order by pcl.id desc
     </select>
@@ -543,4 +562,19 @@
         where pcl.del_flag = '0' and p.del_flag = '0' and pcl.id = #{id}
     </select>
 
-</mapper>
+    <select id="selectProductCodeListByQrCodeIn" resultType="com.zkqy.business.domain.ProductCodeList" parameterType="list">
+        SELECT *
+        FROM {DBNAME}.product_code_list pcl
+                LEFT JOIN {DBNAME}.production p
+        ON pcl.product_id = p.id
+        where p.del_flag = '0'
+        <if test="list != null">
+            and
+            qr_code in
+            <foreach item="id" collection="list" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+    </select>
+
+</mapper>

+ 1 - 1
zkqy-ui/src/api/amichi/ringScanInformation/index.js

@@ -82,7 +82,7 @@ export function updateInformation(data) {
 // 删除指环王扫描日志信息
 export function delInformation(id) {
   return request({
-    url: '/amichi/ringScanInformation' + id,
+    url: '/amichi/ringScanInformation/' + id,
     method: 'delete'
   })
 }

+ 9 - 0
zkqy-ui/src/api/codeListManage/productCodeList.js

@@ -19,6 +19,15 @@ export function getProductCodeList(id) {
   })
 }
 
+
+export function selectCodeListWarehousing(data) {
+  return request({
+    url: '/system/ProductInventory/selectCodeListWarehousing',
+    method: 'post',
+    data: data,
+    //baseURL: process.env.VUE_APP_BASE_API1
+  })
+}
 // 新增产品码单
 export function addProductCodeList(data) {
   return request({

+ 116 - 0
zkqy-ui/src/views/orderMange/codeListManage/index.vue

@@ -113,12 +113,31 @@
             >导出
           </el-button>
         </el-col>
+        <el-col :span="1.5">
+          <el-button
+            type="success"
+            plain
+            icon="el-icon-circle-plus-outline"
+            size="mini"
+            @click="rk"
+            v-hasPermi="['system:productCodeList:export']"
+          >入库
+          </el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-radio-group v-model="queryParams.tabPosition" style="float: right;margin-left: 200px" size="small"  @change="tabHandleClick" >
+            <el-radio-button label="0">全部</el-radio-button>
+            <el-radio-button label="1">已入库</el-radio-button>
+            <el-radio-button label="2">未入库</el-radio-button>
+          </el-radio-group>
+        </el-col>
         <right-toolbar
           :showSearch.sync="showSearch"
           @queryTable="getList"
         ></right-toolbar>
       </el-row>
 
+
       <el-table
         v-loading="loading"
         :data="productCodeListList"
@@ -141,6 +160,7 @@
         <el-table-column label="净重" align="center" prop="suttle" />
         <el-table-column label="外贸号" align="center" prop="foreignTradeNumber" />
         <el-table-column label="备注" align="center" prop="remark" />
+        <el-table-column label="仓库" align="center" prop="warehouseName"></el-table-column>
         <el-table-column
           label="操作"
           align="center"
@@ -472,6 +492,26 @@
           <el-button @click="handleClose">关 闭</el-button>
         </div>
       </el-dialog>
+
+      <el-dialog
+        title="选择入库仓库"
+        :visible.sync="cKdialogVisible"
+        width="30%"
+
+        :before-close="handleClose">
+        <el-select v-model="rKPayLoad.warehouseId" placeholder="请选择"  style="width: 100%">
+          <el-option
+            v-for="item in warehouseList"
+            :key="item.id"
+            :label="item.warehouseName"
+            :value="item.id">
+          </el-option>
+        </el-select>
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="cKdialogVisible = false">取 消</el-button>
+            <el-button type="primary" @click="isRk">确 定</el-button>
+         </span>
+      </el-dialog>
     </div>
   </el-card>
 </template>
@@ -493,10 +533,12 @@ import {
   getPrintDataNew,
   removeProductCodeASInventory,
   updateAssembleProductCode,
+  selectCodeListWarehousing
 } from "@/api/codeListManage/productCodeList";
 import codeListPrint from "@/utils/print/codeListPrint";
 import { getServerPrintData } from "@/utils/print/printUtils";
 import { v4 as uuidv4 } from "uuid";
+import {checkOldInventory, oldNoticeOutStorage, queryDropDownBoxData} from "@/api/tablelist/commonTable";
 
 export default {
   name: "ProductCodeList",
@@ -509,6 +551,13 @@ export default {
   ],
   data() {
     return {
+      warehouseList: [],
+      rKPayLoad:{
+        warehouseId: '', //仓库信息
+        listCodeWarehousing:[], //选择的码单集合列表
+        otherStates:'1' // 0 普通码单 1 总码单
+      },
+      cKdialogVisible:false,
       // 修改/补码 数据  start
       currentProductRow: {}, //当前产品行
       changeDialogVisible: false,
@@ -654,6 +703,7 @@ export default {
       open: false,
       // 查询参数
       queryParams: {
+        tabPosition:0,
         otherStates: "1",
         pageNum: 1,
         pageSize: 10,
@@ -671,6 +721,7 @@ export default {
   },
   created() {
     this.getList();
+    this.initWarehouse();
   },
   watch: {
     tableData: {
@@ -722,9 +773,72 @@ export default {
   },
 
   methods: {
+    tabHandleClick(){
+      this.getList();
+    },
+    isRk(){
+      this.$confirm("是否确认入库?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+               //发送入库请求
+          console.log("发送入库请求")
+          let res = await selectCodeListWarehousing(this.rKPayLoad);
+          if (res.code == 200) {
+            this.$message.success("请先选择入库数据");
+          } else {
+            this.$message.error("请先选择入库数据");
+          }
+          this.cKdialogVisible=false;
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消入库",
+          });
+        });
+    },
+    async rklj(data) {
+
+    },
+    // 初始化仓库选项数据
+    async initWarehouse() {
+      try {
+        let payload = [
+          {
+            basicMap: {
+              tableName: "warehouse",
+            },
+            conditionMap: {
+              warehouse_type: ["1"],
+            },
+          },
+        ];
+        let res = await queryDropDownBoxData(payload);
+        if (res.code == 200) {
+          this.warehouseList = res.data.resultMap?.warehouse || [];
+        } else {
+          throw new Error(res.msg);
+        }
+      } catch (error) {}
+    },
+    rk(){
+      //入库操作
+      console.log("入库操作")
+      if(this.ids.length<=0){
+        this.$message.warning("请先选择入库数据");
+        return;
+      }
+
+      this.cKdialogVisible=true;
+      console.log("码单号数据",this.ids);
+    },
     // 弹窗关闭回调
     handleClose() {
       this.changeDialogVisible = false;
+      this.cKdialogVisible=false;
       this.getList();
     },
     // 校验表格数据状态
@@ -1697,6 +1811,7 @@ export default {
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;
+      this.rKPayLoad.otherStates=this.queryParams.otherStates
       this.getList();
     },
     /** 重置按钮操作 */
@@ -1707,6 +1822,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map((item) => item.qrCode);
+      this.rKPayLoad.listCodeWarehousing=selection.map((item) => item.qrCode);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },

+ 3 - 2
zkqy-ui/src/views/orderMange/codeListManage/printIndex.vue

@@ -769,7 +769,8 @@ export default {
       if (inputElement) {
         inputElement.focus();
       }
-    }
+    };
+
   },
   beforeDestroy() {
     this.closeWebSocket();
@@ -1043,7 +1044,7 @@ export default {
           shouldPrint = false; // 重量为0时,重置打印标志
           return;
         }
-
+        console.log(minimumWeight,"最小重量")
         if (weight <= minimumWeight) {
           console.log("hmc后端自动打印逻辑3")
           this.resetWeightStatus();