|
@@ -42,6 +42,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
</van-cell>
|
|
</van-cell>
|
|
|
<deleteUploadImgTaskPhoto
|
|
<deleteUploadImgTaskPhoto
|
|
|
|
|
+ :imgs="item.fileInfoList"
|
|
|
ref="taskPhoto"
|
|
ref="taskPhoto"
|
|
|
:formData="formData"
|
|
:formData="formData"
|
|
|
:storeGroupId="storeGroupId"
|
|
:storeGroupId="storeGroupId"
|
|
@@ -163,6 +164,9 @@ export default {
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
activated() {
|
|
activated() {
|
|
|
|
|
+ if (this.formData && this.formData.collectionItemList && this.formData.collectionItemList[0]) {
|
|
|
|
|
+ this.formData.collectionItemList[0].fileInfoList = [];
|
|
|
|
|
+ }
|
|
|
this.taskIds = this.$route.query.taskIds || [];
|
|
this.taskIds = this.$route.query.taskIds || [];
|
|
|
this.visitsId = this.$route.query.visitsId || '';
|
|
this.visitsId = this.$route.query.visitsId || '';
|
|
|
this.storeGroupId = this.$route.query.storeGroupId || '';
|
|
this.storeGroupId = this.$route.query.storeGroupId || '';
|
|
@@ -170,6 +174,7 @@ export default {
|
|
|
this.insert = this.$route.query.insert;
|
|
this.insert = this.$route.query.insert;
|
|
|
// 授权
|
|
// 授权
|
|
|
// getTicketFun(['uploadImage']).then(() => {});
|
|
// getTicketFun(['uploadImage']).then(() => {});
|
|
|
|
|
+ this.toastLoading(0, '加载中...', true);
|
|
|
if (this.$route.query.source == 'historicalDetails') {
|
|
if (this.$route.query.source == 'historicalDetails') {
|
|
|
this.getVisitsDetailFun();
|
|
this.getVisitsDetailFun();
|
|
|
} else {
|
|
} else {
|
|
@@ -249,7 +254,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
getVisitsDetailFun() {
|
|
getVisitsDetailFun() {
|
|
|
- this.toastLoading(0, '加载中...', true);
|
|
|
|
|
getVisitsDetail({ visitsId: this.visitsId }).then((res) => {
|
|
getVisitsDetail({ visitsId: this.visitsId }).then((res) => {
|
|
|
this.toastLoading().clear();
|
|
this.toastLoading().clear();
|
|
|
if (res.data.sfaTaskList) {
|
|
if (res.data.sfaTaskList) {
|
|
@@ -269,6 +273,7 @@ export default {
|
|
|
id: this.visitsId,
|
|
id: this.visitsId,
|
|
|
taskIds: this.taskIds.split(','),
|
|
taskIds: this.taskIds.split(','),
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
|
|
+ this.toastLoading().clear();
|
|
|
if (res.data && res.data.length) {
|
|
if (res.data && res.data.length) {
|
|
|
this.dataList = res.data;
|
|
this.dataList = res.data;
|
|
|
this.formData = res.data[0];
|
|
this.formData = res.data[0];
|
|
@@ -279,7 +284,7 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
isEditFun() {
|
|
isEditFun() {
|
|
|
- this.getTicketFunfun();
|
|
|
|
|
|
|
+ // this.getTicketFunfun();
|
|
|
},
|
|
},
|
|
|
openDialog(item) {
|
|
openDialog(item) {
|
|
|
this.vanPopup = true;
|
|
this.vanPopup = true;
|
|
@@ -292,7 +297,6 @@ export default {
|
|
|
},
|
|
},
|
|
|
onSubmit() {
|
|
onSubmit() {
|
|
|
this.toastLoading(0, '提交中,请稍候...', true);
|
|
this.toastLoading(0, '提交中,请稍候...', true);
|
|
|
- const taskPhoto = this.$refs.taskPhoto && this.$refs.taskPhoto[0];
|
|
|
|
|
let formData = {
|
|
let formData = {
|
|
|
storeId: this.$route.query.storeId,
|
|
storeId: this.$route.query.storeId,
|
|
|
storeCode: this.$route.query.storeCode,
|
|
storeCode: this.$route.query.storeCode,
|
|
@@ -305,24 +309,8 @@ export default {
|
|
|
deviceCode: '',
|
|
deviceCode: '',
|
|
|
putInCode: '',
|
|
putInCode: '',
|
|
|
equipmentCode: '',
|
|
equipmentCode: '',
|
|
|
- collectionItemId: taskPhoto ? taskPhoto.collectionItemId : '',
|
|
|
|
|
- objectType: this.$route.query.photoType,
|
|
|
|
|
- locationRemark: taskPhoto ? taskPhoto.locationRemark : '',
|
|
|
|
|
- mediaInfos: [],
|
|
|
|
|
- isH5: this.userInfo.photoMethod == '1',
|
|
|
|
|
};
|
|
};
|
|
|
- if (this.userInfo.photoMethod == '1') {
|
|
|
|
|
- formData.mediaInfos = [];
|
|
|
|
|
- this.addCollection(formData);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.mediaInfos = [];
|
|
|
|
|
- let imgArr = JSON.parse(JSON.stringify(taskPhoto.imgArr));
|
|
|
|
|
- this.syncUpload(imgArr, () => {
|
|
|
|
|
- this.toastLoading().clear();
|
|
|
|
|
- formData.mediaInfos = this.mediaInfos;
|
|
|
|
|
- this.addCollection(formData);
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.addCollection(formData);
|
|
|
},
|
|
},
|
|
|
syncUpload(imgArr, callback) {
|
|
syncUpload(imgArr, callback) {
|
|
|
if (!imgArr.length) {
|
|
if (!imgArr.length) {
|
|
@@ -349,7 +337,8 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
addCollection(formData) {
|
|
addCollection(formData) {
|
|
|
- return addCollectionAnswerBatch(formData).then((res) => {
|
|
|
|
|
|
|
+ addCollectionAnswerBatch(formData).then((res) => {
|
|
|
|
|
+ this.toastLoading().clear();
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
localStorage.setItem('getRequestFlage', 'true');
|
|
localStorage.setItem('getRequestFlage', 'true');
|
|
|
this.$router.go(-1);
|
|
this.$router.go(-1);
|