Merge branch 'master' of http://git.lionquexpress.com/wuweihua/BMS
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
placeholder="请先选择产品"
|
||||
style="width: 100%"
|
||||
:disabled="!form.productCode"
|
||||
@change="form.destPostcode = undefined"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in countryOptions"
|
||||
@@ -43,6 +44,15 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="needPostcode" label="目的邮编" prop="destPostcode">
|
||||
<el-input
|
||||
v-model="form.destPostcode"
|
||||
clearable
|
||||
placeholder="该国家有分区,请填写邮编"
|
||||
maxlength="20"
|
||||
/>
|
||||
<div class="form-hint">通过邮编判定分区后再匹配产品国家价</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="计费重量(kg)" prop="weight">
|
||||
<el-input-number
|
||||
v-model="form.weight"
|
||||
@@ -80,6 +90,8 @@
|
||||
<el-descriptions-item label="客户ID">{{ result.customerId }}</el-descriptions-item>
|
||||
<el-descriptions-item label="产品">{{ result.productName || '-' }} ({{ result.productCode }})</el-descriptions-item>
|
||||
<el-descriptions-item label="国家">{{ result.countryName || '-' }} ({{ result.countryCode }})</el-descriptions-item>
|
||||
<el-descriptions-item label="目的邮编">{{ result.destPostcode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="分区">{{ result.zoneName || result.zoneCode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="计费重量(kg)">{{ result.chargeWeight ?? result.weight }}</el-descriptions-item>
|
||||
<el-descriptions-item label="重量段">{{ result.weightLabel || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="明细生效时间">{{ formatDate(result.effectiveDate) }}</el-descriptions-item>
|
||||
@@ -179,6 +191,8 @@
|
||||
<el-descriptions-item label="客户ID">{{ viewResult.customerId }}</el-descriptions-item>
|
||||
<el-descriptions-item label="产品">{{ viewResult.productName || '-' }} ({{ viewResult.productCode }})</el-descriptions-item>
|
||||
<el-descriptions-item label="国家">{{ viewResult.countryName || '-' }} ({{ viewResult.countryCode }})</el-descriptions-item>
|
||||
<el-descriptions-item label="目的邮编">{{ viewResult.destPostcode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="分区">{{ viewResult.zoneName || viewResult.zoneCode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="计费重量(kg)">{{ viewResult.chargeWeight ?? viewResult.weight }}</el-descriptions-item>
|
||||
<el-descriptions-item label="重量段">{{ viewResult.weightLabel || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="计价来源">
|
||||
@@ -235,6 +249,7 @@ const historyTableRef = ref()
|
||||
const loading = ref(false)
|
||||
const productOptions = ref([])
|
||||
const countryOptions = ref([])
|
||||
const countryRows = ref([])
|
||||
const result = ref(null)
|
||||
const errorMsg = ref('')
|
||||
const historyOpen = ref(false)
|
||||
@@ -282,6 +297,7 @@ const form = reactive({
|
||||
customerCode: undefined,
|
||||
productCode: undefined,
|
||||
countryCode: undefined,
|
||||
destPostcode: undefined,
|
||||
weight: undefined,
|
||||
bizDate: undefined
|
||||
})
|
||||
@@ -290,6 +306,16 @@ const rules = {
|
||||
customerCode: [{ required: true, message: '请选择客户', trigger: 'change' }],
|
||||
productCode: [{ required: true, message: '请选择产品', trigger: 'change' }],
|
||||
countryCode: [{ required: true, message: '请选择目的国/地区', trigger: 'change' }],
|
||||
destPostcode: [{
|
||||
validator: (_r, val, cb) => {
|
||||
if (needPostcode.value && !(val && String(val).trim())) {
|
||||
cb(new Error('该国家有分区,请填写邮编'))
|
||||
} else {
|
||||
cb()
|
||||
}
|
||||
},
|
||||
trigger: 'blur'
|
||||
}],
|
||||
weight: [{ required: true, message: '请输入计费重量', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
@@ -314,14 +340,26 @@ function countryOptionLabel(item) {
|
||||
return name + ' (' + item.countryCode + ')'
|
||||
}
|
||||
|
||||
const needPostcode = computed(() => {
|
||||
if (!form.countryCode) return false
|
||||
return (countryRows.value || []).some(r =>
|
||||
String(r.countryCode || '').toUpperCase() === String(form.countryCode || '').toUpperCase()
|
||||
&& !!(r.zoneCode || r.zoneId)
|
||||
)
|
||||
})
|
||||
|
||||
function handleProductChange(productCode) {
|
||||
form.countryCode = undefined
|
||||
form.destPostcode = undefined
|
||||
countryOptions.value = []
|
||||
countryRows.value = []
|
||||
if (!productCode) {
|
||||
return
|
||||
}
|
||||
listProductCountries(productCode).then(res => {
|
||||
countryOptions.value = uniqueCountries((res.data || []).filter(item => !item.expireDate))
|
||||
const rows = (res.data || []).filter(item => !item.expireDate)
|
||||
countryRows.value = rows
|
||||
countryOptions.value = uniqueCountries(rows)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -337,6 +375,7 @@ function handleQuote() {
|
||||
customerCode: form.customerCode,
|
||||
productCode: form.productCode,
|
||||
countryCode: form.countryCode,
|
||||
destPostcode: form.destPostcode || undefined,
|
||||
weight: form.weight
|
||||
}
|
||||
if (form.bizDate) {
|
||||
@@ -361,9 +400,11 @@ function resetForm() {
|
||||
form.customerCode = undefined
|
||||
form.productCode = undefined
|
||||
form.countryCode = undefined
|
||||
form.destPostcode = undefined
|
||||
form.weight = undefined
|
||||
form.bizDate = undefined
|
||||
countryOptions.value = []
|
||||
countryRows.value = []
|
||||
result.value = null
|
||||
errorMsg.value = ''
|
||||
proxy.$nextTick(() => {
|
||||
|
||||
Reference in New Issue
Block a user