Quellcode durchsuchen

渠道客诉填写任务增加上传照片功能

zhujindu vor 11 Monaten
Ursprung
Commit
1d1600d48f

+ 9 - 1
src/components/uploadImgVStorec.vue

@@ -48,6 +48,10 @@ export default {
       type: String,
       default: '',
     },
+    itemData: {
+      type: Object,
+      default: {},
+    },
   },
   data() {
     return {
@@ -137,7 +141,11 @@ export default {
           });
           loind1.clear();
           that.$toast('上传成功!');
-          that.$emit('newimgarr', { fileUrl: imgArr.join(','), type: that.type });
+          that.$emit('newimgarr', {
+            fileUrl: imgArr.join(','),
+            type: that.type,
+            itemData: itemData,
+          });
         } else {
           that.$toast('上传失败!');
         }

+ 23 - 30
src/layout/index.vue

@@ -1,48 +1,41 @@
 <template>
   <div class="container bgcolor">
     <keep-alive>
-      <router-view :key="$route.fullPath"/>
+      <router-view :key="$route.fullPath" />
     </keep-alive>
   </div>
 </template>
 <script>
 export default {
   created() {
-    if(this.$route.query.token!=undefined){
-      localStorage.setItem("loginName",this.$route.query.token)
+    if (this.$route.query.token != undefined) {
+      localStorage.setItem('loginName', this.$route.query.token);
+    }
+    if (process.env.NODE_ENV != 'development') {
+      var ua = window.navigator.userAgent.toLowerCase();
+      if (ua.match(/MicroMessenger/i) == 'micromessenger' && ua.match(/wxwork/i) == 'wxwork') {
+      } else {
+        if (process.env.NODE_ENV == 'production') {
+          this.$router.push('/err');
+        }
+      }
     }
-   if(process.env.NODE_ENV!="development"){
-     var ua= window.navigator.userAgent.toLowerCase();
-     if( (ua.match(/MicroMessenger/i) == 'micromessenger') && (ua.match(/wxwork/i) == 'wxwork') ){
-
-     }else{
-       if(localStorage.getItem("loginName")=="lihaoyang.sm"||localStorage.getItem("loginName")=="zhangjunyang.sm"||localStorage.getItem("loginName")=="wukang"){
-
-       }else{
-         this.$router.push("/err")
-       }
-     }
-   }
   },
   watch: {
     $route(to, from) {
-      if(this.$route.query.token!=undefined){
-        localStorage.setItem("loginName",this.$route.query.token)
+      if (this.$route.query.token != undefined) {
+        localStorage.setItem('loginName', this.$route.query.token);
       }
-      if(process.env.NODE_ENV!="development"){
-        var ua= window.navigator.userAgent.toLowerCase();
-        if( (ua.match(/MicroMessenger/i) == 'micromessenger') && (ua.match(/wxwork/i) == 'wxwork') ){
-
-        }else{
-          if(localStorage.getItem("loginName")=="lihaoyang.sm"||localStorage.getItem("loginName")=="zhangjunyang.sm"){
-
-          }else{
-            this.$router.push("/err")
+      if (process.env.NODE_ENV != 'development') {
+        var ua = window.navigator.userAgent.toLowerCase();
+        if (ua.match(/MicroMessenger/i) == 'micromessenger' && ua.match(/wxwork/i) == 'wxwork') {
+        } else {
+          if (process.env.NODE_ENV == 'production') {
+            this.$router.push('/err');
           }
         }
       }
-    }
-  }
-}
+    },
+  },
+};
 </script>
-

+ 52 - 2
src/views/clew/complaintDetail/radioGroup.vue

@@ -1,11 +1,15 @@
 <template>
   <div class="radioGroup">
     <template v-for="(val, ind) in clueOptionList">
-      <div class="title" v-if="val.customerClueName">
+      <!-- <div class="title" v-if="val.customerClueName">
         <span class="van-f-red" v-if="val.isMust == 0">*</span>
         {{ val.customerClueName }}
-      </div>
+      </div> -->
       <template v-if="val.answerType == 'dx'">
+        <div class="title" v-if="val.customerClueName">
+          <span class="van-f-red" v-if="val.isMust == 0">*</span>
+          {{ val.customerClueName }}
+        </div>
         <van-radio-group v-model="val.searchValue" @change="radioGroupChange">
           <template v-for="(item, index) in val.customerClueOptionList">
             <van-radio :name="item.customerClueOptionId" :key="index" @click="radioClick">
@@ -21,6 +25,10 @@
       </template>
       <!-- 回答类型:wb-文本,sz-数字,rq-日期,zp-照片,dx -->
       <template v-if="val.answerType == 'wb'">
+        <div class="title" v-if="val.customerClueName">
+          <span class="van-f-red" v-if="val.isMust == 0">*</span>
+          {{ val.customerClueName }}
+        </div>
         <template v-if="parentOptionList.searchValue == val.itemOptionParentId">
           <van-field
             v-model="val.answerValue"
@@ -39,6 +47,10 @@
         </template>
       </template>
       <template v-if="val.answerType == 'sz'">
+        <div class="title" v-if="val.customerClueName">
+          <span class="van-f-red" v-if="val.isMust == 0">*</span>
+          {{ val.customerClueName }}
+        </div>
         <van-field
           class="fieldInput"
           v-model="val.answerValue"
@@ -47,11 +59,42 @@
           :error-message="val.remark"
           type="number"></van-field>
       </template>
+      <template v-if="val.answerType == 'zp'">
+        <van-cell>
+          <template #title>
+            <span v-if="val.isMust == 0" class="van-f-red">*</span>
+            {{ val.customerClueName }}
+            <!-- 操作说明图片和电话 -->
+            <taskTips
+              v-if="val.contactPhone || val.examplePhoto"
+              :contactPhone="val.contactPhone"
+              :examplePhoto="val.examplePhoto">
+            </taskTips>
+          </template>
+          <template #right-icon>
+            <span v-if="val.isMustPicture == '0'" style="color: red">图片必填</span>
+            <div class="uploadImg" style="width: 30px">
+              <upload-imgc
+                uploadid="uploadid2"
+                :itemData="val"
+                :imgArr="val.answerValue"
+                @newimgarr="newimgarr1"
+                :type="3"></upload-imgc>
+            </div>
+            <!-- <van-icon color="#666" name="photograph" size="24" @click="imgClick(val)" /> -->
+          </template>
+        </van-cell>
+        <deleteImgView :imgs="val.answerValue"></deleteImgView>
+      </template>
     </template>
   </div>
 </template>
 <script>
+import taskTips from '@/views/deviceWithin/taskTips';
+import deleteImgView from '@/components/deleteUploadImg3';
+import uploadImgc from '@/components/uploadImgVStorec';
 export default {
+  components: { deleteImgView, taskTips, uploadImgc },
   name: 'radioGroup',
   props: {
     clueOptionList: {
@@ -116,6 +159,13 @@ export default {
     radioClick(event) {
       // console.log(event);
     },
+    imgClick(val) {
+      this.show = true;
+    },
+    newimgarr1(val) {
+      console.lg(val);
+      // this.fromValue.carShopImgList.push(val.fileUrl);
+    },
   },
 };
 </script>