|
|
@@ -113,7 +113,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { getCollectionInfosBatch } from '@/api/index';
|
|
|
+import { getCollectionInfosBatch, addCollectionAnswerBatch, getVisitsDetail } from '@/api/index';
|
|
|
import taskTips from './taskTips';
|
|
|
import deleteUploadImg from '@/components/deleteUploadImgTaskPhoto';
|
|
|
export default {
|
|
|
@@ -139,9 +139,25 @@ export default {
|
|
|
this.storeGroupId = this.$route.query.storeGroupId || '';
|
|
|
this.objectType = this.$route.query.photoType || '';
|
|
|
this.insert = this.$route.query.insert;
|
|
|
- this.getDetaile();
|
|
|
+ if (this.$route.query.source == 'historicalDetails') {
|
|
|
+ this.getVisitsDetailFun();
|
|
|
+ } else {
|
|
|
+ this.getDetaile();
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
+ getVisitsDetailFun() {
|
|
|
+ this.toastLoading(0, '加载中...', true);
|
|
|
+ getVisitsDetail({ visitsId: this.visitsId }).then((res) => {
|
|
|
+ this.toastLoading().clear();
|
|
|
+ if (res.data.sfaTaskList) {
|
|
|
+ this.dataList = res.data.sfaTaskList.filter((val) => val.taskType == '5');
|
|
|
+ this.formData = this.dataList[0];
|
|
|
+ } else {
|
|
|
+ this.formData = null;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
getDetaile() {
|
|
|
console.log(this.$route.query);
|
|
|
getCollectionInfosBatch({
|
|
|
@@ -163,7 +179,25 @@ export default {
|
|
|
this.taskPhotoRecognitionResult = item.taskPhotoRecognitionResult;
|
|
|
},
|
|
|
onSubmit() {
|
|
|
- this.$router.go(-1);
|
|
|
+ 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: true,
|
|
|
+ collectionAnswers: [],
|
|
|
+ checkUnManage: 'N',
|
|
|
+ deviceCode: '',
|
|
|
+ putInCode: '',
|
|
|
+ equipmentCode: '',
|
|
|
+ };
|
|
|
+ addCollectionAnswerBatch(formData).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ localStorage.setItem('getRequestFlage', 'true');
|
|
|
+ this.$router.go(-1);
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
onClickLeft() {
|
|
|
this.$router.go(-1);
|