| ¶Ô±ÈÐÂÎļþ |
| | |
| | | window.webConfig = { |
| | | "webApiBaseUrl": "http://localhost:9291/", |
| | | "webApiProduction":"http://localhost:9291/" |
| | | |
| | | // "webApiBaseUrl": "http://172.19.69.152:9291/", |
| | | // "webApiProduction":"http://172.19.69.152:9291/" |
| | | } |
| | |
| | | }); |
| | | }, |
| | | 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); |
| | | // 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); |
| | | |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value, |
| | | }); |
| | | |
| | | 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; |
| | | } |
| | | |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | detailIds: keys, |
| | | outboundTargetLocation: formData.selectedPlatform, |
| | | outboundQuantity: 1, |
| | | operator: "", |
| | | orderNo: this.row.orderNo, |
| | | }; |
| | | |
| | | this.http |
| | | .post( |
| | | "api/Outbound/ProcessPickingOutbound", |
| | | 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("请æ±å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | // const formData = reactive({ |
| | | // selectedPlatform: platformOptions[0].value, |
| | | // }); |
| | | }, |
| | | style: { |
| | | borderRadius: "4px", |
| | | padding: "8px 20px", |
| | | }, |
| | | }, "ç¡®å®åºåº"), |
| | | ]), |
| | | ]), |
| | | } |
| | | ); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | // 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; |
| | | // } |
| | | |
| | | // const keys = this.selection.map((item) => item.id); |
| | | // const requestParams = { |
| | | // detailIds: keys, |
| | | // outboundTargetLocation: formData.selectedPlatform, |
| | | // outboundQuantity: 1, |
| | | // operator: "", |
| | | // orderNo: this.row.orderNo, |
| | | // }; |
| | | |
| | | // this.http |
| | | // .post( |
| | | // "api/Outbound/ProcessPickingOutbound", |
| | | // 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", |
| | | // }, |
| | | // }, "ç¡®å®åºåº"), |
| | | // ]), |
| | | // ]), |
| | | // } |
| | | // ); |
| | | |
| | | // vnode.appContext = this.$.appContext; |
| | | // render(vnode, mountNode); |
| | | }, |
| | | outboundbatch() { |
| | | if (this.selection.length === 0) { |
| | |
| | | |
| | | //æ¤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'; |
| | | |
| | | import gridBody from './extend/newAllocateOrderDetail.vue' |
| | | let extension = { |
| | | components: { |
| | |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [ |
| | | /* { |
| | | name: 'åºåº', |
| | | type: 'primary', |
| | | value: 'åºåº', |
| | | onClick: function () { // ä¿®å¤ï¼ç¨ElMessageæ¿ä»£this.$message |
| | | const selectedRows = this.$refs.table.getSelected(); |
| | | if (selectedRows.length === 0) { |
| | | ElMessage.warning('请å
éæ©è¦çæä»»å¡çè¡'); |
| | | return; |
| | | } |
| | | if (selectedRows.length > 1) { |
| | | ElMessage.warning('åªè½éæ©ä¸è¡'); |
| | | return; |
| | | } |
| | | |
| | | |
| | | // æææ ¡éªéè¿ï¼è§¦å主ç»ä»¶æå¼åºåºå¼¹çª |
| | | console.log('æææ ¡éªéè¿ï¼è§¦åopenOutboundDialogäºä»¶ï¼åæ®æ°æ®ï¼', selectedRows[0]); |
| | | |
| | | this.$emit('openOutboundDialog', { |
| | | transNo: selectedRows[0].transNo, // åºåºåç¼å· |
| | | createDate: selectedRows[0].createDate || new Date().toLocaleDateString() // åºåºæ¥æ |
| | | }); |
| | | } |
| | | }, */ |
| | | { |
| | | name: '空æçåºåº', |
| | | type: 'primary', |
| | | value: '空æçåºåº', |
| | | onClick: function () { |
| | | |
| | | |
| | | const platformOptions = Array.from({ length: 1 }, (_, i) => { |
| | | const num = 1; |
| | | return { label: `ç«å°${num}`, value: `1-2` }; |
| | | }); |
| | | |
| | | const quantityOptions = Array.from({ length: 6 }, (_, i) => ({ |
| | | label: (i + 1).toString(), |
| | | value: i + 1 |
| | | })); |
| | | |
| | | const warehouseOptions = 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æ ¼å¼ |
| | | warehouseOptions.value = data.map(item => ({ |
| | | label: item.locationTypeDesc, |
| | | value: item.locationType |
| | | })); |
| | | } else { |
| | | ElMessage.error('è·ååºåå表失败'); |
| | | warehouseOptions.value = []; |
| | | } |
| | | } catch (err) { |
| | | ElMessage.error('åºåæ°æ®è¯·æ±å¼å¸¸ï¼è¯·ç¨åéè¯'); |
| | | warehouseOptions.value = []; |
| | | } finally { |
| | | isLoadingWarehouses.value = false; |
| | | } |
| | | }; |
| | | |
| | | const mountNode = document.createElement('div'); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | |
| | | const formData = reactive({ |
| | | warehouseCode:'', |
| | | palletCode: '', |
| | | selectedPlatform: platformOptions[0].value, |
| | | quantity:1 |
| | | }); |
| | | |
| | | const vnode = createVNode(ElDialog, { |
| | | title: '空æçåºåº', |
| | | width: '500px', |
| | | 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); |
| | | } |
| | | }, |
| | | style: { |
| | | padding: '20px 0', |
| | | borderRadius: '8px' |
| | | } |
| | | }, { |
| | | default: () => h(ElForm, { |
| | | model: formData, |
| | | rules: { |
| | | warehouseCode:[ |
| | | { required: true, message: 'è¯·éæ©åºå', trigger: ['change', 'blur'] } |
| | | ], |
| | | palletCode: [ |
| | | { type: 'string', message: 'æç®±å·å¿
须为å符串', trigger: 'blur' } |
| | | ], |
| | | selectedPlatform: [ |
| | | { required: true, message: 'è¯·éæ©åºåºç«å°', trigger: 'change' } |
| | | ], |
| | | quantity:[ |
| | | { required: true, message: 'è¯·éæ©ç©ºç®±æ°é', trigger: 'change'} |
| | | ] |
| | | }, |
| | | ref: 'batchOutForm', |
| | | labelWidth: '100px', |
| | | style: { |
| | | padding: '0 30px', |
| | | } |
| | | }, |
| | | [ |
| | | // h(ElFormItem, { |
| | | // label: 'ä»åºåºå', |
| | | // prop: 'warehouseCode', |
| | | // style: { |
| | | // marginBottom: '24px' |
| | | // } |
| | | // }, [ |
| | | // h(ElSelect, { |
| | | // placeholder: 'è¯·éæ©ä»åºåºå', |
| | | // modelValue: formData.warehouseCode, |
| | | // 'onUpdate:modelValue': (val) => { |
| | | // formData.warehouseCode = val; |
| | | // }, |
| | | // style: { |
| | | // width: '100%', |
| | | // height: '40px', |
| | | // borderRadius: '4px', |
| | | // borderColor: '#dcdfe6' |
| | | // } |
| | | // }, warehouseOptions.value.map(platform => |
| | | // h(ElOption, { label: platform.label, value: platform.value }) |
| | | // )) |
| | | // ]), |
| | | h(ElFormItem, { |
| | | label: 'åºåºç«å°', |
| | | prop: 'selectedPlatform', |
| | | style: { |
| | | marginBottom: '24px' |
| | | } |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: 'è¯·éæ©åºåºç«å°', |
| | | 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:'quantity', |
| | | // style:{ |
| | | // marginBottom:'24px' |
| | | // } |
| | | // },[h(ElSelect,{ |
| | | // placeholder:'è¯·éæ©ç©ºç®±æ°é', |
| | | // modelValue:formData.quantity, |
| | | // 'onUpdate:modelValue':(val)=>{ |
| | | // formData.quantity=val; |
| | | // }, |
| | | // style:{ |
| | | // width:'100%', |
| | | // height:'40px', |
| | | // borderRadius:'4px', |
| | | // borderColor:'#dcdfe6' |
| | | // }, |
| | | // filterable:false |
| | | // }, |
| | | // quantityOptions.map(option=> |
| | | // h(ElOption,{ |
| | | // label:option.label, |
| | | // value:option.value |
| | | // }) |
| | | // ) |
| | | // )]), |
| | | h(ElFormItem, { |
| | | label: 'æç®±å·', |
| | | prop: 'palletCode', |
| | | style: { |
| | | marginBottom: '16px' |
| | | } |
| | | }, [ |
| | | h(ElInput, { |
| | | type: 'text', |
| | | placeholder: 'å¯éè¾å
¥æç®±å·ï¼ä¸å¡«åèªå¨åé
空æç®±', |
| | | modelValue: formData.palletCode, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.palletCode = val; |
| | | }, |
| | | style: { |
| | | width: '100%', |
| | | height: '40px', |
| | | borderRadius: '4px', |
| | | borderColor: '#dcdfe6' |
| | | }, |
| | | attrs: { |
| | | placeholderStyle: 'color: #909399;' |
| | | } |
| | | }) |
| | | ]), |
| | | |
| | | 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.batchOutForm; |
| | | try { |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | |
| | | http.post('/api/Task/PalletOutboundTask?palletCode='+formData.palletCode+'&endStation='+formData.selectedPlatform, { |
| | | |
| | | }).then(({ data, status, message }) => { |
| | | if (status) { |
| | | |
| | | ElMessage.success(`åºåºæå`); |
| | | this.refresh(); |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } else { |
| | | ElMessage.error(message || data?.message || 'åºåºå¤±è´¥'); |
| | | } |
| | | }).catch(() => { |
| | | ElMessage.error('请æ±å¤±è´¥ï¼è¯·ç¨åéè¯'); |
| | | }); |
| | | }, |
| | | style: { |
| | | borderRadius: '4px', |
| | | padding: '8px 20px' |
| | | } |
| | | }, 'ç¡®å®') |
| | | ]) |
| | | ]) |
| | | }); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | } |
| | | } |
| | | ], box: [], detail: [] }, //æ©å±çæé® |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-form ref="form" :model="form" label-width="90px" v-if="isBatch === 1" v-show="this.outboundQuantity>1"> |
| | | <el-form ref="form" :model="form" label-width="90px" v-if="isBatch === 1"> |
| | | <el-form-item label="åºåºæ°é:"> |
| | | <el-input-number v-model="outboundQuantity" :controls="true" placeholder="è¯·éæ©åºåºæ°é" |
| | | style="width: 100%;"></el-input-number> |
| | |
| | | const requestParams = { |
| | | detailIds: this.keys, |
| | | OutboundTargetLocation: this.station, |
| | | outboundQuantity: this.outboundQuantity, |
| | | outboundQuantity: this.keys.length > 1 ? 1 : this.outboundQuantity, |
| | | operator: "", |
| | | orderNo: this.orderNo, |
| | | }; |
| | | console.log(requestParams); |
| | | this.http.post("api/Outbound/ProcessPickingOutbound", requestParams, 'æ°æ®å¤çä¸...') |
| | | .then((x) => { |
| | | if (!x.status) { |
| | |
| | | <stock-select ref="child" @parentCall="parentCall"></stock-select> |
| | | <selected-stock ref="selectedStock" @parentCall="parentCall"></selected-stock> |
| | | <NoStockOut ref="NoStockOut" @parentCall="parentCall"></NoStockOut> |
| | | <DirectOutbound ref="DirectOutbound" @parentCall="parentCall"></DirectOutbound> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | 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 DirectOutbound from "./DirectOutbound.vue"; |
| | | |
| | | export default { |
| | | components: { VolBox, VolForm, StockSelect, SelectedStock, NoStockOut }, |
| | | components: { VolBox, VolForm, StockSelect, SelectedStock, NoStockOut, DirectOutbound }, |
| | | data() { |
| | | return { |
| | | row: null, |
| | |
| | | }); |
| | | }, |
| | | 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); |
| | | // 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); |
| | | |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value, |
| | | }); |
| | | |
| | | 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; |
| | | } |
| | | |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | detailIds: keys, |
| | | outboundTargetLocation: formData.selectedPlatform, |
| | | outboundQuantity: 1, |
| | | operator: "", |
| | | orderNo: this.row.orderNo, |
| | | }; |
| | | |
| | | this.http |
| | | .post( |
| | | "api/Outbound/ProcessPickingOutbound", |
| | | 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("请æ±å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | // const formData = reactive({ |
| | | // selectedPlatform: platformOptions[0].value, |
| | | // }); |
| | | }, |
| | | style: { |
| | | borderRadius: "4px", |
| | | padding: "8px 20px", |
| | | }, |
| | | }, "ç¡®å®åºåº"), |
| | | ]), |
| | | ]), |
| | | } |
| | | ); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | // 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; |
| | | // } |
| | | |
| | | // const keys = this.selection.map((item) => item.id); |
| | | // const requestParams = { |
| | | // detailIds: keys, |
| | | // outboundTargetLocation: formData.selectedPlatform, |
| | | // outboundQuantity: 1, |
| | | // operator: "", |
| | | // orderNo: this.row.orderNo, |
| | | // }; |
| | | |
| | | // this.http |
| | | // .post( |
| | | // "api/Outbound/ProcessPickingOutbound", |
| | | // 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", |
| | | // }, |
| | | // }, "ç¡®å®åºåº"), |
| | | // ]), |
| | | // ]), |
| | | // } |
| | | // ); |
| | | |
| | | // 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); |
| | | |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value, |
| | | outboundDecimal: "", |
| | | }); |
| | | |
| | | 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) => { |
| | | 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", |
| | | precision: 2, |
| | | min: 0.01, |
| | | }), |
| | | ]), |
| | | 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; |
| | | } |
| | | |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | detailIds: keys, |
| | | outboundTargetLocation: formData.selectedPlatform, |
| | | outboundQuantity: formData.outboundDecimal, |
| | | outboundQuantity: this.selection[0].orderQuantity - this.selection[0].lockQuantity, |
| | | operator: "", |
| | | orderNo: this.row.orderNo, |
| | | isBatch: this.isBatch |
| | | }; |
| | | console.log(requestParams); |
| | | this.$refs.DirectOutbound.open(requestParams); |
| | | |
| | | this.http |
| | | .post( |
| | | "api/Outbound/ProcessPickingOutbound", |
| | | 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", |
| | | }, |
| | | }, "ç¡®å®åæ¹åºåº"), |
| | | ]), |
| | | ]), |
| | | } |
| | | ); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | }, |
| | | setCurrent(row) { |
| | | this.$refs.singleTable.setCurrentRow(row); |
| | |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | detailIds: keys, |
| | | outboundQuantity: this.selection.length > 1 ? 1 : this.selection[0].orderQuantity - this.selection[0].lockQuantity, |
| | | outboundQuantity: this.selection[0].orderQuantity - this.selection[0].lockQuantity, |
| | | operator: "", |
| | | orderNo: this.row.orderNo, |
| | | isBatch: this.isBatch |
| | |
| | | if (rows.length == 0) return this.$error("è¯·éæ©æ°æ®!"); |
| | | if (rows.length > 1) return this.$error("è¯·éæ©ä¸æ¡æ°æ®!"); |
| | | |
| | | |
| | | // ç¡®ä¿éä¸è¡æidï¼æ ¹æ®å®é
è¡¨æ ¼æ°æ®åæ®µè°æ´ï¼æ¯å¦rows[0].detailIdçï¼ |
| | | const selectedId = rows[0].id || rows[0].detailId; |
| | | if (!selectedId) return this.$error("é䏿°æ®ç¼ºå°å¿
è¦IDåæ®µ!"); |
| | | |
| | | if(rows[0].orderStatus!=0&&rows[0].orderStatus!=1)return this.$error("è¯¥åæ®å·²ç»å®æ"); |
| | | |
| | | const platformOptions = [ |
| | | { label: "ç«å°2", value: "2-1" }, |
| | | { label: "ç«å°3", value: "3-1" }, |
| | |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [ |
| | | { |
| | | name: 'éä¸ä»»å¡', |
| | | type: 'primary', |
| | | value: 'éä¸ä»»å¡', |
| | | onClick: async function () { |
| | | const selectRows = this.$refs.table.getSelected(); |
| | | if (selectRows.length == 0) return ElMessage.warning('è¯·éæ©ä¸æ¡ä»»å¡'); |
| | | if (selectRows.length > 1) return ElMessage.warning('åªè½éæ©ä¸æ¡ä»»å¡'); |
| | | const taskNum = selectRows[0].taskId; |
| | | try{ |
| | | const response = await http.post('api/Task/RecreateTasks?taskNums='+taskNum, 'ä»»å¡éä¸ä¸...'); |
| | | const { status, message ,data} = response; |
| | | if (status) { |
| | | ElMessage.success(`éä¸ä»»å¡æå`); |
| | | this.refresh(); |
| | | }else{ |
| | | ElMessage.error(`éä¸ä»»å¡å¤±è´¥ï¼${message}`); |
| | | } |
| | | }catch(err){ |
| | | ElMessage.error(`éä¸ä»»å¡å¼å¸¸ï¼${err.message}`); |
| | | } |
| | | } |
| | | } |
| | | ], box: [], detail: [] }, //æ©å±çæé® |
| | | buttons: { view: [ ], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | |
| | | const codeImgSrc = ref(""); |
| | | const value = ref(""); |
| | | const userInfo = reactive({ |
| | | userName: "admin", |
| | | password: "123456", |
| | | userName: "", |
| | | password: "", |
| | | verificationCode: "1234", |
| | | UUID: undefined, |
| | | }); |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | @openPalletDialog="handleOpenPalletDialog" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | <view-grid ref="grid" @openPalletDialog="handleOpenPalletDialog" :columns="columns" :detail="detail" |
| | | :editFormFields="editFormFields" :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" :table="table" :extend="extend"> |
| | | </view-grid> |
| | | <!-- 2. ç»çå¼¹çªï¼ç¡®ä¿propsåäºä»¶ç»å®æ£ç¡® --> |
| | | <PalletDialog |
| | | v-model:visible="palletVisible" |
| | | :docNo="currentPalletDocNo" |
| | | @back-success="handlePalletBackSuccess" |
| | | ></PalletDialog> |
| | | |
| | | <PalletDialog v-model:visible="palletVisible" :docNo="currentPalletDocNo" @back-success="handlePalletBackSuccess"> |
| | | </PalletDialog> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/inbound/allocateinboundOrder.js"; |
| | |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | | field: "materielName", |
| | | title: "ç©æåç§°", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | bind: { key: "MaterielNames", data: [] }, |
| | | bind: { key: "materielInfo", data: [] }, |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | | field: "materielName", |
| | | title: "ç©æåç§°", |
| | | type: "string", |
| | | width: 120, |
| | | width: 150, |
| | | align: "left", |
| | | bind: { key: "MaterielNames", data: [] }, |
| | | bind: { key: "materielInfo", data: [] }, |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | @openOutboundDialog="handleOpenOutboundDialog" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | <view-grid ref="grid" @openOutboundDialog="handleOpenOutboundDialog" :columns="columns" :detail="detail" |
| | | :editFormFields="editFormFields" :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" :table="table" :extend="extend"> |
| | | </view-grid> |
| | | <!-- åºåºæä½å¼¹çª --> |
| | | <OutboundDialog |
| | | v-model:visible="outboundVisible" |
| | | :selected-document="selectedOutboundDocument" |
| | | @outbound-success="handleOutboundSuccess" |
| | | ></OutboundDialog> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/outbound/allocateoutboundOrder.js"; |
| | | import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue'; |
| | | import { ref, defineComponent } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import OutboundDialog from "@/extension/outbound/extend/OutBound.vue"; // å¼å
¥åºåºå¼¹çªç»ä»¶ |
| | | |
| | | |
| | | export default defineComponent({ |
| | | components: { |
| | | // å
³é®ä¿®å¤2ï¼ç»ä»¶æ³¨åå䏿¨¡æ¿æ ç¾åéé
ï¼kebab-case对åºview-gridï¼ |
| | | viewGrid: ViewGrid, // 注å为kebab-caseï¼æ¨¡æ¿ç¨<view-grid> |
| | | OutboundDialog // 注ååºåºå¼¹çªç»ä»¶ |
| | | }, |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | |
| | | key: "id", |
| | | }); |
| | | // è°æ¨å¼¹çªç¸å
³ |
| | | const outboundVisible = ref(false); |
| | | const selectedOutboundDocument = ref({}); // åå¨éä¸çè°æ¨åæ°æ® |
| | | // const outboundVisible = ref(false); |
| | | // const selectedOutboundDocument = ref({}); // åå¨éä¸çè°æ¨åæ°æ® |
| | | |
| | | // æå¼è°æ¨å¼¹çªï¼ä»æ©å±é
ç½®çæé®äºä»¶è§¦åï¼ |
| | | const handleOpenOutboundDialog = (docData) => { |
| | | selectedOutboundDocument.value = docData; // ä¿åéä¸çåæ®æ°æ® |
| | | outboundVisible.value = true; // æ¾ç¤ºå¼¹çª |
| | | }; |
| | | // // æå¼è°æ¨å¼¹çªï¼ä»æ©å±é
ç½®çæé®äºä»¶è§¦åï¼ |
| | | // const handleOpenOutboundDialog = (docData) => { |
| | | // selectedOutboundDocument.value = docData; // ä¿åéä¸çåæ®æ°æ® |
| | | // outboundVisible.value = true; // æ¾ç¤ºå¼¹çª |
| | | // }; |
| | | |
| | | // è°æ¨æååçåè° |
| | | const handleOutboundSuccess = (docNo) => { |
| | | ElMessage.success(`åæ® ${docNo} è°æ¨æå`); |
| | | gridRef.value?.refresh(); // å·æ°è¡¨æ ¼æ°æ® |
| | | }; |
| | | // // è°æ¨æååçåè° |
| | | // const handleOutboundSuccess = (docNo) => { |
| | | // ElMessage.success(`åæ® ${docNo} è°æ¨æå`); |
| | | // gridRef.value?.refresh(); // å·æ°è¡¨æ ¼æ°æ® |
| | | // }; |
| | | |
| | | // åå§åæ©å±é
ç½®ï¼ä¸ºè°æ¨æé®æ·»å äºä»¶è§¦åé»è¾ |
| | | const initExtension = () => { |
| | | // æ¾å°"è°æ¨"æé®å¹¶ç»å®æå¼å¼¹çªçé»è¾ |
| | | const outboundBtn = extend.buttons.view.find(btn => btn.name === 'åºåº'); |
| | | if (outboundBtn) { |
| | | const originalOnClick = outboundBtn.onClick; |
| | | outboundBtn.onClick = function() { |
| | | // å
æ§è¡åææ ¡éªé»è¾ |
| | | const selectedRows = this.$refs.table.getSelected(); |
| | | if (selectedRows.length === 1) { |
| | | // æ ¡éªéè¿åï¼è§¦å主ç»ä»¶çåºåºå¼¹çªäºä»¶ |
| | | this.$emit('openOutboundDialog', selectedRows[0]); |
| | | } else { |
| | | // åæé»è¾å·²å¤çæç¤ºï¼æ ééå¤ |
| | | originalOnClick.call(this); |
| | | } |
| | | }; |
| | | } |
| | | }; |
| | | // // åå§åæ©å±é
ç½®ï¼ä¸ºè°æ¨æé®æ·»å äºä»¶è§¦åé»è¾ |
| | | // const initExtension = () => { |
| | | // // æ¾å°"è°æ¨"æé®å¹¶ç»å®æå¼å¼¹çªçé»è¾ |
| | | // const outboundBtn = extend.buttons.view.find(btn => btn.name === 'åºåº'); |
| | | // if (outboundBtn) { |
| | | // const originalOnClick = outboundBtn.onClick; |
| | | // outboundBtn.onClick = function () { |
| | | // // å
æ§è¡åææ ¡éªé»è¾ |
| | | // const selectedRows = this.$refs.table.getSelected(); |
| | | // if (selectedRows.length === 1) { |
| | | // // æ ¡éªéè¿åï¼è§¦å主ç»ä»¶çåºåºå¼¹çªäºä»¶ |
| | | // this.$emit('openOutboundDialog', selectedRows[0]); |
| | | // } else { |
| | | // // åæé»è¾å·²å¤çæç¤ºï¼æ ééå¤ |
| | | // originalOnClick.call(this); |
| | | // } |
| | | // }; |
| | | // } |
| | | // }; |
| | | return { |
| | | table, |
| | | extend, |
| | |
| | | columns, |
| | | detail, |
| | | // åºåºç¸å
³ |
| | | outboundVisible, |
| | | selectedOutboundDocument, |
| | | handleOpenOutboundDialog, |
| | | handleOutboundSuccess |
| | | // outboundVisible, |
| | | // selectedOutboundDocument, |
| | | // handleOpenOutboundDialog, |
| | | // handleOutboundSuccess |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | @openOutboundDialog="handleOpenOutboundDialog" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | <view-grid ref="grid" @openOutboundDialog="handleOpenOutboundDialog" :columns="columns" :detail="detail" |
| | | :editFormFields="editFormFields" :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" :table="table" :extend="extend"> |
| | | </view-grid> |
| | | <!-- åºåºæä½å¼¹çª --> |
| | | <OutboundDialog |
| | | v-model:visible="outboundVisible" |
| | | :selected-document="selectedOutboundDocument" |
| | | @outbound-success="handleOutboundSuccess" |
| | | ></OutboundDialog> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/outbound/outboundOrder.js"; |
| | | import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue'; |
| | | import { ref, defineComponent } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import OutboundDialog from "@/extension/outbound/extend/OutBound.vue"; // å¼å
¥åºåºå¼¹çªç»ä»¶ |
| | | |
| | | |
| | | export default defineComponent({ |
| | | components: { |
| | | // å
³é®ä¿®å¤2ï¼ç»ä»¶æ³¨åå䏿¨¡æ¿æ ç¾åéé
ï¼kebab-case对åºview-gridï¼ |
| | | viewGrid: ViewGrid, // 注å为kebab-caseï¼æ¨¡æ¿ç¨<view-grid> |
| | | OutboundDialog // 注ååºåºå¼¹çªç»ä»¶ |
| | | }, |
| | | |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | |
| | | width: 90, |
| | | align: "left", |
| | | edit: { type: "number" }, |
| | | readonly: true |
| | | }, |
| | | { |
| | | field: "rowNo", |
| | |
| | | sortName: "id", |
| | | key: "id", |
| | | }); |
| | | // åºåºå¼¹çªç¸å
³ |
| | | const outboundVisible = ref(false); |
| | | const selectedOutboundDocument = ref({}); // åå¨éä¸çåºåºåæ°æ® |
| | | |
| | | // æå¼åºåºå¼¹çªï¼ä»æ©å±é
ç½®çæé®äºä»¶è§¦åï¼ |
| | | const handleOpenOutboundDialog = (docData) => { |
| | | selectedOutboundDocument.value = docData; // ä¿åéä¸çåæ®æ°æ® |
| | | outboundVisible.value = true; // æ¾ç¤ºå¼¹çª |
| | | }; |
| | | |
| | | // åºåºæååçåè° |
| | | const handleOutboundSuccess = (docNo) => { |
| | | ElMessage.success(`åæ® ${docNo} åºåºæå`); |
| | | gridRef.value?.refresh(); // å·æ°è¡¨æ ¼æ°æ® |
| | | }; |
| | | |
| | | // åå§åæ©å±é
ç½®ï¼ä¸ºåºåºæé®æ·»å äºä»¶è§¦åé»è¾ |
| | | const initExtension = () => { |
| | | // æ¾å°"åºåº"æé®å¹¶ç»å®æå¼å¼¹çªçé»è¾ |
| | | const outboundBtn = extend.buttons.view.find(btn => btn.name === 'åºåº'); |
| | | if (outboundBtn) { |
| | | const originalOnClick = outboundBtn.onClick; |
| | | outboundBtn.onClick = function() { |
| | | // å
æ§è¡åææ ¡éªé»è¾ |
| | | const selectedRows = this.$refs.table.getSelected(); |
| | | if (selectedRows.length === 1) { |
| | | // æ ¡éªéè¿åï¼è§¦å主ç»ä»¶çåºåºå¼¹çªäºä»¶ |
| | | this.$emit('openOutboundDialog', selectedRows[0]); |
| | | } else { |
| | | // åæé»è¾å·²å¤çæç¤ºï¼æ ééå¤ |
| | | originalOnClick.call(this); |
| | | } |
| | | }; |
| | | } |
| | | }; |
| | | return { |
| | | table, |
| | | extend, |
| | |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | // åºåºç¸å
³ |
| | | outboundVisible, |
| | | selectedOutboundDocument, |
| | | handleOpenOutboundDialog, |
| | | handleOutboundSuccess |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | bind: { key: "materielInfo", data: [] }, |
| | | }, |
| | | { |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "decimal", |
| | | width: 90, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | width: 90, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "supplyCode", |
| | |
| | | field: "outboundQuantity", |
| | | title: "åºåºæ°é", |
| | | type: "string", |
| | | width: 180, |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | bind: { key: "materielInfo", data: [] }, |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions" |
| | | :table="table" :extend="extend"> |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | |
| | | [ |
| | | { title: "ä»»å¡å·", field: "taskNum", type: "int" }, |
| | | { title: "æçç¼å·", field: "palletCode", type: "like" }, |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | | // { title: "å建人", field: "creater", type: "like" }, |
| | | ], |
| | | [ |
| | | //{ title: "ä»»å¡ç±»å",field: "taskType",type: "selectList",dataKey: "taskType",data: [],}, |
| | | { title: "ä»»å¡ç±»å", field: "taskType", type: "selectList", dataKey: "taskType", data: [], }, |
| | | { title: "ä»»å¡ç¶æ",field: "taskStatus",type: "selectList",dataKey: "taskStatusEnum",data: [],}, |
| | | { title: "å··éå·", field: "roadway", type: "like" }, |
| | | ], |
| | | [ |
| | | { title: "èµ·å§å°å", field: "sourceAddress", type: "like" }, |
| | | { title: "ç®æ å°å", field: "targetAddress", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | // { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "taskType", |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions" |
| | | :table="table" :extend="extend"> |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | |
| | | [ |
| | | { title: "ä»»å¡å·", field: "taskNum", type: "int" }, |
| | | { title: "æçç¼å·", field: "palletCode", type: "like" }, |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | | // { title: "å建人", field: "creater", type: "like" }, |
| | | ], |
| | | [ |
| | | //{ title: "ä»»å¡ç±»å",field: "taskType",type: "selectList",dataKey: "taskType",data: [],}, |
| | | { title: "ä»»å¡ç±»å", field: "taskType", type: "selectList", dataKey: "taskType", data: [], }, |
| | | { title: "ä»»å¡ç¶æ",field: "taskStatus",type: "selectList",dataKey: "taskStatusEnum",data: [],}, |
| | | { title: "å··éå·", field: "roadway", type: "like" }, |
| | | // { title: "å··éå·", field: "roadway", type: "like" }, |
| | | ], |
| | | [ |
| | | { title: "èµ·å§å°å", field: "sourceAddress", type: "like" }, |
| | | { title: "ç®æ å°å", field: "targetAddress", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | // { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | // { |
| | | // field: "taskType", |
| | | // title: "ä»»å¡ç±»å", |
| | | // type: "int", |
| | | // width: 120, |
| | | // align: "left", |
| | | // bind: { key: "taskType", data: [] }, |
| | | // }, |
| | | { |
| | | field: "taskType", |
| | | title: "ä»»å¡ç±»å", |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "taskType", data: [] }, |
| | | }, |
| | | { |
| | | field: "taskStatus", |
| | | title: "ä»»å¡ç¶æ", |
| | |
| | | public readonly IRepository<Dt_AllocateOrder> _allocateOrderRepository; |
| | | public readonly IRepository<Dt_AllocateOrderDetail> _allocateOrderDetailRepository; |
| | | private readonly IMaterielInfoService _materielInfoService; |
| | | private readonly IRepository<Dt_MaterielInfo> _materielInforepository; |
| | | public readonly IRepository<Dt_InboundOrderDetail> _inboundOrderDetailRepository; |
| | | |
| | | private readonly ILogger<AllocateService> _logger; |
| | |
| | | IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository, |
| | | IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, |
| | | ILogger<AllocateService> logger, |
| | | IMaterielInfoService materielInfoService) : base(BaseDal) |
| | | IMaterielInfoService materielInfoService, |
| | | IRepository<Dt_MaterielInfo> materielInforepository) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _inboundService = inboundService; |
| | |
| | | _logger = logger; |
| | | _inboundOrderDetailRepository = inboundOrderDetailRepository; |
| | | _materielInfoService = materielInfoService; |
| | | _materielInforepository = materielInforepository; |
| | | } |
| | | |
| | | public IRepository<Dt_AllocateOrder> Repository => BaseDal; |
| | |
| | | .Select(g => g.First()) |
| | | .ToList(); |
| | | |
| | | // è·åææç©æä»£ç |
| | | var materielCodes = distinctDetails.Select(d => d.MaterielCode).Distinct().ToList(); |
| | | |
| | | // 仿°æ®åºæ¥è¯¢ç©æä¿¡æ¯ï¼åè®¾ä½¿ç¨ DbContextï¼ |
| | | var materielInfos = _materielInforepository.Db.Queryable<Dt_MaterielInfo>() |
| | | .Where(m => materielCodes.Contains(m.MaterielCode)) |
| | | .Select(m => new { m.MaterielCode, m.MaterielName }) |
| | | .ToDictionary(m => m.MaterielCode, m => m.MaterielName); |
| | | |
| | | return new List<Dt_InboundOrder>() |
| | | { |
| | | new Dt_InboundOrder(){ |
| | |
| | | Remark=allocateOrder.Remark, |
| | | Details=distinctDetails.Select(detail=>new Dt_InboundOrderDetail |
| | | { |
| | | |
| | | OrderId= 0, |
| | | MaterielCode=detail.MaterielCode, |
| | | MaterielName="", |
| | | MaterielName=detail.MaterielName, |
| | | BatchNo=detail.BatchNo, |
| | | OrderQuantity=detail.OrderQuantity, |
| | | ReceiptQuantity=detail.ReceiptQuantity, |
| | |
| | | using System.Text.Json; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.LogHelper; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_IBasicService; |
| | | |
| | |
| | | var result = await PostAsync<TaskModel, ApiResponse<TasksData>>(url, request); |
| | | if (result != null && result.Code == 0) |
| | | { |
| | | _logger.LogInformation(result.Serialize()); |
| | | |
| | | return true; |
| | | } |
| | | return false; |
| | |
| | | |
| | | private async Task<TResponse> PostAsync<TRequest, TResponse>(string url, TRequest request) |
| | | { |
| | | |
| | | TResponse response1 = (TResponse)Activator.CreateInstance(typeof(TResponse)); |
| | | try |
| | | { |
| | | string json = JsonConvert.SerializeObject(request, new JsonSerializerSettings |
| | | { |
| | | ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() |
| | |
| | | throw new HttpRequestException(body); |
| | | } |
| | | |
| | | return JsonConvert.DeserializeObject<TResponse>(body); |
| | | response1 = JsonConvert.DeserializeObject<TResponse>(body); |
| | | |
| | | return response1; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Add(request == null ? "" : JsonConvert.SerializeObject(request), response1 == null ? ex.ToString() : JsonConvert.SerializeObject(response1)); |
| | | throw new Exception(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | Logger.Add(request == null ? "" : JsonConvert.SerializeObject(request), response1 == null ? "" : JsonConvert.SerializeObject(response1)); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.HttpContextUser; |
| | | using WIDESEA_Core.LogHelper; |
| | | using WIDESEA_Core.Util; |
| | | using WIDESEA_DTO.Base; |
| | | using WIDESEA_DTO.ReturnMES; |
| | |
| | | |
| | | public WebResponseContent OutboundFeedback(string orderNo) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_OutboundOrder outboundOrder = _outboundOrderRepository.Db.Queryable<Dt_OutboundOrder>().Where(x => x.OrderNo == orderNo).Includes(x => x.Details).First(); |
| | | if (outboundOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçåºåºåä¿¡æ¯"); |
| | | return webResponse = WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçåºåºåä¿¡æ¯"); |
| | | } |
| | | |
| | | List<Dt_MesReturnRecord> returnRecords = BaseDal.QueryData(x => x.OrderNo == orderNo && x.OrderId == outboundOrder.Id && x.ReturnStatus == 2); |
| | |
| | | MaterialOutboundReturnDTO? returnDTO = BuildOutboundFeedbackData(outboundOrder); |
| | | if (returnDTO == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æå»ºåè°å¯¹è±¡å¤±è´¥"); |
| | | return webResponse = WebResponseContent.Instance.Error($"æå»ºåè°å¯¹è±¡å¤±è´¥"); |
| | | } |
| | | |
| | | if (returnDTO.Details.Count <= 0) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è¯¥åæ®æ æç»å¯åä¼ "); |
| | | return webResponse = WebResponseContent.Instance.Error($"è¯¥åæ®æ æç»å¯åä¼ "); |
| | | } |
| | | |
| | | string apiUrl = AppSettings.GetValue("MaterialOutboundFeedbackUrl"); |
| | |
| | | Dt_AllocateOrder allocateOrder = _allocateRepository.QueryFirst(x => x.OrderNo == outboundOrder.OrderNo); |
| | | if (allocateOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçè°æ¨å"); |
| | | return webResponse = WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçè°æ¨å"); |
| | | } |
| | | |
| | | AllocationReturnDTO? returnDTO = BuildAllocationFeedbackData(outboundOrder, allocateOrder.FromWarehouse, allocateOrder.ToWarehouse); |
| | | if (returnDTO == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æå»ºåè°å¯¹è±¡å¤±è´¥"); |
| | | return webResponse = WebResponseContent.Instance.Error($"æå»ºåè°å¯¹è±¡å¤±è´¥"); |
| | | } |
| | | |
| | | if (returnDTO.Details.Count <= 0) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è¯¥åæ®æ æç»å¯åä¼ "); |
| | | return webResponse = WebResponseContent.Instance.Error($"è¯¥åæ®æ æç»å¯åä¼ "); |
| | | } |
| | | |
| | | string apiUrl = AppSettings.GetValue("AllocationFeedbackUrl"); ; |
| | |
| | | lineNos = returnDTO.Details.Select(x => x.LineNo).ToList(); |
| | | httpResponseResult = _httpClientHelper.Post<MesResponseDTO>(apiUrl, requestData); |
| | | httpResponseResult.ApiUrl = apiUrl; |
| | | |
| | | Logger.Add(requestData, httpResponseResult.Serialize()); |
| | | } |
| | | |
| | | bool isSuccess = httpResponseResult.IsSuccess && httpResponseResult.Data.Code == "200"; |
| | |
| | | _unitOfWorkManage.CommitTran(); |
| | | int successCount = returnRecords.Where(x => x.ReturnStatus == 1).Count() + (isSuccess ? 1 : 0); |
| | | int failCount = returnRecords.Where(x => x.ReturnStatus == 2).Count() + (isSuccess ? 1 : 0); |
| | | WebResponseContent responseContent = new WebResponseContent(); |
| | | responseContent.Status = true; |
| | | responseContent.Message = $"åè°æåæ¡æ°ï¼{successCount}ï¼åè°å¤±è´¥æ¡æ°ï¼{failCount}"; |
| | | return responseContent; |
| | | |
| | | webResponse.Status = true; |
| | | webResponse.Message = $"åè°æåæ¡æ°ï¼{successCount}ï¼åè°å¤±è´¥æ¡æ°ï¼{failCount}"; |
| | | |
| | | return webResponse; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | return webResponse = WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | Logger.Add(orderNo, webResponse.Serialize()); |
| | | } |
| | | } |
| | | |
| | |
| | | Normal = 0, |
| | | |
| | | /// <summary> |
| | | /// -è¬ææåº |
| | | /// </summary> |
| | | [Description("æºä»--è¬ææä»")] |
| | | Ordinary = 1, |
| | | |
| | | /// <summary> |
| | | /// ä¸è¯ååº |
| | | /// </summary> |
| | | [Description("ä¸è¯ååº")] |
| | | Defective = 1, |
| | | [Description("æºä»-ä¸è¯åä»")] |
| | | Defective = 2, |
| | | /// <summary> |
| | | /// PCBAåº |
| | | /// </summary> |
| | | [Description("PCBAåº")] |
| | | PCBA = 2, |
| | | [Description("æºä»-çµåä»")] |
| | | Electronic = 3, |
| | | |
| | | /// <summary> |
| | | /// ä¿ç¨åº |
| | | /// </summary> |
| | | [Description("ä¿ç¨åº")] |
| | | Bonded = 3, |
| | | [Description("æºä»-ä¿ç¨ææä»")] |
| | | Bonded = 4, |
| | | |
| | | [Description("æºä»-å
æä»")] |
| | | Package = 5, |
| | | |
| | | [Description("æºä»-è¯äº§ä»")] |
| | | TrialProduction = 6, |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | Type type = entity.GetType(); |
| | | Assembly assembly = type.Assembly; |
| | | Type? htyType = assembly.GetType(type.FullName + "_Hty"); |
| | | |
| | | Type? htyType = assembly.GetTypes().FirstOrDefault(t => !t.IsInterface && !t.IsAbstract && type.IsAssignableFrom(t) && typeof(IBaseHistoryEntity).IsAssignableFrom(t)); |
| | | |
| | | //assembly.GetType(type.FullName + "_Hty"); |
| | | if (htyType != null) |
| | | { |
| | | object? obj = Activator.CreateInstance(htyType); |
| | |
| | | PropertyInfo propertyInfo = propertyInfos[i]; |
| | | PropertyInfo? property = type.GetProperty(propertyInfo.Name); |
| | | |
| | | if (property != null) |
| | | if (property != null && property.CanWrite) |
| | | { |
| | | if (propertyInfo.Name == nameof(BaseEntity.Modifier)) |
| | | { |
| | |
| | | } |
| | | } |
| | | if (obj != null) |
| | | _db.InsertableByObject(obj).AS(type.Name + "_Hty").ExecuteCommand(); |
| | | _db.InsertableByObject(obj).AS(htyType.Name).ExecuteCommand(); |
| | | } |
| | | } |
| | | return DeleteData(entity); |
| | |
| | | string bodyData = sr.ReadToEndAsync().Result; |
| | | if (request.ContentLength <= 100000) |
| | | { |
| | | if (context.Request.Path.Value?.ToLower().Contains("login") ?? false) |
| | | { |
| | | Dictionary<string,object>? valuePairs = JsonConvert.DeserializeObject<Dictionary<string, object>>(bodyData); |
| | | if (valuePairs != null) |
| | | { |
| | | if(valuePairs.ContainsKey("Password")) |
| | | valuePairs["Password"] = "******"; |
| | | else if (valuePairs.ContainsKey("pwd")) |
| | | valuePairs["pwd"] = "******"; |
| | | else if (valuePairs.ContainsKey("password")) |
| | | valuePairs["password"] = "******"; |
| | | else if (valuePairs.ContainsKey("Pwd")) |
| | | valuePairs["Pwd"] = "******"; |
| | | else if (valuePairs.ContainsKey("PASSWORD")) |
| | | valuePairs["PASSWORD"] = "******"; |
| | | else if (valuePairs.ContainsKey("passWord")) |
| | | valuePairs["passWord"] = "******"; |
| | | else if (valuePairs.ContainsKey("PassWord")) |
| | | valuePairs["PassWord"] = "******"; |
| | | bodyData = JsonConvert.SerializeObject(valuePairs); |
| | | } |
| | | } |
| | | obj = new |
| | | { |
| | | QueryString = request.QueryString.ToString(), |
| | |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core; |
| | |
| | | private readonly IRepository<Dt_WarehouseArea> _warehouseAreaRepository; |
| | | private readonly IRepository<Dt_LocationType> _locationTypeRepository; |
| | | private readonly IRepository<Dt_StockInfo> _stockRepository; |
| | | private readonly IRepository<Dt_LocationInfo> _locationInfoRepository; |
| | | private readonly IBasicService _basicService; |
| | | public IRepository<Dt_InboundOrder> Repository => BaseDal; |
| | | |
| | | public InboundOrderService(IRepository<Dt_InboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_Task> taskRepository, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService, IMaterialUnitService materialUnitService, IRepository<Dt_StockInfoDetail> stockDetailRepository, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_StockInfo> stockRepository, IRepository<Dt_LocationType> locationTypeRepository, IMaterielInfoService materielInfoService, IBasicService basicService) : base(BaseDal) |
| | | public InboundOrderService(IRepository<Dt_InboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_Task> taskRepository, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService, IMaterialUnitService materialUnitService, IRepository<Dt_StockInfoDetail> stockDetailRepository, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_StockInfo> stockRepository, IRepository<Dt_LocationType> locationTypeRepository, IMaterielInfoService materielInfoService, IBasicService basicService, IRepository<Dt_LocationInfo> locationInfoRepository) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _locationTypeRepository = locationTypeRepository; |
| | | _materielInfoService = materielInfoService; |
| | | _basicService = basicService; |
| | | _locationInfoRepository = locationInfoRepository; |
| | | } |
| | | |
| | | public async Task<WebResponseContent> ReceiveInboundOrder(List<Dt_InboundOrder> models, int operateType) |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | |
| | | (bool, string, object?) result2 = ModelValidate.ValidateModelData(materielGroupDTO); |
| | | if (!result2.Item1) return content = WebResponseContent.Instance.Error(result2.Item2); |
| | | |
| | | bool code = _locationTypeRepository.Db.Queryable<Dt_LocationType>().Where(x => x.LocationType == materielGroupDTO.WarehouseCode).Any(); |
| | | bool statu = _locationInfoRepository.Db.Queryable<Dt_LocationInfo>().Where(x => x.LocationType == materielGroupDTO.WarehouseCode && x.LocationStatus == (int)LocationStatusEnum.Free).Any(); |
| | | if (!statu) |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"该åºåæ è´§ä½å¯åé
"); |
| | | } |
| | | if (!code) |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"åºå䏿²¡æè¯¥{materielGroupDTO.WarehouseCode}ç¼å·ã"); |
| | |
| | | StockId = stockInfo == null ? 0 : stockInfo.Id, |
| | | Barcode = item.Barcode, |
| | | MaterielCode = item.MaterielCode, |
| | | MaterielName = item.MaterielName, |
| | | BatchNo = item.BatchNo, |
| | | Unit = item.Unit, |
| | | InboundOrderRowNo = item.lineNo, |
| | |
| | | Status = 0, |
| | | OrderNo = inboundOrder.InboundOrderNo, |
| | | BusinessType = inboundOrder.BusinessType, |
| | | ValidDate = inboundOrder.BusinessType == BusinessTypeEnum.å¤é¨ä»åºè°æºä».ToString() ? item.ValidDate : datevaliDate.ValidityDays == null ? null : Convert.ToDateTime(DateTime.Now).AddDays(Convert.ToDouble(datevaliDate.ValidityDays)), |
| | | ValidDate = inboundOrder.BusinessType == BusinessTypeEnum.å¤é¨ä»åºè°æºä».ToString() ? item.ValidDate : datevaliDate == null ? null : Convert.ToDateTime(DateTime.Now).AddDays(Convert.ToDouble(datevaliDate.ValidityDays)), |
| | | //ValidDate = datevaliDate == null ? null : DateTime.Now.AddDays(datevaliDate.ValidityDays), |
| | | }); |
| | | |
| | |
| | | //} |
| | | List<Barcodes> barcodesList = new List<Barcodes>(); |
| | | List<Dt_StockInfoDetail> stockInfoDetails = stockInfo.Details.Where((x => x.StockQuantity > x.OutboundQuantity)).ToList(); |
| | | |
| | | decimal itemQuantity = item.LockQuantity - item.OverOutQuantity; |
| | | |
| | | foreach (var stockDetail in stockInfoDetails) |
| | | { |
| | | if (item.LockQuantity - item.OverOutQuantity >= stockDetail.StockQuantity - stockInfoDetail.OutboundQuantity) |
| | | if (itemQuantity >= stockDetail.StockQuantity - stockDetail.OutboundQuantity) |
| | | { |
| | | Barcodes barcodes = new Barcodes |
| | | { |
| | | Barcode = stockDetail.Barcode, |
| | | Qty = stockDetail.StockQuantity - stockInfoDetail.OutboundQuantity, |
| | | Qty = stockDetail.StockQuantity - stockDetail.OutboundQuantity, |
| | | SupplyCode = stockDetail?.SupplyCode ?? "", |
| | | BatchNo = stockDetail?.BatchNo ?? "", |
| | | Unit = stockDetail?.Unit ?? "" |
| | | }; |
| | | |
| | | stockDetail.StockQuantity = stockInfoDetail.OutboundQuantity; |
| | | itemQuantity -= (stockDetail.StockQuantity - stockDetail.OutboundQuantity); |
| | | stockDetail.OutboundQuantity = stockDetail.StockQuantity; |
| | | barcodesList.Add(barcodes); |
| | | |
| | | if (itemQuantity <= 0) break; |
| | | } |
| | | else |
| | | { |
| | | Barcodes barcodes = new Barcodes |
| | | { |
| | | Barcode = stockDetail.Barcode, |
| | | Qty = item.LockQuantity - item.OverOutQuantity, |
| | | Qty = itemQuantity, |
| | | SupplyCode = stockDetail?.SupplyCode ?? "", |
| | | BatchNo = stockDetail?.BatchNo ?? "", |
| | | Unit = stockDetail?.Unit ?? "" |
| | | }; |
| | | stockInfoDetail.OutboundQuantity += item.LockQuantity - item.OverOutQuantity; |
| | | stockDetail.OutboundQuantity += itemQuantity; |
| | | barcodesList.Add(barcodes); |
| | | break; |
| | | } |
| | | } |
| | | |
| | |
| | | List<Barcodes> barcodesList = new List<Barcodes>(); |
| | | Barcodes barcodes = new Barcodes |
| | | { |
| | | Barcode = request.Barcode, |
| | | Barcode = isUnpacked ? newBarcode : stockDetail?.Barcode, |
| | | Qty = barcodeQuantity, |
| | | SupplyCode = stockDetail?.SupplyCode ?? "", |
| | | BatchNo = stockDetail?.BatchNo ?? "", |
| | |
| | | |
| | | var newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = stations[station], |
| | | CurrentAddress = stations.GetValueOrDefault(station) ?? "", |
| | | Grade = 0, |
| | | PalletCode = palletCode, |
| | | NextAddress = "", |
| | | OrderNo = OrderNo, |
| | | Roadway = newLocation.RoadwayNo, |
| | | SourceAddress = stations[station], |
| | | SourceAddress = stations.GetValueOrDefault(station) ?? "", |
| | | TargetAddress = newLocation.LocationCode, |
| | | TaskStatus = (int)TaskStatusEnum.New, |
| | | TaskType = stock.Details.Count > 0 ? (int)TaskTypeEnum.InPick : (int)TaskTypeEnum.InEmpty, |
| | |
| | | _stockInfoRepository.UpdateData(stock); |
| | | _taskRepository.AddData(newTask); |
| | | |
| | | //var moveResult = await _eSSApiService.MoveContainerAsync(new MoveContainerRequest |
| | | //{ |
| | | // slotCode = movestations[station], |
| | | // containerCode = palletCode |
| | | //}); |
| | | var moveResult = await _eSSApiService.MoveContainerAsync(new MoveContainerRequest |
| | | { |
| | | slotCode = movestations[station], |
| | | containerCode = palletCode |
| | | }); |
| | | return content.OK(); |
| | | |
| | | } |
| | |
| | | |
| | | _stockService.StockInfoService.Db.UpdateNav(stock).IncludesAllFirstLayer().ExecuteCommand(); |
| | | |
| | | task.TaskStatus = (int)TaskStatusEnum.Finish; |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.èªå¨å®æ); |
| | | if (!result) |
| | | { |
| | |
| | | |
| | | var newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = stationCode, |
| | | CurrentAddress = stations.GetValueOrDefault(stationCode) ?? "", |
| | | Grade = 0, |
| | | NextAddress = stations.GetValueOrDefault(stationCode) ?? "", |
| | | NextAddress = locationInfo.LocationCode, |
| | | PalletCode = palletCode, |
| | | Roadway = locationInfo.RoadwayNo, |
| | | SourceAddress = stationCode, |
| | | SourceAddress = stations.GetValueOrDefault(stationCode) ?? "", |
| | | TargetAddress = locationInfo.LocationCode, |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType, |
| | | OrderNo= stockInfo.Details.FirstOrDefault()?.OrderNo |
| | | |
| | | }; |
| | | //空箱 |
| | | if (stockInfo.PalletType == PalletTypeEnum.Empty.ObjToInt()) |
| | |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_DTO.Allocate; |
| | | using WIDESEA_IAllocateService; |
| | | using WIDESEA_IInboundService; |
| | |
| | | public class AllocateOrderController : ApiBaseController<IAllocateService, Dt_AllocateOrder> |
| | | { |
| | | private readonly ILogger<AllocateOrderController> _logger; |
| | | public AllocateOrderController(IAllocateService service, ILogger<AllocateOrderController> logger) : base(service) |
| | | private readonly IRepository<Dt_MaterielInfo> _materialInfoRepository; |
| | | public AllocateOrderController(IAllocateService service, ILogger<AllocateOrderController> logger,IRepository<Dt_MaterielInfo> materialInfoRepository) : base(service) |
| | | { |
| | | _logger = logger; |
| | | _materialInfoRepository = materialInfoRepository; |
| | | } |
| | | |
| | | [HttpPost, Route("ReceiveAllocateOrder"), MethodParamsValidate, AllowAnonymous] |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æ¡ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | var materialName = _materialInfoRepository.QueryFirst(x => x.MaterielCode == detailDto.MaterialCode).MaterielName; |
| | | if (detailDto.Barcodes != null && detailDto.Barcodes.Any()) |
| | | { |
| | | foreach (var barcodeDto in detailDto.Barcodes) |
| | |
| | | { |
| | | WarehouseCode = detailDto.WarehouseCode, |
| | | MaterielCode = detailDto.MaterialCode, |
| | | MaterielName = materialName, |
| | | LineNo = detailDto.LineNo, |
| | | OrderQuantity = detailDto.Qty, |
| | | SupplyCode = barcodeDto.SupplyCode, |
| | |
| | | Unit = detailDto.Unit, |
| | | BarcodeUnit =detailDto.Unit, |
| | | BarcodeQty=detailDto.Qty, |
| | | |
| | | MaterielName = materialName |
| | | }; |
| | | allocateOrder.Details.Add(orderDetail); |
| | | } |
| | |
| | | private readonly ILocationInfoService _locationInfoService; |
| | | private readonly IDailySequenceService _dailySequenceService; |
| | | private readonly IMaterialUnitService _materialUnitService; |
| | | private readonly IRepository<Dt_MaterielInfo> _materialInfoRepository; |
| | | 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, ITask_HtyService task_HtyService) : 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, IRepository<Dt_MaterielInfo> materialInfoRepository) : base(service) |
| | | { |
| | | this.erpApiService = erpApiService; |
| | | _invokeMESService = invokeMESService; |
| | |
| | | _outboundOrderDetailService = outboundOrderDetailService; |
| | | _taskRepository = taskRepository; |
| | | _task_HtyService = task_HtyService; |
| | | _materialInfoRepository = materialInfoRepository; |
| | | } |
| | | |
| | | [HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate] |
| | |
| | | Dt_InboundOrder dt_InboundOrder = new Dt_InboundOrder() { Details = new List<Dt_InboundOrderDetail>() }; |
| | | foreach (var detailitem in item.details) |
| | | { |
| | | |
| | | var materialName = _materialInfoRepository.QueryFirst(x => x.MaterielCode == detailitem.materialCode).MaterielName; |
| | | if (detailitem.barcodes != null && detailitem.barcodes.Any()) |
| | | { |
| | | foreach (var barcode in detailitem.barcodes) |
| | |
| | | { |
| | | lineNo = detailitem.lineNo, |
| | | MaterielCode = detailitem.materialCode, |
| | | MaterielName = materialName, |
| | | SupplyCode = detailitem.supplyCode, |
| | | BatchNo = detailitem.batchNo, |
| | | Unit = detailitem.unit, |
| | |
| | | OrderQuantity = detailitem.qty, |
| | | BarcodeUnit = detailitem.unit, |
| | | BarcodeQty = detailitem.qty, |
| | | MaterielName = materialName |
| | | }; |
| | | dt_InboundOrder.Details.Add(inboundOrderDetail); |
| | | } |
| | |
| | | { |
| | | |
| | | // ç¬¬ä¸æ¥ï¼æ´æ°ValidDateçåçSQLï¼SQL Serverï¼ |
| | | string updateSql = @" |
| | | UPDATE s |
| | | SET s.ValidDate = DATEADD(DAY, m.ValidityDays, s.CreateDate) |
| | | FROM Dt_StockInfoDetail s |
| | | INNER JOIN Dt_MaterialExpirationDate m ON SUBSTRING(s.MaterielCode, 1, 6) = m.MaterialCode |
| | | WHERE s.ValidDate IS NULL"; |
| | | int updateValidDateResult = _db.Ado.ExecuteCommand(updateSql); |
| | | // string updateSql = @" |
| | | //UPDATE s |
| | | //SET s.ValidDate = DATEADD(DAY, m.ValidityDays, s.CreateDate) |
| | | //FROM Dt_StockInfoDetail s |
| | | //INNER JOIN Dt_MaterialExpirationDate m ON SUBSTRING(s.MaterielCode, 1, 6) = m.MaterialCode |
| | | //WHERE s.ValidDate IS NULL"; |
| | | // int updateValidDateResult = _db.Ado.ExecuteCommand(updateSql); |
| | | |
| | | // ç¬¬äºæ¥ï¼æ´æ°è¿æç¶æçåçSQL |
| | | string updateStatusSql = @" |
| | |
| | | { |
| | | var allQzServices = new List<TasksQz>() |
| | | { |
| | | //new TasksQz() |
| | | //{ |
| | | // Id = 1, |
| | | // AssemblyName = "WIDESEA_WMSServer", |
| | | // ClassName = "AgvTaskJob", |
| | | // CreateTime = DateTime.Now, |
| | | // IntervalSecond = 3, |
| | | // IsDeleted = false, |
| | | // IsStart = false, |
| | | // JobGroup = "WIDESEA_WMSServer", |
| | | // Name = "AgvTaskJob", |
| | | // TriggerType = 0 |
| | | //}, |
| | | new TasksQz() |
| | | { |
| | | Id = 1, |
| | | AssemblyName = "WIDESEA_WMSServer", |
| | | ClassName = "AgvTaskJob", |
| | | CreateTime = DateTime.Now, |
| | | IntervalSecond = 3, |
| | | IsDeleted = false, |
| | | IsStart = false, |
| | | JobGroup = "WIDESEA_WMSServer", |
| | | Name = "AgvTaskJob", |
| | | TriggerType = 0 |
| | | }, |
| | | |
| | | }; |
| | | foreach (var item in allQzServices) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <!-- https://go.microsoft.com/fwlink/?LinkID=208121. --> |
| | | <Project> |
| | | <PropertyGroup> |
| | | <DeleteExistingFiles>false</DeleteExistingFiles> |
| | | <ExcludeApp_Data>false</ExcludeApp_Data> |
| | | <LaunchSiteAfterPublish>true</LaunchSiteAfterPublish> |
| | | <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> |
| | | <LastUsedPlatform>Any CPU</LastUsedPlatform> |
| | | <PublishProvider>FileSystem</PublishProvider> |
| | | <PublishUrl>bin\Release\net6.0\publish\</PublishUrl> |
| | | <WebPublishMethod>FileSystem</WebPublishMethod> |
| | | <_TargetId>Folder</_TargetId> |
| | | </PropertyGroup> |
| | | </Project> |