Browse Source

新增一键签收

fix_bug_pro20231227
13208366016 1 year ago
parent
commit
1e254916c1
  1. 13
      src/api/distribution/distributionSignfor.js
  2. 448
      src/views/distribution/deliverylist/distributionDeliveryListedt.vue
  3. 33
      src/views/distribution/signfor/distributionSignforedt.vue

13
src/api/distribution/distributionSignfor.js

@ -203,3 +203,16 @@ export const addvalueInfoList = (row) => {
})
}
/**
* 签收增值服务弹窗
* @param params
* @returns {AxiosPromise}
*/
export const $_checkAddValuePackageList = params => {
return request({
url: '/api/logpm-distribution/signfor/checkAddValuePackageList',
method: 'get',
params,
});
};

448
src/views/distribution/deliverylist/distributionDeliveryListedt.vue

@ -424,6 +424,126 @@
<el-button type="primary" @click="submitForm">确定</el-button>
</div>
</div>
<div>------------------------------</div>
<div class="TcFrom">
<el-form :model="TcForm" label-width="120px">
<el-form-item label="收货人姓名">
<el-input disabled v-model="TcForm.consignee" placeholder="暂无收货人姓名" />
</el-form-item>
<el-form-item label="收货人电话">
<el-input disabled v-model="TcForm.deliveryPhone" placeholder="暂无收货人电话" />
</el-form-item>
<el-form-item label="收货人地址">
<el-input disabled v-model="TcForm.deliveryAddress" placeholder="暂无收货人地址" />
</el-form-item>
<el-form-item label="签收人类型">
<el-radio-group v-model="TcForm.signingType" class="ml-4">
<el-radio label="1" size="large">签收</el-radio>
<el-radio label="2" size="large">待签收</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="TcForm.clerkSignRemarks" placeholder="暂无备注" />
</el-form-item>
</el-form>
<div class="imgName">
<span>上门照</span>
<el-upload
v-model:file-list="DoorstepPhoto"
:action="doubledCount"
list-type="picture-card"
:on-preview="EnlargeTheTmageA"
:on-remove="handleRemove"
:on-success="ImgSuccessA"
:headers="headers"
>
<el-icon><Plus /></el-icon>
</el-upload>
<el-dialog v-model="dialogVisibleA">
<img w-full :src="dialogImageUrlA" alt="IMG" />
</el-dialog>
</div>
<div class="imgName">
<span>堆码照</span>
<el-upload
v-model:file-list="StackingPhoto"
:action="doubledCount"
list-type="picture-card"
:on-preview="EnlargeTheTmageB"
:on-remove="handleRemove"
:on-success="ImgSuccessB"
:headers="headers"
>
<el-icon><Plus /></el-icon>
</el-upload>
<el-dialog v-model="dialogVisibleB">
<img w-full :src="dialogImageUrlB" alt="IMG" />
</el-dialog>
</div>
<div class="imgName">
<span>易碎照</span>
<el-upload
v-model:file-list="FragilePhotos"
:action="doubledCount"
list-type="picture-card"
:on-preview="EnlargeTheTmageC"
:on-remove="handleRemove"
:on-success="ImgSuccessC"
:headers="headers"
>
<el-icon><Plus /></el-icon>
</el-upload>
<el-dialog v-model="dialogVisibleC">
<img w-full :src="dialogImageUrlC" alt="IMG" />
</el-dialog>
</div>
<div class="imgName">
<span>家配照</span>
<el-upload
v-model:file-list="HomePhotos"
:action="doubledCount"
list-type="picture-card"
:on-preview="EnlargeTheTmageD"
:on-remove="handleRemove"
:on-success="ImgSuccessD"
:headers="headers"
>
<el-icon><Plus /></el-icon>
</el-upload>
<el-dialog v-model="dialogVisibleD">
<img w-full :src="dialogImageUrlD" alt="IMG" />
</el-dialog>
</div>
<div class="imgName">
<span>签收照</span>
<el-upload
v-model:file-list="SignForPhotos"
:action="doubledCount"
list-type="picture-card"
:on-preview="EnlargeTheTmageE"
:on-remove="handleRemove"
:on-success="ImgSuccessE"
:headers="headers"
>
<el-icon><Plus /></el-icon>
</el-upload>
<el-dialog v-model="dialogVisibleE">
<img w-full :src="dialogImageUrlE" alt="IMG" />
</el-dialog>
</div>
<div class="tj-ttn">
<el-button type="primary" @click="submitForm">确定</el-button>
<el-button type="primary" @click="cancellation">取消</el-button>
</div>
</div>
</el-dialog>
</div>
</basic-container>
@ -448,10 +568,38 @@ import { mapGetters } from 'vuex';
import { getDictionaryBiz } from '@/api/system/dict';
import dayjs from 'dayjs';
import { updateReservation } from '@/api/distribution/distributionReservation';
import { ElMessage } from 'element-plus';
import { getToken } from '@/utils/auth';
export default {
data() {
return {
dialogImageUrl: '', //
dialogVisible: false, //
dialogImageUrlA: '',
dialogImageUrlB: '',
dialogImageUrlC: '',
dialogImageUrlD: '',
dialogImageUrlE: '',
dialogVisibleA: false,
dialogVisibleB: false,
dialogVisibleC: false,
dialogVisibleD: false,
dialogVisibleE: false,
deliveryId: null,
Routid: null,
TcForm: {}, //
//
DoorstepPhoto: [],
//
StackingPhoto: [],
//
FragilePhotos: [],
//
HomePhotos: [],
//
SignForPhotos: [],
reservationId: null, //ID
columnList: [
{
prop: 'reservationCode',
@ -2460,9 +2608,18 @@ export default {
});
return ids.join(',');
},
//
doubledCount() {
return '/api/blade-resource/oss/endpoint/put-file';
},
// TOKEN
headers() {
return { 'Blade-Auth': 'Bearer ' + getToken() };
},
},
methods: {
callFordelivery(formName) {
console.log(formName, 'formName');
this.$refs[formName].validate(valid => {
if (valid) {
console.log('提交的数据》》》', this.formCustomer);
@ -2610,55 +2767,208 @@ export default {
}
});
},
//
handleRemove(uploadFile, uploadFiles) {
console.log(uploadFile, uploadFiles);
console.log('执行了1回调');
},
handlePictureCardPreview(uploadFile) {
console.log(uploadFile);
console.log('执行了2回调');
dialogVisible.value = true;
},
//
//
ImgSuccessA(response, uploadFile) {
console.log(response, '触发了上门照');
console.log(this.DoorstepPhoto, '处理好的值');
},
//
ImgSuccessB(response, uploadFile) {
console.log(response, '触发了堆门照');
// this.StackingPhoto;
},
//
ImgSuccessC(response, uploadFile) {
console.log(response, '触发了易碎照');
// this.FragilePhotos;
},
//
ImgSuccessD(response, uploadFile) {
console.log(response, '触发了家配照');
// this.HomePhotos;
},
//
ImgSuccessE(response, uploadFile) {
console.log(response, '触发了签收照');
// this.SignForPhotos;
},
//
EnlargeTheTmageA(uploadFile) {
this.dialogImageUrlA = uploadFile.url;
this.dialogVisibleA = true;
},
EnlargeTheTmageB(uploadFile) {
this.dialogImageUrlB = uploadFile.url;
this.dialogVisibleB = true;
},
EnlargeTheTmageC(uploadFile) {
this.dialogImageUrlC = uploadFile.url;
this.dialogVisibleC = true;
},
EnlargeTheTmageD(uploadFile) {
this.dialogImageUrlD = uploadFile.url;
this.dialogVisibleD = true;
},
EnlargeTheTmageE(uploadFile) {
this.dialogImageUrlE = uploadFile.url;
this.dialogVisibleE = true;
},
submitForm() {
console.log('--------------->this.signtitle', this.signtitle);
this.$refs.signform.validate(valid => {
if (valid) {
if (this.signtitle === '复核签收') {
let row = {};
console.log(
'this.signform.deliverySignPictures>>>>>>>>>',
this.signform.deliverySignPictures
);
row.id = this.signform.deliveryId;
row.deliverySignPictures = this.signform.deliverySignPictures;
row.clerkSignRemarks = this.signform.clerkSignRemarks;
row.signingTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
row.signingStatus = '2';
console.log('更新参数>>>>>>>>', row);
if (!!row.id) {
updatesign(row).then(
() => {
this.$message({
type: 'success',
message: '操作成功!',
});
this.onLoad();
},
error => {
console.log(error);
}
);
}
} else {
let data = {};
console.log('---------------->this.deliverydata', this.deliverydata);
console.log('---------------->this.signform', this.signform);
data.reservationId = this.signform.id;
data.deliveryId = this.deliverydata.id;
data.deliverySignPictures = this.signform.deliverySignPictures.join(',');
data.clerkSignRemarks = this.signform.clerkSignRemarks;
console.log('一键签收data>>>>>>>>>>', data);
getOneclickq(data).then(res => {
this.$message.success(res.data.msg);
this.onLoad();
});
}
// ,
this.signform = {};
this.signBox = false;
}
// console.log('--------------->this.signtitle', this.signtitle);
// console.log('--------------->this.signtitle', this.submitForm);
let row = {};
row.map = {
photo_1: [],
photo_2: [],
photo_3: [],
photo_4: [],
photo_5: [],
};
//
//
row.reservationId = this.reservationId;
// row.clerkSignPictures = this.signform.clerkSignPictures;
row.clerkSignRemarks = this.TcForm.clerkSignRemarks; //
row.deliveryId = this.deliveryId;
//
if (
this.DoorstepPhoto.length < 3 &&
this.StackingPhoto.length < 3 &&
this.SignForPhotos.length < 3
) {
ElMessage({
message: '图片参数不全',
type: 'warning',
});
return;
}
this.DoorstepPhoto.forEach(item => {
row.map['photo_1'].push({
name: item.response.data.originalName,
reservationId: this.reservationId,
type: 'photo_1',
urlRoute: item.response.data.link,
});
});
this.StackingPhoto.forEach(item => {
row.map['photo_2'].push({
name: item.response.data.originalName,
reservationId: this.reservationId,
type: 'photo_2',
urlRoute: item.response.data.link,
});
});
this.FragilePhotos.forEach(item => {
row.map['photo_3'].push({
name: item.response.data.originalName,
reservationId: this.reservationId,
type: 'photo_3',
urlRoute: item.response.data.link,
});
});
this.HomePhotos.forEach(item => {
row.map['photo_4'].push({
name: item.response.data.originalName,
reservationId: this.reservationId,
type: 'photo_4',
urlRoute: item.response.data.link,
});
});
this.SignForPhotos.forEach(item => {
row.map['photo_5'].push({
name: item.response.data.originalName,
reservationId: this.reservationId,
type: 'photo_5',
urlRoute: item.response.data.link,
});
});
console.log(row, '准备提交的参数');
getOneclickq(row).then(res => {
console.log(res, '上传成功后的返回值');
});
//
//
// {
// name: item.name,
// reservationId: reservationId,
// type: photoType,
// urlRoute: item.url,
// }
// console.log(row, '');
// getOneclickq(row).then(res => {
// console.log(res);
// });
// this.$refs.signform.validate(valid => {
// if (valid) {
// if (this.signtitle === '') {
// let row = {};
// console.log(
// 'this.signform.deliverySignPictures>>>>>>>>>',
// this.signform.deliverySignPictures
// );
// row.id = this.signform.deliveryId;
// row.deliverySignPictures = this.signform.deliverySignPictures;
// row.clerkSignRemarks = this.signform.clerkSignRemarks;
// row.signingTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
// row.signingStatus = '2';
// console.log('>>>>>>>>', row);
// if (!!row.id) {
// updatesign(row).then(
// () => {
// this.$message({
// type: 'success',
// message: '!',
// });
// this.onLoad();
// },
// error => {
// console.log(error);
// }
// );
// }
// } else {
// let data = {};
// console.log('---------------->this.deliverydata', this.deliverydata);
// console.log('---------------->this.signform', this.signform);
// data.reservationId = this.signform.id;
// data.deliveryId = this.deliverydata.id;
// data.deliverySignPictures = this.signform.deliverySignPictures.join(',');
// data.clerkSignRemarks = this.signform.clerkSignRemarks;
// console.log('data>>>>>>>>>>', data);
// getOneclickq(data).then(res => {
// this.$message.success(res.data.msg);
// this.onLoad();
// });
// }
// // ,
// this.signform = {};
// this.signBox = false;
// }
// });
},
//
handleCustom() {
@ -2671,6 +2981,7 @@ export default {
handleOrder(page) {
let params = {};
params.deliveryId = this.deliverydata.id;
getorddetail(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
console.log('查看>>>>>订单>>', res.data.data);
const data = res.data.data;
@ -2726,6 +3037,7 @@ export default {
},
handleSign(row) {
console.log('签收>>>>>>>>>>', row);
this.signtitle = '复核签收';
// this.view = true;
this.signform = row;
@ -2735,13 +3047,15 @@ export default {
},
//
handleSignone(row) {
console.log('一键签收>>>>>>>>>>', row);
console.log('一键签收222>>>>>>>>>>', row);
this.reservationId = row.reservationId; //ID
this.signtitle = '一键签收';
this.signform = row;
this.TcForm = row;
this.signBox = true;
},
inventoryDetail(row) {
console.log('一键签收>>>>>>>>>>', row);
console.log('一键签收当前行参数>>>>>>>>>>', row);
},
handleOne(row) {
console.log('签收>>>>>>>>>>', row);
@ -2867,7 +3181,10 @@ export default {
//
const data = decodeURIComponent(this.$route.query.data);
this.deliverydata = JSON.parse(data);
console.log(this.Routid,this.Routid,'存储的ID=====================WDWADAWD');
console.log('data>>>>>>>>', this.deliverydata);
this.deliveryId=this.deliverydata.id;//ID
this.loading = true;
let id = this.deliverydata.id;
getDetail(id).then(res => {
@ -2932,3 +3249,34 @@ export default {
},
};
</script>
<style scoped lang="scss">
.TcFrom {
:deep(.el-form) {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.el-form-item {
width: 46%;
}
}
}
.imgName {
span {
font-weight: bold;
font-size: 16px;
}
span::after {
content: '';
}
}
.tj-ttn {
display: flex;
justify-content: flex-end;
align-items: center;
}
:deep(.el-dialog__body) {
img {
width: 100%;
}
}
</style>

33
src/views/distribution/signfor/distributionSignforedt.vue

@ -407,11 +407,10 @@
<template v-for="item in TabB" :key="item.name">
<el-tab-pane :label="item.label" :name="item.name">
<div class="tab-title">
<!-- <div class="BatchDelete">
<div class="BatchDelete">
<el-button type="primary" @click="newlyAdded(item.name)"> 新增 </el-button>
<el-button type="primary" @click="BatchDelete(item.name)"> 批量删除 </el-button>
</div> -->
</div>
<template v-for="(item, index) in TabTitle" :key="index">
<span>
<el-icon><component :is="item.icon" /></el-icon> {{ item.name }}
@ -510,7 +509,7 @@
<el-dialog v-model="dialogBatchDelete" title="标题" width="60%" :before-close="handleClose">
<!-- 表格列开始 -->
<el-table
:data="dataAdded"
:data="TcDataAdded"
row-key="name"
border
height="500"
@ -584,6 +583,7 @@ import {
signforPackageList,
signforInventoryList,
addvalueInfoList,
$_checkAddValuePackageList,
} from '@/api/distribution/distributionSignfor';
import { getToken } from '@/utils/auth';
const form = ref({}); //
@ -1427,7 +1427,7 @@ const onLoad = () => {
// RouterReservationId.value = '1721707896171032578';
//
RouterId.value = route.query.id; //ID
RouterReservationId.value= route.query.reservationId//
RouterReservationId.value = route.query.reservationId; //
console.log(route.query.id, '当前路由参数');
console.log(route.query.RouterReservationId, '当前路由参数');
// TOKEN
@ -1441,7 +1441,12 @@ const doubledCount = computed(() => {
//
const newlyAdded = val => {
dialogBatchDelete.value = true;
console.log(val, '触发了新增按钮');
$_checkAddValuePackageList({
reservationId: RouterReservationId.value,
}).then(res => {
TcDataAdded.value = res.data.records;
console.log(res, '新增返回的信息');
});
};
//
const BatchDelete = val => {
@ -1550,17 +1555,15 @@ const valueAddedServices = val => {
// TabTitle.value[1].value = res.data.data.fee ? res.data.data.fee : ''; //
// TabTitle.value[2].value = res.data.data.floolNum ? res.data.data.floolNum : ''; //
// TabTitle.value[3].value = res.data.data.packageEntityList ? res.data.data.packageEntityList.length : ''; //
// }
// }
const packageList = res.data.data ? res.data.data.packageEntityList : [];
dataAdded.value = packageList;
TabTitle.value[0].value = res.data.data?.distance ?? '暂无数据';
TabTitle.value[1].value = res.data.data?.fee ?? '暂无数据';
TabTitle.value[2].value = res.data.data?.floolNum ?? '暂无数据';
TabTitle.value[3].value = packageList.length ? packageList.length : '暂无数据';
const packageList = res.data.data ? res.data.data.packageEntityList : [];
dataAdded.value = packageList;
TabTitle.value[0].value = res.data.data?.distance ?? '暂无数据';
TabTitle.value[1].value = res.data.data?.fee ?? '暂无数据';
TabTitle.value[2].value = res.data.data?.floolNum ?? '暂无数据';
TabTitle.value[3].value = packageList.length ? packageList.length : '暂无数据';
});
};
const ServiceChange = val => {

Loading…
Cancel
Save