马远东 12 months ago
parent
commit
663fb334eb
  1. 296
      src/views/Pricesystem/Price/PriceBill.vue
  2. 60
      src/views/distribution/reservation/reservation.vue

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

@ -72,6 +72,7 @@
:min="0"
/>
</td>
<!-- 新增 && 删除 -->
<td>
<el-button
v-if="index === 0"
@ -241,6 +242,22 @@
</template>
</template>
</tablecmt>
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div></div>
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="details.page.current"
:page-sizes="[30, 50, 80, 120]"
:page-size="details.page.size"
layout="total, sizes, prev, pager, next, jumper"
:total="details.page.total"
>
</el-pagination>
</div>
</template>
</div>
@ -258,6 +275,7 @@
style="width: 100%"
v-model="details.form.startCity"
filterable
@change="value => handleChangeCity(value, 'start')"
clearable
>
<template #default="{ node, data }">
@ -273,6 +291,7 @@
:options="details.regionOptione"
style="width: 100%"
v-model="details.form.endCity"
@change="value => handleChangeCity(value, 'end')"
filterable
clearable
>
@ -284,15 +303,6 @@
</el-form-item>
<el-form-item label="发货单位">
<el-select class="w100" v-model="details.form.sendOrgId" clearable placeholder="请选择车型">
<el-option
v-for="item in details.priceMethodType"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey"
/>
</el-select>
<el-select
class="w100"
v-model="details.form.sendOrgId"
@ -300,7 +310,7 @@
clearable
placeholder="请选择发货单位"
style="width: 240px"
:loading="details.form.loading"
:loading="details.loadingObj.loading"
remote
reserve-keyword
default-first-option
@ -308,9 +318,9 @@
>
<el-option
v-for="val in details.sendOrgArr"
:key="val.goodsId"
:label="val.goodsName"
:value="val.goodsId"
:key="val.id"
:label="val.clientName"
:value="val.id"
/>
</el-select>
</el-form-item>
@ -490,10 +500,10 @@
</el-form>
</template>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="details.popUpShow.addVsitied = false"> </el-button>
<el-button type="primary" @click="handleSubmit"> </el-button>
</span>
<div slot="footer" class="dialog-footer mt10">
<el-button icon="CircleClose" @click="details.popUpShow.addVsitied = false"> </el-button>
<el-button type="primary" icon="Position" @click="handleSubmitLine"> </el-button>
</div>
</el-dialog>
</template>
@ -503,8 +513,9 @@ import { getLazyTreeAll } from '@/api/base/region';
import { debounce, deepClone } from '@/utils/util';
import { ElMessage, ElMessageBox } from 'element-plus';
import { getDictionaryBiz } from '@/api/system/dict';
import { putBasicdataPrice } from '@/api/Pricesystem/index';
import { putBasicdataPrice, getPage, postSubmit } from '@/api/Pricesystem/index';
import { useRoute } from 'vue-router';
import { getList } from '@/api/basicdata/basicClient';
const $route = useRoute(); //
const instance = getCurrentInstance();
@ -592,10 +603,12 @@ const details = reactive({
loadingObj: {
pageLoading: false,
list: false,
loading: false,
},
popUpShow: {
addVsitied: false,
},
/** 提货路线表格表头 */
columnList: [
// {
// prop: '',
@ -650,7 +663,18 @@ const details = reactive({
head: false,
},
],
/** 提货线路数据 */
data: [],
/** 提货线路分页参数 */
page: {
/** 当前页 */
current: 1,
/** 每页页数 */
size: 30,
/** 总数 */
total: 0,
},
/** 发货单位数组 */
sendOrgArr: [],
});
@ -816,6 +840,9 @@ const initDictionaryBiz = async () => {
details.form.pickupIsMinCost += '';
details.form.minCost = 0;
details.form.additionalCost = 0;
// ,
if (details.form.pickupIsUnifyAreaBill === '0') initLineData();
}
// 线
@ -877,8 +904,98 @@ const handleCheckVehicleType = () => {
}
};
/** 获取提货路径数据 */
const initLineData = async () => {
try {
details.loadingObj.list = true;
const res = await getPage({ ...details.page });
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.list = false;
}
};
/** 页数改变 */
const sizeChange = size => {
details.page.size = size;
details.page.current = 1;
initLineData();
};
/** 页码改变 */
const currentChange = current => {
details.page.current = current;
initLineData();
};
/** 城市改变 */
const handleChangeCity = (CascaderValue: any[] | null, type: 'strat' | 'end') => {
console.log('CascaderValue :>> ', CascaderValue);
//
switch (type) {
case 'strat':
if (!CascaderValue) {
details.form.startProvinceId = ''; //
details.form.startCityId = ''; //
details.form.startCountyId = ''; //
}
if (CascaderValue.length === 1) {
details.form.startProvinceId = CascaderValue[0]; //
details.form.startCityId = CascaderValue[0]; //
details.form.startCountyId = CascaderValue[0]; //
} else if (CascaderValue.length === 2) {
details.form.startProvinceId = CascaderValue[0]; //
details.form.startCityId = CascaderValue[0]; //
details.form.startCountyId = CascaderValue[1]; //
} else {
details.form.startProvinceId = CascaderValue[0]; //
details.form.startCityId = CascaderValue[1]; //
details.form.startCountyId = CascaderValue[2]; //
}
break;
case 'end':
if (!CascaderValue) {
details.form.endProvinceId = ''; //
details.form.endCityId = ''; //
details.form.startCountyId = ''; //
}
if (CascaderValue.length === 1) {
details.form.endProvinceId = CascaderValue[0]; //
details.form.endCityId = CascaderValue[0]; //
details.form.endCountyId = CascaderValue[0]; //
} else if (CascaderValue.length === 2) {
details.form.endProvinceId = CascaderValue[0]; //
details.form.endCityId = CascaderValue[0]; //
details.form.endCountyId = CascaderValue[1]; //
} else {
details.form.endProvinceId = CascaderValue[0]; //
details.form.endCityId = CascaderValue[1]; //
details.form.endCountyId = CascaderValue[2]; //
}
break;
default:
break;
}
};
/** 新增提货路径 */
const handleAdd = () => {
details.VehicleBillingDetal = [
{
/** 车型 */
pickupPricingType: '',
/** 车型计费(元/车) */
price: 0,
},
];
details.form = deepClone(details.initForm);
details.popUpShow.addVsitied = true;
};
@ -888,13 +1005,13 @@ const remoteMethod = async value => {
if (!value) return;
details.loadingObj.loading = true;
const response = await postFindCategoryInfo({ goodsName: value });
const response = await getList(1, 10, { clientName: value });
const { code, data } = response.data;
if (code !== 200) return;
details.sendOrgArr = data || [];
details.sendOrgArr = data.records || [];
} catch (error) {
console.log('error :>> ', error);
} finally {
@ -932,48 +1049,117 @@ const handleSubmit = async () => {
});
if (isRetrun) return;
ElMessageBox.confirm('确认提交', '', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'success',
}).then(async () => {
try {
details.loadingObj.pageLoading = true;
const submitData: any = {
checkType: '1',
id: $route.query.id,
pickup: {},
};
console.log('123 :>> ', 123);
try {
details.loadingObj.pageLoading = true;
//
if (details.form.pickupIsMinCost === '1') {
submitData.pickup.minCost = details.form.minCost;
submitData.pickup.additionalCost = details.form.additionalCost;
}
const submitData: any = {
checkType: '1',
id: $route.query.id,
pickup: {},
};
for (let i = 0; i < details.form.billTemplateDetail.length; i++) {
const item = details.form.billTemplateDetail[i];
//
if (details.form.pickupIsMinCost === '1') {
submitData.pickup.minCost = details.form.minCost;
submitData.pickup.additionalCost = details.form.additionalCost;
}
if (!details.form.pickupPricingType.includes(item.code)) continue;
for (let i = 0; i < details.form.billTemplateDetail.length; i++) {
const item = details.form.billTemplateDetail[i];
//
if (item.code === '1') submitData.pickup.pieceCategory = item.categories;
//
else if (item.code === '3') submitData.pickup.cubeCategory = item.categories;
//
else if (item.code === '4') submitData.pickup.weightCategory = item.categories;
}
//
if (details.form.pickupPricingType.includes('2'))
submitData.pickup.fullVehicle = details.VehicleBillingDetal;
if (!details.form.pickupPricingType.includes(item.code)) continue;
const res = await putBasicdataPrice(submitData);
//
if (item.code === '1') submitData.pickup.pieceCategory = item.categories;
//
else if (item.code === '3') submitData.pickup.cubeCategory = item.categories;
//
else if (item.code === '4') submitData.pickup.weightCategory = item.categories;
const { code, msg } = res.data;
if (code !== 200) return;
ElMessage.success(msg);
console.log('submitData :>> ', submitData);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
//
if (details.form.pickupPricingType.includes('2'))
submitData.pickup.fullVehicle = details.VehicleBillingDetal;
});
};
/** 提货线路提交 */
const handleSubmitLine = () => {
ElMessageBox.confirm('确认提交', '', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'success',
}).then(async () => {
try {
details.loadingObj.pageLoading = true;
const submitData: any = {
startProvinceId: details.form.startProvinceId, //
startCityId: details.form.startCityId, //
startCountyId: details.form.startCountyId, // ,
endProvinceId: details.form.endProvinceId, //
endCityId: details.form.startCityId, //
endCountyId: details.form.endCountyId, // ,
/** 提货 */
serviceType: '1',
id: $route.query.id,
sendOrgId: details.form.sendOrgId,
};
const res = await putBasicdataPrice(submitData);
//
if (details.form.pickupIsMinCost === '1') {
submitData.minCost = details.form.minCost;
submitData.additionalCost = details.form.additionalCost;
}
const { code, data } = res.data;
console.log('submitData :>> ', submitData);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
for (let i = 0; i < details.form.billTemplateDetail.length; i++) {
const item = details.form.billTemplateDetail[i];
if (!details.form.pickupPricingType.includes(item.code)) continue;
//
if (item.code === '1') submitData.pieceCategory = item.categories;
//
else if (item.code === '3') submitData.cubeCategory = item.categories;
//
else if (item.code === '4') submitData.weightCategory = item.categories;
}
//
if (details.form.pickupPricingType.includes('2'))
submitData.fullVehicle = details.VehicleBillingDetal;
const res = await postSubmit(submitData);
const { code, msg } = res.data;
if (code !== 200) return;
ElMessage.success(msg);
console.log('submitData :>> ', submitData);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
});
};
defineExpose({ initDictionaryBiz });
@ -1142,4 +1328,8 @@ defineExpose({ initDictionaryBiz });
font-weight: bold;
cursor: pointer;
}
.dialog-footer {
text-align: end;
}
</style>

60
src/views/distribution/reservation/reservation.vue

@ -1019,6 +1019,7 @@ export default {
},
editsolt(scope) {
const { row } = scope;
this.$store.commit('DEL_ONCE_TAG', '/distribution/reservation/reservationAddFrom');
this.$router.push({
path: '/distribution/reservation/reservationAddFrom',
query: {
@ -1303,12 +1304,14 @@ export default {
});
},
handleAdd() {
this.$store.commit('DEL_ONCE_TAG', '/distribution/reservation/reservationAddFrom');
this.$router.push({
path: '/distribution/reservation/reservationAddFrom',
});
},
handleEdit(row) {
console.log(row);
this.$store.commit('DEL_ONCE_TAG', '/distribution/reservation/reservationAddFrom');
this.$router.push({
path: '/distribution/reservation/reservationAddFrom',
query: {
@ -1341,51 +1344,20 @@ export default {
return;
}
let ids = [];
this.selectionList.forEach(item => {
if (item.id) {
ids.push(item.id);
}
});
ids = ids.join(',');
this.$router.push({
path: '/distribution/turndelivery/deliveryMarket',
query: {
id: ids,
name: '市配计划',
},
});
return
const data = JSON.parse(localStorage.getItem('MapState'));
console.log(data, '选择地图');
if (data) {
let ids = [];
this.selectionList.forEach(item => {
if (item.id) {
ids.push(item.id);
}
});
ids = ids.join(',');
if (data.checkedMap && data.MapState) {
this.$router.push({
path: '/distribution/reservation/atlas',
query: {
id: ids,
type: '1',
},
});
} else {
this.$router.push({
path: '/distribution/turndelivery/deliveryMarket',
query: {
id: ids,
name: '市配计划',
},
});
this.selectionList.forEach(item => {
if (item.id) {
ids.push(item.id);
}
} else {
//
this.dialogatlas = true; //
}
});
ids = ids.join(',');
this.$router.push({
path: '/distribution/turndelivery/deliveryMarket',
query: {
id: ids,
name: '市配计划',
},
});
return;
// console.log(">>>>>>>>>>",ids);
},

Loading…
Cancel
Save