Browse Source

公装主管任务

zhujindu 7 months ago
parent
commit
35fd5f91f1

+ 8 - 0
src/api/week.js

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

+ 42 - 33
src/components/zCheckbox2.vue

@@ -3,8 +3,12 @@
     <div>
     <div>
       <div class="checkbox">
       <div class="checkbox">
         <van-checkbox-group v-model="zSelectValuec" @change="checkboxclick">
         <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
+            :name="item.customOptionId + ''"
+            v-for="(item, index) in zCheckboxcolumns"
+            :key="index"
+            shape="square"
+            >{{ item.customOption }}
           </van-checkbox>
           </van-checkbox>
         </van-checkbox-group>
         </van-checkbox-group>
       </div>
       </div>
@@ -14,59 +18,65 @@
 
 
 <script>
 <script>
 export default {
 export default {
-  name: "zSelect",
+  name: 'zSelect',
   props: {
   props: {
     zCheckboxcolumns: [],
     zCheckboxcolumns: [],
-    checkboxval: "",
-    textc: "",
+    checkboxval: '',
+    textc: '',
     rules: false,
     rules: false,
-    answerType: "",
-    collectionType: ""
+    answerType: '',
+    collectionType: '',
   },
   },
   data() {
   data() {
     return {
     return {
       zSelect: false,
       zSelect: false,
-      zSelectValuec: ""
-    }
+      zSelectValuec: '',
+    };
   },
   },
   created() {
   created() {
-
-    this.checkboxvalFn()
+    this.checkboxvalFn();
   },
   },
   methods: {
   methods: {
     checkboxvalFn() {
     checkboxvalFn() {
-      if (this.checkboxval == "" || this.checkboxval == undefined) {
-        this.zSelectValuec = []
+      if (this.checkboxval == '' || this.checkboxval == undefined) {
+        this.zSelectValuec = [];
       } else {
       } else {
-        this.zSelectValuec = this.checkboxval.split(",")
+        this.zSelectValuec = this.checkboxval.split(',');
       }
       }
     },
     },
     checkboxclick(value) {
     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 = {
       let datalist = {
         id: this.textc,
         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>
 </script>
 
 
 <style scoped>
 <style scoped>
 .van-f-red {
 .van-f-red {
   color: red;
   color: red;
   width: 4px;
   width: 4px;
-  display: inline-block
+  display: inline-block;
 }
 }
 
 
 .zSelect .z-cell {
 .zSelect .z-cell {
@@ -76,9 +86,8 @@ export default {
 
 
 /*.checkbox{padding: 10px 16px 0 16px;background-color: white;}*/
 /*.checkbox{padding: 10px 16px 0 16px;background-color: white;}*/
 .checkbox .van-checkbox {
 .checkbox .van-checkbox {
-  padding-bottom: 10px
+  padding-bottom: 10px;
 }
 }
-
 </style>
 </style>
 <style>
 <style>
 .checkbox .van-checkbox__icon .van-icon {
 .checkbox .van-checkbox__icon .van-icon {
@@ -90,4 +99,4 @@ export default {
   color: #1989fa;
   color: #1989fa;
   background-color: #fff;
   background-color: #fff;
 }
 }
-</style>
+</style>

+ 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>

+ 180 - 180
src/views/week/VisitSummaryDetail.vue

@@ -2,7 +2,11 @@
   <div>
   <div>
     <!--        顶部条-->
     <!--        顶部条-->
     <div class="navBarTOP">
     <div class="navBarTOP">
-      <van-nav-bar class="navBar" :title="info.summaryTaskName" left-arrow @click-left="onClickLeft"/>
+      <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>-->
       <!--      <p style="text-align: right;margin-right: 16px;color: #1e5398;">{{title}}</p>-->
     </div>
     </div>
     <div class="lineGrey"></div>
     <div class="lineGrey"></div>
@@ -10,223 +14,220 @@
     <div class="lineGrey"></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>
-      <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>
-      <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>
     </div>
     <div class="lineGrey"></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>
     </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>
   </div>
 </template>
 </template>
 
 
 <script>
 <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 {
 export default {
-  name: "daily",
-  components: {deleteUploadImg},
+  name: 'daily',
+  components: { deleteUploadImg, componVisitSummary },
   data() {
   data() {
     return {
     return {
-      info:{},
-      zw:zw,
-      tm:tm,
-      ry:ry,
+      info: {},
+      zw: zw,
+      tm: tm,
+      ry: ry,
       show: true,
       show: true,
       num: 0,
       num: 0,
       todayGoal: {},
       todayGoal: {},
       progressWidth: 0,
       progressWidth: 0,
       history: history,
       history: history,
       imgArr: [],
       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() {
   created() {
-    this.powerGrade= localStorage.getItem("powerGrade")
-    this.getDetailById()
+    this.powerGrade = localStorage.getItem('powerGrade');
+    this.getDetailById();
   },
   },
-  watch:{
-    $route(to,from){
-      this.powerGrade= localStorage.getItem("powerGrade")
-      if(to.path=="/dailyDetails"){
-        this.getDetailById()
+  watch: {
+    $route(to, from) {
+      this.powerGrade = localStorage.getItem('powerGrade');
+      if (to.path == '/dailyDetails') {
+        this.getDetailById();
       }
       }
       // &&from.path=="/dailyApprovalList"
       // &&from.path=="/dailyApprovalList"
       // if(to.path=="/dailyDetails"&&from.path=="/myHistoricalDaily"){
       // if(to.path=="/dailyDetails"&&from.path=="/myHistoricalDaily"){
       //   this.getDetailById()
       //   this.getDetailById()
       // }
       // }
-    }
+    },
   },
   },
   activated() {
   activated() {
     this.num = 0;
     this.num = 0;
-    this.userTodayPlanNum()
+    this.userTodayPlanNum();
   },
   },
   methods: {
   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({
       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,
         duration: 0,
         message: '加载中...',
         message: '加载中...',
         forbidClick: true,
         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.writeAgain === '1';
+        });
+
+        this.collectionItemLists = res.data.customItemList;
+      });
     },
     },
     userTodayPlanNum() {
     userTodayPlanNum() {
-      userTodayPlanNum().then(res => {
+      // 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);
+    },
+    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.writeAgain);
+      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) {
         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)
+          this.$toast('操作成功!');
+          this.$router.replace({
+            path: '/VisitSummary',
+          });
         }
         }
-      })
+      });
     },
     },
-    onClickLeft() {
-      this.$router.go(-1)
-    }
-  }
-}
+  },
+};
 </script>
 </script>
 <style scoped>
 <style scoped>
 .container {
 .container {
@@ -242,15 +243,15 @@ export default {
 
 
 .formLabel {
 .formLabel {
   margin: 0 16px;
   margin: 0 16px;
-  border-bottom: 1px solid #f1f1f1
+  border-bottom: 1px solid #f1f1f1;
 }
 }
 
 
 .formLabel .van-cell {
 .formLabel .van-cell {
-  padding: 10px 0
+  padding: 10px 0;
 }
 }
 
 
 .formLabel .van-cell::after {
 .formLabel .van-cell::after {
-  border: 0
+  border: 0;
 }
 }
 
 
 .formLabel .van-field {
 .formLabel .van-field {
@@ -258,11 +259,11 @@ export default {
   padding: 6px;
   padding: 6px;
   width: 100%;
   width: 100%;
   border-radius: 4px;
   border-radius: 4px;
-  overflow: hidden
+  overflow: hidden;
 }
 }
 
 
 .formLabel .van-field__control {
 .formLabel .van-field__control {
-  padding: 0 10px
+  padding: 0 10px;
 }
 }
 
 
 .formLabel .formLabeltitle {
 .formLabel .formLabeltitle {
@@ -273,7 +274,7 @@ export default {
 .z-checkbox .van-radio {
 .z-checkbox .van-radio {
   padding: 6px 0;
   padding: 6px 0;
 }
 }
-.z-celly .van-cell__title{
+.z-celly .van-cell__title {
   font-weight: initial;
   font-weight: initial;
   font-size: 14px;
   font-size: 14px;
 }
 }
@@ -305,11 +306,11 @@ export default {
 
 
 .table-headermd .van-cell {
 .table-headermd .van-cell {
   padding: 0 4px;
   padding: 0 4px;
-  height: 100%
+  height: 100%;
 }
 }
 
 
 .table-headermd th.el-table__cell > .cell {
 .table-headermd th.el-table__cell > .cell {
-  padding: 0 4px
+  padding: 0 4px;
 }
 }
 
 
 .table-headermd th.el-table__cell {
 .table-headermd th.el-table__cell {
@@ -330,12 +331,12 @@ export default {
 }
 }
 
 
 .table-headermd::before {
 .table-headermd::before {
-  height: 0
+  height: 0;
 }
 }
 
 
 .f-right {
 .f-right {
   text-align: right;
   text-align: right;
-  margin: 0
+  margin: 0;
 }
 }
 
 
 .mg0 {
 .mg0 {
@@ -354,7 +355,6 @@ export default {
 }
 }
 
 
 .z-cells .van-cell {
 .z-cells .van-cell {
-  padding-bottom: 0
+  padding-bottom: 0;
 }
 }
-
-</style>
+</style>

+ 216 - 77
src/views/week/componVisitSummary.vue

@@ -67,56 +67,19 @@
             {{ item.remark }}
             {{ item.remark }}
           </p>
           </p>
         </div>
         </div>
-        <div v-if="item.answerType == 'gs'" class="formLabel z-cell" @click="regionClick(index)">
-          <van-cell>
-            <template #title>
-              <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
-            </template>
-          </van-cell>
-          <van-field
-            readonly
-            v-model="item.answerName"
-            :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
         <div
-          v-if="item.answerType == 'dq'"
-          class="formLabel z-cell"
-          @click="SalesRegionClick(index)">
+          class="formLabel z-cell z-cells z-celly"
+          v-if="item.answerType == 'gs' || item.answerType == 'dq' || item.answerType == 'xsb'">
           <van-cell>
           <van-cell>
-            <template #title>
-              <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
-            </template>
+            <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>
           </van-cell>
-          <van-field
-            readonly
-            v-model="item.answerName"
-            :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
-          v-if="item.answerType == 'xsb'"
-          class="formLabel z-cell"
-          @click="SalesDepartmentClick(index)">
-          <van-cell>
-            <template #title>
-              <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
-            </template>
-          </van-cell>
-          <van-field
-            readonly
-            v-model="item.answerName"
-            :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>
+          <p class="mg0">{{ item.answerValue }}</p>
         </div>
         </div>
         <div v-if="item.answerType == 'duox'" class="formLabel z-cell">
         <div v-if="item.answerType == 'duox'" class="formLabel z-cell">
           <van-cell>
           <van-cell>
@@ -149,7 +112,6 @@
         <br />
         <br />
       </div>
       </div>
     </van-form>
     </van-form>
-    <br />
     <van-calendar
     <van-calendar
       v-model="showCalendar"
       v-model="showCalendar"
       @confirm="onConfirm"
       @confirm="onConfirm"
@@ -203,13 +165,23 @@
     </van-popup>
     </van-popup>
   </div>
   </div>
 </template>
 </template>
+
 <script>
 <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 {
 export default {
+  name: 'MyHistoricalWeekly',
   components: { zRadio, zCheckbox, uploadImg, deleteUploadImg },
   components: { zRadio, zCheckbox, uploadImg, deleteUploadImg },
   props: {
   props: {
-    collectionItemList: {
+    collectionItemLists: {
       type: Array,
       type: Array,
-      default: [],
+      default() {
+        return [];
+      },
     },
     },
   },
   },
   data() {
   data() {
@@ -267,7 +239,25 @@ export default {
       index: '',
       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: {
   methods: {
     showCalendarClick(val) {
     showCalendarClick(val) {
       this.dateIndex = val;
       this.dateIndex = val;
@@ -308,6 +298,7 @@ export default {
       }
       }
     },
     },
     zSelectVal(value) {
     zSelectVal(value) {
+      console.log(value);
       var collectionAnswerlisd = this.collectionAnswerlisd;
       var collectionAnswerlisd = this.collectionAnswerlisd;
       if (collectionAnswerlisd.length > 0) {
       if (collectionAnswerlisd.length > 0) {
         var num = 0;
         var num = 0;
@@ -369,40 +360,43 @@ export default {
       }
       }
     },
     },
     setCollectionItemLists() {
     setCollectionItemLists() {
-      var collectionItemLists = res.data;
-      for (var q = 0; q < collectionItemLists.length; q++) {
-        collectionItemLists[q].answerName = undefined;
+      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 (collectionItemLists[q].answerType == 'gs') {
-          this.getDeptInfo('dept', 'gs', collectionItemLists[q].answerValue);
-        }
+        // if (this.collectionItemList[q].answerType == 'gs') {
+        //   this.getDeptInfo('dept', 'gs', this.collectionItemList[q].answerValue);
+        // }
         // 单选
         // 单选
-        if (
-          collectionItemLists[q].answerType == 'dx' &&
-          collectionItemLists[q].showHistory == '1'
-        ) {
-          let findCustom = collectionItemLists[q].customOptionList.find((item) => item.checked);
+        if (this.collectionItemList[q].answerType == 'dx') {
+          let findCustom = this.collectionItemList[q].customOptionList.find((item) => item.checked);
           if (findCustom) {
           if (findCustom) {
-            collectionItemLists[q].answerValue = findCustom.customOptionId + '';
+            this.collectionItemList[q].answerValue = findCustom.customOptionId + '';
           }
           }
         }
         }
         // 多选
         // 多选
-        if (
-          collectionItemLists[q].answerType == 'duox' &&
-          collectionItemLists[q].showHistory == '1'
-        ) {
+        if (this.collectionItemList[q].answerType == 'duox') {
           let findCustom = [];
           let findCustom = [];
-          collectionItemLists[q].customOptionList.forEach((item) => {
+          this.collectionItemList[q].customOptionList.forEach((item) => {
             if (item.checked) {
             if (item.checked) {
               findCustom.push(item.customOptionId + '');
               findCustom.push(item.customOptionId + '');
             }
             }
           });
           });
           if (findCustom) {
           if (findCustom) {
-            collectionItemLists[q].answerValue = findCustom.join(',');
+            this.collectionItemList[q].answerValue = findCustom.join(',');
           }
           }
         }
         }
+        // 照片
+        if (this.collectionItemList[q].answerType == 'zp') {
+          let fileIdList = [];
+          this.collectionItemList[q].fileInfoList.forEach((item) => {
+            fileIdList.push(item.id);
+          });
+          this.collectionItemList[q].fileIdList = fileIdList;
+        }
       }
       }
-      this.collectionItemList = collectionItemLists;
     },
     },
     getThreeDaysAgo() {
     getThreeDaysAgo() {
       let myDate = new Date();
       let myDate = new Date();
@@ -482,12 +476,6 @@ export default {
         if (grade == 'dq') {
         if (grade == 'dq') {
           if (res.data.region != null) {
           if (res.data.region != null) {
             this.regionList = res.data.region;
             this.regionList = res.data.region;
-            // for (var k = 0; k < this.collectionItemList.length; k++) {
-            //   if (this.collectionItemList[k].answerType == 'dq') {
-            //     this.collectionItemList[k].answerName = res.data.region[0].deptName;
-            //     this.collectionItemList[k].answerValue = res.data.region[0].deptCode;
-            //   }
-            // }
             if (answerValue) {
             if (answerValue) {
               let findCompany = this.regionList.find((item) => item.deptCode == answerValue);
               let findCompany = this.regionList.find((item) => item.deptCode == answerValue);
               this.onSalesRegionConfirm(findCompany);
               this.onSalesRegionConfirm(findCompany);
@@ -667,4 +655,155 @@ export default {
   },
   },
 };
 };
 </script>
 </script>
-<style lang="less" scoped></style>
+<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>