master
lion 4 days ago
parent 2932df86ac
commit 2b925b5af8

@ -419,6 +419,7 @@ export default {
visitShow: false,
visitData: null,
vehicleImages: [], //
originalVehicleImageIds: [], // ID
remarkValue: "", //
personNoValue: "", //
uploading: false, //
@ -713,6 +714,11 @@ export default {
});
});
this.vehicleImages = arr;
// ID
this.originalVehicleImageIds = arr.map((item) => item.id);
} else {
this.vehicleImages = [];
this.originalVehicleImageIds = [];
}
//
this.codeForm.code = visitor.code;
@ -814,6 +820,7 @@ export default {
this.visitData = null;
//
this.vehicleImages = [];
this.originalVehicleImageIds = [];
this.remarkValue = "";
this.personNoValue = "";
this.uploading = false;
@ -950,43 +957,69 @@ export default {
// - action
this.updating = true;
console.log("this.visitData", this.visitData);
// return
try {
const updateParams = {
...this.visitData,
id: this.visitData.id,
remark: this.remarkValue,
person_no: this.personNoValue,
// follw_people follw_people_person_no
};
//
const performUpdate = async (alsoCancel) => {
this.updating = true;
try {
const updateParams = {
...this.visitData,
id: this.visitData.id,
remark: this.remarkValue,
person_no: this.personNoValue,
// follw_people follw_people_person_no
};
// type==3
if (this.visitData.type == 3) {
updateParams.vehicle_images = (this.vehicleImages || [])
.filter((img) => img && img.id)
.map((img) => img.id);
}
await this.$u.api.visitUpdate(updateParams);
uni.showToast({
title: "更新成功",
icon: "success",
});
// type==3
if (this.visitData.type == 3) {
updateParams.vehicle_images = this.vehicleImages.map((img) => img.id);
if (alsoCancel) {
//
this.cancelCode();
setTimeout(() => {
this.closeVisitModal();
}, 800);
}
} catch (error) {
console.error("更新失败:", error);
uni.showToast({
title: "更新失败",
icon: "none",
});
} finally {
this.updating = false;
}
};
const res = await this.$u.api.visitUpdate(updateParams);
//
const isVehicleType = this.visitData.type == 3; //
uni.showToast({
title: "更新成功",
icon: "success",
});
//
this.cancelCode();
setTimeout(() => {
this.closeVisitModal();
}, 800);
} catch (error) {
console.error("更新失败:", error);
uni.showToast({
title: "更新失败",
icon: "none",
});
} finally {
this.updating = false;
}
uni.showModal({
title: "提示",
content: "是否立即核销?",
cancelText: isVehicleType ? "仅提交照片" : "取消",
confirmText: "提交并核销",
success: async (res) => {
if (res.confirm) {
//
await performUpdate(true);
} else if (res.cancel && isVehicleType) {
//
await performUpdate(false);
}
//
},
});
},
// 访
@ -1427,7 +1460,7 @@ export default {
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
z-index: 10; // uni.showModal
}
.modal-content {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.
Loading…
Cancel
Save