From 801ddd3be4d6bf8553cac870435bb5092eca6b60 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 06 一月 2025 18:50:38 +0800
Subject: [PATCH] 更新前端代码
---
代码管理/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 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 24e1d94..e43f901 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"
@@ -17,6 +17,61 @@
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();
+ });
+ }
+ }
+ this.columns.forEach(column => {
+ if (column.field == 'materielCode') {
+ column.formatter = (row) => {
+ var str='';
+ var list=row.materielCode.split(',');
+ for (let index = 0; index < list.length; index++) {
+ str+=list[index]+'<br>';
+ }
+ return str;
+ }
+ }
+ if (column.field == 'batchNo') {
+ column.formatter = (row) => {
+ var str='';
+ var list=row.batchNo.split(',');
+ for (let index = 0; index < list.length; index++) {
+ str+=list[index]+'<br>';
+ }
+ return str;
+ }
+ }
+ if (column.field == 'materielInfo') {
+ const today = new Date()
+ column.formatter = (row) => {
+ 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 };
+ })
+ .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>';
+ }
+ }
+ })
},
onInited() {
//妗嗘灦鍒濆鍖栭厤缃悗
--
Gitblit v1.9.3