Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu
| | |
| | | </el-row> |
| | | </el-alert> |
| | | </div> |
| | | |
| | | <!-- æ°å¢çéåºå --> |
| | | <div class="filter-area" style="margin: 10px 0; padding: 10px; background: #f8f9fa; border-radius: 4px;"> |
| | | <el-form :model="filterForm" inline @submit.prevent> |
| | | <el-form-item label="ç©æç¼å·ï¼"> |
| | | <el-input |
| | | v-model="filterForm.materielCode" |
| | | placeholder="模ç³çéç©æç¼å·" |
| | | clearable |
| | | style="width: 180px" |
| | | @input="filterTable" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç©ææ¡ç ï¼"> |
| | | <el-input |
| | | v-model="filterForm.barcode" |
| | | placeholder="模ç³çéç©ææ¡ç " |
| | | clearable |
| | | style="width: 180px" |
| | | @input="filterTable" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æçç¼å·ï¼"> |
| | | <el-input |
| | | v-model="filterForm.palletCode" |
| | | placeholder="模ç³çéæçç¼å·" |
| | | clearable |
| | | style="width: 180px" |
| | | @input="filterTable" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="è´§ä½ç¼å·ï¼"> |
| | | <el-input |
| | | v-model="filterForm.locationCode" |
| | | placeholder="模ç³çéè´§ä½ç¼å·" |
| | | clearable |
| | | style="width: 180px" |
| | | @input="filterTable" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="filterTable">æç´¢</el-button> |
| | | <el-button @click="resetFilter">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="box-table" style="margin-top: 1%"> |
| | | <el-table |
| | | ref="singleTable" |
| | |
| | | row: null, |
| | | showDetialBox: false, |
| | | tableData: [], |
| | | originalTableData: [], // æ°å¢ï¼åå¨åå§æ°æ®ï¼ç¨äºçé |
| | | tableColumns: [ |
| | | { prop: "materielCode", title: "ç©æç¼å·", type: "string", width: 150 }, |
| | | { prop: "barcode", title: "ç©ææ¡ç ", type: "string", width: 150 }, |
| | |
| | | selectionSum: 0, |
| | | selectionClass: "less-style", |
| | | originalQuantity: 0, |
| | | |
| | | // æ°å¢ï¼çéè¡¨åæ°æ® |
| | | filterForm: { |
| | | materielCode: "", |
| | | barcode: "", |
| | | palletCode: "", |
| | | locationCode: "" |
| | | }, |
| | | |
| | | // åºåºå¼¹çªç¸å
³æ°æ® |
| | | showOutboundDialog: false, |
| | |
| | | this.$refs.outboundFormRef.validate((valid) => { |
| | | if (!valid) return; |
| | | |
| | | |
| | | if (this.selection.length <= 0) { |
| | | return this.$message.error("请å¾é"); |
| | | } |
| | | let url = this.pkcx |
| | | ? "api/Task/GenerateOutboundTask?orderDetailId=" |
| | | : "api/Task/GenerateOutboundTask?orderDetailId="; |
| | | this.http |
| | | .post(url + this.row.id+"&station="+this.outboundForm.selectedPlatform, this.selection, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.$message.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | if (this.selection.length <= 0) { |
| | | return this.$message.error("请å¾é"); |
| | | } |
| | | let url = this.pkcx |
| | | ? "api/Task/GenerateOutboundTask?orderDetailId=" |
| | | : "api/Task/GenerateOutboundTask?orderDetailId="; |
| | | this.http |
| | | .post(url + this.row.id+"&station="+this.outboundForm.selectedPlatform, this.selection, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.$message.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | }); |
| | | }, |
| | |
| | | ) |
| | | .then((x) => { |
| | | this.tableData = x; |
| | | this.originalTableData = x; // æ°å¢ï¼ä¿ååå§æ°æ® |
| | | // å·æ°åæ¸
空ä¹åçéæ©åè®¡æ° |
| | | this.clearSelection(); |
| | | this.selectionSum = 0; |
| | | this.originalQuantity = 0; |
| | | this.updateSelectionClass(); |
| | | // å·æ°åéç½®ç鿡件 |
| | | this.resetFilter(); |
| | | }); |
| | | }, |
| | | |
| | |
| | | // æ´æ°å·²éæ°éæ ·å¼ |
| | | updateSelectionClass() { |
| | | if (!this.row) return; |
| | | if (this.selectionSum === this.row.orderQuantity) { |
| | | // ä¿®å¤ï¼row.orderQuantity æ¹ä¸º row.qtyï¼æ¨¡æ¿éæ¾ç¤ºçæ¯row.qtyï¼ |
| | | if (this.selectionSum === this.row.qty) { |
| | | this.selectionClass = "equle-style"; |
| | | } else if (this.selectionSum < this.row.orderQuantity) { |
| | | } else if (this.selectionSum < this.row.qty) { |
| | | this.selectionClass = "less-style"; |
| | | } else { |
| | | this.selectionClass = "more-style"; |
| | |
| | | tableButtonClick(row, item) { |
| | | console.log("徿 æé®ç¹å»ï¼", item.title, row); |
| | | }, |
| | | |
| | | // æ°å¢ï¼çéè¡¨æ ¼æ°æ® |
| | | filterTable() { |
| | | if (!this.originalTableData.length) return; |
| | | |
| | | // è§£æçéæ¡ä»¶å¹¶è½¬ä¸ºå°åï¼å¿½ç¥å¤§å°åï¼ |
| | | const { materielCode, barcode, palletCode, locationCode } = this.filterForm; |
| | | const mc = materielCode.toLowerCase().trim(); |
| | | const bc = barcode.toLowerCase().trim(); |
| | | const pc = palletCode.toLowerCase().trim(); |
| | | const lc = locationCode.toLowerCase().trim(); |
| | | |
| | | // 模ç³çéé»è¾ |
| | | this.tableData = this.originalTableData.filter(item => { |
| | | // æ¯ä¸ªå段é½å空å¼å¤çåå°å转æ¢ï¼æ¯ææ¨¡ç³å¹é
|
| | | const itemMc = (item.materielCode || "").toLowerCase(); |
| | | const itemBc = (item.barcode || "").toLowerCase(); |
| | | const itemPc = (item.palletCode || "").toLowerCase(); |
| | | const itemLc = (item.locationCode || "").toLowerCase(); |
| | | |
| | | return ( |
| | | itemMc.includes(mc) && |
| | | itemBc.includes(bc) && |
| | | itemPc.includes(pc) && |
| | | itemLc.includes(lc) |
| | | ); |
| | | }); |
| | | |
| | | // çé忏
ç©ºéæ©ç¶æ |
| | | this.clearSelection(); |
| | | this.selectionSum = 0; |
| | | this.updateSelectionClass(); |
| | | }, |
| | | |
| | | // æ°å¢ï¼éç½®ç鿡件 |
| | | resetFilter() { |
| | | this.filterForm = { |
| | | materielCode: "", |
| | | barcode: "", |
| | | palletCode: "", |
| | | locationCode: "" |
| | | }; |
| | | // æ¢å¤åå§æ°æ® |
| | | this.tableData = [...this.originalTableData]; |
| | | // éç½®éæ©ç¶æ |
| | | this.clearSelection(); |
| | | this.selectionSum = 0; |
| | | this.updateSelectionClass(); |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | .more-style { |
| | | color: red; |
| | | } |
| | | |
| | | /* çéåºåæ ·å¼ä¼å */ |
| | | .filter-area :deep(.el-form-item) { |
| | | margin-bottom: 0; |
| | | margin-right: 10px; |
| | | } |
| | | </style> |
| | | |
| | | <style> |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | import http from '@/api/http.js' |
| | | import { h, createVNode, render, reactive, ref } from 'vue'; |
| | |
| | | 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: '', // æçå·è¾å
¥æ¡ |
| | | barcode:'' |
| | | }); |
| | | // ååºå¼è¡¨åæ°æ®ï¼æçå·ï¼å¿
å¡«ï¼ |
| | | const formData = reactive({ |
| | | palletCode: '', // æçå·è¾å
¥æ¡ |
| | | barcode: '' |
| | | }); |
| | | |
| | | // æäº¤è¡¨åçç»ä¸é»è¾ |
| | | 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()+'&barcode='+formData.barcode.trim()); |
| | | |
| | | // åèµ·æ¤éç»çè¯·æ± |
| | | try { |
| | | //console.log('åèµ·æ¤éç»ç请æ±ï¼æçå·ï¼', formData.palletCode.trim()); |
| | | const response = await http.post('/api/InboundOrder/UndoPalletGroup?palletCode=' + formData.palletCode.trim() + '&barcode=' + formData.barcode.trim()); |
| | | |
| | | const { status, message, data } = response; |
| | | if (status) { |
| | | ElMessage.success(response.message); |
| | | console.log(response.message) |
| | | 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(response.message); |
| | | console.log(response.message) |
| | | 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(ElFormItem,{label: 'æ¡ç ', prop: 'barcode'},[ |
| | | h(ElInput, { |
| | | type: 'text', |
| | | modelValue: formData.barcode, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.barcode = val; |
| | | }, |
| | | 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); |
| | | }, |
| | | '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(ElFormItem, { label: 'æ¡ç ', prop: 'barcode' }, [ |
| | | h(ElInput, { |
| | | type: 'text', |
| | | modelValue: formData.barcode, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.barcode = val; |
| | | }, |
| | | 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', |
| | |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | 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; |
| | | }, {}); |
| | | 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>'; |
| | | } |
| | | }; |
| | | } |
| | | }); |
| | | //æ¯ä¸ªç©æé¡¹çæç¬ç«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() { |
| | | |
| | |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| | | //æ¥è¯¢åï¼resultè¿åçæ¥è¯¢æ°æ®,å¯ä»¥å¨æ¾ç¤ºå°è¡¨æ ¼åå¤çè¡¨æ ¼çå¼ |
| | | return true; |
| | | }, |
| | | addBefore(formData) { |
| | |
| | | } |
| | | } |
| | | }; |
| | | export default extension; |
| | | export default extension; |
| | |
| | | </el-form> |
| | | <el-form ref="form" :model="form" label-width="90px"> |
| | | <el-form-item label="åºåºæ°é:"> |
| | | <el-select v-model="num" placeholder="è¯·éæ©åºåºæ°é"> |
| | | <el-option v-for="item in 6" :key="item" :label="item.toString()" :value="item"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input-number v-model="num" :min="1" :max="999" :controls="true" placeholder="è¯·éæ©åºåºæ°é" style="width: 100%;"></el-input-number> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "overOutQuantity", |
| | | prop: "moveQty", |
| | | title: "æªææ°é", |
| | | type: "string", |
| | | width: 90, |
| | |
| | | <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" |
| | | v-if="isBatch === 0" |
| | | style="float: right; height: 20px" |
| | | @click="handleOpenPicking" |
| | | >æ£é</el-link> |
| | | <el-link |
| | | >æ£é</el-link |
| | | > |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | v-if="isBatch === 1" |
| | | v-if="isBatch === 1" |
| | | @click="handleOpenBatchPicking" |
| | | >åæ¹æ£é</el-link> |
| | | >åæ¹æ£é</el-link |
| | | > |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | v-if="isBatch === 0" |
| | | v-if="isBatch === 0" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="outbound" |
| | | >ç´æ¥åºåº</el-link |
| | | > |
| | | <el-link |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | v-if="isBatch === 1" |
| | | v-if="isBatch === 1" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="outboundbatch" |
| | | >åæ¹åºåº</el-link |
| | |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="getData" |
| | | >å·æ°</el-link |
| | | ></el-col |
| | | > |
| | | > |
| | | </el-col> |
| | | </el-row> |
| | | </el-alert> |
| | | </div> |
| | |
| | | effect="dark" |
| | | :content="item.title" |
| | | placement="bottom" |
| | | ><el-link |
| | | > |
| | | <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> |
| | | > |
| | | <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> |
| | | <div v-else> |
| | | {{ scoped.row[item.prop] }} |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <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'; |
| | | import { h, createVNode, render, reactive } from "vue"; |
| | | import { |
| | | ElDialog, |
| | | ElForm, |
| | | ElFormItem, |
| | | ElSelect, |
| | | ElOption, |
| | | ElButton, |
| | | ElInput, |
| | | ElMessage, |
| | | } from "element-plus"; |
| | | |
| | | export default { |
| | | components: { VolBox, VolForm, StockSelect, SelectedStock,NoStockOut}, |
| | | components: { VolBox, VolForm, StockSelect, SelectedStock, NoStockOut }, |
| | | data() { |
| | | return { |
| | | row: null, |
| | | isBatch :0, |
| | | isBatch: 0, |
| | | showDetialBox: false, |
| | | flag: false, |
| | | currentRow: null, |
| | | selection: [], |
| | | tableData: [], |
| | | mainBusinessType: null, // æ°å¢ï¼åå¨ä¸»åæ®çbusinessType |
| | | tableColumns: [ |
| | | { |
| | | prop: "id", |
| | |
| | | prop: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | width: 120, |
| | | }, |
| | | { |
| | | prop: "materielName", |
| | |
| | | prop: "supplyCode", |
| | | title: "ä¾åºåç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "orderQuantity", |
| | |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "overOutQuantity", |
| | | prop: "moveQty", |
| | | title: "æªææ°é", |
| | | type: "string", |
| | | width: 90, |
| | |
| | | prop: "unit", |
| | | title: "åä½", |
| | | type: "string", |
| | | width: 90, |
| | | width: 80, |
| | | }, |
| | | { |
| | | prop: "orderDetailStatus", |
| | |
| | | title: "æå®åºå", |
| | | type: "icon", |
| | | width: 90, |
| | | hidden:true, |
| | | hidden: true, // é»è®¤éè |
| | | icon: "el-icon-s-grid", |
| | | }, |
| | | { |
| | |
| | | order: "desc", |
| | | Foots: "", |
| | | total: 0, |
| | | // 2020.08.29å¢å èªå®ä¹å页æ¡å¤§å° |
| | | sizes: [30, 60, 100, 120], |
| | | size: 30, // é»è®¤åé¡µå¤§å° |
| | | size: 30, |
| | | Wheres: [], |
| | | page: 1, |
| | | rows: 30, |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | toggleAssignStockColumn() { |
| | | const assignStockColumn = this.tableColumns.find( |
| | | (item) => item.prop === "assignStock" |
| | | ); |
| | | if (assignStockColumn) { |
| | | // businessType为22æ¶æ¾ç¤ºï¼å¦åéè |
| | | assignStockColumn.hidden = this.mainBusinessType !=='22'; |
| | | } |
| | | }, |
| | | open(row) { |
| | | this.row = row; |
| | | this.showDetialBox = true; |
| | | console.log(this.row); |
| | | console.log("ä¸»åæ®æ°æ®ï¼", this.row); |
| | | this.isBatch = row.isBatch; |
| | | this.mainBusinessType = row.businessType; |
| | | this.getDictionaryData(); |
| | | this.getData(); |
| | | this.toggleAssignStockColumn(); |
| | | }, |
| | | getData() { |
| | | var wheres = [{ name: "orderId", value: this.row.id }]; |
| | |
| | | rows: this.paginations.rows, |
| | | sort: this.paginations.sort, |
| | | order: this.paginations.order, |
| | | wheres: JSON.stringify(wheres), // æ¥è¯¢æ¡ä»¶ï¼æ ¼å¼ä¸º[{ name: "åæ®µ", value: "xx" }] |
| | | wheres: JSON.stringify(wheres), |
| | | }; |
| | | this.http |
| | | .post("api/OutboundOrderDetail/GetPageData", param, "æ¥è¯¢ä¸") |
| | | .then((x) => { |
| | | this.tableData = x.rows; |
| | | this.toggleAssignStockColumn(); // æ°æ®å è½½åéæ°ç¡®è®¤åæ¾é |
| | | }); |
| | | }, |
| | | tableButtonClick(row, column) { |
| | |
| | | this.$refs.child.open(row); |
| | | } else if (column.prop == "NoStockOut") { |
| | | this.$refs.NoStockOut.open(row); |
| | | }else{ |
| | | //ç¹å»æå¼åºåºè¯¦æ
|
| | | } else { |
| | | this.$refs.selectedStock.open(row); |
| | | } |
| | | }, |
| | |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | var keys = this.selection.map((item) => item.id); // è·åéä¸è¡çid |
| | | var keys = this.selection.map((item) => item.id); |
| | | this.http |
| | | .post("api/OutboundOrderDetail/LockOutboundStocks", keys, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | // æå¼æ£éé¡µé¢ |
| | | handleOpenPicking() { |
| | | handleOpenPicking() { |
| | | this.$router.push({ |
| | | path: '/outbound/picking', |
| | | query: { orderId: this.row.id ,orderNo:this.row.orderNo} |
| | | }) |
| | | 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}}) |
| | | 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'); |
| | | 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 |
| | | selectedPlatform: platformOptions[0].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' } |
| | | ] |
| | | const vnode = createVNode( |
| | | ElDialog, |
| | | { |
| | | title: "åºåºæä½ - éæ©åºåºç«å°", |
| | | width: "500px", |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | "onUpdate:modelValue": (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | 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; |
| | | 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", |
| | | }, |
| | | }, |
| | | 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; |
| | | } |
| | | [ |
| | | 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 // åºåºç«å° |
| | | }; |
| | | 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' |
| | | } |
| | | }, 'ç¡®å®åºåº') |
| | | ]) |
| | | ]) |
| | | }); |
| | | 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); |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | }, |
| | | 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' |
| | | if (this.selection.length > 1) { |
| | | return this.$message.error("åªè½éæ©ä¸æ¡åæ®æç»è¿è¡åæ¹åºåº"); |
| | | } |
| | | }, [ |
| | | // åºåºç«å°éæ©é¡¹ï¼æ ¸å¿è¡¨åé¡¹ï¼ |
| | | 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; |
| | | 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); |
| | | } |
| | | 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' |
| | | } |
| | | }, 'ç¡®å®åæ¹åºåº') |
| | | ]) |
| | | ]) |
| | | }); |
| | | 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; |
| | | } |
| | | |
| | | // ç»å®appä¸ä¸æï¼ç¡®ä¿Elç»ä»¶æ£å¸¸å·¥ä½ |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | }, |
| | | |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | orderDetailId: keys[0], |
| | | outboundPlatform: formData.selectedPlatform, |
| | | batchQuantity: formData.outboundDecimal, |
| | | }; |
| | | |
| | | 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", |
| | | }, |
| | | }, "ç¡®å®åæ¹åºåº"), |
| | | ]), |
| | | ]), |
| | | } |
| | | ); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | }, |
| | | setCurrent(row) { |
| | | this.$refs.singleTable.setCurrentRow(row); |
| | | }, |
| | |
| | | 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]; |
| | | } |
| | | } |
| | | return row[column.prop]; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .text-button { |
| | | border: 0px; |
| | |
| | | |
| | | .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 { |
| | |
| | | .box-table .el-table { |
| | | border: 1px solid #ebeef5; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | //this.detailOptions.columns.forEach(column=>{ }); |
| | | }, |
| | | searchBefore(param) { |
| | | |
| | | //ç颿¥è¯¢å,å¯ä»¥ç»param.wheresæ·»å æ¥è¯¢åæ° |
| | | //è¿åfalseï¼åä¸ä¼æ§è¡æ¥è¯¢ |
| | | return true; |
| | |
| | | column.formatter = (row) => { |
| | | // æ ¡éªdetailsæ¯å¦åå¨ä¸ææ°æ® |
| | | if (row.details && row.details.length > 0) { |
| | | // æmaterielCodeåç»ç»è®¡stockQuantityæ»åï¼å¹¶è®°å½åä½ï¼å第ä¸ä¸ªé空åä½ï¼ |
| | | const materielSumMap = row.details.reduce((acc, item) => { |
| | | const materielCode = item.materielCode || 'æªç¥ç©æ'; |
| | | // æbarcode + supplyCode + BatchNo ç»å维度åç»ç»è®¡stockQuantityæ»åï¼å¹¶è®°å½åä½ï¼å第ä¸ä¸ªé空åä½ï¼ |
| | | const groupSumMap = row.details.reduce((acc, item) => { |
| | | // è·ååç»å
³é®å段ï¼ä¸ºç©ºæ¶èµäºé»è®¤å¼ |
| | | const supplyCode = item.supplyCode || 'æªç¥ä¾åºåç¼ç '; |
| | | const batchNo = item.batchNo || 'æªç¥æ¹æ¬¡å·'; |
| | | const materielCode = item.materielCode || 'æªç¥ç©æ'; // ä¿çåæç©æç¼ç |
| | | const quantity = Number(item.stockQuantity) || 0; |
| | | const unit = item.unit || ''; // è·ååä½ï¼æ å为空 |
| | | |
| | | // ç´¯å æ°é |
| | | acc[materielCode] = { |
| | | total: (acc[materielCode]?.total || 0) + quantity, |
| | | unit: acc[materielCode]?.unit || unit // ä¿ç第ä¸ä¸ªé空åä½ |
| | | // ç»ååç»é®ï¼å¯æ ¹æ®éè¦è°æ´æ¾ç¤ºæ ¼å¼ï¼ |
| | | const groupKey = `${supplyCode}|${batchNo}|${materielCode}`; |
| | | |
| | | // ç´¯å æ°éï¼ä¿ç第ä¸ä¸ªé空åä½ |
| | | acc[groupKey] = { |
| | | total: (acc[groupKey]?.total || 0) + quantity, |
| | | unit: acc[groupKey]?.unit || unit, |
| | | supplyCode, |
| | | batchNo, |
| | | materielCode |
| | | }; |
| | | return acc; |
| | | }, {}); |
| | | |
| | | // æ¯ä¸ªç©æé¡¹çæç¬ç«divï¼è·¨è¡æ¾ç¤ºï¼å
å«åä½ï¼ |
| | | const displayItems = Object.entries(materielSumMap).map(([code, data]) => { |
| | | // æ¯ä¸ªåç»é¡¹çæç¬ç«divï¼è·¨è¡æ¾ç¤ºï¼å
嫿æåç»ç»´åº¦ååä½ï¼ |
| | | const displayItems = Object.entries(groupSumMap).map(([_, data]) => { |
| | | // å¤çå使¾ç¤ºï¼æåä½åå ç©ºæ ¼æ¾ç¤ºï¼æ å䏿¾ç¤º |
| | | const unitText = data.unit ? ` ${data.unit}` : ''; |
| | | return `<div style="line-height: 1.5; white-space: normal;">${code}ï¼${data.total}${unitText}</div>`; |
| | | |
| | | // ç»è£
æ¾ç¤ºææ¬ï¼å¯æ ¹æ®éæ±è°æ´å段æ¾ç¤ºé¡ºåºåæ ¼å¼ï¼ |
| | | return `<div style="line-height: 1.5; white-space: normal; margin-bottom: 4px;"> |
| | | ä¾åºåç¼ç ï¼${data.supplyCode} | æ¹æ¬¡å·ï¼${data.batchNo} | ç©æç¼ç ï¼${data.materielCode}ï¼${data.total}${unitText} |
| | | </div>`; |
| | | }); |
| | | |
| | | const displayContent = displayItems.join(''); |
| | | return `<div style="color: #F56C6C; white-space: normal; word-break: break-all;">${displayContent}</div>`; |
| | | return `<div style="color: #716cf5ff; white-space: normal; word-break: break-all;">${displayContent}</div>`; |
| | | } else { |
| | | return '<span style="color: #F56C6C">空箱</span>'; |
| | | } |
| | |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | link: true, |
| | | }, |
| | | { |
| | | field: "upperOrderNo", |
| | |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "åæ®ç¼å·", field: "inboundOrderNo", type: "like" }, |
| | | { title: "æ«æåæ®ç¼å·ææ¡ç ", field: "inboundOrderNo", type: "like" }, |
| | | { title: "䏿¸¸åæ®ç¼å·", field: "upperOrderNo", type: "like" }, |
| | | { |
| | | title: "åæ®ç±»å", |
| | | field: "orderType", |
| | | title: "ä¸å¡ç±»å", |
| | | field: "businessType", |
| | | type: "select", |
| | | dataKey: "inOrderType", |
| | | data: [0], |
| | | hidden:true |
| | | dataKey: "documentTypeEmun", |
| | | data: [], |
| | | }, |
| | | { |
| | | title: "åæ®ç¶æ", |
| | |
| | | bind: { key: "createType", data: [] }, |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left" |
| | | }, |
| | | { |
| | | field: "returnToMESStatus", |
| | | title: "åä¼ MESç¶æ", |
| | | width: 120, |
| | | bind: { key: "createType", data:[{key:0, value:"æªåä¼ "},{key:1, value:"å·²åä¼ æå"},{key:2, value:"åä¼ å¤±è´¥"}]}, |
| | | }, |
| | | { |
| | | field: "factoryArea", |
| | | title: "ååº", |
| | | type: "string", |
| | |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | |
| | | { title: "åæ®ç¼å·", field: "orderNo", type: "like" }, |
| | | { title: "䏿¸¸åæ®ç¼å·", field: "upperOrderNo", type: "like" }, |
| | | { |
| | | title: "åæ®ç±»å", |
| | | field: "orderType", |
| | | title: "ä¸å¡ç±»å", |
| | | field: "businessType", |
| | | type: "select", |
| | | dataKey: "outOrderType", |
| | | dataKey: "documentTypeEmun", |
| | | data: [], |
| | | hidden:true |
| | | }, |
| | | { |
| | | title: "åæ®ç¶æ", |
| | |
| | | bind: { key: "createType", data: [] }, |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left" |
| | | }, |
| | | { |
| | | field: "returnToMESStatus", |
| | | title: "åä¼ MESç¶æ", |
| | | width: 120, |
| | | bind: { key: "createType", data:[{key:0, value:"æªåä¼ "},{key:1, value:"å·²åä¼ æå"},{key:2, value:"åä¼ å¤±è´¥"}]}, |
| | | }, |
| | | { |
| | | field: "factoryArea", |
| | | title: "ååº", |
| | | type: "string", |
| | |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | |
| | | const searchFormFields = ref({ |
| | | materielCode: "", |
| | | materielName: "", |
| | | orderNo: "", |
| | | batchNo: "", |
| | | supplyCode:"", |
| | | warehouseCode:"" |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "ç©æç¼å·", field: "materielCode" ,type:'like'}, |
| | | { title: "ç©æåç§°", field: "materielName" ,type:'like'}, |
| | | { title: "åæ®ç¼å·", field: "orderNo" ,type:'like'}, |
| | | { title: "æçå·", field: "palletCode" ,type:'like'}, |
| | | { title: "æ¹æ¬¡å·", field: "batchNo" ,type:'like'}, |
| | | { title: "ä¾åºåç¼å·", field: "supplyCode" ,type:'like'}, |
| | | { title: "ä»åºå·", field: "warehouseCode" ,type:'like'}, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | 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", |
| | |
| | | [ |
| | | { title: "ç©æç¼å·", field: "materielCode",type: "like"}, |
| | | { title: "æ¹æ¬¡å·", field: "batchNo",type: "like"}, |
| | | { title: "æå±ä»åº", field: "warehouseId",type: "selectList",dataKey: "warehouses",data: [],}, |
| | | { title: "æå±ä»åº", field: "locationType",type: "select",dataKey: "locationType",data: [],}, |
| | | { title: "æå«æ¡ç ", field: "barcode",type: "like"}, |
| | | ], |
| | | [ |
| | | { title: "ä¾åºåç¼å·", field: "supplyCode",type: "like"}, |
| | | { title: "æå«åæ®ç¼å·", field: "orderNo",type: "like"}, |
| | | { title: "åºåå建æ¶é´", field: "createDate",type: "datetime"}, |
| | | |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "locationType", |
| | | title: "æå±ä»åº", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | bind: { key: "locationType", data: [] }, |
| | | }, |
| | | { |
| | | field: "palletCode", |
| | | title: "æçç¼å·", |
| | | type: "string", |
| | |
| | | field: "locationCode", |
| | | title: "è´§ä½ç¼å·", |
| | | type: "string", |
| | | width: 200, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "locationName", |
| | | title: "è´§ä½åç§°", |
| | | type: "string", |
| | | width: 150, |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | |
| | |
| | | field: "orderStatistics", |
| | | title: "æå«ç©ææç»", |
| | | type: "string", |
| | | width: 240, |
| | | width: 630, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | { 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" }, |
| | | ], |
| | |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | 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: "ä»»å¡ç¶æ", |
| | |
| | | { 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" }, |
| | | ], |
| | |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | 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: "ä»»å¡ç¶æ", |
| | |
| | | //} |
| | | //return new PageGridData<Dt_AllocateOrderDetail>(totalCount, data); |
| | | |
| | | Dt_AllocateOrder allocateOrder = _allocateOrderRepository.QueryFirst(x => x.Id == options.Filter.FirstOrDefault().Value.ObjToInt()); |
| | | Dt_OutboundOrder _InboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == allocateOrder.UpperOrderNo).First(); |
| | | try |
| | | { |
| | | Dt_AllocateOrder allocateOrder = _allocateOrderRepository.QueryFirst(x => x.Id == options.Filter.FirstOrDefault().Value.ObjToInt()); |
| | | Dt_OutboundOrder _InboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == allocateOrder.UpperOrderNo).First(); |
| | | var Id = _InboundOrder == null ? 0 : _InboundOrder.Id; |
| | | var data = BaseDal.Db.Queryable<Dt_OutboundOrderDetail>() |
| | | .Where(x => x.OrderId == Id) |
| | | .OrderBy(orderByModels) |
| | | .ToPageList(options.Page, options.Rows, ref totalCount); |
| | | |
| | | var data = BaseDal.Db.Queryable<Dt_OutboundOrderDetail>() |
| | | .WhereIF(!_InboundOrder.IsNullOrEmpty(), x => x.OrderId == _InboundOrder.Id) |
| | | .OrderBy(orderByModels) |
| | | .ToPageList(options.Page, options.Rows, ref totalCount); |
| | | |
| | | |
| | | return new PageGridData<Dt_OutboundOrderDetail>(totalCount, data); |
| | | return new PageGridData<Dt_OutboundOrderDetail>(totalCount, data); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | throw new Exception("æ æç»"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | Dt_AllocateOrder allocateOrder = _allocateOrderRepository.QueryFirst(x => x.Id == (int)options.Value); |
| | | Dt_InboundOrder _InboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_InboundOrder>().Where(x => x.UpperOrderNo == allocateOrder.UpperOrderNo).First(); |
| | | |
| | | var Id = _InboundOrder == null ? 0 : _InboundOrder.Id; |
| | | var data = BaseDal.Db.Queryable<Dt_InboundOrderDetail>() |
| | | .WhereIF(!wheres.IsNullOrEmpty(), wheres) |
| | | .WhereIF(!_InboundOrder.IsNullOrEmpty(), x => x.OrderId == _InboundOrder.Id) |
| | | .Where( x => x.OrderId == Id) |
| | | .OrderBy(orderByModels) |
| | | .ToPageList(options.Page, options.Rows, ref totalCount); |
| | | |
| | |
| | | public enum OutOrderTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// è°æ¨åºåºå |
| | | /// </summary> |
| | | [Description("è°æ¨åºåºå")] |
| | | InternalAllocat = 117, |
| | | /// <summary> |
| | | /// ç产è¿å·¥å |
| | | /// </summary> |
| | | [Description("ç产è¿å·¥å")] |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.Extensions.Logging; |
| | | using SqlSugar; |
| | | using SqlSugar.Extensions; |
| | | using WIDESEA_Common.AllocateEnum; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | |
| | | } |
| | | } |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfo.WarehouseId).FirstLetterToLower()); |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfoDetail.WarehouseCode).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable = sugarQueryable.Where(x => x.WarehouseId.Equals(searchParameters.Value)); |
| | | } |
| | | } |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfo.StockStatus).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable = sugarQueryable.Where(x => x.StockStatus.Equals(searchParameters.Value)); |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.WarehouseCode.Contains(searchParameters.Value)); |
| | | } |
| | | } |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfoDetail.MaterielName).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.MaterielName.Contains(searchParameters.Value)); |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.MaterielName.Equals(searchParameters.Value)); |
| | | } |
| | | } |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfoDetail.BatchNo).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.BatchNo.Equals(searchParameters.Value)); |
| | | } |
| | | } |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfoDetail.SupplyCode).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.SupplyCode.Contains(searchParameters.Value)); |
| | | } |
| | | } |
| | | |
| | |
| | | try |
| | | { |
| | | ISugarQueryable<Dt_StockInfo> sugarQueryable1 = _dbBase.Queryable<Dt_StockInfo>().Includes(x => x.Details); |
| | | ISugarQueryable<Dt_LocationInfo> sugarQueryable = _dbBase.Queryable<Dt_LocationInfo>(); |
| | | if (!string.IsNullOrEmpty(options.Wheres)) |
| | | { |
| | | try |
| | |
| | | .Where(x => x.Details.Any(v => v.BatchNo.Contains(param.Value.ToString()))); |
| | | } |
| | | break; |
| | | |
| | | case var name when name == nameof(Dt_StockInfo.LocationCode).FirstLetterToLower(): |
| | | case var name when name == nameof(Dt_StockInfoDetail.SupplyCode).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.LocationCode == param.Value.ToString()); |
| | | .Where(x => x.Details.Any(v => v.SupplyCode.Contains(param.Value.ToString()))); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_StockInfoDetail.Barcode).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.Details.Any(v => v.Barcode.Contains(param.Value.ToString()))); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_StockInfoDetail.OrderNo).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.Details.Any(v => v.OrderNo.Contains(param.Value.ToString()))); |
| | | } |
| | | break; |
| | | |
| | | case var name when name == nameof(Dt_LocationInfo.LocationStatus).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable = sugarQueryable |
| | | .Where(x => x.LocationStatus == param.Value.ObjToInt()); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_StockInfo.CreateDate).FirstLetterToLower(): |
| | |
| | | } |
| | | } |
| | | EntityProperties.ValidatePageOptions(options, ref sugarQueryable1); |
| | | ISugarQueryable<Dt_LocationInfo> sugarQueryable = _dbBase.Queryable<Dt_LocationInfo>(); |
| | | |
| | | ISugarQueryable<StockViewDTO> list = sugarQueryable1.InnerJoin(sugarQueryable, (b, a) => a.LocationCode == b.LocationCode).Select((b, a) => new StockViewDTO |
| | | { |
| | | LocationCode = b.LocationCode, |
| | |
| | | Layer = a.Layer, |
| | | LocationName = a.LocationName, |
| | | LocationStatus = a.LocationStatus, |
| | | LocationType = a.LocationType, |
| | | LocationType = b.LocationType, |
| | | Modifier = b.Modifier, |
| | | ModifyDate = b.ModifyDate, |
| | | PalletCode = b.PalletCode, |
| | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | |
| | | case "documentTypeEmun": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | Type type = typeof(DocumentType); |
| | | List<int> enums = Enum.GetValues(typeof(DocumentType)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(DocumentType).GetField(((DocumentType)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | } |
| | | return result; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | |
| | | |
| | | // è·ååå½±åç订åæç»IDï¼å»éï¼ |
| | | var affectedDetailIds = returnLocks |
| | | .Select(x => x.OrderDetailId) |
| | | .Distinct() |
| | | .ToList(); |
| | | //var affectedDetailIds = returnLocks |
| | | // .Select(x => x.OrderDetailId) |
| | | // .Distinct() |
| | | // .ToList(); |
| | | |
| | | if (!affectedDetailIds.Any()) |
| | | { |
| | | _logger.LogInformation($"没æåå½±åç订åæç» - OrderNo: {orderNo}"); |
| | | return; |
| | | } |
| | | //if (!affectedDetailIds.Any()) |
| | | //{ |
| | | // _logger.LogInformation($"没æåå½±åç订åæç» - OrderNo: {orderNo}"); |
| | | // return; |
| | | //} |
| | | |
| | | _logger.LogInformation($"æ´æ°{affectedDetailIds.Count}个åå½±åç订åæç» - OrderNo: {orderNo}"); |
| | | //_logger.LogInformation($"æ´æ°{affectedDetailIds.Count}个åå½±åç订åæç» - OrderNo: {orderNo}"); |
| | | |
| | | foreach (var detailId in affectedDetailIds) |
| | | { |
| | | // éæ°è®¡ç®è¯¥è®¢åæç»çé宿°é |
| | | decimal currentLockQty = await CalculateOrderDetailLockQuantity(detailId); |
| | | //foreach (var detailId in affectedDetailIds) |
| | | //{ |
| | | // // éæ°è®¡ç®è¯¥è®¢åæç»çé宿°é |
| | | // decimal currentLockQty = await CalculateOrderDetailLockQuantity(detailId); |
| | | |
| | | // æ£æ¥æ°æ®ä¸è´æ§ |
| | | if (currentLockQty < 0) |
| | | { |
| | | _logger.LogWarning($"é宿°é计ç®ä¸ºè´å¼ - OrderDetailId: {detailId}, å½åå¼: {currentLockQty}ï¼é置为0"); |
| | | currentLockQty = 0; |
| | | } |
| | | // // æ£æ¥æ°æ®ä¸è´æ§ |
| | | // if (currentLockQty < 0) |
| | | // { |
| | | // _logger.LogWarning($"é宿°é计ç®ä¸ºè´å¼ - OrderDetailId: {detailId}, å½åå¼: {currentLockQty}ï¼é置为0"); |
| | | // currentLockQty = 0; |
| | | // } |
| | | |
| | | // è·å订åæç» |
| | | var orderDetail = await _outboundOrderDetailService.Db.Queryable<Dt_OutboundOrderDetail>() |
| | | .FirstAsync(x => x.Id == detailId); |
| | | // // è·å订åæç» |
| | | // var orderDetail = await _outboundOrderDetailService.Db.Queryable<Dt_OutboundOrderDetail>() |
| | | // .FirstAsync(x => x.Id == detailId); |
| | | |
| | | if (orderDetail == null) |
| | | { |
| | | _logger.LogWarning($"æªæ¾å°è®¢åæç» - OrderDetailId: {detailId}"); |
| | | continue; |
| | | } |
| | | // if (orderDetail == null) |
| | | // { |
| | | // _logger.LogWarning($"æªæ¾å°è®¢åæç» - OrderDetailId: {detailId}"); |
| | | // continue; |
| | | // } |
| | | |
| | | // æ´æ°é宿°é |
| | | if (orderDetail.LockQuantity != currentLockQty) |
| | | { |
| | | await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>() |
| | | .SetColumns(it => new Dt_OutboundOrderDetail |
| | | { |
| | | LockQuantity = currentLockQty, |
| | | }) |
| | | .Where(it => it.Id == detailId) |
| | | .ExecuteCommandAsync(); |
| | | // // æ´æ°é宿°é |
| | | // if (orderDetail.LockQuantity != currentLockQty) |
| | | // { |
| | | // await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>() |
| | | // .SetColumns(it => new Dt_OutboundOrderDetail |
| | | // { |
| | | // LockQuantity = currentLockQty, |
| | | // }) |
| | | // .Where(it => it.Id == detailId) |
| | | // .ExecuteCommandAsync(); |
| | | |
| | | _logger.LogInformation($"æ´æ°è®¢åæç»é宿°é - OrderDetailId: {detailId}, " + |
| | | $"æ§å¼: {orderDetail.LockQuantity}, æ°å¼: {currentLockQty}"); |
| | | } |
| | | // _logger.LogInformation($"æ´æ°è®¢åæç»é宿°é - OrderDetailId: {detailId}, " + |
| | | // $"æ§å¼: {orderDetail.LockQuantity}, æ°å¼: {currentLockQty}"); |
| | | // } |
| | | |
| | | // æ´æ°è®¢åæç»ç¶æ |
| | | await UpdateOrderDetailStatus(orderDetail); |
| | | } |
| | | // // æ´æ°è®¢åæç»ç¶æ |
| | | // await UpdateOrderDetailStatus(orderDetail); |
| | | //} |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | { |
| | | hasInProgress = true; |
| | | } |
| | | await UpdateOrderDetailStatus(detail); |
| | | } |
| | | |
| | | var outboundOrder = await _outboundOrderService.Db.Queryable<Dt_OutboundOrder>() |
| | |
| | | |
| | | _logger.LogInformation($"æ´æ°è®¢åç¶æ - OrderNo: {orderNo}, æ§ç¶æ: {outboundOrder.OrderStatus}, æ°ç¶æ: {newStatus}"); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | if (allCompleted && newStatus == (int)OutOrderStatusEnum.åºåºå®æ) |
| | | { |
| | | |
| | | if (outboundOrder.OrderType == OutOrderTypeEnum.Allocate.ObjToInt()) |
| | | if (outboundOrder.OrderType == OutOrderTypeEnum.Allocate.ObjToInt() || outboundOrder.OrderType == OutOrderTypeEnum.InternalAllocat.ObjToInt()) |
| | | { |
| | | var allocate = _allocateService.Repository.QueryData(x => x.UpperOrderNo == outboundOrder.UpperOrderNo).First(); |
| | | var allocatefeedmodel = new AllocateDto |