| | |
| | | <span><i class="el-icon-tickets"></i> ç»çæ°æ®</span> |
| | | <span class="list-actions"> |
| | | <el-tag type="primary">å
± {{ materials.length }} æ¡è®°å½</el-tag> |
| | | <el-tag type="primary">å·²ç»ç {{ totalStockCount }}</el-tag> |
| | | <el-tag type="primary">åºåæ°é {{ totalStockSum }}<span>{{ uniqueUnit }}</span></el-tag> |
| | | <el-tag v-if="trayBarcode" type="success">æç: {{ trayBarcode }}</el-tag> |
| | | <!-- <el-button |
| | | v-if="materials.length > 0" |
| | |
| | | import VolTable from '@/components/basic/VolTable.vue'; |
| | | import { ElLoading, ElMessage,ElMessageBox } from 'element-plus'; |
| | | import { ref, onMounted, onUnmounted } from 'vue' |
| | | import InboundOrder from '../../../views/inbound/inboundOrder.vue'; |
| | | |
| | | export default { |
| | | name: 'BarcodeScanner', |
| | |
| | | scanTimer: null, |
| | | manualInputTimer: null, |
| | | scanTarget: 'tray', // å½åæ«ç ç®æ : tray æ material |
| | | |
| | | // åºåç»è®¡ç¸å
³åé |
| | | totalStockSum: 0, |
| | | totalStockCount: 0, |
| | | uniqueUnit: '', |
| | | sumLoading: false, |
| | | sumError: '' |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | this.$nextTick(() => { |
| | | setTimeout(() => { |
| | | this.focusTrayInput(); |
| | | this.fetchStockStatistics(); // å è½½ç»è®¡æ°æ® |
| | | }, 300); |
| | | }); |
| | | } |
| | |
| | | this.palletForm = { palletCode: '', barcode: '' }; |
| | | this.backData = []; |
| | | this.$refs.palletForm?.reset(); |
| | | this.fetchStockStatistics(); // åæ®å·åäºï¼å·æ°ç»è®¡ |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.clearAllTimers(); |
| | | }, |
| | | methods: { |
| | | // æ°å¢ï¼æ¥è¯¢å端åºåç»è®¡æ°æ®ï¼è°ç¨ä¹åç SumQuantity æ¥å£ï¼ |
| | | async fetchStockStatistics() { |
| | | // åæ®å·ä¸ºç©ºæ¶ä¸æ¥è¯¢ |
| | | if (!this.docNo) { |
| | | this.sumError = 'åæ®å·ä¸ºç©ºï¼æ æ³ç»è®¡'; |
| | | return; |
| | | } |
| | | |
| | | this.sumLoading = true; |
| | | this.sumError = ''; |
| | | try { |
| | | // è°ç¨å端ç»è®¡æ¥å£ï¼æ¿æ¢ä¸ºä½ çå®é
æ¥å£è·¯å¾ï¼ |
| | | const response = await http.post('/api/InboundOrder/UnPalletQuantity?orderNo='+this.docNo, { |
| | | |
| | | }); |
| | | |
| | | // ç»å®æ°æ®ï¼å¹é
PalletSumQuantityDTO ç»æï¼ |
| | | if (response.data) { |
| | | this.totalStockSum = response.data.stockSumQuantity || 0; // æ»åºåæ°é |
| | | this.totalStockCount = response.data.stockCount || 0; // æ»åºåè®°å½æ° |
| | | this.uniqueUnit = response.data.uniqueUnit || ''; // 计éåä½ |
| | | } |
| | | } catch (err) { |
| | | this.sumError = 'ç»è®¡å 载失败'; |
| | | this.totalStockSum = 0; |
| | | this.totalStockCount = 0; |
| | | console.error('åºåç»è®¡æ¥è¯¢å¼å¸¸ï¼', err); |
| | | } finally { |
| | | this.sumLoading = false; |
| | | } |
| | | }, |
| | | // éç½®æææ°æ® |
| | | resetData() { |
| | | console.log('éç½®å¼¹æ¡æ°æ®'); |
| | |
| | | this.currentFocus = 'tray'; |
| | | this.scanTarget = 'tray'; |
| | | this.clearAllTimers(); |
| | | this.totalStockSum = 0; |
| | | this.totalStockCount = 0; |
| | | this.sumLoading = false; |
| | | this.sumError = ''; |
| | | }, |
| | | |
| | | // æ¸
餿æè®¡æ¶å¨ |
| | |
| | | |
| | | const targetRow = selectedRows[0]; |
| | | |
| | | |
| | | |
| | | |
| | | this.$emit('openPalletDialog', targetRow.inboundOrderNo); |
| | | } |
| | | }, |
| | | { |
| | | name: 'åæ¹å
¥åº', |
| | | type: 'primary', |
| | | value: 'åæ¹å
¥åº', |
| | | onClick: async function () { |
| | | console.log('åæ¹å
¥åºæé®è¢«ç¹å»ï¼å¼å§æ ¡éª'); |
| | | const selectedRows = this.$refs.table.getSelected(); |
| | | |
| | | // æ ¡éª1ï¼æ¯å¦éä¸è¡ï¼è³å°éæ©ä¸æ¡ï¼ |
| | | if (selectedRows.length === 0) { |
| | | console.log('æ ¡éªä¸éè¿ï¼æªéä¸ä»»ä½åæ®'); |
| | | ElMessage.warning('è¯·éæ©è³å°ä¸æ¡åæ®'); |
| | | return; |
| | | } |
| | | |
| | | // æ¶éææéä¸åæ®çç¼å·ï¼è¿æ»¤æ åæ®å·çå¼å¸¸è¡ï¼ |
| | | const inboundOrderNos = selectedRows |
| | | .filter(row => row.inboundOrderNo) |
| | | .map(row => row.inboundOrderNo); |
| | | |
| | | // æ ¡éª2ï¼æ¯å¦æææåæ®å· |
| | | if (inboundOrderNos.length === 0) { |
| | | console.log('æ ¡éªä¸éè¿ï¼éä¸åæ®æ ææç¼å·'); |
| | | ElMessage.warning('éä¸ç忮䏿 ææç¼å·ï¼è¯·éæ°éæ©'); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | console.log('åèµ·åæ¹å
¥åºè¯·æ±ï¼åæ°ï¼', { inboundOrderNos}); |
| | | const response = await http.post('/api/InboundOrder/BatchInbound', { |
| | | inboundOrderNos: inboundOrderNos, |
| | | }); |
| | | |
| | | const { status, message, data } = response; |
| | | if (status) { |
| | | console.log('åæ¹å
¥åºæåï¼å端è¿åï¼', data); |
| | | ElMessage.success(`åæ¹å
¥åºæåï¼å
±å¤ç${inboundOrderNos.length}æ¡åæ®`); |
| | | this.refresh(); // å
¥åºæååå·æ°å表ï¼å¤ç¨åæé»è¾ï¼ |
| | | } else { |
| | | console.log('åæ¹å
¥åºå¤±è´¥ï¼å端æç¤ºï¼', message); |
| | | ElMessage.error(message || data?.message || 'åæ¹å
¥åºå¤±è´¥'); |
| | | } |
| | | } catch (error) { |
| | | console.error('åæ¹å
¥åºè¯·æ±å¼å¸¸ï¼', error); |
| | | ElMessage.error('ç½ç»å¼å¸¸ææ¥å£é误ï¼è¯·ç¨åéè¯'); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | name: '空æçå
¥åº', |
| | | type: 'primary', |
| | |
| | | rules: { |
| | | // æç®±ç æ ¡éªï¼ä»
ä¿çå符串类åï¼ç§»é¤å¿
å¡«è¦æ±ï¼ç©ºå¼å¯éè¿ï¼ |
| | | boxCode: [ |
| | | { required: true, message: '请è¾å
¥æç®±ç ', trigger: 'blur' }, |
| | | { type: 'string', message: 'æç®±ç å¿
须为å符串', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | ref: 'batchInForm' |
| | | }, [ |
| | | // æç®±ç è¾å
¥é¡¹ï¼å¯éå¡«ï¼ |
| | | h(ElFormItem, { label: 'æç®±ç ', prop: 'boxCode' }, [ |
| | | h(ElFormItem, { label: 'æç®±ç ', prop: 'boxCode',required:true }, [ |
| | | h(ElInput, { |
| | | type: 'text', |
| | | placeholder: 'å¯éè¾å
¥æç®±ç ï¼ä¸å¡«åé»è®¤å
¥åº', // æç¤ºå¯ç©ºè§å |
| | | modelValue: formData.boxCode, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.boxCode = val; |
| | |
| | | } |
| | | |
| | | // å
¥åºæ¥å£æäº¤ï¼æç®±ç 为空æ¶ä¼ é空å符串ï¼åç«¯éæ¯æè¯¥å段å¯é |
| | | http.post('/api/wmsTask/BatchInboundTask', { |
| | | boxCode: formData.boxCode // å¯ç©ºï¼ç¨æ·è¾å
¥æç©ºå符串 |
| | | http.post('/api/InboundOrder/EmptyMaterielGroup', { |
| | | palletCode: formData.boxCode // å¯ç©ºï¼ç¨æ·è¾å
¥æç©ºå符串 |
| | | }).then(({ data, status, message }) => { |
| | | if (status) { |
| | | ElMessage.success(`å
¥åºæå${formData.boxCode ? 'ï¼æç®±ç ï¼' + formData.boxCode : ''}`); |
| | |
| | | onClick: function () { |
| | | |
| | | // 2. çæ3-12ç«å°é项ï¼é»è®¤ç¬¬ä¸ä¸ªä¸ºç«å°3ï¼ |
| | | const platformOptions = Array.from({ length: 10 }, (_, i) => { |
| | | const num = i + 3; |
| | | return { label: `ç«å°${num}`, value: `PLATFORM${num.toString().padStart(3, '0')}` }; |
| | | const platformOptions = Array.from({ length: 1 }, (_, i) => { |
| | | const num = 1; |
| | | return { label: `ç«å°${num}`, value: `1-2` }; |
| | | }); |
| | | |
| | | const mountNode = document.createElement('div'); |
| | |
| | | return; |
| | | } |
| | | |
| | | http.post('/api/wmsTask/BatchOutboundTask', { |
| | | palletCode: formData.palletCode, |
| | | platform: formData.selectedPlatform |
| | | http.post('/api/Task/PalletOutboundTask?palletCode='+formData.palletCode+'&endStation='+formData.selectedPlatform, { |
| | | |
| | | }).then(({ data, status, message }) => { |
| | | if (status) { |
| | | ElMessage.success(`åºåºæåï¼åé
çæçç¼å·ï¼${data.palletCode || formData.palletCode}`); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_DTO.Inbound |
| | | { |
| | | public class PalletSumQuantityDTO |
| | | { |
| | | public decimal StockSumQuantity { get; set; } |
| | | |
| | | public int StockCount { get; set; } |
| | | |
| | | public string UniqueUnit { get; set; } |
| | | } |
| | | } |
| | |
| | | WebResponseContent BarcodeMaterielGroup(BarcodeMaterielGroupDTO materielGroupDTO); |
| | | WebResponseContent EmptyMaterielGroup(EmptyBarcodeMaterielGroupDTO materielGroupDTO); |
| | | |
| | | |
| | | WebResponseContent UnPalletQuantity(string orderNo); |
| | | } |
| | | } |
| | |
| | | private readonly IMaterialUnitService _materialUnitService; |
| | | private readonly IInboundOrderDetailService _inboundOrderDetailService; |
| | | private readonly IRepository<Dt_InboundOrderDetail> _inboundOrderDetailRepository; |
| | | private readonly IRepository<Dt_StockInfoDetail> _stockDetailRepository; |
| | | private readonly IRepository<Dt_InboundOrder> _inboundOrderRepository; |
| | | public IRepository<Dt_InboundOrder> Repository => BaseDal; |
| | | |
| | | public InboundOrderService(IRepository<Dt_InboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_Task> taskRepository, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService, IMaterialUnitService materialUnitService) : base(BaseDal) |
| | | public InboundOrderService(IRepository<Dt_InboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_Task> taskRepository, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService, IMaterialUnitService materialUnitService,IRepository<Dt_StockInfoDetail> stockDetailRepository,IRepository<Dt_InboundOrder> inboundOrderRepository) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _stockService = stockService; |
| | | _inboundOrderDetailService = inboundOrderDetailService; |
| | | _materialUnitService = materialUnitService; |
| | | _stockDetailRepository = stockDetailRepository; |
| | | _inboundOrderRepository = inboundOrderRepository; |
| | | } |
| | | |
| | | public async Task<WebResponseContent> ReceiveInboundOrder(List<Dt_InboundOrder> models, int operateType) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public WebResponseContent UnPalletQuantity(string orderNo) |
| | | { |
| | | // åå§åè¿åDTOï¼é»è®¤å¼é½ä¸º0ï¼é¿å
nullï¼ |
| | | var resultDTO = new PalletSumQuantityDTO |
| | | { |
| | | StockSumQuantity = 0, |
| | | StockCount = 0, |
| | | UniqueUnit="" |
| | | }; |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (string.IsNullOrWhiteSpace(orderNo)) |
| | | { |
| | | return content.Error("ä¼ å
¥ç订åå·orderNo为空æç©ºç½"); |
| | | } |
| | | var orderDetail = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Includes(x => x.Details).Where(s => s.InboundOrderNo == orderNo).First(); |
| | | if (orderDetail == null) |
| | | { |
| | | return content.Error("æªæ¾å°åæ®"); |
| | | } |
| | | var unitGroups = orderDetail.Details.GroupBy(d => d.Unit).ToList(); |
| | | if (unitGroups.Count == 1) |
| | | { |
| | | resultDTO.UniqueUnit = unitGroups.First().Key; |
| | | } |
| | | else |
| | | { |
| | | resultDTO.UniqueUnit = ""; |
| | | } |
| | | var validDetails = _stockDetailRepository.Db.Queryable<Dt_StockInfoDetail>().Where(s => s.OrderNo == orderNo).ToList(); |
| | | resultDTO.StockSumQuantity = orderDetail.Details.Sum(d => d.OrderQuantity); |
| | | resultDTO.StockCount = orderDetail.Details.Count; |
| | | if(validDetails.Any()) |
| | | { |
| | | resultDTO.StockSumQuantity -= validDetails.Sum(d => d.StockQuantity); |
| | | // æç»è®°å½æ°ï¼ç¬¦åæ¡ä»¶çææè®°å½æ¡æ° |
| | | resultDTO.StockCount -= validDetails.Count; |
| | | } |
| | | return content.OK("",resultDTO); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content.Error("SumQuantity ç»è®¡åºåæ°é失败ï¼è®¢åå·ï¼{OrderNo}"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | [HttpPost, Route("UnPalletQuantity"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent UnPalletQuantity(string orderNo) |
| | | { |
| | | return Service.UnPalletQuantity(orderNo); |
| | | } |
| | | |
| | | } |
| | | } |