Browse Source

新品流程OK

master
常熟吴彦祖 2 weeks ago
parent
commit
06de1006e1
  1. 91
      src/views/modules/base/dictMaintenance.vue
  2. 21
      src/views/modules/order/com_poCustomer_FieldAuth.vue
  3. 12
      src/views/modules/order/poOrder.vue

91
src/views/modules/base/dictMaintenance.vue

@ -30,14 +30,14 @@
v-loading="typeLoading" v-loading="typeLoading"
style="width:100%" style="width:100%"
@row-click="selectDictType"> @row-click="selectDictType">
<el-table-column prop="dictName" label="字典名称" min-width="140" header-align="center" align="left" show-overflow-tooltip />
<!-- <el-table-column prop="dictType" label="字典类型" min-width="200" header-align="center" align="left" show-overflow-tooltip />-->
<!-- <el-table-column prop="dictType" label="字典类型" min-width="120" header-align="center" align="left" show-overflow-tooltip />-->
<el-table-column prop="dictName" label="字典名称" min-width="120" header-align="center" align="left" show-overflow-tooltip />
<el-table-column prop="status" label="状态" width="80" header-align="center" align="center"> <el-table-column prop="status" label="状态" width="80" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.status === 'Y' ? '启用' : '停用' }} {{ scope.row.status === 'Y' ? '启用' : '停用' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="70" header-align="center" align="center">
<el-table-column label="操作" width="70" fixed="right" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="canDeleteType(scope.row)" v-if="canDeleteType(scope.row)"
@ -110,7 +110,7 @@
<el-link style="cursor:pointer" @click="handleDisableData(scope.row)">停用</el-link> <el-link style="cursor:pointer" @click="handleDisableData(scope.row)">停用</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="dictLabel" label="字典标签" min-width="120" header-align="center" align="left" show-overflow-tooltip />
<el-table-column prop="dictLabel" label="字典标签" min-width="120" header-align="center" align="left" show-overflow-tooltip />
<el-table-column prop="dictValue" label="字典键值" min-width="120" header-align="center" align="left" show-overflow-tooltip /> <el-table-column prop="dictValue" label="字典键值" min-width="120" header-align="center" align="left" show-overflow-tooltip />
<el-table-column label="作用范围" width="80" header-align="center" align="center"> <el-table-column label="作用范围" width="80" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -167,7 +167,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="字典标签" prop="dictLabel"> <el-form-item label="字典标签" prop="dictLabel">
<el-input v-model="dataForm.dictLabel" maxlength="255" />
<el-input v-model="dataForm.dictLabel" @blur="dictLabel()" maxlength="255" />
</el-form-item> </el-form-item>
<el-form-item label="字典键值" prop="dictValue"> <el-form-item label="字典键值" prop="dictValue">
<el-input v-model="dataForm.dictValue" :disabled="dataEditMode" maxlength="255" /> <el-input v-model="dataForm.dictValue" :disabled="dataEditMode" maxlength="255" />
@ -323,7 +323,7 @@ export default {
status: this.typeSearch.status status: this.typeSearch.status
})).then(({ data }) => { })).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
const rows = data.rows || []
const rows = this.normalizeTypeRows(data.rows || [])
this.applyTypeListResult(rows, rows.length) this.applyTypeListResult(rows, rows.length)
} else { } else {
this.$message.error((data && data.msg) || '查询字典类型失败') this.$message.error((data && data.msg) || '查询字典类型失败')
@ -352,6 +352,85 @@ export default {
this.dataTotal = 0 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) { selectDictType (row) {
if (!row || !row.dictType) return if (!row || !row.dictType) return
this.currentType = { ...row } this.currentType = { ...row }

21
src/views/modules/order/com_poCustomer_FieldAuth.vue

@ -19,9 +19,9 @@
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-input <el-input
v-model="row.dictType" v-model="row.dictType"
:disabled="!isExtField(row)"
:disabled="!isDictTypeEditable(row)"
clearable clearable
placeholder="留空=默认组件"
:placeholder="isExtDateField(row) ? '日期扩展字段不可填' : '留空=默认组件'"
/> />
</template> </template>
</el-table-column> </el-table-column>
@ -75,7 +75,7 @@ export default {
fieldLabel: r.fieldLabel || r.fieldCode, fieldLabel: r.fieldLabel || r.fieldCode,
mandatoryFlag: (r.mandatoryFlag || 'N').toUpperCase(), mandatoryFlag: (r.mandatoryFlag || 'N').toUpperCase(),
displayLabel: r.displayLabel || r.fieldLabel || r.fieldCode, 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'), visibleFlag: ((r.mandatoryFlag || 'N').toUpperCase() === 'Y') ? 'Y' : (r.visibleFlag || 'Y'),
requiredFlag: r.requiredFlag || 'N' requiredFlag: r.requiredFlag || 'N'
})) : [] })) : []
@ -85,6 +85,13 @@ export default {
const code = row && row.fieldCode ? String(row.fieldCode).toLowerCase() : '' const code = row && row.fieldCode ? String(row.fieldCode).toLowerCase() : ''
return code.indexOf('ext_') === 0 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) { isMandatoryField (row) {
return !!(row && String(row.mandatoryFlag || '').toUpperCase() === 'Y') return !!(row && String(row.mandatoryFlag || '').toUpperCase() === 'Y')
}, },
@ -98,6 +105,12 @@ export default {
const text = String(value).trim() const text = String(value).trim()
return text ? text : null return text ? text : null
}, },
normalizeDictTypeForSave (row) {
if (!this.isDictTypeEditable(row)) {
return null
}
return this.normalizeNullable(row && row.dictType)
},
save () { save () {
if (!this.customerCode) return if (!this.customerCode) return
this.saving = true this.saving = true
@ -109,7 +122,7 @@ export default {
visibleFlag: r.visibleFlag, visibleFlag: r.visibleFlag,
requiredFlag: r.requiredFlag, requiredFlag: r.requiredFlag,
displayLabel: this.normalizeNullable(r.displayLabel), displayLabel: this.normalizeNullable(r.displayLabel),
dictType: this.normalizeNullable(r.dictType),
dictType: this.normalizeDictTypeForSave(r),
active: r.active || 'Y' active: r.active || 'Y'
})) }))
}).then(({ data }) => { }).then(({ data }) => {

12
src/views/modules/order/poOrder.vue

@ -2624,6 +2624,12 @@ export default {
crd: row.crd, crd: row.crd,
inspection: row.inspection, inspection: row.inspection,
realCrd: row.realCrd, realCrd: row.realCrd,
poPlaceDate: row.poPlaceDate,
poPromiseReadyDate: row.poPromiseReadyDate,
poActualReadyDate: row.poActualReadyDate,
chinaOfficeInspectionDate: row.chinaOfficeInspectionDate,
shipToNpcDate: row.shipToNpcDate,
inspectionResult: row.inspectionResult,
flexid: row.flexid, flexid: row.flexid,
obd: row.obd, obd: row.obd,
docSent: row.docSent, docSent: row.docSent,
@ -3091,6 +3097,12 @@ export default {
crd: '', crd: '',
inspection: '', inspection: '',
realCrd: '', realCrd: '',
poPlaceDate: '',
poPromiseReadyDate: '',
poActualReadyDate: '',
chinaOfficeInspectionDate: '',
shipToNpcDate: '',
inspectionResult: '',
flexid: '', flexid: '',
obd: '', obd: '',
docSent: '', docSent: '',

Loading…
Cancel
Save