| | |
| | | <template> |
| | | <div> |
| | | <!-- åºåæå®å¼¹çª --> |
| | | <vol-box |
| | | v-model="showDetialBox" |
| | | :lazy="true" |
| | | width="60%" |
| | | width="80%" |
| | | :padding="15" |
| | | title="æå®åºå" |
| | | > |
| | |
| | | <el-alert :closable="false" style="width: 100%"> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <span class="less-style">åæ®ç¼å·ï¼{{ mainOrderNo }}</span> |
| | | <el-divider direction="vertical"></el-divider> |
| | | <span class="less-style">ç©æåç§°ï¼ {{ row.materielName }} </span> |
| | | <el-divider direction="vertical"></el-divider> |
| | | <span class="less-style">ç©æç¼å·ï¼ {{ row.materielCode }} </span> |
| | |
| | | </span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <!-- <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px" |
| | | @click="getData(false)" |
| | | >{{ kcname }}</el-link |
| | | > --> |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | |
| | | @click="getData" |
| | | >å·æ°</el-link |
| | | > |
| | | <!-- <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="revokeAssign" |
| | | >æ¤éåé
</el-link |
| | | > --> |
| | | </el-col> |
| | | </el-row> |
| | | </el-alert> |
| | |
| | | height="500px" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | > |
| | | <el-table-column type="selection" width="55"> </el-table-column> |
| | | <el-table-column |
| | | label="åºå·" |
| | |
| | | </el-table> |
| | | </div> |
| | | <template #footer> |
| | | <!-- <el-button type="primary" size="small" @click="outbound" |
| | | <el-button type="primary" size="small" @click="openStationDialog" |
| | | >ç´æ¥åºåº</el-button |
| | | > |
| | | <el-button type="primary" size="small" @click="lockStock" |
| | | >éå®åºå</el-button |
| | | > --> |
| | | <el-button type="danger" size="small" @click="showDetialBox = false" |
| | | >å
³é</el-button |
| | | > |
| | | </template> |
| | | </vol-box> |
| | | |
| | | <!-- ç«å°éæ©å¼¹çª --> |
| | | <el-dialog |
| | | v-model="showStationDialog" |
| | | title="éæ©åºåºç«å°" |
| | | width="500px" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <div class="station-dialog-content"> |
| | | <el-form :model="stationForm" label-width="100px"> |
| | | <el-form-item label="éæ©ç«å°ï¼" required> |
| | | <el-select |
| | | v-model="stationForm.selectedPlatform" |
| | | placeholder="è¯·éæ©åºåºç«å°" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in stations" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åºåºæ°éï¼"> |
| | | <el-input |
| | | v-model="selectionSum" |
| | | readonly |
| | | style="width: 100%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç©æä¿¡æ¯ï¼"> |
| | | <div style="font-size: 12px; color: #666; line-height: 1.5"> |
| | | <div>ç©æç¼å·ï¼{{ row.materielCode }}</div> |
| | | <div>ç©æåç§°ï¼{{ row.materielName }}</div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="showStationDialog = false">åæ¶</el-button> |
| | | <el-button type="primary" @click="confirmOutbound">确认åºåº</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | import { fa } from "element-plus/es/locales.mjs"; |
| | | // å¼å
¥ç«å°ç®¡çå·¥å
· |
| | | import { stationManager } from "@/../src/uitils/stationManager"; |
| | | |
| | | export default { |
| | | components: { VolBox }, |
| | | data() { |
| | | return { |
| | | row: null, |
| | | kcname: "", |
| | | mainOrderNo: "", |
| | | pkcx: false, |
| | | showDetialBox: false, |
| | | showStationDialog: false, // ç«å°éæ©å¼¹çªæ¾ç¤ºæ§å¶ |
| | | tableData: [], |
| | | tableColumns: [ |
| | | { |
| | |
| | | width: 150, |
| | | }, |
| | | { |
| | | prop: "barcode", |
| | | title: "æ¡ç ", |
| | | type: "string", |
| | | width: 150, |
| | | }, |
| | | { |
| | | prop: "locationCode", |
| | | title: "è´§ä½ç¼å·", |
| | | type: "string", |
| | |
| | | title: "å¯ç¨æ°é", |
| | | type: "string", |
| | | }, |
| | | { |
| | | prop: "supplyCode", |
| | | title: "ä¾åºå", |
| | | type: "string", |
| | | }, |
| | | { |
| | | prop: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | }, |
| | | { |
| | | prop: "stockId", |
| | | title: "åºå主é®", |
| | | type: "string", |
| | | }, |
| | | { |
| | | prop: "orderDetailId", |
| | | title: "åæ®æç»ä¸»é®", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | selection: [], |
| | | selectionSum: 0, |
| | | selectionClass: "less-style", |
| | | originalQuantity: 0, |
| | | |
| | | // ç«å°ç¸å
³æ°æ® |
| | | stations: [ |
| | | { label: "ç«å°2", value: "2-1" }, |
| | | { label: "ç«å°3", value: "3-1" }, |
| | | ], |
| | | stationForm: { |
| | | selectedPlatform: "", // ä¿®æ¹å段å以å¹é
åæ° |
| | | }, |
| | | }; |
| | | }, |
| | | methods: { |
| | | open(row) { |
| | | console.log(row); |
| | | open(row, orderNo) { |
| | | this.row = row; |
| | | this.mainOrderNo = orderNo; |
| | | this.showDetialBox = true; |
| | | this.originalQuantity = this.row.lockQuantity; |
| | | this.selectionSum = this.row.lockQuantity; |
| | | this.getData(); |
| | | |
| | | if (this.selectionSum == this.row.orderQuantity) { |
| | | this.selectionClass = "equle-style"; |
| | | } else if (this.selectionSum < this.row.orderQuantity) { |
| | |
| | | this.selectionClass = "more-style"; |
| | | } |
| | | }, |
| | | lockStock() { |
| | | this.http |
| | | .post( |
| | | "api/OutboundOrderDetail/LockOutboundStock?id=" + this.row.id, |
| | | 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(); |
| | | }); |
| | | }); |
| | | }, |
| | | outbound() { |
| | | |
| | | // æå¼ç«å°éæ©å¼¹çª |
| | | openStationDialog() { |
| | | if (this.selection.length <= 0) { |
| | | return this.$message.error("请å¾é"); |
| | | return this.$message.error("请å
å¾éè¦åºåºçåºå"); |
| | | } |
| | | let url = this.pkcx |
| | | ? "api/Task/GenerateOutboundTask?orderDetailId=" |
| | | : "api/Task/GenerateOutboundTask?orderDetailId="; |
| | | this.http |
| | | .post(url + this.row.id, 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(); |
| | | }); |
| | | }); |
| | | |
| | | // ä»ç¼åä¸è·åé»è®¤ç«å° |
| | | const cachedStation = stationManager.getStation(); |
| | | this.stationForm.selectedPlatform = cachedStation || ""; |
| | | |
| | | this.showStationDialog = true; |
| | | }, |
| | | |
| | | // 确认åºåº |
| | | async confirmOutbound() { |
| | | if (!this.stationForm.selectedPlatform) { |
| | | return this.$message.error("è¯·éæ©åºåºç«å°"); |
| | | } |
| | | |
| | | // åå¤è¯·æ±åæ° |
| | | const requestParams = { |
| | | detailIds: [this.row.id], // åºåºåçæç»ID |
| | | outboundTargetLocation: this.stationForm.selectedPlatform, // éæ©çç«å° |
| | | outboundQuantity: this.selectionSum, // 已鿰é |
| | | operator: this.getCurrentOperator(), // è·åå½åæä½äºº |
| | | orderNo: this.mainOrderNo, // åæ®ç¼å· |
| | | stockDetailIds: this.selection.map(item => item.stockId) // åºåæç»ä¸»é®æ°ç» |
| | | }; |
| | | |
| | | try { |
| | | const x = await this.http.post( |
| | | "api/Outbound/ProcessPickingOutbound", |
| | | requestParams, |
| | | "æ°æ®å¤çä¸" |
| | | ); |
| | | |
| | | if (!x.status) { |
| | | return this.$message.error(x.message); |
| | | } |
| | | |
| | | this.$message.success("åºåºä»»å¡å建æå"); |
| | | this.showStationDialog = false; |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | } catch (error) { |
| | | this.$message.error(error.message || "åºåºå¤ç失败"); |
| | | } |
| | | }, |
| | | |
| | | // è·åå½åæä½äºº |
| | | getCurrentOperator() { |
| | | // å¯ä»¥ä»æ¬å°åå¨ãVuexæå
¨å±ç¶æä¸è·åå½åç¨æ· |
| | | try { |
| | | // 示ä¾ï¼ä»localStorageè·åç¨æ·ä¿¡æ¯ |
| | | const userInfo = JSON.parse(localStorage.getItem('userInfo') || '{}'); |
| | | if (userInfo.userName) { |
| | | return userInfo.userName; |
| | | } |
| | | |
| | | // 示ä¾ï¼ä»Vuexè·åç¨æ·ä¿¡æ¯ |
| | | if (this.$store && this.$store.state.user) { |
| | | return this.$store.state.user.userName; |
| | | } |
| | | } catch (error) { |
| | | console.error('è·åæä½äººä¿¡æ¯å¤±è´¥:', error); |
| | | } |
| | | |
| | | // é»è®¤æä½äºº |
| | | return "admin"; |
| | | }, |
| | | |
| | | getData(a) { |
| | | if (!a) this.pkcx = !this.pkcx; |
| | | let url = this.pkcx |
| | |
| | | this.tableData = x; |
| | | }); |
| | | }, |
| | | revokeAssign() { |
| | | console.log(this.row); |
| | | this.http |
| | | .post( |
| | | "api/OutboundOrderDetail/RevokeLockOutboundStock?id=" + this.row.id, |
| | | null, |
| | | "æ°æ®å¤çä¸" |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.$message.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | handleSelectionChange(val) { |
| | | this.selection = val; |
| | | this.selectionSum = |
| | |
| | | this.selectionClass = "more-style"; |
| | | } |
| | | }, |
| | | |
| | | toggleSelection(rows) { |
| | | if (rows) { |
| | | rows.forEach((row) => { |
| | |
| | | this.$refs.singleTable.clearSelection(); |
| | | } |
| | | }, |
| | | |
| | | clearSelection() { |
| | | this.$refs.singleTable.clearSelection(); |
| | | }, |
| | | |
| | | handleRowClick(row) { |
| | | this.$refs.singleTable.toggleRowSelection(row); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .less-style { |
| | | color: black; |
| | |
| | | |
| | | .more-style { |
| | | color: red; |
| | | } |
| | | |
| | | /* ç«å°éæ©å¼¹çªæ ·å¼ */ |
| | | .station-dialog-content { |
| | | padding: 10px 0; |
| | | } |
| | | |
| | | .dialog-footer { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | gap: 10px; |
| | | } |
| | | </style> |
| | | |
| | |
| | | |
| | | .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 { |