From 0705cb6170a9ba77ba48bbb6dcebb9cf3d73cbea Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 14 十月 2025 02:12:25 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
---
代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/ProStockSelect.vue | 198 +++++++++++++++++++++++++++++++++++++------------
1 files changed, 150 insertions(+), 48 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/ProStockSelect.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/ProStockSelect.vue"
index 3a59ab1..03b4fdc 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/ProStockSelect.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/ProStockSelect.vue"
@@ -3,7 +3,7 @@
<vol-box
v-model="showDetialBox"
:lazy="true"
- width="80%"
+ width="78%"
:padding="15"
title="鎸囧畾搴撳瓨"
>
@@ -21,8 +21,8 @@
>闇�姹傛暟閲忥細 {{ row.qtyPcs }}
</span>
<el-divider direction="vertical"></el-divider>
- <span class="less-style"
- >宸插垎閰嶆暟閲忥細 {{ row.lockQtyPcs }}
+ <span :class="selectionClass"
+ >宸查�夋暟閲忥細 {{ selectionSum }}
</span>
</el-col>
<el-col>
@@ -57,24 +57,33 @@
align="center"
></el-table-column>
<el-table-column
- v-for="(item, index) in tableColumns"
+ v-for="(item, index) in tableColumns.filter((x) => !x.hidden)"
:key="index"
:prop="item.prop"
:label="item.title"
:width="item.width"
align="center"
>
- <template #default="scoped" 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">
+ <div v-if="item.type == 'icon'">
+ <el-tooltip
+ class="item"
+ effect="dark"
+ :content="item.title"
+ placement="bottom"
+ ><el-link
+ type="primary"
+ :disabled="getButtonEnable(item.prop, scoped.row)"
+ @click="tableButtonClick(scoped.row, item)"
+ ><i :class="item.icon" style="font-size: 22px"></i></el-link
+ ></el-tooltip>
+ </div>
+
+ <div v-else-if="item.type == 'tag'">
+ <el-tag size="small">
+ {{ getDictionary(scoped.row, item) }}
+ </el-tag>
+ </div>
</template>
</el-table-column>
</el-table>
@@ -93,6 +102,7 @@
<script>
import VolBox from "@/components/basic/VolBox.vue";
import { fa } from "element-plus/es/locales.mjs";
+import { el } from 'element-plus/es/locale';
export default {
components: { VolBox },
data() {
@@ -104,46 +114,78 @@
tableData: [],
tableColumns: [
{
- field: "proStockId",
+ prop: "proStockId",
title: "搴撳瓨淇℃伅涓婚敭",
type: "string",
width: 90,
- align: "left"
+ hidden: true,
},
{
- field: "productCode",
+ prop: "proStockAttribute",
+ title: "搴撳瓨灞炴��",
+ type: "tag",
+ width: 110,
+ bindKey: "proStockAttributeEnum",
+ },
+ {
+ prop: "locationCode",
+ title: "浠撳偍浣嶇疆",
+ type: "string",
+ width: 130,
+ },
+ {
+ prop: "palletCode",
+ title: "澶栧寘鍙�",
+ type: "string",
+ width: 130,
+ },
+ {
+ prop: "productCode",
title: "浜у搧缂栫爜",
type: "string",
width: 140,
- align: "left",
},
{
- field: "productVersion",
+ prop: "productVersion",
title: "浜у搧鐗堟湰",
type: "string",
- width: 80,
- align: "left",
+ width: 100,
},
{
- field: "dateCode",
+ prop: "dateCode",
title: "鍛ㄦ湡",
type: "string",
- width: 80,
- align: "left",
+ width: 120,
},
{
- field: "saleOrder",
+ prop: "erpOrder",
+ title: "ERP宸ュ崟",
+ type: "string",
+ width: 200,
+ },
+ {
+ prop: "moNumber",
+ title: "鍒堕�犲崟",
+ type: "string",
+ width: 140,
+ },
+ {
+ prop: "saleOrder",
title: "閿�鍞鍗�",
type: "string",
width: 200,
- align: "left",
},
{
- field: "sumStocks",
+ prop: "sumStocks",
title: "搴撳瓨PCS鏁�",
type: "string",
- width: 90,
- align: "left",
+ width: 120,
+ },
+ {
+ prop: "createDate",
+ title: "鍒涘缓鏃堕棿",
+ type: "string",
+ width: 160,
},
// {
// field: "lotNumber",
@@ -213,6 +255,7 @@
// },
],
selection: [],
+ isTrue: false,
selectionSum: 0,
selectionClass: "less-style",
originalQuantity: 0,
@@ -224,8 +267,9 @@
this.row = row;
this.showDetialBox = true;
this.originalQuantity = this.row.lockQuantity;
- this.selectionSum = this.row.lockQuantity;
+ this.selectionSum = this.row.lockQtyPcs;
this.getData();
+ this.getDictionaryData();
if (this.selectionSum == this.row.orderQuantity) {
this.selectionClass = "equle-style";
} else if (this.selectionSum < this.row.orderQuantity) {
@@ -238,9 +282,7 @@
if (this.selection.length <= 0) {
return this.$message.error("璇峰嬀閫�");
}
- let url = this.pkcx
- ? "api/Task/GeneratePKOutboundTask?orderDetailId="
- : "api/Task/GenerateOutboundTask?orderDetailId=";
+ let url ="api/Task/OutProductSelect?orderDetailId=";
this.http
.post(url + this.row.id, this.selection, "鏁版嵁澶勭悊涓�")
.then((x) => {
@@ -250,6 +292,7 @@
this.$emit("parentCall", ($vue) => {
$vue.getData();
});
+ this.$parent.refresh();
});
},
getData(a) {
@@ -266,20 +309,41 @@
});
},
handleSelectionChange(val) {
- this.selection = val;
- this.selectionSum =
- val.reduce(
- (accumulator, currentValue) =>
- accumulator + currentValue["useableQuantity"],
- 0
- ) + this.originalQuantity;
- if (this.selectionSum == this.row.orderQuantity) {
- this.selectionClass = "equle-style";
- } else if (this.selectionSum < this.row.orderQuantity) {
- this.selectionClass = "less-style";
- } else {
- this.selectionClass = "more-style";
- }
+ this.selection=val;
+ this.CheckSelection(val);
+ //鍒ゆ柇鍕鹃�変腑鐨剆umStocks鏁伴噺濡傛灉褰撳墠鍕鹃�夋暟澶т簬row.qtyPcs鍒欏彇娑堝嬀閫�
+ // if (this.selection.length<=0) {
+ // this.selection = val;
+ // this.selectionSum = val[0].sumStocks;
+ // }else{
+ // if (this.selectionSum + val[0].sumStocks > this.row.qtyPcs) {
+ // this.$message.error("鍕鹃�夋暟閲忓凡婊¤冻闇�姹傛暟閲�,鏃犻渶鍐嶅嬀閫�");
+ // }else {
+ // this.selection = val;
+ // this.selectionSum += val[0].sumStocks;
+ // }
+ // }1
+ },
+ CheckSelection(rows) {
+ if (rows.length <= 0) {
+ this.selectionSum = this.row.lockQtyPcs;
+ } else {
+ if (this.selectionSum >= this.row.qtyPcs) {
+ this.$message.error("宸叉弧瓒抽渶姹傛暟閲�,鏃犻渶鍐嶅嬀閫�");
+ //绉婚櫎this.selection涓渶鍚庝竴涓�
+ this.$refs.singleTable.toggleRowSelection(this.selection[this.selection.length - 1],false);
+ this.selection.splice(-1, 1);
+ this.selectionSum = this.selection.reduce((sum, item) => {
+ return sum + item.sumStocks;
+ }, 0)+this.row.lockQtyPcs;
+ }else {
+ this.selectionSum=0;
+ rows.forEach(row => {
+ this.selectionSum+= row.sumStocks;
+ });
+ this.selectionSum+=this.row.lockQtyPcs;
+ }
+ }
},
toggleSelection(rows) {
if (rows) {
@@ -295,6 +359,41 @@
},
handleRowClick(row) {
this.$refs.singleTable.toggleRowSelection(row);
+ },
+ getDictionaryData() {
+ if (this.dictionaryList) {
+ return;
+ }
+ var param = [];
+ this.tableColumns.forEach((x) => {
+ if (x.type == "tag" && x.bindKey != "") {
+ param.push(x.bindKey);
+ }
+ });
+ this.http
+ .post("api/Sys_Dictionary/GetVueDictionary", param, "鏌ヨ涓�")
+ .then((x) => {
+ if (x.length > 0) {
+ this.dictionaryList = x;
+ console.log(this.dictionaryList);
+ }
+ });
+ },
+ getDictionary(row, column) {
+ if (this.dictionaryList) {
+ var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey);
+ if (item) {
+ var dicItem = item.data.find((x) => x.key == row[column.prop]);
+ console.log(dicItem);
+ if (dicItem) {
+ return dicItem.value;
+ } else {
+ return row[column.prop];
+ }
+ } else {
+ return row[column.prop];
+ }
+ }
},
},
};
@@ -343,4 +442,7 @@
.box-head .el-alert__content {
width: 100%;
}
+ .el-table__header .el-checkbox {
+ display: none;
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.3