| | |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | { |
| | | name: "忣", |
| | | // icon: 'el-icon-upload2', |
| | | class: '', |
| | | value: 'BatchOrder', |
| | | type: 'primary', |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | ] |
| | | |
| | | export default buttons |
| | |
| | | // if (_button) { |
| | | // _button.name = isAdd ? this.continueAddName : 'ä¿ å'; |
| | | // } |
| | | this.boxButtons.forEach(x=>{ |
| | | btn.hidden=true |
| | | }) |
| | | this.boxButtons.forEach(x=>{}) |
| | | }, |
| | | resetAdd() { |
| | | if (this.hasDetail) { |
| | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | import gridBody from './extend/StockSelect.vue' |
| | | 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 { h, createVNode, render, reactive, ref } from 'vue'; |
| | | import { ElDialog, ElForm, ElFormItem, ElInput, ElButton, ElMessage, ElSelect, ElOption } from 'element-plus'; // å¼å
¥ElMessageï¼è§£å³æç¤ºæ ååº |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [ { |
| | | name: 'ç»ç', |
| | | type: 'primary', |
| | | value: 'ç»ç', |
| | | onClick: function () { // ä¿®å¤1ï¼ç§»é¤æ ç¨rowåæ°ï¼å æ¥å¿è°è¯ |
| | | console.log('ç»çæé®è¢«ç¹å»ï¼å¼å§æ ¡éª'); |
| | | const selectedRows = this.$refs.table.getSelected(); |
| | | |
| | | // æ ¡éª1ï¼æ¯å¦éä¸è¡ |
| | | if (selectedRows.length === 0) { |
| | | console.log('æ ¡éªä¸éè¿ï¼æªéä¸ä»»ä½åæ®'); |
| | | ElMessage.warning('è¯·éæ©ä¸æ¡åæ®'); |
| | | return; |
| | | } |
| | | // æ ¡éª2ï¼æ¯å¦éä¸åè¡ |
| | | if (selectedRows.length > 1) { |
| | | console.log('æ ¡éªä¸éè¿ï¼éä¸å¤è¡åæ®'); |
| | | ElMessage.warning('åªè½éæ©ä¸æ¡åæ®'); |
| | | return; |
| | | } |
| | | |
| | | const targetRow = selectedRows[0]; |
| | | |
| | | this.$emit('openPalletDialog', targetRow.orderNo); |
| | | } |
| | | },], box: [], detail: [] }, //æ©å±çæé® |
| | | buttons: { |
| | | view: [{ |
| | | name: 'ç»ç', |
| | | type: 'primary', |
| | | value: 'ç»ç', |
| | | onClick: function () { // ä¿®å¤1ï¼ç§»é¤æ ç¨rowåæ°ï¼å æ¥å¿è°è¯ |
| | | console.log('ç»çæé®è¢«ç¹å»ï¼å¼å§æ ¡éª'); |
| | | const selectedRows = this.$refs.table.getSelected(); |
| | | |
| | | // æ ¡éª1ï¼æ¯å¦éä¸è¡ |
| | | if (selectedRows.length === 0) { |
| | | console.log('æ ¡éªä¸éè¿ï¼æªéä¸ä»»ä½åæ®'); |
| | | ElMessage.warning('è¯·éæ©ä¸æ¡åæ®'); |
| | | return; |
| | | } |
| | | // æ ¡éª2ï¼æ¯å¦éä¸åè¡ |
| | | if (selectedRows.length > 1) { |
| | | console.log('æ ¡éªä¸éè¿ï¼éä¸å¤è¡åæ®'); |
| | | ElMessage.warning('åªè½éæ©ä¸æ¡åæ®'); |
| | | return; |
| | | } |
| | | |
| | | const targetRow = selectedRows[0]; |
| | | |
| | | this.$emit('openPalletDialog', targetRow.orderNo); |
| | | } |
| | | },], box: [], detail: [] |
| | | }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { //æ¡æ¶åå§åé
ç½®åï¼ |
| | | this.columns.push({ |
| | | this.columns.push({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | | width: 90, |
| | |
| | | this.$refs.gridBody.open(row); |
| | | } |
| | | }); |
| | | let EmptyTrayOutboundBtn = this.buttons.find(x => x.value == 'BatchOrder'); |
| | | if (EmptyTrayOutboundBtn) { |
| | | EmptyTrayOutboundBtn.onClick = function () { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) return this.$error("è¯·éæ©æ°æ®!"); |
| | | if (rows.length > 1) return this.$error("è¯·éæ©ä¸æ¡æ°æ®!"); |
| | | this.$router.push({ |
| | | path: '/outbound/picking', |
| | | query: { orderId: rows[0].id,orderNo:rows[0].orderNo} |
| | | }) |
| | | |
| | | } |
| | | } |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | 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 { h, createVNode, render, reactive, ref } from 'vue'; |
| | | import { ElDialog, ElForm, ElFormItem, ElInput, ElButton, ElMessage, ElSelect, ElOption } from 'element-plus'; // å¼å
¥ElMessageï¼è§£å³æç¤ºæ ååº |
| | | |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: '', |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [ |
| | | { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: '', |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { |
| | | view: [ |
| | | { |
| | | name: 'ç»ç', |
| | | type: 'primary', |
| | | value: 'ç»ç', |
| | |
| | | } |
| | | |
| | | const targetRow = selectedRows[0]; |
| | | |
| | | |
| | | this.$emit('openPalletDialog', targetRow.inboundOrderNo); |
| | | } |
| | | }, |
| | | { |
| | | name: 'æ¤éç»ç', |
| | | type: 'primary', |
| | | value: 'æ¤éç»ç', |
| | | onClick: function () { |
| | | console.log('æ¤éç»çæé®è¢«ç¹å»'); |
| | | const mountNode = document.createElement('div'); |
| | | document.body.appendChild(mountNode); |
| | | name: 'æ¤éç»ç', |
| | | type: 'primary', |
| | | value: 'æ¤éç»ç', |
| | | onClick: function () { |
| | | console.log('æ¤éç»çæé®è¢«ç¹å»'); |
| | | const mountNode = document.createElement('div'); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | // ååºå¼è¡¨åæ°æ®ï¼æçå·ï¼å¿
å¡«ï¼ |
| | | const formData = reactive({ |
| | | palletCode: '' // æçå·è¾å
¥æ¡ |
| | | }); |
| | | // ååºå¼è¡¨åæ°æ®ï¼æçå·ï¼å¿
å¡«ï¼ |
| | | const formData = reactive({ |
| | | palletCode: '' // æçå·è¾å
¥æ¡ |
| | | }); |
| | | |
| | | // æäº¤è¡¨åçç»ä¸é»è¾ |
| | | const submitForm = async () => { |
| | | const formRef = vnode.component.refs.cancelPalletForm; |
| | | try { |
| | | // æ§è¡è¡¨åæ ¡éªï¼æçå·å¿
å¡«ï¼ |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | ElMessage.warning('请è¾å
¥ææçæçå·'); |
| | | return; |
| | | } |
| | | // æäº¤è¡¨åçç»ä¸é»è¾ |
| | | const submitForm = async () => { |
| | | const formRef = vnode.component.refs.cancelPalletForm; |
| | | try { |
| | | // æ§è¡è¡¨åæ ¡éªï¼æçå·å¿
å¡«ï¼ |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | ElMessage.warning('请è¾å
¥ææçæçå·'); |
| | | return; |
| | | } |
| | | |
| | | // åèµ·æ¤éç»çè¯·æ± |
| | | try { |
| | | //console.log('åèµ·æ¤éç»ç请æ±ï¼æçå·ï¼', formData.palletCode.trim()); |
| | | const response = await http.post('/api/InboundOrder/UndoPalletGroup?palletCode='+formData.palletCode.trim()); |
| | | |
| | | // åèµ·æ¤éç»çè¯·æ± |
| | | try { |
| | | //console.log('åèµ·æ¤éç»ç请æ±ï¼æçå·ï¼', formData.palletCode.trim()); |
| | | const response = await http.post('/api/InboundOrder/UndoPalletGroup?palletCode=' + formData.palletCode.trim()); |
| | | |
| | | const { status, message, data } = response; |
| | | if (status) { |
| | | ElMessage.success(`æ¤éç»çæåï¼æçå·ï¼${formData.palletCode.trim()}`); |
| | | this.refresh(); // æååå·æ°å表 |
| | | // å
³éå¯¹è¯æ¡ |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } else { |
| | | console.log('æ¤éç»ç失败ï¼å端æç¤ºï¼', message); |
| | | ElMessage.error(message || data?.message || 'æ¤éç»ç失败'); |
| | | selectPalletCodeInput(); // éä¸è¾å
¥æ¡æ¹ä¾¿éæ°è¾å
¥ |
| | | } |
| | | } catch (error) { |
| | | console.error('æ¤éç»ç请æ±å¼å¸¸ï¼', error); |
| | | ElMessage.error('ç½ç»å¼å¸¸ææ¥å£é误ï¼è¯·ç¨åéè¯'); |
| | | selectPalletCodeInput(); |
| | | } |
| | | }; |
| | | |
| | | // éä¸è¾å
¥æ¡ææ¬ï¼æ¹ä¾¿éæ°è¾å
¥ï¼ |
| | | const selectPalletCodeInput = () => { |
| | | setTimeout(() => { |
| | | const inputRef = vnode.component.refs.palletCodeInput; |
| | | if (inputRef) { |
| | | const targetInput = inputRef.$el?.querySelector('input') || inputRef; |
| | | targetInput?.focus(); |
| | | targetInput?.select(); |
| | | } |
| | | }, 100); |
| | | }; |
| | | const { status, message, data } = response; |
| | | if (status) { |
| | | ElMessage.success(`æ¤éç»çæåï¼æçå·ï¼${formData.palletCode.trim()}`); |
| | | this.refresh(); // æååå·æ°å表 |
| | | // å
³éå¯¹è¯æ¡ |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } else { |
| | | console.log('æ¤éç»ç失败ï¼å端æç¤ºï¼', message); |
| | | ElMessage.error(message || data?.message || 'æ¤éç»ç失败'); |
| | | selectPalletCodeInput(); // éä¸è¾å
¥æ¡æ¹ä¾¿éæ°è¾å
¥ |
| | | } |
| | | } catch (error) { |
| | | console.error('æ¤éç»ç请æ±å¼å¸¸ï¼', error); |
| | | ElMessage.error('ç½ç»å¼å¸¸ææ¥å£é误ï¼è¯·ç¨åéè¯'); |
| | | selectPalletCodeInput(); |
| | | } |
| | | }; |
| | | |
| | | // åå»ºå¯¹è¯æ¡VNode |
| | | const vnode = createVNode(ElDialog, { |
| | | title: 'æ¤éç»ç', |
| | | width: '400px', |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | onOpened: () => { |
| | | // å¯¹è¯æ¡æå¼åèªå¨èç¦è¾å
¥æ¡ |
| | | setTimeout(() => { |
| | | const inputRef = vnode.component.refs.palletCodeInput; |
| | | inputRef?.focus(); |
| | | }, 100); |
| | | }, |
| | | 'onUpdate:modelValue': (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | } |
| | | }, { |
| | | default: () => h(ElForm, { |
| | | model: formData, |
| | | rules: { |
| | | palletCode: [ |
| | | { required: true, message: '请è¾å
¥æçå·', trigger: ['blur', 'enter'] }, |
| | | { min: 1, max: 50, message: 'æçå·é¿åº¦ä¸è½è¶
è¿50个å符', trigger: ['blur', 'input'] } |
| | | ] |
| | | }, |
| | | ref: 'cancelPalletForm' |
| | | }, [ |
| | | // æçå·è¾å
¥é¡¹ |
| | | h(ElFormItem, { label: 'æçå·', prop: 'palletCode', required: true }, [ |
| | | h(ElInput, { |
| | | type: 'text', |
| | | modelValue: formData.palletCode, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.palletCode = val; |
| | | }, |
| | | ref: 'palletCodeInput', |
| | | placeholder: 'æ«ç è¾å
¥ææå¨è¾å
¥æçå·', |
| | | maxLength: 50, |
| | | // çå¬å车äºä»¶ï¼æ«ç æªé»è®¤ä¼åéåè½¦ï¼ |
| | | 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.bind(this) // ç»å®thisä¸ä¸æ |
| | | }, '确认æ¤é') |
| | | ]) |
| | | ]) |
| | | }); |
| | | // éä¸è¾å
¥æ¡ææ¬ï¼æ¹ä¾¿éæ°è¾å
¥ï¼ |
| | | const selectPalletCodeInput = () => { |
| | | setTimeout(() => { |
| | | const inputRef = vnode.component.refs.palletCodeInput; |
| | | if (inputRef) { |
| | | const targetInput = inputRef.$el?.querySelector('input') || inputRef; |
| | | targetInput?.focus(); |
| | | targetInput?.select(); |
| | | } |
| | | }, 100); |
| | | }; |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | } |
| | | // åå»ºå¯¹è¯æ¡VNode |
| | | const vnode = createVNode(ElDialog, { |
| | | title: 'æ¤éç»ç', |
| | | width: '400px', |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | onOpened: () => { |
| | | // å¯¹è¯æ¡æå¼åèªå¨èç¦è¾å
¥æ¡ |
| | | setTimeout(() => { |
| | | const inputRef = vnode.component.refs.palletCodeInput; |
| | | inputRef?.focus(); |
| | | }, 100); |
| | | }, |
| | | { |
| | | name: 'åæ¹å
¥åº', |
| | | type: 'primary', |
| | | value: 'åæ¹å
¥åº', |
| | | onClick: async function () { |
| | | console.log('åæ¹å
¥åºæé®è¢«ç¹å»ï¼å¼å§æ ¡éª'); |
| | | const selectedRows = this.$refs.table.getSelected(); |
| | | |
| | | // æ ¡éª1ï¼æ¯å¦éä¸è¡ï¼è³å°éæ©ä¸æ¡ï¼ |
| | | if (selectedRows.length === 0) { |
| | | console.log('æ ¡éªä¸éè¿ï¼æªéä¸ä»»ä½åæ®'); |
| | | ElMessage.warning('è¯·éæ©è³å°ä¸æ¡åæ®'); |
| | | return; |
| | | } |
| | | |
| | | // æ¶éææéä¸åæ®çç¼å·ï¼è¿æ»¤æ åæ®å·çå¼å¸¸è¡ï¼ |
| | | const inboundOrderNos = selectedRows |
| | | .filter(row => row.inboundOrderNo) |
| | | .map(row => row.inboundOrderNo); |
| | | |
| | | // æ ¡éª2ï¼æ¯å¦æææåæ®å· |
| | | if (inboundOrderNos.length === 0) { |
| | | console.log('æ ¡éªä¸éè¿ï¼éä¸åæ®æ ææç¼å·'); |
| | | ElMessage.warning('éä¸ç忮䏿 ææç¼å·ï¼è¯·éæ°éæ©'); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | console.log('åèµ·åæ¹å
¥åºè¯·æ±ï¼åæ°ï¼', { inboundOrderNos}); |
| | | const response = await http.post('/api/InboundOrder/BatchOrderFeedbackToMes', { |
| | | orderNos: inboundOrderNos, |
| | | inout:1 |
| | | }); |
| | | |
| | | const { status, message, data } = response; |
| | | if (status) { |
| | | console.log('åæ¹å
¥åºæåï¼å端è¿åï¼', data); |
| | | ElMessage.success(`åæ¹å
¥åºæåï¼å
±å¤ç${inboundOrderNos.length}æ¡åæ®`); |
| | | this.refresh(); // å
¥åºæååå·æ°å表ï¼å¤ç¨åæé»è¾ï¼ |
| | | } else { |
| | | console.log('åæ¹å
¥åºå¤±è´¥ï¼å端æç¤ºï¼', message); |
| | | ElMessage.error(message || data?.message || 'åæ¹å
¥åºå¤±è´¥'); |
| | | } |
| | | } catch (error) { |
| | | console.error('åæ¹å
¥åºè¯·æ±å¼å¸¸ï¼', error); |
| | | ElMessage.error('ç½ç»å¼å¸¸ææ¥å£é误ï¼è¯·ç¨åéè¯'); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | name: '空æçå
¥åº', |
| | | type: 'primary', |
| | | value: '空æçå
¥åº', |
| | | |
| | | onClick: function () { |
| | | const mountNode = document.createElement('div'); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | // ååºå¼è¡¨åæ°æ®ï¼æç®±ç ï¼å¿
å¡«ï¼æ«ç æª/æå¨è¾å
¥ï¼ |
| | | const formData = reactive({ |
| | | boxCode: '', |
| | | warehouseCode:'' |
| | | }); |
| | | |
| | | 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 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 = ''; |
| | | |
| | | 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, |
| | | |
| | | 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(); |
| | | 'onUpdate:modelValue': (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | } |
| | | }) |
| | | ]), |
| | | // åºé¨æé®åº |
| | | h('div', { style: { textAlign: 'right', marginTop: '16px' } }, [ |
| | | h(ElButton, { |
| | | type: 'text', |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info('åæ¶å
¥åºä»»å¡'); |
| | | }, { |
| | | default: () => h(ElForm, { |
| | | model: formData, |
| | | rules: { |
| | | palletCode: [ |
| | | { required: true, message: '请è¾å
¥æçå·', trigger: ['blur', 'enter'] }, |
| | | { min: 1, max: 50, message: 'æçå·é¿åº¦ä¸è½è¶
è¿50个å符', trigger: ['blur', 'input'] } |
| | | ] |
| | | }, |
| | | ref: 'cancelPalletForm' |
| | | }, [ |
| | | // æçå·è¾å
¥é¡¹ |
| | | h(ElFormItem, { label: 'æçå·', prop: 'palletCode', required: true }, [ |
| | | h(ElInput, { |
| | | type: 'text', |
| | | modelValue: formData.palletCode, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.palletCode = val; |
| | | }, |
| | | ref: 'palletCodeInput', |
| | | placeholder: 'æ«ç è¾å
¥ææå¨è¾å
¥æçå·', |
| | | maxLength: 50, |
| | | // çå¬å车äºä»¶ï¼æ«ç æªé»è®¤ä¼åéåè½¦ï¼ |
| | | 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.bind(this) // ç»å®thisä¸ä¸æ |
| | | }, '确认æ¤é') |
| | | ]) |
| | | ]) |
| | | }); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | } |
| | | }, |
| | | { |
| | | name: 'åæ¹å
¥åº', |
| | | type: 'primary', |
| | | value: 'åæ¹å
¥åº', |
| | | onClick: async function () { |
| | | console.log('åæ¹å
¥åºæé®è¢«ç¹å»ï¼å¼å§æ ¡éª'); |
| | | const selectedRows = this.$refs.table.getSelected(); |
| | | |
| | | // æ ¡éª1ï¼æ¯å¦éä¸è¡ï¼è³å°éæ©ä¸æ¡ï¼ |
| | | if (selectedRows.length === 0) { |
| | | console.log('æ ¡éªä¸éè¿ï¼æªéä¸ä»»ä½åæ®'); |
| | | ElMessage.warning('è¯·éæ©è³å°ä¸æ¡åæ®'); |
| | | return; |
| | | } |
| | | |
| | | // æ¶éææéä¸åæ®çç¼å·ï¼è¿æ»¤æ åæ®å·çå¼å¸¸è¡ï¼ |
| | | const inboundOrderNos = selectedRows |
| | | .filter(row => row.inboundOrderNo) |
| | | .map(row => row.inboundOrderNo); |
| | | |
| | | // æ ¡éª2ï¼æ¯å¦æææåæ®å· |
| | | if (inboundOrderNos.length === 0) { |
| | | console.log('æ ¡éªä¸éè¿ï¼éä¸åæ®æ ææç¼å·'); |
| | | ElMessage.warning('éä¸ç忮䏿 ææç¼å·ï¼è¯·éæ°éæ©'); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | console.log('åèµ·åæ¹å
¥åºè¯·æ±ï¼åæ°ï¼', { inboundOrderNos }); |
| | | const response = await http.post('/api/InboundOrder/BatchOrderFeedbackToMes', { |
| | | orderNos: inboundOrderNos, |
| | | inout: 1 |
| | | }); |
| | | |
| | | const { status, message, data } = response; |
| | | if (status) { |
| | | console.log('åæ¹å
¥åºæåï¼å端è¿åï¼', data); |
| | | ElMessage.success(`åæ¹å
¥åºæåï¼å
±å¤ç${inboundOrderNos.length}æ¡åæ®`); |
| | | this.refresh(); // å
¥åºæååå·æ°å表ï¼å¤ç¨åæé»è¾ï¼ |
| | | } else { |
| | | console.log('åæ¹å
¥åºå¤±è´¥ï¼å端æç¤ºï¼', message); |
| | | ElMessage.error(message || data?.message || 'åæ¹å
¥åºå¤±è´¥'); |
| | | } |
| | | }, 'åæ¶'), |
| | | h(ElButton, { |
| | | type: 'primary', |
| | | onClick: submitForm |
| | | }, 'ç¡®å®') |
| | | ]) |
| | | ]) |
| | | }); |
| | | } catch (error) { |
| | | console.error('åæ¹å
¥åºè¯·æ±å¼å¸¸ï¼', error); |
| | | ElMessage.error('ç½ç»å¼å¸¸ææ¥å£é误ï¼è¯·ç¨åéè¯'); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | name: '空æçå
¥åº', |
| | | type: 'primary', |
| | | value: '空æçå
¥åº', |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | } |
| | | } |
| | | ], box: [], detail: [] }, |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | }, |
| | | onInited() { |
| | | |
| | | //æ¡æ¶åå§åé
ç½®å |
| | | //妿è¦é
ç½®æç»è¡¨,卿¤æ¹æ³æä½ |
| | | //this.detailOptions.columns.forEach(column=>{ }); |
| | | }, |
| | | searchBefore(param) { |
| | | //ç颿¥è¯¢å,å¯ä»¥ç»param.wheresæ·»å æ¥è¯¢åæ° |
| | | //è¿åfalseï¼åä¸ä¼æ§è¡æ¥è¯¢ |
| | | // this.searchFormFields.orderType=[0] |
| | | let wheres = [{ |
| | | 'name': 'orderType', |
| | | 'value': '0', |
| | | 'displayType': 'text'}]; |
| | | |
| | | onClick: function () { |
| | | const mountNode = document.createElement('div'); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | param.wheres.push(...wheres); |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| | | //æ¥è¯¢åï¼resultè¿åçæ¥è¯¢æ°æ®,å¯ä»¥å¨æ¾ç¤ºå°è¡¨æ ¼åå¤çè¡¨æ ¼çå¼ |
| | | return true; |
| | | }, |
| | | addBefore(formData) { |
| | | //æ°å»ºä¿ååformData为对象ï¼å
æ¬æç»è¡¨ï¼å¯ä»¥ç»ç»è¡¨å设置å¼ï¼èªå·±è¾åºçformDataçå¼ |
| | | return true; |
| | | }, |
| | | updateBefore(formData) { |
| | | //ç¼è¾ä¿ååformData为对象ï¼å
æ¬æç»è¡¨ãå é¤è¡çId |
| | | return true; |
| | | }, |
| | | rowClick({ row, column, event }) { |
| | | //æ¥è¯¢çé¢ç¹å»è¡äºä»¶ |
| | | this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | // ååºå¼è¡¨åæ°æ®ï¼æç®±ç ï¼å¿
å¡«ï¼æ«ç æª/æå¨è¾å
¥ï¼ |
| | | const formData = reactive({ |
| | | boxCode: '', |
| | | warehouseCode: '' |
| | | }); |
| | | |
| | | 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 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 = ''; |
| | | |
| | | 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, |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | ], box: [], detail: [] |
| | | }, |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | this.columns.forEach(column => { |
| | | if (column.field === 'orderStatistics') { |
| | | column.formatter = (row) => { |
| | | // æ ¡éªdetailsæ¯å¦åå¨ä¸ææ°æ® |
| | | if (row.details && row.details.length > 0) { |
| | | //æmaterielCodeåç»ç»è®¡orderQuantityæ»å |
| | | const materielSumMap = row.details.reduce((acc, item) => { |
| | | const materielCode = item.materielCode || 'æªç¥ç©æ'; |
| | | const quantity = Number(item.orderQuantity) || 0; |
| | | acc[materielCode] = (acc[materielCode] || 0) + quantity; |
| | | return acc; |
| | | }, {}); |
| | | |
| | | //æ¯ä¸ªç©æé¡¹çæç¬ç«divï¼è·¨è¡æ¾ç¤º |
| | | const displayItems = Object.entries(materielSumMap).map(([code, total]) => { |
| | | return `<div style="line-height: 1.5; white-space: normal;">${code}ï¼${total}个</div>`; |
| | | }); |
| | | const displayContent = displayItems.join(''); |
| | | return `<div style="color: #F56C6C; white-space: normal; word-break: break-all;">${displayContent}</div>`; |
| | | } else { |
| | | return '<span style="color: #F56C6C">æ å
¥åºæç»</span>'; |
| | | } |
| | | }; |
| | | } |
| | | }); |
| | | }, |
| | | onInited() { |
| | | |
| | | //æ¡æ¶åå§åé
ç½®å |
| | | //妿è¦é
ç½®æç»è¡¨,卿¤æ¹æ³æä½ |
| | | //this.detailOptions.columns.forEach(column=>{ }); |
| | | }, |
| | | searchBefore(param) { |
| | | //ç颿¥è¯¢å,å¯ä»¥ç»param.wheresæ·»å æ¥è¯¢åæ° |
| | | //è¿åfalseï¼åä¸ä¼æ§è¡æ¥è¯¢ |
| | | // this.searchFormFields.orderType=[0] |
| | | let wheres = [{ |
| | | 'name': 'orderType', |
| | | 'value': '0', |
| | | 'displayType': 'text' |
| | | }]; |
| | | |
| | | |
| | | param.wheres.push(...wheres); |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| | | //æ¥è¯¢åï¼resultè¿åçæ¥è¯¢æ°æ®,å¯ä»¥å¨æ¾ç¤ºå°è¡¨æ ¼åå¤çè¡¨æ ¼çå¼ |
| | | return true; |
| | | }, |
| | | addBefore(formData) { |
| | | //æ°å»ºä¿ååformData为对象ï¼å
æ¬æç»è¡¨ï¼å¯ä»¥ç»ç»è¡¨å设置å¼ï¼èªå·±è¾åºçformDataçå¼ |
| | | return true; |
| | | }, |
| | | updateBefore(formData) { |
| | | //ç¼è¾ä¿ååformData为对象ï¼å
æ¬æç»è¡¨ãå é¤è¡çId |
| | | return true; |
| | | }, |
| | | rowClick({ row, column, event }) { |
| | | //æ¥è¯¢çé¢ç¹å»è¡äºä»¶ |
| | | this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | } |
| | | }; |
| | | export default extension; |
| | | |
| | | } |
| | | }; |
| | | export default extension; |
| | |
| | | import { h,createVNode, render,reactive ,ref } from 'vue'; |
| | | import { ElDialog , ElForm, ElFormItem, ElInput, ElButton, ElMessage ,ElSelect, ElOption} from 'element-plus'; |
| | | |
| | | import gridBody from './extend/outOrderDetail.vue' |
| | | import gridBody from './extend/newAllocateOrderDetail.vue' |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <vol-box |
| | | v-model="showDetialBox" |
| | | :lazy="true" |
| | | width="75%" |
| | | :padding="15" |
| | | title="åæ®æç»ä¿¡æ¯" |
| | | > |
| | | <div class="box-head"> |
| | | <el-alert :closable="false" style="width: 100%"> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <span>å·²éä¸ {{ selection.length }} 项</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <!-- <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px" |
| | | @click="lockstocks" |
| | | >éå®åºå</el-link> --> |
| | | |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | v-if="isBatch === 0" |
| | | style="float: right; height: 20px" |
| | | @click="handleOpenPicking" |
| | | >æ£é</el-link> |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | v-if="isBatch === 1" |
| | | @click="handleOpenBatchPicking" |
| | | >åæ¹æ£é</el-link> |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | v-if="isBatch === 0" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="outbound" |
| | | >ç´æ¥åºåº</el-link |
| | | > |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | v-if="isBatch === 1" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="outboundbatch" |
| | | >åæ¹åºåº</el-link |
| | | > |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="getData" |
| | | >å·æ°</el-link |
| | | ></el-col |
| | | > |
| | | </el-row> |
| | | </el-alert> |
| | | </div> |
| | | <div class="box-table" style="margin-top: 1%"> |
| | | <el-table |
| | | ref="singleTable" |
| | | :data="tableData" |
| | | style="width: 100%; height: 100%" |
| | | highlight-current-row |
| | | @current-change="handleCurrentChange" |
| | | height="500px" |
| | | @row-click="handleRowClick" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"> </el-table-column> |
| | | <el-table-column |
| | | label="åºå·" |
| | | type="index" |
| | | fixed="left" |
| | | width="55" |
| | | align="center" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | v-for="(item, index) in tableColumns.filter((x) => !x.hidden)" |
| | | :key="index" |
| | | :prop="item.prop" |
| | | :label="item.title" |
| | | :width="item.width" |
| | | align="center" |
| | | > |
| | | <template #default="scoped"> |
| | | <div v-if="item.type == 'icon'"> |
| | | <el-tooltip |
| | | class="item" |
| | | effect="dark" |
| | | :content="item.title" |
| | | placement="bottom" |
| | | ><el-link |
| | | type="primary" |
| | | :disabled="getButtonEnable(item.prop, scoped.row)" |
| | | @click="tableButtonClick(scoped.row, item)" |
| | | ><i :class="item.icon" style="font-size: 22px"></i></el-link |
| | | ></el-tooltip> |
| | | </div> |
| | | |
| | | <div v-else-if="item.type == 'tag'"> |
| | | <el-tag size="small"> |
| | | {{ getDictionary(scoped.row, item) }} |
| | | </el-tag> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </vol-box> |
| | | <stock-select ref="child" @parentCall="parentCall"></stock-select> |
| | | <selected-stock |
| | | ref="selectedStock" |
| | | @parentCall="parentCall" |
| | | ></selected-stock> |
| | | <NoStockOut ref="NoStockOut" @parentCall="parentCall"></NoStockOut> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | import VolForm from "@/components/basic/VolForm.vue"; |
| | | import StockSelect from "./StockSelect.vue"; |
| | | import SelectedStock from "./SelectedStock.vue"; |
| | | import NoStockOut from "./NoStockOut.vue"; |
| | | 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'; |
| | | |
| | | export default { |
| | | components: { VolBox, VolForm, StockSelect, SelectedStock,NoStockOut}, |
| | | data() { |
| | | return { |
| | | row: null, |
| | | isBatch :0, |
| | | showDetialBox: false, |
| | | flag: false, |
| | | currentRow: null, |
| | | selection: [], |
| | | tableData: [], |
| | | tableColumns: [ |
| | | { |
| | | prop: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | }, |
| | | { |
| | | prop: "orderId", |
| | | title: "åºåºå主é®", |
| | | type: "string", |
| | | width: 90, |
| | | hidden: true, |
| | | }, |
| | | { |
| | | prop: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | }, |
| | | { |
| | | prop: "materielName", |
| | | title: "ç©æåç§°", |
| | | type: "string", |
| | | width: 150, |
| | | }, |
| | | { |
| | | prop: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "supplyCode", |
| | | title: "ä¾åºåç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | }, |
| | | { |
| | | prop: "orderQuantity", |
| | | title: "åæ®æ°é", |
| | | type: "string", |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "lockQuantity", |
| | | title: "é宿°é", |
| | | type: "int", |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "overOutQuantity", |
| | | title: "å·²åºæ°é", |
| | | type: "string", |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "overOutQuantity", |
| | | title: "æªææ°é", |
| | | type: "string", |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "unit", |
| | | title: "åä½", |
| | | type: "string", |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "orderDetailStatus", |
| | | title: "订åæç»ç¶æ", |
| | | type: "tag", |
| | | width: 90, |
| | | bindKey: "orderDetailStatusEnum", |
| | | }, |
| | | { |
| | | prop: "assignStock", |
| | | title: "æå®åºå", |
| | | type: "icon", |
| | | width: 90, |
| | | hidden:true, |
| | | icon: "el-icon-s-grid", |
| | | }, |
| | | { |
| | | prop: "viewDetail", |
| | | title: "åºåºè¯¦ç»", |
| | | type: "icon", |
| | | width: 90, |
| | | icon: "el-icon-s-operation", |
| | | }, |
| | | { |
| | | prop: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | }, |
| | | { |
| | | prop: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | }, |
| | | { |
| | | prop: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | }, |
| | | { |
| | | prop: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | paginations: { |
| | | sort: "id", |
| | | order: "desc", |
| | | Foots: "", |
| | | total: 0, |
| | | // 2020.08.29å¢å èªå®ä¹å页æ¡å¤§å° |
| | | sizes: [30, 60, 100, 120], |
| | | size: 30, // é»è®¤åé¡µå¤§å° |
| | | Wheres: [], |
| | | page: 1, |
| | | rows: 30, |
| | | }, |
| | | searchFormOptions: [ |
| | | [ |
| | | { |
| | | title: "åæ®ç¼å·", |
| | | field: "allocation_code", |
| | | type: "like", |
| | | }, |
| | | { |
| | | title: "åæ®ç±»å", |
| | | field: "allocation_type", |
| | | type: "select", |
| | | dataKey: "OrderType", |
| | | data: [], |
| | | }, |
| | | { |
| | | title: "åæ®ç¶æ", |
| | | field: "allocation_state", |
| | | type: "select", |
| | | dataKey: "OrderState", |
| | | data: [], |
| | | }, |
| | | ], |
| | | ], |
| | | searchFormFields: { |
| | | allocation_code: "", |
| | | allocation_type: "", |
| | | allocation_state: "", |
| | | }, |
| | | dictionaryList: null, |
| | | }; |
| | | }, |
| | | methods: { |
| | | open(row) { |
| | | this.row = row; |
| | | this.showDetialBox = true; |
| | | console.log(this.row); |
| | | this.isBatch = row.isBatch; |
| | | this.getDictionaryData(); |
| | | this.getData(); |
| | | }, |
| | | getData() { |
| | | var wheres = [{ name: "orderId", value: this.row.id }]; |
| | | var param = { |
| | | page: this.paginations.page, |
| | | rows: this.paginations.rows, |
| | | sort: this.paginations.sort, |
| | | order: this.paginations.order, |
| | | wheres: JSON.stringify(wheres), // æ¥è¯¢æ¡ä»¶ï¼æ ¼å¼ä¸º[{ name: "åæ®µ", value: "xx" }] |
| | | }; |
| | | this.http |
| | | .post("api/AllocateOrderDetail/GetPageData", param, "æ¥è¯¢ä¸") |
| | | .then((x) => { |
| | | this.tableData = x.rows; |
| | | }); |
| | | }, |
| | | tableButtonClick(row, column) { |
| | | if (column.prop == "assignStock") { |
| | | this.$refs.child.open(row); |
| | | } else if (column.prop == "NoStockOut") { |
| | | this.$refs.NoStockOut.open(row); |
| | | }else{ |
| | | //ç¹å»æå¼åºåºè¯¦æ
|
| | | this.$refs.selectedStock.open(row); |
| | | } |
| | | }, |
| | | lockstocks() { |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | var keys = this.selection.map((item) => item.id); // è·åéä¸è¡çid |
| | | this.http |
| | | .post("api/OutboundOrderDetail/LockOutboundStocks", keys, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.$message.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | }); |
| | | }, |
| | | // æå¼æ£éé¡µé¢ |
| | | handleOpenPicking() { |
| | | this.$router.push({ |
| | | path: '/outbound/picking', |
| | | query: { orderId: this.row.id ,orderNo:this.row.orderNo} |
| | | }) |
| | | }, |
| | | handleOpenBatchPicking() { |
| | | this.$router.push({ |
| | | path: '/outbound/batchpicking', |
| | | query: { orderId: this.row.id ,orderNo:this.row.orderNo}}) |
| | | }, |
| | | outbound() { |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | const platformOptions = [{label:'ç«å°2',value:'2-1'},{label:'ç«å°3',value:'3-1'}]; |
| | | const mountNode = document.createElement('div'); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | // 2. è¡¨åæ°æ®ï¼é»è®¤éä¸ç«å°3ï¼ |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value // é»è®¤ç»å®ãç«å°3ãçvalue |
| | | }); |
| | | |
| | | // 3. 卿å建弹çªç»ä»¶ |
| | | const vnode = createVNode(ElDialog, { |
| | | title: 'åºåºæä½ - éæ©åºåºç«å°', |
| | | width: '500px', |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | 'onUpdate:modelValue': (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | style: { |
| | | padding: '20px 0', |
| | | borderRadius: '8px' |
| | | } |
| | | }, { |
| | | default: () => h(ElForm, { |
| | | model: formData, |
| | | rules: { |
| | | selectedPlatform: [ |
| | | { required: true, message: 'è¯·éæ©åºåºç«å°', trigger: 'change' } |
| | | ] |
| | | }, |
| | | ref: 'outboundForm', |
| | | labelWidth: '100px', |
| | | style: { |
| | | padding: '0 30px' |
| | | } |
| | | }, [ |
| | | // åºåºç«å°éæ©é¡¹ï¼æ ¸å¿è¡¨åé¡¹ï¼ |
| | | h(ElFormItem, { |
| | | label: 'åºåºç«å°', |
| | | prop: 'selectedPlatform', |
| | | style: { |
| | | marginBottom: '24px' |
| | | } |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: 'è¯·éæ©åºåºç«å°ï¼3-12ï¼', |
| | | modelValue: formData.selectedPlatform, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.selectedPlatform = val; |
| | | }, |
| | | style: { |
| | | width: '100%', |
| | | height: '40px', |
| | | borderRadius: '4px', |
| | | borderColor: '#dcdfe6' |
| | | } |
| | | }, platformOptions.map(platform => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )) |
| | | ]), |
| | | // åºé¨æé®åº |
| | | h('div', { |
| | | style: { |
| | | textAlign: 'right', |
| | | marginTop: '8px', |
| | | paddingRight: '4px' |
| | | } |
| | | }, [ |
| | | h(ElButton, { |
| | | type: 'text', |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info('åæ¶åºåºæä½'); |
| | | }, |
| | | style: { |
| | | marginRight: '8px', |
| | | color: '#606266' |
| | | } |
| | | }, 'åæ¶'), |
| | | h(ElButton, { |
| | | type: 'primary', |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.outboundForm; |
| | | try { |
| | | // è¡¨åæ ¡éª |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | |
| | | // 4. æé 请æ±åæ°ï¼éä¸åæ®ID + éæ©çåºåºç«å°ï¼ |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | taskIds: keys, |
| | | outboundPlatform: formData.selectedPlatform // åºåºç«å° |
| | | }; |
| | | |
| | | // 5. è°ç¨åºåºæ¥å£ |
| | | this.http |
| | | .post("api/Task/GenerateOutboundTasks", requestParams, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return ElMessage.error(x.message); |
| | | |
| | | ElMessage.success("æä½æå"); |
| | | this.showDetialBox = false; // å
³é详æ
æ¡ |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); // éç¥ç¶ç»ä»¶å·æ° |
| | | }); |
| | | // å
³éå¼¹çª |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error('请æ±å¤±è´¥ï¼è¯·ç¨åéè¯'); |
| | | }); |
| | | }, |
| | | style: { |
| | | borderRadius: '4px', |
| | | padding: '8px 20px' |
| | | } |
| | | }, 'ç¡®å®åºåº') |
| | | ]) |
| | | ]) |
| | | }); |
| | | |
| | | // ç»å®appä¸ä¸æï¼ç¡®ä¿Elç»ä»¶æ£å¸¸å·¥ä½ |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | }, |
| | | outboundbatch() { |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | if (this.selection.length>1) { |
| | | return this.$message.error("åªè½éæ©ä¸æ¡åæ®æç»è¿è¡åæ¹åºåº"); |
| | | } |
| | | const platformOptions = [{label:'ç«å°2',value:'2-1'},{label:'ç«å°3',value:'3-1'}]; |
| | | const mountNode = document.createElement('div'); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | // 2. è¡¨åæ°æ®ï¼é»è®¤éä¸ç«å°3ï¼æ°å¢å°æ°åæ®µï¼ |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value, // é»è®¤ç»å®ãç«å°3ãçvalue |
| | | outboundDecimal: '' // æ°å¢ï¼å°æ°è¾å
¥æ¡å段 |
| | | }); |
| | | |
| | | // 3. 卿å建弹çªç»ä»¶ |
| | | const vnode = createVNode(ElDialog, { |
| | | title: 'åºåºæä½ - éæ©åºåºç«å°', |
| | | width: '500px', |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | 'onUpdate:modelValue': (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | style: { |
| | | padding: '20px 0', |
| | | borderRadius: '8px' |
| | | } |
| | | }, { |
| | | default: () => h(ElForm, { |
| | | model: formData, |
| | | rules: { |
| | | selectedPlatform: [ |
| | | { required: true, message: 'è¯·éæ©åºåºç«å°', trigger: 'change' } |
| | | ], |
| | | // æ°å¢ï¼å°æ°å段éªè¯è§åï¼å¿
å¡« + ææå°æ°æ ¼å¼ï¼ |
| | | outboundDecimal: [ |
| | | { required: true, message: '请è¾å
¥å°æ°æ°å¼', trigger: 'blur' }, |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | // éªè¯è§åï¼æ£æ°ãæ¯æå°æ°ç¹åæå¤2ä½ï¼å¯æ ¹æ®éæ±è°æ´å°æ°ä½æ°ï¼ |
| | | const decimalReg = /^(([1-9]\d*)|0)(\.\d{1,2})?$/; |
| | | if (value && !decimalReg.test(value)) { |
| | | callback(new Error('请è¾å
¥ææçå°æ°ï¼æ£æ°ï¼æå¤2ä½å°æ°ï¼')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | ref: 'outboundForm', |
| | | labelWidth: '100px', |
| | | style: { |
| | | padding: '0 30px' |
| | | } |
| | | }, [ |
| | | // åºåºç«å°éæ©é¡¹ï¼æ ¸å¿è¡¨åé¡¹ï¼ |
| | | h(ElFormItem, { |
| | | label: 'åºåºç«å°', |
| | | prop: 'selectedPlatform', |
| | | style: { |
| | | marginBottom: '24px' |
| | | } |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: 'è¯·éæ©åºåºç«å°ï¼3-12ï¼', |
| | | modelValue: formData.selectedPlatform, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.selectedPlatform = val; |
| | | }, |
| | | style: { |
| | | width: '100%', |
| | | height: '40px', |
| | | borderRadius: '4px', |
| | | borderColor: '#dcdfe6' |
| | | } |
| | | }, platformOptions.map(platform => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )) |
| | | ]), |
| | | // æ°å¢ï¼å°æ°è¾å
¥æ¡è¡¨å项 |
| | | h(ElFormItem, { |
| | | label: 'åºåºæ°', // 坿 ¹æ®ä¸å¡éæ±ä¿®æ¹æ ç¾åï¼å¦âåºåºæ°éââééâçï¼ |
| | | prop: 'outboundDecimal', |
| | | style: { |
| | | marginBottom: '24px' |
| | | } |
| | | }, [ |
| | | h(ElInput, { |
| | | type: 'number', // æ°åç±»åï¼åçæ¯æå°æ°è¾å
¥ |
| | | placeholder: '请è¾å
¥å°æ°æ°å¼ï¼æå¤2ä½å°æ°ï¼', |
| | | modelValue: formData.outboundDecimal, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.outboundDecimal = val; |
| | | }, |
| | | style: { |
| | | width: '100%', |
| | | height: '40px', |
| | | borderRadius: '4px', |
| | | borderColor: '#dcdfe6' |
| | | }, |
| | | step: '0.01', // æ¥é¿0.01ï¼ç¹å»ä¸ä¸ç®å¤´æ¶æ0.01å¢å |
| | | precision: 2, // éå¶æå¤è¾å
¥2ä½å°æ°ï¼Element Plus屿§ï¼ |
| | | min: 0.01, // å¯éï¼éå¶æå°å¼ä¸º0.01ï¼é¿å
è¾å
¥0æè´æ° |
| | | }) |
| | | ]), |
| | | // åºé¨æé®åº |
| | | h('div', { |
| | | style: { |
| | | textAlign: 'right', |
| | | marginTop: '8px', |
| | | paddingRight: '4px' |
| | | } |
| | | }, [ |
| | | h(ElButton, { |
| | | type: 'text', |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info('åæ¶åæ¹åºåºæä½'); |
| | | }, |
| | | style: { |
| | | marginRight: '8px', |
| | | color: '#606266' |
| | | } |
| | | }, 'åæ¶'), |
| | | h(ElButton, { |
| | | type: 'primary', |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.outboundForm; |
| | | try { |
| | | // è¡¨åæ ¡éªï¼ä¼åæ¶æ ¡éªåºåºç«å°åå°æ°åæ®µï¼ |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | console.log(this.selection); |
| | | // 4. æé 请æ±åæ°ï¼æ°å¢å°æ°åæ®µï¼ |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | orderDetailId: keys[0], // åæ¹åºåºä»
æ¯æåæ¡æç» |
| | | outboundPlatform: formData.selectedPlatform, // åºåºç«å° |
| | | batchQuantity: formData.outboundDecimal // æ°å¢ï¼å°æ°åæ®µä¼ ç»å端 |
| | | }; |
| | | |
| | | // 5. è°ç¨åºåºæ¥å£ |
| | | this.http |
| | | .post("api/Task/GenerateOutboundBatchTasks", requestParams, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return ElMessage.error(x.message); |
| | | |
| | | ElMessage.success("æä½æå"); |
| | | this.showDetialBox = false; // å
³é详æ
æ¡ |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); // éç¥ç¶ç»ä»¶å·æ° |
| | | }); |
| | | // å
³éå¼¹çª |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error('请æ±å¤±è´¥ï¼è¯·ç¨åéè¯'); |
| | | }); |
| | | }, |
| | | style: { |
| | | borderRadius: '4px', |
| | | padding: '8px 20px' |
| | | } |
| | | }, 'ç¡®å®åæ¹åºåº') |
| | | ]) |
| | | ]) |
| | | }); |
| | | |
| | | // ç»å®appä¸ä¸æï¼ç¡®ä¿Elç»ä»¶æ£å¸¸å·¥ä½ |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | }, |
| | | |
| | | |
| | | setCurrent(row) { |
| | | this.$refs.singleTable.setCurrentRow(row); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.currentRow = val; |
| | | }, |
| | | getButtonEnable(propName, row) { |
| | | if (propName == "assignStock") { |
| | | if ( |
| | | row.orderDetailStatus !== 0 && |
| | | row.orderDetailStatus !== 60 && |
| | | row.orderDetailStatus !== 70 && |
| | | row.orderDetailStatus !== 80 |
| | | ) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | return false; |
| | | }, |
| | | parentCall(fun) { |
| | | if (typeof fun != "function") { |
| | | return console.log("æ©å±ç»ä»¶éè¦ä¼ å
¥ä¸ä¸ªåè°æ¹æ³æè½è·åç¶çº§Vue对象"); |
| | | } |
| | | fun(this); |
| | | }, |
| | | handleRowClick(row) { |
| | | this.$refs.singleTable.toggleRowSelection(row); |
| | | }, |
| | | handleSelectionChange(val) { |
| | | this.selection = val; |
| | | }, |
| | | getDictionaryData() { |
| | | if (this.dictionaryList) { |
| | | return; |
| | | } |
| | | var param = []; |
| | | this.tableColumns.forEach((x) => { |
| | | if (x.type == "tag" && x.bindKey != "") { |
| | | param.push(x.bindKey); |
| | | } |
| | | }); |
| | | this.http |
| | | .post("api/Sys_Dictionary/GetVueDictionary", param, "æ¥è¯¢ä¸") |
| | | .then((x) => { |
| | | if (x.length > 0) { |
| | | this.dictionaryList = x; |
| | | } |
| | | }); |
| | | }, |
| | | getDictionary(row, column) { |
| | | if (this.dictionaryList) { |
| | | var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey); |
| | | if (item) { |
| | | var dicItem = item.data.find((x) => x.key == row[column.prop]); |
| | | console.log(dicItem); |
| | | if (dicItem) { |
| | | return dicItem.value; |
| | | } else { |
| | | return row[column.prop]; |
| | | } |
| | | } else { |
| | | return row[column.prop]; |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .text-button { |
| | | border: 0px; |
| | | } |
| | | </style> |
| | | |
| | | <style> |
| | | .text-button:hover { |
| | | background-color: #f0f9eb !important; |
| | | } |
| | | |
| | | .el-table .warning-row { |
| | | background: oldlace; |
| | | } |
| | | |
| | | .box-table .el-table tbody tr:hover > td { |
| | | background-color: #d8e0d4 !important; |
| | | /* color: #ffffff; */ |
| | | } |
| | | |
| | | .box-table .el-table tbody tr.current-row > td { |
| | | background-color: #f0f9eb !important; |
| | | /* color: #ffffff; */ |
| | | } |
| | | |
| | | .el-table .success-row { |
| | | background: #f0f9eb; |
| | | } |
| | | |
| | | .box-table .el-table { |
| | | border: 1px solid #ebeef5; |
| | | } |
| | | </style> |
| | |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "overOutQuantity", |
| | | title: "æªææ°é", |
| | | type: "string", |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "unit", |
| | | title: "åä½", |
| | | type: "string", |
| | |
| | | searchBefore(param) { |
| | | //ç颿¥è¯¢å,å¯ä»¥ç»param.wheresæ·»å æ¥è¯¢åæ° |
| | | //è¿åfalseï¼åä¸ä¼æ§è¡æ¥è¯¢ |
| | | |
| | | let wheres = [{ |
| | | 'name': 'orderType', |
| | | 'value': ['0','116'], |
| | | 'displayType': 'text' |
| | | }]; |
| | | |
| | | |
| | | param.wheres.push(...wheres); |
| | | return true; |
| | | |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: '', |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | console.log(this) |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | | //妿è¦é
ç½®æç»è¡¨,卿¤æ¹æ³æä½ |
| | | //this.detailOptions.columns.forEach(column=>{ }); |
| | | }, |
| | | searchBefore(param) { |
| | | //ç颿¥è¯¢å,å¯ä»¥ç»param.wheresæ·»å æ¥è¯¢åæ° |
| | | //è¿åfalseï¼åä¸ä¼æ§è¡æ¥è¯¢ |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| | | //æ¥è¯¢åï¼resultè¿åçæ¥è¯¢æ°æ®,å¯ä»¥å¨æ¾ç¤ºå°è¡¨æ ¼åå¤çè¡¨æ ¼çå¼ |
| | | return true; |
| | | }, |
| | | addBefore(formData) { |
| | | //æ°å»ºä¿ååformData为对象ï¼å
æ¬æç»è¡¨ï¼å¯ä»¥ç»ç»è¡¨å设置å¼ï¼èªå·±è¾åºçformDataçå¼ |
| | | return true; |
| | | }, |
| | | updateBefore(formData) { |
| | | //ç¼è¾ä¿ååformData为对象ï¼å
æ¬æç»è¡¨ãå é¤è¡çId |
| | | return true; |
| | | }, |
| | | rowClick({ row, column, event }) { |
| | | //æ¥è¯¢çé¢ç¹å»è¡äºä»¶ |
| | | this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | } |
| | | } |
| | | }; |
| | | export default extension; |
| | | |
| | |
| | | path: '/reCheckOrder', |
| | | name: 'Dt_ReCheckOrder', |
| | | component: () => import('@/views/check/ReCheckOrder.vue') |
| | | }, |
| | | { |
| | | path: '/stockInfoDetailByMaterielSum', |
| | | name: 'Dt_StockInfoDetailss', |
| | | component: () => import('@/views/stock/stockInfoDetailByMaterielSum.vue') |
| | | } |
| | | ] |
| | | |
| | |
| | | const searchFormFields = ref({ |
| | | inboundOrderNo: "", |
| | | upperOrderNo: "", |
| | | orderType: "0", |
| | | orderType: "", |
| | | orderStatus: "", |
| | | createType: "", |
| | | creater: "", |
| | |
| | | bind: { key: "inboundState", data: [] }, |
| | | }, |
| | | { |
| | | field: "orderStatistics", |
| | | title: "åæ®ç©æç»è®¡", |
| | | type: "string", |
| | | width: 230, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createType", |
| | | title: "å建æ¹å¼", |
| | | type: "string", |
| | |
| | | }, |
| | | |
| | | openSplitDialog() { |
| | | console.log('å¼å§æå¼æå
å¼¹çª'); |
| | | |
| | | if (this.isOpeningDialog) { |
| | | console.log('æ£å¨æå¼å¼¹çªï¼è·³è¿'); |
| | | return; |
| | | } |
| | | console.log('ç´§æ¥ä¿®å¤çï¼æå¼æå
å¼¹çª'); |
| | | |
| | | if (!this.scanData.palletCode) { |
| | | this.$message.warning('请å
æ«ææçç '); |
| | | return; |
| | | } |
| | | |
| | | this.isOpeningDialog = true; |
| | | // 1. å
³éææVueå¼¹çª |
| | | this.closeAllDialogs(); |
| | | |
| | | // 2. 强å¶ä»DOMä¸ç§»é¤ææå¼¹çª |
| | | setTimeout(() => { |
| | | const dialogs = document.querySelectorAll('.custom-dialog-overlay'); |
| | | dialogs.forEach(dialog => { |
| | | if (dialog.parentNode) { |
| | | dialog.parentNode.removeChild(dialog); |
| | | } |
| | | }); |
| | | |
| | | // 妿已ç»å卿å¨å¼¹çªï¼å
ç§»é¤ |
| | | if (this.manualDialog && this.manualDialog.parentNode) { |
| | | this.manualDialog.parentNode.removeChild(this.manualDialog); |
| | | } |
| | | |
| | | // 3. çå¾
ä¸å¸§ |
| | | requestAnimationFrame(() => { |
| | | // 4. ç´æ¥å建æ°å¼¹çªï¼ä¸ä¾èµVueçååºå¼ç³»ç» |
| | | this.createManualSplitDialog(); |
| | | }); |
| | | }, 10); |
| | | }, |
| | | |
| | | // å建æå¨æå
å¼¹çª |
| | | createManualSplitDialog() { |
| | | const newDialog = document.createElement('div'); |
| | | newDialog.className = 'custom-dialog-overlay emergency-fix'; |
| | | |
| | | // çæéæºIDç¨äºäºä»¶ç»å® |
| | | const dialogId = 'manual-dialog-' + Date.now(); |
| | | newDialog.id = dialogId; |
| | | |
| | | // åå¨å¼ç¨ |
| | | this.manualDialog = newDialog; |
| | | |
| | | // å¼¹çªå
容 |
| | | newDialog.innerHTML = ` |
| | | <div class="custom-dialog-wrapper"> |
| | | <div class="custom-dialog" style="width: 500px;"> |
| | | <div class="custom-dialog-header"> |
| | | <h3 style="margin: 0; color: #303133;">æå
æä½</h3> |
| | | <button class="close-button" onclick="document.getElementById('${dialogId}').remove()" style=" |
| | | font-size: 18px; |
| | | color: #909399; |
| | | padding: 0; |
| | | width: 24px; |
| | | height: 24px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | background: none; |
| | | border: none; |
| | | cursor: pointer; |
| | | ">Ã</button> |
| | | </div> |
| | | <div class="custom-dialog-body" style="padding: 20px;"> |
| | | <div style="margin-bottom: 15px;"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 5px;"> |
| | | <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">订åç¼å·:</span> |
| | | <input type="text" value="${this.scanData.orderNo}" disabled style=" |
| | | flex: 1; |
| | | padding: 8px 12px; |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 4px; |
| | | background-color: #f5f7fa; |
| | | color: #909399; |
| | | "> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin-bottom: 15px;"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 5px;"> |
| | | <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">æçç¼å·:</span> |
| | | <input type="text" value="${this.scanData.palletCode}" disabled style=" |
| | | flex: 1; |
| | | padding: 8px 12px; |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 4px; |
| | | background-color: #f5f7fa; |
| | | color: #909399; |
| | | "> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin-bottom: 15px;"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 5px;"> |
| | | <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">åæ¡ç :</span> |
| | | <div style="flex: 1; display: flex; align-items: center; gap: 10px;"> |
| | | <input type="text" id="${dialogId}-barcode" placeholder="æ«æåæ¡ç " style=" |
| | | flex: 1; |
| | | padding: 8px 12px; |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 4px; |
| | | "> |
| | | <button id="${dialogId}-viewChain" style=" |
| | | padding: 8px 16px; |
| | | background: #409eff; |
| | | color: white; |
| | | border: none; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | white-space: nowrap; |
| | | ">æ¥çæå
é¾</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin-bottom: 15px;"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 5px;"> |
| | | <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">ç©æç¼ç :</span> |
| | | <input type="text" id="${dialogId}-materiel" disabled style=" |
| | | flex: 1; |
| | | padding: 8px 12px; |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 4px; |
| | | background-color: #f5f7fa; |
| | | color: #909399; |
| | | "> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin-bottom: 15px;"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 5px;"> |
| | | <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">å©ä½æ°é:</span> |
| | | <input type="text" id="${dialogId}-remain" disabled style=" |
| | | flex: 1; |
| | | padding: 8px 12px; |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 4px; |
| | | background-color: #f5f7fa; |
| | | color: #909399; |
| | | "> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin-bottom: 15px;"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 5px;"> |
| | | <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">æå
æ°é:</span> |
| | | <div style="flex: 1;"> |
| | | <input type="number" id="${dialogId}-splitQty" value="1" min="0.01" step="0.01" style=" |
| | | width: 100%; |
| | | padding: 8px 12px; |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 4px; |
| | | "> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="custom-dialog-footer" style=" |
| | | padding: 10px 20px 20px; |
| | | text-align: right; |
| | | border-top: 1px solid #ebeef5; |
| | | "> |
| | | <button id="${dialogId}-cancel" style=" |
| | | padding: 9px 15px; |
| | | background: white; |
| | | color: #606266; |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | margin-right: 10px; |
| | | ">åæ¶</button> |
| | | <button id="${dialogId}-confirm" style=" |
| | | padding: 9px 15px; |
| | | background: #409eff; |
| | | color: white; |
| | | border: none; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | ">确认æå
</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | `; |
| | | |
| | | // æ·»å æ ·å¼ |
| | | newDialog.style.cssText = ` |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: rgba(0,0,0,0.5); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | z-index: 999999; |
| | | `; |
| | | |
| | | // å¼¹çªå®¹å¨æ ·å¼ |
| | | const wrapper = newDialog.querySelector('.custom-dialog-wrapper'); |
| | | if (wrapper) { |
| | | wrapper.style.position = 'relative'; |
| | | wrapper.style.zIndex = '1000000'; |
| | | } |
| | | |
| | | // å¼¹çªå
å®¹æ ·å¼ |
| | | const dialog = newDialog.querySelector('.custom-dialog'); |
| | | if (dialog) { |
| | | dialog.style.background = 'white'; |
| | | dialog.style.borderRadius = '4px'; |
| | | dialog.style.maxWidth = '90vw'; |
| | | dialog.style.maxHeight = '90vh'; |
| | | dialog.style.boxShadow = '0 2px 12px 0 rgba(0, 0, 0, 0.1)'; |
| | | dialog.style.overflow = 'auto'; |
| | | } |
| | | |
| | | // å¼¹çªå¤´é¨æ ·å¼ |
| | | const header = newDialog.querySelector('.custom-dialog-header'); |
| | | if (header) { |
| | | header.style.display = 'flex'; |
| | | header.style.justifyContent = 'space-between'; |
| | | header.style.alignItems = 'center'; |
| | | header.style.padding = '20px 20px 10px'; |
| | | header.style.borderBottom = '1px solid #ebeef5'; |
| | | } |
| | | |
| | | document.body.appendChild(newDialog); |
| | | console.log('ç´§æ¥å¼¹çªå·²å建'); |
| | | |
| | | // ç»å®äºä»¶ |
| | | this.bindManualDialogEvents(dialogId); |
| | | |
| | | // èªå¨èç¦å°æ¡ç è¾å
¥æ¡ |
| | | setTimeout(() => { |
| | | const barcodeInput = document.getElementById(`${dialogId}-barcode`); |
| | | if (barcodeInput) { |
| | | barcodeInput.focus(); |
| | | // æ·»å å车é®çå¬ |
| | | barcodeInput.addEventListener('keyup', (event) => { |
| | | if (event.key === 'Enter') { |
| | | this.onManualSplitBarcodeScan(dialogId); |
| | | } |
| | | }); |
| | | } |
| | | }, 100); |
| | | }, |
| | | |
| | | // ç»å®æå¨å¼¹çªäºä»¶ |
| | | bindManualDialogEvents(dialogId) { |
| | | const vm = this; // ä¿åVueå®ä¾å¼ç¨ |
| | | |
| | | // æ¥çæå
é¾æé® |
| | | const viewChainBtn = document.getElementById(`${dialogId}-viewChain`); |
| | | if (viewChainBtn) { |
| | | viewChainBtn.onclick = () => { |
| | | const barcodeInput = document.getElementById(`${dialogId}-barcode`); |
| | | if (barcodeInput && barcodeInput.value.trim()) { |
| | | vm.viewSplitChainFromManualDialog(barcodeInput.value.trim(), dialogId); |
| | | } else { |
| | | ElMessage.warning('请å
è¾å
¥æ¡ç '); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | // åæ¶æé® |
| | | const cancelBtn = document.getElementById(`${dialogId}-cancel`); |
| | | if (cancelBtn) { |
| | | cancelBtn.onclick = () => { |
| | | const dialog = document.getElementById(dialogId); |
| | | if (dialog && dialog.parentNode) { |
| | | dialog.parentNode.removeChild(dialog); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | // 确认æå
æé® |
| | | const confirmBtn = document.getElementById(`${dialogId}-confirm`); |
| | | if (confirmBtn) { |
| | | confirmBtn.onclick = () => { |
| | | vm.handleManualSplitPackage(dialogId); |
| | | }; |
| | | } |
| | | |
| | | // æ¡ç è¾å
¥æ¡ååäºä»¶ |
| | | const barcodeInput = document.getElementById(`${dialogId}-barcode`); |
| | | if (barcodeInput) { |
| | | // 鲿å¤ç |
| | | let timeout; |
| | | barcodeInput.addEventListener('input', () => { |
| | | clearTimeout(timeout); |
| | | timeout = setTimeout(() => { |
| | | if (barcodeInput.value.trim()) { |
| | | vm.onManualSplitBarcodeScan(dialogId); |
| | | } |
| | | }, 500); |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // æå¨å¼¹çªçæ¡ç æ«æå¤ç |
| | | async onManualSplitBarcodeScan(dialogId) { |
| | | const barcodeInput = document.getElementById(`${dialogId}-barcode`); |
| | | if (!barcodeInput || !barcodeInput.value.trim()) return; |
| | | |
| | | const barcode = barcodeInput.value.trim(); |
| | | |
| | | try { |
| | | // æ¹æ³1: ä½¿ç¨ setTimeout ç¡®ä¿å¼æ¥æ§è¡ |
| | | setTimeout(() => { |
| | | console.log('æ§è¡å¼¹çªæå¼é»è¾'); |
| | | const res = await http.post('/api/OutboundBatchPicking/split-package-info', { |
| | | orderNo: this.scanData.orderNo, |
| | | palletCode: this.scanData.palletCode, |
| | | barcode: barcode |
| | | }); |
| | | |
| | | if (res.status) { |
| | | // æ´æ°ç©æç¼ç |
| | | const materielInput = document.getElementById(`${dialogId}-materiel`); |
| | | if (materielInput) { |
| | | materielInput.value = res.data.materielCode || ''; |
| | | } |
| | | |
| | | // å
å
³éææå¼¹çª |
| | | this.closeAllDialogsImmediately(); |
| | | // æ´æ°å©ä½æ°é |
| | | const remainInput = document.getElementById(`${dialogId}-remain`); |
| | | if (remainInput) { |
| | | remainInput.value = res.data.remainQuantity || 0; |
| | | } |
| | | |
| | | // ä½¿ç¨ requestAnimationFrame ç¡®ä¿å¨ä¸ä¸å¸§æå¼ |
| | | requestAnimationFrame(() => { |
| | | console.log('设置弹çªç¶æä¸º true'); |
| | | |
| | | // é置表å |
| | | this.resetSplitForm(); |
| | | this.splitForm.orderNo = this.scanData.orderNo; |
| | | this.splitForm.palletCode = this.scanData.palletCode; |
| | | |
| | | // å
³é®ï¼ç´æ¥è®¾ç½®å¼¹çªç¶æ |
| | | this.showCustomSplitDialog = true; |
| | | |
| | | console.log('å¼¹çªç¶æå·²è®¾ç½®ï¼çå¾
DOMæ´æ°'); |
| | | |
| | | // ä½¿ç¨ nextTick ç¡®ä¿DOMæ´æ°å®æ |
| | | this.$nextTick(() => { |
| | | console.log('DOMæ´æ°å®æï¼å¼¹çªåºè¯¥æ¾ç¤ºäº'); |
| | | this.isOpeningDialog = false; |
| | | |
| | | // å°è¯èç¦å°è¾å
¥æ¡ |
| | | setTimeout(() => { |
| | | const input = this.$refs.splitFormRef?.$el?.querySelector('input'); |
| | | if (input) { |
| | | input.focus(); |
| | | console.log('è¾å
¥æ¡å·²èç¦'); |
| | | } |
| | | }, 100); |
| | | }); |
| | | }); |
| | | }, 0); |
| | | |
| | | // æ´æ°æå
æ°éï¼é»è®¤ä¸º1ï¼ä¸è¶
è¿å©ä½æ°éï¼ |
| | | const splitQtyInput = document.getElementById(`${dialogId}-splitQty`); |
| | | if (splitQtyInput) { |
| | | const maxQty = res.data.remainQuantity || 0; |
| | | splitQtyInput.max = maxQty; |
| | | const currentVal = parseFloat(splitQtyInput.value) || 1; |
| | | if (currentVal > maxQty) { |
| | | splitQtyInput.value = Math.min(1, maxQty); |
| | | } |
| | | } |
| | | } else { |
| | | ElMessage.error(res.message || 'è·åæå
ä¿¡æ¯å¤±è´¥'); |
| | | } |
| | | } catch (error) { |
| | | console.error('æå¼æå
å¼¹çªåºé:', error); |
| | | this.isOpeningDialog = false; |
| | | console.error('è·åæå
ä¿¡æ¯å¤±è´¥:', error); |
| | | ElMessage.error('è·åæå
ä¿¡æ¯å¤±è´¥'); |
| | | } |
| | | }, |
| | | |
| | | // 仿å¨å¼¹çªæ¥çæå
é¾ |
| | | viewSplitChainFromManualDialog(barcode, dialogId) { |
| | | // å
å
³éæå¨å¼¹çª |
| | | const dialog = document.getElementById(dialogId); |
| | | if (dialog && dialog.parentNode) { |
| | | dialog.parentNode.removeChild(dialog); |
| | | } |
| | | |
| | | // å»¶è¿ä¸ä¸ï¼ç¶åæå¼Vueçæå
é¾å¼¹çª |
| | | setTimeout(() => { |
| | | this.viewSplitChain(barcode); |
| | | }, 50); |
| | | }, |
| | | |
| | | // å¤çæå¨å¼¹çªçæå
æä½ |
| | | async handleManualSplitPackage(dialogId) { |
| | | const barcodeInput = document.getElementById(`${dialogId}-barcode`); |
| | | const splitQtyInput = document.getElementById(`${dialogId}-splitQty`); |
| | | |
| | | if (!barcodeInput || !barcodeInput.value.trim()) { |
| | | ElMessage.warning('请è¾å
¥åæ¡ç '); |
| | | return; |
| | | } |
| | | |
| | | if (!splitQtyInput || !splitQtyInput.value || parseFloat(splitQtyInput.value) <= 0) { |
| | | ElMessage.warning('请è¾å
¥ææçæå
æ°é'); |
| | | return; |
| | | } |
| | | |
| | | const originalBarcode = barcodeInput.value.trim(); |
| | | const splitQuantity = parseFloat(splitQtyInput.value); |
| | | |
| | | try { |
| | | // æ¾ç¤ºå è½½ç¶æ |
| | | const confirmBtn = document.getElementById(`${dialogId}-confirm`); |
| | | if (confirmBtn) { |
| | | confirmBtn.disabled = true; |
| | | confirmBtn.textContent = 'å¤çä¸...'; |
| | | } |
| | | |
| | | const res = await http.post('/api/OutboundBatchPicking/split-package', { |
| | | orderNo: this.scanData.orderNo, |
| | | palletCode: this.scanData.palletCode, |
| | | originalBarcode: originalBarcode, |
| | | splitQuantity: splitQuantity |
| | | }); |
| | | |
| | | if (res.status) { |
| | | ElMessage.success('æå
æå'); |
| | | |
| | | // å
³éæå¨å¼¹çª |
| | | const dialog = document.getElementById(dialogId); |
| | | if (dialog && dialog.parentNode) { |
| | | dialog.parentNode.removeChild(dialog); |
| | | } |
| | | |
| | | // éæ°å è½½æ°æ® |
| | | await this.loadPalletData(); |
| | | } else { |
| | | ElMessage.error(res.message || 'æå
失败'); |
| | | |
| | | // æ¢å¤æé®ç¶æ |
| | | if (confirmBtn) { |
| | | confirmBtn.disabled = false; |
| | | confirmBtn.textContent = '确认æå
'; |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('æå
失败:', error); |
| | | ElMessage.error('æå
失败'); |
| | | |
| | | // æ¢å¤æé®ç¶æ |
| | | const confirmBtn = document.getElementById(`${dialogId}-confirm`); |
| | | if (confirmBtn) { |
| | | confirmBtn.disabled = false; |
| | | confirmBtn.textContent = '确认æå
'; |
| | | } |
| | | } |
| | | }, |
| | | closeAllDialogsImmediately() { |
| | |
| | | closeAllDialogs() { |
| | | this.activeDialog = null; |
| | | // ç¡®ä¿ææå¼¹çªç¶æé½è¢«éç½® |
| | | // å
³éVueå¼¹çª |
| | | this.showCustomSplitDialog = false; |
| | | this.showRevertSplitDialog = false; |
| | | this.showBatchReturnDialog = false; |
| | | this.showEmptyPalletDialog = false; |
| | | this.showSplitChainDialog = false; |
| | | |
| | | // å
³éæå¨å¼¹çª |
| | | if (this.manualDialog && this.manualDialog.parentNode) { |
| | | this.manualDialog.parentNode.removeChild(this.manualDialog); |
| | | this.manualDialog = null; |
| | | } |
| | | |
| | | // ç§»é¤ææç´§æ¥å¼¹çª |
| | | const emergencyDialogs = document.querySelectorAll('.emergency-fix'); |
| | | emergencyDialogs.forEach(dialog => { |
| | | if (dialog.parentNode) { |
| | | dialog.parentNode.removeChild(dialog); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // ååºç¸å
³æ¹æ³ |
| | |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | /* åæçæ ·å¼ä¿æä¸å */ |
| | | .OutboundPicking-container { |
| | | padding: 20px; |
| | | } |
| | | |
| | | .scanner-form { |
| | | display: flex; |
| | | gap: 10px; |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | | .scanner-form .el-input { |
| | | width: 200px; |
| | | } |
| | | |
| | | .summary-info { |
| | | display: flex; |
| | | gap: 20px; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | | .table-actions { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 10px; |
| | | padding: 0 10px; |
| | | } |
| | | |
| | | .selection-count { |
| | | font-size: 12px; |
| | | color: #909399; |
| | | } |
| | | |
| | | /* åæçèªå®ä¹å¼¹çªæ ·å¼ */ |
| | | .custom-dialog-overlay { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background-color: rgba(0, 0, 0, 0.5); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | z-index: 2000; |
| | | } |
| | | |
| | | .custom-dialog-wrapper { |
| | | position: relative; |
| | | z-index: 2001; |
| | | } |
| | | |
| | | .custom-dialog { |
| | | background: white; |
| | | border-radius: 4px; |
| | | width: 500px; |
| | | max-width: 90vw; |
| | | max-height: 90vh; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | overflow: auto; |
| | | } |
| | | |
| | | .custom-dialog-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 20px 20px 10px; |
| | | border-bottom: 1px solid #ebeef5; |
| | | } |
| | | |
| | | .custom-dialog-header h3 { |
| | | margin: 0; |
| | | color: #303133; |
| | | } |
| | | |
| | | .close-button { |
| | | font-size: 18px; |
| | | color: #909399; |
| | | padding: 0; |
| | | width: 24px; |
| | | height: 24px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .close-button:hover { |
| | | color: #409EFF; |
| | | background-color: transparent; |
| | | } |
| | | |
| | | .custom-dialog-body { |
| | | padding: 20px; |
| | | } |
| | | |
| | | .custom-dialog-footer { |
| | | padding: 10px 20px 20px; |
| | | text-align: right; |
| | | border-top: 1px solid #ebeef5; |
| | | } |
| | | |
| | | .custom-dialog-footer .el-button { |
| | | margin-left: 10px; |
| | | } |
| | | |
| | | @media (max-width: 768px) { |
| | | .custom-dialog { |
| | | width: 95vw; |
| | | margin: 10px; |
| | | } |
| | | |
| | | .scanner-form { |
| | | flex-direction: column; |
| | | align-items: stretch; |
| | | } |
| | | |
| | | .scanner-form .el-input { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | /* æ°å¢ï¼æå¨å¼¹çªçæé®æ¬åææ */ |
| | | :deep(button) { |
| | | transition: all 0.3s; |
| | | } |
| | | |
| | | :deep(button:hover) { |
| | | opacity: 0.8; |
| | | } |
| | | |
| | | :deep(button:active) { |
| | | opacity: 0.6; |
| | | } |
| | | </style> |
| | |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | link: true, |
| | | }, |
| | | { |
| | | field: "upperOrderNo", |
| | |
| | | title: "é¨é¨åç§°", |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "operator", |
| | | title: "æä½äºº", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | width: 90, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "supplyCode", |
| | |
| | | width: 90, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "orderQuantity", |
| | |
| | | width: 90, |
| | | align: "left", |
| | | edit: { type: "number" }, |
| | | readonly:true |
| | | }, |
| | | { |
| | | field: "rowNo", |
| | |
| | | width: 90, |
| | | align: "left", |
| | | edit: { type: "number" }, |
| | | readonly:true |
| | | }, |
| | | { |
| | | field: "lockQuantity", |
| | |
| | | align: "left", |
| | | edit: { type: "select" }, |
| | | bind: { key: "orderDetailStatusEnum", data: [] }, |
| | | required: true, |
| | | readonly:true |
| | | }, |
| | | { |
| | | field: "creater", |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions" |
| | | :table="table" :extend="extend"> |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/stock/stockInfoDetailByMaterielSum.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "åºåä¿¡æ¯æç»", |
| | | name: "stockInfoDetail", |
| | | url: "/StockInfoDetail/", |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({ |
| | | deviceCode: "", |
| | | deviceName: "", |
| | | deviceType: "", |
| | | deviceStatus: "", |
| | | deviceIp: "", |
| | | devicePort: "", |
| | | devicePlcType: "", |
| | | deviceRemark: "", |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "ç©æç¼å·", |
| | | required: true, |
| | | field: "materielCode", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "åæ®ç¼å·", |
| | | required: true, |
| | | field: "materielName", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "æ¹æ¬¡å·", |
| | | required: true, |
| | | field: "orderNo", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "åºåå·", |
| | | required: true, |
| | | field: "serialNumber", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | materielCode: "", |
| | | materielName: "", |
| | | orderNo: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "ç©æç¼å·", field: "materielCode" ,type:'like'}, |
| | | { title: "ç©æåç§°", field: "materielName" ,type:'like'}, |
| | | { title: "åæ®ç¼å·", field: "orderNo" ,type:'like'}, |
| | | { title: "æçå·", field: "palletCode" ,type:'like'}, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stockId", |
| | | title: "åºåä¿¡æ¯ä¸»é®", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielName", |
| | | title: "ç©æåç§°", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "serialNumber", |
| | | title: "åºåå·", |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "supplyCode", |
| | | title: "ä¾åºåç¼å·", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "warehouseCode", |
| | | title: "ä»åºå·", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "barcode", |
| | | title: "æ¡ç ", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stockQuantity", |
| | | title: "åºåæ°é", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "outboundQuantity", |
| | | title: "åºåºæ°é", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "status", |
| | | title: "åºåæç»ç¶æ", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "stockStatusEmun", data: [] }, |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "", |
| | | columns: [], |
| | | sortName: "", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | |
| | | { |
| | | try |
| | | { |
| | | var request = new TokenRequest { appId = "BG_SYSTEM", secretKey = "7e9239c1e132462a9cf03bfa342a044aMTcxODE5MzgxODI4Mw" }; |
| | | //erp æµè¯ç¯å¢ |
| | | //var request = new TokenRequest { appId = "BG_SYSTEM", secretKey = "7e9239c1e132462a9cf03bfa342a044aMTcxODE5MzgxODI4Mw" }; |
| | | ////erp æ£å¼ç¯å¢ |
| | | var request = new TokenRequest { appId = "BG_SYSTEM", secretKey = "9a3d0b5a37Bfc6dAM4b34ODb8ebDOSb937106d1b19DS29098" }; |
| | | var response = await PostAsync<TokenRequest, TokenResponse>("auth/getAccessToken", request, includeToken: false); |
| | | var _token = response?.data?.access_token; |
| | | return _token ?? ""; |
| | |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Model.Models.Outbound; |
| | | |
| | | namespace WIDESEA_BasicService |
| | | { |
| | |
| | | private readonly IOutboundOrderService _outboundOrderService; |
| | | private readonly IOutboundOrderDetailService _outboundOrderDetailService; |
| | | private readonly IOutStockLockInfoService _outStockLockInfoService; |
| | | private readonly IRepository<Dt_InterfaceLog> _interfacelogRepository; |
| | | |
| | | // åå¨èµæºIDåå
¶å¯¹åºçé对象ãä½¿ç¨ ConcurrentDictionary ç¡®ä¿å¯¹åå
¸æä½æ¬èº«ç线ç¨å®å
¨ã |
| | | private static readonly ConcurrentDictionary<string, object> _resourceLocks = new ConcurrentDictionary<string, object>(); |
| | | |
| | | // å
¨å±éæéï¼ç¨äºä¿æ¤ _resourceLocks åå
¸ä¸ GetOrAdd æ TryRemove æ¶çç«äº |
| | | private static readonly object _globalLocker = new object(); |
| | | public InvokeMESService(IHttpClientFactory httpClientFactory, ILogger<InvokeMESService> logger, IRepository<Dt_FeedbackToMes> feedbacktomesRepository, IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_InboundOrder> inboundOrderRepository, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IOutStockLockInfoService outStockLockInfoService, IMaterialUnitService materialUnitService, IRepository<Dt_PickingRecord> pickingRecoreRepository) |
| | | public InvokeMESService(IHttpClientFactory httpClientFactory, ILogger<InvokeMESService> logger, IRepository<Dt_FeedbackToMes> feedbacktomesRepository, IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_InboundOrder> inboundOrderRepository, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IOutStockLockInfoService outStockLockInfoService, IMaterialUnitService materialUnitService, IRepository<Dt_PickingRecord> pickingRecoreRepository, IRepository<Dt_InterfaceLog> interfacelogRepository) |
| | | { |
| | | _httpClientFactory = httpClientFactory; |
| | | _logger = logger; |
| | |
| | | _outStockLockInfoService = outStockLockInfoService; |
| | | _materialUnitService = materialUnitService; |
| | | _pickingRecoreRepository = pickingRecoreRepository; |
| | | _interfacelogRepository = interfacelogRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | public async Task<WebResponseContent> BatchOrderFeedbackToMes(List<string> orderNos, int inout) |
| | | { |
| | | // 1. ãå
å鿢å ã |
| | | if (MemoryLockManager.TryAcquireLock(orderNos[0])) |
| | | { |
| | | try |
| | | { |
| | | if (inout == 1) |
| | | { |
| | | foreach (var orderNo in orderNos) |
| | | try |
| | | { // 1. ãå
å鿢å ã |
| | | //if (MemoryLockManager.TryAcquireLock(orderNos[0])) |
| | | //{ |
| | | |
| | | if (inout == 1) |
| | | { |
| | | try |
| | | foreach (var orderNo in orderNos) |
| | | { |
| | | var stockinfos = _stockInfoRepository.Db.Queryable<Dt_StockInfo>("info").Where(info => info.StockStatus == 6) |
| | | .Where(it => SqlFunc.Subqueryable<Dt_StockInfoDetail>().Where(s => s.StockId == it.Id && s.OrderNo == orderNo).Any()) |
| | | .ToList(); |
| | | var feeds = _feedbacktomesRepository.Db.Queryable<Dt_FeedbackToMes>().Where(x => x.OrderNo == orderNo && x.ReportStatus == 1).Select(o => o.PalletCode).ToList(); |
| | | var unreports = stockinfos.Where(x => !feeds.Contains(x.PalletCode)).ToList(); |
| | | if (unreports != null && !unreports.Any()) |
| | | try |
| | | { |
| | | return WebResponseContent.Instance.Error("没æéè¦åä¼ çæ°æ®"); |
| | | } |
| | | foreach (var item in unreports) |
| | | { |
| | | var lists = _stockInfoDetailRepository.Db.Queryable<Dt_StockInfoDetail>().Where(x => x.StockId == item.Id).ToList(); |
| | | if (lists.Any()) |
| | | var stockinfos = _stockInfoRepository.Db.Queryable<Dt_StockInfo>("info").Where(info => info.StockStatus == 6) |
| | | .Where(it => SqlFunc.Subqueryable<Dt_StockInfoDetail>().Where(s => s.StockId == it.Id && s.OrderNo == orderNo).Any()) |
| | | .ToList(); |
| | | var feeds = _feedbacktomesRepository.Db.Queryable<Dt_FeedbackToMes>().Where(x => x.OrderNo == orderNo && x.ReportStatus == 1).Select(o => o.PalletCode).ToList(); |
| | | var unreports = stockinfos.Where(x => !feeds.Contains(x.PalletCode)).ToList(); |
| | | if (unreports != null && !unreports.Any()) |
| | | { |
| | | var inboundOrder = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().First(x => x.InboundOrderNo == lists.FirstOrDefault().OrderNo); |
| | | if (inboundOrder != null) |
| | | return WebResponseContent.Instance.Error("没æéè¦åä¼ çæ°æ®"); |
| | | } |
| | | foreach (var item in unreports) |
| | | { |
| | | var lists = _stockInfoDetailRepository.Db.Queryable<Dt_StockInfoDetail>().Where(x => x.StockId == item.Id).ToList(); |
| | | if (lists.Any()) |
| | | { |
| | | if (inboundOrder.OrderType == (int)InOrderTypeEnum.AllocatInbound)//è°æ¨å
¥åº |
| | | var inboundOrder = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().First(x => x.InboundOrderNo == lists.FirstOrDefault().OrderNo); |
| | | if (inboundOrder != null) |
| | | { |
| | | var allocate = SqlSugarHelper.DbWMS.Queryable<Dt_AllocateOrder>().Where(x => x.OrderNo == inboundOrder.InboundOrderNo).First(); |
| | | var allocatefeedmodel = new AllocateDto |
| | | if (inboundOrder.OrderType == (int)InOrderTypeEnum.AllocatInbound)//è°æ¨å
¥åº |
| | | { |
| | | ReqCode = Guid.NewGuid().ToString(), |
| | | ReqTime = DateTime.Now.ToString(), |
| | | BusinessType = "2", |
| | | FactoryArea = inboundOrder.FactoryArea, |
| | | OperationType = 1, |
| | | Operator = inboundOrder.Operator, |
| | | OrderNo = inboundOrder.UpperOrderNo, |
| | | fromWarehouse = allocate?.FromWarehouse ?? "", |
| | | toWarehouse = allocate?.ToWarehouse ?? "", |
| | | Details = new List<AllocateDtoDetail>() |
| | | var allocate = SqlSugarHelper.DbWMS.Queryable<Dt_AllocateOrder>().Where(x => x.OrderNo == inboundOrder.InboundOrderNo).First(); |
| | | var allocatefeedmodel = new AllocateDto |
| | | { |
| | | ReqCode = Guid.NewGuid().ToString(), |
| | | ReqTime = DateTime.Now.ToString(), |
| | | BusinessType = "2", |
| | | FactoryArea = inboundOrder.FactoryArea, |
| | | OperationType = 1, |
| | | Operator = inboundOrder.Operator, |
| | | OrderNo = inboundOrder.UpperOrderNo, |
| | | fromWarehouse = allocate?.FromWarehouse ?? "", |
| | | toWarehouse = allocate?.ToWarehouse ?? "", |
| | | Details = new List<AllocateDtoDetail>() |
| | | |
| | | }; |
| | | }; |
| | | |
| | | var groupedData = lists.GroupBy(item => new { item.MaterielCode, item.InboundOrderRowNo, item.BarcodeUnit, item.WarehouseCode }) |
| | | .Select(group => new AllocateDtoDetail |
| | | { |
| | | MaterialCode = group.Key.MaterielCode, |
| | | LineNo = group.Key.InboundOrderRowNo, |
| | | WarehouseCode = group.Key.WarehouseCode, |
| | | Qty = group.Sum(x => x.BarcodeQty), |
| | | Unit = group.Key.BarcodeUnit, |
| | | Barcodes = group.Select(row => new BarcodeInfo |
| | | var groupedData = lists.GroupBy(item => new { item.MaterielCode, item.InboundOrderRowNo, item.BarcodeUnit, item.WarehouseCode }) |
| | | .Select(group => new AllocateDtoDetail |
| | | { |
| | | Barcode = row.Barcode, |
| | | Qty = row.BarcodeQty, |
| | | BatchNo = row.BatchNo, |
| | | SupplyCode = row.SupplyCode, |
| | | Unit = row.BarcodeUnit |
| | | }).ToList() |
| | | }).ToList(); |
| | | allocatefeedmodel.Details = groupedData; |
| | | MaterialCode = group.Key.MaterielCode, |
| | | LineNo = group.Key.InboundOrderRowNo, |
| | | WarehouseCode = group.Key.WarehouseCode, |
| | | Qty = group.Sum(x => x.BarcodeQty), |
| | | Unit = group.Key.BarcodeUnit, |
| | | Barcodes = group.Select(row => new BarcodeInfo |
| | | { |
| | | Barcode = row.Barcode, |
| | | Qty = row.BarcodeQty, |
| | | BatchNo = row.BatchNo, |
| | | SupplyCode = row.SupplyCode, |
| | | Unit = row.BarcodeUnit |
| | | }).ToList() |
| | | }).ToList(); |
| | | allocatefeedmodel.Details = groupedData; |
| | | |
| | | var result = await FeedbackAllocate(allocatefeedmodel); |
| | | if (result != null && result.code == 200) |
| | | { |
| | | _feedbacktomesRepository.Db.Insertable(new Dt_FeedbackToMes { OrderNo = orderNo, PalletCode = item.PalletCode, ReportStatus = 1 }).ExecuteCommand(); |
| | | var result = await FeedbackAllocate(allocatefeedmodel); |
| | | if (result != null && result.code == 200) |
| | | { |
| | | _feedbacktomesRepository.Db.Insertable(new Dt_FeedbackToMes { OrderNo = orderNo, PalletCode = item.PalletCode, ReportStatus = 1 }).ExecuteCommand(); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var feedmodel = new FeedbackInboundRequestModel |
| | | else |
| | | { |
| | | reqCode = Guid.NewGuid().ToString(), |
| | | reqTime = DateTime.Now.ToString(), |
| | | business_type = inboundOrder.BusinessType, |
| | | factoryArea = inboundOrder.FactoryArea, |
| | | operationType = 1, |
| | | Operator = inboundOrder.Operator, |
| | | orderNo = inboundOrder.UpperOrderNo, |
| | | status = inboundOrder.OrderStatus, |
| | | details = new List<FeedbackInboundDetailsModel>() |
| | | var feedmodel = new FeedbackInboundRequestModel |
| | | { |
| | | reqCode = Guid.NewGuid().ToString(), |
| | | reqTime = DateTime.Now.ToString(), |
| | | business_type = inboundOrder.BusinessType, |
| | | factoryArea = inboundOrder.FactoryArea, |
| | | operationType = 1, |
| | | Operator = inboundOrder.Operator, |
| | | orderNo = inboundOrder.UpperOrderNo, |
| | | status = inboundOrder.OrderStatus, |
| | | details = new List<FeedbackInboundDetailsModel>() |
| | | |
| | | }; |
| | | }; |
| | | |
| | | var groupedData = lists.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.InboundOrderRowNo, item.BarcodeUnit, item.WarehouseCode }) |
| | | .Select(group => new FeedbackInboundDetailsModel |
| | | { |
| | | materialCode = group.Key.MaterielCode, |
| | | supplyCode = group.Key.SupplyCode, |
| | | batchNo = group.Key.BatchNo, |
| | | lineNo = group.Key.InboundOrderRowNo, |
| | | qty = group.Sum(x => x.BarcodeQty), |
| | | // warehouseCode = group.Key.WarehouseCode=="0"?"1072": group.Key.WarehouseCode, |
| | | warehouseCode = group.Key.WarehouseCode, |
| | | unit = group.Key.BarcodeUnit, |
| | | barcodes = group.Select(row => new FeedbackBarcodesModel |
| | | var groupedData = lists.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.InboundOrderRowNo, item.BarcodeUnit, item.WarehouseCode }) |
| | | .Select(group => new FeedbackInboundDetailsModel |
| | | { |
| | | barcode = row.Barcode, |
| | | qty = row.BarcodeQty |
| | | }).ToList() |
| | | }).ToList(); |
| | | feedmodel.details = groupedData; |
| | | var result = await FeedbackInbound(feedmodel); |
| | | if (result != null && result.code == 200) |
| | | { |
| | | _feedbacktomesRepository.Db.Insertable(new Dt_FeedbackToMes { OrderNo = orderNo, PalletCode = item.PalletCode, ReportStatus = 1 }).ExecuteCommand(); |
| | | materialCode = group.Key.MaterielCode, |
| | | supplyCode = group.Key.SupplyCode, |
| | | batchNo = group.Key.BatchNo, |
| | | lineNo = group.Key.InboundOrderRowNo, |
| | | qty = group.Sum(x => x.BarcodeQty), |
| | | // warehouseCode = group.Key.WarehouseCode=="0"?"1072": group.Key.WarehouseCode, |
| | | warehouseCode = group.Key.WarehouseCode, |
| | | unit = group.Key.BarcodeUnit, |
| | | barcodes = group.Select(row => new FeedbackBarcodesModel |
| | | { |
| | | barcode = row.Barcode, |
| | | qty = row.BarcodeQty |
| | | }).ToList() |
| | | }).ToList(); |
| | | feedmodel.details = groupedData; |
| | | var result = await FeedbackInbound(feedmodel); |
| | | if (result != null && result.code == 200) |
| | | { |
| | | _feedbacktomesRepository.Db.Insertable(new Dt_FeedbackToMes { OrderNo = orderNo, PalletCode = item.PalletCode, ReportStatus = 1 }).ExecuteCommand(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _logger.LogInformation("InvokeMESService BatchOrderFeedbackToMes ååMES失败: " + ex.Message); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _logger.LogInformation("InvokeMESService BatchOrderFeedbackToMes ååMES失败: " + ex.Message); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | else if (inout == 2) |
| | | { |
| | | foreach (var orderNo in orderNos) |
| | | else if (inout == 2) |
| | | { |
| | | var outboundOrder = await _outboundOrderService.Db.Queryable<Dt_OutboundOrder>().FirstAsync(x => x.OrderNo == orderNo); |
| | | if (outboundOrder != null && outboundOrder.IsBatch == 0) |
| | | foreach (var orderNo in orderNos) |
| | | { |
| | | var result = await HandleOutboundOrderToMESCompletion(outboundOrder, orderNo); |
| | | return result; |
| | | var outboundOrder = await _outboundOrderService.Db.Queryable<Dt_OutboundOrder>().FirstAsync(x => x.OrderNo == orderNo); |
| | | if (outboundOrder != null && outboundOrder.IsBatch == 0) |
| | | { |
| | | var result = await HandleOutboundOrderToMESCompletion(outboundOrder, orderNo); |
| | | return result; |
| | | } |
| | | else if (outboundOrder != null && outboundOrder.IsBatch == 1) |
| | | { |
| | | var result = await HandleOutboundOrderBatchToMESCompletion(outboundOrder, orderNo); |
| | | return result; |
| | | } |
| | | } |
| | | else if (outboundOrder != null && outboundOrder.IsBatch == 1) |
| | | { |
| | | var result = await HandleOutboundOrderBatchToMESCompletion(outboundOrder, orderNo); |
| | | return result; |
| | | } |
| | | |
| | | } |
| | | |
| | | //} |
| | | //else |
| | | //{ |
| | | // // æ¢é失败ï¼è¯´ææå¦ä¸ä¸ªçº¿ç¨ï¼WCSåè°æäººå·¥æä½ï¼æ£å¨å¤ç |
| | | |
| | | } |
| | | } |
| | | finally |
| | | { |
| | | // 2. ãéæ¾å
åéãæ è®ºæå失败ï¼å¿
须鿾 |
| | | MemoryLockManager.ReleaseLock(orderNos[0]); |
| | | } |
| | | // return WebResponseContent.Instance.Error("WMSæ£å¨å¤çæ¤åä¼ ä»»å¡ï¼è¯·å¿é夿ä½ã"); |
| | | //} |
| | | } |
| | | else |
| | | catch(Exception ex) |
| | | { |
| | | // æ¢é失败ï¼è¯´ææå¦ä¸ä¸ªçº¿ç¨ï¼WCSåè°æäººå·¥æä½ï¼æ£å¨å¤ç |
| | | |
| | | return WebResponseContent.Instance.OK("WMSæ£å¨å¤çæ¤åä¼ ä»»å¡ï¼è¯·å¿é夿ä½ã"); |
| | | _logger.LogInformation("InvokeMESService BatchOrderFeedbackToMes : " +ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | // 2. ãéæ¾å
åéãæ è®ºæå失败ï¼å¿
须鿾 |
| | | // MemoryLockManager.ReleaseLock(orderNos[0]); |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | try |
| | | { |
| | | // æ ¡éªï¼å·²åä¼ ç´æ¥è¿åé误 |
| | | if (outboundOrder.ReturnToMESStatus == 1) |
| | | { |
| | | return WebResponseContent.Instance.Error("该åå·²ç»åä¼ ï¼"); |
| | | } |
| | | //if (outboundOrder.ReturnToMESStatus == 1) |
| | | //{ |
| | | // return WebResponseContent.Instance.Error("该åå·²ç»åä¼ ï¼"); |
| | | //} |
| | | |
| | | // æ¥è¯¢è®¢åæç»ï¼ä»
æ¥è¯¢æªåä¼ æåçï¼ |
| | | var orderDetails = await _outboundOrderDetailService.Db.Queryable<Dt_OutboundOrderDetail>() |
| | |
| | | var groups = pickingRecords.GroupBy(x => x.FeedBackMesDocumentNo).ToList(); |
| | | foreach (var group in groups) |
| | | { |
| | | |
| | | |
| | | List<Dt_PickingRecord> records = group.ToList(); // 该åç»ä¸çææè®°å½ |
| | | if (string.IsNullOrEmpty(group.Key)) |
| | | { |
| | | var emptydocumentNo = UniqueValueGenerator.Generate(); |
| | | records.ForEach(x => { x.FeedBackMesDocumentNo = emptydocumentNo; }); |
| | | var result= await _pickingRecoreRepository.Db.Insertable(records).ExecuteCommandAsync(); |
| | | var result = await _pickingRecoreRepository.Db.Updateable(records).ExecuteCommandAsync(); |
| | | |
| | | var interfacelog = new Dt_InterfaceLog |
| | | { |
| | | Content = JsonConvert.SerializeObject(records), |
| | | DocumentNo = emptydocumentNo, |
| | | OrderNo = orderNo, |
| | | OrderType = "2", |
| | | }; |
| | | _interfacelogRepository.AddData(interfacelog); |
| | | |
| | | if (result > 0) |
| | | { |
| | | (bool _flowControl, WebResponseContent _value) = await FeedBackBatchToMes(outboundOrder, orderNo, orderDetails, pickingRecords, emptydocumentNo); |
| | | if (!_flowControl) |
| | | { |
| | | return _value; |
| | | } |
| | | |
| | | return _value; |
| | | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | (bool _flowControl, WebResponseContent _value) = await FeedBackBatchToMes(outboundOrder, orderNo, orderDetails, pickingRecords, group.Key); |
| | | if (!_flowControl) |
| | | var ilog = _interfacelogRepository.QueryFirst(x => x.DocumentNo == group.Key); |
| | | if (ilog == null) |
| | | { |
| | | return _value; |
| | | var interfacelog = new Dt_InterfaceLog |
| | | { |
| | | Content = JsonConvert.SerializeObject(records), |
| | | DocumentNo = group.Key, |
| | | OrderNo = orderNo, |
| | | OrderType = "2", |
| | | }; |
| | | _interfacelogRepository.AddData(interfacelog); |
| | | } |
| | | (bool _flowControl, WebResponseContent _value) = await FeedBackBatchToMes(outboundOrder, orderNo, orderDetails, pickingRecords, group.Key); |
| | | |
| | | return _value; |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | // æ´æ°è®¢åç¶æ |
| | | int newStatus = allCompleted ? (int)OutOrderStatusEnum.åºåºå®æ : (int)OutOrderStatusEnum.åºåºä¸; |
| | | if (outboundOrder.OrderStatus != newStatus) |
| | | if (allCompleted && outboundOrder.OrderStatus != newStatus) |
| | | { |
| | | |
| | | int updateCount = await _outboundOrderService.Db.Updateable<Dt_OutboundOrder>() |
| | |
| | | x.ReturnToMESStatus = 1; |
| | | }); |
| | | await _pickingRecoreRepository.Db.Updateable(updates).ExecuteCommandAsync(); |
| | | await _interfacelogRepository.Db.Updateable<Dt_InterfaceLog>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 1) |
| | | .Where(x => x.OrderNo == orderNo) |
| | | .ExecuteCommandAsync(); |
| | | |
| | | if (allCompleted) |
| | | { |
| | | //MESåä¼ æåï¼æ´æ°æç»ä¸ºåä¼ æåç¶æ |
| | |
| | | } |
| | | |
| | | List<string> lockLocationCodes = locationCaches.Select(x => x.LocationCode).ToList(); |
| | | |
| | | //Dictionary<string, SqlSugar.OrderByType> orderBy = new Dictionary<string, OrderByType>() |
| | | //{ |
| | | // { nameof(Dt_LocationInfo.RoadwayNo),OrderByType.Asc }, |
| | | // { nameof(Dt_LocationInfo.Layer),OrderByType.Asc }, |
| | | // { nameof(Dt_LocationInfo.Column),OrderByType.Asc }, |
| | | // { nameof(Dt_LocationInfo.Depth),OrderByType.Desc }, |
| | | // { nameof(Dt_LocationInfo.Row),OrderByType.Asc } |
| | | //}; |
| | | |
| | | Dictionary<string, SqlSugar.OrderByType> orderBy = new Dictionary<string, OrderByType>() |
| | | { |
| | | { nameof(Dt_LocationInfo.RoadwayNo),OrderByType.Asc }, |
| | | //{ nameof(Dt_LocationInfo.RoadwayNo),OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Layer),OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Row),OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Column),OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Depth),OrderByType.Desc }, |
| | | { nameof(Dt_LocationInfo.Row),OrderByType.Asc } |
| | | |
| | | }; |
| | | |
| | | |
| | | var first = BaseDal.QueryFirst(x => x.LocationType == locationType && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.Disable.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode), orderBy);//æ¥è¯¢ç©ºè´§ä½ä¿¡æ¯å¹¶æé¤5åéå
åé
çè´§ä½,æ ¹æ®å±ãåãæ·±åº¦ãè¡æåº |
| | | if (first != null) |
| | |
| | | { |
| | | LocationStatus = (int)LocationStatusEnum.InStockLock, |
| | | }).Where(x => x.Id == first.Id).ExecuteCommand(); |
| | | } |
| | | } |
| | | |
| | | return first; |
| | | } |
| | |
| | | { |
| | | return Repository.QueryData(x => locationCodes.Contains(x.LocationCode)); |
| | | } |
| | | |
| | | |
| | | public List<LocationTypeDto> GetLocationTypes() |
| | | { |
| | | return _locationTypeRepository.Db.Queryable<Dt_LocationType>().Select(x => |
| | |
| | | [Description("AGVæ§è¡ä¸")] |
| | | AGV_Executing = 310, |
| | | |
| | | [Description("AGVåè´§ä¸")] |
| | | AGV_Pull = 315, |
| | | /// <summary> |
| | | /// AGVå¾
ç»§ç»æ§è¡ |
| | | /// </summary> |
| | |
| | | if (string.IsNullOrEmpty(where)) |
| | | where += $"{searchParametersList[i].Name} >= '{searchParametersList[i].Value}'"; |
| | | else |
| | | where += $" and {searchParametersList[i].Name} {searchParametersList[i].DisplayType.GetLinqCondition()} '{searchParametersList[i].Value}'"; |
| | | where += $" and {searchParametersList[i].Name} >= '{searchParametersList[i].Value}'"; |
| | | } |
| | | else if (searchParametersList[i].DisplayType.GetLinqCondition() == LinqExpressionType.LessThanOrEqual) |
| | | { |
| | |
| | | case HtmlElementType.Contains: |
| | | linqExpression = LinqExpressionType.In; |
| | | break; |
| | | case HtmlElementType.ThanOrEqual: |
| | | case HtmlElementType.thanorequal: |
| | | linqExpression = LinqExpressionType.ThanOrEqual; |
| | | break; |
| | | case HtmlElementType.LessOrequal: |
| | | case HtmlElementType.lessorequal: |
| | | linqExpression = LinqExpressionType.LessThanOrEqual; |
| | | break; |
| | | case HtmlElementType.GT: |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_DTO.Stock |
| | | { |
| | | public class StockDetailDtO |
| | | { |
| | | |
| | | public int Id { get; set; } |
| | | |
| | | |
| | | public int StockId { get; set; } |
| | | |
| | | |
| | | public string MaterielCode { get; set; } |
| | | |
| | | |
| | | public string MaterielName { get; set; } |
| | | |
| | | |
| | | public string OrderNo { get; set; } |
| | | |
| | | |
| | | public string BatchNo { get; set; } |
| | | |
| | | |
| | | public string ProductionDate { get; set; } |
| | | |
| | | |
| | | public string EffectiveDate { get; set; } |
| | | |
| | | |
| | | public string SerialNumber { get; set; } |
| | | |
| | | |
| | | public decimal StockQuantity { get; set; } |
| | | |
| | | |
| | | public decimal OutboundQuantity { get; set; } |
| | | |
| | | |
| | | public int Status { get; set; } |
| | | |
| | | |
| | | public string Unit { get; set; } |
| | | |
| | | public string InboundOrderRowNo { get; set; } |
| | | |
| | | |
| | | public string? SupplyCode { get; set; } |
| | | |
| | | public string FactoryArea { get; set; } |
| | | |
| | | public string? WarehouseCode { get; set; } |
| | | |
| | | |
| | | public string? Barcode { get; set; } |
| | | |
| | | |
| | | |
| | | public string? BusinessType { get; set; } |
| | | |
| | | |
| | | public decimal BarcodeQty { get; set; } |
| | | |
| | | public string BarcodeUnit { get; set; } |
| | | |
| | | public DateTime? ValidDate { get; set; } |
| | | |
| | | public string Remark { get; set; } |
| | | |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IStockService |
| | | { |
| | | public interface IStockDetailByMaterielService : IService<StockDetailByMateriel> |
| | | { |
| | | IRepository<StockDetailByMateriel> Repository { get; } |
| | | |
| | | PageGridData<StockDetailByMateriel> GetPageData2(PageDataOptions options); |
| | | } |
| | | } |
| | |
| | | bool ExistBarcodes(List<string> barcodes); |
| | | |
| | | PageGridData<StockInfoDetailWithPalletDto> GetPageData2(PageDataOptions options); |
| | | |
| | | PageGridData<StockDetailDtO> GetPageDataByMateriel(PageDataOptions options); |
| | | } |
| | | } |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | |
| | | |
| | | Task<WebResponseContent> TaskCompleted(string taskNum); |
| | | |
| | | Task TaskStatusChange(string taskNum, TaskStatusEnum taskStatusEnum); |
| | | |
| | | Task<WebResponseContent> GenerateOutboundTasksAsync(int[] keys, string outStation); |
| | | |
| | | Task<WebResponseContent> GenerateOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews,string station=null); |
| | |
| | | |
| | | public interface ITask_HtyService : IService<Dt_Task_Hty> |
| | | { |
| | | bool DeleteAndMoveIntoHty(Dt_Task task, OperateTypeEnum operateType); |
| | | } |
| | |
| | | |
| | | return WebResponseContent.Instance.OK("æçæ¤éæå"); |
| | | } |
| | | |
| | | public override PageGridData<Dt_InboundOrder> GetPageData(PageDataOptions options) |
| | | { |
| | | string wheres = ValidatePageOptions(options); |
| | | //è·åæåºå段 |
| | | Dictionary<string, SqlSugar.OrderByType> orderbyDic = GetPageDataSort(options, TProperties); |
| | | List<OrderByModel> orderByModels = new List<OrderByModel>(); |
| | | foreach (var item in orderbyDic) |
| | | { |
| | | OrderByModel orderByModel = new() |
| | | { |
| | | FieldName = item.Key, |
| | | OrderByType = item.Value |
| | | }; |
| | | orderByModels.Add(orderByModel); |
| | | } |
| | | |
| | | |
| | | int totalCount = 0; |
| | | List<SearchParameters> searchParametersList = new List<SearchParameters>(); |
| | | if (!string.IsNullOrEmpty(options.Wheres)) |
| | | { |
| | | try |
| | | { |
| | | searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | options.Filter = searchParametersList; |
| | | } |
| | | catch { } |
| | | } |
| | | var data = BaseDal.Db.Queryable<Dt_InboundOrder>() |
| | | .WhereIF(!wheres.IsNullOrEmpty(), wheres) |
| | | .OrderBy(orderByModels).Includes(x=>x.Details) |
| | | .ToPageList(options.Page, options.Rows, ref totalCount); |
| | | |
| | | return new PageGridData<Dt_InboundOrder>(totalCount, data); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// è¡å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "è¡å·")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "è¡å·", DefaultValue = "0")] |
| | | public int RowNo { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 订åæç»ç¶æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "订åæç»ç¶æ")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "订åæç»ç¶æ", DefaultValue = "0")] |
| | | public int OrderDetailStatus { get; set; } |
| | | /// <summary> |
| | | /// åä½ |
| | |
| | | using System; |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | |
| | | public List<string> BarCodeSubmit { get; set; } |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | public class StockDetailByMateriel |
| | | { |
| | | public int Id { get; set; } |
| | | |
| | | |
| | | public int StockId { get; set; } |
| | | |
| | | |
| | | public string MaterielCode { get; set; } |
| | | |
| | | |
| | | public string MaterielName { get; set; } |
| | | |
| | | |
| | | public string OrderNo { get; set; } |
| | | |
| | | |
| | | public string BatchNo { get; set; } |
| | | |
| | | |
| | | public string ProductionDate { get; set; } |
| | | |
| | | |
| | | public string EffectiveDate { get; set; } |
| | | |
| | | |
| | | public string SerialNumber { get; set; } |
| | | |
| | | |
| | | public decimal StockQuantity { get; set; } |
| | | |
| | | |
| | | public decimal OutboundQuantity { get; set; } |
| | | |
| | | |
| | | public int Status { get; set; } |
| | | |
| | | |
| | | public string Unit { get; set; } |
| | | |
| | | public string InboundOrderRowNo { get; set; } |
| | | |
| | | |
| | | public string? SupplyCode { get; set; } |
| | | |
| | | public string FactoryArea { get; set; } |
| | | |
| | | public string? WarehouseCode { get; set; } |
| | | |
| | | |
| | | public string? Barcode { get; set; } |
| | | |
| | | |
| | | |
| | | public string? BusinessType { get; set; } |
| | | |
| | | |
| | | public decimal BarcodeQty { get; set; } |
| | | |
| | | public string BarcodeUnit { get; set; } |
| | | |
| | | public DateTime? ValidDate { get; set; } |
| | | |
| | | public string Remark { get; set; } |
| | | } |
| | | } |
| | |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Model.Models.Basic; |
| | | using WIDESEA_Model.Models.Outbound; |
| | |
| | | private readonly IDailySequenceService _dailySequenceService; |
| | | private readonly IAllocateService _allocateService; |
| | | private readonly IRepository<Dt_OutboundBatch> _outboundBatchRepository; |
| | | private readonly ITask_HtyService _task_HtyService; |
| | | private readonly ILogger<OutboundPickingService> _logger; |
| | | |
| | | private Dictionary<string, string> stations = new Dictionary<string, string> |
| | |
| | | public OutboundBatchPickingService(IRepository<Dt_PickingRecord> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, IStockService stockService, |
| | | IOutStockLockInfoService outStockLockInfoService, IStockInfoDetailService stockInfoDetailService, ILocationInfoService locationInfoService, |
| | | IOutboundOrderDetailService outboundOrderDetailService, ISplitPackageService splitPackageService, IOutboundOrderService outboundOrderService, |
| | | IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository) : base(BaseDal) |
| | | IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository, ITask_HtyService task_HtyService) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _stockInfoService = stockInfoService; |
| | |
| | | _dailySequenceService = dailySequenceService; |
| | | _allocateService = allocateService; |
| | | _outboundBatchRepository = outboundBatchRepository; |
| | | _task_HtyService = task_HtyService; |
| | | } |
| | | |
| | | // <summary> |
| | |
| | | |
| | | // æ´æ°éå®è®°å½ç¶æä¸ºå·²ååº |
| | | lockInfo.Status = (int)OutLockStockStatusEnum.å·²ååº; |
| | | lockInfo.Operator = App.User.UserName; |
| | | lockInfo.Operator = App.User.UserName; |
| | | |
| | | await _outStockLockInfoService.Db.Updateable(lockInfo).ExecuteCommandAsync(); |
| | | |
| | |
| | | |
| | | // æ´æ°éå®è®°å½ç¶æä¸ºå·²ååº |
| | | lockInfo.Status = (int)OutLockStockStatusEnum.å·²ååº; |
| | | lockInfo.Operator = App.User.UserName; |
| | | lockInfo.Operator = App.User.UserName; |
| | | |
| | | await _outStockLockInfoService.Db.Updateable(lockInfo).ExecuteCommandAsync(); |
| | | |
| | |
| | | PalletType = stockInfo.PalletType, |
| | | WarehouseId = currentTask.WarehouseId |
| | | }; |
| | | var targetAddress = currentTask.TargetAddress; |
| | | |
| | | await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync(); |
| | | try |
| | | { |
| | | await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync(); |
| | | |
| | | _logger.LogInformation($"CreateReturnTaskAndHandleESS åæ¹å é¤åå²ä»»å¡: {orderNo} ï¼ {currentTask.TaskNum}"); |
| | | // å é¤åå§åºåºä»»å¡ |
| | | //_taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.èªå¨å®æ); |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(currentTask, OperateTypeEnum.人工å é¤); |
| | | await _taskRepository.Db.Deleteable(currentTask).ExecuteCommandAsync(); |
| | | |
| | | if (!result) |
| | | { |
| | | await _taskRepository.Db.Deleteable(currentTask).ExecuteCommandAsync(); |
| | | } |
| | | _logger.LogInformation($"CreateReturnTaskAndHandleESS åæ¹å é¤åå²ä»»å¡: {orderNo} ï¼ {currentTask.TaskNum},å½±åè¡ {result}"); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _logger.LogInformation($"å建ååºä»»å¡å¤±è´¥ - 订å: {orderNo}, æç: {palletCode}"); |
| | | throw new Exception($"å建ååºä»»å¡å¤±è´¥ - 订å: {orderNo}, æç: {palletCode}"); |
| | | |
| | | } |
| | | // åéESSå½ä»¤ |
| | | await SendESSCommands(palletCode, currentTask.TargetAddress, returnTask); |
| | | await SendESSCommands(palletCode, targetAddress, returnTask); |
| | | |
| | | _logger.LogInformation($"å建ååºä»»å¡æå - 订å: {orderNo}, æç: {palletCode}"); |
| | | } |
| | |
| | | // åé
æ°éå¨è®¢åæç»å±é¢ç»ä¸å¤ç |
| | | var originalStatus = lockInfo.Status; |
| | | lockInfo.Status = (int)OutLockStockStatusEnum.å·²ååº; |
| | | lockInfo.Operator = App.User.UserName; |
| | | lockInfo.Operator = App.User.UserName; |
| | | |
| | | await _outStockLockInfoService.Db.Updateable(lockInfo).ExecuteCommandAsync(); |
| | | |
| | |
| | | /// <summary> |
| | | /// å¤çæªåæ£çéå®è®°å½ååº |
| | | /// </summary> |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// å¤çæçä¸çåºåè´§ç©ååº |
| | |
| | | |
| | | }; |
| | | // ä¿åååºä»»å¡ |
| | | await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync(); |
| | | var insertcount = await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync(); |
| | | if (insertcount <= 0) |
| | | { |
| | | throw new Exception("å建任å¡å¤±è´¥ï¼"); |
| | | } |
| | | var targetAddress = originalTask.TargetAddress; |
| | | |
| | | _logger.LogInformation($"CreateReturnTaskAndHandleESS åæ¹å é¤åå²ä»»å¡: {orderNo} ï¼ {originalTask.TaskNum}"); |
| | | // å é¤åå§åºåºä»»å¡ |
| | | _taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.èªå¨å®æ); |
| | | //_taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.èªå¨å®æ); |
| | | var result= _task_HtyService.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.人工å é¤); |
| | | await _taskRepository.Db.Deleteable(originalTask).ExecuteCommandAsync(); |
| | | |
| | | if (!result) |
| | | { |
| | | await _taskRepository.Db.Deleteable(originalTask).ExecuteCommandAsync(); |
| | | } |
| | | _logger.LogInformation($"CreateReturnTaskAndHandleESS åæ¹å é¤åå²ä»»å¡: {orderNo} ï¼ {originalTask.TaskNum},å½±åè¡ {result}"); |
| | | |
| | | |
| | | // ç» ESS åéæµå¨ä¿¡å·ååå»ºä»»å¡ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Text.Json; |
| | | using System.Threading.Tasks; |
| | |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Model.Models.Basic; |
| | | using WIDESEA_Model.Models.Check; |
| | | using WIDESEA_Model.Models.Outbound; |
| | | |
| | | namespace WIDESEA_OutboundService |
| | | { |
| | |
| | | private readonly IInboundOrderDetailService _inboundOrderDetailService; |
| | | private readonly IRepository<Dt_WarehouseArea> _warehouseAreaRepository; |
| | | private readonly IReCheckOrderService _reCheckOrderService; |
| | | private readonly ITask_HtyService _task_HtyService; |
| | | private readonly ILogger<OutboundPickingService> _logger; |
| | | private readonly IRepository<Dt_InterfaceLog> _interfaceLog; |
| | | |
| | | private Dictionary<string, string> stations = new Dictionary<string, string> |
| | | { |
| | |
| | | public OutboundPickingService(IRepository<Dt_PickingRecord> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, IStockService stockService, |
| | | IOutStockLockInfoService outStockLockInfoService, IStockInfoDetailService stockInfoDetailService, ILocationInfoService locationInfoService, |
| | | IOutboundOrderDetailService outboundOrderDetailService, ISplitPackageService splitPackageService, IOutboundOrderService outboundOrderService, |
| | | IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_InboundOrder> inboundOrderRepository, IInboundOrderDetailService inboundOrderDetailService, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IReCheckOrderService reCheckOrderService) : base(BaseDal) |
| | | IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_InboundOrder> inboundOrderRepository, IInboundOrderDetailService inboundOrderDetailService, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IReCheckOrderService reCheckOrderService, ITask_HtyService task_HtyService,IRepository<Dt_InterfaceLog> interfaceLog) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _stockInfoService = stockInfoService; |
| | |
| | | _inboundOrderDetailService = inboundOrderDetailService; |
| | | _warehouseAreaRepository = warehouseAreaRepository; |
| | | _reCheckOrderService = reCheckOrderService; |
| | | _task_HtyService = task_HtyService; |
| | | _interfaceLog = interfaceLog; |
| | | } |
| | | |
| | | |
| | |
| | | WarehouseId = originalTask.WarehouseId |
| | | |
| | | }; |
| | | // ä¿åååºä»»å¡ |
| | | await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync(); |
| | | try |
| | | { |
| | | // ä¿åååºä»»å¡ |
| | | var insertcount = await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync(); |
| | | if (insertcount <= 0) |
| | | { |
| | | throw new Exception("å建任å¡å¤±è´¥ï¼"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _logger.LogInformation($"CreateReturnTaskAndHandleESS å建任å¡å¤±è´¥: {orderNo} ï¼ {palletCode}"); |
| | | throw new Exception("å建任å¡å¤±è´¥ï¼"); |
| | | } |
| | | var targetAddress = originalTask.TargetAddress; |
| | | |
| | | _logger.LogInformation($"CreateReturnTaskAndHandleESS å é¤åå²ä»»å¡: {orderNo} ï¼ {originalTask.TaskNum}"); |
| | | // å é¤åå§åºåºä»»å¡ |
| | | _taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.èªå¨å®æ); |
| | | await _taskRepository.Db.Deleteable(originalTask).ExecuteCommandAsync(); |
| | | |
| | | |
| | | // _taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.èªå¨å®æ); |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.人工å é¤); |
| | | if (!result) |
| | | { |
| | | await _taskRepository.Db.Deleteable(originalTask).ExecuteCommandAsync(); |
| | | } |
| | | _logger.LogInformation($"CreateReturnTaskAndHandleESS å é¤åå²ä»»å¡: {orderNo} ï¼ {originalTask.TaskNum},å½±åè¡ {result}"); |
| | | |
| | | // ç» ESS åéæµå¨ä¿¡å·ååå»ºä»»å¡ |
| | | await SendESSCommands(palletCode, targetAddress, returnTask); |
| | |
| | | TaskNum = 0, |
| | | Status = (int)OutLockStockStatusEnum.æ£é宿, |
| | | Unit = outboundOrderDetail.Unit, |
| | | SupplyCode = outboundOrderDetail.SupplyCode?? "æ ", |
| | | SupplyCode = outboundOrderDetail.SupplyCode ?? "æ ", |
| | | OrderType = outboundOrder.OrderType, |
| | | CurrentBarcode = inboundOrderDetail.Barcode, |
| | | IsSplitted = 1, |
| | | Operator = App.User.UserName, |
| | | lineNo= outboundOrderDetail.lineNo, |
| | | lineNo = outboundOrderDetail.lineNo, |
| | | WarehouseCode = outboundOrderDetail.WarehouseCode ?? "æ ", |
| | | BarcodeQty=outboundOrderDetail.NoStockOutQty, |
| | | BarcodeUnit =outboundOrderDetail.BarcodeUnit, |
| | | BarcodeQty = outboundOrderDetail.NoStockOutQty, |
| | | BarcodeUnit = outboundOrderDetail.BarcodeUnit, |
| | | BatchNo = outboundOrderDetail.BatchNo |
| | | }; |
| | | _outStockLockInfoService.AddData(newLockInfo); |
| | |
| | | var result1 = await _invokeMESService.FeedbackInbound(infeedmodel); |
| | | if (result1 != null && result1.code == 200) |
| | | { |
| | | var orderIds = inboundOrderDetails.Select(x => x.Id).Distinct().ToList(); |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | | _inboundOrderDetailService.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand(); |
| | | .Where(it => orderIds.Contains(it.Id)).ExecuteCommand(); |
| | | } |
| | | //åºåºåä¼ MES |
| | | |
| | | var documentNo = UniqueValueGenerator.Generate(); |
| | | |
| | | var outfeedmodel = new FeedbackOutboundRequestModel |
| | | { |
| | | reqCode = Guid.NewGuid().ToString(), |
| | | reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | business_type = outboundOrder.BusinessType, |
| | | factoryArea = outboundOrder.FactoryArea, |
| | | operationType = 1, |
| | | Operator = App.User.UserName, |
| | | orderNo = outboundOrder.UpperOrderNo, |
| | | documentsNO = documentNo, |
| | | status = outboundOrder.OrderStatus, |
| | | details = new List<FeedbackOutboundDetailsModel>() |
| | | }; |
| | | foreach (var detail in outboundOrder.Details) |
| | | { |
| | | reqCode = Guid.NewGuid().ToString(), |
| | | reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | business_type = outboundOrder.BusinessType, |
| | | factoryArea = outboundOrder.FactoryArea, |
| | | operationType = 1, |
| | | Operator = App.User.UserName, |
| | | orderNo = outboundOrder.UpperOrderNo, |
| | | documentsNO = documentNo, |
| | | status = outboundOrder.OrderStatus, |
| | | details = new List<FeedbackOutboundDetailsModel>() |
| | | }; |
| | | foreach (var detail in outboundOrderDetails) |
| | | { |
| | | // è·å该æç»å¯¹åºçæ¡ç ä¿¡æ¯ï¼ä»éå®è®°å½ï¼ |
| | | var detailLocks = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>() |
| | |
| | | (x.Status == (int)OutLockStockStatusEnum.æ£é宿 || x.Status == (int)OutLockStockStatusEnum.å·²ååº)) |
| | | .ToListAsync(); |
| | | |
| | | var groupdata = detailLocks.GroupBy(item => new { item.MaterielCode, item.lineNo, item.BarcodeUnit, item.WarehouseCode }) |
| | | .Select(group => new FeedbackOutboundDetailsModel |
| | | { |
| | | var groupdata = detailLocks.GroupBy(item => new { item.MaterielCode, item.lineNo, item.BarcodeUnit, item.WarehouseCode }) |
| | | .Select(group => new FeedbackOutboundDetailsModel |
| | | { |
| | | |
| | | materialCode = group.Key.MaterielCode, |
| | | lineNo = group.Key.lineNo, |
| | | warehouseCode = group.Key.WarehouseCode, |
| | | qty = group.Sum(x => x.PickedQty), |
| | | currentDeliveryQty = group.Sum(x => x.PickedQty), |
| | | unit = group.Key.BarcodeUnit, |
| | | barcodes = group.Select(lockInfo => new WIDESEA_DTO.Outbound.BarcodesModel |
| | | { |
| | | barcode = lockInfo.CurrentBarcode, |
| | | supplyCode = lockInfo.SupplyCode, |
| | | batchNo = lockInfo.BatchNo, |
| | | unit = lockInfo.BarcodeUnit, |
| | | qty = lockInfo.PickedQty |
| | | }).ToList() |
| | | }).ToList(); |
| | | outfeedmodel.details.AddRange(groupdata); |
| | | } |
| | | var result = await _invokeMESService.FeedbackOutbound(outfeedmodel); |
| | | if (result != null && result.code == 200) |
| | | { |
| | | await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 1) |
| | | .Where(x => x.OrderId == outboundOrder.Id) |
| | | .ExecuteCommandAsync(); |
| | | materialCode = group.Key.MaterielCode, |
| | | lineNo = group.Key.lineNo, |
| | | warehouseCode = group.Key.WarehouseCode, |
| | | qty = group.Sum(x => x.PickedQty), |
| | | currentDeliveryQty = group.Sum(x => x.PickedQty), |
| | | unit = group.Key.BarcodeUnit, |
| | | barcodes = group.Select(lockInfo => new WIDESEA_DTO.Outbound.BarcodesModel |
| | | { |
| | | barcode = lockInfo.CurrentBarcode, |
| | | supplyCode = lockInfo.SupplyCode, |
| | | batchNo = lockInfo.BatchNo, |
| | | unit = lockInfo.BarcodeUnit, |
| | | qty = lockInfo.PickedQty |
| | | }).ToList() |
| | | }).ToList(); |
| | | outfeedmodel.details.AddRange(groupdata); |
| | | } |
| | | //åå¨åä¼ åæ°ï¼ä¿è¯å¼å¸¸æå¨åä¼ |
| | | Dt_InterfaceLog interfaceLog = new Dt_InterfaceLog |
| | | { |
| | | OrderNo = outboundOrder.UpperOrderNo, |
| | | DocumentNo = documentNo, |
| | | OrderType = "èæåºå
¥åº", |
| | | Content = outfeedmodel.ToJson(), |
| | | ReturnToMESStatus = 0, |
| | | IsDeleted = false |
| | | }; |
| | | _interfaceLog.AddData(interfaceLog); |
| | | |
| | | var result = await _invokeMESService.FeedbackOutbound(outfeedmodel); |
| | | if (result != null && result.code == 200) |
| | | { |
| | | var orderIds = outboundOrderDetails.Select(x => x.Id).Distinct().ToList(); |
| | | await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 1) |
| | | .Where(x => orderIds.Contains(x.Id)) |
| | | .ExecuteCommandAsync(); |
| | | |
| | | |
| | | await _outboundOrderService.Db.Updateable<Dt_OutboundOrder>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 1) |
| | | .Where(x => x.Id == outboundOrder.Id) |
| | | .ExecuteCommandAsync(); |
| | | |
| | | await _interfaceLog.Db.Updateable<Dt_InterfaceLog>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 1) |
| | | .Where(x=>x.DocumentNo == documentNo) |
| | | .ExecuteCommandAsync(); |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | <ProjectReference Include="..\WIDESEA_IOutboundService\WIDESEA_IOutboundService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IRecordService\WIDESEA_IRecordService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IStockService\WIDESEA_IStockService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_ITaskInfoService\WIDESEA_ITaskInfoService.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_StockService |
| | | { |
| | | internal class StockDetailByMaterielService |
| | | { |
| | | } |
| | | } |
| | |
| | | |
| | | return new PageGridData<StockInfoDetailWithPalletDto> { Rows = dtoList, Total = lists.Total, Summary = lists.Summary }; |
| | | } |
| | | |
| | | public PageGridData<StockDetailDtO> GetPageDataByMateriel(PageDataOptions options) |
| | | { |
| | | PageGridData<Dt_StockInfoDetail> lists = base.GetPageData(options); |
| | | |
| | | List<StockDetailDtO> dtoList = lists.Rows.GroupBy(detail => new { detail.MaterielCode, detail.BatchNo, detail.SupplyCode }).Select(group => |
| | | { |
| | | var firstItem = group.First(); |
| | | return new StockDetailDtO |
| | | { |
| | | Id = firstItem.Id, |
| | | StockId = firstItem.StockId, |
| | | MaterielCode = group.Key.MaterielCode, |
| | | MaterielName = firstItem.MaterielName, |
| | | OrderNo = firstItem.OrderNo, |
| | | BatchNo = group.Key.BatchNo, |
| | | ProductionDate = firstItem.ProductionDate, |
| | | EffectiveDate = firstItem.EffectiveDate, |
| | | SerialNumber = firstItem.SerialNumber, |
| | | // æ ¸å¿ï¼å¯¹å½ååç»çStockQuantityæ±å |
| | | StockQuantity = group.Sum(item => item.StockQuantity), |
| | | OutboundQuantity = firstItem.OutboundQuantity, |
| | | Status = firstItem.Status, |
| | | Unit = firstItem.Unit, |
| | | InboundOrderRowNo = firstItem.InboundOrderRowNo, |
| | | SupplyCode = group.Key.SupplyCode, |
| | | WarehouseCode = firstItem.WarehouseCode, |
| | | Barcode = firstItem.Barcode, |
| | | BusinessType = firstItem.BusinessType, |
| | | Remark = firstItem.Remark |
| | | }; |
| | | }).ToList(); |
| | | |
| | | |
| | | return new PageGridData<StockDetailDtO> { Rows = dtoList, Total = lists.Total, Summary = lists.Summary }; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | //} |
| | | int totalCount = 0; |
| | | |
| | | ISugarQueryable<Dt_StockInfo> sugarQueryable1 = _dbBase.Queryable<Dt_StockInfo>(); |
| | | ISugarQueryable<Dt_StockInfo> sugarQueryable1 = _dbBase.Queryable<Dt_StockInfo>().Includes(x=>x.Details); |
| | | ISugarQueryable<Dt_LocationInfo> sugarQueryable = _dbBase.Queryable<Dt_LocationInfo>(); |
| | | ISugarQueryable<Dt_StockInfoDetail> sugarQueryable2 = _dbBase.Queryable<Dt_StockInfoDetail>(); |
| | | |
| | |
| | | private readonly IRecordService _recordService; |
| | | private readonly IAllocateService _allocateService; |
| | | private readonly IInvokeMESService _invokeMESService; |
| | | private readonly ITask_HtyService _task_HtyService; |
| | | public IRepository<Dt_Task> Repository => BaseDal; |
| | | |
| | | private Dictionary<string, SqlSugar.OrderByType> _taskOrderBy = new() |
| | |
| | | |
| | | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList(); |
| | | |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository, IRepository<Dt_ReCheckOrder> reCheckOrderRepository, IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository, IMaterialUnitService materialUnitService) : base(BaseDal) |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository, IRepository<Dt_ReCheckOrder> reCheckOrderRepository, IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository, IMaterialUnitService materialUnitService, ITask_HtyService task_HtyService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _allocateOrderDetailRepository = allocateOrderDetailRepository; |
| | | _allocateOrderRepository = allocateOrderRepository; |
| | | _materialUnitService = materialUnitService; |
| | | _task_HtyService = task_HtyService; |
| | | } |
| | | |
| | | public async Task TaskStatusChange(string taskNum,TaskStatusEnum taskStatusEnum) |
| | | { |
| | | if (int.TryParse(taskNum, out var newTaskNum)) |
| | | { |
| | | await Db.Updateable<Dt_Task>().SetColumns(it => new Dt_Task { |
| | | TaskStatus = taskStatusEnum.ObjToInt() |
| | | }) |
| | | .Where(it => it.TaskNum == newTaskNum) |
| | | .ExecuteCommandAsync(); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | |
| | | |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | |
| | | // BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.人工å é¤); |
| | | if (!result) |
| | | { |
| | | await Db.Deleteable(task).ExecuteCommandAsync(); |
| | | } |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum); |
| | | |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, WIDESEA_Common.StockEnum.StockChangeType.MaterielGroup); |
| | |
| | | }).ToList(); |
| | | allocatefeedmodel.Details = groupedData; |
| | | |
| | | var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel); |
| | | if (result != null && result.code == 200) |
| | | var feedbackresult = await _invokeMESService.FeedbackAllocate(allocatefeedmodel); |
| | | if (feedbackresult != null && feedbackresult.code == 200) |
| | | { |
| | | _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | |
| | | }).ToList(); |
| | | allocatefeedmodel.Details = groupedData; |
| | | |
| | | var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel); |
| | | if (result != null && result.code == 200) |
| | | var feedbackresult = await _invokeMESService.FeedbackAllocate(allocatefeedmodel); |
| | | if (feedbackresult != null && feedbackresult.code == 200) |
| | | { |
| | | _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | |
| | | }).ToList(); |
| | | feedmodel.details = groupedData; |
| | | |
| | | var result = await _invokeMESService.FeedbackInbound(feedmodel); |
| | | if (result != null && result.code == 200) |
| | | var feedbackresult = await _invokeMESService.FeedbackInbound(feedmodel); |
| | | if (feedbackresult != null && feedbackresult.code == 200) |
| | | { |
| | | _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | |
| | | var outboundOrder = _outboundOrderService.Db.Queryable<Dt_OutboundOrder>().First(x => x.OrderNo == task.OrderNo); |
| | | |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | |
| | | // BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.人工å é¤); |
| | | if (!result) |
| | | { |
| | | await Db.Deleteable(task).ExecuteCommandAsync(); |
| | | } |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforelocationStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum); |
| | | |
| | | |
| | |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | |
| | | // å é¤ä»»å¡è®°å½ |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | BaseDal.DeleteData(task); |
| | | |
| | | //BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | //BaseDal.DeleteData(task); |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.人工å é¤); |
| | | if (!result) |
| | | { |
| | | await Db.Deleteable(task).ExecuteCommandAsync(); |
| | | } |
| | | // è®°å½è´§ä½ç¶æåæ´ |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord( |
| | | locationInfo, |
| | |
| | | //ä¸ç¨åä¼ |
| | | } |
| | | else |
| | | { |
| | | { |
| | | if (outboundOrder != null && outboundOrder.IsBatch == 0) |
| | | { |
| | | var feedmodel = new FeedbackOutboundRequestModel |
| | |
| | | } |
| | | else if (outboundOrder != null && outboundOrder.IsBatch == 1) |
| | | { |
| | | await _invokeMESService.BatchOrderFeedbackToMes(new List<string>(){outboundOrder.OrderNo },2); |
| | | await _invokeMESService.BatchOrderFeedbackToMes(new List<string>() { outboundOrder.OrderNo }, 2); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | //_stockRepository.Db.Deleteable(stockInfo).ExecuteCommand(); |
| | | // BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.人工å é¤); |
| | | if (!result) |
| | | { |
| | | await Db.Deleteable(task).ExecuteCommandAsync(); |
| | | } |
| | | |
| | | var stockresult = _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | if (!stockresult) |
| | | { |
| | | _stockRepository.Db.Deleteable(stockInfo).ExecuteCommand(); |
| | | } |
| | | _stockService.StockInfoService.DeleteData(stockInfo); |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | |
| | |
| | | using WIDESEA_Core.BaseRepository; |
| | | using AutoMapper; |
| | | using Microsoft.Extensions.Logging; |
| | | using System.Transactions; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | |
| | | public class Task_HtyService : ServiceBase<Dt_Task_Hty, IRepository<Dt_Task_Hty>>, ITask_HtyService |
| | | { |
| | | public Task_HtyService(IRepository<Dt_Task_Hty> BaseDal) : base(BaseDal) |
| | | private readonly ILogger<Task_HtyService> _logger; |
| | | |
| | | private readonly IMapper _mapper; // AutoMapperå®ä¾ |
| | | public Task_HtyService(IRepository<Dt_Task_Hty> BaseDal, IMapper mapper, ILogger<Task_HtyService> logger) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _logger = logger; |
| | | } |
| | | public bool DeleteAndMoveIntoHty(Dt_Task task, OperateTypeEnum operateType) |
| | | { |
| | | // using var transaction = Db.Ado.UseTran(); |
| | | try |
| | | { |
| | | var historyEntity = _mapper.Map<Dt_Task_Hty>(task); |
| | | |
| | | // 2. å¡«å
åå²å®ä½æ ¸å¿å段 |
| | | historyEntity.SourceId = task.TaskId; |
| | | historyEntity.OperateType = App.User?.UserName != null ? OperateTypeEnum.èªå¨å®æ.ToString() : OperateTypeEnum.äººå·¥å®æ.ToString(); |
| | | historyEntity.Creater = App.User?.UserName != null ? App.User.UserName : "System"; |
| | | |
| | | // è¦çä¿®æ¹äºº/ä¿®æ¹æ¶é´ï¼ä¼å
级é«äºæ å°ï¼ |
| | | // historyEntity.Modifier = App.User?.UserId > 0 ? App.User?.UserName : "System"; |
| | | // historyEntity.ModifyDate = DateTime.Now; |
| | | |
| | | // 3. æå
¥åå²è¡¨ï¼ç±»åå®å
¨ï¼æ åå°æ¼æ¥è¡¨åï¼ |
| | | |
| | | int insertCount = Db.Insertable(historyEntity).ExecuteCommand(); |
| | | |
| | | if (insertCount <= 0) |
| | | { |
| | | _logger.LogError($"ä»»å¡åå²è¡¨Dt_Task_Hty [{task.TaskNum}]æå
¥å¤±è´¥ï¼å½±åè¡æ°ä¸º0"); |
| | | // transaction.RollbackTran(); |
| | | return false; |
| | | } |
| | | |
| | | // 4. å é¤åå®ä½ï¼ç±»åå®å
¨ï¼ |
| | | int deleteCount = Db.Deleteable(task).ExecuteCommand(); |
| | | if (deleteCount <= 0) |
| | | { |
| | | _logger.LogError("ä»»å¡ä¸å¡å®ä½[{0}]å é¤å¤±è´¥ï¼å½±åè¡æ°ä¸º0", task.TaskNum); |
| | | // transaction.RollbackTran(); |
| | | return false; |
| | | } |
| | | //transaction.CommitTran(); |
| | | _logger.LogInformation("ä»»å¡å®ä½[{0}]å·²æåç§»å
¥åå²è¡¨[{1}]å¹¶å é¤åæ°æ®", task.TaskNum); |
| | | return true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | // transaction.RollbackTran(); |
| | | _logger.LogError(ex, "ä»»å¡å é¤å®ä½[{0}]å¹¶ç§»å
¥åå²è¡¨å¤±è´¥", task.TaskNum); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | private async Task HandleTaskSuspended(StatusCallbackRequest request) |
| | | { |
| | | _logger.LogWarning("ä»»å¡æèµ·: TaskCode={TaskCode}, ç³»ç»ä»»å¡ç ={SysTaskCode}, åå ={Message}", |
| | | request.TaskCode, request.SysTaskCode, request.Message); |
| | | _logger.LogWarning("ä»»å¡æèµ·: TaskCode={TaskCode}, ç³»ç»ä»»å¡ç ={SysTaskCode}, åå ={Message}",request.TaskCode, request.SysTaskCode, request.Message); |
| | | |
| | | // è¿éæ·»å æ¨çæèµ·å¤çé»è¾ |
| | | await Task.CompletedTask; |
| | |
| | | /// </summary> |
| | | private async Task HandleTaskAllocated(StatusCallbackRequest request) |
| | | { |
| | | _logger.LogInformation("ä»»å¡åé
: TaskCode={TaskCode}, Robot={Robot}", |
| | | request.TaskCode, request.RobotCode); |
| | | _logger.LogInformation("ä»»å¡åé
: TaskCode={TaskCode}, Robot={Robot}",request.TaskCode, request.RobotCode); |
| | | |
| | | // è¿éæ·»å æ¨çä»»å¡åé
å¤çé»è¾ |
| | | await Task.CompletedTask; |
| | |
| | | { |
| | | if (request.Status == WIDESEA_DTO.Basic.TaskStatus.success) |
| | | { |
| | | _logger.LogInformation("åç®±å®æ: Container={Container}, Location={Location}", |
| | | request.ContainerCode, request.LocationCode); |
| | | _logger.LogInformation("åç®±å®æ: Container={Container}, Location={Location}", request.ContainerCode, request.LocationCode); |
| | | |
| | | await _taskService.TaskStatusChange(request.TaskCode, WIDESEA_Common.TaskEnum.TaskStatusEnum.AGV_Pull); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | if (request.Status == WIDESEA_DTO.Basic.TaskStatus.success) |
| | | { |
| | | _logger.LogInformation("æ¾ç®±å®æ: Container={Container}, Location={Location}", |
| | | request.ContainerCode, request.LocationCode); |
| | | _logger.LogInformation("æ¾ç®±å®æ: Container={Container}, Location={Location}", request.ContainerCode, request.LocationCode); |
| | | await _taskService.TaskStatusChange(request.TaskCode, WIDESEA_Common.TaskEnum.TaskStatusEnum.AGV_Puting); |
| | | } |
| | | else |
| | | { |
| | |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_InboundService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_OutboundService; |
| | | |
| | |
| | | private readonly IOutStockLockInfoService _outStockLockInfoService; |
| | | private readonly IOutboundOrderDetailService _outboundOrderDetailService; |
| | | private readonly IRepository<Dt_Task> _taskRepository; |
| | | private readonly ITask_HtyService _task_HtyService; |
| | | private readonly ILogger<InboundOrderController> _logger; |
| | | public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService, ILogger<InboundOrderController> logger, IMaterialUnitService materialUnitService, IInboundService inboundService, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderDetailService outboundOrderDetailService, IRepository<Dt_Task> taskRepository) : base(service) |
| | | public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService, ILogger<InboundOrderController> logger, IMaterialUnitService materialUnitService, IInboundService inboundService, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderDetailService outboundOrderDetailService, IRepository<Dt_Task> taskRepository, ITask_HtyService task_HtyService) : base(service) |
| | | { |
| | | this.erpApiService = erpApiService; |
| | | _invokeMESService = invokeMESService; |
| | |
| | | _outStockLockInfoService = outStockLockInfoService; |
| | | _outboundOrderDetailService = outboundOrderDetailService; |
| | | _taskRepository = taskRepository; |
| | | _task_HtyService = task_HtyService; |
| | | } |
| | | |
| | | [HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate] |
| | | public async Task<WebResponseContent> Test() |
| | | { |
| | | var originalTask = _taskRepository.Db.Queryable<Dt_Task>().First(); |
| | | _taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.èªå¨å®æ); |
| | | |
| | | //var originalTask = _taskRepository.Db.Queryable<Dt_Task>().First(); |
| | | |
| | | //var result = _task_HtyService.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.人工å é¤); |
| | | //if (result) |
| | | //{ |
| | | // var sddd = "trueee"; |
| | | //} |
| | | //var originalTask = _taskRepository.Db.Queryable<Dt_Task>().First(); |
| | | //_taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.èªå¨å®æ); |
| | | // Service.Db.Deleteable<Dt_InboundOrder>().Where(x=>x.UpperOrderNo== "12020251100040").ExecuteCommand(); |
| | | //_inboundService.InboundOrderDetailService.Db.Deleteable<Dt_InboundOrderDetail>() |
| | | // .Where(p => SqlFunc.Subqueryable<Dt_InboundOrder>().Where(s => s.Id == p.OrderId && s.UpperOrderNo == "12020251100040").Any()).ExecuteCommand(); |
| | |
| | | |
| | | //var pdddurchaseToStockResult = await _materialUnitService.ConvertFromToStockAsync("100513-00303", "W013", 1); |
| | | |
| | | //var sddd = _locationInfoService.AssignLocation(); |
| | | //var sddd = _locationInfoService.AssignLocation(1); |
| | | //var code = sddd.LocationCode; |
| | | //var ssss=await _dailySequenceService.GetNextSequenceAsync(); |
| | | //var ddddssss = "WSLOT" + DateTime.Now.ToString("yyyyMMddHHmmss") + ssss.ToString().PadLeft(5, '0'); |
| | | //erpApiService.GetSuppliersAsync(); |
| | | |
| | | //erpApiService.GetMaterialUnitAsync(); |
| | | //var sss=await _invokeMESService.NewMaterielToMes(new WIDESEA_DTO.Basic.MaterielToMesDTO |
| | | // { |
| | | // reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | // reqCode = Guid.NewGuid().ToString(), |
| | | // oldmaterialCode = "b001", |
| | | // newmaterialCode = "Bar01", |
| | | // unit = "A01", |
| | | // operationType = 1, |
| | | // supplyCode = "A0001", |
| | | // batchNo = "A0002", |
| | | // materialCode = "FC00001", |
| | | // warehouseCode = "", |
| | | // factoryArea = "A01", |
| | | // qty = "20.0", |
| | | // }); |
| | | erpApiService.GetMaterialUnitAsync(); |
| | | |
| | | var sss = await _invokeMESService.NewMaterielToMes(new WIDESEA_DTO.Basic.MaterielToMesDTO |
| | | { |
| | | reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | reqCode = Guid.NewGuid().ToString(), |
| | | oldmaterialCode = "b001", |
| | | newmaterialCode = "Bar01", |
| | | unit = "A01", |
| | | operationType = 1, |
| | | supplyCode = "A0001", |
| | | batchNo = "A0002", |
| | | materialCode = "FC00001", |
| | | warehouseCode = "", |
| | | factoryArea = "A01", |
| | | qty =20, |
| | | }); |
| | | |
| | | //await _eSSApiService.MoveContainerAsync(new WIDESEA_DTO.Basic.MoveContainerRequest |
| | | //{ |
| | |
| | | //await erpApiService.GetMaterialInfoAsync(new WIDESEA_DTO.Basic.MaterialRequest()); |
| | | |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | return WebResponseContent.Instance.OK( ); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_StockService; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Stock |
| | | { |
| | |
| | | |
| | | return Json(result); |
| | | } |
| | | |
| | | [HttpPost, Route("GetPageDataByMateriel"),AllowAnonymous] |
| | | public PageGridData<StockDetailDtO> GetPageDataByMateriel([FromBody] PageDataOptions options) |
| | | { |
| | | return Service.GetPageDataByMateriel(options); |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.HttpContextUser; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.Outbound; |
| | |
| | | CreateMap<Dt_ReceiveOrderDetail, Dt_CheckOrder>().ForMember(a => a.ReceivedQuantity, b => b.MapFrom(x => x.ReceivedQuantity)).ForMember(a => a.MaterielCode, b => b.MapFrom(x => x.MaterielCode)).ForMember(a => a.CheckOrderStatus, b => b.MapFrom(x => CheckOrderStatusEnum.NotCheck.ObjToInt())); |
| | | |
| | | CreateMap<Dt_Task, WMSTaskDTO>(); |
| | | |
| | | CreateMap<Dt_Task, Dt_Task_Hty>() |
| | | .ForMember(dest => dest.SourceId, opt => opt.Ignore()) // æå¨å¡«å
ï¼å¿½ç¥æ å° |
| | | .ForMember(dest => dest.OperateType, opt => opt.Ignore()); // æå¨å¡«å
ï¼å¿½ç¥æ å° |
| | | } |
| | | } |
| | | } |