| | |
| | | v-model="printForm.barcode" |
| | | placeholder="请è¾å
¥æ¹å·ï¼çæäºç»´ç ç¨ï¼" |
| | | clearable |
| | | @keyup.enter="fetchBarcodeData" |
| | | :loading="fetchingData" |
| | | /> |
| | | </el-form-item> |
| | | |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <!-- 第äºå --> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¾åºåç¼ç " prop="suplierCode"> |
| | | <el-input |
| | |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- æ¹éæ·»å ï¼å¯éï¼ --> |
| | | |
| | | <el-form-item label="æå°ä»½æ°"> |
| | | <el-input-number |
| | | v-model="printCopyCount" |
| | |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <!-- æä½æé® --> |
| | | |
| | | <el-form-item class="form-actions"> |
| | | <el-button type="primary" @click="submitForm">确认并æå¼æå°å¼¹çª</el-button> |
| | | <el-button @click="resetForm">é置表å</el-button> |
| | |
| | | </el-form> |
| | | </el-card> |
| | | |
| | | <!-- å¼å
¥æå°å¼¹çªç»ä»¶ --> |
| | | |
| | | <print-view ref="printViewRef" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | // å¼å
¥æå°å¼¹çªç»ä»¶ |
| | | |
| | | import printView from "@/extension/outbound/extend/printView.vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import http from '@/api/http.js' |
| | | |
| | | export default { |
| | | name: "PrintInputPage", |
| | | components: { printView }, |
| | | data() { |
| | | return { |
| | | // è¡¨åæ°æ®ï¼å¯¹åºprintViewæéçåæ°ï¼ |
| | | printForm: { |
| | | materialCode: "", // æå· |
| | | suplierCode: "", // ä¾åºåç¼ç |
| | | materialName: "", // åå |
| | | pruchaseOrderNo: "", // éè´åå· |
| | | materialSpec: "", // è§æ ¼ |
| | | quantity: "", // æ°é/æ»æ° |
| | | barcode: "", // æ¹å·ï¼äºç»´ç å
å®¹ï¼ |
| | | batchNo: "", // æ¹æ¬¡ |
| | | factoryArea: "", // ååº |
| | | date: "", // æ¥æï¼é»è®¤å½åæ¥æï¼ |
| | | materialCode: "", |
| | | suplierCode: "", |
| | | materialName: "", |
| | | pruchaseOrderNo: "", |
| | | materialSpec: "", |
| | | quantity: "", |
| | | barcode: "", |
| | | batchNo: "", |
| | | factoryArea: "", |
| | | date: "", |
| | | }, |
| | | // æå°ä»½æ°ï¼æ¯ææ¹éçæå¤æ¡ç¸åæ°æ®ï¼ |
| | | |
| | | printCopyCount: 1, |
| | | // 表åéªè¯è§å |
| | | |
| | | formRules: { |
| | | materialCode: [{ required: true, message: "请è¾å
¥æå·", trigger: "blur" }], |
| | | materialName: [{ required: true, message: "请è¾å
¥åå", trigger: "blur" }], |
| | | barcode: [{ required: true, message: "请è¾å
¥æ¹å·", trigger: "blur" }], |
| | | date: [{ required: true, message: "è¯·éæ©æ¥æ", trigger: "change" }], |
| | | }, |
| | | |
| | | fetchingData: false |
| | | }; |
| | | }, |
| | | mounted() { |
| | | // åå§åé»è®¤æ¥æä¸ºå½å¤© |
| | | const today = new Date(); |
| | | this.printForm.date = `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, "0")}-${today.getDate().toString().padStart(2, "0")}`; |
| | | }, |
| | | methods: { |
| | | // æäº¤è¡¨åï¼æå¼æå°å¼¹çª |
| | | async fetchBarcodeData() { |
| | | if (!this.printForm.barcode.trim()) { |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | |
| | | this.fetchingData = true; |
| | | |
| | | const response = await http.post( |
| | | `/api/Outbound/PrintFromData?barcode=` + this.printForm.barcode.trim() |
| | | ); |
| | | const data = response.data; |
| | | if (data) { |
| | | this.printForm.materialCode = data.materialCode || ""; |
| | | this.printForm.suplierCode = data.suplierCode || ""; |
| | | this.printForm.materialName = data.materialName || ""; |
| | | this.printForm.pruchaseOrderNo = data.pruchaseOrderNo || ""; |
| | | this.printForm.materialSpec = data.materialSpec || ""; |
| | | this.printForm.quantity = data.quantity || ""; |
| | | this.printForm.batchNo = data.batchNo || ""; |
| | | this.printForm.factoryArea = data.factoryArea || ""; |
| | | |
| | | |
| | | ElMessage.success("å·²æ ¹æ®æ¹å·èªå¨å¡«å
æ°æ®"); |
| | | } else { |
| | | ElMessage.info("æªæ¥è¯¢å°è¯¥æ¹å·å¯¹åºçç©ææ°æ®"); |
| | | } |
| | | } catch (error) { |
| | | console.error("è·åæ¹å·æ°æ®å¤±è´¥ï¼", error); |
| | | ElMessage.error("è·åæ°æ®å¤±è´¥ï¼è¯·æ£æ¥ç½ç»ææ¹å·æ¯å¦æ£ç¡®"); |
| | | } finally { |
| | | this.fetchingData = false; |
| | | } |
| | | }, |
| | | submitForm() { |
| | | this.$refs.printFormRef.validate((valid) => { |
| | | if (!valid) { |
| | |
| | | } |
| | | |
| | | try { |
| | | // æé æå°æ°æ®ï¼æ¯æå¤ä»½ï¼ |
| | | const printData = []; |
| | | for (let i = 0; i < this.printCopyCount; i++) { |
| | | printData.push({ ...this.printForm }); |
| | | } |
| | | |
| | | // è°ç¨printViewçopenæ¹æ³ï¼ä¼ éåæ°å¹¶æå¼å¼¹çª |
| | | this.$refs.printViewRef.open(printData); |
| | | ElMessage.success(`å·²çæ ${this.printCopyCount} 份æå°æ°æ®ï¼å³å°æå¼æå°å¼¹çª`); |
| | | } catch (error) { |
| | |
| | | }); |
| | | }, |
| | | |
| | | // é置表å |
| | | |
| | | resetForm() { |
| | | this.$refs.printFormRef.resetFields(); |
| | | // éç½®åæ¢å¤é»è®¤æ¥æ |
| | | const today = new Date(); |
| | | this.printForm.date = `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, "0")}-${today.getDate().toString().padStart(2, "0")}`; |
| | | this.printCopyCount = 1; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_DTO.Outbound |
| | | { |
| | | public class PrintFromDataDTO |
| | | { |
| | | public string materialCode { get; set; } |
| | | public string materialName { get; set; } |
| | | public string materialSpec { get; set; } |
| | | public string factoryArea { get; set; } |
| | | public string suplierCode { get;set; } |
| | | public string pruchaseOrderNo { get; set; } |
| | | public decimal quantity { get; set; } |
| | | public string batchNo { get; set; } |
| | | public DateTime date { get; set; } |
| | | } |
| | | } |
| | |
| | | /// <param name="orderNo"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent RecheckPicking(RecheckPickingDTO pickingDTO); |
| | | |
| | | WebResponseContent PrintFromData(string barcode); |
| | | } |
| | | } |
| | |
| | | using WIDESEA_DTO.Base; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.CalcOut; |
| | | using WIDESEA_DTO.Outbound; |
| | | using WIDESEA_DTO.ReturnMES; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IOutboundService; |
| | |
| | | private readonly IESSApiService _eSSApiService; |
| | | private readonly IRepository<Dt_AllocateOrder> _allocateOrderRepository; |
| | | private readonly IRepository<Dt_AllocateMaterialInfo> _allocateMaterialInfoRepository; |
| | | public readonly IRepository<Dt_InboundOrderDetail> _inboundOrderDetailRepository; |
| | | public readonly IRepository<Dt_InboundOrder> _inboundOrderRepository; |
| | | |
| | | private Dictionary<string, string> stations = new Dictionary<string, string> |
| | | { |
| | |
| | | {"3-1","3-5" }, |
| | | }; |
| | | |
| | | public OutboundService(IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_OutboundOrderDetail> detailRepository, IRepository<Dt_OutboundOrder> outboundRepository, IRepository<Dt_OutStockLockInfo> outboundLockInfoRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_StockInfoDetail> stockDetailRepository, IRepository<Dt_StockQuantityChangeRecord> stockChangeRepository, IRepository<Dt_StockInfoDetail_Hty> stockDetailHistoryRepository, IBasicService basicService, IOutboundOrderDetailService outboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutStockLockInfoService outboundStockLockInfoService, IFeedbackMesService feedbackMesService, IRepository<Dt_Task> taskRepository, ILocationInfoService locationInfoService, IESSApiService eSSApiService, IRepository<Dt_AllocateOrder> allocateOrderRepository, IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfoRepository) |
| | | public OutboundService(IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_OutboundOrderDetail> detailRepository, IRepository<Dt_OutboundOrder> outboundRepository, IRepository<Dt_OutStockLockInfo> outboundLockInfoRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_StockInfoDetail> stockDetailRepository, IRepository<Dt_StockQuantityChangeRecord> stockChangeRepository, IRepository<Dt_StockInfoDetail_Hty> stockDetailHistoryRepository, IBasicService basicService, IOutboundOrderDetailService outboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutStockLockInfoService outboundStockLockInfoService, IFeedbackMesService feedbackMesService, IRepository<Dt_Task> taskRepository, ILocationInfoService locationInfoService, IESSApiService eSSApiService, IRepository<Dt_AllocateOrder> allocateOrderRepository, IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfoRepository, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_InboundOrder> inboundOrderRepository) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _eSSApiService = eSSApiService; |
| | | _allocateOrderRepository = allocateOrderRepository; |
| | | _allocateMaterialInfoRepository = allocateMaterialInfoRepository; |
| | | _inboundOrderDetailRepository = inboundOrderDetailRepository; |
| | | _inboundOrderRepository = inboundOrderRepository; |
| | | } |
| | | |
| | | public WebResponseContent PrintFromData (string barcode) |
| | | { |
| | | var detail = _inboundOrderDetailRepository.QueryFirst(x => x.Barcode == barcode); |
| | | if(detail == null) |
| | | { |
| | | return WebResponseContent.Instance.Error(); |
| | | } |
| | | |
| | | var inbound = _inboundOrderRepository.QueryFirst(x=>x.Id == detail.OrderId); |
| | | if(inbound == null) |
| | | { |
| | | return WebResponseContent.Instance.Error(); |
| | | } |
| | | var printFormData = new PrintFromDataDTO { |
| | | materialCode = detail.Barcode, |
| | | materialName = detail.MaterielName, |
| | | materialSpec = detail.Unit, |
| | | batchNo = detail.BatchNo, |
| | | pruchaseOrderNo = inbound.UpperOrderNo, |
| | | factoryArea = inbound.FactoryArea, |
| | | suplierCode = inbound.SupplierId, |
| | | quantity = detail.BarcodeQty |
| | | }; |
| | | |
| | | return WebResponseContent.Instance.OK(data:printFormData); |
| | | } |
| | | |
| | | #region åºåºåé
|
| | |
| | | { |
| | | return _outboundService.RecheckPicking(pickingDTO); |
| | | } |
| | | |
| | | [HttpPost, Route("PrintFromData"), AllowAnonymous] |
| | | public WebResponseContent PrintFromData(string barcode) |
| | | { |
| | | return _outboundService.PrintFromData(barcode); |
| | | } |
| | | } |
| | | } |