|
|
@@ -586,6 +586,22 @@
|
|
|
const text = String(value).trim();
|
|
|
return /^\d+$/.test(text) ? text : '';
|
|
|
},
|
|
|
+ normalizeBackendTextValue(value) {
|
|
|
+ if (value === null || value === undefined || value === '') {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ const text = String(value).trim();
|
|
|
+ return ['undefined', 'null'].includes(text.toLowerCase()) ? '' : text;
|
|
|
+ },
|
|
|
+ pickBackendTextValue(...values) {
|
|
|
+ for (const value of values) {
|
|
|
+ const text = this.normalizeBackendTextValue(value);
|
|
|
+ if (text) {
|
|
|
+ return text;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ },
|
|
|
normalizeOrderQuantity(value) {
|
|
|
if (value === null || value === undefined || value === '') {
|
|
|
return '';
|
|
|
@@ -1331,24 +1347,26 @@
|
|
|
code: item.code || item.workstationCode || item.stationCode || '',
|
|
|
workstationCode:
|
|
|
item.workstationCode || item.code || item.stationCode || '',
|
|
|
- assetCode:
|
|
|
- item.assetCode ||
|
|
|
- item.deviceCode ||
|
|
|
- item.extInfo?.assetCode ||
|
|
|
- substance.code ||
|
|
|
- '',
|
|
|
+ assetCode: this.pickBackendTextValue(
|
|
|
+ item.assetCode,
|
|
|
+ item.deviceCode,
|
|
|
+ item.extInfo?.assetCode,
|
|
|
+ item.extInfo?.deviceCode,
|
|
|
+ substance.code
|
|
|
+ ),
|
|
|
assetId:
|
|
|
this.normalizeBackendLongId(item.assetId) ||
|
|
|
this.normalizeBackendLongId(item.deviceId) ||
|
|
|
this.normalizeBackendLongId(item.extInfo?.assetId) ||
|
|
|
this.normalizeBackendLongId(substance.id) ||
|
|
|
'',
|
|
|
- assetName:
|
|
|
- item.assetName ||
|
|
|
- item.deviceName ||
|
|
|
- item.extInfo?.assetName ||
|
|
|
- substance.name ||
|
|
|
- '',
|
|
|
+ assetName: this.pickBackendTextValue(
|
|
|
+ item.assetName,
|
|
|
+ item.deviceName,
|
|
|
+ item.extInfo?.assetName,
|
|
|
+ item.extInfo?.deviceName,
|
|
|
+ substance.name
|
|
|
+ ),
|
|
|
assetModelType:
|
|
|
item.assetModelType ||
|
|
|
item.deviceModel ||
|
|
|
@@ -2935,9 +2953,9 @@
|
|
|
|
|
|
const titleText = this.isReview
|
|
|
? '是否发起流程'
|
|
|
- : '发布工单后不可撤回,确定发布吗?';
|
|
|
- const title = this.isReview ? '流程确认' : '发布确认';
|
|
|
- const text = this.isReview ? '流程发布中...' : '工单发布中...';
|
|
|
+ : '审批工单后不可撤回,确定审批吗?';
|
|
|
+ const title = this.isReview ? '流程确认' : '审批确认';
|
|
|
+ const text = this.isReview ? '流程审批中...' : '工单审批中...';
|
|
|
|
|
|
try {
|
|
|
await this.$confirm(titleText, title);
|
|
|
@@ -2955,14 +2973,14 @@
|
|
|
const api = this.isReview ? releaseByApproval : release;
|
|
|
const data = await api([row.id]);
|
|
|
if (data || data === 0) {
|
|
|
- this.$message.success('发布成功!');
|
|
|
+ this.$message.success('审批成功!');
|
|
|
} else {
|
|
|
- this.$message.error('发布失败,请重新发布!');
|
|
|
+ this.$message.error('审批失败,请重新审批!');
|
|
|
}
|
|
|
await this.refreshSchedulingView();
|
|
|
await this.reloadPlanSchedulingPlansByStatus();
|
|
|
} catch (e) {
|
|
|
- this.$message.error(e.message || '发布失败,请重新发布!');
|
|
|
+ this.$message.error(e.message || '审批失败,请重新审批!');
|
|
|
} finally {
|
|
|
this.approvalLoading = false;
|
|
|
loading.close();
|