Browse Source

取消自提限制

dev-xx
马远东 11 months ago
parent
commit
0f096761aa
  1. 91
      src/views/Pricesystem/Price/PriceDelivery.vue
  2. 400
      src/views/Pricesystem/Price/PriceWarehousing.vue
  3. 15
      src/views/Pricesystem/PricesyHome.vue
  4. 10
      src/views/distribution/inventory/distrilbutionBillLading.vue

91
src/views/Pricesystem/Price/PriceDelivery.vue

@ -4,10 +4,41 @@
<div class="el_row_1">
<div class="el_flex_row">
<el-form-item label="配送服务类型">
<el-input v-model="form.name" disabled placeholder="自动带出无法更改" />
<el-select
class="el_Cselect"
style="width: 100%;"
v-model="form.dispatchServiceType"
filterable
placeholder="选择计费类型"
disabled
@change="chargetype"
>
<el-option
v-for="item in Warehousebillingmode"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="计费模式">
<el-input v-model="form.region" disabled placeholder="自动带出无法更改" />
<el-select
v-model="form.dispatchPricingType"
filterable
placeholder="请选择配送计费模式"
:popper-append-to-body="false"
style="width:100%;"
disabled
multiple
>
<el-option
v-for="item in ServiceList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</div>
</div>
@ -298,8 +329,26 @@
</template>
<script setup>
import { ref } from 'vue';
import { ref , defineEmits, defineComponent} from 'vue';
import SurchargeTable from '@/components/pric/tablePric.vue';
import { putBasicdataPrice } from '@/api/Pricesystem/index';
import { useRoute } from 'vue-router';
import { deepClone } from '@/utils/util';
import { getDictionaryBiz } from '@/api/system/dict'; //
const $route = useRoute(); //
const emit = defineEmits(['request-data']);
defineComponent({
emits: ['request-data'],
});
//
const props = defineProps({
templateData: Object,
});
console.log(props, '来自父页面参数');
const ServiceList=ref([])
const requestInfo = ref({}); //
const request=ref({})
const Warehousebillingmode=ref([]);//
const form = ref({
//
perpieceBilling: [
@ -494,7 +543,7 @@ const form = ref({
disabled: true,
},
{
label: '遗留件最低计费方数',
label: '遗留件最低计费重量',
input: 0,
disabled: true,
},
@ -510,7 +559,39 @@ const form = ref({
},
],
});
function updateDictionary(targetArray, dictionaryType) {
getDictionaryBiz(dictionaryType)
.then(res => {
console.log(res, '字典');
if (res.data.code == 200) {
if (res.data.data.length) {
res.data.data.forEach(item => {
targetArray.push({
value: Number(item.dictKey),
label: item.dictValue,
id: item.id,
});
});
}
}
})
.catch(() => {})
.finally(() => {});
}
const onLoad= async()=>{
await updateDictionary(Warehousebillingmode.value, 'dispatch_type'); //
await updateDictionary(ServiceList.value, 'dispatch_pricing_type'); //
if(props.templateData.request){
console.log(props.templateData.request,'props.templateData.request');
request.value =await deepClone(props.templateData.request)
form.value.dispatchServiceType= request.value.dispatchServiceType;//
form.value.dispatchPricingType = request.value.dispatchPricingType
? request.value.dispatchPricingType.split(',').map(Number)
: []; //
}
}
onLoad()
const btn = () => {
console.log(form.value);
};

400
src/views/Pricesystem/Price/PriceWarehousing.vue

@ -60,52 +60,56 @@
<div class="el_sever_title">
<span> 附加费用</span>
</div>
<span class="Subtitle">统一计费单价</span>
<div class="el_row_2_1">
<div class="el_flex_row">
<el-form-item
label="仓储操作/装卸费"
class="el_lable_title"
v-if="request.warehouseIsOperateFee"
>
<el-input-number
v-model="form.operatePrice"
:precision="2"
:min="0"
:max="10"
:controls="false"
placeholder="请输入价格"
/>
</el-form-item>
<el-form-item
label="仓储管理费"
style="margin-top: 10px"
v-if="request.warehouseIsManageFee"
>
<el-input-number
v-model="form.warehouseManagementPrice"
:precision="2"
:min="0"
:max="10"
:controls="false"
placeholder="请输入价格"
/>
</el-form-item>
</div>
<div class="el_flex_row" style="margin-top: 10px" v-if="request.warehouseIsSortFee">
<el-form-item label="仓储分货费">
<el-input-number
v-model="form.warehouseSortPrice"
:precision="2"
:min="0"
:max="10"
:controls="false"
placeholder="请输入价格"
/>
</el-form-item>
<div v-if="!request.warehouseIsCategorySubjoin">
<span class="Subtitle">统一计费单价</span>
<div class="el_row_2_1">
<div class="el_flex_row">
<el-form-item
label="仓储操作/装卸费"
class="el_lable_title"
v-if="request.warehouseIsOperateFee"
>
<el-input-number
v-model="form.operatePrice"
:precision="2"
:min="0"
:max="10"
:controls="false"
placeholder="请输入价格"
/>
</el-form-item>
<el-form-item
label="仓储管理费"
style="margin-top: 10px"
v-if="request.warehouseIsManageFee"
>
<el-input-number
v-model="form.warehouseManagementPrice"
:precision="2"
:min="0"
:max="10"
:controls="false"
placeholder="请输入价格"
/>
</el-form-item>
</div>
<div class="el_flex_row" style="margin-top: 10px" v-if="request.warehouseIsSortFee">
<el-form-item label="仓储分货费">
<el-input-number
v-model="form.warehouseSortPrice"
:precision="2"
:min="0"
:max="10"
:controls="false"
placeholder="请输入价格"
/>
</el-form-item>
</div>
</div>
</div>
</div>
<!-- 品类计费单价 -->
<div class="el_row" style="width: 50%" v-if="request.warehouseIsCategorySubjoin">
<el-form-item label="品类计费单价">
@ -158,7 +162,7 @@
</el-form-item>
</div> -->
<div class="el_row">
<span class="Subtitle">{{tabform.title}}</span>
<span class="Subtitle">{{ tabform.title }}</span>
<el-form-item :label="tabform.table" class="el_lable_title">
<SurchargeTable :SurchargeData="form.publicData" :Surcharge="form.publicTable" />
</el-form-item>
@ -178,6 +182,12 @@ 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 { putBasicdataPrice } from '@/api/Pricesystem/index';
import { useRoute } from 'vue-router';
import { valid } from 'mockjs';
import page from '@/router/page';
const $route = useRoute(); //
const emit = defineEmits(['request-data']);
defineComponent({
emits: ['request-data'],
@ -187,10 +197,11 @@ const props = defineProps({
templateData: Object,
});
console.log(props, '来自父页面参数');
const tabform=ref({
table:'',
title:''
})
const tabform = ref({
table: '',
title: '',
});
const requestInfo = ref({}); //
const Storagebillingtype = ref([]);
const Warehousebillingmode = ref([]);
const CalculationBasis = ref([]);
@ -246,7 +257,7 @@ const form = ref({
disabled: true,
},
],
SurchargeData: [ ],
SurchargeData: [],
//
publicTable: [
{ label: '序号', prop: 'index', type: 'string', width: '80', disabled: true },
@ -281,21 +292,23 @@ const form = ref({
},
],
publicData: [ ],
publicData: [],
});
const onLoad = async () => {
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) {
request.value = await deepClone(props.templateData.request);
form.value.warehousePricingType = request.value.warehousePricingType; //
form.value.warehousePricingMode = request.value.warehousePricingMode; //
form.value.warehouseCalculationBasis = request.value.warehouseCalculationBasis; //
//
if (request.value.warehouseIsCategorySubjoin) {
console.log('有附加品类');
if (
request.value.warehouseSubjoinCategorys &&
request.value.warehouseSubjoinCategorys.length
@ -317,91 +330,94 @@ const onLoad = async () => {
});
});
}
}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
}
form.value.publicData=[];//
form.value.publicData = []; //
//
function updateLabelsWithUnit(unit, labelsMap) {
form.value.publicTable.forEach(res => {
if (labelsMap[res.label]) {
res.label = labelsMap[res.label] + unit;
form.value.publicTable.forEach(res => {
if (labelsMap[res.label]) {
res.label = labelsMap[res.label] + unit;
}
});
}
});
}
function handleFormUpdate(disableIndexAndCategory, unitLabel, tableTitle, perPiece=false) {
const unitMapping = {
'按件计费': `${unitLabel}/件`,
'按重量计费(t)': `${unitLabel}/KG`,
'按吨计费(t)': `${unitLabel}/t`,
};
const unit = unitMapping[tableTitle] || unitLabel;
function handleFormUpdate(disableIndexAndCategory, unitLabel, tableTitle, perPiece = false) {
const unitMapping = {
按件计费: `${unitLabel}/件`,
'按重量计费(t)': `${unitLabel}/KG`,
'按吨计费(t)': `${unitLabel}/t`,
};
updateLabelsWithUnit(unit, {
'30天内': '30天内',
'30天-60天': '30天-60天',
'60天外': '60天外',
'上限': '上限'
});
const unit = unitMapping[tableTitle] || unitLabel;
tabform.value.title = tableTitle;
tabform.value.table = perPiece ? '按件计费品类单价' : '统一计费单价';
// Disable or enable index and category based on 'perPiece' value
form.value.publicTable.find(res => res.prop === 'index').disabled = disableIndexAndCategory;
form.value.publicTable.find(res => res.prop === 'categoryId').disabled = disableIndexAndCategory;
updateLabelsWithUnit(unit, {
'30天内': '30天内',
'30天-60天': '30天-60天',
'60天外': '60天外',
上限: '上限',
});
if (request.value.warehouseIsByCategory) {
request.value.warehousePieceCategorys.forEach((res, index) => {
form.value.publicData.push(createPublicDataEntry(index, res.id, res.name));
});
} else {
form.value.publicData = [createEmptyPublicDataEntry()];
}
}
tabform.value.title = tableTitle;
tabform.value.table = perPiece ? '按件计费品类单价' : '统一计费单价';
form.value.publicTable.find(res => res.prop === 'index').disabled = disableIndexAndCategory;
form.value.publicTable.find(res => res.prop === 'categoryId').disabled =
disableIndexAndCategory;
function createPublicDataEntry(index, categoryId, categoryName) {
return {
index: index + 1,
categoryId: categoryId,
withinThirtyPrice: 0,
betweenThirtySixtyPrice: 0,
beyondSixtyPrice: 0,
maximumPrice: 0,
options: [{ label: categoryName, value: categoryId }]
};
}
if (request.value.warehouseIsByCategory) {
request.value.warehousePieceCategorys.forEach((res, index) => {
form.value.publicData.push(createPublicDataEntry(index, res.id, res.name));
});
} else {
form.value.publicData = [createEmptyPublicDataEntry()];
}
}
function createEmptyPublicDataEntry() {
return {
withinThirtyPrice: 0,
betweenThirtySixtyPrice: 0,
beyondSixtyPrice: 0,
maximumPrice: 0
};
}
function createPublicDataEntry(index, categoryId, categoryName) {
return {
index: index + 1,
categoryId: categoryId,
withinThirtyPrice: 0,
betweenThirtySixtyPrice: 0,
beyondSixtyPrice: 0,
maximumPrice: 0,
options: [{ label: categoryName, value: categoryId }],
};
}
// Now we can use those functions to simplify the main code.
const unitType = request.value.warehousePricingType;
console.log(unitType,' console.log(unitType);===>');
const isByCategory = request.value.warehouseIsByCategory;
switch (unitType) {
case 1:
handleFormUpdate(isByCategory, '(元/件)', '按件计费');
break;
case 2:
handleFormUpdate(isByCategory, '(元/m³)', '按件计费');
break;
case 3:
handleFormUpdate(isByCategory, '(元/KG)', '按重量计费(t)');
break;
case 4:
handleFormUpdate(isByCategory, '(元/t)', '按吨计费(t)');
break;
}
function createEmptyPublicDataEntry() {
return {
withinThirtyPrice: 0,
betweenThirtySixtyPrice: 0,
beyondSixtyPrice: 0,
maximumPrice: 0,
};
}
const unitType = request.value.warehousePricingType;
console.log(unitType, ' console.log(unitType);===>');
const isByCategory = request.value.warehouseIsByCategory;
switch (unitType) {
case 1:
handleFormUpdate(isByCategory, '(元/件)', '按件计费');
break;
case 2:
handleFormUpdate(isByCategory, '(元/m³)', '按件计费');
break;
case 3:
handleFormUpdate(isByCategory, '(元/KG)', '按重量计费(t)');
break;
case 4:
handleFormUpdate(isByCategory, '(元/t)', '按吨计费(t)');
break;
}
// if(request.value.warehouseSubjoinFeeUnit==4){
// form.value.publicTable.forEach(res=>{
@ -450,16 +466,50 @@ switch (unitType) {
// maximumPrice: 0, //
// }
// ]
// }
// }
// }
}
console.log(request.value, '初始化页面');
};
const price = async () => {
console.log(form.value, 'form===>');
if (Object.keys(requestInfo.value).length > 0) {
if (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;
}
});
}
//
if (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;//
}
});
}
}
console.log(request.value, '初始化页面');
};
onLoad();
const pageonload = async () => {
request.value = await deepClone(props.templateData.request);
requestInfo.value = await deepClone(props.templateData.requestInfo.warehouse);
onLoad(); //
price(); //
};
pageonload();
const Surchargecd = computed(() => {
const {
warehouseIsCategorySubjoin,
@ -479,8 +529,98 @@ const Surchargecd = computed(() => {
}
});
const btn = () => {
console.log(form.value);
//
const handleSubmit = () => {
let data = {
checkType: '3',
id: $route.query.id,
warehouse: {
additionalCategory: [],
catergory: [],
},
};
//
if (request.value.warehouseIsCategorySubjoin) {
form.value.SurchargeData.forEach(res => {
data.warehouse['additionalCategory'].push({
categoryId: res.categoryId, //ID
operatePrice: res.operatePrice, ///
warehouseManagementPrice: res.warehouseManagementPrice, //
warehouseSortPrice: res.warehouseSortPrice, //
});
});
} else {
//
data.warehouse['additionalCategory'].push({
operatePrice: form.value.operatePrice, ///
warehouseManagementPrice: form.value.warehouseManagementPrice, //
warehouseSortPrice: form.value.warehouseSortPrice, //
name: 'fj',
});
}
//
if (request.value.warehouseIsByCategory) {
form.value.publicData.forEach(res => {
data.warehouse['catergory'].push({
betweenThirtySixtyPrice: res.betweenThirtySixtyPrice, // 30-60
beyondSixtyPrice: res.beyondSixtyPrice, // 60
categoryId: res.categoryId, // id
maximumPrice: res.maximumPrice, //
withinThirtyPrice: res.withinThirtyPrice, // 30
});
});
} else {
form.value.publicData.forEach(res => {
data.warehouse['catergory'].push({
betweenThirtySixtyPrice: res.betweenThirtySixtyPrice, // 30-60
beyondSixtyPrice: res.beyondSixtyPrice, // 60
maximumPrice: res.maximumPrice, //
withinThirtyPrice: res.withinThirtyPrice, // 30
});
});
}
console.log(data, 'data===>');
//
if (!request.value.warehouseIsCategorySubjoin) {
//
// data.warehouse['additionalCategory'].push({
// operatePrice: form.value.operatePrice, ///
// warehouseManagementPrice: form.value.warehouseManagementPrice, //
// warehouseSortPrice: form.value.warehouseSortPrice, //
// name: 'fj',
// });
let mox = data.warehouse['additionalCategory'].find(res => res.name == 'fj');
delete mox.name
if (!request.value.warehouseIsManageFee) {
//
delete mox.warehouseManagementPrice;
}
if (!request.value.warehouseIsOperateFee) {
// /
delete mox.operatePrice;
}
if (!request.value.warehouseIsSortFee) {
//
delete mox.warehouseSortPrice;
}
}
putBasicdataPrice(data)
.then(res => {
console.log(res, '保存成功');
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
}
})
.catch(() => {})
.finally(() => {});
};
</script>

15
src/views/Pricesystem/PricesyHome.vue

@ -29,11 +29,10 @@
import { ref, defineAsyncComponent } from 'vue';
import { getDictionaryBiz } from '@/api/system/dict'; //
import { $_basicdataBrande } from '@/api/financialsector/index'; //
import { $_InfopriceTemplate as getInfo } from '@/api/Pricesystem/index.js';
import { $_InfopriceTemplate as getInfo,getBasicdataPrice } from '@/api/Pricesystem/index.js';
import { $_InfopriceTemplate } from '@/api/financialsector/index.js';
import { useRoute } from 'vue-router';
import { nextTick } from 'vue';
const $route = useRoute();
//
@ -101,7 +100,7 @@ const initData = async () => {
const { code, data } = res.data;
if (code !== 200) return;
form.value.requestInfo=data;//
// form.value = data;
} catch (error) {
console.log('error :>> ', error);
@ -112,7 +111,7 @@ const initData = async () => {
const onLoad = async () => {
try {
pageLoading.value = true;
const PromiseAll = [
/** 服务类型 */
updateDictionary(ServiceList.value, 'service_type'),
@ -121,8 +120,8 @@ const onLoad = async () => {
];
await Promise.all(PromiseAll);
initData();
console.log('VehicleTypeList :>> ', VehicleTypeList);
let data = {
@ -140,10 +139,10 @@ const onLoad = async () => {
form.value.request = data;
console.log('form.value.ServiceType :>> ', form.value.ServiceType);
const result = ServiceList.value.filter(item => form.value.ServiceType.includes(item.value));
await initData();
//
executeCheckedResults(result);
await nextTick();
setTimeout(() => {
console.log('financialBill :>> ', financialBill);

10
src/views/distribution/inventory/distrilbutionBillLading.vue

@ -2293,11 +2293,11 @@ export default {
},
//
callFordelivery(inde) {
if (!this.selectionList.length) {
console.log(this.selectionListStock, '23');
this.$message.warning('至少选择一条数据!');
return;
}
// if (!this.selectionList.length) {
// console.log(this.selectionListStock, '23');
// this.$message.warning('');
// return;
// }
let isa = false;
this.selectionList.some(i => {
if (parseInt(i.inventoryQuantity) > parseInt(i.quantityStock)) {

Loading…
Cancel
Save