Przeglądaj źródła

Merge branch 'feature_20250415_公装主管任务' into release

zhujindu 7 miesięcy temu
rodzic
commit
8b6bb64e21

+ 0 - 1
src/api/index.js

@@ -565,7 +565,6 @@ export function getSummaryMobilo(query) {
   return request({
     url: '/mobile/summaryMobile/' + query.userSummaryId,
     method: 'get',
-    params: query,
   });
 }
 

+ 8 - 0
src/api/week.js

@@ -17,3 +17,11 @@ export function setPhotoMethod(query) {
     params: query,
   });
 }
+
+export function writeAgainCustomAnswer(data) {
+  return request({
+    url: '/mobile/summaryMobile/writeAgainCustomAnswer',
+    method: 'post',
+    data,
+  });
+}

+ 23 - 9
src/components/deleteUploadImg2.vue

@@ -2,7 +2,7 @@
   <div>
     <van-col span="6" v-for="(urls, index) in imgs" :key="index">
       <div class="imgview2">
-        <van-icon name="close" size="16" v-on:click="deleteImg(index, urls.id)" />
+        <van-icon name="close" size="16" v-on:click="deleteImg(index, urls.id)" v-if="isEdit" />
         <img
           v-if="urls.type == '2'"
           :src="urls.fileUrl"
@@ -35,6 +35,16 @@ export default {
         return [];
       },
     },
+    // 是否允许补填
+    isEdit: {
+      type: Boolean,
+      default: true,
+    },
+    // 是否请求接口删除
+    isDelete: {
+      type: Boolean,
+      default: true,
+    },
   },
   data() {
     return {
@@ -46,14 +56,18 @@ export default {
       var fileName = {
         fileId: collectionItemId,
       };
-      removeSummaryPhoto(fileName).then((res) => {
-        if (res.code == 200) {
-          this.$toast('删除成功!');
-          this.imgs.splice(index, 1);
-        } else {
-          this.$toast('删除失败!');
-        }
-      });
+      if (this.isDelete) {
+        removeSummaryPhoto(fileName).then((res) => {
+          if (res.code == 200) {
+            this.$toast('删除成功!');
+            this.imgs.splice(index, 1);
+          } else {
+            this.$toast('删除失败!');
+          }
+        });
+      } else {
+        this.imgs.splice(index, 1);
+      }
     },
     previewsImg(index) {
       var arrimg = [];

+ 128 - 110
src/components/uploadVTask.vue

@@ -3,8 +3,7 @@
     <!--    <van-uploader :after-read="afterRead" upload-text="照片上传"/>-->
     <div class="uploaderImage">
       <p class="coverImg" @click="uploadImg">
-        <van-icon class="photo ico" name="photograph" size="16px" color="#969696">
-        </van-icon>
+        <van-icon class="photo ico" name="photograph" size="16px" color="#969696"> </van-icon>
         <span>{{ imgText }}</span>
       </p>
     </div>
@@ -13,62 +12,67 @@
 </template>
 
 <script>
-import {ImagePreview} from "vant";
-import {addPhotov} from "@/api/index";
-import axios from "axios";
+import { ImagePreview } from 'vant';
+import { addPhotov } from '@/api/index';
+import axios from 'axios';
 
 export default {
   name: 'uploadImg',
   props: {
     uploadid: {
       type: String,
-      default: ''
+      default: '',
     },
     imgText: {
       type: String,
-      default: ''
+      default: '',
     },
-    indexImg:{
+    indexImg: {
       type: Number,
-      default: 0
+      default: 0,
     },
     visitsId: {
       type: String,
-      default: ''
+      default: '',
     },
     customId: {
-      type: String  | Number,
-      default: ''
+      type: String | Number,
+      default: '',
     },
     summaryId: {
-      type: String  | Number,
-      default: ''
+      type: String | Number,
+      default: '',
     },
     type: {
       type: Number,
-      default: 1
+      default: 1,
     },
     imgArr: {
       type: String,
-      default: ''
+      default: '',
+    },
+    // 是否补填
+    allowWriteAgain: {
+      type: Boolean,
+      default: false,
     },
   },
   data() {
     return {
       shows: false,
-      url: ""
-    }
+      url: '',
+    };
   },
   methods: {
     deleteImgs(val) {
       ImagePreview([val]);
     },
-    uploadImg(){
+    uploadImg() {
       let url = window.location.href;
       let that = this;
-      let wx = this.wx
-      let qiyeData
-      let addressesRemark=""
+      let wx = this.wx;
+      let qiyeData;
+      let addressesRemark = '';
       var map = new TMap.Map('allmap', {
         zoom: 14,
         center: new TMap.LatLng(39.986785, 116.301012),
@@ -81,105 +85,118 @@ export default {
       });
       markers.setGeometries([]);
       const instance = axios.create();
-      instance.defaults.headers.common['userId'] = localStorage.getItem("loginName");
-      instance.get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket',
-          {
-            params: {
-              url: url
-            }
-          }).then(response => {
-        if (response.status == 200) {
-          qiyeData = response.data.data;
-          wx.config({
-            beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
-            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-            appId: qiyeData.appId, // 必填,企业微信的corpID
-            timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
-            nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
-            signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
-            jsApiList: ["ready", "chooseImage","uploadImage","getLocation"] // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
-          });
-          wx.ready(function () {
-            wx.getLocation({
-              type: 'gcj02',
-              success: function (res) {
-                var location = new TMap.LatLng(res.latitude, res.longitude);
-                map.setCenter(location);
-                markers.updateGeometries([
-                  {
-                    id: 'main', // 点标注数据数组
-                    position: location,
-                  },
-                ]);
-                geocoder
-                    .getAddress({ location: location })
-                    .then(function(result){
-                      var addresses=result.result.formatted_addresses
-                      addressesRemark=addresses.recommend
-                    },function(err){
-                      addressesRemark=""
-                    })
-              },
-              fail: function () {
-                that.$dialog.alert({
-                  message: 'GPS未开启',
-                })
-              }
+      instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
+      instance
+        .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
+          params: {
+            url: url,
+          },
+        })
+        .then((response) => {
+          if (response.status == 200) {
+            qiyeData = response.data.data;
+            wx.config({
+              beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
+              debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+              appId: qiyeData.appId, // 必填,企业微信的corpID
+              timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
+              nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
+              signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
+              jsApiList: ['ready', 'chooseImage', 'uploadImage', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
             });
-            wx.chooseImage({
-              count: 1,
-              sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
-              sourceType:['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
-              defaultCameraMode: "normal", //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
-              isSaveToAlbum:0,
-              success: function (res) {
-                var localIds=""
-                if(res.localIds!=undefined){
-                  localIds= res.localIds[0]
-                }else{
-                  localIds=res.localId
-                }
-                // andriod中localId可以作为img标签的src属性显示图片;
-                // iOS应当使用 getLocalImgData 获取图片base64数据,从而用于img标签的显示(在img标签内使用 wx.chooseImage 的 localid 显示可能会不成功)
-                wx.uploadImage({
-                  localId: localIds, // 需要上传的图片的本地ID,由chooseImage接口获得
-                  isShowProgressTips: 1, // 默认为1,显示进度提示
-                  success: function (res) {
-                    that.uploadImagev(res.serverId,addressesRemark)
+            wx.ready(function () {
+              wx.getLocation({
+                type: 'gcj02',
+                success: function (res) {
+                  var location = new TMap.LatLng(res.latitude, res.longitude);
+                  map.setCenter(location);
+                  markers.updateGeometries([
+                    {
+                      id: 'main', // 点标注数据数组
+                      position: location,
+                    },
+                  ]);
+                  geocoder.getAddress({ location: location }).then(
+                    function (result) {
+                      var addresses = result.result.formatted_addresses;
+                      addressesRemark = addresses.recommend;
+                    },
+                    function (err) {
+                      addressesRemark = '';
+                    }
+                  );
+                },
+                fail: function () {
+                  that.$dialog.alert({
+                    message: 'GPS未开启',
+                  });
+                },
+              });
+              wx.chooseImage({
+                count: 1,
+                sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
+                sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
+                defaultCameraMode: 'normal', //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
+                isSaveToAlbum: 0,
+                success: function (res) {
+                  var localIds = '';
+                  if (res.localIds != undefined) {
+                    localIds = res.localIds[0];
+                  } else {
+                    localIds = res.localId;
                   }
-                });
-              }
+                  // andriod中localId可以作为img标签的src属性显示图片;
+                  // iOS应当使用 getLocalImgData 获取图片base64数据,从而用于img标签的显示(在img标签内使用 wx.chooseImage 的 localid 显示可能会不成功)
+                  wx.uploadImage({
+                    localId: localIds, // 需要上传的图片的本地ID,由chooseImage接口获得
+                    isShowProgressTips: 1, // 默认为1,显示进度提示
+                    success: function (res) {
+                      that.uploadImagev(res.serverId, addressesRemark);
+                    },
+                  });
+                },
+              });
             });
-          })
-        }
-      });
+          }
+        });
     },
-    uploadImagev(meidaId,addressesRemark){
+    uploadImagev(meidaId, addressesRemark) {
       var that = this;
-      var form={
-        mediaId:meidaId,
-        customId:that.customId,
-        summaryId:that.summaryId,
-        locationRemark:addressesRemark
-      }
+      var form = {
+        mediaId: meidaId,
+        customId: that.customId,
+        summaryId: that.summaryId,
+        locationRemark: addressesRemark,
+      };
       var loind1 = that.$toast.loading({
         duration: 0,
         message: '上传中...',
         forbidClick: true,
       });
-      addPhotov(form).then(res=>{
+      // 允许补填 添加上补填标识
+      if (this.allowWriteAgain) {
+        form.writeAgain = '1';
+      }
+      addPhotov(form).then((res) => {
         if (res.code == 200) {
-          that.imgArr =  res.data.url
+          that.imgArr = res.data.url;
           loind1.clear();
-          that.$toast("上传成功!")
-          that.$emit('newimgarr', {fileUrl: res.data.url,id:res.data.fileId,fileType:res.fileType,fileName:res.fileName, type: that.type,index:that.indexImg});
+          that.$toast('上传成功!');
+          that.$emit('newimgarr', {
+            fileUrl: res.data.url,
+            id: res.data.fileId,
+            fileType: res.fileType,
+            fileName: res.fileName,
+            type: that.type,
+            index: that.indexImg,
+          });
         } else {
-          that.$toast("上传失败!")
+          that.$toast('上传失败!');
         }
-      })
-    }
+      });
+    },
   },
-}
+};
 </script>
 
 <style scoped>
@@ -221,7 +238,7 @@ export default {
   z-index: 99;
   background-color: rgba(255, 255, 255, 0.8);
   border-bottom-left-radius: 3px;
-  border-top-left-radius: 3px
+  border-top-left-radius: 3px;
 }
 
 .uploaderImage .coverImg {
@@ -233,14 +250,15 @@ export default {
   margin: 0;
   width: 100%;
 }
-.uploaderImage .coverImg span{
+.uploaderImage .coverImg span {
   padding-top: 24px;
-  display: block;text-align: center;
+  display: block;
+  text-align: center;
 }
 .uploaderImage .coverImg .ico {
   top: 30%;
 }
-#allmap{
+#allmap {
   width: 10px;
   height: 10px;
   left: -1000px;

+ 44 - 33
src/components/zCheckbox2.vue

@@ -3,8 +3,13 @@
     <div>
       <div class="checkbox">
         <van-checkbox-group v-model="zSelectValuec" @change="checkboxclick">
-          <van-checkbox :name="item.customOptionId+''" v-for="(item,index) in zCheckboxcolumns" :key="index"
-                        shape="square">{{ item.customOption }}
+          <van-checkbox
+            :disabled="disabled"
+            :name="item.customOptionId + ''"
+            v-for="(item, index) in zCheckboxcolumns"
+            :key="index"
+            shape="square"
+            >{{ item.customOption }}
           </van-checkbox>
         </van-checkbox-group>
       </div>
@@ -14,59 +19,66 @@
 
 <script>
 export default {
-  name: "zSelect",
+  name: 'zSelect',
   props: {
     zCheckboxcolumns: [],
-    checkboxval: "",
-    textc: "",
+    checkboxval: '',
+    textc: '',
     rules: false,
-    answerType: "",
-    collectionType: ""
+    answerType: '',
+    collectionType: '',
+    disabled: false,
   },
   data() {
     return {
       zSelect: false,
-      zSelectValuec: ""
-    }
+      zSelectValuec: '',
+    };
   },
   created() {
-
-    this.checkboxvalFn()
+    this.checkboxvalFn();
   },
   methods: {
     checkboxvalFn() {
-      if (this.checkboxval == "" || this.checkboxval == undefined) {
-        this.zSelectValuec = []
+      if (this.checkboxval == '' || this.checkboxval == undefined) {
+        this.zSelectValuec = [];
       } else {
-        this.zSelectValuec = this.checkboxval.split(",")
+        this.zSelectValuec = this.checkboxval.split(',');
       }
     },
     checkboxclick(value) {
-      var typeval = [...this.zCheckboxcolumns]
-      for (var k = 0; k < typeval.length; k++) {
-        for (var kk = 0; kk < value.length; kk++) {
-          if (typeval[k].customOptionId == value[kk]) {
-            typeval[k].value="Y"
-          }
+      var typeval = [...this.zCheckboxcolumns];
+      typeval.forEach((item) => {
+        if (value.includes(item.customOptionId + '')) {
+          item.value = 'Y';
+        } else {
+          item.value = 'N';
         }
-      }
+      });
+      // for (var k = 0; k < typeval.length; k++) {
+      //   for (var kk = 0; kk < value.length; kk++) {
+      //     if (typeval[k].customOptionId == value[kk]) {
+      //       typeval[k].value = 'Y';
+      //     }
+      //   }
+      // }
       let datalist = {
         id: this.textc,
-        value: typeval
-      }
-      this.zSelectValuec = value
-      this.$emit('zSelectVal', datalist)
-      this.zSelect = false
-    }
-  }
-}
+        value: typeval,
+      };
+      this.zSelectValuec = value;
+      this.$emit('zSelectVal', datalist);
+      this.zSelect = false;
+    },
+  },
+};
 </script>
 
 <style scoped>
 .van-f-red {
   color: red;
   width: 4px;
-  display: inline-block
+  display: inline-block;
 }
 
 .zSelect .z-cell {
@@ -76,9 +88,8 @@ export default {
 
 /*.checkbox{padding: 10px 16px 0 16px;background-color: white;}*/
 .checkbox .van-checkbox {
-  padding-bottom: 10px
+  padding-bottom: 10px;
 }
-
 </style>
 <style>
 .checkbox .van-checkbox__icon .van-icon {
@@ -90,4 +101,4 @@ export default {
   color: #1989fa;
   background-color: #fff;
 }
-</style>
+</style>

+ 30 - 22
src/components/zRadio2.vue

@@ -1,8 +1,14 @@
 <template>
   <div class="zSelect">
     <div class="checkbox">
-      <van-radio-group v-model="zradioc" @change="radiofn">
-        <van-radio :name="item.customOptionId+''" @click="radioclick" v-for="(item,index) in zRadiocolumns" :key="index">{{item.customOption}}</van-radio>
+      <van-radio-group v-model="zradioc" @change="radiofn" :disabled="disabled">
+        <van-radio
+          :name="item.customOptionId + ''"
+          @click="radioclick"
+          v-for="(item, index) in zRadiocolumns"
+          :key="index"
+          >{{ item.customOption }}</van-radio
+        >
       </van-radio-group>
     </div>
   </div>
@@ -10,51 +16,53 @@
 
 <script>
 export default {
-  name: "zSelect",
+  name: 'zSelect',
   props: {
-    radio: "",
-    textc: "",
+    radio: '',
+    textc: '',
     zRadiocolumns: [],
-    answerType: "",
-    collectionType: ""
+    answerType: '',
+    collectionType: '',
+    disabled: false,
   },
   data() {
     return {
       radioChange: false,
-      zradioc: this.radio
-    }
+      zradioc: this.radio,
+    };
   },
   methods: {
     radiofn(value) {
       this.radioChange = true;
-      var typeval =[...this.zRadiocolumns]
+      var typeval = [...this.zRadiocolumns];
       for (var k = 0; k < this.zRadiocolumns.length; k++) {
-        typeval[k].value="N"
+        typeval[k].value = 'N';
         if (this.zRadiocolumns[k].customOptionId == value) {
-          typeval[k].value="Y"
+          typeval[k].value = 'Y';
         }
       }
       let datalist = {
         id: this.textc,
-        value: typeval
-      }
+        value: typeval,
+      };
       this.$emit('zSelectVal', datalist);
     },
     radioclick() {
+      if (this.disabled) return;
       if (!this.radioChange) {
-        this.zradioc = ""
+        this.zradioc = '';
       }
-      this.radioChange = false
+      this.radioChange = false;
     },
-  }
-}
+  },
+};
 </script>
 
 <style scoped>
 .van-f-red {
   color: red;
   width: 4px;
-  display: inline-block
+  display: inline-block;
 }
 
 .zSelect .z-cell {
@@ -63,14 +71,14 @@ export default {
 }
 
 .checkbox .van-radio {
-  padding-bottom: 10px
+  padding-bottom: 10px;
 }
 </style>
 <style>
 .checkbox .van-radio__icon {
   border: 1px solid #333;
   border-radius: 80px;
-  width: 1em
+  width: 1em;
 }
 
 .checkbox .van-radio__icon .van-icon {
@@ -93,4 +101,4 @@ export default {
 .checkbox .van-radio__icon--checked {
   border: 1px solid #1989fa;
 }
-</style>
+</style>

+ 280 - 282
src/views/week/VisitSummary.vue

@@ -1,47 +1,46 @@
 <template>
   <div class="bgcolor">
     <!--        顶部条-->
-    <van-nav-bar
-        class="navBar"
-        title="主管任务查询"
-        left-arrow
-        @click-left="onClickLeft"
-    />
+    <van-nav-bar class="navBar" title="主管任务查询" left-arrow @click-left="onClickLeft" />
     <div class="container contentpd16">
       <van-row gutter="20">
         <van-col span="12">
-          <van-cell :title="companyName"  is-link arrow-direction="down" @click="regionClick"/>
+          <van-cell :title="companyName" is-link arrow-direction="down" @click="regionClick" />
         </van-col>
         <van-col span="12">
-          <van-cell :title="regionName"  is-link @click="SalesRegionClick" arrow-direction="down"/>
+          <van-cell :title="regionName" is-link @click="SalesRegionClick" arrow-direction="down" />
         </van-col>
         <van-col span="24">
-          <van-cell :title="deptName" is-link @click="SalesDepartmentClick" arrow-direction="down"/>
+          <van-cell
+            :title="deptName"
+            is-link
+            @click="SalesDepartmentClick"
+            arrow-direction="down" />
         </van-col>
-<!--        <van-col span="12">-->
-<!--          <van-cell :title="userName" is-link @click="StaffClick" arrow-direction="down"/>-->
-<!--        </van-col>-->
+        <!--        <van-col span="12">-->
+        <!--          <van-cell :title="userName" is-link @click="StaffClick" arrow-direction="down"/>-->
+        <!--        </van-col>-->
         <van-col span="12">
           <van-cell :title="formData.startTime" is-link @click="StartTimeClick">
             <template #right-icon>
-              <van-icon :name="timeico" class="search-icon"/>
+              <van-icon :name="timeico" class="search-icon" />
             </template>
           </van-cell>
         </van-col>
         <van-col span="12">
           <van-cell :title="formData.endTime" is-link @click="EndTimeClick">
             <template #right-icon>
-              <van-icon :name="timeico" class="search-icon"/>
+              <van-icon :name="timeico" class="search-icon" />
             </template>
           </van-cell>
         </van-col>
         <van-col span="24">
           <van-cell class="inputSearch">
-            <van-field  v-model="formData.summaryTaskName" placeholder="请输入任务名称" />
+            <van-field v-model="formData.summaryTaskName" placeholder="请输入任务名称" />
           </van-cell>
         </van-col>
       </van-row>
-      <br>
+      <br />
       <van-button type="info" size="small" plain class="Btn100" @click="searchBtn">查找</van-button>
     </div>
     <!--    <div class="container">-->
@@ -54,89 +53,87 @@
     <!--      </div>-->
     <!--    </div>-->
     <div class="container">
-      <van-list v-model="loading" :finished="finished" @load="onLoad" finished-text="--已经到底了--">
-        <div class="cellcontent brud" v-for="(item,index) in list" :key="index">
+      <van-list
+        v-model="loading"
+        :finished="finished"
+        @load="onLoad"
+        finished-text="--已经到底了--">
+        <div class="cellcontent brud" v-for="(item, index) in list" :key="index">
           <van-cell>
             <div class="cardContent" @click="dailyFn(item)">
-              <div class="title"  >
-                <p class="textLeft">{{item.nickName}}的{{item.summaryTaskName}}</p>
+              <div class="title">
+                <p class="textLeft">{{ item.nickName }}的{{ item.summaryTaskName }}</p>
               </div>
-              <div class="info">提交时间:{{item.createTime}}</div>
+              <div class="info">提交时间:{{ item.createTime }}</div>
             </div>
           </van-cell>
         </div>
-        <van-empty  v-if="list.length==0"/>
+        <van-empty v-if="list.length == 0" />
       </van-list>
     </div>
-    <br>
-    <br>
+    <br />
+    <br />
     <van-popup v-model="RegionShow" capture position="bottom">
       <van-picker
-          show-toolbar
-          :columns="companyList"
-          value-key="deptName"
-          @confirm="onregionConfirm"
-          @cancel="RegionShow = false"
-      />
+        show-toolbar
+        :columns="companyList"
+        value-key="deptName"
+        @confirm="onregionConfirm"
+        @cancel="RegionShow = false" />
     </van-popup>
     <van-popup v-model="SalesRegionShow" capture position="bottom">
       <van-picker
-          show-toolbar
-          :columns="regionList"
-          value-key="deptName"
-          @confirm="onSalesRegionConfirm"
-          @cancel="SalesRegionShow = false"
-      />
+        show-toolbar
+        :columns="regionList"
+        value-key="deptName"
+        @confirm="onSalesRegionConfirm"
+        @cancel="SalesRegionShow = false" />
     </van-popup>
     <van-popup v-model="SalesDepartmentShow" capture position="bottom">
       <van-picker
-          show-toolbar
-          :columns="deptList"
-          value-key="deptName"
-          @confirm="onSalesDepartmentConfirm"
-          @cancel="SalesDepartmentShow = false"
-      />
+        show-toolbar
+        :columns="deptList"
+        value-key="deptName"
+        @confirm="onSalesDepartmentConfirm"
+        @cancel="SalesDepartmentShow = false" />
     </van-popup>
     <van-popup v-model="StaffShow" capture position="bottom">
       <van-picker
-          show-toolbar
-          :columns="userList"
-          @confirm="onStaffConfirm"
-          value-key="nickName"
-          @cancel="StaffShow = false"
-      />
+        show-toolbar
+        :columns="userList"
+        @confirm="onStaffConfirm"
+        value-key="nickName"
+        @cancel="StaffShow = false" />
     </van-popup>
 
     <van-popup v-model="StartTimeShow" capture position="bottom">
       <van-datetime-picker
-          v-model="strtcurrentDate"
-          type="date"
-          title="选择查找开始时间"
-          :min-date="strtminDate"
-          :max-date="strtmaxDate"
-          @confirm="onStartTimeConfirm"
-          @cancel="StartTimeShow = false"
-      />
+        v-model="strtcurrentDate"
+        type="date"
+        title="选择查找开始时间"
+        :min-date="strtminDate"
+        :max-date="strtmaxDate"
+        @confirm="onStartTimeConfirm"
+        @cancel="StartTimeShow = false" />
     </van-popup>
     <van-popup v-model="EndTimeShow" capture position="bottom">
       <van-datetime-picker
-          v-model="endcurrentDate"
-          type="date"
-          title="选择查找结束时间"
-          :min-date="endminDate"
-          :max-date="endmaxDate"
-          @confirm="onEndTimeConfirm"
-          @cancel="EndTimeShow = false"
-      />
+        v-model="endcurrentDate"
+        type="date"
+        title="选择查找结束时间"
+        :min-date="endminDate"
+        :max-date="endmaxDate"
+        @confirm="onEndTimeConfirm"
+        @cancel="EndTimeShow = false" />
     </van-popup>
   </div>
 </template>
 
 <script>
-import timeico from "@/assets/Icon/datatims.png";
-import {getDeptInfo,getSummaryMobileDeptInfo,queryHistorySummaryList} from "@/api/index";
+import timeico from '@/assets/Icon/datatims.png';
+import { getDeptInfo, getSummaryMobileDeptInfo, queryHistorySummaryList } from '@/api/index';
 export default {
-  name: "MyHistoricalWeekly",
+  name: 'MyHistoricalWeekly',
   data() {
     return {
       timeico: timeico,
@@ -146,95 +143,95 @@ export default {
       StaffShow: false,
       StartTimeShow: false,
       EndTimeShow: false,
-      PhotoTypeList: [{text: "009", value: "09"}],
+      PhotoTypeList: [{ text: '009', value: '09' }],
       strtminDate: new Date(2022, 0, 1),
       endminDate: new Date(2022, 0, 1),
       strtmaxDate: new Date(),
       endmaxDate: new Date(),
       strtcurrentDate: new Date(),
       endcurrentDate: new Date(),
-      companyName:"全部公司",
-      deptName:"全部销售部",
-      regionName:"全部大区",
-      userName:"全部业务员",
-      companyCode:"",
-      deptCode:"",
-      regionCode:"",
-      userCode:"",
-      companyList:[],
-      deptList:[],
-      regionList:[],
-      userList:[],
-      deptForm:{type:"",parentId:""},
-      list:[],
+      companyName: '全部公司',
+      deptName: '全部销售部',
+      regionName: '全部大区',
+      userName: '全部业务员',
+      companyCode: '',
+      deptCode: '',
+      regionCode: '',
+      userCode: '',
+      companyList: [],
+      deptList: [],
+      regionList: [],
+      userList: [],
+      deptForm: { type: '', parentId: '' },
+      list: [],
       loading: false,
       finished: true,
-      formData:{
-        type:"1", // 汇报类型或入口 1-下属业务员日报 2-下属销售部主管周报 3-下属大区主管半月报
-        companyId:"", // 公司id,必传 Long类型
-        regionId:"", // 大区id,必传  Long类型
-        deptId:"", // 部门id,如果为周报或日报为必传  Long类型
-        userId:"", // 业务员id,如果为日报为必传      Long类型
-        startTime:"", // 开始时间,必传  格式:yyyy-MM-dd  String类型
-        endTime:"", // 结束时间,必传  格式:yyyy-MM-dd  String类型
-        pageNum:1 , // 当前页码  int类型
-        pageSize:10, // 当前每页条数  int类型
+      formData: {
+        type: '1', // 汇报类型或入口 1-下属业务员日报 2-下属销售部主管周报 3-下属大区主管半月报
+        companyId: '', // 公司id,必传 Long类型
+        regionId: '', // 大区id,必传  Long类型
+        deptId: '', // 部门id,如果为周报或日报为必传  Long类型
+        userId: '', // 业务员id,如果为日报为必传      Long类型
+        startTime: '', // 开始时间,必传  格式:yyyy-MM-dd  String类型
+        endTime: '', // 结束时间,必传  格式:yyyy-MM-dd  String类型
+        pageNum: 1, // 当前页码  int类型
+        pageSize: 10, // 当前每页条数  int类型
       },
-      tableList:[]
-    }
+      tableList: [],
+    };
   },
   created() {
-    this.userList=[]
-    this.formData.startTime =this.getThreeDaysAgo()
+    this.userList = [];
+    this.formData.startTime = this.getThreeDaysAgo();
     // this.formData.startTime = this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'),2)
     // this.strtcurrentDate=new Date(this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'),2))
-    this.strtcurrentDate=new Date(this.getThreeDaysAgo())
-    this.formData.endTime = this.parseTime(new Date(), '{y}-{m}-{d}') + ""
-    this.endminDate=new Date(this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'),2))
-    this.powerGrade = localStorage.getItem("powerGrade")
-    this.getDeptInfo("dept")
-    if(this.powerGrade==5){
-      setTimeout(()=>{
-        if(this.$route.query.userCode==undefined){
-          this.companyName=this.companyList[0].deptName;
-          this.companyCode=this.companyList[0].deptId;
+    this.strtcurrentDate = new Date(this.getThreeDaysAgo());
+    this.formData.endTime = this.parseTime(new Date(), '{y}-{m}-{d}') + '';
+    this.endminDate = new Date(this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'), 2));
+    this.powerGrade = localStorage.getItem('powerGrade');
+    this.getDeptInfo('dept');
+    if (this.powerGrade == 5) {
+      setTimeout(() => {
+        if (this.$route.query.userCode == undefined) {
+          this.companyName = this.companyList[0].deptName;
+          this.companyCode = this.companyList[0].deptId;
         }
-        this.getDeptInfo("dept",1)
-      },1000)
+        this.getDeptInfo('dept', 1);
+      }, 1000);
     }
-    if(this.powerGrade==4){
-      setTimeout(()=>{
-        this.getDeptInfo("dept",1)
-      },1000)
+    if (this.powerGrade == 4) {
+      setTimeout(() => {
+        this.getDeptInfo('dept', 1);
+      }, 1000);
     }
-    if(this.powerGrade==3){
-      setTimeout(()=>{
-        this.getDeptInfo("dept",2)
-      },1000)
+    if (this.powerGrade == 3) {
+      setTimeout(() => {
+        this.getDeptInfo('dept', 2);
+      }, 1000);
     }
-    if(this.powerGrade==2||this.powerGrade==1){
-      setTimeout(()=>{
-        this.getDeptInfo("user")
-      },2000)
+    if (this.powerGrade == 2 || this.powerGrade == 1) {
+      setTimeout(() => {
+        this.getDeptInfo('user');
+      }, 2000);
     }
-    if(this.$route.query.userCode!=undefined){
-      this.companyName=this.$route.query.companyName
-      this.companyCode=this.$route.query.companyCode
-      this.regionName=this.$route.query.regionName
-      this.regionCode=this.$route.query.regionCode
-      this.userCode=this.$route.query.userCode
-      this.userName=this.$route.query.userName
-      this.deptName=this.$route.query.deptName
-      this.deptCode=this.$route.query.deptCode
-      this.formData.startTime=this.$route.query.startTime
-      this.formData.endTime=this.$route.query.endTime
-      this.searchBtn()
-      this.getDeptInfo("dept",2)
-      this.getDeptInfo("user")
-    }else{
-      setTimeout(()=>{
-        this.searchBtn()
-      },1000)
+    if (this.$route.query.userCode != undefined) {
+      this.companyName = this.$route.query.companyName;
+      this.companyCode = this.$route.query.companyCode;
+      this.regionName = this.$route.query.regionName;
+      this.regionCode = this.$route.query.regionCode;
+      this.userCode = this.$route.query.userCode;
+      this.userName = this.$route.query.userName;
+      this.deptName = this.$route.query.deptName;
+      this.deptCode = this.$route.query.deptCode;
+      this.formData.startTime = this.$route.query.startTime;
+      this.formData.endTime = this.$route.query.endTime;
+      this.searchBtn();
+      this.getDeptInfo('dept', 2);
+      this.getDeptInfo('user');
+    } else {
+      setTimeout(() => {
+        this.searchBtn();
+      }, 1000);
     }
   },
   watch: {
@@ -279,26 +276,26 @@ export default {
       //       this.searchBtn()
       //     },1000)
       //   }
-    }
+    },
   },
   methods: {
-    dateFn(val){
-      return val.slice(0,4)+"-"+val.slice(4,6)+"-"+val.slice(6,8)
+    dateFn(val) {
+      return val.slice(0, 4) + '-' + val.slice(4, 6) + '-' + val.slice(6, 8);
     },
-    onLoad(){
-      this.querySubReport()
+    onLoad() {
+      this.querySubReport();
     },
-    searchBtn(){
+    searchBtn() {
       // if(this.userCode==""){
       //   this.$toast("业务员未选择")
       // }else{
-      this.formData.pageNum=1
+      this.formData.pageNum = 1;
       this.list = [];
-      this.querySubReport()
+      this.querySubReport();
       // }
     },
-    querySubReport(){
-      let loading1=this.$toast.loading({
+    querySubReport() {
+      let loading1 = this.$toast.loading({
         duration: 0,
         message: '加载中...',
         forbidClick: true,
@@ -307,24 +304,24 @@ export default {
         this.list = [];
         this.refreshing = false;
       }
-      this.formData.companyId=this.companyCode; // 公司id,必传 Long类型
-      this.formData.regionId=this.regionCode; // 大区id,必传  Long类型
-      this.formData.deptId=this.deptCode; // 部门id,如果为周报或日报为必传  Long类型
-      this.formData.userId=this.userCode; // 业务员id,如果为日报为必传      Long类型
-      queryHistorySummaryList(this.formData).then(res=>{
-        loading1.clear()
-        if(res.code==200){
-          this.loading=false
-          this.list = this.list.concat(res.data)
-          if (this.list.length >=res.total) {
+      this.formData.companyId = this.companyCode; // 公司id,必传 Long类型
+      this.formData.regionId = this.regionCode; // 大区id,必传  Long类型
+      this.formData.deptId = this.deptCode; // 部门id,如果为周报或日报为必传  Long类型
+      this.formData.userId = this.userCode; // 业务员id,如果为日报为必传      Long类型
+      queryHistorySummaryList(this.formData).then((res) => {
+        loading1.clear();
+        if (res.code == 200) {
+          this.loading = false;
+          this.list = this.list.concat(res.data);
+          if (this.list.length >= res.total) {
             this.finished = true;
-          }else{
+          } else {
             this.finished = false;
           }
-          this.formData.pageNum=this.formData.pageNum+1
+          this.formData.pageNum = this.formData.pageNum + 1;
           // this.tableList=res.data.rates
         }
-      })
+      });
     },
     getThreeDaysAgo() {
       let myDate = new Date();
@@ -333,14 +330,10 @@ export default {
       let lastM = lw.getMonth() + 1;
       let lastD = lw.getDate();
       let startData =
-          lastY +
-          "-" +
-          (lastM < 10 ? "0" + lastM : lastM) +
-          "-" +
-          (lastD < 10 ? "0" + lastD : lastD); //三十天之前日期
+        lastY + '-' + (lastM < 10 ? '0' + lastM : lastM) + '-' + (lastD < 10 ? '0' + lastD : lastD); //三十天之前日期
       return startData;
     },
-    GetPreMonthDay(date, monthNum,type) {
+    GetPreMonthDay(date, monthNum, type) {
       var dateArr = date.split('-');
       var year = dateArr[0]; //获取当前日期的年份
       var month = dateArr[1]; //获取当前日期的月份
@@ -363,102 +356,104 @@ export default {
       if (month2 < 10) {
         month2 = '0' + month2;
       }
-      var t2 =""
-      if(monthNum>0){
-        t2= year2 + '-' + month2 + '-01';
-      }else{
-        if(type=="end"){
-          var Months=new Date().getMonth()+1
-          var days111=new Date().getDate()
+      var t2 = '';
+      if (monthNum > 0) {
+        t2 = year2 + '-' + month2 + '-01';
+      } else {
+        if (type == 'end') {
+          var Months = new Date().getMonth() + 1;
+          var days111 = new Date().getDate();
           if (Months < 10) {
             Months = '0' + Months;
           }
           if (days111 < 10) {
             days111 = '0' + days111;
           }
-          if(new Date().getFullYear()==year){
-            if(parseInt(month2)>=new Date().getMonth()+1){
-              t2= year2 + '-' + Months + '-' + days111;
-            }else{
-              var daysd=this.getMonthDays(year2,month2)
-              t2= year2 + '-' + month2 + '-' + daysd;
+          if (new Date().getFullYear() == year) {
+            if (parseInt(month2) >= new Date().getMonth() + 1) {
+              t2 = year2 + '-' + Months + '-' + days111;
+            } else {
+              var daysd = this.getMonthDays(year2, month2);
+              t2 = year2 + '-' + month2 + '-' + daysd;
             }
-          }else{
-            var daysd=this.getMonthDays(year2,month2)
-            t2= year2 + '-' + month2 + '-' + daysd;
+          } else {
+            var daysd = this.getMonthDays(year2, month2);
+            t2 = year2 + '-' + month2 + '-' + daysd;
           }
-        }else{
-          t2= year2 + '-' + month2 + '-' + day2;
+        } else {
+          t2 = year2 + '-' + month2 + '-' + day2;
         }
       }
       return t2;
     },
-    getMonthDays(year,month){
-      var stratDate = new Date(year,month-1,1),
-          endData = new Date(year,month,1);
-      var days = (endData -stratDate)/(1000*60*60*24);
+    getMonthDays(year, month) {
+      var stratDate = new Date(year, month - 1, 1),
+        endData = new Date(year, month, 1);
+      var days = (endData - stratDate) / (1000 * 60 * 60 * 24);
       return days;
     },
-    getDeptInfo(type,grade){
-      this.deptForm.type=type
-      if(type=="dept"){
-        if(grade=="1"){
-          this.deptForm.parentId=this.companyCode
-        }else if(grade=="2"){
-          this.deptForm.parentId=this.regionCode
-        }else{
-          this.deptForm.type=""
-          this.deptForm.parentId=""
+    getDeptInfo(type, grade) {
+      this.deptForm.type = type;
+      if (type == 'dept') {
+        if (grade == '1') {
+          this.deptForm.parentId = this.companyCode;
+        } else if (grade == '2') {
+          this.deptForm.parentId = this.regionCode;
+        } else {
+          this.deptForm.type = '';
+          this.deptForm.parentId = '';
         }
-      }else if(type=="user"){
-        this.deptForm.parentId=this.deptCode
+      } else if (type == 'user') {
+        this.deptForm.parentId = this.deptCode;
       }
-      getSummaryMobileDeptInfo(this.deptForm).then(res=>{
-        if(type=="dept"){
-          if(grade=="1"){
-            if(res.data.region!=null){
-              this.regionList=[{deptName:"全部大区",deptId:""}].concat(res.data.region)
+      getSummaryMobileDeptInfo(this.deptForm).then((res) => {
+        if (type == 'dept') {
+          if (grade == '1') {
+            if (res.data.region != null) {
+              this.regionList = [{ deptName: '全部大区', deptId: '' }].concat(res.data.region);
             }
-          }else if(grade=="2"){
-            if(res.data.dept!=null){
-              this.deptList=[{deptName:"全部销售部",deptId:""}].concat(res.data.dept)
+          } else if (grade == '2') {
+            if (res.data.dept != null) {
+              this.deptList = [{ deptName: '全部销售部', deptId: '' }].concat(res.data.dept);
             }
-          }else{
-            this.companyList=res.data.company
-            if(this.$route.query.userCode==undefined){
-              this.companyName=res.data.company[0].deptName
-              this.companyCode=res.data.company[0].deptId
+          } else {
+            this.companyList = res.data.company;
+            if (this.$route.query.userCode == undefined) {
+              this.companyName = res.data.company[0].deptName;
+              this.companyCode = res.data.company[0].deptId;
             }
-            if(res.data.dept!=null){
-              this.deptName=res.data.dept[0].deptName
-              this.deptCode=res.data.dept[0].deptId
-              this.deptList=res.data.dept
+            if (res.data.dept != null) {
+              this.deptName = res.data.dept[0].deptName;
+              this.deptCode = res.data.dept[0].deptId;
+              this.deptList = res.data.dept;
             }
-            if(res.data.region!=null){
-              this.regionName=res.data.region[0].deptName
-              this.regionCode=res.data.region[0].deptId
-              this.regionList=res.data.region
+            if (res.data.region != null) {
+              this.regionName = res.data.region[0].deptName;
+              this.regionCode = res.data.region[0].deptId;
+              this.regionList = res.data.region;
             }
-            if(res.data.user!=null){
-              this.userList=res.data.user
-              this.userCode=""
+            if (res.data.user != null) {
+              this.userList = res.data.user;
+              this.userCode = '';
             }
           }
-        }else if(type=="user"){
-          if(res.data.user!=null){
-            this.userList=[{nickName:"全部业务员",userId:""}].concat(res.data.user)
+        } else if (type == 'user') {
+          if (res.data.user != null) {
+            this.userList = [{ nickName: '全部业务员', userId: '' }].concat(res.data.user);
           }
         }
-      })
+      });
     },
     dailyFn(row) {
       this.$router.push({
-        path: "/VisitSummaryDetail",
-        query: {userSummaryId: row.userSummaryId,}
-      })
+        path: '/VisitSummaryDetail',
+        query: { userSummaryId: row.userSummaryId },
+      });
     },
     onClickLeft() {
-      this.$router.go(-1)
+      this.$router.replace({
+        path: '/My/index',
+      });
     },
     regionClick() {
       // if(this.powerGrade>4){
@@ -486,67 +481,68 @@ export default {
     },
     onregionConfirm(val) {
       this.RegionShow = false;
-      this.companyName=val.deptName;
-      this.companyCode=val.deptId;
-      this.regionName="全部大区";
-      this.regionCode="";
-      this.deptName="全部销售部";
-      this.deptCode="";
-      this.userName="全部业务员";
-      this.userCode="";
-      this.getDeptInfo("dept",1)
+      this.companyName = val.deptName;
+      this.companyCode = val.deptId;
+      this.regionName = '全部大区';
+      this.regionCode = '';
+      this.deptName = '全部销售部';
+      this.deptCode = '';
+      this.userName = '全部业务员';
+      this.userCode = '';
+      this.getDeptInfo('dept', 1);
     },
     onSalesRegionConfirm(val) {
       this.SalesRegionShow = false;
-      this.regionName=val.deptName;
-      this.regionCode=val.deptId;
-      if(val.deptId!=""){
-        this.getDeptInfo("dept",2)
+      this.regionName = val.deptName;
+      this.regionCode = val.deptId;
+      if (val.deptId != '') {
+        this.getDeptInfo('dept', 2);
       }
-      this.deptName="全部销售部";
-      this.deptCode="";
-      this.userName="全部业务员";
-      this.userCode="";
-      this.userList=[]
+      this.deptName = '全部销售部';
+      this.deptCode = '';
+      this.userName = '全部业务员';
+      this.userCode = '';
+      this.userList = [];
     },
     onSalesDepartmentConfirm(val) {
       this.SalesDepartmentShow = false;
-      this.deptName=val.deptName;
-      this.deptCode=val.deptId;
-      if(val.deptId!=""){
-
-        this.getDeptInfo("user")
+      this.deptName = val.deptName;
+      this.deptCode = val.deptId;
+      if (val.deptId != '') {
+        this.getDeptInfo('user');
       }
-      this.userName="全部业务员";
-      this.userCode="";
+      this.userName = '全部业务员';
+      this.userCode = '';
     },
     onStaffConfirm(val) {
       this.StaffShow = false;
-      this.userName=val.nickName;
-      this.userCode=val.userId;
+      this.userName = val.nickName;
+      this.userCode = val.userId;
     },
     onStartTimeConfirm(val) {
-      this.formData.startTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + ""
+      this.formData.startTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + '';
       this.StartTimeShow = false;
-      this.endminDate = new Date(val)
-      this.endmaxDate=new Date(this.GetPreMonthDay(this.formData.startTime,-2,"end"))
-      if((new Date(this.formData.startTime).getTime()>new Date(this.formData.endTime).getTime())||(new Date(this.endmaxDate).getTime()<new Date(this.formData.endTime).getTime())) {
-        this.formData.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + ""
-        this.endcurrentDate=  this.GetPreMonthDay(this.formData.startTime,-2)
+      this.endminDate = new Date(val);
+      this.endmaxDate = new Date(this.GetPreMonthDay(this.formData.startTime, -2, 'end'));
+      if (
+        new Date(this.formData.startTime).getTime() > new Date(this.formData.endTime).getTime() ||
+        new Date(this.endmaxDate).getTime() < new Date(this.formData.endTime).getTime()
+      ) {
+        this.formData.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + '';
+        this.endcurrentDate = this.GetPreMonthDay(this.formData.startTime, -2);
       }
-
     },
     onEndTimeConfirm(val) {
-      this.formData.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}')
-      this.strtmaxDate = new Date(val)
-      if(new Date(this.formData.startTime).getTime()>new Date(this.formData.endTime).getTime()){
-        this.formData.startTime=this.formData.endTime
+      this.formData.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}');
+      this.strtmaxDate = new Date(val);
+      if (new Date(this.formData.startTime).getTime() > new Date(this.formData.endTime).getTime()) {
+        this.formData.startTime = this.formData.endTime;
       }
 
       this.EndTimeShow = false;
     },
-  }
-}
+  },
+};
 </script>
 <style>
 .cardContent {
@@ -563,7 +559,7 @@ export default {
 
 .cardContent .title p {
   padding: 0;
-  margin: 0
+  margin: 0;
 }
 
 .cardContent .title .textLeft {
@@ -607,27 +603,29 @@ export default {
   color: #fff !important;
   background-color: #0057ba;
   border: 1px solid #0057ba;
-  height: 36px
+  height: 36px;
 }
 
 .contentpd16 .van-cell {
-  background-color: #EBF4FF;
+  background-color: #ebf4ff;
   margin: 8px 0;
   border-radius: 5px;
   padding: 4px 16px;
 }
-.elTreeTableLsiy  th.el-table__cell>.cell{text-align: center;}
-.elTreeTableLsiy td.el-table__cell div{
+.elTreeTableLsiy th.el-table__cell > .cell {
+  text-align: center;
+}
+.elTreeTableLsiy td.el-table__cell div {
   text-align: right;
 }
-.elTreeTableLsiy .el-table__cell{
+.elTreeTableLsiy .el-table__cell {
   padding: 2px 0;
 }
-.elTreeTableLsiy .el-table__cell:first-child .cell{
+.elTreeTableLsiy .el-table__cell:first-child .cell {
   text-align: center;
 }
-.contentpd16 .inputSearch .van-cell{
+.contentpd16 .inputSearch .van-cell {
   padding: 0;
   margin: 4px 0;
 }
-</style>
+</style>

Plik diff jest za duży
+ 466 - 353
src/views/week/VisitSummaryAdd.vue


+ 360 - 0
src/views/week/VisitSummaryDetail copy.vue

@@ -0,0 +1,360 @@
+<template>
+  <div>
+    <!--        顶部条-->
+    <div class="navBarTOP">
+      <van-nav-bar class="navBar" :title="info.summaryTaskName" left-arrow @click-left="onClickLeft"/>
+      <!--      <p style="text-align: right;margin-right: 16px;color: #1e5398;">{{title}}</p>-->
+    </div>
+    <div class="lineGrey"></div>
+    <div class="lineGrey"></div>
+    <div class="lineGrey"></div>
+    <div class="lineGrey"></div>
+    <div class="lineGrey"></div>
+    <div class="lineGrey" style="height:6px;"></div>
+    <!--        主体内容-->
+    <div class="container linep" style="background-color: #fff;width: 94%; margin: 0px auto; border-radius: 6px;padding: 10px">
+      <div style="padding:4px 0">
+        <van-icon :name="ry" size="16"  style="float: left"/>
+        <span>&nbsp;{{info.nickName}} - {{info.postName}}</span>
+      </div>
+      <div style="padding:4px 0">
+        <van-icon :name="zw" size="16" style="float: left"/>
+        <span >&nbsp;所属部门:{{info.deptName}}</span>
+      </div>
+      <div style="padding:4px 0">
+        <van-icon :name="tm" size="16"  style="float: left"/>
+        <span >&nbsp;提交时间:{{info.createTime}}</span>
+      </div>
+    </div>
+    <div class="lineGrey"></div>
+    <div class="container linep" style="background-color: #fff;width: 94%; margin: 0px auto; border-radius: 6px;">
+      <van-form ref="tabstoreVal">
+        <div v-for="(item,index) in info.customItemList" :key="index">
+          <div class="formLabel z-cell z-cells z-celly" v-if="item.answerType=='sz' || item.answerType=='rq'||item.answerType=='gs'||item.answerType=='dq'||item.answerType=='xsb'">
+            <van-cell>
+              <template #title>{{ index + 1 }}.{{ item.customName }} <span style="color: #444;
+  font-size: 12px;
+  margin: 0;
+  padding:10px 0;text-align: right">{{ item.remark}}</span></template>
+            </van-cell>
+            <p class="mg0">{{ item.answerValue }}</p>
+          </div>
+          <div class="formLabel z-cell z-cells z-celly" v-if="item.answerType=='zp'">
+            <van-cell>
+              <template #title>{{ index + 1 }}.{{ item.customName }}</template>
+            </van-cell>
+            <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
+          </div>
+          <div class="formLabel z-cell z-cells z-celly" v-if="item.answerType=='wb'">
+            <van-cell>
+              <template #title>{{ index + 1 }}.{{ item.customName }}</template>
+            </van-cell>
+            <div class="selesetText">
+              <p class="mg0">{{ item.answerValue }}</p>
+            </div>
+            <p style="color: #444;font-size: 12px;margin: 0;padding:10px 0;text-align: right">{{ item.remark }}</p>
+            <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
+          </div>
+          <div class="formLabel z-cell z-cells z-celly" v-if="item.answerType=='duox'">
+            <van-cell>
+              <template #title>{{ index + 1 }}.{{ item.customName }}</template>
+            </van-cell>
+            <div class="selesetText">
+              <div class="mg0" v-for="(item1,index1) in item.customOptionList" :key="index1">
+              <p style="color:#0057ba" v-if="item1.checked">
+                <i style="border: 1px solid #0057ba;margin-right: 10px;border-radius:2px;padding: 2px" class="van-icon van-icon-success"></i>
+                <span >{{ item1.customOption }}</span>
+              </p>
+              <p v-if="!item1.checked">
+                <i style="border: 1px solid #ccc;margin-right: 10px;border-radius:2px;color:#fff;padding: 2px" class="van-icon van-icon-success"></i>
+                <span >{{ item1.customOption }}</span>
+              </p>
+              </div>
+            </div>
+          </div>
+          <div class="formLabel z-cell z-cells z-celly" v-if="item.answerType=='dx'">
+            <van-cell>
+              <template #title>
+                {{ index + 1 }}.{{ item.customName }}
+              </template>
+            </van-cell>
+            <div class="selesetText">
+              <div class="mg0" v-for="(item2,index2) in item.customOptionList" :key="index2">
+                <p style="color:#0057ba" v-if="item2.checked">
+                  <i style="border: 1px solid #0057ba;border-radius:40px;margin-right: 10px;padding: 2px" class="van-icon van-icon-success"></i>
+                  <span >{{ item2.customOption }}</span>
+                </p>
+                <p v-if="!item2.checked">
+                  <i style="border: 1px solid #ccc;border-radius:40px;margin-right: 10px;color:#fff;padding: 2px" class="van-icon van-icon-success"></i>
+                  <span >{{ item2.customOption }}</span>
+                </p>
+              </div>
+            </div>
+            <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
+          </div>
+        </div>
+      </van-form>
+
+    </div>
+    <br>
+    <br>
+    <br>
+  </div>
+</template>
+
+<script>
+import history from "@/assets/Icon/history.png";
+import tm from "@/assets/Icon/tm.png";
+import zw from "@/assets/Icon/zw.png";
+import ry from "@/assets/Icon/ry.png";
+import {getSummaryMobilo} from "@/api/index";
+import {ImagePreview} from "vant";
+import deleteUploadImg from "@/components/deleteUploadImg";
+export default {
+  name: "daily",
+  components: {deleteUploadImg},
+  data() {
+    return {
+      info:{},
+      zw:zw,
+      tm:tm,
+      ry:ry,
+      show: true,
+      num: 0,
+      todayGoal: {},
+      progressWidth: 0,
+      history: history,
+      imgArr: [],
+      activeNames: ['1', '2', '3', '4', '5', '6', '7', '8', '10',"16","17"],
+      value: "2",
+      message: "",
+      powerGrade:"",
+      Content:"",
+      Content2:"",
+      reportTargetAll:{},
+      reportContents:[{dayContent:""}],
+      reportTarget:{},
+      successContent:"",
+      imgList:[],
+      type:"-1"
+      //
+    }
+  },
+  created() {
+    this.powerGrade= localStorage.getItem("powerGrade")
+    this.getDetailById()
+  },
+  watch:{
+    $route(to,from){
+      this.powerGrade= localStorage.getItem("powerGrade")
+      if(to.path=="/dailyDetails"){
+        this.getDetailById()
+      }
+      // &&from.path=="/dailyApprovalList"
+      // if(to.path=="/dailyDetails"&&from.path=="/myHistoricalDaily"){
+      //   this.getDetailById()
+      // }
+    }
+  },
+  activated() {
+    this.num = 0;
+    this.userTodayPlanNum()
+  },
+  methods: {
+    pviewFn(val,imgVal){
+      var imgList=[]
+      var photos=this.reportTarget.photos[val].photos
+      for(let i=0;i<photos.length;i++){imgList.push(photos[i].fileUrl)};
+      ImagePreview({images: imgList, startPosition: imgVal});
+    },
+    submint(){
+      this.$router.push({
+        path: "/daily",
+        query: {reportId:this.$route.query.reportId,temporaryShow:"N"}
+      })
+    },
+    getDetailById(){
+      let loading1=this.$toast.loading({
+        duration: 0,
+        message: '加载中...',
+        forbidClick: true,
+      });
+      getSummaryMobilo({userSummaryId:this.$route.query.userSummaryId}).then(res=>{
+        loading1.clear()
+        this.reportTargetAll=res.data.reportTargetAll
+        this.info=res.data
+        this.type=res.data.userType
+        if(res.data.status==3){
+          this.successContent=res.data.successContent
+        }else{
+          this.successContent=res.data.failContent
+        }
+        if(res.data.reportContents.length>0){
+          this.Content=res.data.reportContents[0].dayContent
+          if(res.data.reportContents.length>1){
+            this.Content2=res.data.reportContents[1].dayContent
+          }else{
+            this.Content2=""
+          }
+        }else{
+          this.Content=""
+          this.Content2=""
+        }
+        this.reportContents=res.data.reportContents
+        var imgList=[]
+        if(res.data.photos!=null){
+          for(var k=0;k<res.data.photos.length;k++){
+            imgList.push(res.data.photos[k].fileUrl+"")
+          }
+        }
+        this.imgList=imgList
+      })
+    },
+    userTodayPlanNum() {
+      userTodayPlanNum().then(res => {
+        if (res.code == 200) {
+          this.todayGoal = res.data
+          this.progressWidth = (this.todayGoal.finishNum / this.todayGoal.planNum) * 100 + "%"
+          localStorage.setItem("nickName", res.data.user.nickName)
+          localStorage.setItem("storeType", res.data.user.type)
+        } else {
+          this.$toast.fail(res.msg)
+        }
+      })
+    },
+    onClickLeft() {
+      this.$router.go(-1)
+    }
+  }
+}
+</script>
+<style scoped>
+.container {
+  background-color: white;
+}
+
+.van-f-red {
+  color: red;
+  width: 8px;
+  display: inline-block;
+  line-height: 26px;
+}
+
+.formLabel {
+  margin: 0 16px;
+  border-bottom: 1px solid #f1f1f1
+}
+
+.formLabel .van-cell {
+  padding: 10px 0
+}
+
+.formLabel .van-cell::after {
+  border: 0
+}
+
+.formLabel .van-field {
+  border: 1px solid #f1f1f1;
+  padding: 6px;
+  width: 100%;
+  border-radius: 4px;
+  overflow: hidden
+}
+
+.formLabel .van-field__control {
+  padding: 0 10px
+}
+
+.formLabel .formLabeltitle {
+  position: absolute;
+  top: 8px;
+}
+
+.z-checkbox .van-radio {
+  padding: 6px 0;
+}
+.z-celly .van-cell__title{
+  font-weight: initial;
+  font-size: 14px;
+}
+</style>
+<style>
+.table-headermd {
+  font-size: 1.2rem;
+  text-align: center;
+  position: initial;
+  width: 94% !important;
+  margin: 0 auto;
+  border-right: 0;
+}
+
+.table-headermd .el-table__header,
+.table-headermd .el-table__body {
+  width: 100% !important;
+}
+
+.table-headermd col {
+  width: 5.8rem;
+}
+
+.table-headermd col:nth-child(2),
+.table-headermd col:nth-child(4),
+.table-headermd col:nth-child(3) {
+  width: 5rem;
+}
+
+.table-headermd .van-cell {
+  padding: 0 4px;
+  height: 100%
+}
+
+.table-headermd th.el-table__cell > .cell {
+  padding: 0 4px
+}
+
+.table-headermd th.el-table__cell {
+  background-color: #1989fa;
+  color: #fff;
+}
+
+.table-headermd .el-table__cell {
+  padding: 4px 0;
+}
+
+.table-headermd .tipTitle {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+}
+
+.table-headermd::before {
+  height: 0
+}
+
+.f-right {
+  text-align: right;
+  margin: 0
+}
+
+.mg0 {
+  margin: 6px 10px;
+  color: #909090;
+  font-size: 14px;
+}
+
+.selesetText {
+  margin-bottom: 16px;
+}
+
+.z-cells .van-cell__title {
+  font-weight: bold;
+  color: #4a4a4a;
+}
+
+.z-cells .van-cell {
+  padding-bottom: 0
+}
+
+</style>

+ 182 - 189
src/views/week/VisitSummaryDetail.vue

@@ -2,231 +2,225 @@
   <div>
     <!--        顶部条-->
     <div class="navBarTOP">
-      <van-nav-bar class="navBar" :title="info.summaryTaskName" left-arrow @click-left="onClickLeft"/>
-      <!--      <p style="text-align: right;margin-right: 16px;color: #1e5398;">{{title}}</p>-->
+      <van-nav-bar
+        class="navBar"
+        :title="info.summaryTaskName"
+        left-arrow
+        @click-left="onClickLeft" />
     </div>
     <div class="lineGrey"></div>
     <div class="lineGrey"></div>
     <div class="lineGrey"></div>
     <div class="lineGrey"></div>
     <div class="lineGrey"></div>
-    <div class="lineGrey" style="height:6px;"></div>
+    <div class="lineGrey" style="height: 6px"></div>
     <!--        主体内容-->
-    <div class="container linep" style="background-color: #fff;width: 94%; margin: 0px auto; border-radius: 6px;padding: 10px">
-      <div style="padding:4px 0">
-        <van-icon :name="ry" size="16"  style="float: left"/>
-        <span>&nbsp;{{info.nickName}} - {{info.postName}}</span>
+    <div
+      class="container linep"
+      style="
+        background-color: #fff;
+        width: 94%;
+        margin: 0px auto;
+        border-radius: 6px;
+        padding: 10px;
+      ">
+      <div style="padding: 4px 0">
+        <van-icon :name="ry" size="16" style="float: left" />
+        <span>&nbsp;{{ info.nickName }} - {{ info.postName }}</span>
       </div>
-      <div style="padding:4px 0">
-        <van-icon :name="zw" size="16" style="float: left"/>
-        <span >&nbsp;所属部门:{{info.deptName}}</span>
+      <div style="padding: 4px 0">
+        <van-icon :name="zw" size="16" style="float: left" />
+        <span>&nbsp;所属部门:{{ info.deptName }}</span>
       </div>
-      <div style="padding:4px 0">
-        <van-icon :name="tm" size="16"  style="float: left"/>
-        <span >&nbsp;提交时间:{{info.createTime}}</span>
+      <div style="padding: 4px 0">
+        <van-icon :name="tm" size="16" style="float: left" />
+        <span>&nbsp;提交时间:{{ info.createTime }}</span>
       </div>
     </div>
     <div class="lineGrey"></div>
-    <div class="container linep" style="background-color: #fff;width: 94%; margin: 0px auto; border-radius: 6px;">
-      <van-form ref="tabstoreVal">
-        <div v-for="(item,index) in info.customItemList" :key="index">
-          <div class="formLabel z-cell z-cells z-celly" v-if="item.answerType=='sz' || item.answerType=='rq'||item.answerType=='gs'||item.answerType=='dq'||item.answerType=='xsb'">
-            <van-cell>
-              <template #title>{{ index + 1 }}.{{ item.customName }} <span style="color: #444;
-  font-size: 12px;
-  margin: 0;
-  padding:10px 0;text-align: right">{{ item.remark}}</span></template>
-            </van-cell>
-            <p class="mg0">{{ item.answerValue }}</p>
-          </div>
-          <div class="formLabel z-cell z-cells z-celly" v-if="item.answerType=='zp'">
-            <van-cell>
-              <template #title>{{ index + 1 }}.{{ item.customName }}</template>
-            </van-cell>
-            <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
-          </div>
-          <div class="formLabel z-cell z-cells z-celly" v-if="item.answerType=='wb'">
-            <van-cell>
-              <template #title>{{ index + 1 }}.{{ item.customName }}</template>
-            </van-cell>
-            <div class="selesetText">
-              <p class="mg0">{{ item.answerValue }}</p>
-            </div>
-            <p style="color: #444;font-size: 12px;margin: 0;padding:10px 0;text-align: right">{{ item.remark }}</p>
-            <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
-          </div>
-          <div class="formLabel z-cell z-cells z-celly" v-if="item.answerType=='duox'">
-            <van-cell>
-              <template #title>{{ index + 1 }}.{{ item.customName }}</template>
-            </van-cell>
-            <div class="selesetText">
-              <div class="mg0" v-for="(item1,index1) in item.customOptionList" :key="index1">
-              <p style="color:#0057ba" v-if="item1.checked">
-                <i style="border: 1px solid #0057ba;margin-right: 10px;border-radius:2px;padding: 2px" class="van-icon van-icon-success"></i>
-                <span >{{ item1.customOption }}</span>
-              </p>
-              <p v-if="!item1.checked">
-                <i style="border: 1px solid #ccc;margin-right: 10px;border-radius:2px;color:#fff;padding: 2px" class="van-icon van-icon-success"></i>
-                <span >{{ item1.customOption }}</span>
-              </p>
-              </div>
-            </div>
-          </div>
-          <div class="formLabel z-cell z-cells z-celly" v-if="item.answerType=='dx'">
-            <van-cell>
-              <template #title>
-                {{ index + 1 }}.{{ item.customName }}
-              </template>
-            </van-cell>
-            <div class="selesetText">
-              <div class="mg0" v-for="(item2,index2) in item.customOptionList" :key="index2">
-                <p style="color:#0057ba" v-if="item2.checked">
-                  <i style="border: 1px solid #0057ba;border-radius:40px;margin-right: 10px;padding: 2px" class="van-icon van-icon-success"></i>
-                  <span >{{ item2.customOption }}</span>
-                </p>
-                <p v-if="!item2.checked">
-                  <i style="border: 1px solid #ccc;border-radius:40px;margin-right: 10px;color:#fff;padding: 2px" class="van-icon van-icon-success"></i>
-                  <span >{{ item2.customOption }}</span>
-                </p>
-              </div>
-            </div>
-            <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
-          </div>
-        </div>
-      </van-form>
-
+    <div
+      class="container linep"
+      style="background-color: #fff; width: 94%; margin: 0px auto; border-radius: 6px">
+      <componVisitSummary
+        :collectionItemLists="collectionItemLists"
+        ref="componVisitSummary"></componVisitSummary>
     </div>
-    <br>
-    <br>
-    <br>
+    <br />
+    <div class="tc" style="padding: 0 16px" v-if="writeAgain">
+      <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">
+        补填保存
+      </van-button>
+    </div>
+    <br />
+    <br />
+    <br />
   </div>
 </template>
 
 <script>
-import history from "@/assets/Icon/history.png";
-import tm from "@/assets/Icon/tm.png";
-import zw from "@/assets/Icon/zw.png";
-import ry from "@/assets/Icon/ry.png";
-import {getSummaryMobilo} from "@/api/index";
-import {ImagePreview} from "vant";
-import deleteUploadImg from "@/components/deleteUploadImg";
+import history from '@/assets/Icon/history.png';
+import tm from '@/assets/Icon/tm.png';
+import zw from '@/assets/Icon/zw.png';
+import ry from '@/assets/Icon/ry.png';
+import { getSummaryMobilo } from '@/api/index';
+import { ImagePreview } from 'vant';
+import deleteUploadImg from '@/components/deleteUploadImg';
+import componVisitSummary from '@/views/week/componVisitSummary';
+import { writeAgainCustomAnswer } from '@/api/week';
 export default {
-  name: "daily",
-  components: {deleteUploadImg},
+  name: 'daily',
+  components: { deleteUploadImg, componVisitSummary },
   data() {
     return {
-      info:{},
-      zw:zw,
-      tm:tm,
-      ry:ry,
+      info: {},
+      zw: zw,
+      tm: tm,
+      ry: ry,
       show: true,
       num: 0,
       todayGoal: {},
       progressWidth: 0,
       history: history,
       imgArr: [],
-      activeNames: ['1', '2', '3', '4', '5', '6', '7', '8', '10',"16","17"],
-      value: "2",
-      message: "",
-      powerGrade:"",
-      Content:"",
-      Content2:"",
-      reportTargetAll:{},
-      reportContents:[{dayContent:""}],
-      reportTarget:{},
-      successContent:"",
-      imgList:[],
-      type:"-1"
+      activeNames: ['1', '2', '3', '4', '5', '6', '7', '8', '10', '16', '17'],
+      value: '2',
+      message: '',
+      powerGrade: '',
+      Content: '',
+      Content2: '',
+      reportTargetAll: {},
+      reportContents: [{ dayContent: '' }],
+      reportTarget: {},
+      successContent: '',
+      imgList: [],
+      type: '-1',
+      collectionItemLists: [],
+      writeAgain: false,
       //
-    }
-  },
-  created() {
-    this.powerGrade= localStorage.getItem("powerGrade")
-    this.getDetailById()
-  },
-  watch:{
-    $route(to,from){
-      this.powerGrade= localStorage.getItem("powerGrade")
-      if(to.path=="/dailyDetails"){
-        this.getDetailById()
-      }
-      // &&from.path=="/dailyApprovalList"
-      // if(to.path=="/dailyDetails"&&from.path=="/myHistoricalDaily"){
-      //   this.getDetailById()
-      // }
-    }
+    };
   },
   activated() {
+    this.powerGrade = localStorage.getItem('powerGrade');
+    this.getDetailById();
     this.num = 0;
-    this.userTodayPlanNum()
+    this.userTodayPlanNum();
   },
   methods: {
-    pviewFn(val,imgVal){
-      var imgList=[]
-      var photos=this.reportTarget.photos[val].photos
-      for(let i=0;i<photos.length;i++){imgList.push(photos[i].fileUrl)};
-      ImagePreview({images: imgList, startPosition: imgVal});
+    pviewFn(val, imgVal) {
+      var imgList = [];
+      var photos = this.reportTarget.photos[val].photos;
+      for (let i = 0; i < photos.length; i++) {
+        imgList.push(photos[i].fileUrl);
+      }
+      ImagePreview({ images: imgList, startPosition: imgVal });
     },
-    submint(){
+    submint() {
       this.$router.push({
-        path: "/daily",
-        query: {reportId:this.$route.query.reportId,temporaryShow:"N"}
-      })
+        path: '/daily',
+        query: { reportId: this.$route.query.reportId, temporaryShow: 'N' },
+      });
     },
-    getDetailById(){
-      let loading1=this.$toast.loading({
+    getDetailById() {
+      let loading1 = this.$toast.loading({
         duration: 0,
         message: '加载中...',
         forbidClick: true,
       });
-      getSummaryMobilo({userSummaryId:this.$route.query.userSummaryId}).then(res=>{
-        loading1.clear()
-        this.reportTargetAll=res.data.reportTargetAll
-        this.info=res.data
-        this.type=res.data.userType
-        if(res.data.status==3){
-          this.successContent=res.data.successContent
-        }else{
-          this.successContent=res.data.failContent
+      getSummaryMobilo({ userSummaryId: this.$route.query.userSummaryId }).then((res) => {
+        loading1.clear();
+        this.reportTargetAll = res.data.reportTargetAll;
+        this.info = res.data;
+        this.type = res.data.userType;
+        if (res.data.status == 3) {
+          this.successContent = res.data.successContent;
+        } else {
+          this.successContent = res.data.failContent;
         }
-        if(res.data.reportContents.length>0){
-          this.Content=res.data.reportContents[0].dayContent
-          if(res.data.reportContents.length>1){
-            this.Content2=res.data.reportContents[1].dayContent
-          }else{
-            this.Content2=""
+        if (res.data.reportContents && res.data.reportContents.length > 0) {
+          this.Content = res.data.reportContents[0].dayContent;
+          if (res.data.reportContents.length > 1) {
+            this.Content2 = res.data.reportContents[1].dayContent;
+          } else {
+            this.Content2 = '';
           }
-        }else{
-          this.Content=""
-          this.Content2=""
+        } else {
+          this.Content = '';
+          this.Content2 = '';
         }
-        this.reportContents=res.data.reportContents
-        var imgList=[]
-        if(res.data.photos!=null){
-          for(var k=0;k<res.data.photos.length;k++){
-            imgList.push(res.data.photos[k].fileUrl+"")
+        this.reportContents = res.data.reportContents;
+        var imgList = [];
+        if (res.data.photos != null) {
+          for (var k = 0; k < res.data.photos.length; k++) {
+            imgList.push(res.data.photos[k].fileUrl + '');
           }
         }
-        this.imgList=imgList
-      })
+        this.imgList = imgList;
+        this.writeAgain = res.data.customItemList.some((item) => {
+          return item.allowWriteAgain;
+        });
+
+        this.collectionItemLists = res.data.customItemList;
+      });
     },
     userTodayPlanNum() {
-      userTodayPlanNum().then(res => {
-        if (res.code == 200) {
-          this.todayGoal = res.data
-          this.progressWidth = (this.todayGoal.finishNum / this.todayGoal.planNum) * 100 + "%"
-          localStorage.setItem("nickName", res.data.user.nickName)
-          localStorage.setItem("storeType", res.data.user.type)
-        } else {
-          this.$toast.fail(res.msg)
+      // userTodayPlanNum().then((res) => {
+      //   if (res.code == 200) {
+      //     this.todayGoal = res.data;
+      //     this.progressWidth = (this.todayGoal.finishNum / this.todayGoal.planNum) * 100 + '%';
+      //     localStorage.setItem('nickName', res.data.user.nickName);
+      //     localStorage.setItem('storeType', res.data.user.type);
+      //   } else {
+      //     this.$toast.fail(res.msg);
+      //   }
+      // });
+    },
+    onClickLeft() {
+      this.$router.replace({
+        path: '/VisitSummary',
+      });
+    },
+    onSubmit() {
+      let collectionAnswerlisd = this.$refs.componVisitSummary.collectionAnswerlisd;
+      let collectionItemList = this.$refs.componVisitSummary.collectionItemList;
+      for (var c = 0; c < collectionAnswerlisd.length; c++) {
+        for (var b = 0; b < collectionItemList.length; b++) {
+          if (collectionAnswerlisd[c].id == collectionItemList[b].customId) {
+            collectionItemList[b].customOptionList = collectionAnswerlisd[c].value;
+          }
         }
+      }
+      // 获取所有可以补填的题
+      let customItemList = collectionItemList.filter((item) => item.allowWriteAgain);
+      console.log(customItemList);
+      // // 照片
+      let zpDataList = customItemList.find((item) => item.answerType == 'zp');
+      if (zpDataList) {
+        let fileIdList = [];
+        zpDataList.fileInfoList.forEach((item) => {
+          fileIdList.push(item.id);
+        });
+        zpDataList.fileIdList = fileIdList;
+      }
+      writeAgainCustomAnswer({
+        userSummaryId: this.$route.query.userSummaryId,
+        customItemList: customItemList,
       })
+        .then((res) => {
+          if (res.code == 200) {
+            this.$toast('操作成功!');
+            this.$router.replace({
+              path: '/VisitSummary',
+            });
+          } else {
+            this.$toast(res.msg);
+          }
+        })
+        .catch((err) => {
+          this.$toast(err.msg);
+        });
     },
-    onClickLeft() {
-      this.$router.go(-1)
-    }
-  }
-}
+  },
+};
 </script>
 <style scoped>
 .container {
@@ -242,15 +236,15 @@ export default {
 
 .formLabel {
   margin: 0 16px;
-  border-bottom: 1px solid #f1f1f1
+  border-bottom: 1px solid #f1f1f1;
 }
 
 .formLabel .van-cell {
-  padding: 10px 0
+  padding: 10px 0;
 }
 
 .formLabel .van-cell::after {
-  border: 0
+  border: 0;
 }
 
 .formLabel .van-field {
@@ -258,11 +252,11 @@ export default {
   padding: 6px;
   width: 100%;
   border-radius: 4px;
-  overflow: hidden
+  overflow: hidden;
 }
 
 .formLabel .van-field__control {
-  padding: 0 10px
+  padding: 0 10px;
 }
 
 .formLabel .formLabeltitle {
@@ -273,7 +267,7 @@ export default {
 .z-checkbox .van-radio {
   padding: 6px 0;
 }
-.z-celly .van-cell__title{
+.z-celly .van-cell__title {
   font-weight: initial;
   font-size: 14px;
 }
@@ -305,11 +299,11 @@ export default {
 
 .table-headermd .van-cell {
   padding: 0 4px;
-  height: 100%
+  height: 100%;
 }
 
 .table-headermd th.el-table__cell > .cell {
-  padding: 0 4px
+  padding: 0 4px;
 }
 
 .table-headermd th.el-table__cell {
@@ -330,12 +324,12 @@ export default {
 }
 
 .table-headermd::before {
-  height: 0
+  height: 0;
 }
 
 .f-right {
   text-align: right;
-  margin: 0
+  margin: 0;
 }
 
 .mg0 {
@@ -354,7 +348,6 @@ export default {
 }
 
 .z-cells .van-cell {
-  padding-bottom: 0
+  padding-bottom: 0;
 }
-
-</style>
+</style>

+ 823 - 0
src/views/week/componVisitSummary.vue

@@ -0,0 +1,823 @@
+<template>
+  <div class="componVisitSummary">
+    <van-form ref="tabstoreVal">
+      <div v-for="(item, index) in collectionItemList" :key="index">
+        <div v-if="item.answerType == 'sz'" class="formLabel z-cell">
+          <van-cell>
+            <template #title>
+              <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
+            </template>
+          </van-cell>
+          <!-- allowWriteAgain 是否允许补填 true/false -->
+          <van-field
+            v-model="item.answerValue"
+            :placeholder="item.customName"
+            type="number"
+            :disabled="!item.allowWriteAgain"
+            @input="numberFn(item, index)"></van-field>
+          <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
+            {{ item.remark }}
+          </p>
+        </div>
+        <div v-if="item.answerType == 'rq'" class="formLabel z-cell">
+          <van-cell>
+            <template #title>
+              <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
+            </template>
+          </van-cell>
+          <van-field
+            v-model="item.answerValue"
+            clickable
+            name="calendar"
+            placeholder="点击选择日期"
+            readonly
+            :disabled="!item.allowWriteAgain"
+            @click="showCalendarClick(index)" />
+          <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
+            {{ item.remark }}
+          </p>
+        </div>
+        <div v-if="item.answerType == 'zp'" class="formLabel z-cell">
+          <van-cell>
+            <template #title>
+              <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
+            </template>
+          </van-cell>
+          <van-row gutter="10" style="margin-bottom: 10px">
+            <p style="margin-top: 0">
+              <span style="font-size: 12px; color: #888">{{ item.remark }}</span>
+            </p>
+            <delete-upload-img
+              :isDelete="false"
+              :imgs="item.fileInfoList"
+              :isEdit="item.allowWriteAgain"></delete-upload-img>
+            <upload-img
+              v-if="item.allowWriteAgain"
+              :uploadid="uploadid2"
+              @newimgarr="newimgarr1"
+              imgText="上传照片"
+              :indexImg="index"
+              :customId="item.customId"
+              :summaryId="item.summaryId"
+              :allowWriteAgain="item.allowWriteAgain"
+              @click="imgClick(item, index)"></upload-img>
+          </van-row>
+        </div>
+        <div v-if="item.answerType == 'wb'" class="formLabel z-cell">
+          <van-cell>
+            <template #title>
+              <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
+            </template>
+          </van-cell>
+          <van-field
+            :disabled="!item.allowWriteAgain"
+            v-model="item.answerValue"
+            :formatter="formatter"
+            :placeholder="item.customName"></van-field>
+          <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
+            {{ item.remark }}
+          </p>
+        </div>
+        <div
+          class="formLabel z-cell z-cells z-celly"
+          v-if="item.answerType == 'gs' || item.answerType == 'dq' || item.answerType == 'xsb'">
+          <van-cell>
+            <template #title
+              >{{ index + 1 }}.{{ item.customName }}
+              <span
+                style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right"
+                >{{ item.remark }}</span
+              ></template
+            >
+          </van-cell>
+          <p class="mg0">{{ item.answerValue }}</p>
+        </div>
+        <div v-if="item.answerType == 'duox'" class="formLabel z-cell">
+          <van-cell>
+            <template #title>
+              <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
+            </template>
+          </van-cell>
+          <z-checkbox
+            :disabled="!item.allowWriteAgain"
+            :answerType="item.answerType"
+            :checkboxval="item.answerValue"
+            :collectionType="item.customOptionList"
+            :textc="item.customId"
+            :zCheckboxcolumns="item.customOptionList"
+            @zSelectVal="zSelectVal"></z-checkbox>
+        </div>
+        <div v-if="item.answerType == 'dx'" class="formLabel z-cell">
+          <van-cell>
+            <template #title>
+              <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
+            </template>
+          </van-cell>
+          <z-radio
+            :disabled="!item.allowWriteAgain"
+            :answerType="item.answerType"
+            :collectionType="item.collectionType"
+            :radio="item.answerValue"
+            :textc="item.customId"
+            :zRadiocolumns="item.customOptionList"
+            @zSelectVal="zSelectVal"></z-radio>
+        </div>
+        <br />
+      </div>
+    </van-form>
+    <van-calendar
+      v-model="showCalendar"
+      @confirm="onConfirm"
+      color="#0057ba"
+      :min-date="minDate"
+      :max-date="maxDate"
+      :show-confirm="false" />
+    <van-popup v-model="RegionShow" capture position="bottom">
+      <van-picker
+        :columns="companyList"
+        show-toolbar
+        value-key="deptName"
+        @cancel="RegionShow = false"
+        @confirm="onregionConfirm" />
+    </van-popup>
+    <van-popup v-model="SalesRegionShow" capture position="bottom">
+      <van-picker
+        :columns="regionList"
+        show-toolbar
+        value-key="deptName"
+        @cancel="SalesRegionShow = false"
+        @confirm="onSalesRegionConfirm" />
+    </van-popup>
+    <van-popup v-model="SalesDepartmentShow" capture position="bottom">
+      <van-picker
+        :columns="deptList"
+        show-toolbar
+        value-key="deptName"
+        @cancel="SalesDepartmentShow = false"
+        @confirm="onSalesDepartmentConfirm" />
+    </van-popup>
+    <van-popup v-model="StartTimeShow" capture position="bottom">
+      <van-datetime-picker
+        v-model="strtcurrentDate"
+        :max-date="strtmaxDate"
+        :min-date="strtminDate"
+        title="选择查找开始时间"
+        type="date"
+        @cancel="StartTimeShow = false"
+        @confirm="onStartTimeConfirm" />
+    </van-popup>
+    <van-popup v-model="EndTimeShow" capture position="bottom">
+      <van-datetime-picker
+        v-model="endcurrentDate"
+        :max-date="endmaxDate"
+        :min-date="endminDate"
+        title="选择查找结束时间"
+        type="date"
+        @cancel="EndTimeShow = false"
+        @confirm="onEndTimeConfirm" />
+    </van-popup>
+  </div>
+</template>
+
+<script>
+import { insertCustomAnswer, getSummaryMobileDeptInfo } from '@/api/index';
+import zRadio from '@/components/zRadio2';
+import zCheckbox from '@/components/zCheckbox2';
+import uploadImg from '@/components/uploadVTask';
+import deleteUploadImg from '@/components/deleteUploadImg2';
+
+export default {
+  name: 'MyHistoricalWeekly',
+  components: { zRadio, zCheckbox, uploadImg, deleteUploadImg },
+  props: {
+    collectionItemLists: {
+      type: Array,
+      default() {
+        return [];
+      },
+    },
+  },
+  data() {
+    return {
+      RegionShow: false,
+      SalesRegionShow: false,
+      SalesDepartmentShow: false,
+      StaffShow: false,
+      StartTimeShow: false,
+      dateIndex: '',
+      EndTimeShow: false,
+      uploadid2: 'uploadid2',
+      PhotoTypeList: [{ text: '009', value: '09' }],
+      strtminDate: new Date(2022, 0, 1),
+      endminDate: new Date(2022, 0, 1),
+      minDate: new Date(2020, 0, 1),
+      maxDate: new Date(2090, 0, 31),
+      strtmaxDate: new Date(),
+      endmaxDate: new Date(),
+      strtcurrentDate: new Date(),
+      endcurrentDate: new Date(),
+      companyName: '全部公司',
+      deptName: '全部销售部',
+      regionName: '全部大区',
+      userName: '全部',
+      companyCode: '',
+      deptCode: '',
+      regionCode: '',
+      userCode: '',
+      companyList: [],
+      title: '',
+      deptList: [],
+      regionList: [],
+      userList: [],
+      deptForm: { type: '', parentId: '' },
+      list: [],
+      loading: false,
+      finished: true,
+      showCalendar: false,
+      formData: {
+        type: '2', // 汇报类型或入口 1-下属业务员日报 2-下属销售部主管周报 3-下属大区主管半月报
+        companyId: '', // 公司id,必传 Long类型
+        regionId: '', // 大区id,必传  Long类型
+        deptId: '', // 部门id,如果为周报或日报为必传  Long类型
+        userId: '', // 业务员id,如果为日报为必传      Long类型
+        startTime: '', // 开始时间,必传  格式:yyyy-MM-dd  String类型
+        endTime: '', // 结束时间,必传  格式:yyyy-MM-dd  String类型
+        pageNum: 1, // 当前页码  int类型
+        pageSize: 10, // 当前每页条数  int类型
+      },
+      tableList: [],
+      collectionItemList: [],
+      collectionAnswerlisd: [],
+      flagclick: true,
+      index: '',
+    };
+  },
+  created() {
+    this.formData.startTime = this.getThreeDaysAgo();
+    this.strtcurrentDate = new Date(this.getThreeDaysAgo());
+    this.formData.endTime = this.parseTime(new Date(), '{y}-{m}-{d}') + '';
+    this.endminDate = new Date(this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'), 2));
+    this.powerGrade = localStorage.getItem('powerGrade');
+    this.title = this.$route.query.title;
+    this.regionCode = '';
+  },
+  watch: {
+    collectionItemLists: {
+      handler(val) {
+        // this.collectionItemList = JSON.parse(JSON.stringify(this.collectionItemLists));
+        this.setCollectionItemLists();
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  methods: {
+    showCalendarClick(val) {
+      if (!val.allowWriteAgain) return;
+      this.dateIndex = val;
+      this.showCalendar = true;
+    },
+    formatDate(date) {
+      var Month = date.getMonth() + 1;
+      var Day = date.getDate();
+      if (Month < 10) {
+        Month = '0' + Month;
+      }
+      if (Day < 10) {
+        Day = '0' + Day;
+      }
+      return `${date.getFullYear()}-${Month}-${Day}`;
+    },
+    onConfirm(date) {
+      this.showCalendar = false;
+      this.collectionItemList[this.dateIndex].answerValue = this.formatDate(date);
+    },
+    formatter(value) {
+      return value.replace(
+        /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi,
+        ''
+      );
+    },
+    numberFn(val, index) {
+      if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(this.collectionItemList[index].answerValue)) {
+        this.collectionItemList[index].answerValue = this.collectionItemList[
+          index
+        ].answerValue.replace(
+          /\.\d{2,}$/,
+          this.collectionItemList[index].answerValue.substr(
+            this.collectionItemList[index].answerValue.indexOf('.'),
+            3
+          )
+        );
+      }
+    },
+    zSelectVal(value) {
+      console.log(value);
+      var collectionAnswerlisd = this.collectionAnswerlisd;
+      if (collectionAnswerlisd.length > 0) {
+        var num = 0;
+        for (var a = 0; a < collectionAnswerlisd.length; a++) {
+          if (collectionAnswerlisd[a].id == value.id) {
+            collectionAnswerlisd[a] = value;
+            num = 0;
+          } else {
+            num = 1;
+          }
+        }
+        if (num > 0) {
+          collectionAnswerlisd.push(value);
+        }
+      } else {
+        collectionAnswerlisd.push(value);
+      }
+      this.collectionAnswerlisd = collectionAnswerlisd;
+    },
+    imgClick(val, index) {
+      this.collectionId = val.collectionId + '';
+      this.indeximg = index;
+      this.show = true;
+    },
+    newimgarr1(val) {
+      if (
+        this.collectionItemList[val.index].fileInfoList == null ||
+        this.collectionItemList[val.index].fileInfoList == undefined
+      ) {
+        this.collectionItemList[val.index].fileInfoList = [];
+        this.collectionItemList[val.index].fileIdList = [];
+      }
+      this.collectionItemList[val.index].fileInfoList.push(val);
+      this.collectionItemList[val.index].fileIdList.push(val.id);
+    },
+    dateFn(val) {
+      return val.slice(0, 4) + '-' + val.slice(4, 6) + '-' + val.slice(6, 8);
+    },
+    onLoad() {},
+    onSubmit() {
+      for (var c = 0; c < this.collectionAnswerlisd.length; c++) {
+        for (var b = 0; b < this.collectionItemList.length; b++) {
+          if (this.collectionAnswerlisd[c].id == this.collectionItemList[b].customId) {
+            this.collectionItemList[b].customOptionList = this.collectionAnswerlisd[c].value;
+          }
+        }
+      }
+      if (this.flagclick) {
+        this.flagclick = false;
+        this.timer = null;
+        this.timer = setTimeout(() => {
+          this.flagclick = true;
+        }, 2000);
+        insertCustomAnswer(this.collectionItemList).then((res) => {
+          if (res.code == 200) {
+            this.$router.go(-1);
+          }
+        });
+      }
+    },
+    setCollectionItemLists() {
+      this.collectionItemList = [];
+      this.collectionAnswerlisd = [];
+      this.collectionItemList = JSON.parse(JSON.stringify(this.collectionItemLists));
+      for (var q = 0; q < this.collectionItemList.length; q++) {
+        this.collectionItemList[q].answerName = undefined;
+        // 公司
+        // if (this.collectionItemList[q].answerType == 'gs') {
+        //   this.getDeptInfo('dept', 'gs', this.collectionItemList[q].answerValue);
+        // }
+        // 单选
+        if (this.collectionItemList[q].answerType == 'dx') {
+          let findCustom = this.collectionItemList[q].customOptionList.find((item) => item.checked);
+          if (findCustom) {
+            this.collectionItemList[q].answerValue = findCustom.customOptionId + '';
+          }
+        }
+        // 多选
+        if (this.collectionItemList[q].answerType == 'duox') {
+          let findCustom = [];
+          this.collectionItemList[q].customOptionList.forEach((item) => {
+            if (item.checked) {
+              findCustom.push(item.customOptionId + '');
+            }
+          });
+          if (findCustom) {
+            this.collectionItemList[q].answerValue = findCustom.join(',');
+          }
+        }
+        // 照片
+        if (
+          this.collectionItemList[q].answerType == 'zp' &&
+          this.collectionItemList[q].fileInfoList
+        ) {
+          let fileIdList = [];
+          this.collectionItemList[q].fileInfoList.forEach((item) => {
+            fileIdList.push(item.id);
+          });
+          this.collectionItemList[q].fileIdList = fileIdList;
+        }
+      }
+    },
+    getThreeDaysAgo() {
+      let myDate = new Date();
+      let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 14); //最后一个数字30可改,30天的意思
+      let lastY = lw.getFullYear();
+      let lastM = lw.getMonth() + 1;
+      let lastD = lw.getDate();
+      let startData =
+        lastY + '-' + (lastM < 10 ? '0' + lastM : lastM) + '-' + (lastD < 10 ? '0' + lastD : lastD); //三十天之前日期
+      return startData;
+    },
+    GetPreMonthDay(date, monthNum, type) {
+      var dateArr = date.split('-');
+      var year = dateArr[0]; //获取当前日期的年份
+      var month = dateArr[1]; //获取当前日期的月份
+      var day = dateArr[2]; //获取当前日期的日
+      var days = new Date(year, month, 0);
+      days = days.getDate(); //获取当前日期中月的天数
+      var year2 = year;
+      var month2 = parseInt(month) - monthNum;
+      if (month2 <= 0) {
+        var absM = Math.abs(month2);
+        year2 = parseInt(year2) - Math.ceil(absM / 12 == 0 ? 1 : parseInt(absM) / 12);
+        month2 = 12 - (absM % 12);
+      }
+      var day2 = day;
+      var days2 = new Date(year2, month2, 0);
+      days2 = days2.getDate();
+      if (day2 > days2) {
+        day2 = days2;
+      }
+      if (month2 < 10) {
+        month2 = '0' + month2;
+      }
+      var t2 = '';
+      if (monthNum > 0) {
+        t2 = year2 + '-' + month2 + '-01';
+      } else {
+        if (type == 'end') {
+          var Months = new Date().getMonth() + 1;
+          var days111 = new Date().getDate();
+          if (Months < 10) {
+            Months = '0' + Months;
+          }
+          if (days111 < 10) {
+            days111 = '0' + days111;
+          }
+          if (parseInt(month2) >= new Date().getMonth() + 1) {
+            t2 = year2 + '-' + Months + '-' + days111;
+          } else {
+            var daysd = this.getMonthDays(year2, month2);
+            t2 = year2 + '-' + month2 + '-' + daysd;
+          }
+        } else {
+          t2 = year2 + '-' + month2 + '-' + day2;
+        }
+      }
+      return t2;
+    },
+    getMonthDays(year, month) {
+      var stratDate = new Date(year, month - 1, 1),
+        endData = new Date(year, month, 1);
+      var days = (endData - stratDate) / (1000 * 60 * 60 * 24);
+      return days;
+    },
+    getDeptInfo(type, grade, answerValue) {
+      this.deptForm.type = type;
+      if (grade == '1') {
+        this.deptForm.parentId = this.companyCode;
+      } else if (grade == '2') {
+        this.deptForm.parentId = this.regionCode;
+      } else {
+        this.deptForm.type = '';
+        this.deptForm.parentId = '';
+      }
+      getSummaryMobileDeptInfo(this.deptForm).then((res) => {
+        if (grade == 'dq') {
+          if (res.data.region != null) {
+            this.regionList = res.data.region;
+            if (answerValue) {
+              let findCompany = this.regionList.find((item) => item.deptCode == answerValue);
+              this.onSalesRegionConfirm(findCompany);
+            } else {
+              this.onSalesRegionConfirm(this.regionList[0]);
+            }
+          }
+        } else if (grade == 'xsb') {
+          if (res.data.dept != null) {
+            this.deptList = res.data.dept;
+            if (answerValue) {
+              let findCompany = this.deptList.find((item) => item.deptCode == answerValue);
+              this.onSalesDepartmentConfirm(findCompany);
+            } else {
+              this.onSalesDepartmentConfirm(this.deptList[0]);
+            }
+          }
+        } else if (grade == 'gs') {
+          this.companyList = res.data.company;
+          if (answerValue) {
+            let findCompany = this.companyList.find((item) => item.deptCode == answerValue);
+            this.onregionConfirm(findCompany);
+          } else {
+            this.onregionConfirm(this.companyList[0]);
+          }
+          if (res.data.dept != null) {
+            this.deptList = res.data.dept;
+          }
+          if (res.data.region != null) {
+            this.regionList = res.data.region;
+          }
+        }
+      });
+    },
+    dailyFn(row) {
+      if (row.status != '0') {
+        if (row.status == -1) {
+          var dayTime = row.showDate;
+          var times = new Date(
+            dayTime.slice(0, 4) + '-' + dayTime.slice(4, 6) + '-' + dayTime.slice(6, 8)
+          ).getTime();
+          var time = new Date('2022-08-25').getTime();
+          if (times < time) {
+            this.$dialog.alert({
+              title: '系统提示',
+              message: '非常抱歉,8月25日前历史报告数据不存在',
+            });
+          } else {
+            this.$router.push({
+              path: '/weeklyHistoricalDetils',
+              query: { reportId: row.id },
+            });
+          }
+        } else {
+          this.$router.push({
+            path: '/weeklyHistoricalDetils',
+            query: { reportId: row.id },
+          });
+        }
+      }
+    },
+    regionClick(val) {
+      // if(this.powerGrade>4){
+      this.index = val;
+      this.RegionShow = true;
+      // }
+    },
+    SalesRegionClick(val) {
+      this.index = val;
+      this.SalesRegionShow = true;
+    },
+    SalesDepartmentClick(val) {
+      this.index = val;
+      this.SalesDepartmentShow = true;
+    },
+    StaffClick() {
+      this.StaffShow = true;
+    },
+    StartTimeClick() {
+      this.StartTimeShow = true;
+    },
+    EndTimeClick() {
+      this.EndTimeShow = true;
+    },
+    onSalesRegionConfirm(val) {
+      this.SalesRegionShow = false;
+      this.regionCode = val.deptId;
+      if (this.index != '') {
+        this.collectionItemList[this.index].answerName = val.deptName;
+        this.collectionItemList[this.index].answerValue = val.deptCode;
+      } else {
+        for (var k1 = 0; k1 < this.collectionItemList.length; k1++) {
+          if (this.collectionItemList[k1].answerType == 'xsb') {
+            this.collectionItemList[k1].answerName = '';
+            this.collectionItemList[k1].answerValue = '';
+          }
+          if (this.collectionItemList[k1].answerType == 'dq') {
+            this.collectionItemList[k1].answerName = val.deptName;
+            this.collectionItemList[k1].answerValue = val.deptCode;
+          }
+          if (this.collectionItemList[k1].answerType == 'xsb' && val.deptId != '') {
+            this.getDeptInfo('dept', 'xsb', this.collectionItemList[k1].answerValue);
+          }
+        }
+      }
+      // if (val.deptId != '') {
+      //   this.getDeptInfo('dept', 'xsb');
+      // }
+    },
+    onregionConfirm(val) {
+      this.RegionShow = false;
+      this.companyCode = val.deptId;
+      if (this.index != '') {
+        this.collectionItemList[this.index].answerName = val.deptName;
+        this.collectionItemList[this.index].answerValue = val.deptCode;
+      } else {
+        for (var k1 = 0; k1 < this.collectionItemList.length; k1++) {
+          if (
+            this.collectionItemList[k1].answerType == 'xsb' ||
+            this.collectionItemList[k1].answerType == 'dq'
+          ) {
+            this.collectionItemList[k1].answerName = '';
+            this.collectionItemList[k1].answerValue = '';
+          }
+          if (this.collectionItemList[k1].answerType == 'gs') {
+            this.collectionItemList[k1].answerName = val.deptName;
+            this.collectionItemList[k1].answerValue = val.deptCode;
+          }
+          if (this.collectionItemList[k1].answerType == 'dq') {
+            this.getDeptInfo('dept', 'dq', this.collectionItemList[k1].answerValue);
+          }
+        }
+      }
+    },
+    onSalesDepartmentConfirm(val) {
+      this.SalesDepartmentShow = false;
+      if (this.index != '') {
+        this.collectionItemList[this.index].answerName = val.deptName;
+        this.collectionItemList[this.index].answerValue = val.deptCode;
+      } else {
+        for (var k1 = 0; k1 < this.collectionItemList.length; k1++) {
+          if (this.collectionItemList[k1].answerType == 'xsb') {
+            this.collectionItemList[k1].answerName = val.deptName;
+            this.collectionItemList[k1].answerValue = val.deptCode;
+          }
+        }
+      }
+    },
+    onStartTimeConfirm(val) {
+      this.formData.startTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + '';
+      this.StartTimeShow = false;
+      this.endminDate = new Date(val);
+      this.endmaxDate = new Date(this.GetPreMonthDay(this.formData.startTime, -2, 'end'));
+      if (
+        new Date(this.formData.startTime).getTime() > new Date(this.formData.endTime).getTime() ||
+        new Date(this.endmaxDate).getTime() < new Date(this.formData.endTime).getTime()
+      ) {
+        this.formData.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + '';
+        this.endcurrentDate = this.GetPreMonthDay(this.formData.startTime, -2);
+      }
+      this.list = [];
+      this.formData.pageNum = 1;
+    },
+    onEndTimeConfirm(val) {
+      this.formData.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}');
+      this.strtmaxDate = new Date(val);
+      if (new Date(this.formData.startTime).getTime() > new Date(this.formData.endTime).getTime()) {
+        this.formData.startTime = this.formData.endTime;
+      }
+      this.list = [];
+      this.formData.pageNum = 1;
+      this.EndTimeShow = false;
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.componVisitSummary {
+  .van-f-red {
+    color: red;
+    width: 8px;
+    display: inline-block;
+    line-height: 26px;
+  }
+
+  .formLabel {
+    margin: 0 16px;
+    border-bottom: 1px solid #f1f1f1;
+  }
+
+  .formLabel .van-cell {
+    padding: 10px 0;
+  }
+
+  .formLabel .van-cell::after {
+    border: 0;
+  }
+
+  .formLabel .van-field {
+    border: 1px solid #f1f1f1;
+    padding: 6px;
+    width: 100%;
+    border-radius: 4px;
+    overflow: hidden;
+  }
+
+  .formLabel .van-field__control {
+    padding: 0 10px;
+  }
+
+  .formLabel .formLabeltitle {
+    position: absolute;
+    top: 8px;
+  }
+
+  .lineGrey {
+    height: 10px;
+    width: 100%;
+    background: #f1f1f1;
+  }
+
+  .z-checkbox .van-radio {
+    padding: 6px 0;
+  }
+
+  .z-cell .van-cell__title {
+    font-size: 16px;
+  }
+}
+</style>
+<style>
+.table-headermd {
+  font-size: 12px;
+  text-align: center;
+  position: initial;
+  width: 98% !important;
+  margin: 0 auto;
+  border-right: 0;
+}
+
+.table-headermd .el-table__header,
+.table-headermd .el-table__body {
+  width: 100% !important;
+}
+
+/*.table-headermd col {width: 6.8rem;}*/
+.table-headermd col:nth-child(4) {
+  width: 5.6rem;
+}
+
+.table-headermd col:nth-child(2),
+.table-headermd col:nth-child(3) {
+  width: 4.6rem;
+}
+
+.table-headermd .van-cell {
+  padding: 0 4px;
+  height: 100%;
+}
+
+.table-headermd th.el-table__cell > .cell {
+  padding: 0 4px;
+  text-align: center;
+}
+
+.table-headermd th.el-table__cell:first-child > .cell {
+  text-align: left;
+}
+
+.table-headermd th.el-table__cell {
+  background-color: #1989fa;
+  color: #fff;
+}
+
+.table-headermd .el-table__cell {
+  padding: 4px 0;
+}
+
+.table-headermd.el-table .cell {
+  padding: 0;
+}
+
+.table-headermd .tipTitle {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+}
+
+.table-headermd::before {
+  height: 0;
+}
+
+.xing {
+  color: red;
+  padding-left: 4px;
+}
+
+.formLabel .van-radio__label,
+.formLabel .van-checkbox__label {
+  font-size: 1.4rem;
+}
+
+.table-headermd .cell,
+.el-table--border .el-table__cell:first-child .cell {
+  padding: 0 4px;
+}
+
+.van-dialog__confirm,
+.van-dialog__confirm:active {
+  color: #1989fa;
+}
+
+.navBarTOP {
+  position: fixed;
+  width: 100%;
+  z-index: 2;
+  top: 0;
+}
+
+.isTableMust {
+  padding: 4px;
+  color: #999;
+  margin: 0;
+  margin-top: -10px;
+}
+</style>