Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu
| | |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | { |
| | | name: "空æå
¥åº", |
| | | class: '', |
| | | value: 'EmptyTrayInbound', |
| | | type: 'primary', |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | ] |
| | | |
| | | export default buttons |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <vol-box v-model="show" title="空æå
¥åº" :width="800" :height="1200"> |
| | | <template #content> |
| | | <el-form ref="form" :model="form" label-width="90px"> |
| | | <el-form-item label="å
¥åºåºå:"> |
| | | <el-select v-model="form.locationType" placeholder="è¯·éæ©å
¥åºåºå"> |
| | | <el-option v-for="item in locationTypes" :key="item.locationType" :label="item.locationTypeDesc" |
| | | :value="item.locationType" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="æçæ¡ç :"> |
| | | <el-input v-model="form.palletCode" placeholder="è¯·æ«æ/è¾å
¥æçæ¡ç " @keyup.enter="submit" @keyup.13="submit" |
| | | clearable maxlength="50" @paste="handlePaste" @input="handleInput" ref="boxCodeInput" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | | |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submit">确认</el-button> |
| | | <el-button @click="show = false">å
³é</el-button> |
| | | </div> |
| | | </template> |
| | | </vol-box> |
| | | </template> |
| | | |
| | | <script> |
| | | import VolBox from '@/components/basic/VolBox.vue' |
| | | |
| | | export default { |
| | | components: { VolBox }, |
| | | props: { |
| | | value: { type: Boolean, default: false } |
| | | }, |
| | | data() { |
| | | return { |
| | | show: false, |
| | | form: { |
| | | palletCode: '', |
| | | locationType: '' |
| | | }, |
| | | locationTypes: [] |
| | | } |
| | | }, |
| | | methods: { |
| | | open() { |
| | | this.show = true |
| | | this.getData(); |
| | | this.$nextTick(() => { |
| | | this.focusInput() |
| | | }) |
| | | }, |
| | | |
| | | async getData() { |
| | | try { |
| | | const { data } = await this.http.post("api/LocationInfo/GetLocationTypes") |
| | | this.locationTypes = data |
| | | } catch (e) { |
| | | this.$message.error('è·ååºåç±»å失败') |
| | | } |
| | | }, |
| | | |
| | | async submit() { |
| | | if (!this.form.palletCode) { |
| | | this.$message.warning('请è¾å
¥æçæ¡ç ') |
| | | this.focusInput() |
| | | return |
| | | } |
| | | |
| | | if (!this.form.locationType) { |
| | | this.$message.warning('è¯·éæ©å
¥åºåºå') |
| | | return |
| | | } |
| | | |
| | | try { |
| | | let param = { |
| | | WarehouseCode: this.form.locationType, |
| | | PalletCode: this.form.palletCode |
| | | } |
| | | |
| | | const { status, message } = await this.http.post( |
| | | `/api/InboundOrder/EmptyMaterielGroup`, |
| | | param |
| | | ) |
| | | |
| | | if (status) { |
| | | this.$message.success("ç»çæå"); |
| | | // æ¸
空è¾å
¥æ¡æ°æ® |
| | | this.form.palletCode = ''; |
| | | // èç¦å¹¶éä¸è¾å
¥æ¡ |
| | | this.focusAndSelectInput(); |
| | | } else { |
| | | this.$message.error(message || 'æä½å¤±è´¥'); |
| | | // 失败æ¶ä¸æ¸
çæ°æ®ï¼ä½èç¦å¹¶éä¸è¾å
¥æ¡ï¼æ¹ä¾¿ä¿®æ¹ |
| | | this.focusAndSelectInput(); |
| | | } |
| | | } catch (error) { |
| | | this.$message.error('请æ±å¼å¸¸'); |
| | | // å¼å¸¸æ¶ä¹ä¸æ¸
çæ°æ® |
| | | this.focusAndSelectInput(); |
| | | } |
| | | }, |
| | | |
| | | // æ«ææªä¼åå¤ç |
| | | handleInput(value) { |
| | | // è¿æ»¤éæ°ååæ¡ç 常ç¨å符 |
| | | this.form.palletCode = value.replace(/[^a-zA-Z0-9\-]/g, '') |
| | | }, |
| | | |
| | | handlePaste(e) { |
| | | // ç²è´´æ¶èªå¨æäº¤ |
| | | setTimeout(this.submit, 100) |
| | | }, |
| | | |
| | | // èç¦å¹¶éä¸è¾å
¥æ¡ |
| | | focusAndSelectInput() { |
| | | this.$nextTick(() => { |
| | | setTimeout(() => { |
| | | const inputRef = this.$refs.boxCodeInput; |
| | | if (inputRef) { |
| | | // Element Plus/Element UI çå¤çæ¹å¼ |
| | | const inputEl = inputRef.$el ? inputRef.$el.querySelector('input') : inputRef; |
| | | if (inputEl) { |
| | | inputEl.focus(); |
| | | inputEl.select(); |
| | | } |
| | | } |
| | | }, 100); |
| | | }); |
| | | }, |
| | | |
| | | // åªèç¦è¾å
¥æ¡ï¼ä¸æ¸
ç©ºæ°æ®ï¼ |
| | | focusInput() { |
| | | this.$nextTick(() => { |
| | | const inputRef = this.$refs.boxCodeInput; |
| | | if (inputRef) { |
| | | const inputEl = inputRef.$el ? inputRef.$el.querySelector('input') : inputRef; |
| | | inputEl?.focus(); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // æ¸
ç©ºè¡¨åæ°æ® |
| | | clearForm() { |
| | | this.form.palletCode = ''; |
| | | // 䏿¸
空 locationTypeï¼ä¿æåºåéæ© |
| | | } |
| | | }, |
| | | watch: { |
| | | show(val) { |
| | | if (val) { |
| | | this.$nextTick(() => { |
| | | this.focusInput() |
| | | }) |
| | | } else { |
| | | // å
³éå¼¹çªæ¶æ¸
空表å |
| | | this.clearForm(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .dialog-footer { |
| | | text-align: right; |
| | | } |
| | | </style> |
| | |
| | | <el-alert :title="error" type="error" show-icon closable @close="error = ''" /> |
| | | </div> |
| | | |
| | | <!-- æªç»çå表 --> |
| | | <div class="unpallet-section compact"> |
| | | <el-card shadow="hover" class="compact-card unpallet-card"> |
| | | <div slot="header" class="compact-header"> |
| | | <span><i class="el-icon-tickets"></i> æªç»çæ¡ç </span> |
| | | <span class="list-actions"> |
| | | <el-tag type="primary" size="small">æªç»ç {{ totalStockCount }}</el-tag> |
| | | </span> |
| | | </div> |
| | | |
| | | |
| | | <div class="table-container"> |
| | | <el-table :data="unpalletMaterials" stripe style="width: 100%" height="100%" size="small" v-loading="unpalletBarcodesLoading"> |
| | | <el-table-column type="index" label="åºå·" width="60" align="center"></el-table-column> |
| | | <el-table-column prop="barcode" label="æ¡ç " min-width="140" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="materielCode" label="ç©æç¼ç " min-width="150" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="batchNo" label="æ¹æ¬¡" min-width="150" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="orderQuantity" label="æ°é" min-width="130" align="right"></el-table-column> |
| | | <el-table-column prop="unit" label="åä½" width="80" align="center"></el-table-column> |
| | | <el-table-column prop="supplyCode" label="ä¾åºå" min-width="130" show-overflow-tooltip></el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | |
| | | </div> |
| | | |
| | | <!-- ç©æå表 - åºå®é«åº¦å¸¦æ»å¨æ¡ --> |
| | | <div class="material-list compact"> |
| | | <el-card shadow="hover" class="compact-card"> |
| | |
| | | <span><i class="el-icon-tickets"></i> ç»çæ°æ®</span> |
| | | <span class="list-actions"> |
| | | <el-tag type="primary" size="small">å
± {{ materials.length }} æ¡</el-tag> |
| | | <el-tag type="primary" size="small">æªç»ç {{ totalStockCount }}</el-tag> |
| | | <el-tag type="primary" size="small">æªå
¥åºæ°é {{ totalStockSum }}{{ uniqueUnit }}</el-tag> |
| | | <el-tag v-if="trayBarcode" type="success" size="small">æç: {{ trayBarcode }}</el-tag> |
| | | <el-tag v-if="form.warehouseType" type="info" size="small">ä»åº: {{ currentWarehouseName }}</el-tag> |
| | |
| | | error: '', |
| | | debugMode: false, |
| | | currentFocus: 'warehouse', |
| | | |
| | | unpalletBarcodes:[], |
| | | unpalletBarcodesLoading: false, |
| | | unpalletMaterials: [], // æªç»çè¯¦ç»æ°æ®å表 |
| | | |
| | | // æ«ç æªç¸å
³åé |
| | | scanCode: '', |
| | |
| | | this.initwarehouseTypes(); // åå§åä»åº |
| | | this.initLocationTypes(); // åå§åä»åºåºå |
| | | this.fetchStockStatistics(); // å è½½ç»è®¡æ°æ® |
| | | this.fetchUnpalletMaterialDetails(); |
| | | }, 300); |
| | | }); |
| | | } |
| | |
| | | this.backData = []; |
| | | this.$refs.palletForm?.reset(); |
| | | this.fetchStockStatistics(); // åæ®å·åäºï¼å·æ°ç»è®¡ |
| | | this.fetchUnpalletMaterialDetails(); |
| | | } |
| | | } |
| | | }, |
| | |
| | | callback(new Error('è¯·éæ©ä»åºåºå')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | |
| | | // æ ¹æ®æ¡ç å表è·åè¯¦ç»æ°æ® |
| | | async fetchUnpalletMaterialDetails() { |
| | | try { |
| | | // å°è¯è°ç¨æ¥å£è·åè¯¦ç»æ°æ® |
| | | // 注æï¼å¦æè¿ä¸ªæ¥å£ä¸åå¨ï¼å¯ä»¥æ³¨éæææ ¹æ®å®é
APIè°æ´ |
| | | const response = await http.post('/api/InboundOrder/UnPalletGroupBarcode?orderNo='+this.docNo, { |
| | | |
| | | }); |
| | | |
| | | console.log('æªç»çæ°æ®:', response.data); |
| | | |
| | | |
| | | if (response.status && Array.isArray(response.data)) { |
| | | this.unpalletMaterials = response.data; |
| | | this.unpalletBarcodes = response.data.map(item => item.barcode || ''); |
| | | this.totalStockCount = response.data.length; |
| | | } else { |
| | | // 妿æ¥å£è¿åæ ¼å¼ä¸åï¼å°è¯å
¶ä»æ¹å¼ |
| | | // 妿æ¥å£ä¸åå¨ï¼è¿éä¼è¿å
¥catchï¼è®¾ç½®ä¸ºç©ºæ°ç» |
| | | this.unpalletMaterials = []; |
| | | } |
| | | } catch (err) { |
| | | console.warn('è·åæªç»çè¯¦ç»æ°æ®æ¥å£å¯è½ä¸åå¨ï¼ä½¿ç¨æ¡ç å表æ¾ç¤ºï¼', err); |
| | | // 妿æ¥å£ä¸åå¨ï¼å°æ¡ç å表转æ¢ä¸ºç®åçæ¾ç¤ºæ ¼å¼ |
| | | // æè
ä¿æä¸ºç©ºï¼è®©ç¨æ·ç¥ééè¦éæ©ä»åºååºåæ¥æ¥çè¯¦ç»æ°æ® |
| | | this.unpalletMaterials = this.unpalletBarcodes.map(barcode => ({ |
| | | barcode: barcode, |
| | | materielCode: '-', |
| | | batchNo: '-', |
| | | stockQuantity: '-', |
| | | unit: '-', |
| | | supplyCode: '-', |
| | | warehouseType: '-' |
| | | })); |
| | | } |
| | | }, |
| | | /** |
| | |
| | | console.log('ä»åºåºåéªè¯éè¿:', value); |
| | | // åºåéæ©åï¼èªå¨èç¦å°æçè¾å
¥æ¡ |
| | | this.focusLocationSelect(); |
| | | // å·æ°æªç»çæ°æ®ï¼æ ¹æ®éæ©çä»åºååºåè¿æ»¤ï¼ |
| | | } |
| | | }); |
| | | }, 100); |
| | |
| | | this.trayBarcode = ''; |
| | | this.barcode = ''; |
| | | this.materials = []; |
| | | this.unpalletBarcodes = []; |
| | | this.unpalletMaterials = []; |
| | | this.loading = false; |
| | | this.error = ''; |
| | | this.scanCode = ''; |
| | |
| | | scanTime: this.formatTime(new Date()) |
| | | }); |
| | | }); |
| | | |
| | | const removeIndex = this.unpalletMaterials.findIndex(item => item.barcode === currentBarcode); |
| | | if (removeIndex > -1) { |
| | | this.unpalletMaterials.splice(removeIndex, 1); // å 餿ªç»çå¯¹åºæ°æ® |
| | | this.unpalletBarcodes = this.unpalletMaterials.map(item => item.barcode || ''); // æ´æ°æ¡ç æ°ç» |
| | | this.totalStockCount = Math.max(0, this.totalStockCount - 1); |
| | | } |
| | | |
| | | this.$message({ |
| | | message: `æåæ·»å æ¡ç : ${currentBarcode}`, |
| | |
| | | border: 1px solid #DCDFE6; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .unpallet-section.compact { |
| | | margin-bottom: 8px; |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .unpallet-card { |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .unpallet-barcode-list { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 6px; |
| | | padding: 8px 0; |
| | | max-height: 180px; |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .unpallet-barcode-list>>>.el-tag { |
| | | cursor: pointer; |
| | | max-width: calc(33.333% - 4px); |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | @media (max-width: 768px) { |
| | | .unpallet-barcode-list>>>.el-tag { |
| | | max-width: calc(50% - 4px); |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | import http from '@/api/http.js' |
| | | import { h, createVNode, render, reactive, ref } from 'vue'; |
| | | import { ElDialog, ElForm, ElFormItem, ElInput, ElButton, ElMessage, ElSelect, ElOption } from 'element-plus'; // å¼å
¥ElMessageï¼è§£å³æç¤ºæ ååº |
| | | |
| | | import gridHeader from './extend/EmptyTrayInbound.vue' |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridHeader: gridHeader, |
| | | gridBody: '', |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | name: '空æçå
¥åº', |
| | | type: 'primary', |
| | | value: '空æçå
¥åº', |
| | | // { |
| | | // name: '空æçå
¥åº', |
| | | // type: 'primary', |
| | | // value: '空æçå
¥åº', |
| | | |
| | | onClick: function () { |
| | | const mountNode = document.createElement('div'); |
| | | document.body.appendChild(mountNode); |
| | | // onClick: function () { |
| | | // const mountNode = document.createElement('div'); |
| | | // document.body.appendChild(mountNode); |
| | | |
| | | // ååºå¼è¡¨åæ°æ®ï¼æç®±ç ï¼å¿
å¡«ï¼æ«ç æª/æå¨è¾å
¥ï¼ |
| | | const formData = reactive({ |
| | | boxCode: '', |
| | | warehouseCode: '' |
| | | }); |
| | | // // ååºå¼è¡¨åæ°æ®ï¼æç®±ç ï¼å¿
å¡«ï¼æ«ç æª/æå¨è¾å
¥ï¼ |
| | | // const formData = reactive({ |
| | | // boxCode: '', |
| | | // warehouseCode: '' |
| | | // }); |
| | | |
| | | const warehouses = ref([]); |
| | | const isLoadingWarehouses = ref(false); |
| | | // const warehouses = ref([]); |
| | | // const isLoadingWarehouses = ref(false); |
| | | |
| | | const getWarehouseList = async () => { |
| | | isLoadingWarehouses.value = true; |
| | | try { |
| | | const { data, status } = await http.post('/api/LocationInfo/GetLocationTypes'); |
| | | if (status && Array.isArray(data)) { |
| | | // æ ¼å¼åä»åºé项ï¼éé
ElSelectçlabel-valueæ ¼å¼ |
| | | warehouses.value = data.map(item => ({ |
| | | label: item.locationTypeDesc, |
| | | value: item.locationType |
| | | })); |
| | | } else { |
| | | ElMessage.error('è·ååºåå表失败'); |
| | | warehouses.value = []; |
| | | } |
| | | } catch (err) { |
| | | ElMessage.error('åºåæ°æ®è¯·æ±å¼å¸¸ï¼è¯·ç¨åéè¯'); |
| | | warehouses.value = []; |
| | | } finally { |
| | | isLoadingWarehouses.value = false; |
| | | } |
| | | }; |
| | | // const getWarehouseList = async () => { |
| | | // isLoadingWarehouses.value = true; |
| | | // try { |
| | | // const { data, status } = await http.post('/api/LocationInfo/GetLocationTypes'); |
| | | // if (status && Array.isArray(data)) { |
| | | // // æ ¼å¼åä»åºé项ï¼éé
ElSelectçlabel-valueæ ¼å¼ |
| | | // warehouses.value = data.map(item => ({ |
| | | // label: item.locationTypeDesc, |
| | | // value: item.locationType |
| | | // })); |
| | | // } else { |
| | | // ElMessage.error('è·ååºåå表失败'); |
| | | // warehouses.value = []; |
| | | // } |
| | | // } catch (err) { |
| | | // ElMessage.error('åºåæ°æ®è¯·æ±å¼å¸¸ï¼è¯·ç¨åéè¯'); |
| | | // warehouses.value = []; |
| | | // } finally { |
| | | // isLoadingWarehouses.value = false; |
| | | // } |
| | | // }; |
| | | |
| | | // æäº¤è¡¨åçç»ä¸é»è¾ï¼ä¾å车触ååæé®ç¹å»å
±ç¨ï¼ |
| | | const submitForm = async () => { |
| | | const formRef = vnode.component.refs.batchInForm; |
| | | try { |
| | | // æ§è¡è¡¨åæ ¡éªï¼æç®±ç å¿
å¡«ï¼ |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | ElMessage.warning('请è¾å
¥ææçæç®±ç '); |
| | | return; |
| | | } |
| | | // // æäº¤è¡¨åçç»ä¸é»è¾ï¼ä¾å车触ååæé®ç¹å»å
±ç¨ï¼ |
| | | // const submitForm = async () => { |
| | | // const formRef = vnode.component.refs.batchInForm; |
| | | // try { |
| | | // // æ§è¡è¡¨åæ ¡éªï¼æç®±ç å¿
å¡«ï¼ |
| | | // await formRef.validate(); |
| | | // } catch (err) { |
| | | // ElMessage.warning('请è¾å
¥ææçæç®±ç '); |
| | | // return; |
| | | // } |
| | | |
| | | |
| | | http.post('/api/InboundOrder/EmptyMaterielGroup', { |
| | | palletCode: formData.boxCode.trim(), |
| | | warehouseCode: formData.warehouseCode |
| | | }).then(({ data, status, message }) => { |
| | | if (status) { |
| | | ElMessage.success(`å
¥åºæåï¼æç®±ç ï¼${formData.boxCode.trim()}`); |
| | | this.refresh(); |
| | | formData.boxCode = ''; |
| | | // http.post('/api/InboundOrder/EmptyMaterielGroup', { |
| | | // palletCode: formData.boxCode.trim(), |
| | | // warehouseCode: formData.warehouseCode |
| | | // }).then(({ data, status, message }) => { |
| | | // if (status) { |
| | | // ElMessage.success(`å
¥åºæåï¼æç®±ç ï¼${formData.boxCode.trim()}`); |
| | | // this.refresh(); |
| | | // formData.boxCode = ''; |
| | | |
| | | setTimeout(() => { |
| | | const inputRef = vnode.component.refs.boxCodeInput; |
| | | inputRef?.focus(); |
| | | }, 100); |
| | | } else { |
| | | ElMessage.error(message || data?.message || 'å
¥åºå¤±è´¥'); |
| | | selectBoxCodeInput(); |
| | | } |
| | | }).catch(() => { |
| | | ElMessage.error('请æ±å¤±è´¥ï¼è¯·ç¨åéè¯'); |
| | | selectBoxCodeInput(); |
| | | }); |
| | | }; |
| | | // setTimeout(() => { |
| | | // const inputRef = vnode.component.refs.boxCodeInput; |
| | | // inputRef?.focus(); |
| | | // }, 100); |
| | | // } else { |
| | | // ElMessage.error(message || data?.message || 'å
¥åºå¤±è´¥'); |
| | | // selectBoxCodeInput(); |
| | | // } |
| | | // }).catch(() => { |
| | | // ElMessage.error('请æ±å¤±è´¥ï¼è¯·ç¨åéè¯'); |
| | | // selectBoxCodeInput(); |
| | | // }); |
| | | // }; |
| | | |
| | | const selectBoxCodeInput = () => { |
| | | setTimeout(() => { |
| | | const inputRef = vnode.component.refs.boxCodeInput; |
| | | if (inputRef) { |
| | | const targetInput = inputRef.$el?.querySelector('input') || inputRef; |
| | | targetInput?.focus(); |
| | | targetInput?.select(); |
| | | } |
| | | }, 100); |
| | | } |
| | | const vnode = createVNode(ElDialog, { |
| | | title: '空æçå
¥åº', |
| | | width: '400px', |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | // const selectBoxCodeInput = () => { |
| | | // setTimeout(() => { |
| | | // const inputRef = vnode.component.refs.boxCodeInput; |
| | | // if (inputRef) { |
| | | // const targetInput = inputRef.$el?.querySelector('input') || inputRef; |
| | | // targetInput?.focus(); |
| | | // targetInput?.select(); |
| | | // } |
| | | // }, 100); |
| | | // } |
| | | // const vnode = createVNode(ElDialog, { |
| | | // title: '空æçå
¥åº', |
| | | // width: '400px', |
| | | // modelValue: true, |
| | | // appendToBody: true, |
| | | |
| | | onOpened: async () => { |
| | | await getWarehouseList(); |
| | | const inputRef = vnode.component.refs.boxCodeInput; |
| | | inputRef?.focus(); |
| | | }, |
| | | 'onUpdate:modelValue': (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | } |
| | | }, { |
| | | default: () => h(ElForm, { |
| | | model: formData, |
| | | rules: { |
| | | boxCode: [ |
| | | { required: true, message: '请è¾å
¥æç®±ç ', trigger: ['blur', 'enter'] } |
| | | ], |
| | | warehouseCode: [ |
| | | { required: true, message: 'è¯·éæ©åºå', trigger: ['change', 'blur'] } |
| | | ] |
| | | }, |
| | | ref: 'batchInForm' |
| | | }, [ |
| | | //ä»åºæ°æ® |
| | | h(ElFormItem, { label: 'åºå', prop: 'warehouseCode', required: true }, [ |
| | | h(ElSelect, { |
| | | modelValue: formData.warehouseCode, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.warehouseCode = val; |
| | | }, |
| | | placeholder: 'è¯·éæ©å
¥åºåºå', |
| | | filterable: true, // æ¯ææç´¢ä»åº |
| | | loading: isLoadingWarehouses.value, // å è½½ç¶æ |
| | | style: { width: '100%' } |
| | | }, [ |
| | | // 渲æä»åºä¸æé项 |
| | | warehouses.value.map(item => h(ElOption, { |
| | | label: item.label, |
| | | value: item.value |
| | | })) |
| | | ]) |
| | | ]), |
| | | // æç®±ç è¾å
¥é¡¹ï¼æ¯æèç¦ãå车æäº¤ï¼ |
| | | h(ElFormItem, { label: 'æç®±ç ', prop: 'boxCode', required: true }, [ |
| | | h(ElInput, { |
| | | type: 'text', |
| | | modelValue: formData.boxCode, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.boxCode = val; |
| | | }, |
| | | ref: 'boxCodeInput', |
| | | placeholder: 'æ«ç è¾å
¥ææå¨è¾å
¥æç®±ç ', |
| | | // çå¬å车äºä»¶ï¼æ«ç æªé»è®¤ä¼åéåè½¦ï¼ |
| | | onKeydown: (e) => { |
| | | if (e.key === 'Enter') { |
| | | e.preventDefault(); |
| | | submitForm(); |
| | | } |
| | | } |
| | | }) |
| | | ]), |
| | | // åºé¨æé®åº |
| | | h('div', { style: { textAlign: 'right', marginTop: '16px' } }, [ |
| | | h(ElButton, { |
| | | type: 'text', |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info('åæ¶å
¥åºä»»å¡'); |
| | | } |
| | | }, 'åæ¶'), |
| | | h(ElButton, { |
| | | type: 'primary', |
| | | onClick: submitForm |
| | | }, 'ç¡®å®') |
| | | ]) |
| | | ]) |
| | | }); |
| | | // onOpened: async () => { |
| | | // await getWarehouseList(); |
| | | // const inputRef = vnode.component.refs.boxCodeInput; |
| | | // inputRef?.focus(); |
| | | // }, |
| | | // 'onUpdate:modelValue': (isVisible) => { |
| | | // if (!isVisible) { |
| | | // render(null, mountNode); |
| | | // document.body.removeChild(mountNode); |
| | | // } |
| | | // } |
| | | // }, { |
| | | // default: () => h(ElForm, { |
| | | // model: formData, |
| | | // rules: { |
| | | // boxCode: [ |
| | | // { required: true, message: '请è¾å
¥æç®±ç ', trigger: ['blur', 'enter'] } |
| | | // ], |
| | | // warehouseCode: [ |
| | | // { required: true, message: 'è¯·éæ©åºå', trigger: ['change', 'blur'] } |
| | | // ] |
| | | // }, |
| | | // ref: 'batchInForm' |
| | | // }, [ |
| | | // //ä»åºæ°æ® |
| | | // h(ElFormItem, { label: 'åºå', prop: 'warehouseCode', required: true }, [ |
| | | // h(ElSelect, { |
| | | // modelValue: formData.warehouseCode, |
| | | // 'onUpdate:modelValue': (val) => { |
| | | // formData.warehouseCode = val; |
| | | // }, |
| | | // placeholder: 'è¯·éæ©å
¥åºåºå', |
| | | // filterable: true, // æ¯ææç´¢ä»åº |
| | | // loading: isLoadingWarehouses.value, // å è½½ç¶æ |
| | | // style: { width: '100%' } |
| | | // }, [ |
| | | // // 渲æä»åºä¸æé项 |
| | | // warehouses.value.map(item => h(ElOption, { |
| | | // label: item.label, |
| | | // value: item.value |
| | | // })) |
| | | // ]) |
| | | // ]), |
| | | // // æç®±ç è¾å
¥é¡¹ï¼æ¯æèç¦ãå车æäº¤ï¼ |
| | | // h(ElFormItem, { label: 'æç®±ç ', prop: 'boxCode', required: true }, [ |
| | | // h(ElInput, { |
| | | // type: 'text', |
| | | // modelValue: formData.boxCode, |
| | | // 'onUpdate:modelValue': (val) => { |
| | | // formData.boxCode = val; |
| | | // }, |
| | | // ref: 'boxCodeInput', |
| | | // placeholder: 'æ«ç è¾å
¥ææå¨è¾å
¥æç®±ç ', |
| | | // // çå¬å车äºä»¶ï¼æ«ç æªé»è®¤ä¼åéåè½¦ï¼ |
| | | // onKeydown: (e) => { |
| | | // if (e.key === 'Enter') { |
| | | // e.preventDefault(); |
| | | // submitForm(); |
| | | // } |
| | | // } |
| | | // }) |
| | | // ]), |
| | | // // åºé¨æé®åº |
| | | // h('div', { style: { textAlign: 'right', marginTop: '16px' } }, [ |
| | | // h(ElButton, { |
| | | // type: 'text', |
| | | // onClick: () => { |
| | | // render(null, mountNode); |
| | | // document.body.removeChild(mountNode); |
| | | // ElMessage.info('åæ¶å
¥åºä»»å¡'); |
| | | // } |
| | | // }, 'åæ¶'), |
| | | // h(ElButton, { |
| | | // type: 'primary', |
| | | // onClick: submitForm |
| | | // }, 'ç¡®å®') |
| | | // ]) |
| | | // ]) |
| | | // }); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | } |
| | | } |
| | | // vnode.appContext = this.$.appContext; |
| | | // render(vnode, mountNode); |
| | | // } |
| | | // } |
| | | ], box: [], detail: [] |
| | | }, |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | var EmptyTrayInboundBtn = this.buttons.find(x => x.value == "EmptyTrayInbound"); |
| | | if (EmptyTrayInboundBtn != null) { |
| | | EmptyTrayInboundBtn.onClick = () => { |
| | | this.$refs.gridHeader.open(); |
| | | } |
| | | } |
| | | |
| | | |
| | | this.columns.forEach(column => { |
| | | if (column.field === 'orderStatistics') { |
| | | column.formatter = (row) => { |
| | |
| | | <template> |
| | | <vol-box v-model="show" title="空æåºåº" :width="400" :height="600"> |
| | | <vol-box v-model="show" title="空æåºåº" :width="800" :height="1200"> |
| | | <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 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-input-number v-model="num" :min="1" :max="999" :controls="true" placeholder="è¯·éæ©åºåºæ°é" style="width: 100%;"></el-input-number> |
| | | <el-input-number v-model="num" :min="1" :max="999" :controls="true" placeholder="è¯·éæ©åºåºæ°é" |
| | | style="width: 100%;"></el-input-number> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | |
| | | WebResponseContent UnPalletQuantity(string orderNo); |
| | | |
| | | WebResponseContent UndoPalletGroup(string palletCode , string barcode = ""); |
| | | |
| | | WebResponseContent UnPalletGroupBarcode(string orderNo); |
| | | } |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | var inbound =_inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == orderNo); |
| | | var inboundDetails = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().Where(x => x.OrderId == inbound.First().Id).ToList(); |
| | | resultDTO.StockSumQuantity = inboundDetails.Where(x=>x.ReceiptQuantity==0).Sum(x=>x.OrderQuantity); |
| | | resultDTO.StockCount = inboundDetails.Where(x => x.ReceiptQuantity == 0).Count(); |
| | | //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 new PageGridData<Dt_InboundOrder>(); |
| | | //} |
| | | |
| | | public WebResponseContent UnPalletGroupBarcode(string orderNo) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | var inbound = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == orderNo).First(); |
| | | if(inbound == null) |
| | | { |
| | | return content.Error(); |
| | | } |
| | | |
| | | var details = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().Where(x => x.OrderId == inbound.Id && x.ReceiptQuantity == 0).ToList(); |
| | | |
| | | return content.OK(data:details); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ§è¡æå¨æå
é»è¾ - ä¿®å¤çæ¬ |
| | | /// æ§è¡æå¨æå
é»è¾ |
| | | /// </summary> |
| | | private async Task<List<SplitResult>> ExecuteManualSplitLogic(Dt_OutStockLockInfo lockInfo, Dt_StockInfoDetail stockDetail, |
| | | decimal splitQuantity, string palletCode) |
| | |
| | | MaterielCode = stockDetail.MaterielCode, |
| | | OrderNo = stockDetail.OrderNo, |
| | | BatchNo = stockDetail.BatchNo, |
| | | StockQuantity = newStockQuantity, // ä¿®å¤ï¼ä½¿ç¨æ£ç¡®çæå
æ°é |
| | | OutboundQuantity = 0, // æ°æ¡ç åå§åºåºæ°é为0 |
| | | StockQuantity = newStockQuantity, |
| | | OutboundQuantity = 0, |
| | | Barcode = newBarcode, |
| | | Status = (int)StockStatusEmun.åºåºéå®, |
| | | SupplyCode = stockDetail.SupplyCode, |
| | |
| | | BarcodeUnit = stockDetail.BarcodeUnit, |
| | | BusinessType = stockDetail.BusinessType, |
| | | InboundOrderRowNo = stockDetail.InboundOrderRowNo, |
| | | FactoryArea = stockDetail.FactoryArea, |
| | | WarehouseCode = stockDetail.WarehouseCode, |
| | | }; |
| | | |
| | | await _stockInfoDetailService.Db.Insertable(newStockDetail).ExecuteCommandAsync(); |
| | |
| | | // æ§è¡èªå¨æå
|
| | | var splitResult = await ExecuteAutoSplitLogic(lockInfo, stockDetail, splitQuantity, palletCode); |
| | | |
| | | // å°æå
æ°éä¼ éç»è°ç¨æ¹ï¼ç¨äºéªè¯ |
| | | if (splitResult != null && splitResult.Any()) |
| | | { |
| | | // å¨è¿åç»æä¸æºå¸¦æå
æ°éä¿¡æ¯ |
| | | foreach (var result in splitResult) |
| | | { |
| | | result.quantityTotal = splitQuantity.ToString("F2"); |
| | | } |
| | | } |
| | | |
| | | return splitResult; |
| | | } |
| | | |
| | |
| | | BarcodeUnit = stockDetail.BarcodeUnit, |
| | | BusinessType = stockDetail.BusinessType, |
| | | InboundOrderRowNo = stockDetail.InboundOrderRowNo, |
| | | FactoryArea=stockDetail.FactoryArea, |
| | | WarehouseCode = stockDetail.WarehouseCode, |
| | | }; |
| | | |
| | | await _stockInfoDetailService.Db.Insertable(newStockDetail).ExecuteCommandAsync(); |
| | |
| | | await RecordSplitHistory(lockInfo, stockDetail, splitQuantity, newBarcode, true, originalStockQty); |
| | | |
| | | // å建æå
ç»æå表 |
| | | var splitResults = CreateSplitResults(lockInfo, splitQuantity, lockInfo.AssignQuantity, newBarcode, stockDetail.Barcode); |
| | | var splitResults = CreateSplitResults(lockInfo, splitQuantity, stockDetail.StockQuantity, newBarcode, stockDetail.Barcode); |
| | | |
| | | _logger.LogInformation($"èªå¨æå
é»è¾æ§è¡å®æ - åå»ºäºæªåé
çåºååéå®è®°å½"); |
| | | |
| | |
| | | { |
| | | var splitHistory = new Dt_SplitPackageRecord |
| | | { |
| | | OrderNo = lockInfo.OrderNo, |
| | | FactoryArea = lockInfo.FactoryArea, |
| | | TaskNum = lockInfo.TaskNum, |
| | | OutStockLockInfoId = lockInfo.Id, |
| | | StockId = stockDetail.StockId, |
| | | Operator = App.User.UserName, |
| | | IsReverted = false, |
| | | OriginalBarcode = stockDetail.Barcode, |
| | | NewBarcode = newBarcode, |
| | | SplitQty = splitQty, |
| | | // RemainQuantity = remainQty, |
| | | MaterielCode = lockInfo.MaterielCode, |
| | | SplitTime = DateTime.Now, |
| | | OrderNo = lockInfo.OrderNo, |
| | | PalletCode = lockInfo.PalletCode, |
| | | |
| | | |
| | | |
| | | Status = (int)SplitPackageStatusEnum.å·²æå
, |
| | | IsAutoSplit = isAutoSplit, |
| | | // SplitType = isAutoSplit ? "èªå¨æå
" : "æå¨æå
" |
| | | OriginalStockQuantity = originalStockQuantity ?? stockDetail.StockQuantity, |
| | | //RemainingStockQuantity = stockDetail.StockQuantity - splitQty |
| | | TaskNum = lockInfo.TaskNum |
| | | |
| | | }; |
| | | |
| | | await _splitPackageService.Db.Insertable(splitHistory).ExecuteCommandAsync(); |
| | |
| | | FactoryArea = item.FactoryArea, |
| | | Status = 0, |
| | | OrderNo = item.OrderNo, |
| | | BusinessType = materielGroupDTO.orderTypes.ToString() |
| | | BusinessType = materielGroupDTO.orderTypes.ToString(), |
| | | |
| | | |
| | | }); |
| | | item.WarehouseCode = item.WarehouseCode; |
| | |
| | | OutboundQuantity = request.SplitQuantity, |
| | | Barcode = newBarcode, |
| | | InboundOrderRowNo = baseStockDetail.InboundOrderRowNo, |
| | | FactoryArea = baseStockDetail.FactoryArea, |
| | | }; |
| | | await _stockInfoDetailService.Db.Insertable(newStockDetail).ExecuteCommandAsync(); |
| | | |
| | |
| | | |
| | | allocatefeedmodel.Details.Add(detailModel); |
| | | } |
| | | var groupedResult = allocatefeedmodel.Details.GroupBy(item => new |
| | | { |
| | | item.WarehouseCode, |
| | | item.MaterialCode, |
| | | item.Unit, |
| | | item.LineNo |
| | | }).Select(group => new AllocateDtoDetail |
| | | { |
| | | WarehouseCode = group.Key.WarehouseCode, |
| | | MaterialCode = group.Key.MaterialCode, |
| | | LineNo = group.Key.LineNo, |
| | | Qty = group.Sum(x => x.Qty), |
| | | Unit = group.Key.Unit, |
| | | Barcodes = group.SelectMany(x => x.Barcodes) |
| | | .GroupBy(b => b.Barcode) |
| | | .Select(b => new BarcodeInfo |
| | | { |
| | | Barcode = b.Key, |
| | | BatchNo = b.First().BatchNo, |
| | | SupplyCode = b.First().SupplyCode, |
| | | Qty = b.Max(x => x.Qty), |
| | | Unit = b.First().Unit |
| | | }) .ToList() |
| | | }) .ToList(); |
| | | allocatefeedmodel.Details = groupedResult; |
| | | |
| | | var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel); |
| | | if (result != null && result.code == 200) |
| | |
| | | } |
| | | feedmodel.details.Add(detailModel); |
| | | } |
| | | var groupedResult = feedmodel.details.GroupBy(item => new |
| | | { |
| | | item.warehouseCode, |
| | | item.materialCode, |
| | | item.unit, |
| | | item.lineNo |
| | | }).Select(group => new FeedbackOutboundDetailsModel |
| | | { |
| | | warehouseCode = group.Key.warehouseCode, |
| | | materialCode = group.Key.materialCode, |
| | | lineNo = group.Key.lineNo, |
| | | qty = group.Sum(x => x.qty), |
| | | unit = group.Key.unit, |
| | | barcodes = group.SelectMany(x => x.barcodes) |
| | | .GroupBy(b => b.barcode) |
| | | .Select(b => new WIDESEA_DTO.Outbound.BarcodesModel |
| | | { |
| | | barcode = b.Key, |
| | | batchNo = b.First().batchNo, |
| | | supplyCode = b.First().supplyCode, |
| | | qty = b.Max(x => x.qty), |
| | | unit = b.First().unit |
| | | }).ToList() |
| | | }).ToList(); |
| | | feedmodel.details = groupedResult; |
| | | |
| | | var result = await _invokeMESService.FeedbackOutbound(feedmodel); |
| | | if (result != null && result.code == 200) |
| | |
| | | [HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate] |
| | | public async Task<WebResponseContent> Test() |
| | | { |
| | | |
| | | //var originalTask = _taskRepository.Db.Queryable<Dt_Task>().First(); |
| | | |
| | | //var result = _task_HtyService.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.人工å é¤); |
| | |
| | | //var ddddssss = "WSLOT" + DateTime.Now.ToString("yyyyMMddHHmmss") + ssss.ToString().PadLeft(5, '0'); |
| | | //erpApiService.GetSuppliersAsync(); |
| | | |
| | | erpApiService.GetMaterialUnitAsync(); |
| | | // erpApiService.GetMaterialUnitAsync(); |
| | | |
| | | //var sss = await _invokeMESService.NewMaterielToMes(new WIDESEA_DTO.Basic.MaterielToMesDTO |
| | | //{ |
| | |
| | | |
| | | } |
| | | |
| | | [HttpPost, Route("UnPalletGroupBarcode"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent UnPalletGroupBarcode(string orderNo) |
| | | { |
| | | return Service.UnPalletGroupBarcode(orderNo); |
| | | } |
| | | |
| | | [HttpPost, Route("UndoPalletGroup"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent UndoPalletGroup(string palletCode,string barcode="") |
| | | { |