1
This commit is contained in:
@@ -380,7 +380,16 @@
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">型号</span>
|
||||
<span class="field-value">{{ row.modelNumber || '-' }}</span>
|
||||
<div class="field-value field-value--third-party-edit">
|
||||
<el-input
|
||||
v-model="row.modelNumber"
|
||||
size="small"
|
||||
clearable
|
||||
placeholder="型号,失焦或点保存写入"
|
||||
@blur="onModelNumberBlur(row)"
|
||||
/>
|
||||
<el-button type="primary" size="mini" plain @click="onModelNumberSave(row)">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">地址</span>
|
||||
@@ -579,7 +588,18 @@
|
||||
</el-table-column>
|
||||
|
||||
<!-- 业务信息列 -->
|
||||
<el-table-column label="型号" prop="modelNumber" width="140"/>
|
||||
<el-table-column label="型号" prop="modelNumber" min-width="128">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="scope.row.modelNumber"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="型号"
|
||||
@blur="onModelNumberBlur(scope.row)"
|
||||
@keyup.enter.native="onModelNumberBlur(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="地址" prop="address" min-width="220" show-overflow-tooltip class-name="address-cell">
|
||||
<template slot-scope="scope">
|
||||
<span style="font-weight: bold; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ scope.row.address }}</span>
|
||||
@@ -1229,6 +1249,8 @@ export default {
|
||||
return {
|
||||
/** 列表加载时的分销标识快照,失焦保存时与当前值比较避免重复请求 */
|
||||
_distMarkBaseline: {},
|
||||
/** 列表加载时的型号快照,失焦保存时与当前值比较避免重复请求 */
|
||||
_modelNumberBaseline: {},
|
||||
loading: false,
|
||||
list: [],
|
||||
total: 0,
|
||||
@@ -1555,12 +1577,15 @@ export default {
|
||||
/** 列表行默认值(退款开关、利润手填标记等) */
|
||||
normalizeOrderListItem(item) {
|
||||
const dist = this.normalizeDistributionMarkInput(item.distributionMark)
|
||||
const modelNum = this.normalizeModelNumberInput(item.modelNumber)
|
||||
if (item.id != null) {
|
||||
this.$set(this._distMarkBaseline, item.id, dist)
|
||||
this.$set(this._modelNumberBaseline, item.id, modelNum)
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
distributionMark: dist,
|
||||
modelNumber: modelNum,
|
||||
isRefunded: item.isRefunded != null ? item.isRefunded : 0,
|
||||
isRefundReceived: item.isRefundReceived != null ? item.isRefundReceived : 0,
|
||||
isRebateReceived: item.isRebateReceived != null ? item.isRebateReceived : 0,
|
||||
@@ -1573,6 +1598,7 @@ export default {
|
||||
},
|
||||
assignListFromResponse(res) {
|
||||
this._distMarkBaseline = {}
|
||||
this._modelNumberBaseline = {}
|
||||
const list = (res.rows || res.data || [])
|
||||
this.list = list.map(item => this.normalizeOrderListItem(item))
|
||||
this.total = res.total || 0
|
||||
@@ -1935,6 +1961,26 @@ export default {
|
||||
if (next === base) return
|
||||
this.persistOrderRow(row, successMsg)
|
||||
},
|
||||
/** 型号:去首尾空白(内部保留,避免误改版式) */
|
||||
normalizeModelNumberInput(v) {
|
||||
if (v == null) return ''
|
||||
return String(v).trim()
|
||||
},
|
||||
/** 型号失焦或点保存时写入数据库(与基线一致则不调接口) */
|
||||
saveModelNumberIfChanged(row, successMsg) {
|
||||
if (row == null || row.id == null) return
|
||||
const next = this.normalizeModelNumberInput(row.modelNumber)
|
||||
row.modelNumber = next
|
||||
const base = this._modelNumberBaseline[row.id] != null ? this._modelNumberBaseline[row.id] : ''
|
||||
if (next === base) return
|
||||
this.persistOrderRow(row, successMsg)
|
||||
},
|
||||
onModelNumberBlur(row) {
|
||||
this.saveModelNumberIfChanged(row)
|
||||
},
|
||||
onModelNumberSave(row) {
|
||||
this.saveModelNumberIfChanged(row, '型号已保存')
|
||||
},
|
||||
onOrderSellingPriceTypeChange(row) {
|
||||
row.sellingPriceManual = 0
|
||||
row.profitManual = 0
|
||||
|
||||
Reference in New Issue
Block a user