Browse Source

修复编辑配送无筛选问题

master
qb 1 year ago
parent
commit
27cc8e87c1
  1. 2
      src/views/distribution/artery/AddVehicleStowage.vue
  2. 15
      src/views/distribution/artery/zeroAdditionalRecording.vue
  3. 516
      src/views/distribution/turndelivery/deliveryMarket.vue

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

@ -486,7 +486,7 @@
</div>
</basic-container>
<!-- 包内产品 -->
<!-- 修改计划数量 -->
<el-dialog
title="修改计划数量"
v-model="details.popUpShow.editPlanNumberVisited"

15
src/views/distribution/artery/zeroAdditionalRecording.vue

@ -325,7 +325,7 @@ onMounted(() => {
const timer = setTimeout(() => {
details.listNodeList = document.querySelectorAll('.maboxhi');
details.listNodeList.forEach(_node => {
_node.style.transition = 'all .5s ease-out';
_node.style.transition = 'all .3s ease-out';
});
clearTimeout(timer);
}, 100);
@ -537,8 +537,17 @@ const handleRemoveWaybill = () => {
for (const iterator of details.newSelectionList) {
console.log('111 :>> ', 111);
}
// this.addInfo.newData = [...this.addInfo.newData, ...this.addInfo.oldSelectionList];
// this.addInfo.haveIds = this.addInfo.map(val => val.id);
details.newData = details.newData.filter((val, index) => {
const _flag = !details.newSelectionList.includes(val);
if (!_flag) {
const _code = val.orderCode + ',' + val.waybillNo;
const _index = details.orderCodeList.indexOf(_code);
// +
details.orderCodeList.splice(_index, 1);
}
return _flag;
});
};
/** 零担补录提交 */

516
src/views/distribution/turndelivery/deliveryMarket.vue

@ -3,10 +3,7 @@
<div @click="ccc" :class="aaa ? 'buts check' : 'buts'">自主配送</div>
<div @click="ddd" :class="bbb ? 'buts check' : 'buts'">外协</div>
</div>
<div
style="margin: 2%; background-color: #ffffff; padding: 20px; box-sizing: border-box"
v-if="aaa"
>
<div style="margin: 10px; background-color: #ffffff; box-sizing: border-box" v-if="aaa">
<el-form ref="form" :model="driverForm" label-width="100px" style="margin: 3px">
<el-row>
<el-col :span="6">
@ -66,10 +63,7 @@
</el-form>
</div>
<div
style="margin: 2%; background-color: #ffffff; padding: 20px; box-sizing: border-box"
v-if="bbb"
>
<div style="margin: 10px; background-color: #ffffff; box-sizing: border-box" v-if="bbb">
<el-form ref="form" :model="waixieForm" label-width="100px" style="margin: 3px">
<el-row>
<el-col :span="6">
@ -111,7 +105,7 @@
</el-row>
</el-form>
</div>
<div style="margin: 2%; background-color: #ffffff; padding: 20px; box-sizing: border-box">
<div style="margin: 10px; background-color: #ffffff; box-sizing: border-box">
<el-form ref="form" :model="stockUpForm" label-width="100px" style="margin: 3px">
<el-row>
<!-- <el-col :span="6">-->
@ -263,11 +257,16 @@
</el-row>
</el-form>
</div>
<h3>预约列表</h3>
<el-button type="primary" @click="addReservation"> </el-button>
<div>
<el-row>
<!-- 标题 -->
<el-divider content-position="left">预约列表</el-divider>
<div class="tableBox">
<el-button type="primary" @click="addReservation"> </el-button>
<div class="mt10">
<!-- 表格 -->
<tablecmt
ref="tableBox"
:columnList="columnList"
:tableData="reservationData"
:loading="loading"
@ -288,13 +287,19 @@
>
</template>
</tablecmt>
</el-row>
<el-form-item style="margin-left: 45%; margin-top: 10px">
<el-button type="primary" icon="el-icon-circle-close" @click="onSubmitOrder"
>提交(配送内容)</el-button
>
<el-button icon="el-icon-circle-close" @click="back"> </el-button>
</el-form-item>
<div class="footer"></div>
<div class="button-container">
<el-button icon="el-icon-circle-close" @click="back"> </el-button>
<el-button
type="primary"
icon="Position"
:loading="loadingObj.submitBtnLoading"
@click="onSubmitOrder"
>提交(配送内容)</el-button
>
</div>
</div>
</div>
<el-dialog title="司机配置" v-model="isDriverShow" width="50%">
@ -376,6 +381,7 @@
<el-dialog title="预约池" v-model="reservationDialogVisible" width="70%" height="50%">
<el-row>
<tablecmt
ref="reservationListBox"
:columnList="reservationListColumnList"
:tableData="reservationListData"
:loading="loading"
@ -396,29 +402,27 @@
>
</template>
</tablecmt>
<el-row>
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</el-row>
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</el-row>
<span slot="footer" class="dialog-footer">
<div slot="footer" class="dialog-footer flex-c-c">
<el-button @click="reservationDialogVisible = false"> </el-button>
<el-button type="primary" @click="saveAddReservation"> </el-button>
</span>
<el-button type="primary" icon="Position" @click="saveAddReservation"> </el-button>
</div>
</el-dialog>
<el-dialog title="提示" v-model="dialogVisible" width="30%">
@ -468,6 +472,8 @@ import { getDriverList } from '@/api/basicdata/basicdataDriverArtery';
import { mapGetters } from 'vuex';
import dayjs from 'dayjs';
import { ElMessage } from 'element-plus';
import { setNodeHeight } from '@/utils/util';
import { nextTick } from 'vue';
export default {
data() {
return {
@ -881,6 +887,7 @@ export default {
width: '200',
checkarr: [],
fixed: false,
isshowSummary: true,
sortable: true,
},
{
@ -891,6 +898,7 @@ export default {
width: '200',
checkarr: [],
fixed: false,
isshowSummary: true,
sortable: true,
},
{
@ -901,6 +909,7 @@ export default {
width: '200',
checkarr: [],
fixed: false,
isshowSummary: true,
sortable: true,
},
{
@ -911,6 +920,7 @@ export default {
width: '200',
checkarr: [],
fixed: false,
isshowSummary: true,
sortable: true,
},
{
@ -921,6 +931,7 @@ export default {
width: '200',
checkarr: [],
fixed: false,
isshowSummary: true,
sortable: true,
},
{
@ -931,6 +942,7 @@ export default {
width: '200',
checkarr: [],
fixed: false,
isshowSummary: true,
sortable: true,
},
@ -959,7 +971,6 @@ export default {
pageSize: 30,
total: 40,
},
query: {},
aaa: true,
bbb: false,
@ -1056,6 +1067,10 @@ export default {
isoperation: false,
dialogVisible: false,
dialogVisibleLoading: false,
/** 按钮loading */
loadingObj: {
submitBtnLoading: false,
},
};
},
watch: {
@ -1096,10 +1111,17 @@ export default {
return ids.join(',');
},
},
mounted() {
async mounted() {
this.onLoad(this.page);
await nextTick();
setNodeHeight(this.$refs.tableBox.$el, '600px');
},
methods: {
async setTableHeight() {
await this.$nextTick();
console.log('this.$refs.reservationListBox :>> ', this.$refs);
setNodeHeight(this.$refs.reservationListBox.$el, '550px');
},
//
addReservation() {
console.log('aaaaa-------->', '执行预约新增');
@ -1107,12 +1129,9 @@ export default {
this.reservationDialogVisible = true;
console.log('aaaaa-------->', 'aaa');
//
let excludeId = [];
if (this.reservationData.length > 0) {
//
excludeId = this.reservationData.map(item => item.id).join(',');
}
this.getAddReservationList(this.page, excludeId);
this.getAddReservationList(this.page);
this.setTableHeight();
},
saveAddReservation() {
if (this.selectionList.length === 0) {
@ -1126,17 +1145,25 @@ export default {
this.reservationDialogVisible = false;
},
//
getAddReservationList(page, excludeId, params = {}) {
getAddReservationList(page, params = {}) {
let excludeId = '';
if (this.reservationData.length > 0) {
//
excludeId = this.reservationData.map(item => item.id).join(',');
}
this.loading = true;
this.reservationQuery.reservationStatus = '20';
this.reservationQuery.excludeId = excludeId;
getList(page.currentPage, page.pageSize, Object.assign(params, this.reservationQuery)).then(
res => {
getList(page.currentPage, page.pageSize, Object.assign(params, this.reservationQuery))
.then(res => {
console.log('res=========>', res);
const data = res.data.data;
this.reservationListData = data.records;
this.page.total = data.total;
}
);
})
.finally(() => {
this.loading = false;
});
},
//
async getFork() {
@ -1239,7 +1266,6 @@ export default {
selectionStockArticleChange(list) {
this.stockArticleList = list;
},
//
getvehicleData() {
return new Promise((rv, rev) => {
@ -1316,199 +1342,231 @@ export default {
})
.catch(_ => {});
},
/** 新增搜索 -- 输入 */
inputsc(index, row) {
this.reservationQuery[row.prop] = index;
this.getAddReservationList(this.page);
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
this.getAddReservationList(this.page);
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.getAddReservationList(this.page);
},
/** 返回上一页 */
back() {
this.$router.push('/distribution/reservation/reservation');
this.$store.commit('DEL_TAG_CURRENT');
},
// ()
onSubmitOrder() {
//
if (this.aaa) {
if (this.deliveryDriver == '') {
ElMessage({
message: '配送司机信息不能为空',
type: 'warning',
});
return;
}
if (this.vehicleIds == '') {
ElMessage({
message: '配送车辆信息为空',
type: 'warning',
});
return;
}
}
async onSubmitOrder() {
try {
this.loadingObj.submitBtnLoading = true;
console.log('>>>>>>>>>>>> 配送类型:', this.aaa + ' ' + this.bbb);
let stockup = {};
let tripartite = {};
let data = {};
if (this.driverForm) {
let allocationInfo = [];
//
//
if (this.driverList.length !== this.vehticleList.length) {
this.$message({
message: '司机车辆数量有误!!!',
type: 'warning',
});
return;
} else {
let info = [];
for (let i = 0; i < this.driverInfo.length; i++) {
let obj = {};
obj.driver = this.driverInfo[i].name;
obj.driverName = this.driverInfo[i].name;
obj.driverId = this.driverInfo[i].id;
obj.driverPhone = this.driverInfo[i].phone;
obj.vehicleNub = this.vehticleInfo[i].vehicleNub;
obj.vehicleId = this.vehticleInfo[i].id;
info.push(obj);
this.driverInfo[i].name;
//
if (this.aaa) {
if (this.deliveryDriver == '') {
ElMessage({
message: '配送司机信息不能为空',
type: 'warning',
});
return;
}
if (this.vehicleIds == '') {
ElMessage({
message: '配送车辆信息为空',
type: 'warning',
});
return;
}
allocationInfo = info;
}
data.allocationInfo = allocationInfo;
data.masterDriverName = this.driverForm.masterDriverName;
data.masterVehicleNub = this.driverForm.masterVehicleNub;
}
console.log('---------->tripartite', tripartite);
console.log('>>>>>>>>>>>> 配送类型:', this.aaa + ' ' + this.bbb);
if (this.stockUpForm) {
let params = this.waixieForm;
//
if (params.driverName) {
tripartite.driverName = params.driverName;
}
if (params.driverPhone) {
tripartite.driverPhone = params.driverPhone;
}
if (params.vehicleNum) {
tripartite.vehicleNum = params.vehicleNum;
}
if (params.deliveryFee) {
tripartite.deliveryFee = params.deliveryFee;
}
if (params.tripartiteSource) {
this.tripartiteSourceData.forEach(item => {
if (this.waixieForm.tripartiteSource == item.dictKey) {
tripartite.distributionCompanyId = item.dictKey;
tripartite.distributionCompany = item.dictValue;
let stockup = {};
let tripartite = {};
let data = {};
if (this.driverForm) {
let allocationInfo = [];
//
//
if (this.driverList.length !== this.vehticleList.length) {
this.$message({
message: '司机车辆数量有误!!!',
type: 'warning',
});
return;
} else {
let info = [];
for (let i = 0; i < this.driverInfo.length; i++) {
let obj = {};
obj.driver = this.driverInfo[i].name;
obj.driverName = this.driverInfo[i].name;
obj.driverId = this.driverInfo[i].id;
obj.driverPhone = this.driverInfo[i].phone;
obj.vehicleNub = this.vehticleInfo[i].vehicleNub;
obj.vehicleId = this.vehticleInfo[i].id;
info.push(obj);
this.driverInfo[i].name;
}
});
data.tripartite = tripartite;
allocationInfo = info;
}
data.allocationInfo = allocationInfo;
data.masterDriverName = this.driverForm.masterDriverName;
data.masterVehicleNub = this.driverForm.masterVehicleNub;
}
//
console.log('------------->this.stockUpForm.loader', this.stockUpForm.loader);
if (this.stockUpForm.loader) {
this.loaderData.forEach(a => {
if (this.stockUpForm.loader === a.dictKey) {
stockup.loaderName = a.dictValue;
stockup.loaderId = a.dictKey;
}
});
}
if (params.taskTime) {
stockup.taskTime = params.taskTime;
}
if (this.stockUpForm.unloader) {
this.loaderData.forEach(a => {
if (this.stockUpForm.unloader === a.dictKey) {
stockup.unloaderName = a.dictValue;
stockup.unloaderId = a.dictKey;
}
});
}
console.log('---------->tripartite', tripartite);
if (this.stockUpForm.remarks) {
data.remarks = this.stockUpForm.remarks;
}
if (this.stockUpForm) {
let params = this.waixieForm;
//
if (params.driverName) {
tripartite.driverName = params.driverName;
}
if (params.driverPhone) {
tripartite.driverPhone = params.driverPhone;
}
if (params.vehicleNum) {
tripartite.vehicleNum = params.vehicleNum;
}
if (params.deliveryFee) {
tripartite.deliveryFee = params.deliveryFee;
}
if (params.tripartiteSource) {
this.tripartiteSourceData.forEach(item => {
if (this.waixieForm.tripartiteSource == item.dictKey) {
tripartite.distributionCompanyId = item.dictKey;
tripartite.distributionCompany = item.dictValue;
}
});
data.tripartite = tripartite;
}
if (stockup) {
data.stockup = stockup;
}
//
console.log('------------->this.stockUpForm.loader', this.stockUpForm.loader);
if (this.stockUpForm.loader) {
this.loaderData.forEach(a => {
if (this.stockUpForm.loader === a.dictKey) {
stockup.loaderName = a.dictValue;
stockup.loaderId = a.dictKey;
}
});
}
if (params.taskTime) {
stockup.taskTime = params.taskTime;
}
if (this.stockUpForm.unloader) {
this.loaderData.forEach(a => {
if (this.stockUpForm.unloader === a.dictKey) {
stockup.unloaderName = a.dictValue;
stockup.unloaderId = a.dictKey;
}
});
}
if (this.stockUpForm.taskTime) {
data.taskTime = this.stockUpForm.taskTime;
if (this.stockUpForm.remarks) {
data.remarks = this.stockUpForm.remarks;
}
if (stockup) {
data.stockup = stockup;
}
if (this.stockUpForm.taskTime) {
data.taskTime = this.stockUpForm.taskTime;
}
}
}
console.log('this.data------------>', this.data);
if (!this.deliveryListId) {
data.reservationIds = this.reservationIds;
if (this.reservationData.length < 1) {
console.log('this.data------------>', this.data);
if (!this.deliveryListId) {
data.reservationIds = this.reservationIds;
if (this.reservationData.length < 1) {
this.$message({
message: '无效的配送计划',
type: 'warning',
});
return;
}
console.log('>>>>>>>>>>>>', data);
const res = await deliveryTask(data);
if (res.data.code !== 200) return;
this.$message({
message: '无效的配送计划',
type: 'warning',
type: 'success',
message: '操作成功!',
});
return;
}
console.log('>>>>>>>>>>>>', data);
deliveryTask(data).then(res => {
this.$router.push({
path: '/distribution/deliverylist/distributionDeliveryListmar',
name: '配送市配列表',
});
});
} else {
let updateDate = {};
updateDate.reservationInfos = this.reservationData;
updateDate.id = this.deliveryListId;
console.log('-------->stockup', stockup);
if (stockup.unloaderId) {
updateDate.unloadingTeamId = stockup.unloaderId;
updateDate.unloadingTeamName = stockup.unloaderName;
}
if (stockup.loaderId) {
updateDate.loadingTeamId = stockup.loaderId;
updateDate.loadingTeamName = stockup.loaderName;
}
if (stockup.taskTime) {
updateDate.taskTime = stockup.taskTime;
}
// updateDate.stockupInfo = stockup;
console.log('------------>this.tripartite', tripartite);
if (tripartite) {
updateDate.tripartite = tripartite;
}
// if (tripartite){
// updateDate.tripartite.distributionCompanyId = tripartite.distributionCompanyId;
// updateDate.tripartite.distributionCompany = tripartite.distributionCompany;
// }
console.log('---------------->data', data.remarks);
updateDate.remarks = this.stockUpForm.remarks;
updateDate.taskTime = this.stockUpForm.taskTime;
updateDate.otherFee = this.stockUpForm.otherFee;
console.log('------------>this.waixieForm', this.waixieForm);
console.log('->>>>>>>', this.waixieForm.tripartiteSource);
if (this.waixieForm.tripartiteSource) {
updateDate.tripartite = data.tripartite;
} else {
updateDate.allocationInfo = data.allocationInfo;
updateDate.masterDriverName = data.masterDriverName;
updateDate.masterVehicleNub = data.masterVehicleNub;
}
console.log('----------------->updateDate', updateDate);
console.log('----------------->this.orderData.length', this.orderData.length);
if (this.reservationData.length === 0) {
this.dialogVisible = true;
return;
}
updateMarketDelivery(updateDate).then(res => {
let updateDate = {};
updateDate.reservationInfos = this.reservationData;
updateDate.id = this.deliveryListId;
console.log('-------->stockup', stockup);
if (stockup.unloaderId) {
updateDate.unloadingTeamId = stockup.unloaderId;
updateDate.unloadingTeamName = stockup.unloaderName;
}
if (stockup.loaderId) {
updateDate.loadingTeamId = stockup.loaderId;
updateDate.loadingTeamName = stockup.loaderName;
}
if (stockup.taskTime) {
updateDate.taskTime = stockup.taskTime;
}
// updateDate.stockupInfo = stockup;
console.log('------------>this.tripartite', tripartite);
if (tripartite) {
updateDate.tripartite = tripartite;
}
// if (tripartite){
// updateDate.tripartite.distributionCompanyId = tripartite.distributionCompanyId;
// updateDate.tripartite.distributionCompany = tripartite.distributionCompany;
// }
console.log('---------------->data', data.remarks);
updateDate.remarks = this.stockUpForm.remarks;
updateDate.taskTime = this.stockUpForm.taskTime;
updateDate.otherFee = this.stockUpForm.otherFee;
console.log('------------>this.waixieForm', this.waixieForm);
console.log('->>>>>>>', this.waixieForm.tripartiteSource);
if (this.waixieForm.tripartiteSource) {
updateDate.tripartite = data.tripartite;
} else {
updateDate.allocationInfo = data.allocationInfo;
updateDate.masterDriverName = data.masterDriverName;
updateDate.masterVehicleNub = data.masterVehicleNub;
}
console.log('----------------->updateDate', updateDate);
console.log('----------------->this.orderData.length', this.orderData.length);
if (this.reservationData.length === 0) {
this.dialogVisible = true;
return;
}
const res = await updateMarketDelivery(updateDate);
if (res.data.code !== 200) return;
this.$message({
type: 'success',
message: '操作成功!',
});
this.back();
return;
});
}
} catch (error) {
console.log('error :>> ', error);
} finally {
this.loadingObj.submitBtnLoading = false;
}
},
qqq(params = {}) {
console.log('--------------->', '执行了..................');
//
@ -1819,4 +1877,32 @@ export default {
flex-wrap: wrap;
}
}
.tableBox {
padding: 10px;
}
//
:deep(.el-divider__text.is-left) {
font-size: 20px;
font-weight: bold;
color: var(--el-color-primary);
}
//
.footer {
height: 80px;
}
//
.button-container {
z-index: 99;
position: fixed;
bottom: 30px;
left: 50%;
}
:deep(.el-input--prefix) {
height: 100% !important;
}
</style>

Loading…
Cancel
Save