Kaynağa Gözat

公装主管任务

zhujindu 7 ay önce
ebeveyn
işleme
5f282268d9

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

+ 2 - 2
src/views/week/VisitSummaryAdd.vue

@@ -414,7 +414,7 @@ export default {
       }
       // // 照片
       let zpDataList = this.collectionItemList.find((item) => item.answerType == 'zp');
-      if (zpDataList) {
+      if (zpDataList && zpDataList.fileInfoList) {
         let fileIdList = [];
         zpDataList.fileInfoList.forEach((item) => {
           fileIdList.push(item.id);
@@ -432,7 +432,7 @@ export default {
             if (res.code == 200) {
               this.$router.go(-1);
             } else {
-              this.$toast(err.msg);
+              this.$toast(res.msg);
             }
           })
           .catch((err) => {

+ 4 - 3
src/views/week/VisitSummaryDetail.vue

@@ -7,7 +7,6 @@
         :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>
@@ -176,7 +175,9 @@ export default {
       // });
     },
     onClickLeft() {
-      this.$router.go(-1);
+      this.$router.replace({
+        path: '/VisitSummary',
+      });
     },
     onSubmit() {
       let collectionAnswerlisd = this.$refs.componVisitSummary.collectionAnswerlisd;
@@ -211,7 +212,7 @@ export default {
               path: '/VisitSummary',
             });
           } else {
-            this.$toast(err.msg);
+            this.$toast(res.msg);
           }
         })
         .catch((err) => {

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

@@ -550,9 +550,6 @@ export default {
         }
       }
     },
-    onClickLeft() {
-      this.$router.go(-1);
-    },
     regionClick(val) {
       // if(this.powerGrade>4){
       this.index = val;