Browse Source

修复部分价格bug

dev-xx
qb 12 months ago
parent
commit
cda266117e
  1. 147
      src/views/Pricesystem/Price/PriceBill.vue
  2. 1646
      src/views/Pricesystem/Price/PriceTrunkLine.vue
  3. 51
      src/views/Pricesystem/PricesyHome.vue
  4. 9
      src/views/distribution/artery/AddVehicleStowage.vue
  5. 23
      src/views/financialsector/Financialse/FinancialBill.vue
  6. 51
      src/views/financialsector/Financialse/FinancialTrunkLine.vue

147
src/views/Pricesystem/Price/PriceBill.vue

@ -268,10 +268,14 @@
width="70%"
v-model="details.popUpShow.addVsitied"
>
<el-form inline label-width="130px">
<el-form-item label="始发地">
<el-form inline :model="details.form" ref="lineFormRef" label-width="130px">
<el-form-item
label="始发地"
prop="startCity"
:rules="[{ required: true, message: '请选择始发地', trigger: ['blur', 'change'] }]"
>
<el-cascader
pleceholder="请选择到站地址"
pleceholder="请选择始发地"
:options="details.regionOptione"
style="width: 100%"
v-model="details.form.startCity"
@ -286,9 +290,13 @@
</el-cascader>
</el-form-item>
<el-form-item label="目的地">
<el-form-item
label="目的地"
prop="endCity"
:rules="[{ required: true, message: '请选择目的地', trigger: ['blur', 'change'] }]"
>
<el-cascader
pleceholder="请选择到站地址"
pleceholder="请选择目的地"
:options="details.regionOptione"
style="width: 100%"
v-model="details.form.endCity"
@ -303,7 +311,11 @@
</el-cascader>
</el-form-item>
<el-form-item label="发货单位">
<el-form-item
label="发货单位"
prop="sendOrg"
:rules="[{ required: true, message: '请选择发货单位', trigger: ['blur', 'change'] }]"
>
<el-select
class="w100"
v-model="details.form.sendOrg"
@ -541,6 +553,9 @@ console.log('props :>> ', props);
/** 表单实例 */
const formRef = ref();
/** 提货路径表单 */
const lineFormRef = ref();
const VehicleBillingFormRef = ref();
//
@ -565,7 +580,7 @@ interface BillTemplateDetail {
/** 整车计费 */
interface VehicleBilling {
/** 车型 */
pickupPricingType: string;
vehicleType: string;
/** 车型计费(元/车) */
price: number;
}
@ -604,7 +619,7 @@ const details = reactive({
VehicleBillingDetal: [
{
/** 车型 */
pickupPricingType: '',
vehicleType: '',
/** 车型计费(元/车) */
price: 0,
},
@ -824,16 +839,18 @@ const handleVehicleTypeArr = response => {
/** 获取业务字典 */
const initDictionaryBiz = async () => {
console.log('123213213 :>> ', 123213213);
try {
// 线
const trunkLinePromise = getDictionaryBiz('trunk_line_pricing_type');
//
const priceVehiclePromise = getDictionaryBiz('price_vehicle_type');
const { trunkLineResult, priceVehicleResult, regionOptione } = props.templateData;
// // 线
// const trunkLinePromise = getDictionaryBiz('trunk_line_pricing_type');
// //
// const priceVehiclePromise = getDictionaryBiz('price_vehicle_type');
const [trunkLineResult, priceVehicleResult] = await Promise.all([
trunkLinePromise,
priceVehiclePromise,
]);
// const [trunkLineResult, priceVehicleResult] = await Promise.all([
// trunkLinePromise,
// priceVehiclePromise,
// ]);
await nextTick();
@ -853,12 +870,15 @@ const initDictionaryBiz = async () => {
// ,
if (details.form.pickupIsUnifyAreaBill === '0') {
console.log('123 :>> ', 123);
//
const res = await getLazyTreeAll();
if (res.data.success) {
details.regionOptione = res.data.data || [];
if (regionOptione.data.success) {
details.regionOptione = regionOptione.data.data || [];
}
console.log('123321 :>> ', 123321);
initLineData();
}
}
@ -867,6 +887,7 @@ const initDictionaryBiz = async () => {
handleTrunkLinePricingType(trunkLineResult);
handleVehicleTypeArr(priceVehicleResult);
initAssignmentForm(props.templateData.requestInfo.pickup, false);
// form
initFormData();
} catch (error) {
@ -894,7 +915,7 @@ const handlePlusVehicle = async (index: number) => {
details.VehicleBillingDetal.splice(index + 1, 0, {
/** 车型 */
pickupPricingType: '',
vehicleType: '',
/** 车型计费(元/车) */
price: 0,
});
@ -972,7 +993,7 @@ const initLineData = async () => {
try {
details.loadingObj.list = true;
const res = await getPage({ ...details.page, priceId: $route.query.id });
const res = await getPage({ ...details.page, priceId: $route.query.id, serviceType: '1' });
const { code, data } = res.data;
if (code !== 200) return;
@ -1081,7 +1102,7 @@ const handleAdd = () => {
details.VehicleBillingDetal = [
{
/** 车型 */
pickupPricingType: '',
vehicleType: '',
/** 车型计费(元/车) */
price: 0,
},
@ -1091,7 +1112,8 @@ const handleAdd = () => {
};
/** 给form赋值 */
const initAssignmentForm = data => {
const initAssignmentForm = (data, isLine = true) => {
if (isLine) {
details.form.startCity = [
...new Set([data.startProvinceId + '', data.startCityId + '', data.startCountyId + '']),
];
@ -1101,12 +1123,20 @@ const initAssignmentForm = data => {
details.form.sendOrgId = data.sendOrgId;
details.form.sendOrg = data.sendOrgName;
details.form.priceId = data.priceId;
}
details.form.minCost = data.minCost || 0;
details.form.additionalCost = data.additionalCost || 0;
//
details.VehicleBillingDetal = data.fullVehicle || [];
details.VehicleBillingDetal = data.fullVehicle || [
{
/** 车型 */
vehicleType: '',
/** 车型计费(元/车) */
price: 0,
},
];
for (let i = 0; i < details.VehicleBillingDetal.length; i++) {
const value = details.VehicleBillingDetal[i];
@ -1169,7 +1199,7 @@ const handleEdit = async ({ row }) => {
details.VehicleBillingDetal = [
{
/** 车型 */
pickupPricingType: '',
vehicleType: '',
/** 车型计费(元/车) */
price: 0,
},
@ -1240,24 +1270,14 @@ const resetFormData = () => {
/** 提交 */
const handleSubmit = async () => {
if (details.form.pickupPricingType.length === 0) ElMessage.error('请选择计价方式');
let isRetrun = false;
await formRef.value.validate(valid => {
// if (!valid) return;
console.log('222 :>> ', 222);
isRetrun = !valid;
});
if (isRetrun) return;
ElMessageBox.confirm('确认提交', '', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'success',
}).then(async () => {
try {
details.loadingObj.pageLoading = true;
const submitData: any = {
checkType: '1',
@ -1283,9 +1303,25 @@ const handleSubmit = async () => {
//
else if (item.code === '4') submitData.pickup.weightCategory = item.categories;
}
//
if (details.form.pickupPricingType.includes('2'))
if (details.form.pickupPricingType.includes('2')) {
for (let i = 0; i < details.VehicleBillingDetal.length; i++) {
const value = details.VehicleBillingDetal[i];
if (!value.vehicleType) return ElMessage.warning('存在未选车型, 请选择车型');
}
submitData.pickup.fullVehicle = details.VehicleBillingDetal;
}
ElMessageBox.confirm('确认提交', '', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'success',
}).then(async () => {
try {
details.loadingObj.pageLoading = true;
const res = await putBasicdataPrice(submitData);
@ -1304,17 +1340,15 @@ const handleSubmit = async () => {
};
/** 提货线路提交 */
const handleSubmitLine = () => {
ElMessageBox.confirm('确认提交', '', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'success',
}).then(async () => {
try {
details.popUpShow.addVsitied = false; //
details.loadingObj.pageLoading = true; // loading
const handleSubmitLine = async () => {
let isRetrun = false;
console.log('details.form :>> ', details.form);
await lineFormRef.value.validate(valid => {
// if (!valid) return;
isRetrun = !valid;
});
if (isRetrun) return;
const submitData: any = {
startProvinceId: details.form.startProvinceId, //
@ -1350,9 +1384,28 @@ const handleSubmitLine = () => {
//
else if (item.code === '4') submitData.weightCategory = item.categories;
}
//
if (details.form.pickupPricingType.includes('2'))
if (details.form.pickupPricingType.includes('2')) {
for (let i = 0; i < details.VehicleBillingDetal.length; i++) {
const value = details.VehicleBillingDetal[i];
if (!value.vehicleType) return ElMessage.warning('存在未选车型, 请选择车型');
}
submitData.fullVehicle = details.VehicleBillingDetal;
}
ElMessageBox.confirm('确认提交', '', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'success',
}).then(async () => {
try {
details.popUpShow.addVsitied = false; //
details.loadingObj.pageLoading = true; // loading
console.log('details.form :>> ', details.form);
const res = await postSubmit(submitData);

1646
src/views/Pricesystem/Price/PriceTrunkLine.vue

File diff suppressed because it is too large Load Diff

51
src/views/Pricesystem/PricesyHome.vue

@ -2,14 +2,20 @@
<basic-container v-loading="pageLoading">
<!-- 模板内容 -->
<div class="content">
<el-tabs type="border-card" v-model="Tabmenu">
<el-tabs type="border-card" @tab-click="handleClick" v-model="Tabmenu">
<template v-for="item in ServiceList" :key="item.label">
<el-tab-pane :name="item.label" v-if="item.state" :label="item.label">
<span v-if="item.label == '提货'"
><FinancialBill ref="financialBill" :templateData="templateInfo"
><FinancialBill
@request-data="provideData"
ref="financialBill"
:templateData="templateInfo"
/></span>
<span v-if="item.label == '干线'"
><FinancialTrunkLine @request-data="provideData" :templateData="templateInfo"
><FinancialTrunkLine
ref="financialTrunkLine"
@request-data="provideData"
:templateData="templateInfo"
/></span>
<span v-if="item.label == '仓储'"
><FinancialWarehousing @request-data="provideData" :templateData="templateInfo"
@ -30,6 +36,7 @@ import { ref, defineAsyncComponent } from 'vue';
import { getDictionaryBiz } from '@/api/system/dict'; //
import { $_basicdataBrande } from '@/api/financialsector/index'; //
import { $_InfopriceTemplate as getInfo, getBasicdataPrice } from '@/api/Pricesystem/index.js';
import { getLazyTreeAll } from '@/api/base/region';
import { $_InfopriceTemplate } from '@/api/financialsector/index.js';
import { useRoute } from 'vue-router';
import { nextTick } from 'vue';
@ -61,6 +68,8 @@ const VehicleTypeList = ref([]);
const financialBill = ref();
const financialTrunkLine = ref();
//
function updateDictionary(targetArray, dictionaryType) {
getDictionaryBiz(dictionaryType)
@ -112,16 +121,31 @@ const onLoad = async () => {
try {
pageLoading.value = true;
const PromiseAll = [
/** 服务类型 */
updateDictionary(ServiceList.value, 'service_type'),
/** 车辆类型 */
updateDictionary(VehicleTypeList.value, 'price_vehicle_type'),
];
// const PromiseAll = [
// /** */
// updateDictionary(VehicleTypeList.value, 'price_vehicle_type'),
// ];
await Promise.all(PromiseAll);
// await Promise.all(PromiseAll);
// 线
const trunkLinePromise = getDictionaryBiz('trunk_line_pricing_type');
//
const priceVehiclePromise = getDictionaryBiz('price_vehicle_type');
const regionOptionePromise = await getLazyTreeAll();
const [trunkLineResult, priceVehicleResult, regionOptione] = await Promise.all([
trunkLinePromise,
priceVehiclePromise,
regionOptionePromise,
/** 服务类型 */
updateDictionary(ServiceList.value, 'service_type'),
]);
form.value.trunkLineResult = trunkLineResult;
form.value.priceVehicleResult = priceVehicleResult;
form.value.regionOptione = regionOptione;
console.log('VehicleTypeList :>> ', VehicleTypeList);
let data = {
@ -135,7 +159,7 @@ const onLoad = async () => {
console.log(res, '获取详情');
form.value.TemplateName = data.name || ''; //
form.value.ServiceType = data.serviceType.split(',') || []; //
form.value.request=data
form.value.request = data;
form.value.request = data;
console.log('form.value.ServiceType :>> ', form.value.ServiceType);
const result = ServiceList.value.filter(item => form.value.ServiceType.includes(item.value));
@ -147,6 +171,7 @@ const onLoad = async () => {
setTimeout(() => {
console.log('financialBill :>> ', financialBill);
financialBill.value[0].initDictionaryBiz();
financialTrunkLine.value[0].initDictionaryBiz();
}, 1000);
});
} catch (error) {
@ -188,6 +213,10 @@ const provideData = data => {
templateInfo.value.code = data; //
}
};
const handleClick = (tab, event) => {
console.log(tab, event);
};
</script>
<style scoped lang="scss">

9
src/views/distribution/artery/AddVehicleStowage.vue

@ -158,11 +158,7 @@
<!-- 装车方式 -->
<div class="form_row_item">
<el-form-item inline label="装车方式" prop="loadingType">
<el-radio-group
v-model="form.loadingType"
:disabled="Number(details.pageType) !== 1"
class="ml-4"
>
<el-radio-group v-model="form.loadingType" class="ml-4">
<el-radio label="1" size="large">手动装车(后台)</el-radio>
<el-radio label="2" size="large">扫描装车</el-radio>
</el-radio-group>
@ -175,7 +171,7 @@
<!-- 经办人 -->
<div class="form_row_item">
<el-form-item inline label="经办人">
<el-input v-model="userInfo.user_name" readonly />
<el-input v-model="form.operator" readonly />
</el-form-item>
</div>
@ -962,6 +958,7 @@ const onLoad = async () => {
details.nodeInfoData = handleEditForbidden(details.nodeInfoData);
details.form.startWarehouseName = data.startWarehouseInfo.warehouseName;
details.form.startWarehouseId = data.startWarehouseInfo.warehouseId;
details.form.operator = userInfo.value.nick_name;
}
//
else {

23
src/views/financialsector/Financialse/FinancialBill.vue

@ -25,7 +25,13 @@
</el-form-item>
<!-- 是否统一区域计费 -->
<el-form-item label="是否统一区域计费">
<el-form-item
label="是否统一区域计费"
prop="pickupIsUnifyAreaBill"
:rules="[
{ required: true, message: '请选择是否统一区域计费', trigger: ['blur', 'change'] },
]"
>
<el-radio-group v-model="details.form.pickupIsUnifyAreaBill" class="ml-4">
<el-radio
v-for="item in details.isType"
@ -38,7 +44,11 @@
</el-form-item>
<!-- 是否区分品类 -->
<el-form-item label="是否区分品类">
<el-form-item
label="是否区分品类"
prop="pickupIsByCategory"
:rules="[{ required: true, message: '请选择是否区分品类', trigger: ['blur', 'change'] }]"
>
<el-radio-group v-model="details.form.pickupIsByCategory" class="ml-4">
<el-radio
v-for="item in details.isType"
@ -120,7 +130,12 @@
</template>
<!-- 是否最低计费 -->
<el-form-item label-width="150px" label="是否最低计费">
<el-form-item
label-width="150px"
label="是否最低计费"
prop="pickupIsMinCost"
:rules="[{ required: true, message: '请选择是否最低计费', trigger: ['blur', 'change'] }]"
>
<el-radio-group v-model="details.form.pickupIsMinCost" class="ml-4">
<el-radio v-for="item in details.isType" :key="item.value" :label="item.value" size="large"
>{{ item.label }}
@ -133,6 +148,8 @@
v-if="details.form.pickupIsMinCost === '1'"
label-width="150px"
label="最低计费类型"
prop="pickupMinCostType"
:rules="[{ required: true, message: '请选择最低计费类型', trigger: ['blur', 'change'] }]"
>
<el-radio-group v-model="details.form.pickupMinCostType" class="ml-4">
<template v-for="item in details.lowestType" :key="item.value">

51
src/views/financialsector/Financialse/FinancialTrunkLine.vue

@ -25,7 +25,13 @@
</el-form-item>
<!-- 是否统一区域计费 -->
<el-form-item label="是否统一区域计费">
<el-form-item
label="是否统一区域计费"
prop="trunklineIsUnifyAreaBill"
:rules="[
{ required: true, message: '请选择是否统一区域计费', trigger: ['blur', 'change'] },
]"
>
<el-radio-group v-model="details.form.trunklineIsUnifyAreaBill" class="ml-4">
<el-radio
v-for="item in details.isType"
@ -38,7 +44,11 @@
</el-form-item>
<!-- 是否区分品类 -->
<el-form-item label="是否区分品类">
<el-form-item
label="是否区分品类"
prop="trunklineIsByCategory"
:rules="[{ required: true, message: '请选择是否区分品类', trigger: ['blur', 'change'] }]"
>
<el-radio-group v-model="details.form.trunklineIsByCategory" class="ml-4">
<el-radio
v-for="item in details.isType"
@ -49,8 +59,6 @@
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template v-if="details.form.trunklineIsByCategory === '1'">
<el-divider content-position="left">品类管理</el-divider>
@ -121,20 +129,39 @@
<el-divider content-position="left">特殊计费</el-divider>
<!-- 是否特殊配置 -->
<el-form-item label-width="150px" label="是否特殊配置">
<el-form-item
label-width="150px"
label="是否特殊配置"
prop="trunklineIsPeculiarSetup"
:rules="[{ required: true, message: '请选择是否特殊配置', trigger: ['blur', 'change'] }]"
>
<el-radio-group v-model="details.form.trunklineIsPeculiarSetup" class="ml-4">
<el-radio v-for="item in details.isType" :key="item.value" :label="item.value" size="large"
<el-radio
v-for="item in details.isType"
:key="item.value"
:label="item.value"
size="large"
>{{ item.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<template v-if="details.form.trunklineIsPeculiarSetup === '0'">
<el-divider content-position="left">一般计费</el-divider>
<!-- 是否最低计费 -->
<el-form-item label-width="150px" label="是否最低计费">
<el-form-item
label-width="150px"
label="是否最低计费"
prop="trunklineIsMinCost"
:rules="[{ required: true, message: '请选择是否最低计费', trigger: ['blur', 'change'] }]"
>
<el-radio-group v-model="details.form.trunklineIsMinCost" class="ml-4">
<el-radio v-for="item in details.isType" :key="item.value" :label="item.value" size="large"
<el-radio
v-for="item in details.isType"
:key="item.value"
:label="item.value"
size="large"
>{{ item.label }}
</el-radio>
</el-radio-group>
@ -145,11 +172,15 @@
v-if="details.form.trunklineIsMinCost === '1'"
label-width="150px"
label="最低计费类型"
prop="trunklineMinCostType"
:rules="[{ required: true, message: '请选择最低计费类型', trigger: ['blur', 'change'] }]"
>
<el-radio-group v-model="details.form.trunklineMinCostType" class="ml-4">
<template v-for="item in details.lowestType" :key="item.value">
<el-radio
v-if="!item.MappingOrNot || details.form.trunklinePricingType.includes(item.mapValue)"
v-if="
!item.MappingOrNot || details.form.trunklinePricingType.includes(item.mapValue)
"
:label="item.dictKey"
size="large"
>{{ item.dictValue }}
@ -161,6 +192,8 @@
</template>
</el-radio-group>
</el-form-item>
</template>
</el-form>
<!-- 操作按钮 -->
<div class="flex-c-c">

Loading…
Cancel
Save