evri渠道附加费计算调整,应付列表查询性能优化
This commit is contained in:
@@ -29,6 +29,7 @@ const calcModeOptions = [
|
||||
{ value: 'MANUAL', label: '暂不计费' },
|
||||
{ value: 'ALWAYS', label: '每票都收' },
|
||||
{ value: 'POSTCODE', label: '命中邮编' },
|
||||
{ value: 'FEE_POSTCODE', label: '附加费邮编' },
|
||||
{ value: 'ZONE', label: '命中分区' },
|
||||
{ value: 'EXTRA_KG', label: '超重续收' },
|
||||
{ value: 'WEIGHT', label: '超重' },
|
||||
@@ -50,6 +51,8 @@ const blockSelectOptions = computed(() =>
|
||||
|
||||
const chargeType = computed(() => String(form.value.chargeType || '').toUpperCase())
|
||||
|
||||
const sizeKind = computed(() => String(form.value.sizeType || '').toUpperCase())
|
||||
|
||||
const schemas = computed(() => [
|
||||
{
|
||||
label: '附加费名称',
|
||||
@@ -81,15 +84,26 @@ const schemas = computed(() => [
|
||||
width: '100%',
|
||||
rules: [{ required: true, message: '请选择计费方式', trigger: 'change' }]
|
||||
},
|
||||
{
|
||||
label: '超尺寸类型',
|
||||
prop: 'sizeType',
|
||||
component: 'select',
|
||||
placeholder: '请选择',
|
||||
dict: 'bms_size_type',
|
||||
span: 12,
|
||||
width: '100%',
|
||||
show: chargeType.value === 'SIZE',
|
||||
rules: chargeType.value === 'SIZE' ? [{ required: true, message: '请选择超尺寸类型', trigger: 'change' }] : undefined
|
||||
},
|
||||
{
|
||||
label: '长(cm)',
|
||||
prop: 'lengthCm',
|
||||
component: 'inputNumber',
|
||||
span: 12,
|
||||
width: '100%',
|
||||
show: chargeType.value === 'SIZE',
|
||||
show: chargeType.value === 'SIZE' && sizeKind.value === 'SIDE',
|
||||
props: { min: 0, precision: 2, controls: false, align: 'left' },
|
||||
rules: chargeType.value === 'SIZE' ? [{ required: true, message: '请填写长', trigger: 'blur' }] : undefined
|
||||
rules: chargeType.value === 'SIZE' && sizeKind.value === 'SIDE' ? [{ required: true, message: '请填写长', trigger: 'blur' }] : undefined
|
||||
},
|
||||
{
|
||||
label: '宽(cm)',
|
||||
@@ -97,9 +111,9 @@ const schemas = computed(() => [
|
||||
component: 'inputNumber',
|
||||
span: 12,
|
||||
width: '100%',
|
||||
show: chargeType.value === 'SIZE',
|
||||
show: chargeType.value === 'SIZE' && sizeKind.value === 'SIDE',
|
||||
props: { min: 0, precision: 2, controls: false, align: 'left' },
|
||||
rules: chargeType.value === 'SIZE' ? [{ required: true, message: '请填写宽', trigger: 'blur' }] : undefined
|
||||
rules: chargeType.value === 'SIZE' && sizeKind.value === 'SIDE' ? [{ required: true, message: '请填写宽', trigger: 'blur' }] : undefined
|
||||
},
|
||||
{
|
||||
label: '高(cm)',
|
||||
@@ -107,9 +121,20 @@ const schemas = computed(() => [
|
||||
component: 'inputNumber',
|
||||
span: 12,
|
||||
width: '100%',
|
||||
show: chargeType.value === 'SIZE',
|
||||
show: chargeType.value === 'SIZE' && sizeKind.value === 'SIDE',
|
||||
props: { min: 0, precision: 2, controls: false, align: 'left' },
|
||||
rules: chargeType.value === 'SIZE' ? [{ required: true, message: '请填写高', trigger: 'blur' }] : undefined
|
||||
rules: chargeType.value === 'SIZE' && sizeKind.value === 'SIDE' ? [{ required: true, message: '请填写高', trigger: 'blur' }] : undefined
|
||||
},
|
||||
{
|
||||
label: '体积值/m³',
|
||||
prop: 'volumeM3',
|
||||
component: 'inputNumber',
|
||||
placeholder: '超过这个体积才收取',
|
||||
span: 12,
|
||||
width: '100%',
|
||||
show: chargeType.value === 'SIZE' && sizeKind.value === 'VOLUME',
|
||||
props: { min: 0, precision: 6, controls: false, align: 'left' },
|
||||
rules: chargeType.value === 'SIZE' && sizeKind.value === 'VOLUME' ? [{ required: true, message: '请填写体积', trigger: 'blur' }] : undefined
|
||||
},
|
||||
{
|
||||
label: '超过重量(kg)',
|
||||
@@ -217,6 +242,8 @@ function emptyForm() {
|
||||
countryCode: undefined,
|
||||
blockTitle: undefined,
|
||||
scNote: undefined,
|
||||
sizeType: undefined,
|
||||
volumeM3: undefined,
|
||||
lengthCm: undefined,
|
||||
widthCm: undefined,
|
||||
heightCm: undefined,
|
||||
@@ -327,6 +354,8 @@ watch(() => form.value.countryCode, (code, prev) => {
|
||||
|
||||
watch(() => form.value.chargeType, (type, prev) => {
|
||||
if (suppressCountryWatch.value || !prev || type === prev) return
|
||||
form.value.sizeType = undefined
|
||||
form.value.volumeM3 = undefined
|
||||
form.value.lengthCm = undefined
|
||||
form.value.widthCm = undefined
|
||||
form.value.heightCm = undefined
|
||||
@@ -337,6 +366,19 @@ watch(() => form.value.chargeType, (type, prev) => {
|
||||
nextTick(() => formRef.value?.clearValidate())
|
||||
})
|
||||
|
||||
watch(() => form.value.sizeType, (type, prev) => {
|
||||
if (suppressCountryWatch.value || !prev || type === prev) return
|
||||
const code = String(type || '').toUpperCase()
|
||||
if (code === 'VOLUME') {
|
||||
form.value.lengthCm = undefined
|
||||
form.value.widthCm = undefined
|
||||
form.value.heightCm = undefined
|
||||
} else if (code === 'SIDE') {
|
||||
form.value.volumeM3 = undefined
|
||||
}
|
||||
nextTick(() => formRef.value?.clearValidate())
|
||||
})
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user