1
This commit is contained in:
@@ -7,13 +7,22 @@
|
||||
<el-form :model="form" label-position="top" class="fadan-form">
|
||||
<el-form-item label="分销标记">
|
||||
<div class="mark-row">
|
||||
<span class="mark-prefix" aria-hidden="true">F-</span>
|
||||
<span v-if="!form.markFull" class="mark-prefix" aria-hidden="true">F-</span>
|
||||
<el-input
|
||||
v-if="!form.markFull"
|
||||
v-model="form.markSuffix"
|
||||
class="mark-suffix-input"
|
||||
placeholder="后缀,如 李旭、闲鱼;留空则仅为 F"
|
||||
clearable
|
||||
/>
|
||||
<el-input
|
||||
v-else
|
||||
v-model="form.markFull"
|
||||
class="mark-suffix-input"
|
||||
placeholder="完整分销标记,如 H-TF"
|
||||
clearable
|
||||
@clear="form.markFull = ''"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="型号" required>
|
||||
@@ -239,6 +248,7 @@ export default {
|
||||
return {
|
||||
form: {
|
||||
markSuffix: '',
|
||||
markFull: '',
|
||||
model: '',
|
||||
shopPrefix: '',
|
||||
address: '',
|
||||
@@ -335,6 +345,10 @@ export default {
|
||||
}
|
||||
},
|
||||
buildDistributionMark() {
|
||||
const full = (this.form.markFull || '').trim()
|
||||
if (full) {
|
||||
return full
|
||||
}
|
||||
let s = (this.form.markSuffix || '').trim()
|
||||
if (s.startsWith('-')) {
|
||||
s = s.slice(1).trim()
|
||||
@@ -705,6 +719,7 @@ export default {
|
||||
resetForm() {
|
||||
this.form = {
|
||||
markSuffix: '',
|
||||
markFull: '',
|
||||
model: '',
|
||||
shopPrefix: '',
|
||||
address: '',
|
||||
@@ -963,19 +978,21 @@ export default {
|
||||
},
|
||||
applyMarkSuffixFromText(mark) {
|
||||
const v = String(mark || '').trim()
|
||||
this.form.markFull = ''
|
||||
this.form.markSuffix = ''
|
||||
if (!v || v === 'F') {
|
||||
this.form.markSuffix = ''
|
||||
return
|
||||
}
|
||||
if (v.startsWith('F-')) {
|
||||
this.form.markSuffix = v.slice(2).trim()
|
||||
return
|
||||
}
|
||||
if (v.startsWith('F') && v.length > 1) {
|
||||
if (v === 'F' || (v.startsWith('F') && v.length > 1 && !v.includes('-'))) {
|
||||
this.form.markSuffix = v.slice(1).replace(/^-/, '').trim()
|
||||
return
|
||||
}
|
||||
this.form.markSuffix = v
|
||||
// H-TF、PDD 等非 F 标记:原样回填,不再拼 F-
|
||||
this.form.markFull = v
|
||||
},
|
||||
applyHistoryItem(row) {
|
||||
if (!row) return
|
||||
|
||||
Reference in New Issue
Block a user