| | |
| | | const mountNode = document.createElement('div'); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | const boxCodeReg = /^[A-Z]\d{9}$/; |
| | | // ååºå¼è¡¨åæ°æ®ï¼æç®±ç ï¼å¿
å¡«ï¼æ«ç æª/æå¨è¾å
¥ï¼ |
| | | const formData = reactive({ |
| | | boxCode: '', |
| | |
| | | // æäº¤è¡¨åçç»ä¸é»è¾ï¼ä¾å车触ååæé®ç¹å»å
±ç¨ï¼ |
| | | const submitForm = async () => { |
| | | const formRef = vnode.component.refs.batchInForm; |
| | | |
| | | if (!boxCodeReg.test(formData.boxCode.trim())) { |
| | | ElMessage.warning('æç®±ç æ ¼å¼é误'); |
| | | selectBoxCodeInput(); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | // æ§è¡è¡¨åæ ¡éªï¼æç®±ç å¿
å¡«ï¼ |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | ElMessage.warning('请è¾å
¥ææçæç®±ç '); |
| | | const errorMsg = err?.[0]?.message || '请è¾å
¥ææçæç®±ç '; |
| | | ElMessage.warning(errorMsg); |
| | | selectBoxCodeInput(); |
| | | return; |
| | | } |
| | | |
| | | |
| | | http.post('/api/InboundOrder/EmptyMaterielGroup', { |
| | | palletCode: formData.boxCode.trim(), |
| | | warehouseCode:formData.warehouseCode |
| | |
| | | model: formData, |
| | | rules: { |
| | | boxCode: [ |
| | | { required: true, message: '请è¾å
¥æç®±ç ', trigger: ['blur', 'enter'] } |
| | | { required: true, message: '请è¾å
¥æç®±ç ', trigger: ['blur', 'change'] }, |
| | | { pattern: boxCodeReg, message: 'æç®±ç æ ¼å¼é误', trigger: ['blur', 'change'] } |
| | | ], |
| | | warehouseCode:[ |
| | | { required: true, message: 'è¯·éæ©åºå', trigger: ['change', 'blur'] } |
| | |
| | | data() { |
| | | return { |
| | | palletVisible: this.visible, |
| | | trayBarcodeReg:/^[A-Z]\d{9}$/, |
| | | trayBarcode: '', |
| | | barcode: '', |
| | | materials: [], |
| | |
| | | trigger: 'change' |
| | | } |
| | | ], |
| | | trayBarcode:[ |
| | | { |
| | | pattern: this.trayBarcodeReg, |
| | | message: 'æçå·æ ¼å¼é误ï¼é为1个大å忝+9个æ°åï¼å¦A000008024ï¼', |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | warehouseType: [ |
| | | { |
| | | massage: 'è¯·éæ©ä»åº', |
| | | message: 'è¯·éæ©ä»åº', |
| | | trigger: 'change' |
| | | } |
| | | ] |
| | |
| | | inputEl.focus(); |
| | | this.currentFocus = 'tray'; |
| | | this.scanTarget = 'tray'; |
| | | inputEl.select(); |
| | | } |
| | | } |
| | | }, |
| | |
| | | |
| | | this.error = ''; |
| | | |
| | | if(!this.trayBarcodeReg.test(currentTrayBarcode)){ |
| | | ElMessage.warning({ |
| | | message: 'æçå·æ ¼å¼é误', |
| | | type: 'warning', |
| | | duration: 3000 |
| | | }) |
| | | this.focusTrayInput(); |
| | | return; |
| | | } |
| | | |
| | | // 设置æçæ¡ç åï¼èªå¨èç¦å°ç©æè¾å
¥æ¡ |
| | | this.focusBarcodeInput(); |
| | | |
| | |
| | | data() { |
| | | return { |
| | | palletVisible: this.visible, |
| | | trayBarcodeReg: /^[A-Z]\d{9}$/, |
| | | trayBarcode: '', |
| | | barcode: '', |
| | | materials: [], |
| | |
| | | trigger: 'change' |
| | | } |
| | | ], |
| | | trayBarcode: [ |
| | | { |
| | | pattern: /^[A-Z]\d{9}$/, |
| | | message: 'æçå·æ ¼å¼é误', |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | warehouseType: [ |
| | | { |
| | | massage: 'è¯·éæ©ä»åº', |
| | |
| | | inputEl.focus(); |
| | | this.currentFocus = 'tray'; |
| | | this.scanTarget = 'tray'; |
| | | inputEl.select(); |
| | | } |
| | | } |
| | | }, |
| | |
| | | |
| | | this.error = ''; |
| | | |
| | | if (!this.trayBarcodeReg.test(currentTrayBarcode)) { |
| | | ElMessage.error('æçæ¡ç æ ¼å¼é误'); |
| | | this.focusTrayInput(); |
| | | return; |
| | | } |
| | | |
| | | // 设置æçæ¡ç åï¼èªå¨èç¦å°ç©æè¾å
¥æ¡ |
| | | this.focusBarcodeInput(); |
| | | |
| | |
| | | <vol-box v-model="show" title="空æåºåº" :width="800" :height="600"> |
| | | <template #content> |
| | | <el-form ref="form" :model="form" label-width="90px"> |
| | | <el-form-item label="åºåºåºå:"> |
| | | <el-select v-model="locationType" placeholder="è¯·éæ©åºåºåºå"> |
| | | <el-option v-for="item in locationTypes" :key="item.locationType" :label="item.locationTypeDesc.toString()" :value="item.locationType"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-form ref="form" :model="form" label-width="90px"> |
| | | <el-form-item label="åºåºæ°é:"> |
| | | <el-select v-model="num" placeholder="è¯·éæ©åºåºæ°é"> |
| | | <el-option v-for="item in 6" :key="item" :label="item.toString()" :value="item"> |
| | |
| | | data() { |
| | | return { |
| | | num: 1, |
| | | show: false |
| | | show: false, |
| | | locationTypes: [], |
| | | locationType:"", |
| | | } |
| | | }, |
| | | methods: { |
| | | open() { |
| | | this.show = true |
| | | this.getData(); |
| | | }, |
| | | submit() { |
| | | this.$emit('parentCall', ($vue) => { |
| | | this.http.post(`/api/Task/PalletOutboundTask?num=${this.num}`, {}, 'æ°æ®å¤çä¸...') |
| | | this.http.post(`/api/Task/PalletOutboundTask?num=${this.num}&locationType=${this.locationType}`, {}, 'æ°æ®å¤çä¸...') |
| | | .then((x) => { |
| | | if (!x.status) { |
| | | this.$message.error(x.message) |
| | |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | getData() { |
| | | this.http.post("api/LocationInfo/GetLocationTypes",null, "æ¥è¯¢ä¸") |
| | | .then((x) => { |
| | | this.locationTypes = x.data; |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | bind: { key: "createType", data: [] }, |
| | | }, |
| | | { |
| | | field: "fromWarehouse", |
| | | title: "è°åºä»åº", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "toWarehouse", |
| | | title: "è°å
¥ä»åº", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "factoryArea", |
| | | title: "ååº", |
| | | type: "string", |
| | |
| | | } |
| | | } |
| | | |
| | | //public override PageGridData<Dt_AllocateOrder> PageGridData(PageDataOptions options) |
| | | //{ |
| | | // string wheres = ValidatePageOptions(options); |
| | | // //è·åæåºå段 |
| | | // Dictionary<string, SqlSugar.OrderByType> orderbyDic = GetPageDataSort(options, TProperties); |
| | | // List<OrderByModel> orderByModels = new List<OrderByModel>(); |
| | | // foreach (var item in orderbyDic) |
| | | // { |
| | | // OrderByModel orderByModel = new() |
| | | // { |
| | | // FieldName = item.Key, |
| | | // OrderByType = item.Value |
| | | // }; |
| | | // orderByModels.Add(orderByModel); |
| | | // } |
| | | |
| | | |
| | | // int totalCount = 0; |
| | | // List<SearchParameters> searchParametersList = new List<SearchParameters>(); |
| | | // if (!string.IsNullOrEmpty(options.Wheres)) |
| | | // { |
| | | // try |
| | | // { |
| | | // searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | // options.Filter = searchParametersList; |
| | | // } |
| | | // catch { } |
| | | // } |
| | | // var data = BaseDal.Db.Queryable<Dt_AllocateOrderDetail>() |
| | | // .WhereIF(!wheres.IsNullOrEmpty(), wheres) |
| | | // .OrderBy(orderByModels) |
| | | // .ToPageList(options.Page, options.Rows, ref totalCount); |
| | | // Dt_AllocateOrder allocateOrder = _allocateOrderRepository.QueryFirst(x => x.Id == (int)options.Value); |
| | | // Dt_InboundOrder _InboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_InboundOrder>().Where(x => x.UpperOrderNo == allocateOrder.UpperOrderNo).First(); |
| | | // var details = _inboundOrderDetailRepository.QueryData(x => x.OrderId == _InboundOrder.Id); |
| | | // foreach (var item in data) |
| | | // { |
| | | // var detail = details.Where(x => x.MaterielCode == item.MaterielCode).FirstOrDefault(); |
| | | // if (detail != null) |
| | | // { |
| | | // item.OrderQuantity = detail.OrderQuantity; |
| | | // item.ReceiptQuantity = detail.ReceiptQuantity; |
| | | // item.OverInQuantity = detail.OverInQuantity; |
| | | // item.OrderDetailStatus = detail.OrderDetailStatus; |
| | | // } |
| | | // } |
| | | // return new PageGridData<Dt_AllocateOrderDetail>(totalCount, data); |
| | | |
| | | |
| | | |
| | | |
| | | // return new PageGridData<Dt_InboundOrderDetail>(totalCount, data); |
| | | //} |
| | | |
| | | public override PageGridData<Dt_InboundOrderDetail> GetDetailPage(PageDataOptions options) |
| | | { |
| | | string wheres = ValidatePageOptions(options); |
| | |
| | | business_type = outboundOrder.BusinessType, |
| | | factoryArea = outboundOrder.FactoryArea, |
| | | operationType = 1, |
| | | Operator = outboundOrder.Operator, |
| | | Operator = outboundOrder.Operator!=""? outboundOrder.Operator:App.User.UserName, |
| | | orderNo = outboundOrder.UpperOrderNo, |
| | | documentsNO = documentNo, |
| | | status = outboundOrder.OrderStatus, |
| | |
| | | |
| | | Task<WebResponseContent> RequestInboundTask(string palletCode, string stationCode); |
| | | |
| | | Task<WebResponseContent> PalletOutboundTask(int num); |
| | | Task<WebResponseContent> PalletOutboundTask(int num, int locationType); |
| | | |
| | | Task<WebResponseContent> TaskCompleted(string taskNum); |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="inTask"></param> |
| | | /// <returns></returns> |
| | | public async Task<WebResponseContent> PalletOutboundTask(int num) |
| | | public async Task<WebResponseContent> PalletOutboundTask(int num, int locationType) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var stockInfos = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.å
¥åºå®æ.ObjToInt()).ToList(); |
| | | var stockInfos = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.å
¥åºå®æ.ObjToInt()).WhereIF(locationType != 0, x => x.LocationType == locationType).Take(num).ToList(); |
| | | |
| | | if (stockInfos.Count() == 0) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°ç©ºæçåºå"); |
| | | } |
| | | for (int i = 0; i < num; i++) |
| | | foreach (var stockInfo in stockInfos) |
| | | { |
| | | var stockInfo = stockInfos.Where(x=>x.StockStatus != StockStatusEmun.åºåºéå®.ObjToInt()).FirstOrDefault(); |
| | | Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode); |
| | | if (locationInfo == null) |
| | | { |
| | |
| | | var result = await _eSSApiService.CreateTaskAsync(esstask); |
| | | |
| | | _logger.LogInformation("å建任å¡PalletOutboundTask è¿å: " + result); |
| | | if (result) |
| | | { |
| | | return WebResponseContent.Instance.OK(200); |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error("ä¸åæºå¨äººä»»å¡å¤±è´¥ï¼"); |
| | | } |
| | | } |
| | | |
| | | return content.OK("空æåºåºæå!"); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | |
| | | [HttpPost, Route("PalletOutboundTask"), AllowAnonymous, MethodParamsValidate] |
| | | public async Task<WebResponseContent> PalletOutboundTask(int num) |
| | | public async Task<WebResponseContent> PalletOutboundTask(int num, int locationType) |
| | | { |
| | | return await Service.PalletOutboundTask(num); |
| | | return await Service.PalletOutboundTask(num, locationType); |
| | | } |
| | | |
| | | |