qb 1 month ago
parent
commit
2bf7c18c16
  1. 52
      src/views/distribution/deliverylist/distributionDeliveryListedt.vue

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

@ -5224,6 +5224,46 @@ export default {
this.dialogImageUrlE = uploadFile.url;
this.dialogVisibleE = true;
},
//
isValidImageUrl(url) {
// URL blob:
return typeof url === 'string' && !url.startsWith('blob:');
},
checkImageUrls(row) {
const invalidImages = []; //
// row.map
for (const photoKey in row.map) {
const photoArray = row.map[photoKey];
// photo
for (const photoObj of photoArray) {
const url = photoObj.urlRoute;
console.log(url, 'url');
const isValid = this.isValidImageUrl(url);
if (!isValid) {
invalidImages.push(photoObj.name); // URLname
}
}
}
if (invalidImages.length > 0) {
invalidImages.forEach(item=>{
ElMessage({
message: `图片名称为:${item}存在问题,请删除图片重新上传或者刷新页面重试`,
type: 'warning',
})
})
console.log(`图片名称为: ${invalidImages.join(', ')}存在问题,请删除图片重新上传,或刷新页面重新尝试`);
return false;
} else {
return true;
}
},
//
submitForm() {
//
@ -5301,6 +5341,18 @@ export default {
pushPhotoToRow(this.FragilePhotos, 'photo_3');
pushPhotoToRow(this.HomePhotos, 'photo_4');
pushPhotoToRow(this.SignForPhotos, 'photo_5');
//
// row.map.photo_5.push({
// name: "03add918888d36ce0d566da120510840.png",
// reservationId: "1829120012682530818",
// type: "photo_2",
// urlRoute: "blob:http://192.168.3.13:2888/d236a3be-e565-4122-b573-7fe4c5f07525"
// })
const result = this.checkImageUrls(row);
console.log(`图片校验 ${result}`);
if(!result){
return
}
this.TCloading = true; //
this.signBox = false;
if (this.signtitle === '图片上传') {

Loading…
Cancel
Save