From 2825b82e8a4eca618ab3c2306de2db74a2ecbd1d Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 06 四月 2026 15:54:58 +0800
Subject: [PATCH] #任务取消优化
---
src/main/webapp/static/js/wrkMastLog/wrkMastLog.js | 128 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 117 insertions(+), 11 deletions(-)
diff --git a/src/main/webapp/static/js/wrkMastLog/wrkMastLog.js b/src/main/webapp/static/js/wrkMastLog/wrkMastLog.js
index 1dd1f6c..34d2335 100644
--- a/src/main/webapp/static/js/wrkMastLog/wrkMastLog.js
+++ b/src/main/webapp/static/js/wrkMastLog/wrkMastLog.js
@@ -1338,27 +1338,27 @@
minWidth: 110
},
wmsWrkNo: {
- label: 'WMS宸ヤ綔鍙�',
+ label: 'WMS浠诲姟鍙�',
searchable: true,
quickSearch: true,
minWidth: 140
},
wrkSts: {
label: '宸ヤ綔鐘舵��',
- kind: 'foreign',
+ kind: 'enum',
tableProp: 'wrkSts$',
exportField: 'wrkSts$',
- foreignQuery: 'basWrkStatus',
+ enumOptions: [],
searchable: true,
quickSearch: true,
minWidth: 160
},
ioType: {
- label: '鍏ュ嚭搴撶被鍨�',
- kind: 'foreign',
+ label: '浠诲姟绫诲瀷',
+ kind: 'enum',
tableProp: 'ioType$',
exportField: 'ioType$',
- foreignQuery: 'basWrkIotype',
+ enumOptions: [],
searchable: true,
quickSearch: true,
minWidth: 160
@@ -1368,8 +1368,8 @@
tableProp: 'ioTime$',
exportField: 'ioTime$',
kind: 'date',
- searchable: true,
- quickSearch: true,
+ searchable: false,
+ quickSearch: false,
defaultVisible: false,
minWidth: 300
},
@@ -1385,25 +1385,38 @@
minWidth: 90
},
sourceStaNo: {
- label: '婧愮珯'
+ label: '婧愮珯',
+ kind: 'enum',
+ enumOptions: [],
+ searchable: false,
+ minWidth: 120
},
staNo: {
- label: '鐩爣绔�'
+ label: '鐩爣绔�',
+ kind: 'enum',
+ enumOptions: [],
+ searchable: false,
+ minWidth: 120
},
sourceLocNo: {
label: '婧愬簱浣�',
+ searchable: true,
minWidth: 120
},
locNo: {
label: '鐩爣搴撲綅',
+ searchable: true,
+ quickSearch: true,
minWidth: 120
},
crnNo: {
label: '鍫嗗灈鏈�',
+ searchable: true,
minWidth: 100
},
dualCrnNo: {
label: '鍙屽伐浣嶅爢鍨涙満',
+ searchable: true,
minWidth: 140
},
batch: {
@@ -1415,7 +1428,9 @@
minWidth: 110
},
barcode: {
- label: '鏉$爜',
+ label: '鎵樼洏鐮�',
+ searchable: true,
+ quickSearch: true,
minWidth: 140
},
modiUser: {
@@ -1804,6 +1819,39 @@
};
}
+ function getFieldByName(fieldName) {
+ for (var i = 0; i < fieldMeta.length; i += 1) {
+ if (fieldMeta[i] && fieldMeta[i].field === fieldName) {
+ return fieldMeta[i];
+ }
+ }
+ return null;
+ }
+
+ function buildEnumOptions(records, valueField, labelField) {
+ var options = [];
+ var seen = {};
+ (records || []).forEach(function (item) {
+ if (!item) {
+ return;
+ }
+ var rawValue = item[valueField];
+ if (isEmptyValue(rawValue)) {
+ return;
+ }
+ var key = String(rawValue);
+ if (seen[key]) {
+ return;
+ }
+ seen[key] = true;
+ options.push({
+ rawValue: key,
+ label: isEmptyValue(item[labelField]) ? key : String(item[labelField])
+ });
+ });
+ return options;
+ }
+
function handleForbidden(res) {
if (res && res.code === 403) {
top.location.href = baseUrl + '/';
@@ -1961,6 +2009,7 @@
}
},
created: function () {
+ this.loadSearchEnumOptions();
this.loadTable();
},
mounted: function () {
@@ -2038,6 +2087,63 @@
}
this.$set(this.searchForm, field.field, '');
},
+ loadSearchEnumOptions: function () {
+ var self = this;
+ [
+ {
+ field: 'wrkSts',
+ url: baseUrl + '/basWrkStatus/list/auth',
+ valueField: 'wrkSts',
+ labelField: 'wrkDesc',
+ limit: 200
+ },
+ {
+ field: 'ioType',
+ url: baseUrl + '/basWrkIotype/list/auth',
+ valueField: 'ioType',
+ labelField: 'ioDesc',
+ limit: 200
+ },
+ {
+ field: 'staNo',
+ url: baseUrl + '/basStation/list/auth',
+ valueField: 'stationId',
+ labelField: 'stationId',
+ limit: 500
+ },
+ {
+ field: 'sourceStaNo',
+ url: baseUrl + '/basStation/list/auth',
+ valueField: 'stationId',
+ labelField: 'stationId',
+ limit: 500
+ }
+ ].forEach(function (config) {
+ $.ajax({
+ url: config.url,
+ method: 'GET',
+ headers: self.authHeaders(),
+ data: {
+ curr: 1,
+ limit: config.limit
+ },
+ success: function (res) {
+ if (self.handleForbidden(res)) {
+ return;
+ }
+ if (!res || res.code !== 200) {
+ return;
+ }
+ var payload = res.data || {};
+ var field = getFieldByName(config.field);
+ if (!field) {
+ return;
+ }
+ self.$set(field, 'enumOptions', buildEnumOptions(payload.records, config.valueField, config.labelField));
+ }
+ });
+ });
+ },
buildQueryParams: function () {
var self = this;
var params = {
--
Gitblit v1.9.1