|
|
|
@ -59,6 +59,7 @@
|
|
|
|
|
:min="0" |
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
@ -82,6 +83,7 @@
|
|
|
|
|
:min="0" |
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
@ -107,6 +109,7 @@
|
|
|
|
|
:min="0" |
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
@ -131,6 +134,7 @@
|
|
|
|
|
:min="0" |
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
@ -147,6 +151,7 @@
|
|
|
|
|
:min="0" |
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
@ -163,6 +168,7 @@
|
|
|
|
|
:min="0" |
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
@ -192,7 +198,11 @@
|
|
|
|
|
style="width: 48%" |
|
|
|
|
v-if="form.Wholevehicle" |
|
|
|
|
> |
|
|
|
|
<SurchargeTable :SurchargeData="form.fullVehicleData" :Surcharge="form.fullVehicle"> |
|
|
|
|
<SurchargeTable |
|
|
|
|
:SurchargeData="form.fullVehicleData" |
|
|
|
|
:Surcharge="form.fullVehicle" |
|
|
|
|
@change="selectChange" |
|
|
|
|
> |
|
|
|
|
<template #default="slotProps"> |
|
|
|
|
<template v-if="slotProps.scope.column.label === '操作'"> |
|
|
|
|
<div class="eml_btn"> |
|
|
|
@ -233,6 +243,7 @@
|
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
@ -248,6 +259,7 @@
|
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
@ -263,6 +275,7 @@
|
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
@ -277,6 +290,7 @@
|
|
|
|
|
:min="0" |
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
@ -302,6 +316,7 @@
|
|
|
|
|
:precision="2" |
|
|
|
|
:min="0" |
|
|
|
|
:max="9999999" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
:controls="false" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
/> |
|
|
|
@ -327,6 +342,7 @@
|
|
|
|
|
:min="0" |
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
@ -339,6 +355,7 @@
|
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
@ -357,6 +374,7 @@
|
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</template> |
|
|
|
@ -368,6 +386,7 @@
|
|
|
|
|
:min="0" |
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
@ -382,6 +401,7 @@
|
|
|
|
|
:min="0" |
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
@ -394,6 +414,7 @@
|
|
|
|
|
v-model="form.dispatchUpwardJudgmentCost" |
|
|
|
|
:precision="2" |
|
|
|
|
:min="0" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
:max="9999999" |
|
|
|
|
:controls="false" |
|
|
|
|
placeholder="请输入价格" |
|
|
|
@ -708,7 +729,7 @@ const form = ref({
|
|
|
|
|
], |
|
|
|
|
}); |
|
|
|
|
async function updateDictionary(targetArray, dictionaryType) { |
|
|
|
|
await getDictionaryBiz(dictionaryType) |
|
|
|
|
await getDictionaryBiz(dictionaryType) |
|
|
|
|
.then(res => { |
|
|
|
|
console.log(res, '字典'); |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
@ -726,6 +747,43 @@ async function updateDictionary(targetArray, dictionaryType) {
|
|
|
|
|
.catch(() => {}) |
|
|
|
|
.finally(() => {}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function updateOptions(allDropdowns) { |
|
|
|
|
// 拉平所有的下拉框组到一个单一数组中 |
|
|
|
|
let dropdowns = allDropdowns; |
|
|
|
|
console.log(dropdowns, 'dropdowns'); |
|
|
|
|
// 遍历每个下拉框 |
|
|
|
|
dropdowns.forEach((dropdown, index, self) => { |
|
|
|
|
// 取出当前下拉框选中的值 |
|
|
|
|
let selectedValue = dropdown.vehicleType; |
|
|
|
|
|
|
|
|
|
// 更新其他下拉框的options状态 |
|
|
|
|
self.forEach(otherDropdown => { |
|
|
|
|
if (dropdown !== otherDropdown) { |
|
|
|
|
// 确保不是自身 |
|
|
|
|
otherDropdown.options.forEach(option => { |
|
|
|
|
// 如果选项值和当前下拉框选中值相同,则禁用该选项 |
|
|
|
|
if (option.value === selectedValue) { |
|
|
|
|
option.disabled = true; |
|
|
|
|
} else { |
|
|
|
|
// 如果其他逻辑导致应保持禁用,可以在这里加上,下面的语句是检查是否已在别处被选中 |
|
|
|
|
let isSelectedSomewhereElse = self.some( |
|
|
|
|
d => d !== otherDropdown && d.vehicleType === option.value |
|
|
|
|
); |
|
|
|
|
option.disabled = isSelectedSomewhereElse; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 选择框值发生改变 |
|
|
|
|
const selectChange = data => { |
|
|
|
|
// 更新选项 |
|
|
|
|
updateOptions(form.value.fullVehicleData); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 重置表单 |
|
|
|
|
const resetFormData = () => { |
|
|
|
|
ElMessageBox.confirm('是否重置数据?', '提示', { |
|
|
|
@ -763,9 +821,10 @@ async function addItemAfterId(array) {
|
|
|
|
|
vehicleType: '', // 车型 |
|
|
|
|
loading: false, |
|
|
|
|
price: 0, //价格 |
|
|
|
|
options: pricevehicle.value, //选择框列表 |
|
|
|
|
options: deepClone(pricevehicle.value), //选择框列表 |
|
|
|
|
}; |
|
|
|
|
await array.push(newItem); |
|
|
|
|
await array.push(newItem); |
|
|
|
|
updateOptions(form.value.fullVehicleData); |
|
|
|
|
} |
|
|
|
|
// 仓储减 |
|
|
|
|
const storagereduce = id => { |
|
|
|
@ -774,8 +833,9 @@ const storagereduce = id => {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 仓储加 |
|
|
|
|
const storageplus = data => { |
|
|
|
|
addItemAfterId(form.value.fullVehicleData); |
|
|
|
|
const storageplus = async data => { |
|
|
|
|
await addItemAfterId(form.value.fullVehicleData); |
|
|
|
|
// 更新选项 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const billing = async () => { |
|
|
|
@ -824,9 +884,24 @@ const onLoad = async () => {
|
|
|
|
|
billing(); //显示条件 |
|
|
|
|
// 整车 |
|
|
|
|
if (form.value.dispatchPricingType.includes(4)) { |
|
|
|
|
addItemAfterId(form.value.fullVehicleData); |
|
|
|
|
console.log('执行整车'); |
|
|
|
|
if (request.value.fullVehicle) { |
|
|
|
|
addItemAfterId(form.value.fullVehicleData); |
|
|
|
|
} else { |
|
|
|
|
form.value.fullVehicleData = [ |
|
|
|
|
{ |
|
|
|
|
index: 1, // 新对象的 ID 为当前数组长度加 1 |
|
|
|
|
plus: false, // 是否显示加号 |
|
|
|
|
reduce: true, // 是否显示减号 |
|
|
|
|
vehicleType: '', // 车型 |
|
|
|
|
loading: false, |
|
|
|
|
price: 0, //价格 |
|
|
|
|
options: pricevehicle.value, //选择框列表 |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
console.log(form.value.fullVehicleData, '整车数据'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 按件品类计费 |
|
|
|
|
if (request.value.dispatchIsByCategory) { |
|
|
|
|
if (form.value.dispatchPricingType.includes(1)) { |
|
|
|
@ -844,29 +919,32 @@ const onLoad = async () => {
|
|
|
|
|
} |
|
|
|
|
// 按方计费 |
|
|
|
|
if (form.value.dispatchPricingType.includes(3)) { |
|
|
|
|
request.value.dispatchCubeCategorys.forEach((item, index) => { |
|
|
|
|
form.value.cubeCategoryData.push({ |
|
|
|
|
index: index + 1, |
|
|
|
|
categoryId: item.id, //品类 |
|
|
|
|
price: 0, //价格 |
|
|
|
|
leaveBehindPrice: 0, //遗留单价 |
|
|
|
|
options: [{ label: item.name, value: item.id }], |
|
|
|
|
if (request.value.dispatchCubeCategorys && request.value.dispatchCubeCategorys.length) { |
|
|
|
|
request.value.dispatchCubeCategorys.forEach((item, index) => { |
|
|
|
|
form.value.cubeCategoryData.push({ |
|
|
|
|
index: index + 1, |
|
|
|
|
categoryId: item.id, //品类 |
|
|
|
|
price: 0, //价格 |
|
|
|
|
leaveBehindPrice: 0, //遗留单价 |
|
|
|
|
options: [{ label: item.name, value: item.id }], |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 按重量 |
|
|
|
|
if (form.value.dispatchPricingType.includes(2)) { |
|
|
|
|
request.value.dispatchWeightCategorys.forEach((item, index) => { |
|
|
|
|
form.value.weightCategoryData.push({ |
|
|
|
|
index: index + 1, |
|
|
|
|
categoryId: item.id, //品类 |
|
|
|
|
price: 0, //价格 |
|
|
|
|
leaveBehindPrice: 0, //遗留单价 |
|
|
|
|
options: [{ label: item.name, value: item.id }], |
|
|
|
|
if (request.value.dispatchWeightCategorys && request.value.dispatchWeightCategorys.length) { |
|
|
|
|
request.value.dispatchWeightCategorys.forEach((item, index) => { |
|
|
|
|
form.value.weightCategoryData.push({ |
|
|
|
|
index: index + 1, |
|
|
|
|
categoryId: item.id, //品类 |
|
|
|
|
price: 0, //价格 |
|
|
|
|
leaveBehindPrice: 0, //遗留单价 |
|
|
|
|
options: [{ label: item.name, value: item.id }], |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
console.log(request.value, ' request.value'); |
|
|
|
@ -893,13 +971,16 @@ const onLoad = async () => {
|
|
|
|
|
// 最低计费等级 |
|
|
|
|
console.log(form.value.Minimumbilling, 'Minimumbilling'); |
|
|
|
|
console.log(request.value.dispatchMinCostType); |
|
|
|
|
form.value.Minimumbilling.forEach(res => { |
|
|
|
|
if (res.index == request.value.dispatchMinCostType) { |
|
|
|
|
res.disabled = true; |
|
|
|
|
} else { |
|
|
|
|
res.disabled = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if (form.value.Minimumbilling.length) { |
|
|
|
|
form.value.Minimumbilling.forEach(res => { |
|
|
|
|
if (res.index == request.value.dispatchMinCostType) { |
|
|
|
|
res.disabled = true; |
|
|
|
|
} else { |
|
|
|
|
res.disabled = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// if (request.value.dispatchMinCostType != 1) { |
|
|
|
|
// form.value.Minimumbilling.find(res => res.label == '加算价格').disabled = true; |
|
|
|
|
// console.log('有加算价格'); |
|
|
|
@ -908,13 +989,15 @@ const onLoad = async () => {
|
|
|
|
|
// console.log('加算价格没有'); |
|
|
|
|
// } |
|
|
|
|
// 遗留控制 |
|
|
|
|
form.value.Minimumlegacy.forEach(res => { |
|
|
|
|
if (res.index == request.value.dispatchMinCostType) { |
|
|
|
|
res.disabled = true; |
|
|
|
|
} else { |
|
|
|
|
res.disabled = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if (form.value.Minimumlegacy.length) { |
|
|
|
|
form.value.Minimumlegacy.forEach(res => { |
|
|
|
|
if (res.index == request.value.dispatchMinCostType) { |
|
|
|
|
res.disabled = true; |
|
|
|
|
} else { |
|
|
|
|
res.disabled = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 附加费用 |
|
|
|
|
// 是否有操作/装卸费 |
|
|
|
@ -953,7 +1036,9 @@ const onLoad = async () => {
|
|
|
|
|
} else { |
|
|
|
|
form.value.pieceCategory.find(res => res.prop === 'leaveBehindPrice').disabled = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (request.value.dispatchIsStairsCarryingCharge && request.value.dispatchIsFeeFloor) { |
|
|
|
|
form.value.dispatchStairsCarryingCharge = 0; |
|
|
|
|
} |
|
|
|
|
// (品类计费按方)是否有遗留 |
|
|
|
|
if (!request.value.dispatchIsLeaveBehind) { |
|
|
|
|
form.value.cubeCategory.find(res => res.prop === 'leaveBehindPrice').disabled = false; |
|
|
|
@ -989,7 +1074,11 @@ const onLoad = async () => {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (form.value.dispatchPricingType.includes(2) && form.value.weightCategoryData.length) { |
|
|
|
|
if ( |
|
|
|
|
form.value.dispatchPricingType.includes(2) && |
|
|
|
|
form.value.weightCategoryData && |
|
|
|
|
form.value.weightCategoryData.length |
|
|
|
|
) { |
|
|
|
|
// 按重量品类计费 |
|
|
|
|
requestInfo.value.weightCategory.forEach(item => { |
|
|
|
|
let data = form.value.weightCategoryData.find(res => res.categoryId == item.categoryId); |
|
|
|
@ -1000,7 +1089,11 @@ const onLoad = async () => {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (form.value.dispatchPricingType.includes(3) && form.value.cubeCategoryData.length) { |
|
|
|
|
if ( |
|
|
|
|
form.value.dispatchPricingType.includes(3) && |
|
|
|
|
form.value.cubeCategoryData && |
|
|
|
|
form.value.cubeCategoryData.length |
|
|
|
|
) { |
|
|
|
|
// 按方品类计费 |
|
|
|
|
|
|
|
|
|
requestInfo.value.cubeCategory.forEach(item => { |
|
|
|
@ -1014,78 +1107,94 @@ const onLoad = async () => {
|
|
|
|
|
} else { |
|
|
|
|
// 按件品类计费 |
|
|
|
|
if (form.value.dispatchPricingType.includes(1)) { |
|
|
|
|
let data = requestInfo.value.pieceCategory[0] || []; |
|
|
|
|
form.value.pieceCategoryInput = data.price || 0; |
|
|
|
|
if (requestInfo.value.pieceCategory && requestInfo.value.pieceCategory.length) { |
|
|
|
|
let data = requestInfo.value.pieceCategory[0] || []; |
|
|
|
|
form.value.pieceCategoryInput = data.price || 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (form.value.dispatchPricingType.includes(2)) { |
|
|
|
|
// 按重量品类计费 |
|
|
|
|
let data = requestInfo.value.weightCategory[0] || []; |
|
|
|
|
form.value.weightCategoryInput = data.price || 0; |
|
|
|
|
if (requestInfo.value.weightCategory.length) { |
|
|
|
|
let data = requestInfo.value.weightCategory[0] || []; |
|
|
|
|
form.value.weightCategoryInput = data.price || 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (form.value.dispatchPricingType.includes(3)) { |
|
|
|
|
// 按方品类计费 |
|
|
|
|
let data = requestInfo.value.cubeCategory[0] || []; |
|
|
|
|
form.value.cubeCategoryInput = data.price || 0; |
|
|
|
|
if (requestInfo.value.cubeCategory && requestInfo.value.cubeCategory.length) { |
|
|
|
|
let data = requestInfo.value.cubeCategory[0] || []; |
|
|
|
|
form.value.cubeCategoryInput = data.price || 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 按公里 |
|
|
|
|
if (form.value.dispatchPricingType.includes(7)) { |
|
|
|
|
form.value.kilometerCost = requestInfo.value.kilometerCost[0].price || 0; |
|
|
|
|
if (requestInfo.value.kilometerCost && requestInfo.value.kilometerCost.length) { |
|
|
|
|
form.value.kilometerCost = requestInfo.value.kilometerCost[0].price || 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//按吨公里 |
|
|
|
|
if (form.value.dispatchPricingType.includes(6)) { |
|
|
|
|
form.value.tonKilometerCost = requestInfo.value.tonKilometerCost[0].price || 0; |
|
|
|
|
if (requestInfo.value.tonKilometerCost && requestInfo.value.tonKilometerCost.length) { |
|
|
|
|
form.value.tonKilometerCost = requestInfo.value.tonKilometerCost[0].price || 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//按吨 |
|
|
|
|
if (form.value.dispatchPricingType.includes(8)) { |
|
|
|
|
form.value.tonCost = requestInfo.value.tonCost[0].price || 0; |
|
|
|
|
if (requestInfo.value.tonCost && requestInfo.value.tonCost.length) { |
|
|
|
|
form.value.tonCost = requestInfo.value.tonCost[0].price || 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//按整车 |
|
|
|
|
if (form.value.dispatchPricingType.includes(4)) { |
|
|
|
|
form.value.fullVehicleData = []; |
|
|
|
|
if(requestInfo.value.fullVehicle && requestInfo.value.fullVehicle.length){ |
|
|
|
|
if (requestInfo.value.fullVehicle && requestInfo.value.fullVehicle.length) { |
|
|
|
|
form.value.fullVehicleData = []; |
|
|
|
|
requestInfo.value.fullVehicle.forEach((item, index) => { |
|
|
|
|
form.value.fullVehicleData.push({ |
|
|
|
|
index: index + 1, |
|
|
|
|
loading: false, |
|
|
|
|
options: pricevehicle.value, |
|
|
|
|
plus: true, |
|
|
|
|
price: item.price || 0, |
|
|
|
|
vehicleType: item.vehicleType, |
|
|
|
|
form.value.fullVehicleData.push({ |
|
|
|
|
index: index + 1, |
|
|
|
|
loading: false, |
|
|
|
|
options: pricevehicle.value, |
|
|
|
|
plus: true, |
|
|
|
|
price: item.price || 0, |
|
|
|
|
vehicleType: item.vehicleType, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 附加费用 |
|
|
|
|
if (request.value.dispatchIsCategorySubjoin) { |
|
|
|
|
if( requestInfo.value.additionalCategory && requestInfo.value.additionalCategory.length){ |
|
|
|
|
if (requestInfo.value.additionalCategory && requestInfo.value.additionalCategory.length) { |
|
|
|
|
requestInfo.value.additionalCategory.forEach(item => { |
|
|
|
|
let data = form.value.additionalCategoryData.find( |
|
|
|
|
res => res.categoryId == item.categoryId |
|
|
|
|
); |
|
|
|
|
if (data) { |
|
|
|
|
data.handlingPrice = item.handlingPrice || 0; |
|
|
|
|
data.relocationPrice = item.relocationPrice || 0; |
|
|
|
|
data.sortPrice = item.sortPrice || 0; |
|
|
|
|
data.upstairsDeliveryPrice = item.upstairsDeliveryPrice || 0; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
let data = form.value.additionalCategoryData.find( |
|
|
|
|
res => res.categoryId == item.categoryId |
|
|
|
|
); |
|
|
|
|
if (data) { |
|
|
|
|
data.handlingPrice = item.handlingPrice || 0; |
|
|
|
|
data.relocationPrice = item.relocationPrice || 0; |
|
|
|
|
data.sortPrice = item.sortPrice || 0; |
|
|
|
|
data.upstairsDeliveryPrice = item.upstairsDeliveryPrice || 0; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
const data = requestInfo.value.additionalCategory[0]; |
|
|
|
|
console.log(data, 'data===>'); |
|
|
|
|
form.value.handlingPrice = data.handlingPrice || 0; |
|
|
|
|
form.value.relocationPrice = data.relocationPrice || 0; |
|
|
|
|
form.value.sortPrice = data.sortPrice || 0; |
|
|
|
|
form.value.upstairsDeliveryPrice = data.upstairsDeliveryPrice || 0; |
|
|
|
|
if (requestInfo.value.additionalCategory && requestInfo.value.additionalCategory.length) { |
|
|
|
|
const data = requestInfo.value.additionalCategory[0]; |
|
|
|
|
console.log(data, 'data===>'); |
|
|
|
|
form.value.handlingPrice = data.handlingPrice || 0; |
|
|
|
|
form.value.relocationPrice = data.relocationPrice || 0; |
|
|
|
|
form.value.sortPrice = data.sortPrice || 0; |
|
|
|
|
form.value.upstairsDeliveryPrice = data.upstairsDeliveryPrice || 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (request.value.dispatchIsStairsCarryingCharge && request.value.dispatchIsFeeFloor) { |
|
|
|
|
console.log('有楼层', form.value.dispatchStairsCarryingCharge); |
|
|
|
|
form.value.dispatchStairsCarryingCharge = |
|
|
|
|
requestInfo.value.dispatchStairsCarryingCharge || 0; |
|
|
|
|
} |
|
|
|
|
// 上楼费免费楼层(缺少判断) |
|
|
|
|
form.value.dispatchStairsCarryingCharge = requestInfo.value.dispatchStairsCarryingCharge; |
|
|
|
|
|
|
|
|
|
// 最低计费 |
|
|
|
|
if (request.value.dispatchIsMinCost) { |
|
|
|
|
form.value.Minimumbilling.find(res => res.disabled).minCost = |
|
|
|
@ -1111,18 +1220,13 @@ const onLoad = async () => {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let setTime = setTimeout(()=>{ |
|
|
|
|
formCopy.value = deepClone(form.value); |
|
|
|
|
loading.value = false; |
|
|
|
|
clearTimeout(setTime); |
|
|
|
|
},500) |
|
|
|
|
|
|
|
|
|
loading.value = false; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
onLoad(); |
|
|
|
|
// 提交信息 |
|
|
|
|
const handleSubmit = () => { |
|
|
|
|
|
|
|
|
|
let data = { |
|
|
|
|
checkType: '4', |
|
|
|
|
id: $route.query.id, |
|
|
|
@ -1142,36 +1246,42 @@ const handleSubmit = () => {
|
|
|
|
|
if (request.value.dispatchIsByCategory) { |
|
|
|
|
console.log('区分品类'); |
|
|
|
|
// 按件品类计费 |
|
|
|
|
if (form.value.dispatchPricingType.includes(1) && form.value.pieceCategoryData.length) { |
|
|
|
|
form.value.pieceCategoryData.forEach(item => { |
|
|
|
|
data.dispatch['pieceCategory'].push({ |
|
|
|
|
categoryId: item.categoryId, //品类id |
|
|
|
|
leaveBehindPrice: item.leaveBehindPrice, // 遗留单价 |
|
|
|
|
price: item.price, //单价 |
|
|
|
|
if (form.value.dispatchPricingType.includes(1)) { |
|
|
|
|
if (form.value.pieceCategoryData && form.value.pieceCategoryData.length) { |
|
|
|
|
form.value.pieceCategoryData.forEach(item => { |
|
|
|
|
data.dispatch['pieceCategory'].push({ |
|
|
|
|
categoryId: item.categoryId, //品类id |
|
|
|
|
leaveBehindPrice: item.leaveBehindPrice, // 遗留单价 |
|
|
|
|
price: item.price, //单价 |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (form.value.dispatchPricingType.includes(2) && form.value.weightCategoryData.length) { |
|
|
|
|
if (form.value.dispatchPricingType.includes(2)) { |
|
|
|
|
// 按重量品类计费 |
|
|
|
|
form.value.weightCategoryData.forEach(item => { |
|
|
|
|
data.dispatch['weightCategory'].push({ |
|
|
|
|
categoryId: item.categoryId, //品类id |
|
|
|
|
leaveBehindPrice: item.leaveBehindPrice, // 遗留单价 |
|
|
|
|
price: item.price, //单价 |
|
|
|
|
if (form.value.weightCategoryData && form.value.weightCategoryData.length) { |
|
|
|
|
form.value.weightCategoryData.forEach(item => { |
|
|
|
|
data.dispatch['weightCategory'].push({ |
|
|
|
|
categoryId: item.categoryId, //品类id |
|
|
|
|
leaveBehindPrice: item.leaveBehindPrice, // 遗留单价 |
|
|
|
|
price: item.price, //单价 |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (form.value.dispatchPricingType.includes(3) && form.value.cubeCategoryData.length) { |
|
|
|
|
if (form.value.dispatchPricingType.includes(3)) { |
|
|
|
|
// 按方品类计费 |
|
|
|
|
form.value.cubeCategoryData.forEach(item => { |
|
|
|
|
data.dispatch['cubeCategory'].push({ |
|
|
|
|
categoryId: item.categoryId, //品类id |
|
|
|
|
leaveBehindPrice: item.leaveBehindPrice, // 遗留单价 |
|
|
|
|
price: item.price, //单价 |
|
|
|
|
if (form.value.cubeCategoryData && form.value.cubeCategoryData.length) { |
|
|
|
|
form.value.cubeCategoryData.forEach(item => { |
|
|
|
|
data.dispatch['cubeCategory'].push({ |
|
|
|
|
categoryId: item.categoryId, //品类id |
|
|
|
|
leaveBehindPrice: item.leaveBehindPrice, // 遗留单价 |
|
|
|
|
price: item.price, //单价 |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// 按件统一计费 |
|
|
|
@ -1212,36 +1322,37 @@ const handleSubmit = () => {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
// 整车计费 |
|
|
|
|
if(form.value.dispatchPricingType.includes(4)){ |
|
|
|
|
if (form.value.dispatchPricingType.includes(4)) { |
|
|
|
|
let fullVehicleDataState = form.value.fullVehicleData.every(res => res.vehicleType); |
|
|
|
|
if (fullVehicleDataState && form.value.fullVehicleData.length) { |
|
|
|
|
form.value.fullVehicleData.forEach(item => { |
|
|
|
|
data.dispatch['fullVehicle'].push({ |
|
|
|
|
price: item.price || 0, // 整车计费(元/车) |
|
|
|
|
vehicleType: item.vehicleType, //车型 |
|
|
|
|
if (fullVehicleDataState && form.value.fullVehicleData.length) { |
|
|
|
|
form.value.fullVehicleData.forEach(item => { |
|
|
|
|
data.dispatch['fullVehicle'].push({ |
|
|
|
|
price: item.price || 0, // 整车计费(元/车) |
|
|
|
|
vehicleType: item.vehicleType, //车型 |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '整车计费有未选择车型', |
|
|
|
|
type: 'warning', |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '整车计费有未选择车型', |
|
|
|
|
type: 'warning', |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 附加费用 |
|
|
|
|
if (request.value.dispatchIsCategorySubjoin && form.value.additionalCategoryData.length) { |
|
|
|
|
form.value.additionalCategoryData.forEach(res => { |
|
|
|
|
data.dispatch['additionalCategory'].push({ |
|
|
|
|
categoryId: res.categoryId, //品类id |
|
|
|
|
handlingPrice: res.handlingPrice || 0, //装卸费 |
|
|
|
|
relocationPrice: res.relocationPrice || 0, //平移费 |
|
|
|
|
sortPrice: res.sortPrice || 0, //分货费 |
|
|
|
|
upstairsDeliveryPrice: res.upstairsDeliveryPrice || 0, //上楼费 |
|
|
|
|
if (request.value.dispatchIsCategorySubjoin) { |
|
|
|
|
if (form.value.additionalCategoryData && form.value.additionalCategoryData.length) { |
|
|
|
|
form.value.additionalCategoryData.forEach(res => { |
|
|
|
|
data.dispatch['additionalCategory'].push({ |
|
|
|
|
categoryId: res.categoryId, //品类id |
|
|
|
|
handlingPrice: res.handlingPrice || 0, //装卸费 |
|
|
|
|
relocationPrice: res.relocationPrice || 0, //平移费 |
|
|
|
|
sortPrice: res.sortPrice || 0, //分货费 |
|
|
|
|
upstairsDeliveryPrice: res.upstairsDeliveryPrice || 0, //上楼费 |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
data.dispatch['additionalCategory'].push({ |
|
|
|
|
handlingPrice: form.value.handlingPrice || 0, //装卸费 |
|
|
|
@ -1252,6 +1363,7 @@ const handleSubmit = () => {
|
|
|
|
|
} |
|
|
|
|
// 上楼费免费楼层 |
|
|
|
|
if (request.value.dispatchIsStairsCarryingCharge && request.value.dispatchIsFeeFloor) { |
|
|
|
|
console.log('有楼层', form.value.dispatchStairsCarryingCharge); |
|
|
|
|
data.dispatch.dispatchStairsCarryingCharge = form.value.dispatchStairsCarryingCharge || 0; |
|
|
|
|
} |
|
|
|
|
// 最低计费 |
|
|
|
@ -1280,19 +1392,22 @@ const handleSubmit = () => {
|
|
|
|
|
} |
|
|
|
|
console.log(data, '要提交的数据'); |
|
|
|
|
loading.value = true; |
|
|
|
|
putBasicdataPrice(data).then(res => { |
|
|
|
|
console.log(res, '处理好的值'); |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: res.data.msg, |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}).catch(res=>{ |
|
|
|
|
console.log(res,'错误信息'); |
|
|
|
|
}).finally(()=>{ |
|
|
|
|
loading.value = false; |
|
|
|
|
}) |
|
|
|
|
putBasicdataPrice(data) |
|
|
|
|
.then(res => { |
|
|
|
|
console.log(res, '处理好的值'); |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: res.data.msg, |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch(res => { |
|
|
|
|
console.log(res, '错误信息'); |
|
|
|
|
}) |
|
|
|
|
.finally(() => { |
|
|
|
|
loading.value = false; |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 返回 |
|
|
|
|