diff --git a/src/views/system/jdorder/orderList.vue b/src/views/system/jdorder/orderList.vue
index 42d3192..ebab127 100644
--- a/src/views/system/jdorder/orderList.vue
+++ b/src/views/system/jdorder/orderList.vue
@@ -351,7 +351,16 @@
标记
-
{{ row.distributionMark || '-' }}
+
+
+ 保存
+
型号
@@ -539,7 +548,18 @@
-
+
+
+
+
+
@@ -1164,6 +1184,8 @@ export default {
},
data() {
return {
+ /** 列表加载时的分销标识快照,失焦保存时与当前值比较避免重复请求 */
+ _distMarkBaseline: {},
loading: false,
list: [],
total: 0,
@@ -1431,8 +1453,13 @@ export default {
},
/** 列表行默认值(退款开关、利润手填标记等) */
normalizeOrderListItem(item) {
+ const dist = this.normalizeDistributionMarkInput(item.distributionMark)
+ if (item.id != null) {
+ this.$set(this._distMarkBaseline, item.id, dist)
+ }
return {
...item,
+ distributionMark: dist,
isRefunded: item.isRefunded != null ? item.isRefunded : 0,
isRefundReceived: item.isRefundReceived != null ? item.isRefundReceived : 0,
isRebateReceived: item.isRebateReceived != null ? item.isRebateReceived : 0,
@@ -1444,6 +1471,7 @@ export default {
}
},
assignListFromResponse(res) {
+ this._distMarkBaseline = {}
const list = (res.rows || res.data || [])
this.list = list.map(item => this.normalizeOrderListItem(item))
this.total = res.total || 0
@@ -1792,6 +1820,26 @@ export default {
onThirdPartyOrderNoSave(row) {
this.saveThirdPartyOrderNoIfFilled(row, '第三方单号已保存')
},
+ /** 分销标识:去首尾空白、合并连续空白(与录单行习惯一致) */
+ normalizeDistributionMarkInput(v) {
+ if (v == null) return ''
+ return String(v).trim().replace(/\s+/g, ' ')
+ },
+ /** 分销标识失焦或点保存时写入数据库(与基线一致则不调接口) */
+ saveDistributionMarkIfChanged(row, successMsg) {
+ if (row == null || row.id == null) return
+ const next = this.normalizeDistributionMarkInput(row.distributionMark)
+ row.distributionMark = next
+ const base = this._distMarkBaseline[row.id] != null ? this._distMarkBaseline[row.id] : ''
+ if (next === base) return
+ this.persistOrderRow(row, successMsg)
+ },
+ onDistributionMarkBlur(row) {
+ this.saveDistributionMarkIfChanged(row)
+ },
+ onDistributionMarkSave(row) {
+ this.saveDistributionMarkIfChanged(row, '分销标识已保存')
+ },
onOrderSellingPriceTypeChange(row) {
row.sellingPriceManual = 0
row.profitManual = 0