From 695571c6009ecbc12e7d4a4fb147df7967a1260e Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 07 七月 2025 20:21:19 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
---
代码管理/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js | 101 +++++++++++++++++++++++++++++++++++---------------
1 files changed, 71 insertions(+), 30 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js"
index 92ad623..b8c502e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js"
@@ -19,22 +19,20 @@
methods: {
//涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
onInit() {
- // let InOrder = this.buttons.find(x => x.value == 'StockOutbound');
- // if (InOrder) {
- // InOrder.onClick = function () {
- // let rows = this.$refs.table.getSelected();
- // if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
- // if (rows.length > 1) return this.$error("璇烽�夋嫨鍗曟潯鏁版嵁!");
- // var keys = rows.map(x => { return x.stockId });
- // this.http
- // .post("api/Task/Outbound?id="+keys[0], null, "鏁版嵁澶勭悊涓�")
- // .then((x) => {
- // if (!x.status) return this.$message.error(x.message);
- // this.$message.success("鎿嶄綔鎴愬姛");
- // this.refresh();
- // });
- // }
- // }
+
+ let SelectTake = this.buttons.find(x => x.value == 'SelectStockTake');
+ if (SelectTake) {
+ SelectTake.onClick = function () {
+ let stockViews = this.$refs.table.getSelected();
+ this.http
+ .post("api/Task/TakeOutbound",stockViews, "鏁版嵁澶勭悊涓�")
+ .then((x) => {
+ if (!x.status) return this.$message.error(x.message);
+ this.$message.success("鎿嶄綔鎴愬姛");
+ this.refresh();
+ });
+ }
+ }
this.columns.forEach(column => {
if (column.field == 'materielCode') {
column.formatter = (row) => {
@@ -56,27 +54,36 @@
return str = list[0] == "" ? "鏃�" : str;
}
}
- if (column.field == 'materielInfo') {
- const today = new Date()
- column.formatter = (row) => {
- if (row.details.length > 0) {
- const today = new Date();
- const closestDate = row.details
+ if (column.field == 'materielInfo') {
+ const today = new Date()
+ column.formatter = (row) => {
+ if (row.details.length > 0) {
+ const today = new Date();
+ const closestDate = row.details
.map(x => {
- const date = new Date(x.effectiveDate);
- const diffInDays = Math.ceil(Math.abs((today - date) / (1000 * 60 * 60 * 24)));
- return { date, diffInDays };
+ const date = new Date(x.effectiveDate);
+ const diffInDays = Math.ceil((date - today) / (1000 * 60 * 60 * 24)); // 鏀逛负璁$畻鍓╀綑澶╂暟
+ return { date, diffInDays };
})
.reduce((closest, current) => (current.diffInDays < closest.diffInDays ? current : closest))
.date;
- const daysSinceClosest = Math.ceil(Math.abs((today - closestDate) / (1000 * 60 * 60 * 24)));
- return '<span style="color: #F56C6C">' + daysSinceClosest + "澶�" + '</span>';
+ const daysRemaining = Math.ceil((closestDate - today) / (1000 * 60 * 60 * 24));
+
+ row.expiryDays = daysRemaining;
+
+ if (daysRemaining <= 0) {
+ return '<span style="color:rgb(30, 27, 27)">鏃犱繚璐ㄦ湡</span>';
} else {
- return '<span style="color: #F56C6C">' + "鏃犱繚璐ㄦ湡" + '</span>';
+ return '<span style="color: #F56C6C">' + daysRemaining + "澶�" + '</span>';
}
+ } else {
+ row.expiryDays = null;
+ return '<span style="color:rgb(24, 18, 18)">鏃犱繚璐ㄦ湡</span>';
+ }
+ }
- }
+
}
if (column.field == 'sumStock') {
column.formatter = (row) => {
@@ -86,7 +93,7 @@
.map(x => {
sum += (x.stockQuantity)
})
- return '<span style="color: #F56C6C">' + sum + row.details[0].unit + '</span>';
+ return '<span style="color: #F56C6C">' + sum.toFixed(3) + row.details[0].unit + '</span>';
} else {
return '<span style="color: #F56C6C">' + "1涓�" + '</span>';
}
@@ -94,11 +101,45 @@
}
}
})
+ this.columns.forEach((column) => {
+ column.cellStyle = (row) => {
+ // 鍙鐞嗘湁淇濊川鏈熸暟鎹殑鎯呭喌
+ if (row.expiryDays !== null && row.expiryDays !== undefined) {
+ if (row.expiryDays <= 0) {
+ return { background: 'red' }; // 绾㈣壊鑳屾櫙锛堝凡杩囨湡锛�
+ } else if (row.expiryDays <= 30) {
+ return { background: 'yellow' }; // 榛勮壊鑳屾櫙锛堜复鏈燂級
+ }
+ }
+ return {}; // 榛樿鏃犺儗鏅壊
+ };
+
+
+
+
+ //濡傛灉鏍规嵁琛岀殑鏌愪釜鍊艰缃暣琛岄鑹�
+ //璁剧疆鏁磋鑳屾櫙棰滆壊
+ // x.cellStyle = (row, rowIndex, columnIndex) => {
+ // if (row.ProductCode == '10044464880643') {
+ // return { background: '#ddecfd' };
+ // }
+ // };
+ });
},
onInited() {
//妗嗘灦鍒濆鍖栭厤缃悗
//濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔
//this.detailOptions.columns.forEach(column=>{ });
+ this.detailOptions.summary = true;
+ this.detailOptions.columns.forEach(x => {
+ if (x.field == 'stockQuantity') {
+ x.summary = true;
+ //璁$畻骞冲潎鍊�
+ // x.summary = 'avg';//2023.05.03鏇存柊voltable鏂囦欢鍚庢墠鑳戒娇鐢�
+ //璁剧疆灏忔暟鏄剧ず浣嶆暟(榛樿2浣�)
+ // x.numberLength = 4;
+ }
+ });
},
searchBefore(param) {
//鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
--
Gitblit v1.9.3