zhujindu 1 年間 前
コミット
6fdc3e3abb
2 ファイル変更103 行追加40 行削除
  1. 58 40
      src/components/uploadVNormal.vue
  2. 45 0
      src/views/deviceWithin/addStoreVisit.vue

+ 58 - 40
src/components/uploadVNormal.vue

@@ -8,47 +8,55 @@
 </template>
 
 <script>
-import { addstorePhoto, addVisitsPosition } from "@/api/index";
-import axios from "axios";
+import { addstorePhoto, addVisitsPosition } from '@/api/index';
+import axios from 'axios';
 
 export default {
-  name: "uploadImg",
+  name: 'uploadImg',
   props: {
     uploadid: {
       type: String,
-      default: "",
+      default: '',
     },
     storeGroupId: {
       type: String,
-      default: "",
+      default: '',
     },
     parentCollectionId: {
       type: String,
-      default: "",
+      default: '',
     },
     secondCollectionId: {
       type: String,
-      default: "",
+      default: '',
     },
     firstCollectionId: {
       type: String,
-      default: "",
+      default: '',
+    },
+    fourthCollectionId: {
+      type: String,
+      default: '',
+    },
+    thirdCollectionId: {
+      type: String,
+      default: '',
     },
     visitsId: {
       type: String,
-      default: "",
+      default: '',
     },
     taskId: {
       type: String,
-      default: "",
+      default: '',
     },
     collectionId: {
       type: String,
-      default: "",
+      default: '',
     },
     objectType: {
       type: String,
-      default: "",
+      default: '',
     },
     type: {
       type: Number,
@@ -62,26 +70,26 @@ export default {
     },
     visitModel: {
       type: String,
-      default: "1",
+      default: '1',
     },
     deviceCode: {
       type: String,
-      default: "",
+      default: '',
     },
     putInCode: {
       type: String,
-      default: "",
+      default: '',
     },
   },
   data() {
     return {
       shows: false,
-      url: "",
+      url: '',
     };
   },
   methods: {
     uploadImg() {
-      var map = new TMap.Map("allmap", {
+      var map = new TMap.Map('allmap', {
         zoom: 14,
         center: new TMap.LatLng(39.986785, 116.301012),
       });
@@ -93,19 +101,19 @@ export default {
       });
       markers.setGeometries([]);
 
-      if (this.objectType == "" || this.objectType == null) {
-        this.$toast("请选择类型!");
+      if (this.objectType == '' || this.objectType == null) {
+        this.$toast('请选择类型!');
         return;
       }
       let url = window.location.href;
       let that = this;
       let wx = this.wx;
       let qiyeData;
-      let addressesRemark = "";
+      let addressesRemark = '';
       const instance = axios.create();
-      instance.defaults.headers.common["userId"] = localStorage.getItem("loginName");
+      instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
       instance
-        .get(process.env.VUE_APP_BASE_API + "mobile/wx/ticket", {
+        .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
           params: {
             url: url,
           },
@@ -120,17 +128,17 @@ export default {
               timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
               nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
               signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
-              jsApiList: ["ready", "chooseImage", "uploadImage", "getLocation"], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
+              jsApiList: ['ready', 'chooseImage', 'uploadImage', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
             });
             wx.ready(function () {
               wx.getLocation({
-                type: "gcj02",
+                type: 'gcj02',
                 success: function (res) {
                   var location = new TMap.LatLng(res.latitude, res.longitude);
                   map.setCenter(location);
                   markers.updateGeometries([
                     {
-                      id: "main", // 点标注数据数组
+                      id: 'main', // 点标注数据数组
                       position: location,
                     },
                   ]);
@@ -140,24 +148,24 @@ export default {
                       addressesRemark = addresses.recommend;
                     },
                     function (err) {
-                      addressesRemark = "";
+                      addressesRemark = '';
                     }
                   );
                 },
                 fail: function () {
                   that.$dialog.alert({
-                    message: "GPS未开启",
+                    message: 'GPS未开启',
                   });
                 },
               });
               wx.chooseImage({
                 count: 1,
-                sizeType: ["compressed"], // 可以指定是原图还是压缩图,默认二者都有
-                sourceType: ["camera"], // 可以指定来源是相册还是相机,默认二者都有
-                defaultCameraMode: "normal", //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
+                sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
+                sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
+                defaultCameraMode: 'normal', //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
                 isSaveToAlbum: 0,
                 success: function (res) {
-                  var localIds = "";
+                  var localIds = '';
                   if (res.localIds != undefined) {
                     localIds = res.localIds[0];
                   } else {
@@ -179,45 +187,55 @@ export default {
     uploadImagev(meidaId, addressesRemark) {
       var that = this;
       var parentCollectionId = null;
-      if (that.parentCollectionId != null && that.parentCollectionId != "null") {
+      if (that.parentCollectionId != null && that.parentCollectionId != 'null') {
         parentCollectionId = that.parentCollectionId;
       }
       var secondCollectionId = null;
-      if (that.secondCollectionId != null && that.secondCollectionId != "null") {
+      if (that.secondCollectionId != null && that.secondCollectionId != 'null') {
         secondCollectionId = that.secondCollectionId;
       }
       var firstCollectionId = null;
-      if (that.firstCollectionId != null && that.firstCollectionId != "null") {
+      if (that.firstCollectionId != null && that.firstCollectionId != 'null') {
         firstCollectionId = that.firstCollectionId;
       }
+      var fourthCollectionId = null;
+      if (that.fourthCollectionId != null && that.fourthCollectionId != 'null') {
+        fourthCollectionId = that.fourthCollectionId;
+      }
+      var thirdCollectionId = null;
+      if (that.thirdCollectionId != null && that.thirdCollectionId != 'null') {
+        thirdCollectionId = that.thirdCollectionId;
+      }
       var form = {
         mediaId: meidaId,
         collectionItemId: that.collectionId,
         objectType: that.objectType,
         storeGroupId: that.storeGroupId,
         taskId: that.taskId,
-        visitsId: localStorage.getItem("visitId"),
+        visitsId: localStorage.getItem('visitId'),
         visitModel: that.visitModel,
-        visitSource: "1",
+        visitSource: '1',
         locationRemark: addressesRemark,
         parentCollectionId: parentCollectionId,
         secondCollectionId: secondCollectionId,
         firstCollectionId: firstCollectionId,
+        fourthCollectionId: fourthCollectionId,
+        thirdCollectionId: thirdCollectionId,
         deviceCode: that.deviceCode, //设备编号
         putInCode: that.putInCode, //投放编号
       };
       var loind1 = that.$toast.loading({
         duration: 0,
-        message: "上传中...",
+        message: '上传中...',
         forbidClick: true,
       });
       addstorePhoto(form).then((res) => {
         if (res.code == 200) {
           loind1.clear();
-          that.$toast("上传成功!");
-          that.$emit("newimgarr", { fileUrl: res.data.url, id: res.data.fileId, type: 2 });
+          that.$toast('上传成功!');
+          that.$emit('newimgarr', { fileUrl: res.data.url, id: res.data.fileId, type: 2 });
         } else {
-          that.$toast("上传失败!");
+          that.$toast('上传失败!');
         }
       });
     },

+ 45 - 0
src/views/deviceWithin/addStoreVisit.vue

@@ -2900,6 +2900,51 @@ export default {
           }
         }
       }
+      if (val.type == 'F') {
+        this.collectionItemList[val.index].collectionOptionList[val.index1].collectionItems[
+          val.index2
+        ].collectionOptionList[val.index3].collectionItems[val.index4].collectionOptionList[
+          val.index5
+        ].collectionItems[val.index6].collectionOptionList[val.index7].collectionItems[
+          val.index8
+        ].collectionOptionList[0].answerValue = val.code;
+        this.collectionItemList[val.index].collectionOptionList[val.index1].collectionItems[
+          val.index2
+        ].collectionOptionList[val.index3].collectionItems[val.index4].collectionOptionList[
+          val.index5
+        ].collectionItems[val.index6].collectionOptionList[val.index7].collectionItems[
+          val.index8
+        ].equipmentCode2 = val.code.split(',')[1];
+        this.collectionItemList[val.index].collectionOptionList[val.index1].collectionItems[
+          val.index2
+        ].collectionOptionList[val.index3].collectionItems[val.index4].collectionOptionList[
+          val.index5
+        ].collectionItems[val.index6].collectionOptionList[val.index7].collectionItems[
+          val.index8
+        ].success = val.success;
+        var b5list =
+          this.collectionItemList[val.index].collectionOptionList[val.index1].collectionItems[
+            val.index2
+          ].collectionOptionList[val.index3].collectionItems[val.index4].collectionOptionList[
+            val.index5
+          ].collectionItems[val.index6].collectionOptionList[val.index7].collectionItems;
+        for (let smcip = 0; smcip < b5list.length; smcip++) {
+          if (b5list[smcip].collectionId == val.cid) {
+            let smchild = b5list[smcip].collectionOptionList;
+            for (let smcipchile = 0; smcipchile < smchild.length; smcipchile++) {
+              if (smchild[smcipchile].collectionOptionId == val.cpid) {
+                b5list[smcip].answerValue = val.cpid + '';
+                b5list[smcip].collectionOptionList[smcipchile].isCheck = 1;
+              }
+            }
+            for (let smnocipchile = 0; smnocipchile < smchild.length; smnocipchile++) {
+              if (smchild[smnocipchile].collectionOptionId == val.nocpid) {
+                b5list[smcip].collectionOptionList[smnocipchile].unableChoose = true;
+              }
+            }
+          }
+        }
+      }
     },
     inputbluwl(val, index, num) {
       if ((val + '').trim() == '') {