VueWebApi/DLL/DAL/AppPurchManagementDAL.cs
@@ -356,9 +356,22 @@
            try
            {
                //判断条码状态
                mes = LabCodeStatusMessage.LabCodeStatus("2060", "1103", labcode);//功能编号、单据类型编码、标签编码
                mes = LabCodeStatusMessage.LabCodeStatus("2060", "1103", labcode);//功能编号(采购到货)、单据类型编码(采购到货单)、标签编码
                if (mes.code == "300")
                {
                    return mes;
                }
                //判断标签状态(是否已入库(不能再入))
                sql = @"select * from TK_WMS_Inwh_Sub  where labcode like '%'+@labcode+'%'";
                dynamicParams.Add("@labcode", "labcode");
                dynamicParams.Add("@labcode", labcode);
                var dt = DapperHelper.selectdata(sql, dynamicParams);
                if (dt.Rows.Count > 0)
                {
                    mes.code = "300";
                    mes.count = 0;
                    mes.Message = "当前条码已入库!";
                    mes.data = null;
                    return mes;
                }
                //判断扫描标签是否为当前选择采购订单下的到货单所生成标签
@@ -697,6 +710,25 @@
            var dynamicParams = new DynamicParameters();
            try
            {
                //判断条码状态
                mes = LabCodeStatusMessage.LabCodeStatus("2060", "1103", labcode);//功能编号(采购到货)、单据类型编码(采购到货单)、标签编码
                if (mes.code == "300")
                {
                    return mes;
                }
                //判断标签状态(是否已入库(不能退货))
                sql = @"select * from TK_WMS_Inwh_Sub  where labcode like '%'+@labcode+'%'";
                dynamicParams.Add("@labcode", "labcode");
                dynamicParams.Add("@labcode", labcode);
                var data0 = DapperHelper.selectdata(sql, dynamicParams);
                if (data0.Rows.Count > 0)
                {
                    mes.code = "300";
                    mes.count = 0;
                    mes.Message = "当前条码已入库!";
                    mes.data = null;
                    return mes;
                }
                //根据采购订单号、物料编码、标签条码查找标签信息
                sql = @"select A.hbarcode,A.hcustomercode,C.name as hcustomercode,
                       A.hbatchno,A.qualitystatus,A.location_code,L.name as location_name,A.hqty  
@@ -804,6 +836,18 @@
                    //查询汇总标签信息
                    for (int j = 0; j < arra[i]["labcont"].Count(); j++)//循环获取标签信息
                    {
                        //更新条码状态
                        sql = @"update T_BarCodeBill set hbarcodestatus=@hbarcodestatus where hsourcebillno=@hsourcebillno and hbarcode=@hbarcode";
                        list.Add(new
                        {
                            str = sql,
                            parm = new
                            {
                                hbarcodestatus="N",
                                hsourcebillno = ordercode,
                                hbarcode = arra[i]["labcont"][j]["labcode"].ToString()
                            }
                        });
                        //更新到货单子表退货数量
                        sql = @"update T_PurchaseArrivalOrder_sub set hreturnqty=isnull(hreturnqty,0)+@inqty where hbillno=@hbillno and hpartcode=@hpartcode";
                        list.Add(new