|
@@ -3,7 +3,7 @@
|
|
|
<van-nav-bar class="navBar" left-arrow title="生动化陈列" @click-left="onClickLeft">
|
|
<van-nav-bar class="navBar" left-arrow title="生动化陈列" @click-left="onClickLeft">
|
|
|
<template #right v-if="formData">
|
|
<template #right v-if="formData">
|
|
|
<span
|
|
<span
|
|
|
- v-if="formData.processStatus != 1 || formData.displayRewardTaskEditable"
|
|
|
|
|
|
|
+ v-if="formData.processStatus != 1"
|
|
|
@click="onSubmit"
|
|
@click="onSubmit"
|
|
|
style="
|
|
style="
|
|
|
color: white;
|
|
color: white;
|
|
@@ -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"
|
|
@@ -75,14 +76,28 @@
|
|
|
<div class="itemHtml" v-html="item.displayInstructions"></div>
|
|
<div class="itemHtml" v-html="item.displayInstructions"></div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="itemBottom" v-if="insert == 'false'">
|
|
<div class="itemBottom" v-if="insert == 'false'">
|
|
|
- <img
|
|
|
|
|
|
|
+ <van-button
|
|
|
|
|
+ round
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="openDialog(item)"
|
|
|
|
|
+ v-if="item.taskPhotoConditionPassed == 1"
|
|
|
|
|
+ >通过</van-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <van-button
|
|
|
|
|
+ round
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ @click="openDialog(item)"
|
|
|
|
|
+ v-if="item.taskPhotoConditionPassed == 0"
|
|
|
|
|
+ >不通过</van-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <!-- <img
|
|
|
v-if="item.taskPhotoConditionPassed == 1"
|
|
v-if="item.taskPhotoConditionPassed == 1"
|
|
|
@click="openDialog(item)"
|
|
@click="openDialog(item)"
|
|
|
:src="require('@/assets/taskPhotoSu.png')" />
|
|
:src="require('@/assets/taskPhotoSu.png')" />
|
|
|
<img
|
|
<img
|
|
|
v-if="item.taskPhotoConditionPassed == 0"
|
|
v-if="item.taskPhotoConditionPassed == 0"
|
|
|
@click="openDialog(item)"
|
|
@click="openDialog(item)"
|
|
|
- :src="require('@/assets/taskPhotoErr.png')" />
|
|
|
|
|
|
|
+ :src="require('@/assets/taskPhotoErr.png')" /> -->
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -159,14 +174,21 @@ export default {
|
|
|
pos: 0,
|
|
pos: 0,
|
|
|
mediaIds: [],
|
|
mediaIds: [],
|
|
|
editFlag: true,
|
|
editFlag: true,
|
|
|
|
|
+ mediaInfos: [],
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
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 || '';
|
|
|
this.objectType = this.$route.query.photoType || '';
|
|
this.objectType = this.$route.query.photoType || '';
|
|
|
this.insert = this.$route.query.insert;
|
|
this.insert = this.$route.query.insert;
|
|
|
|
|
+ // 授权
|
|
|
|
|
+ // 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 {
|
|
@@ -246,7 +268,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) {
|
|
@@ -266,6 +287,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];
|
|
@@ -276,13 +298,7 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
isEditFun() {
|
|
isEditFun() {
|
|
|
- // processStatus 是否有权限编辑,displayRewardTaskEditable 只能编辑一次,
|
|
|
|
|
- if (
|
|
|
|
|
- (this.insert == 'false' && this.formData.processStatus != 1) ||
|
|
|
|
|
- this.formData.displayRewardTaskEditable
|
|
|
|
|
- ) {
|
|
|
|
|
- this.getTicketFunfun();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // this.getTicketFunfun();
|
|
|
},
|
|
},
|
|
|
openDialog(item) {
|
|
openDialog(item) {
|
|
|
this.vanPopup = true;
|
|
this.vanPopup = true;
|
|
@@ -293,57 +309,50 @@ export default {
|
|
|
this.taskPhotoRecognitionResult = item.taskPhotoRecognitionResult;
|
|
this.taskPhotoRecognitionResult = item.taskPhotoRecognitionResult;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- waitUploadReady(interval = 1000) {
|
|
|
|
|
- return new Promise((resolve) => {
|
|
|
|
|
- const intervalId = setInterval(() => {
|
|
|
|
|
- const taskPhoto = this.$refs.taskPhoto && this.$refs.taskPhoto[0];
|
|
|
|
|
- if (taskPhoto && taskPhoto.isUploadImg) {
|
|
|
|
|
- clearInterval(intervalId);
|
|
|
|
|
- resolve();
|
|
|
|
|
- }
|
|
|
|
|
- }, interval);
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- async onSubmit() {
|
|
|
|
|
|
|
+ onSubmit() {
|
|
|
this.toastLoading(0, '提交中,请稍候...', true);
|
|
this.toastLoading(0, '提交中,请稍候...', true);
|
|
|
- try {
|
|
|
|
|
- const taskPhoto = this.$refs.taskPhoto && this.$refs.taskPhoto[0];
|
|
|
|
|
- if (taskPhoto && !taskPhoto.isUploadImg) {
|
|
|
|
|
- await this.waitUploadReady(1000);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- let formData = {
|
|
|
|
|
- storeId: this.$route.query.storeId,
|
|
|
|
|
- storeCode: this.$route.query.storeCode,
|
|
|
|
|
- storeGroupId: this.$route.query.storeGroupId,
|
|
|
|
|
- visitsId: this.visitsId,
|
|
|
|
|
- taskList: this.taskIds.split(',').map((val) => Number(val)),
|
|
|
|
|
- insert: this.insert,
|
|
|
|
|
- collectionAnswers: [],
|
|
|
|
|
- checkUnManage: 'N',
|
|
|
|
|
- deviceCode: '',
|
|
|
|
|
- putInCode: '',
|
|
|
|
|
- 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 = [];
|
|
|
|
|
- } else if (taskPhoto) {
|
|
|
|
|
- formData.mediaInfos = taskPhoto.imgArr;
|
|
|
|
|
|
|
+ let formData = {
|
|
|
|
|
+ storeId: this.$route.query.storeId,
|
|
|
|
|
+ storeCode: this.$route.query.storeCode,
|
|
|
|
|
+ storeGroupId: this.$route.query.storeGroupId,
|
|
|
|
|
+ visitsId: this.visitsId,
|
|
|
|
|
+ taskList: this.taskIds.split(',').map((val) => Number(val)),
|
|
|
|
|
+ insert: this.insert,
|
|
|
|
|
+ collectionAnswers: [],
|
|
|
|
|
+ checkUnManage: 'N',
|
|
|
|
|
+ deviceCode: '',
|
|
|
|
|
+ putInCode: '',
|
|
|
|
|
+ equipmentCode: '',
|
|
|
|
|
+ };
|
|
|
|
|
+ this.addCollection(formData);
|
|
|
|
|
+ },
|
|
|
|
|
+ syncUpload(imgArr, callback) {
|
|
|
|
|
+ if (!imgArr.length) {
|
|
|
|
|
+ callback && callback();
|
|
|
|
|
+ return;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ var item = imgArr.pop();
|
|
|
|
|
+ if (!item.mediaId) {
|
|
|
|
|
+ wx.uploadImage({
|
|
|
|
|
+ localId: item.mediaFileUrl,
|
|
|
|
|
+ isShowProgressTips: 0, // 默认为1,显示进度提示
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ this.mediaInfos.push({
|
|
|
|
|
+ mediaId: res.serverId,
|
|
|
|
|
+ mediaFileUrl: item.mediaFileUrl,
|
|
|
|
|
+ });
|
|
|
|
|
+ this.syncUpload(imgArr, callback);
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.mediaInfos.push(item);
|
|
|
|
|
+ this.syncUpload(imgArr, callback);
|
|
|
}
|
|
}
|
|
|
- await this.addCollection(formData);
|
|
|
|
|
- } catch (err) {
|
|
|
|
|
- this.$toast(err.message || '提交失败,请稍后再试');
|
|
|
|
|
- } finally {
|
|
|
|
|
- this.toastLoading().clear();
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
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);
|
|
@@ -474,7 +483,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
.itemBottom {
|
|
.itemBottom {
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- width: 35px;
|
|
|
|
|
|
|
+ width: 60px;
|
|
|
margin-left: 5px;
|
|
margin-left: 5px;
|
|
|
img {
|
|
img {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
@@ -492,14 +501,12 @@ export default {
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
|
-// .taskPhotoTaking {
|
|
|
|
|
-// .itenHtml {
|
|
|
|
|
-// overflow: hidden;
|
|
|
|
|
-// img {
|
|
|
|
|
-// width: 100%;
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+.taskPhotoTaking {
|
|
|
|
|
+ .van-button--danger {
|
|
|
|
|
+ background-color: #ee0a24 !important;
|
|
|
|
|
+ border: 1px solid #ee0a24 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
.identifyResultdialog {
|
|
.identifyResultdialog {
|
|
|
width: vw(690) !important;
|
|
width: vw(690) !important;
|
|
|
margin-top: 1vh !important;
|
|
margin-top: 1vh !important;
|