Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215
| | |
| | | type: 'warning', |
| | | onClick: function () { |
| | | } |
| | | },{ |
| | | name: "计ç®åºåæ»å", |
| | | icon: '', |
| | | class: '', |
| | | value: 'CalculateStock', |
| | | type: 'warning', |
| | | onClick: function () { |
| | | } |
| | | } |
| | | ] |
| | | |
| | |
| | | <div class="location-section compact"> |
| | | <el-form :model="form" :rules="rules" ref="locationForm" class="compact-form"> |
| | | <el-form-item label="ä»åºåºå" prop="locationType" class="location-select compact-item"> |
| | | <el-select v-model="form.locationType" placeholder="请å
éæ©ä»åº" clearable filterable |
| | | @change="handleLocationChange" style="width: 100%" :loading="locationLoading" size="medium"> |
| | | <el-select v-model="form.locationType" placeholder="èªå¨è·åä»åºåºå" clearable filterable |
| | | @change="handleLocationChange" style="width: 100%" :loading="locationLoading" size="medium" :disabled="true"> |
| | | <el-option v-for="item in locationTypes" :key="item.locationType" :label="item.locationTypeDesc" |
| | | :value="item.locationType" /> |
| | | </el-select> |
| | |
| | | } |
| | | }, |
| | | |
| | | |
| | | visible(newVal, oldVal) { |
| | | this.palletVisible = newVal; |
| | | |
| | |
| | | } |
| | | }, |
| | | |
| | | fetchLocationByWarehouse(warehouseCode) { |
| | | if (!warehouseCode) { |
| | | this.form.locationType = null; |
| | | return; |
| | | } |
| | | this.locationLoading = true; |
| | | http.post(`/api/InboundOrder/GetLocationType?code=${warehouseCode}`) |
| | | .then(({ data }) => { |
| | | if (data) { |
| | | this.form.locationType = data.locationType || data; |
| | | if (!this.locationTypes.find(item => item.locationType === this.form.locationType)) { |
| | | this.locationTypes.push({ |
| | | locationType: this.form.locationType, |
| | | locationTypeDesc: this.form.locationType |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.error("è·åä»åºåºå失败:", err); |
| | | this.$message.error("è·åä»åºåºå失败ï¼è¯·éè¯"); |
| | | this.form.locationType = null; |
| | | }) |
| | | .finally(() => { |
| | | this.locationLoading = false; |
| | | }); |
| | | }, |
| | | async fetchStockStatistics(orderNo) { |
| | | // åæ®å·ä¸ºç©ºæ¶ä¸æ¥è¯¢ |
| | | if (!orderNo) { |
| | |
| | | this.barcode = ''; |
| | | this.materials = []; |
| | | this.error = ''; |
| | | this.fetchLocationByWarehouse(this.form.warehouseType); |
| | | }, |
| | | |
| | | // åºå忢äºä»¶ |
| | |
| | | <div class="location-section compact"> |
| | | <el-form :model="form" :rules="rules" ref="locationForm" class="compact-form"> |
| | | <el-form-item label="ä»åºåºå" prop="locationType" class="location-select compact-item"> |
| | | <el-select v-model="form.locationType" placeholder="请å
éæ©ä»åº" clearable filterable |
| | | @change="handleLocationChange" style="width: 100%" :loading="locationLoading" size="medium"> |
| | | <el-select v-model="form.locationType" placeholder="èªå¨è·åä»åºåºå" clearable filterable |
| | | @change="handleLocationChange" style="width: 100%" :loading="locationLoading" size="medium" :disabled="true"> |
| | | <el-option v-for="item in locationTypes" :key="item.locationType" :label="item.locationTypeDesc" |
| | | :value="item.locationType" /> |
| | | </el-select> |
| | |
| | | }) |
| | | .finally(() => { |
| | | this.warehouseLoading = false; |
| | | }); |
| | | }, |
| | | |
| | | fetchLocationByWarehouse(warehouseCode) { |
| | | if (!warehouseCode) { |
| | | this.form.locationType = null; |
| | | return; |
| | | } |
| | | this.locationLoading = true; |
| | | http.post(`/api/InboundOrder/GetLocationType?code=${warehouseCode}`) |
| | | .then(({ data }) => { |
| | | if (data) { |
| | | this.form.locationType = data.locationType || data; |
| | | if (!this.locationTypes.find(item => item.locationType === this.form.locationType)) { |
| | | this.locationTypes.push({ |
| | | locationType: this.form.locationType, |
| | | locationTypeDesc: this.form.locationType |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.error("è·åä»åºåºå失败:", err); |
| | | this.$message.error("è·åä»åºåºå失败ï¼è¯·éè¯"); |
| | | this.form.locationType = null; |
| | | }) |
| | | .finally(() => { |
| | | this.locationLoading = false; |
| | | }); |
| | | }, |
| | | |
| | |
| | | this.barcode = ''; |
| | | this.materials = []; |
| | | this.error = ''; |
| | | this.fetchLocationByWarehouse(this.form.warehouseType); |
| | | }, |
| | | |
| | | // åºå忢äºä»¶ |
| | |
| | | > |
| | | <el-select |
| | | v-model="form.locationType" |
| | | placeholder="请å
éæ©ä»åº" |
| | | placeholder="èªå¨è·åä»åºåºå" |
| | | clearable |
| | | filterable |
| | | @change="handleLocationChange" |
| | | style="width: 100%" |
| | | :loading="locationLoading" |
| | | size="medium" |
| | | :disabled="true" |
| | | > |
| | | <el-option |
| | | v-for="item in locationTypes" |
| | |
| | | }); |
| | | }, |
| | | |
| | | fetchLocationByWarehouse(warehouseCode) { |
| | | if (!warehouseCode) { |
| | | this.form.locationType = null; |
| | | return; |
| | | } |
| | | this.locationLoading = true; |
| | | http.post(`/api/InboundOrder/GetLocationType?code=${warehouseCode}`) |
| | | .then(({ data }) => { |
| | | if (data) { |
| | | this.form.locationType = data.locationType || data; |
| | | if (!this.locationTypes.find(item => item.locationType === this.form.locationType)) { |
| | | this.locationTypes.push({ |
| | | locationType: this.form.locationType, |
| | | locationTypeDesc: this.form.locationType |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.error("è·åä»åºåºå失败:", err); |
| | | this.$message.error("è·åä»åºåºå失败ï¼è¯·éè¯"); |
| | | this.form.locationType = null; |
| | | }) |
| | | .finally(() => { |
| | | this.locationLoading = false; |
| | | }); |
| | | }, |
| | | // è·ååºåç»è®¡ |
| | | fetchStockStatistics(orderNo) { |
| | | if (!orderNo) { |
| | |
| | | this.barcode = ""; |
| | | this.materials = []; |
| | | this.error = ""; |
| | | this.fetchLocationByWarehouse(this.form.warehouseType); |
| | | }, |
| | | |
| | | // åºå忢äºä»¶ |
| | |
| | | <div class="location-section compact"> |
| | | <el-form :model="form" :rules="rules" ref="locationForm" class="compact-form"> |
| | | <el-form-item label="ä»åºåºå" prop="locationType" class="location-select compact-item"> |
| | | <el-select v-model="form.locationType" placeholder="请å
éæ©ä»åº" clearable filterable |
| | | @change="handleLocationChange" style="width: 100%" :loading="locationLoading" size="medium"> |
| | | <el-select v-model="form.locationType" placeholder="èªå¨è·åä»åºåºå" clearable filterable |
| | | @change="handleLocationChange" style="width: 100%" :loading="locationLoading" size="medium" :disabled="true"> |
| | | <el-option v-for="item in locationTypes" :key="item.locationType" :label="item.locationTypeDesc" |
| | | :value="item.locationType" /> |
| | | </el-select> |
| | |
| | | } |
| | | }, |
| | | |
| | | fetchLocationByWarehouse(warehouseCode) { |
| | | if (!warehouseCode) { |
| | | this.form.locationType = null; |
| | | return; |
| | | } |
| | | this.locationLoading = true; |
| | | http.post(`/api/InboundOrder/GetLocationType?code=${warehouseCode}`) |
| | | .then(({ data }) => { |
| | | if (data) { |
| | | this.form.locationType = data.locationType || data; |
| | | if (!this.locationTypes.find(item => item.locationType === this.form.locationType)) { |
| | | this.locationTypes.push({ |
| | | locationType: this.form.locationType, |
| | | locationTypeDesc: this.form.locationType |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.error("è·åä»åºåºå失败:", err); |
| | | this.$message.error("è·åä»åºåºå失败ï¼è¯·éè¯"); |
| | | this.form.locationType = null; |
| | | }) |
| | | .finally(() => { |
| | | this.locationLoading = false; |
| | | }); |
| | | }, |
| | | async fetchStockStatistics(orderNo) { |
| | | // åæ®å·ä¸ºç©ºæ¶ä¸æ¥è¯¢ |
| | | if (!orderNo) { |
| | |
| | | this.barcode = ''; |
| | | this.materials = []; |
| | | this.error = ''; |
| | | this.fetchLocationByWarehouse(this.form.warehouseType); |
| | | }, |
| | | |
| | | // åºå忢äºä»¶ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <vol-box v-model="show" title="ç©æåºåæ¥è¯¢" :width="800" :height="600"> |
| | | <template #content> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="90px"> |
| | | <!-- ä»åºå·è¾å
¥æ¡ --> |
| | | <el-form-item label="ä»åºå·:" prop="warehouseCode"> |
| | | <el-input |
| | | v-model="form.warehouseCode" |
| | | placeholder="请è¾å
¥ä»åºå·ï¼å¦ï¼5053ï¼" |
| | | clearable |
| | | @input="handleWarehouseInput" |
| | | @keyup.enter="focusMaterielInput" |
| | | ref="warehouseCodeInput" |
| | | :disabled="loading" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <!-- ç©ææ¡ç è¾å
¥æ¡ --> |
| | | <el-form-item label="ç©ææ¡ç :" prop="materielBarcode"> |
| | | <el-input |
| | | v-model="form.materielBarcode" |
| | | placeholder="è¯·æ«æ/è¾å
¥ç©ææ¡ç ï¼å¦ï¼100401-01211ï¼" |
| | | @keyup.enter="getStockTotal" |
| | | clearable |
| | | @paste="handlePaste" |
| | | @input="handleInput" |
| | | ref="materielCodeInput" |
| | | :disabled="loading" |
| | | /> |
| | | <!-- åºåæ¥è¯¢å è½½ç¶æ --> |
| | | <el-icon class="ml-2" v-if="loading"><loading /></el-icon> |
| | | </el-form-item> |
| | | |
| | | <!-- åºåæ»åæ¾ç¤ºåºå --> |
| | | <el-form-item label="åºåæ»å:" prop="totalStockQuantity"> |
| | | <el-input |
| | | v-model="form.totalStockQuantity" |
| | | placeholder="请è¾å
¥ä»åºå·åç©ææ¡ç æ¥è¯¢" |
| | | disabled |
| | | prefix-icon="el-icon-s-data" |
| | | /> |
| | | <!-- æ æ°æ®æç¤º --> |
| | | <span v-if="form.totalStockQuantity === 0 && !loading && form.materielBarcode && form.warehouseCode" class="text-gray-500 ml-2"> |
| | | è¯¥ç©æå¨å½åä»åºææ åºå |
| | | </span> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | | |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="resetForm">éç½®</el-button> |
| | | <el-button @click="show = false">å
³é</el-button> |
| | | </div> |
| | | </template> |
| | | </vol-box> |
| | | </template> |
| | | |
| | | <script> |
| | | import VolBox from '@/components/basic/VolBox.vue' |
| | | import { Loading } from '@element-plus/icons-vue' |
| | | |
| | | export default { |
| | | components: { VolBox, Loading }, |
| | | props: { |
| | | value: { type: Boolean, default: false } |
| | | }, |
| | | data() { |
| | | // ä»åºå·éªè¯è§å |
| | | const validateWarehouseCode = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('请è¾å
¥ä»åºå·')); |
| | | } |
| | | callback(); |
| | | }; |
| | | |
| | | // ç©ææ¡ç éªè¯è§å |
| | | const validateMaterielBarcode = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('请è¾å
¥ç©ææ¡ç ')); |
| | | } |
| | | callback(); |
| | | }; |
| | | |
| | | return { |
| | | show: false, |
| | | loading: false, // åºåæ¥è¯¢å è½½ç¶æ |
| | | form: { |
| | | warehouseCode: '', // ä»åºå· |
| | | materielBarcode: '', // ç©ææ¡ç |
| | | totalStockQuantity: 0 // åºåæ»å |
| | | }, |
| | | // 表åéªè¯è§å |
| | | rules: { |
| | | warehouseCode: [ |
| | | { validator: validateWarehouseCode, trigger: ['blur', 'change'] } |
| | | ], |
| | | materielBarcode: [ |
| | | { validator: validateMaterielBarcode, trigger: ['blur', 'change'] } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | // æå¼å¼¹çªåå§å |
| | | open() { |
| | | this.show = true |
| | | this.$nextTick(() => { |
| | | this.focusWarehouseInput() |
| | | }) |
| | | }, |
| | | async getStockTotal() { |
| | | // 表åéªè¯ |
| | | try { |
| | | await this.$refs.form.validate(); |
| | | } catch (error) { |
| | | if (!this.form.warehouseCode) { |
| | | this.focusWarehouseInput(); |
| | | } else { |
| | | this.focusAndSelectInput(); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | this.loading = true; |
| | | try { |
| | | const res = await this.http.post('/api/StockDetailByMateriel/CalculateStock?warehouseCode=' + this.form.warehouseCode.trim() + '&materielCode=' + this.form.materielBarcode.trim()); |
| | | if (res.status && res.code === 0) { |
| | | this.form.totalStockQuantity = Number(res.data) || 0; |
| | | this.$message.success('åºåæ¥è¯¢æå'); |
| | | } else { |
| | | this.form.totalStockQuantity = 0; |
| | | this.$message.error(res.message || 'åºåæ¥è¯¢å¤±è´¥ï¼æ¥å£è¿åå¼å¸¸'); |
| | | } |
| | | } catch (error) { |
| | | this.form.totalStockQuantity = 0; |
| | | const errorMsg = error.response |
| | | ? `æ¥å£é误ï¼${error.response.status} - ${error.response.data?.message || 'æªç¥é误'}` |
| | | : `ç½ç»å¼å¸¸ï¼${error.message}`; |
| | | this.$message.error(`åºåæ¥è¯¢å¤±è´¥ï¼${errorMsg}`); |
| | | } finally { |
| | | this.loading = false; |
| | | } |
| | | }, |
| | | |
| | | // ä»åºå·è¾å
¥è¿æ»¤ |
| | | handleWarehouseInput(value) { |
| | | this.form.warehouseCode = value.replace(/[^a-zA-Z0-9]/g, '').toUpperCase(); |
| | | this.$nextTick(() => { |
| | | this.$refs.form.validateField('warehouseCode'); |
| | | }); |
| | | }, |
| | | |
| | | // ç©ææ¡ç è¾å
¥è¿æ»¤ |
| | | handleInput(value) { |
| | | this.form.materielBarcode = value.replace(/[^-a-zA-Z0-9]/g, ''); |
| | | this.$nextTick(() => { |
| | | this.$refs.form.validateField('materielBarcode'); |
| | | }); |
| | | }, |
| | | |
| | | // ç²è´´ç©ææ¡ç èªå¨æ¥è¯¢ |
| | | handlePaste(e) { |
| | | const clipboardData = e.clipboardData || window.clipboardData; |
| | | const pastedText = clipboardData.getData('text'); |
| | | const cleanedText = pastedText.replace(/[^-a-zA-Z0-9]/g, ''); |
| | | if (cleanedText) { |
| | | this.form.materielBarcode = cleanedText; |
| | | setTimeout(() => { |
| | | this.getStockTotal(); |
| | | }, 50); |
| | | } |
| | | e.preventDefault(); |
| | | }, |
| | | |
| | | // ä»åºå·å车èç¦ç©ææ¡ç |
| | | focusMaterielInput() { |
| | | this.$nextTick(() => { |
| | | const inputRef = this.$refs.materielCodeInput; |
| | | if (inputRef) { |
| | | const inputEl = inputRef.$el ? inputRef.$el.querySelector('input') : inputRef; |
| | | inputEl?.focus(); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // èç¦ä»åºå·è¾å
¥æ¡ |
| | | focusWarehouseInput() { |
| | | this.$nextTick(() => { |
| | | const inputRef = this.$refs.warehouseCodeInput; |
| | | if (inputRef) { |
| | | const inputEl = inputRef.$el ? inputRef.$el.querySelector('input') : inputRef; |
| | | inputEl?.focus(); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // èç¦å¹¶éä¸ç©ææ¡ç è¾å
¥æ¡ |
| | | focusAndSelectInput() { |
| | | this.$nextTick(() => { |
| | | setTimeout(() => { |
| | | const inputRef = this.$refs.materielCodeInput; |
| | | if (inputRef) { |
| | | const inputEl = inputRef.$el ? inputRef.$el.querySelector('input') : inputRef; |
| | | if (inputEl) { |
| | | inputEl.focus(); |
| | | inputEl.select(); |
| | | } |
| | | } |
| | | }, 100); |
| | | }); |
| | | }, |
| | | |
| | | // é置表å |
| | | resetForm() { |
| | | this.form = { |
| | | warehouseCode: '', |
| | | materielBarcode: '', |
| | | totalStockQuantity: 0 |
| | | }; |
| | | this.$refs.form.clearValidate(); |
| | | this.focusWarehouseInput(); |
| | | } |
| | | }, |
| | | watch: { |
| | | show(val) { |
| | | if (val) { |
| | | this.$nextTick(() => { |
| | | this.focusWarehouseInput() |
| | | }) |
| | | } else { |
| | | this.resetForm(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .dialog-footer { |
| | | text-align: right; |
| | | } |
| | | .text-gray-500 { |
| | | color: #909399; |
| | | font-size: 12px; |
| | | } |
| | | .ml-2 { |
| | | margin-left: 8px; |
| | | } |
| | | </style> |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | import gridHeader from "./extend/CalculateStock.vue"; |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridHeader: gridHeader, |
| | | gridBody: '', |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | console.log(this) |
| | | var EmptyTrayInboundBtn = this.buttons.find( |
| | | (x) => x.value == "CalculateStock" |
| | | ); |
| | | if (EmptyTrayInboundBtn != null) { |
| | | EmptyTrayInboundBtn.onClick = () => { |
| | | this.$refs.gridHeader.open(); |
| | | }; |
| | | } |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | title: "ä¸å¡ç±»å", |
| | | field: "businessType", |
| | | type: "select", |
| | | dataKey: "documentTypeEmun", |
| | | dataKey: "inboundbusinessType", |
| | | data: [], |
| | | }, |
| | | { |
| | |
| | | <i class="el-icon-document"></i> |
| | | <span class="order-label">订åå·ï¼</span> |
| | | <span class="order-value">{{ orderNo }}</span> |
| | | <span class="order-label" style="margin-left: 20px;">产线åç§°ï¼</span> |
| | | <span class="order-value">{{ orderInfo?.departmentName || '' }}</span> |
| | | </div> |
| | | <div class="order-status"> |
| | | <el-tag v-if="orderInfo" :type="getStatusType(orderInfo.orderStatus)" size="medium" |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // ============== æ°å¢ï¼æ ¹æ®æçå·è·å订åå·ï¼æ ¸å¿åè½ï¼ ============== |
| | | async getOrderNoByPallet(palletCode) { |
| | | if (!palletCode) { |
| | | this.$message.warning('æçå·ä¸è½ä¸ºç©º'); |
| | | return null; |
| | | } |
| | | |
| | | try { |
| | | this.showFullScreenLoading(); |
| | | // è°ç¨è·å订åå·çæ¥å£ |
| | | const response = await this.http.get(`/api/OutboundOrder/GetOrderNoByPalletCode?palletCode=${palletCode}`); |
| | | |
| | | if (response.status && response.data) { |
| | | const validOrderNo = response.data; |
| | | this.playSuccessAudio(); |
| | | this.$message.success(`æåè·å订åå·ï¼${validOrderNo}`); |
| | | return validOrderNo; |
| | | } else { |
| | | this.playErrorAudio(); |
| | | const errorMsg = response.message || '该æçå·æªå
³èä»»ä½è®¢å'; |
| | | this.$message.error(errorMsg); |
| | | return null; |
| | | } |
| | | } catch (error) { |
| | | this.playErrorAudio(); |
| | | const errorMsg = `è·å订åå·å¼å¸¸ï¼${error.message || 'ç½ç»é误'}`; |
| | | this.$message.error(errorMsg); |
| | | console.error("ãæçå·æ¥è®¢åå·æ¥å£å¼å¸¸ã", error); |
| | | return null; |
| | | } finally { |
| | | this.hideFullScreenLoading(); |
| | | } |
| | | }, |
| | | // ============== æ°å¢ç»æ ============== |
| | | |
| | | // ææ¾æåé³é¢ |
| | | playSuccessAudio() { |
| | | try { |
| | |
| | | initPage() { |
| | | // ä»è·¯ç±åæ°è·å订åå· |
| | | this.orderNo = this.$route.query.orderNo || '' |
| | | if (!this.orderNo) { |
| | | this.$message.error('订åå·ä¸è½ä¸ºç©º') |
| | | this.$router.back() |
| | | return |
| | | } |
| | | // ============== å¾®è°ï¼æ³¨é强å¶è¿åé»è¾ï¼å
¼å®¹æçå·æ¥è®¢åå· ============== |
| | | // if (!this.orderNo) { |
| | | // this.$message.error('订åå·ä¸è½ä¸ºç©º') |
| | | // this.$router.back() |
| | | // return |
| | | // } |
| | | // ============== å¾®è°ç»æ ============== |
| | | |
| | | // å 载订åä¿¡æ¯ |
| | | this.loadOrderInfo() |
| | |
| | | }, |
| | | |
| | | handlePalletScan(flag = true) { |
| | | if (this.scanForm.palletCode) { |
| | | this.loadPalletData(flag) |
| | | } else { |
| | | const palletCode = this.scanForm.palletCode.trim(); |
| | | if (!palletCode) { |
| | | return; |
| | | } |
| | | // å
æ ¹æ®æçå·è·å订åå· |
| | | this.getOrderNoByPallet(palletCode).then((orderNo) => { |
| | | if (orderNo) { |
| | | // èµå¼è®¢åå·ï¼ä¾åç»é»è¾ä½¿ç¨ |
| | | this.orderNo = orderNo; |
| | | // å·æ°è®¢åä¿¡æ¯ |
| | | this.loadOrderInfo(); |
| | | } |
| | | this.loadPalletData(flag); |
| | | }); |
| | | }, |
| | | |
| | | handleMaterialScan() { |
| | |
| | | title: "ä¸å¡ç±»å", |
| | | field: "businessType", |
| | | type: "select", |
| | | dataKey: "documentTypeEmun", |
| | | dataKey: "outboundbusinessType", |
| | | data: [], |
| | | }, |
| | | { |
| | |
| | | data: [], |
| | | }, |
| | | { title: "ç©æç¼å·", field: "materielCode", type: "like" }, |
| | | { title: "æçº¿åç§°", field: "departmentName", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | ], |
| | | ]); |
| | |
| | | WebResponseContent UnPalletGroupBarcode(string orderNo); |
| | | |
| | | WebResponseContent HandCloseOrder(List<string> orderIds); |
| | | |
| | | WebResponseContent GetLocationType(string code); |
| | | } |
| | | } |
| | |
| | | Task<WebResponseContent> ReceiveOutboundOrder(Dt_OutboundOrder model, int operateType); |
| | | |
| | | Task<WebResponseContent> GetById(int id); |
| | | |
| | | WebResponseContent GetOrderNoByPalletCode(string palletCode); |
| | | } |
| | | } |
| | |
| | | public interface IStockDetailByMaterielService : IDependency |
| | | { |
| | | PageGridData<StockDetailByMateriel> GetPageGridData(PageDataOptions options); |
| | | |
| | | WebResponseContent CalculateStock(string warehouseCode, string materielCode); |
| | | } |
| | | } |
| | |
| | | return content.OK(data: details); |
| | | } |
| | | |
| | | public WebResponseContent GetLocationType(string code) |
| | | { |
| | | var warehouseAreaName = _warehouseAreaRepository.QueryFirst(x => x.Code == code); |
| | | if(string.IsNullOrWhiteSpace(warehouseAreaName.ToString())) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°ä»åºåç§°"); |
| | | } |
| | | var locationTypeDesc = _locationTypeRepository.Db.Queryable<Dt_LocationType>().Where(x => string.Equals(x.LocationTypeDesc, warehouseAreaName.Name, StringComparison.OrdinalIgnoreCase)).First(); |
| | | |
| | | return WebResponseContent.Instance.OK(data:locationTypeDesc.LocationType); |
| | | } |
| | | |
| | | public WebResponseContent HandCloseOrder(List<string> orderNos) |
| | | { |
| | | try |
| | |
| | | private readonly ILogger<OutboundOrderService> _logger; |
| | | private readonly IRepository<Dt_OutboundOrderDetail> _outboundOrderDetailRepository; |
| | | private readonly IMaterialUnitService _materialUnitService; |
| | | public OutboundOrderService(IRepository<Dt_OutboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_OutboundOrderDetail> outboundOrderDetailRepository, ILogger<OutboundOrderService> logger, IMaterialUnitService materialUnitService, IMaterielInfoService materielInfoService) : base(BaseDal) |
| | | private readonly IRepository<Dt_OutStockLockInfo> _outStockLockInfoRepository; |
| | | public OutboundOrderService(IRepository<Dt_OutboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_OutboundOrderDetail> outboundOrderDetailRepository, ILogger<OutboundOrderService> logger, IMaterialUnitService materialUnitService, IMaterielInfoService materielInfoService, IRepository<Dt_OutStockLockInfo> outStockLockInfoRepository) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _logger = logger; |
| | | _materialUnitService = materialUnitService; |
| | | _materielInfoService = materielInfoService; |
| | | _outStockLockInfoRepository = outStockLockInfoRepository; |
| | | } |
| | | |
| | | private int[] OrderTypes = new int[] { (int)InOrderTypeEnum.AllocatOutbound, (int)InOrderTypeEnum.InternalAllocat, (int)InOrderTypeEnum.ReCheck }; |
| | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æçå·è·ååæ®ç¼å· |
| | | /// </summary> |
| | | public WebResponseContent GetOrderNoByPalletCode(string palletCode) |
| | | { |
| | | var orderNo = _outStockLockInfoRepository.QueryData(x => x.PalletCode == palletCode).Select(x=>x.OrderNo).FirstOrDefault(); |
| | | if(string.IsNullOrWhiteSpace(orderNo)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æç{palletCode}å·²æ£éå®"); |
| | | } |
| | | return WebResponseContent.Instance.OK(data: orderNo); |
| | | } |
| | | |
| | | static object lock_code = new object(); |
| | | public string CreateCodeByRule(string ruleCode) |
| | | { |
| | |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.ReturnToMESStatus.Equals(returnToMESStatus)); |
| | | } |
| | | |
| | | var businessTypeParam = searchParametersList.FirstOrDefault(x => |
| | | x.Name.Equals(nameof(Dt_OutboundOrder.BusinessType).FirstLetterToLower(), StringComparison.OrdinalIgnoreCase)); |
| | | if (businessTypeParam != null && !string.IsNullOrEmpty(businessTypeParam.Value?.ToString())) |
| | | { |
| | | string businessType = businessTypeParam.Value.ToString().Trim(); |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.BusinessType.Equals(businessType)); |
| | | } |
| | | |
| | | var departmentNameParam = searchParametersList.FirstOrDefault(x => |
| | | x.Name.Equals("departmentName", StringComparison.OrdinalIgnoreCase)); |
| | | if (departmentNameParam != null && !string.IsNullOrEmpty(departmentNameParam.Value?.ToString())) |
| | | { |
| | | string departmentName = departmentNameParam.Value.ToString().Trim(); |
| | | sugarQueryable1 = sugarQueryable1.Where(x => |
| | | x.DepartmentName.Contains(departmentName)); |
| | | } |
| | | |
| | | var createDateParams = searchParametersList |
| | | .Where(x => x.Name.Equals("createDate", StringComparison.OrdinalIgnoreCase) |
| | | && !string.IsNullOrEmpty(x.Value?.ToString())) |
| | |
| | | { |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly SqlSugarClient _dbBase; |
| | | private readonly IRepository<Dt_StockInfoDetail> _stockInfoDetailRepository; |
| | | |
| | | public StockDetailByMaterielService(IUnitOfWorkManage unitOfWorkManage) |
| | | public StockDetailByMaterielService(IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfoDetail> stockInfoDetailRepository) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _dbBase = unitOfWorkManage.GetDbClient(); |
| | | _stockInfoDetailRepository = stockInfoDetailRepository; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | decimal totalStockQuantity = 0; |
| | | if (groupedData.Count > 0) |
| | | { |
| | | totalStockQuantity = groupedData.Values.Sum(x => x.StockQuantity); |
| | | } |
| | | |
| | | materielnfoStatistics = groupedData.Values.ToList(); |
| | | int startIndex = (options.Page - 1) * options.Rows; |
| | | int endIndex = Math.Min(startIndex + options.Rows, materielnfoStatistics.Count); |
| | |
| | | } |
| | | |
| | | int count = groupedData.Count; |
| | | return new PageGridData<StockDetailByMateriel>(count, materielnfoStatistics); |
| | | return new PageGridData<StockDetailByMateriel>(count, materielnfoStatistics) |
| | | { |
| | | TotalStockQuantity = totalStockQuantity |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return new PageGridData<StockDetailByMateriel>(); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent CalculateStock(string warehouseCode,string materielCode) |
| | | { |
| | | var calculateStock =_stockInfoDetailRepository.QueryData(x => x.WarehouseCode == warehouseCode && x.MaterielCode == materielCode).Sum(x => x.StockQuantity); |
| | | if(calculateStock == 0) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°åºå"); |
| | | } |
| | | return WebResponseContent.Instance.OK(data: calculateStock); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | return Service.HandCloseOrder(orderIds); |
| | | } |
| | | |
| | | [HttpPost, Route("GetLocationType"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent GetLocationType(string code) |
| | | { |
| | | return Service.GetLocationType(code); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | return WebResponseContent.Instance.OK(null, order); |
| | | } |
| | | |
| | | [HttpGet, Route("GetOrderNoByPalletCode"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent GetOrderNoByPalletCode(string palletCode) |
| | | { |
| | | return Service.GetOrderNoByPalletCode(palletCode); |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Autofac.Core; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_DTO.Stock; |
| | |
| | | { |
| | | return _stockDetailByMaterielService.GetPageGridData(options); |
| | | } |
| | | |
| | | [HttpPost, Route("CalculateStock"), AllowAnonymous] |
| | | public WebResponseContent CalculateStock(string warehouseCode,string materielCode) |
| | | { |
| | | return _stockDetailByMaterielService.CalculateStock(warehouseCode,materielCode); |
| | | } |
| | | } |
| | | } |