| | |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | { |
| | | name: "空æå
¥åº", |
| | | class: '', |
| | | value: 'EmptyTrayInbound', |
| | | type: 'primary', |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | ] |
| | | |
| | | export default buttons |
| | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | |
| | | import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager"; |
| | | export default { |
| | | components: { VolBox }, |
| | | data() { |
| | |
| | | ], |
| | | }; |
| | | }, |
| | | onMounted() { |
| | | // 仿¬å°åå¨å è½½ä¿åçç«å°å¼ |
| | | const savedStation = stationManager.getStation(); |
| | | console.log(savedStation); |
| | | if (savedStation) { |
| | | outboundForm.selectedPlatform = savedStation; |
| | | } else if (stationOptions.length > 0) { |
| | | // å¦ææ²¡æä¿åçå¼ï¼ä½¿ç¨ç¬¬ä¸ä¸ªé项 |
| | | //stationValue.value = stationOptions[0].value; |
| | | } |
| | | }, |
| | | methods: { |
| | | open(row) { |
| | | this.row = row; |
| | |
| | | if (this.selection.length === 0) { |
| | | return ElMessage.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | |
| | | // é置表åé¿å
æ®çå¼ |
| | | this.outboundForm.selectedPlatform = ""; |
| | | const savedStation = stationManager.getStation(); |
| | | |
| | | if (savedStation) { |
| | | outboundForm.selectedPlatform = savedStation; |
| | | } |
| | | this.showOutboundDialog = true; |
| | | }, |
| | | |
| | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | |
| | | import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager"; |
| | | export default { |
| | | components: { VolBox }, |
| | | data() { |
| | |
| | | ], |
| | | }; |
| | | }, |
| | | onMounted() { |
| | | // 仿¬å°åå¨å è½½ä¿åçç«å°å¼ |
| | | const savedStation = stationManager.getStation(); |
| | | console.log(savedStation); |
| | | if (savedStation) { |
| | | outboundForm.selectedPlatform = savedStation; |
| | | } else if (stationOptions.length > 0) { |
| | | // å¦ææ²¡æä¿åçå¼ï¼ä½¿ç¨ç¬¬ä¸ä¸ªé项 |
| | | //stationValue.value = stationOptions[0].value; |
| | | } |
| | | }, |
| | | methods: { |
| | | open(row) { |
| | | this.row = row; |
| | |
| | | } |
| | | // é置表åé¿å
æ®çå¼ |
| | | this.outboundForm.selectedPlatform = ""; |
| | | const savedStation = stationManager.getStation(); |
| | | console.log(savedStation); |
| | | if (savedStation) { |
| | | this.outboundForm.selectedPlatform = savedStation; |
| | | } |
| | | this.showOutboundDialog = true; |
| | | }, |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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" /> |
| | | </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(); |
| | | }, |
| | | |
| | | 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('请è¾å
¥æçæ¡ç ') |
| | | 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.show = false |
| | | this.$emit('refresh') |
| | | } else { |
| | | this.$message.error(message || 'æä½å¤±è´¥') |
| | | } |
| | | } catch (error) { |
| | | this.$message.error('请æ±å¼å¸¸') |
| | | } |
| | | }, |
| | | |
| | | // æ«ææªä¼åå¤ç |
| | | handleInput(value) { |
| | | // è¿æ»¤éæ°ååæ¡ç 常ç¨å符 |
| | | this.form.palletCode = value.replace(/[^a-zA-Z0-9\-]/g, '') |
| | | }, |
| | | |
| | | handlePaste(e) { |
| | | // ç²è´´æ¶èªå¨æäº¤ |
| | | setTimeout(this.submit, 100) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .dialog-footer { |
| | | text-align: right; |
| | | } |
| | | </style> |
| | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | |
| | | import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager"; |
| | | export default { |
| | | components: { VolBox }, |
| | | data() { |
| | |
| | | ], |
| | | }; |
| | | }, |
| | | onMounted() { |
| | | // 仿¬å°åå¨å è½½ä¿åçç«å°å¼ |
| | | const savedStation = stationManager.getStation(); |
| | | console.log(savedStation); |
| | | if (savedStation) { |
| | | outboundForm.selectedPlatform.value = savedStation; |
| | | } else if (stationOptions.length > 0) { |
| | | // å¦ææ²¡æä¿åçå¼ï¼ä½¿ç¨ç¬¬ä¸ä¸ªé项 |
| | | //stationValue.value = stationOptions[0].value; |
| | | } |
| | | }, |
| | | methods: { |
| | | open(row) { |
| | | this.row = row; |
| | |
| | | } |
| | | // é置表åé¿å
æ®çå¼ |
| | | this.outboundForm.selectedPlatform = ""; |
| | | const savedStation = stationManager.getStation(); |
| | | if (savedStation) { |
| | | outboundForm.selectedPlatform = savedStation; |
| | | } |
| | | this.showOutboundDialog = true; |
| | | }, |
| | | |
| | |
| | | import SelectedStock from "./SelectedStock.vue"; |
| | | import { h,createVNode, render,reactive } from 'vue'; |
| | | import { ElDialog , ElForm, ElFormItem, ElSelect,ElOption, ElButton, ElMessage } from 'element-plus'; |
| | | import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager"; |
| | | export default { |
| | | components: { VolBox, VolForm, StockSelect, SelectedStock }, |
| | | data() { |
| | |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value // é»è®¤ç»å®ãç«å°3ãçvalue |
| | | }); |
| | | const savedStation = stationManager.getStation(); |
| | | console.log(savedStation); |
| | | if (savedStation) { |
| | | formData.selectedPlatform = savedStation; |
| | | } |
| | | |
| | | // 3. 卿å建弹çªç»ä»¶ |
| | | const vnode = createVNode(ElDialog, { |
| | |
| | | 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> |
| | |
| | | num: 1, |
| | | show: false, |
| | | locationTypes: [], |
| | | locationType:"", |
| | | locationType: "", |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | }, |
| | | |
| | | getData() { |
| | | this.http.post("api/LocationInfo/GetLocationTypes",null, "æ¥è¯¢ä¸") |
| | | this.http.post("api/LocationInfo/GetLocationTypes", null, "æ¥è¯¢ä¸") |
| | | .then((x) => { |
| | | this.locationTypes = x.data; |
| | | }) |
| | |
| | | import { h,createVNode, render,reactive } from 'vue'; |
| | | import { ElDialog , ElForm, ElFormItem, ElSelect,ElOption, ElButton, ElInput, ElMessage } from 'element-plus'; |
| | | import { th } from 'element-plus/es/locale'; |
| | | import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager"; |
| | | |
| | | export default { |
| | | components: { VolBox, VolForm, StockSelect, SelectedStock,NoStockOut}, |
| | |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value // é»è®¤ç»å®ãç«å°3ãçvalue |
| | | }); |
| | | |
| | | const savedStation = stationManager.getStation(); |
| | | if (savedStation) { |
| | | formData.selectedPlatform = savedStation; |
| | | } |
| | | // 3. 卿å建弹çªç»ä»¶ |
| | | const vnode = createVNode(ElDialog, { |
| | | title: 'åºåºæä½ - éæ©åºåºç«å°', |
| | |
| | | import StockSelect from "./StockSelect.vue"; |
| | | import SelectedStock from "./SelectedStock.vue"; |
| | | import NoStockOut from "./NoStockOut.vue"; |
| | | import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager"; |
| | | import { h, createVNode, render, reactive } from "vue"; |
| | | import { |
| | | ElDialog, |
| | |
| | | dictionaryList: null, |
| | | }; |
| | | }, |
| | | onMounted() { |
| | | // 仿¬å°åå¨å è½½ä¿åçç«å°å¼ |
| | | const savedStation = stationManager.getStation(); |
| | | console.log(savedStation); |
| | | if (savedStation) { |
| | | outboundForm.selectedPlatform = savedStation; |
| | | } else if (stationOptions.length > 0) { |
| | | // å¦ææ²¡æä¿åçå¼ï¼ä½¿ç¨ç¬¬ä¸ä¸ªé项 |
| | | //stationValue.value = stationOptions[0].value; |
| | | } |
| | | }, |
| | | methods: { |
| | | toggleAssignStockColumn() { |
| | | const assignStockColumn = this.tableColumns.find( |
| | |
| | | }); |
| | | }, |
| | | outbound() { |
| | | const savedStation = stationManager.getStation(); |
| | | console.log(savedStation); |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | |
| | | selectedPlatform: platformOptions[0].value, |
| | | }); |
| | | |
| | | if (savedStation) { |
| | | formData.selectedPlatform = savedStation; |
| | | } |
| | | const vnode = createVNode( |
| | | ElDialog, |
| | | { |
| | |
| | | render(vnode, mountNode); |
| | | }, |
| | | outboundbatch() { |
| | | const savedStation = stationManager.getStation(); |
| | | console.log(savedStation); |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | |
| | | selectedPlatform: platformOptions[0].value, |
| | | outboundDecimal: "", |
| | | }); |
| | | |
| | | if (savedStation) { |
| | | formData.selectedPlatform = savedStation; |
| | | } |
| | | const vnode = createVNode( |
| | | ElDialog, |
| | | { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // æ¬å°åå¨é®å |
| | | export const STATION_STORAGE_KEY = "wms_selected_station"; |
| | | |
| | | /** |
| | | * ç«å°ç®¡çå¨ - æä¾ç«å°ä¿¡æ¯çæä¹
ååå¨åè·å |
| | | */ |
| | | export const stationManager = { |
| | | /** |
| | | * ä¿åç«å°ä¿¡æ¯å°æ¬å°åå¨ |
| | | * @param {string} station - ç«å°å¼ |
| | | */ |
| | | saveStation(station) { |
| | | try { |
| | | // 使ç¨localStorageè¿è¡æä¹
ååå¨ |
| | | localStorage.setItem(STATION_STORAGE_KEY, station); |
| | | |
| | | // åæ¶ä¿åå°sessionStorageï¼ä½ä¸ºå¤ç¨ |
| | | sessionStorage.setItem(STATION_STORAGE_KEY, station); |
| | | |
| | | // 触åèªå®ä¹äºä»¶ï¼éç¥å
¶ä»ç»ä»¶ç«å°å·²æ´æ° |
| | | window.dispatchEvent(new CustomEvent('station-changed', { |
| | | detail: { station } |
| | | })); |
| | | |
| | | console.log(`ç«å°å·²ä¿å: ${station}`); |
| | | } catch (error) { |
| | | console.error("ä¿åç«å°ä¿¡æ¯å¤±è´¥:", error); |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * è·åä¿åçç«å°ä¿¡æ¯ |
| | | * @returns {string|null} ç«å°å¼ænull |
| | | */ |
| | | getStation() { |
| | | try { |
| | | // ä¼å
ä»localStorageè·å |
| | | let station = localStorage.getItem(STATION_STORAGE_KEY); |
| | | |
| | | // 妿localStorage没æï¼å°è¯ä»sessionStorageè·å |
| | | if (!station) { |
| | | station = sessionStorage.getItem(STATION_STORAGE_KEY); |
| | | } |
| | | |
| | | return station; |
| | | } catch (error) { |
| | | console.error("è·åç«å°ä¿¡æ¯å¤±è´¥:", error); |
| | | return null; |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * æ¸
é¤ç«å°ä¿¡æ¯ |
| | | */ |
| | | clearStation() { |
| | | try { |
| | | localStorage.removeItem(STATION_STORAGE_KEY); |
| | | sessionStorage.removeItem(STATION_STORAGE_KEY); |
| | | console.log("ç«å°ä¿¡æ¯å·²æ¸
é¤"); |
| | | } catch (error) { |
| | | console.error("æ¸
é¤ç«å°ä¿¡æ¯å¤±è´¥:", error); |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * çå¬ç«å°åå |
| | | * @param {Function} callback - åååè°å½æ° |
| | | * @returns {Function} åæ¶çå¬ç彿° |
| | | */ |
| | | onStationChange(callback) { |
| | | const handler = (event) => { |
| | | if (callback && typeof callback === 'function') { |
| | | callback(event.detail.station); |
| | | } |
| | | }; |
| | | |
| | | window.addEventListener('station-changed', handler); |
| | | |
| | | // è¿ååæ¶çå¬ç彿° |
| | | return () => { |
| | | window.removeEventListener('station-changed', handler); |
| | | }; |
| | | }, |
| | | |
| | | /** |
| | | * è·åç«å°æ¾ç¤ºæ ç¾ |
| | | * @param {string} value - ç«å°å¼ |
| | | * @param {Array} options - ç«å°é项æ°ç» |
| | | * @returns {string} ç«å°æ ç¾ |
| | | */ |
| | | getStationLabel(value, options) { |
| | | if (!value || !options) return value || ''; |
| | | |
| | | const option = options.find(opt => opt.value === value); |
| | | return option ? option.label : value; |
| | | } |
| | | }; |
| | | |
| | | // é»è®¤å¯¼åº |
| | | export default stationManager; |
| | |
| | | </div> |
| | | <div class="vol-container" :style="{ left: menuWidth - 1 + 'px' }"> |
| | | <div class="vol-header"> |
| | | <div class="project-name">WMS</div> |
| | | <div class="project-name">WMS {{ stationValue.replace('-1','') }}ç«å°</div> |
| | | <div class="header-text"> |
| | | <div class="h-link"> |
| | | <a |
| | |
| | | import VolMenu from "@/components/basic/VolElementMenu.vue"; |
| | | import Message from "./index/Message.vue"; |
| | | import MessageConfig from "./index/MessageConfig.js"; |
| | | import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager"; |
| | | var imgUrl = require("@/assets/imgs/wms_x.png"); |
| | | var $this; |
| | | var $interval; |
| | |
| | | }, |
| | | setup(props, context) { |
| | | let client = ref(null); |
| | | |
| | | const stationValue = ref(""); |
| | | const savedStation = stationManager.getStation(); |
| | | console.log("Saved Station:", savedStation); |
| | | if (savedStation) { |
| | | stationValue.value = savedStation; |
| | | } |
| | | // è·åå
¨å±å±æ§åæ¹æ³ |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | |
| | | visibleItem, |
| | | closeTabsMenu, |
| | | closeTabs, |
| | | stationValue, |
| | | currentMenuId, |
| | | }; |
| | | }, |
| | |
| | | placeholder="请è¾å
¥å¯ç " |
| | | /> |
| | | </div> |
| | | |
| | | <div class="item station-select-item"> |
| | | <div class="input-icon el-icon-lock"></div> |
| | | <el-select |
| | | v-model="stationValue" |
| | | placeholder="éæ©ç«å°" |
| | | class="station-select" |
| | | @change="handleStationChange" |
| | | > |
| | | <el-option |
| | | v-for="item in stationOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </div> |
| | | |
| | | |
| | | <div class="item"> |
| | | <div class="input-icon el-icon-mobile"></div> |
| | | |
| | | <input |
| | | v-focus |
| | | type="text" |
| | |
| | | <span v-else>æ£å¨ç»å½...</span> |
| | | </el-button> |
| | | </div> |
| | | |
| | | <!-- è´¦å·ä¿¡æ¯ --> |
| | | <!-- <div class="account-info"> |
| | | <p>æ¼ç¤ºè´¦å·ï¼admin666 å¯ç :123456</p> |
| | | <p>æ¬å°è´¦å·ï¼admin å¯ç :123456</p> |
| | | <p><a href="https://jq.qq.com/?_wv=1027&k=Sqstuy0M" style="text-decoration: none" |
| | | target="_blank">QQ3群:743852316</a> |
| | | |
| | | <a href="http://v2.volcore.xyz/document/guide" style="text-decoration: none" target="_blank">æ¡æ¶ææ¡£</a> |
| | | </p> |
| | | </div> --> |
| | | <!-- 龿¥ä½ç½® --> |
| | | <!-- <div class="app-link" > |
| | | <a href="#" style="text-decoration: none">ç§»å¨ç«¯æ«ç </a> |
| | | <a> |
| | | <i class="el-icon-chat-dot-round"></i> å°ç¨åº |
| | | <img src="https://app-1256993465.cos.ap-nanjing.myqcloud.com/wechat.jpg" /></a> |
| | | <a> |
| | | <i class="el-icon-apple"></i> |
| | | Android |
| | | <img src="https://app-1256993465.cos.ap-nanjing.myqcloud.com/Android.png" /></a> |
| | | <a> |
| | | <i class="el-icon-document"></i> |
| | | H5 |
| | | <img src="https://app-1256993465.cos.ap-nanjing.myqcloud.com/H5.png" /></a> |
| | | </div> --> |
| | | </div> |
| | | |
| | | <!-- 页é¢åºé¨ --> |
| | | <!-- <div class="login-footer"> |
| | | <a style="text-decoration: none" href="https://beian.miit.gov.cn/" target="_blank">京ICPå¤19056538å·-1</a> |
| | | |
| | | |
| | | <a href="https://dotnet9.com/" style="text-decoration: none" target="blank">Dotnet9</a> |
| | | <a href="https://space.bilibili.com/525836469" style="text-decoration: none" target="blank">NETè§é¢æç¨(微软MVP-ACEå½å¶)</a> |
| | | <a href="https://www.cctalk.com/m/group/90268531" style="text-decoration: none" target="blank">VOLæ¡æ¶è§é¢</a> |
| | | <a href="http://120.48.115.252:9990" style="text-decoration: none" target="blank">è§é¢æ¼ç¤ºå°å</a> |
| | | </div> --> |
| | | |
| | | <img class="login-bg" src="/static/login_bg.png" /> |
| | | </div> |
| | | </template> |
| | | |
| | | |
| | | <script > |
| | | <script> |
| | | import { |
| | | defineComponent, |
| | | ref, |
| | | reactive, |
| | | toRefs, |
| | | getCurrentInstance, |
| | | onMounted, |
| | | } from "vue"; |
| | | import { useRouter, useRoute } from "vue-router"; |
| | | import store from "../store/index"; |
| | | import http from "@/../src/api/http.js"; |
| | | import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager"; |
| | | export default defineComponent({ |
| | | setup(props, context) { |
| | | store.commit("clearUserInfo", ""); |
| | | const loading = ref(false); |
| | | const codeImgSrc = ref(""); |
| | | const value = ref(""); |
| | | const userInfo = reactive({ |
| | | userName: "", |
| | | password: "", |
| | | verificationCode: "", |
| | | UUID: undefined, |
| | | }); |
| | | const stationValue = ref(""); |
| | | const stationOptions = reactive([ |
| | | { label: "ç«å°2", value: "2-1" }, |
| | | { label: "ç«å°3", value: "3-1" }, |
| | | ]); |
| | | // åå§åç«å°å¼ |
| | | onMounted(() => { |
| | | // 仿¬å°åå¨å è½½ä¿åçç«å°å¼ |
| | | const savedStation = stationManager.getStation(); |
| | | if (savedStation) { |
| | | stationValue.value = savedStation; |
| | | } else if (stationOptions.length > 0) { |
| | | // å¦ææ²¡æä¿åçå¼ï¼ä½¿ç¨ç¬¬ä¸ä¸ªé项 |
| | | stationValue.value = stationOptions[0].value; |
| | | } |
| | | }); |
| | | const handleStationChange = (value) => { |
| | | // ä¿åç«å°éæ©å°æ¬å°åå¨ |
| | | if (value) { |
| | | stationManager.saveStation(value); |
| | | // ä¹ä¿åå°Vuex/storeä¸ï¼æ¹ä¾¿å
¨å±è®¿é® |
| | | store.commit("setStation", value); |
| | | } |
| | | }; |
| | | |
| | | const getVierificationCode = () => { |
| | | http.get("/api/User/getVierificationCode").then((x) => { |
| | |
| | | }); |
| | | }; |
| | | getVierificationCode(); |
| | | |
| | | |
| | | let appContext = getCurrentInstance().appContext; |
| | | let $message = appContext.config.globalProperties.$message; |
| | | let router = useRouter(); |
| | |
| | | if (!userInfo.verificationCode) { |
| | | return $message.error("请è¾å
¥éªè¯ç "); |
| | | } |
| | | |
| | | // ç¡®ä¿ç«å°å¼å·²ä¿å |
| | | if (stationValue.value) { |
| | | stationManager.saveStation(stationValue.value); |
| | | store.commit("setStation", stationValue.value); |
| | | } |
| | | |
| | | loading.value = true; |
| | | http.post("/api/User/login", userInfo, "æ£å¨ç»å½....").then((result) => { |
| | | if (!result.status) { |
| | |
| | | } |
| | | $message.success("ç»å½æå,æ£å¨è·³è½¬!"); |
| | | store.commit("setUserInfo", result.data); |
| | | |
| | | |
| | | router.push({ path: "/" }); |
| | | }); |
| | | }; |
| | |
| | | userInfo, |
| | | loginPress, |
| | | openUrl, |
| | | stationOptions, |
| | | stationValue, |
| | | handleStationChange, |
| | | }; |
| | | }, |
| | | directives: { |
| | |
| | | width: 50%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | // margin-right: 150px; |
| | | z-index: 999; |
| | | |
| | | .form-user { |
| | | // margin: 25px 0; |
| | | |
| | | .item { |
| | | border-radius: 5px; |
| | | border: 1px solid #ececec; |
| | |
| | | background: #ffff; |
| | | height: 45px; |
| | | padding-left: 20px; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | &.station-select-item { |
| | | padding-left: 0; |
| | | |
| | | .input-icon { |
| | | margin-left: 20px; |
| | | min-width: 20px; |
| | | } |
| | | } |
| | | |
| | | .code { |
| | | position: relative; |
| | | cursor: pointer; |
| | | width: 74px; |
| | | padding: 5px 10px 0 0; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .input-icon { |
| | | line-height: 45px; |
| | | color: #7a7a7a; |
| | | padding-right: 20px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | } |
| | | } |
| | |
| | | margin: 0; |
| | | padding: 0; |
| | | color: #323233; |
| | | line-height: inherit; |
| | | text-align: left; |
| | | border: 0; |
| | | outline: none; |
| | | font-size: 16px; |
| | | line-height: 20px; |
| | | height: 100%; |
| | | line-height: normal; |
| | | } |
| | | |
| | | select { |
| | | background: white; |
| | | display: block; |
| | | box-sizing: border-box; |
| | | width: 100%; |
| | | min-width: 0; |
| | | margin: 0; |
| | | padding: 0; |
| | | color: #323233; |
| | | text-align: left; |
| | | border: 0; |
| | | outline: none; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | |
| | | font-weight: bolder; |
| | | font-size: 20px; |
| | | letter-spacing: 2px; |
| | | |
| | | position: relative; |
| | | display: flex; |
| | | |
| | |
| | | color: transparent; |
| | | font-size: 25px; |
| | | } |
| | | |
| | | // 䏿æ¡èªå®ä¹æ ·å¼ - ç§»é¤ææäº¤äºææ |
| | | .station-select { |
| | | width: 100%; |
| | | height: 100%; |
| | | flex: 1; |
| | | |
| | | :deep(.el-input) { |
| | | height: 100%; |
| | | cursor: pointer; // æ·»å æéæ¾ç¤ºä¸ºå¯ç¹å» |
| | | } |
| | | |
| | | :deep(.el-input__wrapper) { |
| | | height: 100%; |
| | | box-shadow: none; |
| | | border: none; |
| | | padding: 0; |
| | | background: transparent; |
| | | |
| | | // ç§»é¤ææhoverãfocusææ |
| | | &:hover, &:focus, &.is-focus { |
| | | box-shadow: none !important; |
| | | outline: none !important; |
| | | border: none !important; |
| | | } |
| | | } |
| | | |
| | | :deep(.el-input__inner) { |
| | | height: 100%; |
| | | padding-left: 10px; |
| | | padding-top: 10px; |
| | | font-size: 16px; |
| | | color: #323233; |
| | | cursor: pointer; // æ·»å æéæ¾ç¤ºä¸ºå¯ç¹å» |
| | | |
| | | &::placeholder { |
| | | color: #c0c4cc; |
| | | } |
| | | } |
| | | |
| | | :deep(.el-input__suffix) { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 100%; |
| | | } |
| | | |
| | | :deep(.el-select__caret) { |
| | | height: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | margin-right: 10px; |
| | | } |
| | | |
| | | // ç§»é¤æ´ä¸ªç»ä»¶ä¸çä»»ä½hoveråfocusæ ·å¼ |
| | | &:hover, &:focus, &.is-focus { |
| | | :deep(.el-input__wrapper) { |
| | | box-shadow: none !important; |
| | | outline: none !important; |
| | | border: none !important; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // ä¿®æ¹å
¨å±çä¸ææ¡æ ·å¼ |
| | | :deep(.el-select-dropdown) { |
| | | border: 1px solid #ececec; |
| | | border-radius: 5px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | |
| | | .el-select-dropdown__item { |
| | | height: 45px; |
| | | line-height: 45px; |
| | | font-size: 16px; |
| | | color: #323233; |
| | | padding: 0 20px; |
| | | |
| | | &:hover { |
| | | background-color: #f5f7fa; |
| | | } |
| | | |
| | | &.selected { |
| | | color: #3a6cd1; |
| | | font-weight: normal; |
| | | background-color: #f0f7ff; |
| | | } |
| | | } |
| | | |
| | | // éèæ»å¨æ¡æè°æ´æ»å¨æ¡æ ·å¼ |
| | | &::-webkit-scrollbar { |
| | | width: 6px; |
| | | } |
| | | |
| | | &::-webkit-scrollbar-track { |
| | | background: #f1f1f1; |
| | | border-radius: 3px; |
| | | } |
| | | |
| | | &::-webkit-scrollbar-thumb { |
| | | background: #c1c1c1; |
| | | border-radius: 3px; |
| | | } |
| | | } |
| | | |
| | | // ç§»é¤ææinputçfocusåhoveræ ·å¼ |
| | | input { |
| | | &:hover, &:focus { |
| | | border: none !important; |
| | | outline: none !important; |
| | | box-shadow: none !important; |
| | | } |
| | | } |
| | | </style> |
| | | <style lang="less" scoped> |
| | | .app-link { |
| | | // font-weight: bolder; |
| | | text-align: center; |
| | | padding-top: 5px; |
| | | font-size: 12px; |
| | |
| | | top: -130px; |
| | | width: 120px; |
| | | left: -22px; |
| | | |
| | | border: 1px solid #b1b1b1; |
| | | } |
| | | } |
| | |
| | | WebResponseContent UnPalletQuantity(string orderNo); |
| | | |
| | | WebResponseContent UndoPalletGroup(string palletCode , string barcode = ""); |
| | | |
| | | WebResponseContent UnPalletGroupBarcode(string orderNo); |
| | | } |
| | | } |
| | |
| | | |
| | | List<StockSelectViewDTO> GetSelectViewDTOs(string orderNo, string materielCode); |
| | | |
| | | List<Dt_StockInfo> GetUseableStocks(string materielCode, string batchNo, string supplyCode, string wearhouseCode, string factoryCode); |
| | | |
| | | List<Dt_StockInfo> GetStockInfos(string materielCode, string lotNo, string supplyCode, List<string> locationCodes, string wearhouseCode, string factoryCode); |
| | | |
| | | } |
| | | } |
| | |
| | | // 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(); |
| | |
| | | _logger.LogInformation($"éè¦èªå¨æå
- åºå: {stockDetail.StockQuantity}, åé
: {lockInfo.AssignQuantity}, æå
æ°é: {splitQuantity}"); |
| | | |
| | | // æ§è¡èªå¨æå
|
| | | var splitResult = await ExecuteAutoSplitLogic(lockInfo, stockDetail, splitQuantity, palletCode); |
| | | |
| | | // å°æå
æ°éä¼ éç»è°ç¨æ¹ï¼ç¨äºéªè¯ |
| | | if (splitResult != null && splitResult.Any()) |
| | | { |
| | | // å¨è¿åç»æä¸æºå¸¦æå
æ°éä¿¡æ¯ |
| | | foreach (var result in splitResult) |
| | | { |
| | | result.quantityTotal = splitQuantity.ToString("F2"); |
| | | } |
| | | } |
| | | var splitResult = await ExecuteAutoSplitLogic(lockInfo, stockDetail, splitQuantity, palletCode); |
| | | |
| | | return splitResult; |
| | | } |
| | |
| | | /// ååï¼åªå离ç©çåºåï¼ä¸æ¹åå订åçä»»ä½åé
ååºåºæ°é |
| | | /// </summary> |
| | | private async Task<List<SplitResult>> ExecuteAutoSplitLogic(Dt_OutStockLockInfo lockInfo, Dt_StockInfoDetail stockDetail, |
| | | decimal splitQuantity, string palletCode) |
| | | decimal splitQuantity,string palletCode) |
| | | { |
| | | _logger.LogInformation($"å¼å§æ§è¡èªå¨æå
é»è¾ - åæ¡ç : {stockDetail.Barcode}, æå
æ°é: {splitQuantity}"); |
| | | |
| | |
| | | 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(); |
| | |
| | | |
| | | // æç©æåæ¹æ¬¡åç»å¤ç |
| | | var groupDetails = outboundOrderDetails |
| | | .GroupBy(x => new { x.MaterielCode, x.BatchNo, x.SupplyCode }) |
| | | .GroupBy(x => new { x.MaterielCode, x.BatchNo, x.SupplyCode,x.WarehouseCode }) |
| | | .Select(x => new |
| | | { |
| | | MaterielCode = x.Key.MaterielCode, |
| | | BatchNo = x.Key.BatchNo, |
| | | SupplyCode = x.Key.SupplyCode, |
| | | Details = x.ToList(), |
| | | WarehouseCode=x.Key.WarehouseCode, |
| | | TotalNeedQuantity = CalculateReassignNeedQuantity(x.ToList()) |
| | | }) |
| | | .Where(x => x.TotalNeedQuantity > 0) |
| | |
| | | foreach (var item in groupDetails) |
| | | { |
| | | var needQuantity = item.TotalNeedQuantity; |
| | | |
| | | |
| | | // è·åå¯ç¨åºåï¼æå
è¿å
åºæåºï¼ |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterielCode, item.BatchNo, item.SupplyCode); |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterielCode, item.BatchNo, item.SupplyCode,item.WarehouseCode, outboundOrder.FactoryArea); |
| | | |
| | | if (!stockInfos.Any()) |
| | | { |
| | |
| | | |
| | | // æç©æåæ¹æ¬¡åç»å¤çï¼è¿éåªæä¸ä¸ªæç»ï¼ |
| | | var groupDetails = new List<Dt_OutboundOrderDetail> { orderDetail } |
| | | .GroupBy(x => new { x.MaterielCode, x.BatchNo, x.SupplyCode }) |
| | | .GroupBy(x => new { x.MaterielCode, x.BatchNo, x.SupplyCode ,x.WarehouseCode}) |
| | | .Select(x => new |
| | | { |
| | | MaterielCode = x.Key.MaterielCode, |
| | | BatchNo = x.Key.BatchNo, |
| | | SupplyCode = x.Key.SupplyCode, |
| | | WarehouseCode=x.Key.WarehouseCode, |
| | | Details = x.ToList(), |
| | | TotalNeedQuantity = batchQuantity // 使ç¨åæ¹æ°é |
| | | }) |
| | |
| | | var needQuantity = item.TotalNeedQuantity; |
| | | |
| | | // è·åå¯ç¨åºåï¼æå
è¿å
åºæåºï¼ |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterielCode, item.BatchNo, item.SupplyCode); |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterielCode, item.BatchNo, item.SupplyCode,item.WarehouseCode,outboundOrder.FactoryArea); |
| | | if (!stockInfos.Any()) |
| | | { |
| | | throw new Exception($"ç©æ[{item.MaterielCode}]æ¹æ¬¡[{item.BatchNo}]æªæ¾å°å¯åé
åºå"); |
| | |
| | | |
| | | if (remainingNeedQuantity > 0) |
| | | { |
| | | //// å¯éï¼è¿éå¯ä»¥æ ¹æ®ä¸å¡éæ±å³å®æ¯å¦å
许èªå¨åé
|
| | | //// å¦æè¦æ±ä¸¥æ ¼æç¨æ·éæ©åºåºï¼å¯ä»¥æåºå¼å¸¸ |
| | | //// throw new Exception($"ç¨æ·éæ©çåºåæ°éä¸è¶³ï¼è¿é{remainingNeedQuantity}ï¼è¯·éæ°éæ©"); |
| | | |
| | | //// 妿éè¦èªå¨åé
ï¼è®°å½æ¥å¿ |
| | | //_logger.LogInformation($"ç¨æ·éæ©çåºåæ°éä¸è¶³ï¼è¿é{remainingNeedQuantity}ï¼ç³»ç»å°èªå¨åé
"); |
| | | |
| | | //List<Dt_StockInfo> autoStocks = _stockService.StockInfoService.GetUseableStocks( |
| | | // outboundOrderDetail.MaterielCode, |
| | | // outboundOrderDetail.BatchNo, |
| | | // ""); |
| | | |
| | | //// æé¤ç¨æ·å·²éæ©ä¸å·²åé
çæç |
| | | //var assignedPalletCodes = outStocks.Select(x => x.PalletCode).ToList(); |
| | | //autoStocks = autoStocks |
| | | // .Where(x => !assignedPalletCodes.Contains(x.PalletCode)) |
| | | // .ToList(); |
| | | |
| | | //var (autoAssignStocks, stockAllocations) = _stockService.StockInfoService.GetOutboundStocks( |
| | | // autoStocks, |
| | | // outboundOrderDetail.MaterielCode, |
| | | // remainingNeedQuantity, |
| | | // out decimal residueQuantity); |
| | | |
| | | //if (autoAssignStocks != null && autoAssignStocks.Any()) |
| | | //{ |
| | | // outStocks.AddRange(autoAssignStocks); |
| | | |
| | | // // 为èªå¨åé
çåºåå建éå®è®°å½ |
| | | // var autoLockInfos = CreateLockInfosForAutoAssign(outboundOrder, outboundOrderDetail, autoAssignStocks, stockAllocations); |
| | | // outStockLockInfos.AddRange(autoLockInfos); |
| | | |
| | | // // æ´æ°å·²åé
æ°é |
| | | // decimal autoAssignedQuantity = remainingNeedQuantity - residueQuantity; |
| | | // totalAssignedFromUserSelection += autoAssignedQuantity; |
| | | // remainingNeedQuantity = residueQuantity; // æ´æ°å©ä½éæ± |
| | | //} |
| | | //else if (remainingNeedQuantity > 0) |
| | | //{ |
| | | // _logger.LogWarning($"èªå¨åé
失败ï¼å©ä½éæ±{remainingNeedQuantity}æ æ³æ»¡è¶³"); |
| | | //} |
| | | |
| | | } |
| | | |
| | | // æ´æ°é宿°é |
| | |
| | | .Where(d => d.MaterielCode == detail.MaterielCode && |
| | | (d.StockQuantity - d.OutboundQuantity) > 0 && |
| | | d.Barcode == barcode); // åªåé
æå®æ¡ç |
| | | |
| | | query = query.Where(x => x.WarehouseCode == detail.WarehouseCode); |
| | | |
| | | if (!string.IsNullOrEmpty(detail.BatchNo)) |
| | | { |
| | |
| | | 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(); |
| | | |
| | |
| | | |
| | | public PageGridData<StockInfoDetailWithPalletDto> GetPageData2(PageDataOptions options) |
| | | { |
| | | // 1. è·ååºç¡åé¡µæ°æ® |
| | | PageGridData<Dt_StockInfoDetail> pageData = base.GetPageData(options); |
| | | List<Dt_StockInfoDetail> filteredDetails = pageData.Rows.ToList(); // å
æ·è´åå§æ°æ® |
| | | string wheres = ValidatePageOptions(options); |
| | | |
| | | var sugarQueryable = Db.Queryable<Dt_StockInfoDetail>().InnerJoin<Dt_StockInfo>((detail, item) => detail.StockId == item.Id); |
| | | |
| | | Dictionary<string, SqlSugar.OrderByType> orderbyDic = GetPageDataSort(options, TProperties); |
| | | List<OrderByModel> orderByModels = new List<OrderByModel>(); |
| | | foreach (var item in orderbyDic) |
| | | { |
| | | if (item.Key.ToLower() == "id") |
| | | { |
| | | OrderByModel orderByModel = new() |
| | | { |
| | | FieldName = "detail."+item.Key, |
| | | OrderByType = item.Value |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | 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 |
| | | { |
| | | List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | if (searchParametersList?.Any() == true) |
| | | searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | if (searchParametersList != null && searchParametersList.Any()) |
| | | { |
| | | foreach (var param in searchParametersList) |
| | | { |
| | |
| | | if (param.Name.Equals(nameof(Dt_StockInfo.PalletCode).FirstLetterToLower(), StringComparison.OrdinalIgnoreCase) |
| | | && !string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | // ä¼åï¼æ¹éæ¥è¯¢ï¼å¦ææå¤ä¸ªæçç ï¼è¿éä¹å¯ä»¥æ©å±ï¼ |
| | | string palletCode = param.Value.ToString().Trim(); |
| | | var targetStock = _stockinfoRepository.QueryFirst(x => x.PalletCode == palletCode); |
| | | |
| | | // ç©ºå¼æ ¡éªï¼æªæ¾å°å¯¹åºæççåºåï¼ç´æ¥è¿æ»¤ä¸ºç©º |
| | | if (targetStock != null) |
| | | { |
| | | filteredDetails = filteredDetails.Where(x => x.StockId == targetStock.Id).ToList(); |
| | | } |
| | | else |
| | | { |
| | | filteredDetails = new List<Dt_StockInfoDetail>(); |
| | | } |
| | | break; // å个æçç æ¥è¯¢ï¼å¹é
åéåºå¾ªç¯ |
| | | sugarQueryable = sugarQueryable.Where((detail, item) => item.PalletCode.Contains(param.Value)); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | List<int> stockIds = filteredDetails.Select(detail => detail.StockId).Distinct().ToList(); |
| | | var stockDict = _stockinfoRepository.QueryData(x => stockIds.Contains(x.Id)) |
| | | .ToDictionary(x => x.Id, x => x.PalletCode ?? "æ æçç¼å·"); |
| | | var data = sugarQueryable |
| | | .WhereIF(!wheres.IsNullOrEmpty(), wheres) |
| | | .OrderBy(orderByModels) |
| | | .Select((detail, item) => new StockInfoDetailWithPalletDto |
| | | { |
| | | Id = detail.Id, |
| | | StockId = detail.StockId, |
| | | MaterielCode = detail.MaterielCode, |
| | | MaterielName = detail.MaterielName, |
| | | OrderNo = detail.OrderNo, |
| | | BatchNo = detail.BatchNo, |
| | | ProductionDate = detail.ProductionDate, |
| | | EffectiveDate = detail.EffectiveDate, |
| | | SerialNumber = detail.SerialNumber, |
| | | StockQuantity = detail.StockQuantity, |
| | | OutboundQuantity = detail.OutboundQuantity, |
| | | Status = detail.Status, |
| | | Unit = detail.Unit, |
| | | InboundOrderRowNo = detail.InboundOrderRowNo, |
| | | SupplyCode = detail.SupplyCode, |
| | | WarehouseCode = detail.WarehouseCode, |
| | | Barcode = detail.Barcode, |
| | | BusinessType = detail.BusinessType, |
| | | Remark = detail.Remark, |
| | | Creater = detail.Creater, |
| | | CreateDate = detail.CreateDate, |
| | | Modifier = detail.Modifier, |
| | | ModifyDate = detail.ModifyDate, |
| | | PalletCode = item.PalletCode |
| | | }) |
| | | .ToPageList(options.Page, options.Rows, ref totalCount); |
| | | |
| | | List<StockInfoDetailWithPalletDto> dtoList = filteredDetails |
| | | .Select(detail => new StockInfoDetailWithPalletDto |
| | | { |
| | | Id = detail.Id, |
| | | StockId = detail.StockId, |
| | | MaterielCode = detail.MaterielCode, |
| | | MaterielName = detail.MaterielName, |
| | | OrderNo = detail.OrderNo, |
| | | BatchNo = detail.BatchNo, |
| | | ProductionDate = detail.ProductionDate, |
| | | EffectiveDate = detail.EffectiveDate, |
| | | SerialNumber = detail.SerialNumber, |
| | | StockQuantity = detail.StockQuantity, |
| | | OutboundQuantity = detail.OutboundQuantity, |
| | | Status = detail.Status, |
| | | Unit = detail.Unit, |
| | | InboundOrderRowNo = detail.InboundOrderRowNo, |
| | | SupplyCode = detail.SupplyCode, |
| | | WarehouseCode = detail.WarehouseCode, |
| | | Barcode = detail.Barcode, |
| | | BusinessType = detail.BusinessType, |
| | | Remark = detail.Remark, |
| | | Creater = detail.Creater, |
| | | CreateDate = detail.CreateDate, |
| | | Modifier = detail.Modifier, |
| | | ModifyDate = detail.ModifyDate, |
| | | PalletCode = stockDict.TryGetValue(detail.StockId, out var palletCode) ? palletCode : "æ æçç¼å·" |
| | | }) |
| | | .ToList(); |
| | | |
| | | return new PageGridData<StockInfoDetailWithPalletDto> |
| | | { |
| | | Rows = dtoList.Where(x=>x.PalletCode != "æ æçç¼å·").ToList(), |
| | | Total = pageData.Total, |
| | | Summary = pageData.Summary |
| | | }; |
| | | return new PageGridData<StockInfoDetailWithPalletDto>(totalCount, data); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | return GetStockInfos(materielCode, batchNo, supplyCode, locationCodes); |
| | | } |
| | | |
| | | |
| | | public List<Dt_StockInfo> GetUseableStocks(string materielCode, string batchNo, string supplyCode, string wearhouseCode, string factoryCode) |
| | | { |
| | | List<string> locationCodes = _locationInfoService.GetCanOutLocationCodes(); |
| | | |
| | | return GetStockInfos(materielCode, batchNo, supplyCode, locationCodes,wearhouseCode,factoryCode); |
| | | } |
| | | |
| | | public List<Dt_StockInfo> GetStockInfos(string materielCode, string lotNo, string supplyCode, List<string> locationCodes, string wearhouseCode, string factoryCode) |
| | | { |
| | | if (string.IsNullOrWhiteSpace(wearhouseCode)) |
| | | { |
| | | throw new ArgumentNullException("ä»åºä¸è½ä¸ºç©º"); |
| | | } |
| | | if (string.IsNullOrWhiteSpace(factoryCode)) |
| | | { |
| | | throw new ArgumentNullException("ååºä¸è½ä¸ºç©º"); |
| | | } |
| | | var query = Db.Queryable<Dt_StockInfo>() |
| | | .Where(x => locationCodes.Contains(x.LocationCode) && x.StockStatus == StockStatusEmun.å
¥åºå®æ.ObjToInt() |
| | | // && x.StockStatus == (int)StockStatusEmun.æ£å¸¸) |
| | | ).Includes(x => x.Details); |
| | | query = query.Where(x => x.Details.Any(d => d.WarehouseCode == wearhouseCode)); |
| | | query = query.Where(x => x.Details.Any(d => d.FactoryArea == factoryCode)); |
| | | if (!string.IsNullOrEmpty(materielCode)) |
| | | { |
| | | query = query.Where(x => x.Details.Any(d => d.MaterielCode == materielCode)); |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(lotNo)) |
| | | { |
| | | query = query.Where(x => x.Details.Any(d => d.BatchNo == lotNo)); |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(supplyCode)) |
| | | { |
| | | query = query.Where(x => x.Details.Any(d => d.SupplyCode == supplyCode)); |
| | | } |
| | | |
| | | return query.OrderBy(x => x.CreateDate).ToList(); |
| | | //ISugarQueryable<Dt_LocationInfo> sugarQueryable = Db.Queryable<Dt_LocationInfo>().Where(x => locationCodes.Contains(x.LocationCode)); |
| | | //ISugarQueryable<Dt_StockInfo> sugarQueryable1 = Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode)); |
| | | //return sugarQueryable.InnerJoin(sugarQueryable1, (a, b) => a.LocationCode == b.LocationCode).Select((a, b) => b).OrderBy(a => a.CreateDate).Includes(a => a.Details).ToList(); |
| | | } |
| | | |
| | | public Dt_StockInfo GetPalletStockInfo(int locationType) |
| | | { |
| | | |
| | |
| | | |
| | | //} |
| | | |
| | | var outboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrder>().Includes(x=>x.Details) .Where(x => x.Details.Any(o=>o.OrderId==orderId)).First(); |
| | | var outboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrder>().Includes(x => x.Details).Where(x => x.Details.Any(o => o.OrderId == orderId)).First(); |
| | | if (outboundOrder == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°åæ®ç¼å·ä¸º{outboundOrder.UpperOrderNo}çåºåºåä¿¡æ¯"); |
| | | } |
| | | return GetStockSelectViews(outboundOrder.Id,orderdetailid, materielCode); |
| | | return GetStockSelectViews(outboundOrder.Id, orderdetailid, materielCode); |
| | | } |
| | | |
| | | public List<StockSelectViewDTO> GetStockSelectViews(int orderId,int orderdetailid, string materielCode) |
| | | public List<StockSelectViewDTO> GetStockSelectViews(int orderId, int orderdetailid, string materielCode) |
| | | { |
| | | Dt_OutboundOrder outboundOrder = _outboundOrderService.Repository.QueryFirst(x => x.Id == orderId); |
| | | if (outboundOrder == null) |
| | |
| | | } |
| | | |
| | | // è·ååºåºåæç»ï¼ç¨äºç¡®å®éè¦çæ¹æ¬¡åä¾åºå |
| | | var orderDetails = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrderDetail>().Where(x =>x.Id==orderdetailid && x.OrderId == orderId && x.MaterielCode == materielCode).ToList(); |
| | | var orderDetails = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrderDetail>().Where(x => x.Id == orderdetailid && x.OrderId == orderId && x.MaterielCode == materielCode).ToList(); |
| | | |
| | | if (!orderDetails.Any()) |
| | | { |
| | |
| | | |
| | | // æ§è¡æ¥è¯¢å¹¶æå
è¿å
åºæåº |
| | | var Qstocks = stockQuery.Where(x => x.Details.Any(d => d.MaterielCode == materielCode && d.StockQuantity > d.OutboundQuantity)); |
| | | Qstocks = stockQuery.Where(x => x.Details.Any(d => d.FactoryArea == outboundOrder.FactoryArea)); |
| | | Qstocks = stockQuery.Where(x => x.Details.Any(d => d.WarehouseCode == orderDetail.WarehouseCode)); |
| | | |
| | | if (!string.IsNullOrEmpty(orderDetail.BatchNo)) |
| | | { |
| | | |
| | | Qstocks = stockQuery.Where(x => x.Details.Any(d => d.BatchNo == orderDetail.BatchNo)); |
| | | |
| | | } |
| | | if (!string.IsNullOrEmpty(orderDetail.SupplyCode)) |
| | | { |
| | | |
| | | Qstocks = stockQuery.Where(x => x.Details.Any(d => d.SupplyCode == orderDetail.SupplyCode)); |
| | | |
| | | } |
| | | |
| | | var stocks = Qstocks.OrderBy(x => x.CreateDate).ToList(); |
| | |
| | | // æ§è¡æ¥è¯¢å¹¶æå
è¿å
åºæåº |
| | | var Qstocks = stockQuery.Where(x => x.Details.Any(d => d.MaterielCode == materielCode && d.StockQuantity > d.OutboundQuantity)); |
| | | |
| | | Qstocks = stockQuery.Where(x => x.Details.Any(d => d.FactoryArea == outboundOrder.FactoryArea)); |
| | | Qstocks = stockQuery.Where(x => x.Details.Any(d => d.WarehouseCode == orderDetail.WarehouseCode)); |
| | | |
| | | if (!string.IsNullOrEmpty(orderDetail.BatchNo)) |
| | | { |
| | | |
| | | Qstocks = stockQuery.Where(x => x.Details.Any(d => d.BatchNo == orderDetail.BatchNo)); |
| | | |
| | | } |
| | | if (!string.IsNullOrEmpty(orderDetail.SupplyCode)) |
| | | { |
| | | |
| | | Qstocks = stockQuery.Where(x => x.Details.Any(d => d.SupplyCode == orderDetail.SupplyCode)); |
| | | |
| | | } |
| | | |
| | | var stocks = Qstocks.OrderBy(x => x.CreateDate).ToList(); |
| | |
| | | |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, WIDESEA_Common.StockEnum.StockChangeType.MaterielGroup); |
| | | } |
| | | catch(Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | _logger.LogInformation($"InboundTaskCompleted AddLocationStatusChangeRecord : {ex.Message} " ); |
| | | _logger.LogInformation($"InboundTaskCompleted AddLocationStatusChangeRecord : {ex.Message} "); |
| | | } |
| | | try |
| | | try |
| | | { |
| | | foreach (var inboundOrder in inboundOrders) |
| | | { |
| | |
| | | { |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforelocationStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum); |
| | | } |
| | | catch(Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | _logger.LogInformation($"InEmptyTaskCompleted AddLocationStatusChangeRecord : {ex.Message} "); |
| | | } |
| | |
| | | { |
| | | await Db.Deleteable(task).ExecuteCommandAsync(); |
| | | } |
| | | |
| | | |
| | | await RecalculateOrderStatus(task.OrderNo); |
| | | try |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | |
| | | |
| | | |
| | | |
| | | // è·ååå½±åç订åæç»IDï¼å»éï¼ |
| | | //var affectedDetailIds = returnLocks |
| | | // .Select(x => x.OrderDetailId) |
| | |
| | | |
| | | _logger.LogInformation($"æ´æ°è®¢åç¶æ - OrderNo: {orderNo}, æ§ç¶æ: {outboundOrder.OrderStatus}, æ°ç¶æ: {newStatus}"); |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | |
| | | 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); |
| | | var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel); |
| | | if (result != null && result.code == 200) |
| | | { |
| | | await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>() |
| | |
| | | } |
| | | 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="") |
| | | { |