From 7ca9651f81d7b84f054194d3d46fdbd1d9c8b922 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期三, 09 七月 2025 22:55:27 +0800 Subject: [PATCH] 增加质检出入库逻辑 --- 项目代码/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue | 109 ++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 77 insertions(+), 32 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue" index 14cafdc..723cef3 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue" @@ -23,7 +23,7 @@ >宸查�夋暟閲忥細 {{ selectionSum }} </span> </el-col> - <el-col :span="4"> + <!-- <el-col :span="4"> <el-link type="primary" size="small" @@ -31,7 +31,7 @@ @click="revokeAssign" >鎾ら攢鍒嗛厤</el-link ></el-col - > + > --> </el-row> </el-alert> </div> @@ -62,17 +62,35 @@ :width="item.width" align="center" > - <template #default="scoped" v-if="item.type == 'icon'"> - <el-tooltip - class="item" - effect="dark" - :content="item.title" - placement="bottom" - ><el-button - type="text" - @click="tableButtonClick(scoped.row, item)" - ><i :class="item.icon" style="font-size: 22px"></i></el-button - ></el-tooltip> + <template #default="scoped"> + <template v-if="item.type == 'icon'"> + <el-tooltip + class="item" + effect="dark" + :content="item.title" + placement="bottom" + ><el-button + type="text" + @click="tableButtonClick(scoped.row, item)" + ><i + :class="item.icon" + :style="{ fontSize: item.iconSize || '22px' }" + ></i></el-button + ></el-tooltip> + </template> + <template v-else> + <el-tooltip + :content="scoped.row[item.prop]" + placement="top" + :disabled=" + !isContentOverflow(scoped.row[item.prop], item.width) + " + > + <div class="cell-content"> + {{ scoped.row[item.prop] }} + </div> + </el-tooltip> + </template> </template> </el-table-column> </el-table> @@ -101,23 +119,23 @@ showDetialBox: false, tableData: [], tableColumns: [ - { - prop: "materielCode", - title: "鐗╂枡缂栧彿", - type: "string", - width: 150, - }, - { - prop: "materielName", - title: "鐗╂枡鍚嶇О", - type: "string", - width: 150, - }, + // { + // prop: "materielCode", + // title: "鐗╂枡缂栧彿", + // type: "string", + // width: 150, + // }, + // { + // prop: "materielName", + // title: "鐗╂枡鍚嶇О", + // type: "string", + // width: 150, + // }, // { // prop: "palletCode", // title: "鎵樼洏缂栧彿", // type: "string", - // width: 150, + // width: 280, // }, { prop: "batchNo", @@ -126,13 +144,19 @@ width: 150, }, // { - // prop: "locationCode", - // title: "璐т綅缂栧彿", + // prop: "stockQuantity", + // title: "搴撳瓨", + // type: "string", + // width: 150, + // }, + // { + // prop: "outboundQuantity", + // title: "鍑哄簱琚嬫暟", // type: "string", // width: 180, // }, { - prop: "useableQuantity", + prop: "stockQuantity", title: "鍙敤鏁伴噺", type: "string", }, @@ -144,6 +168,13 @@ }; }, methods: { + isContentOverflow(content, width) { + if (!content || !width) return false; + // 浼扮畻姣忎釜瀛楃鐨勫搴︼紙鏍规嵁瀛椾綋澶у皬璋冩暣锛� + const charWidth = 8; // 鍋囪姣忎釜瀛楃瀹藉害涓� 8px + const maxChars = Math.floor(width / charWidth); + return content.length > maxChars; + }, open(row) { this.row = row; this.showDetialBox = true; @@ -175,9 +206,15 @@ }); }, outbound() { + if (this.selection.length <= 0) { + return this.$message.error("璇烽�夋嫨鎸囧畾搴撳瓨"); + } + // if (this.selectionSum > this.row.orderQuantity) { + // return this.$message.error("宸查�夋暟閲忎笉鑳借秴杩囬渶姹傛暟閲�"); + // } this.http .post( - "api/Task/GenerateOutboundTask?id=" + this.row.id, + "api/Task/NewGenerateOutboundTask?id=" + this.row.id, this.selection, "鏁版嵁澶勭悊涓�" ) @@ -193,7 +230,9 @@ getData() { this.http .post( - "api/StockInfo/GetStockSelectViews?materielCode=" + + // "api/StockInfo/GetStockSelectViews?materielCode=" + + // this.row.materielCode, + "api/InventoryBatch/GetInventoryBatch?materielCode=" + this.row.materielCode, null, "鏌ヨ涓�" @@ -224,7 +263,7 @@ this.selectionSum = val.reduce( (accumulator, currentValue) => - accumulator + currentValue["useableQuantity"], + accumulator + currentValue["stockQuantity"], 0 ) + this.originalQuantity; if (this.selectionSum == this.row.orderQuantity) { @@ -263,6 +302,12 @@ .more-style { color: red; } +.cell-content { + white-space: nowrap; /* 闃叉鎹㈣ */ + overflow: hidden; /* 闅愯棌瓒呭嚭閮ㄥ垎 */ + text-overflow: ellipsis; /* 鏄剧ず鐪佺暐鍙� */ + width: 100%; /* 瀹藉害鍗犳弧鍗曞厓鏍� */ +} </style> <style> -- Gitblit v1.9.3