|
@@ -386,24 +386,31 @@ export default {
|
|
|
new tools()
|
|
|
.uploadFile(file, `reporting/reportingActivities`)
|
|
|
.then(({ data }) => {
|
|
|
- placeActivity.value.safetyPlan = data.url;
|
|
|
- fileList.value.push(data);
|
|
|
- fileList.value[0].url = `${$base}` + fileList.value[0].url;
|
|
|
- fileList.value[0].name = decodeURIComponent(
|
|
|
- fileList.value[0].url.substring(
|
|
|
- fileList.value[0].url.lastIndexOf("/") + 1
|
|
|
- )
|
|
|
- );
|
|
|
+ if (res.status == 200 || res.statusText == "OK") {
|
|
|
+ xm.showToast({
|
|
|
+ message: "上传成功",
|
|
|
+ });
|
|
|
+ placeActivity.value.safetyPlan = data.url;
|
|
|
+ fileList.value.push(data);
|
|
|
+ fileList.value[0].url = `${$base}` + fileList.value[0].url;
|
|
|
+ fileList.value[0].name = decodeURIComponent(
|
|
|
+ fileList.value[0].url.substring(
|
|
|
+ fileList.value[0].url.lastIndexOf("/") + 1
|
|
|
+ )
|
|
|
+ );
|
|
|
+ }
|
|
|
});
|
|
|
- console.log("上传文件", placeActivity.value.safetyPlan);
|
|
|
};
|
|
|
// 提交数据
|
|
|
const submit = () => {
|
|
|
isLoading.value = true;
|
|
|
new placeActivityServer().save(placeActivity.value).then((res) => {
|
|
|
- console.log("提交", res);
|
|
|
+ if (res.status == 200 || res.statusText == "OK") {
|
|
|
+ xm.showToast({
|
|
|
+ message: res.data,
|
|
|
+ });
|
|
|
+ }
|
|
|
onClickLeft();
|
|
|
- isLoading.value = false;
|
|
|
});
|
|
|
};
|
|
|
return {
|