-
-
-
-
+
+
+
+ {{ tabform.title }}
+
+
+
+
+
-
-
-
{{ tabform.title }}
-
-
+
+
+
+
+
+
+
+ 重置
+ 保存
-
-
-
- 重置
- 保存
@@ -182,7 +144,7 @@ import { ref, defineEmits, defineComponent, computed } from 'vue';
import SurchargeTable from '@/components/pric/tablePric.vue';
import { getDictionaryBiz } from '@/api/system/dict'; //字典
import { deepClone } from '@/utils/util';
-import { ElMessage } from 'element-plus';
+import { ElMessage, ElMessageBox } from 'element-plus';
import { putBasicdataPrice } from '@/api/Pricesystem/index';
import { useRoute } from 'vue-router';
const $route = useRoute(); //获取地址栏参数
@@ -224,7 +186,8 @@ function updateDictionary(targetArray, dictionaryType) {
.catch(() => {})
.finally(() => {});
}
-
+const loading = ref(true);
+const formCopy = ref({}); //拷贝数据
const form = ref({
operatePrice: 0, //操作/装卸费
warehouseManagementPrice: 0, //仓储管理费
@@ -232,26 +195,33 @@ const form = ref({
// 附加费
Surcharge: [
{ label: '序号', prop: 'index', type: 'string', width: '80', disabled: true },
- { label: '产品品类', prop: 'categoryId', type: 'select', width: '150', disabled: true },
+ {
+ label: '产品品类',
+ prop: 'categoryId',
+ type: 'select',
+ width: '150',
+ disabled: true,
+ show: true,
+ },
{
label: '仓储操作/装卸费',
prop: 'operatePrice',
type: 'number',
- width: '180',
+ width: 'auto',
disabled: true,
},
{
label: '仓储管理费',
prop: 'warehouseManagementPrice',
type: 'number',
- width: '180',
+ width: 'auto',
disabled: true,
},
{
label: '仓储分货费',
prop: 'warehouseSortPrice',
type: 'number',
- width: '180',
+ width: 'auto',
disabled: true,
},
],
@@ -259,33 +229,40 @@ const form = ref({
// 按吨计费
publicTable: [
{ label: '序号', prop: 'index', type: 'string', width: '80', disabled: true },
- { label: '产品品类', prop: 'categoryId', type: 'select', width: '150', disabled: true },
+ {
+ label: '产品品类',
+ prop: 'categoryId',
+ type: 'select',
+ width: '150',
+ disabled: true,
+ show: true,
+ },
{
label: '30天内',
prop: 'withinThirtyPrice',
type: 'number',
- width: '180',
+ width: 'auto',
disabled: true,
},
{
label: '30天-60天',
prop: 'betweenThirtySixtyPrice',
type: 'number',
- width: '180',
+ width: 'auto',
disabled: true,
},
{
label: '60天外',
prop: 'beyondSixtyPrice',
type: 'number',
- width: '180',
+ width: 'auto',
disabled: true,
},
{
label: '上限',
prop: 'maximumPrice',
type: 'number',
- width: '180',
+ width: 'auto',
disabled: true,
},
],
@@ -293,14 +270,14 @@ const form = ref({
publicData: [],
});
const onLoad = async () => {
- updateDictionary(Storagebillingtype.value, 'warehouse_pricing_type'); //仓储计费类型
- updateDictionary(Warehousebillingmode.value, 'warehouse_pricing_mode'); //仓储计费模式
- updateDictionary(CalculationBasis.value, 'warehouse_calculation_basis'); //计算基准
+ await Promise.all([
+ updateDictionary(Storagebillingtype.value, 'warehouse_pricing_type'), // 仓储计费类型
+ updateDictionary(Warehousebillingmode.value, 'warehouse_pricing_mode'), // 仓储计费模式
+ updateDictionary(CalculationBasis.value, 'warehouse_calculation_basis'), // 计算基准
+ ]);
// updateDictionary(Surchargepricingunit.value, 'warehouse_pricing_unit'); //附加费计价单位
- // 价格回显
-
+ // 回显
if (props.templateData.request) {
-
form.value.warehousePricingType = request.value.warehousePricingType; //计算类型
form.value.warehousePricingMode = request.value.warehousePricingMode; //计费模式
form.value.warehouseCalculationBasis = request.value.warehouseCalculationBasis; //计算基准
@@ -328,13 +305,13 @@ const onLoad = async () => {
});
});
}
- }else{
+ } else {
console.log('没有附加品类');
- let data= requestInfo.value.additionalCategory[0]
- console.log(data,'data数据');
- form.value.operatePrice=data.operatePrice
- form.value.warehouseManagementPrice=data.warehouseManagementPrice
- form.value.warehouseSortPrice=data.warehouseSortPrice
+ let data = requestInfo.value.additionalCategory[0];
+ console.log(data, 'data数据');
+ form.value.operatePrice = data.operatePrice || 0;
+ form.value.warehouseManagementPrice = data.warehouseManagementPrice || 0;
+ form.value.warehouseSortPrice = data.warehouseSortPrice || 0;
}
form.value.publicData = []; //清空数据
// 仓储回显
@@ -416,6 +393,46 @@ const onLoad = async () => {
handleFormUpdate(isByCategory, '(元/t)', '按吨计费(t)');
break;
}
+ // 附加费是否有操作装/装卸费
+ if (!request.value.warehouseIsOperateFee) {
+ form.value.Surcharge.find(res => res.prop === 'operatePrice').disabled = false;
+ } else {
+ form.value.Surcharge.find(res => res.prop === 'operatePrice').disabled = true;
+ }
+ // 附加费是否有仓储管理费
+ if (!request.value.warehouseIsManageFee) {
+ form.value.Surcharge.find(res => res.prop === 'warehouseManagementPrice').disabled = false;
+ } else {
+ form.value.Surcharge.find(res => res.prop === 'warehouseManagementPrice').disabled = true;
+ }
+ // 附加费是否有仓储分货费
+ if (!request.value.warehouseIsSortFee) {
+ form.value.Surcharge.find(res => res.prop === 'warehouseSortPrice').disabled = false;
+ } else {
+ form.value.Surcharge.find(res => res.prop === 'warehouseSortPrice').disabled = true;
+ }
+
+ // {
+ // label: '仓储操作/装卸费',
+ // prop: 'operatePrice',
+ // type: 'number',
+ // width: 'auto',
+ // disabled: true,
+ // },
+ // {
+ // label: '仓储管理费',
+ // prop: 'warehouseManagementPrice',
+ // type: 'number',
+ // width: 'auto',
+ // disabled: true,
+ // },
+ // {
+ // label: '仓储分货费',
+ // prop: 'warehouseSortPrice',
+ // type: 'number',
+ // width: 'auto',
+ // disabled: true,
+ // },
// if(request.value.warehouseSubjoinFeeUnit==4){
// form.value.publicTable.forEach(res=>{
@@ -467,45 +484,46 @@ const onLoad = async () => {
// }
// }
}
-
- console.log(request.value, '初始化页面');
-};
-
-const price = async () => {
-
+ // 价格处理
if (Object.keys(requestInfo.value).length > 0) {
if (requestInfo.value.catergory && requestInfo.value.catergory.length) {
// 仓储
requestInfo.value.catergory.forEach(res => {
let data = form.value.publicData.find(temp => temp.categoryId == res.categoryId);
if (data) {
- data.betweenThirtySixtyPrice = res.betweenThirtySixtyPrice;
- data.beyondSixtyPrice = res.beyondSixtyPrice;
- data.maximumPrice = res.maximumPrice;
- data.withinThirtyPrice = res.withinThirtyPrice;
+ data.betweenThirtySixtyPrice = res.betweenThirtySixtyPrice || 0;
+ data.beyondSixtyPrice = res.beyondSixtyPrice || 0;
+ data.maximumPrice = res.maximumPrice || 0;
+ data.withinThirtyPrice = res.withinThirtyPrice || 0;
}
});
}
- // 附加费(还差状态)
+ // 附加费
if (requestInfo.value.additionalCategory && requestInfo.value.additionalCategory.length) {
requestInfo.value.additionalCategory.forEach(res => {
let data = form.value.SurchargeData.find(temp => temp.categoryId == res.categoryId);
if (data) {
- data.operatePrice = res.operatePrice;//操作/装卸费
- data.managementFee = res.managementFee;
- data.warehouseManagementPrice = res.warehouseManagementPrice;// 仓储管理费
- data.warehouseSortPrice = res.warehouseSortPrice;//仓储分货费
+ data.operatePrice = res.operatePrice || 0; //操作/装卸费
+ data.managementFee = res.managementFee || 0;
+ data.warehouseManagementPrice = res.warehouseManagementPrice || 0; // 仓储管理费
+ data.warehouseSortPrice = res.warehouseSortPrice || 0; //仓储分货费
}
});
+ }
}
- }
+ let setTime = setTimeout(async () => {
+ formCopy.value = await deepClone(form.value);
+ loading.value = false;
+ clearTimeout(setTime);
+ }, 500);
+ console.log(request.value, '初始化页面');
};
+// 页面初始化
const pageonload = async () => {
request.value = await deepClone(props.templateData.request);
requestInfo.value = await deepClone(props.templateData.requestInfo.warehouse);
onLoad(); //页面渲染
- price(); //处理价格
};
pageonload();
const Surchargecd = computed(() => {
@@ -526,7 +544,24 @@ const Surchargecd = computed(() => {
return true;
}
});
-
+// 重置表单
+const resetFormData = () => {
+ ElMessageBox.confirm('是否重置数据?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
+ }).then(() => {
+ loading.value = true;
+ form.value = deepClone(formCopy.value);
+ setTimeout(() => {
+ loading.value = false;
+ ElMessage({
+ message: '重置成功',
+ type: 'success',
+ });
+ }, 300);
+ });
+};
// 保存数据
const handleSubmit = () => {
let data = {
@@ -584,7 +619,6 @@ const handleSubmit = () => {
// 数据处理
if (!request.value.warehouseIsCategorySubjoin) {
-
// 不存在填写统一单价
// data.warehouse['additionalCategory'].push({
// operatePrice: form.value.operatePrice, //操作/装卸费
@@ -593,7 +627,7 @@ const handleSubmit = () => {
// name: 'fj',
// });
let mox = data.warehouse['additionalCategory'].find(res => res.name == 'fj');
- delete mox.name
+ delete mox.name;
if (!request.value.warehouseIsManageFee) {
//删除管理费
delete mox.warehouseManagementPrice;
diff --git a/src/views/distribution/reservation/reservation.vue b/src/views/distribution/reservation/reservation.vue
index 6273ed5b..9f0e095a 100644
--- a/src/views/distribution/reservation/reservation.vue
+++ b/src/views/distribution/reservation/reservation.vue
@@ -280,7 +280,7 @@
-
+
-->
-
+
计算基准
-
+
{{
item.label
}}
@@ -60,7 +56,6 @@
@change="categoriesDisplayChange"
v-model="form.warehouseIsByCategory"
class="el_Cselect"
- style="padding-left: 4px"
>
{{
item.label
@@ -70,9 +65,14 @@
-
+
仓储品类配置
-
+
@@ -81,7 +81,11 @@
>新增
-
+
删除
@@ -89,57 +93,6 @@
-
@@ -148,56 +101,56 @@
-
-
- 附加费计价单位
-
-
-
-
+
+
+ 附加费计价单位
+
+
+
+
-
-
- 是否有管理费
-
- {{
- item.label
- }}
-
-
+
+
+ 是否有管理费
+
+ {{
+ item.label
+ }}
+
+
-
-
- 是否有操作/装卸费
-
- {{
- item.label
- }}
-
-
+
+
+ 是否有操作/装卸费
+
+ {{
+ item.label
+ }}
+
+
-
-
-
是否有分拣费用
-
- {{
- item.label
- }}
-
+
+
+ 是否有分拣费用
+
+ {{
+ item.label
+ }}
+
+
-
附加费是否按品类计费
@@ -214,27 +167,33 @@
-
+
附加费品类配置
-
-
-
-
-
- 新增
-
-
- 删除
-
-
-
-
-
+
+
+
+
+
+ 新增
+
+
+ 删除
+
+
+
+
+
-
-
- 配送服务类型
-
-
-
-
-
-
-
+
+
+
+
+
+ 配送服务类型
+
+
+
+
+
+
配送计费模式
-
-
-
-
- 是否区分品类
-
- {{
- item.label
- }}
-
-
-
-
-
- 是否有遗留件
-
- {{
- item.label
- }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{ Item.title }}
-
-
-
-
-
-
- 序号 |
- 产品品类 |
- 操作 |
-
-
-
-
-
-
- {{ item.id }} |
-
-
-
-
-
-
- |
-
-
- 新增
-
-
- 删除
-
- |
-
-
-
-
-
-
-
-
-
-
-
-
-
附加费计费
-
-
+
+
- 是否有分货费
-
- {{
+ 是否区分品类
+
+ {{
item.label
}}
-
+
+
- 是否有操作/装卸费
-
- {{
+ 是否有遗留件
+
+ {{
item.label
}}
+
+
+
+
+
+
+
+
-
-
-
- 是否有上楼费
-
- {{
+
+
+
+
+
+
+
附加费计费
+
+
+
+ 是否有分货费
+
+ {{
item.label
}}
-
-
-
-
是否配置免费层数
-
- {{
+
+
+ 是否有操作/装卸费
+
+ {{
item.label
}}
-
-
-
-
-
- 是否有平移费
-
- {{
- item.label
- }}
-
-
-
-
-
- 附加费是否按品类计费
-
- {{ item.label }}
-
-
-
-
-
-
-
-
附加费品类
-
-
-
-
-
-
- 序号 |
- 品类 |
- 操作 |
-
-
-
-
-
-
- {{ item.id }} |
-
-
-
-
-
-
- |
-
-
- 新增
-
-
- 删除
-
- |
-
-
-
-
-
-
-
-
-
-
最低计费
-
-
-
-
- 是否最低计费
-
- {{ item.label }}
-
-
-
-
-
-
最低计费方式
-
- {{
+
+
+
+ 是否有上楼费
+
+ {{
item.label
}}
-
-
-
- 最低计费类型
-
- {{
+
+
+
+ 是否配置免费层数
+
+ {{
item.label
}}
+
+
+
+
+
+ 是否有平移费
+
+ {{
+ item.label
+ }}
+
+
-
-
-
-
是否向上判断
-
- {{
- item.label
- }}
-
+
+
+ 附加费是否按品类计费
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
附加费品类
+
+
+
+
+
+
+ 序号 |
+ 品类 |
+ 操作 |
+
+
+
+
+
+
+ {{ item.id }} |
+
+
+
+
+
+
+ |
+
+
+ 新增
+
+
+ 删除
+
+ |
+
+
+
-
-
-
-
- 重置
- 保存
-
-
+
+
+
最低计费
+
+
+
+
+ 是否最低计费
+
+ {{ item.label }}
+
+
+
+
+
+ 最低计费方式
+
+ {{
+ item.label
+ }}
+
+
+
+
+
+ 最低计费类型
+
+ {{ item.label }}
+
+
+
+
+
+
+ 是否向上判断
+
+ {{
+ item.label
+ }}
+
+
+
+
+
+
+
+
+ 重置
+ 保存
+
+