diff --git a/src/views/modules/base/dictMaintenance.vue b/src/views/modules/base/dictMaintenance.vue
index c68af14..07afd24 100644
--- a/src/views/modules/base/dictMaintenance.vue
+++ b/src/views/modules/base/dictMaintenance.vue
@@ -30,14 +30,14 @@
v-loading="typeLoading"
style="width:100%"
@row-click="selectDictType">
-
-
+
+
{{ scope.row.status === 'Y' ? '启用' : '停用' }}
-
+
停用
-
+
@@ -167,7 +167,7 @@
-
+
@@ -323,7 +323,7 @@ export default {
status: this.typeSearch.status
})).then(({ data }) => {
if (data && data.code === 0) {
- const rows = data.rows || []
+ const rows = this.normalizeTypeRows(data.rows || [])
this.applyTypeListResult(rows, rows.length)
} else {
this.$message.error((data && data.msg) || '查询字典类型失败')
@@ -352,6 +352,85 @@ export default {
this.dataTotal = 0
}
},
+ dictLabel(){
+ this.dataForm.dictValue = JSON.parse(JSON.stringify(this.dataForm.dictLabel));
+ },
+ normalizeTypeRows (rows) {
+ if (!Array.isArray(rows)) {
+ return []
+ }
+ return rows.map(row => this.normalizeTypeRow(row))
+ },
+ normalizeTypeRow (row) {
+ const normalized = { ...(row || {}) }
+ normalized.dictId = normalized.dictId != null ? normalized.dictId : normalized.dict_id
+ normalized.dictType = this.firstText(
+ normalized.dictType,
+ normalized.dict_type
+ )
+ normalized.status = this.normalizeStatus(
+ this.firstText(normalized.status, normalized.STATUS, normalized.active)
+ )
+ normalized.createBy = this.firstText(normalized.createBy, normalized.create_by)
+ normalized.site = this.firstText(normalized.site, normalized.SITE)
+ normalized.remark = this.firstText(normalized.remark)
+ normalized.dictName = this.resolveTypeDisplayName(normalized)
+ return normalized
+ },
+ resolveTypeDisplayName (row) {
+ const direct = this.firstText(row && row.dictName, row && row.dict_name)
+ if (direct && !this.isStatusText(direct)) {
+ return direct
+ }
+ const remark = this.firstText(row && row.remark)
+ if (remark) {
+ const sep = remark.indexOf('-')
+ if (sep > 0) {
+ const prefix = remark.substring(0, sep).trim()
+ if (prefix && !this.isStatusText(prefix)) {
+ return prefix
+ }
+ }
+ if (!this.isStatusText(remark)) {
+ return remark
+ }
+ }
+ return this.firstText(row && row.dictType, row && row.dict_type)
+ },
+ normalizeStatus (raw) {
+ const text = this.firstText(raw)
+ if (!text) {
+ return ''
+ }
+ const upper = text.toUpperCase()
+ if (upper === 'Y' || text === '启用') {
+ return 'Y'
+ }
+ if (upper === 'N' || text === '停用') {
+ return 'N'
+ }
+ return text
+ },
+ isStatusText (text) {
+ const val = this.firstText(text)
+ if (!val) {
+ return false
+ }
+ const upper = val.toUpperCase()
+ return upper === 'Y' || upper === 'N' || val === '启用' || val === '停用'
+ },
+ firstText (...vals) {
+ for (const val of vals) {
+ if (val === null || val === undefined) {
+ continue
+ }
+ const text = String(val).trim()
+ if (text) {
+ return text
+ }
+ }
+ return ''
+ },
selectDictType (row) {
if (!row || !row.dictType) return
this.currentType = { ...row }
diff --git a/src/views/modules/order/com_poCustomer_FieldAuth.vue b/src/views/modules/order/com_poCustomer_FieldAuth.vue
index 6e57806..6a08cac 100644
--- a/src/views/modules/order/com_poCustomer_FieldAuth.vue
+++ b/src/views/modules/order/com_poCustomer_FieldAuth.vue
@@ -19,9 +19,9 @@
@@ -75,7 +75,7 @@ export default {
fieldLabel: r.fieldLabel || r.fieldCode,
mandatoryFlag: (r.mandatoryFlag || 'N').toUpperCase(),
displayLabel: r.displayLabel || r.fieldLabel || r.fieldCode,
- dictType: r.dictType || '',
+ dictType: this.isDictTypeEditable(r) ? (r.dictType || '') : '',
visibleFlag: ((r.mandatoryFlag || 'N').toUpperCase() === 'Y') ? 'Y' : (r.visibleFlag || 'Y'),
requiredFlag: r.requiredFlag || 'N'
})) : []
@@ -85,6 +85,13 @@ export default {
const code = row && row.fieldCode ? String(row.fieldCode).toLowerCase() : ''
return code.indexOf('ext_') === 0
},
+ isExtDateField (row) {
+ const code = row && row.fieldCode ? String(row.fieldCode).toLowerCase() : ''
+ return /^ext_dt\d{2}$/.test(code)
+ },
+ isDictTypeEditable (row) {
+ return this.isExtField(row) && !this.isExtDateField(row)
+ },
isMandatoryField (row) {
return !!(row && String(row.mandatoryFlag || '').toUpperCase() === 'Y')
},
@@ -98,6 +105,12 @@ export default {
const text = String(value).trim()
return text ? text : null
},
+ normalizeDictTypeForSave (row) {
+ if (!this.isDictTypeEditable(row)) {
+ return null
+ }
+ return this.normalizeNullable(row && row.dictType)
+ },
save () {
if (!this.customerCode) return
this.saving = true
@@ -109,7 +122,7 @@ export default {
visibleFlag: r.visibleFlag,
requiredFlag: r.requiredFlag,
displayLabel: this.normalizeNullable(r.displayLabel),
- dictType: this.normalizeNullable(r.dictType),
+ dictType: this.normalizeDictTypeForSave(r),
active: r.active || 'Y'
}))
}).then(({ data }) => {
diff --git a/src/views/modules/order/poOrder.vue b/src/views/modules/order/poOrder.vue
index ecc79a6..cb3efac 100644
--- a/src/views/modules/order/poOrder.vue
+++ b/src/views/modules/order/poOrder.vue
@@ -2624,6 +2624,12 @@ export default {
crd: row.crd,
inspection: row.inspection,
realCrd: row.realCrd,
+ poPlaceDate: row.poPlaceDate,
+ poPromiseReadyDate: row.poPromiseReadyDate,
+ poActualReadyDate: row.poActualReadyDate,
+ chinaOfficeInspectionDate: row.chinaOfficeInspectionDate,
+ shipToNpcDate: row.shipToNpcDate,
+ inspectionResult: row.inspectionResult,
flexid: row.flexid,
obd: row.obd,
docSent: row.docSent,
@@ -3091,6 +3097,12 @@ export default {
crd: '',
inspection: '',
realCrd: '',
+ poPlaceDate: '',
+ poPromiseReadyDate: '',
+ poActualReadyDate: '',
+ chinaOfficeInspectionDate: '',
+ shipToNpcDate: '',
+ inspectionResult: '',
flexid: '',
obd: '',
docSent: '',