修改产品套餐
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
border
|
||||
size="small"
|
||||
:span-method="spanMethod"
|
||||
:row-class-name="rowClass"
|
||||
>
|
||||
<el-table-column :label="colCountry" min-width="100">
|
||||
<template #default="{ row }">{{ countryLabel(row) }}</template>
|
||||
@@ -27,16 +26,6 @@
|
||||
<template #default="{ row }">{{ row.zoneName || row.zoneCode || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="colWeight" prop="weightLabel" min-width="120" />
|
||||
<el-table-column :label="colBaseFv" width="130" align="center">
|
||||
<template #default="{ row }">
|
||||
<span class="price-text base-price">{{ formatNum(row._baseFreight, 4) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="colBaseReg" width="130" align="center">
|
||||
<template #default="{ row }">
|
||||
<span class="price-text base-price">{{ formatNum(row._baseReg, 2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="colSetFv" width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
<div class="price-cell">
|
||||
@@ -99,7 +88,6 @@
|
||||
|
||||
<script setup name="PriceEditDrawer">
|
||||
import SurchargeCountCell from './SurchargeCountCell.vue'
|
||||
import { isDetailPriceChanged } from '../../utils/priceSet'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { type: Boolean, default: false },
|
||||
@@ -109,8 +97,6 @@ const props = defineProps({
|
||||
})
|
||||
const emit = defineEmits(['update:modelValue', 'pick-surcharge', 'row-change', 'surcharge-change'])
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const keyword = ref('')
|
||||
const editingKey = ref('')
|
||||
const committing = ref(false)
|
||||
@@ -121,13 +107,11 @@ const title = computed(() => {
|
||||
const name = props.productName || ''
|
||||
return code + ' · ' + name + ' · 国家服务价格'
|
||||
})
|
||||
const hint = '黄色行=已改价(与产品基础价不同);点编辑图标后修改,失焦即刻写入数据库。单位:运费 RMB/KG,挂号费 RMB/票。'
|
||||
const hint = '点编辑图标后修改,失焦即刻写入数据库。单位:运费 RMB/KG,挂号费 RMB/票。'
|
||||
const phSearch = '搜索国家/分区'
|
||||
const colCountry = '国家'
|
||||
const colZone = '分区'
|
||||
const colWeight = '重量段'
|
||||
const colBaseFv = '产品基础运费'
|
||||
const colBaseReg = '产品基础挂号费'
|
||||
const colSetFv = '套餐运费'
|
||||
const colSetReg = '套餐挂号费'
|
||||
const colSurcharge = '附加费'
|
||||
@@ -159,20 +143,6 @@ function startEdit(row, field) {
|
||||
})
|
||||
}
|
||||
|
||||
function isBelowFloor(value, floor) {
|
||||
if (value == null || value === '' || floor == null || floor === '') return false
|
||||
const n = Number(value)
|
||||
const f = Number(floor)
|
||||
if (Number.isNaN(n) || Number.isNaN(f)) return false
|
||||
return n + 1e-8 < f
|
||||
}
|
||||
|
||||
function belowFloorMessage(field, floor) {
|
||||
const name = field === 'fv' ? '\u5957\u9910\u8fd0\u8d39' : '\u5957\u9910\u6302\u53f7\u8d39'
|
||||
const prec = field === 'fv' ? 4 : 2
|
||||
return name + '\u4e0d\u80fd\u4f4e\u4e8e\u5bfc\u5165\u57fa\u51c6\u4ef7 ' + formatNum(floor, prec)
|
||||
}
|
||||
|
||||
async function commitEdit(row, field) {
|
||||
if (committing.value) return
|
||||
if (editingKey.value !== cellKey(row, field)) return
|
||||
@@ -180,16 +150,6 @@ async function commitEdit(row, field) {
|
||||
editingKey.value = ''
|
||||
try {
|
||||
if (!row) return
|
||||
// Temporarily allow freight / registration below imported base price.
|
||||
// if (field === 'fv') {
|
||||
// const floor = row._floorFreight
|
||||
// const value = row.fvValue
|
||||
// if (isBelowFloor(value, floor)) {
|
||||
// row.fvValue = row._editPrevFv
|
||||
// proxy.$modal.msgError(belowFloorMessage(field, floor))
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
if (!row.psdId) return
|
||||
emit('row-change', row)
|
||||
} finally {
|
||||
@@ -271,10 +231,6 @@ function spanOf(spans, rowIndex) {
|
||||
return rowspan > 0 ? { rowspan, colspan: 1 } : { rowspan: 0, colspan: 0 }
|
||||
}
|
||||
|
||||
function rowClass({ row }) {
|
||||
return isDetailPriceChanged(row) ? 'changed-row' : ''
|
||||
}
|
||||
|
||||
function close() {
|
||||
editingKey.value = ''
|
||||
emit('update:modelValue', false)
|
||||
@@ -345,13 +301,7 @@ watch(() => props.modelValue, v => {
|
||||
min-width: 64px;
|
||||
text-align: right;
|
||||
}
|
||||
.base-price {
|
||||
color: #909399;
|
||||
}
|
||||
.edit-ico {
|
||||
padding: 0 2px !important;
|
||||
}
|
||||
:deep(.changed-row > td) {
|
||||
background: #fffbe6 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user