Browse Source

Merge branch 'feature_20250521_主管任务审批' into release

zhujindu 5 months ago
parent
commit
9c3ef00214

+ 27 - 0
src/api/SUPTaskApproval.js

@@ -0,0 +1,27 @@
+import request from '@/utils/request';
+
+// 主管审批列表接口
+export function getSummaryApprovalList(query) {
+  return request({
+    url: '/mobile/summaryMobile/getSummaryApprovalList',
+    method: 'get',
+    params: query,
+  });
+}
+
+// 主管任务审批接口
+export function changeApproval(data) {
+  return request({
+    url: '/mobile/summaryMobile/changeApproval',
+    method: 'post',
+    data,
+  });
+}
+
+export function getApprovalDetail(query) {
+  return request({
+    url: '/mobile/summaryMobile/getApprovalDetail',
+    method: 'get',
+    params: query,
+  });
+}

BIN
src/assets/bumen.png


BIN
src/assets/rili.png


BIN
src/assets/zhuguan.png


+ 15 - 3
src/components/zCheckbox2.vue

@@ -32,11 +32,23 @@ export default {
   data() {
     return {
       zSelect: false,
-      zSelectValuec: '',
+      zSelectValuec: [],
     };
   },
-  created() {
-    this.checkboxvalFn();
+  watch: {
+    checkboxval: {
+      handler(va) {
+        if (this.checkboxval == '' || this.checkboxval == undefined) {
+          this.zSelectValuec = [];
+        } else {
+          this.zSelectValuec = this.checkboxval.split(',');
+        }
+      },
+      immediate: true,
+    },
+  },
+  activated() {
+    // this.checkboxvalFn();
   },
   methods: {
     checkboxvalFn() {

+ 9 - 1
src/components/zRadio2.vue

@@ -28,9 +28,17 @@ export default {
   data() {
     return {
       radioChange: false,
-      zradioc: this.radio,
+      zradioc: '',
     };
   },
+  watch: {
+    radio: {
+      handler(va) {
+        this.zradioc = this.radio;
+      },
+      immediate: true,
+    },
+  },
   methods: {
     radiofn(value) {
       this.radioChange = true;

+ 10 - 5
src/layout/index.vue

@@ -1,12 +1,17 @@
 <template>
   <div class="container bgcolor">
+    <!-- 默认都走缓存 keepAlive:true 不缓存-->
+    <!-- <template v-if="$route.meta.keepAlive">
+      <router-view></router-view>
+    </template>
+    <template v-else>
+      <keep-alive>
+        <router-view></router-view>
+      </keep-alive>
+    </template> -->
     <keep-alive>
-      <router-view :key="$route.fullPath" />
+      <router-view></router-view>
     </keep-alive>
-    <!-- <keep-alive>
-      <router-view v-if="$route.meta.keepAlive"></router-view>
-    </keep-alive>
-    <router-view v-if="!$route.meta.keepAlive"></router-view> -->
   </div>
 </template>
 <script>

+ 13 - 1
src/router/index.js

@@ -75,7 +75,6 @@ const router = new VueRouter({
           meta: { title: '提示类-业务员建店未完成页面' },
           component: () => import('@/views/home/hintTabPage/unCreateStore.vue'),
           meta: {
-            keepAlive: false,
             title: '提示类-业务员建店未完成页面',
           },
         },
@@ -442,6 +441,19 @@ const router = new VueRouter({
           component: () => import('@/views/week/systemSettings.vue'),
           meta: { title: '设置' },
         },
+        {
+          path: '/SUPTaskApproval',
+          name: 'SUPTaskApproval',
+          component: () => import('@/views/week/SUPTaskApproval/index.vue'),
+          meta: { title: '主管任务审批', keepAlive: true },
+          children: [],
+        },
+        {
+          path: '/SUPTaskApprovalDetail',
+          name: 'SUPTaskApprovalDetail',
+          component: () => import('@/views/week/SUPTaskApproval/SUPTaskApprovalDetail.vue'),
+          meta: { title: '主管任务审批详情', keepAlive: true },
+        },
       ],
     },
     {

+ 495 - 0
src/views/week/SUPTaskApproval/SUPTaskApprovalDetail.vue

@@ -0,0 +1,495 @@
+<template>
+  <div v-if="info" class="SUPTaskApprovalDetail">
+    <!--        顶部条-->
+    <div class="navBarTOP">
+      <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="container linep"
+      style="
+        background-color: #fff;
+        width: 94%;
+        margin: 0px auto;
+        border-radius: 6px;
+        padding: 10px;
+      ">
+      <div style="padding: 4px 0">
+        <img :src="require('@/assets/zhuguan.png')" width="14" />
+        <span style="font-size: 13px; margin-left: 8px"
+          >&nbsp;{{ info.nickName }} - {{ info.postName }}</span
+        >
+      </div>
+      <div style="padding: 4px 0">
+        <img :src="require('@/assets/bumen.png')" width="14" />
+        <span style="font-size: 13px; margin-left: 8px">&nbsp;所属部门:{{ info.deptName }}</span>
+      </div>
+      <div style="padding: 4px 0">
+        <img :src="require('@/assets/rili.png')" width="14" />
+        <span style="font-size: 13px; margin-left: 8px">&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">
+      <detailItem
+        :collectionItemLists="collectionItemLists"
+        :approvalStatus="info.approvalStatus"
+        ref="detailItem"></detailItem>
+    </div>
+    <div
+      class="newCarList"
+      v-for="(item, index) in info.summaryApprovals"
+      :key="index"
+      v-if="info.summaryApprovals">
+      <div class="newlist">
+        <div class="info">审批人:{{ item.handleUserName }}</div>
+        <div class="info">审批结果:{{ setApprovalStatus(item.approvalStatus) }}</div>
+        <div class="info">审批时间:{{ item.handleTime }}</div>
+        <div class="info">审批意见:{{ item.approvalOpinion }}</div>
+      </div>
+    </div>
+    <br />
+    <div class="approvalRemarh" v-if="info.summaryApprovalButton">
+      <div class="approvalLabel">审批意见</div>
+      <div class="remark">
+        <van-field
+          v-model="approvalMessage"
+          rows="3"
+          type="textarea"
+          placeholder="请输入审批意见" />
+      </div>
+    </div>
+    <template v-if="info.summaryApprovalButton">
+      <div class="bottomBtn">
+        <van-button color="red" round @click="approvalStoreFun('Nopass')">拒绝</van-button>
+        <van-button type="primary" round @click="approvalStoreFun('pass')">通过</van-button>
+      </div>
+    </template>
+    <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 detailItem from './detailItem';
+import { writeAgainCustomAnswer } from '@/api/week';
+import { changeApproval, getApprovalDetail } from '@/api/SUPTaskApproval.js';
+export default {
+  name: 'SUPTaskApprovalDetail',
+  components: { deleteUploadImg, detailItem },
+  data() {
+    return {
+      info: null,
+      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',
+      collectionItemLists: [],
+      writeAgain: false,
+      approvalMessage: '',
+      tabVal: '1',
+      //
+    };
+  },
+  activated() {
+    this.powerGrade = localStorage.getItem('powerGrade');
+    this.tabVal = this.$route.query.tabVal;
+    this.getDetailById();
+    this.num = 0;
+    this.userTodayPlanNum();
+  },
+  methods: {
+    setApprovalStatus(status) {
+      if (status == '1') {
+        return '通过';
+      } else if (status == '2') {
+        return '拒绝';
+      }
+    },
+    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,
+      });
+      getApprovalDetail({
+        userSummaryId: this.$route.query.userSummaryId,
+        summaryApprovalId: this.$route.query.summaryApprovalId,
+      }).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 && 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;
+        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);
+      //   }
+      // });
+    },
+    onClickLeft() {
+      this.$router.replace({
+        path: '/SUPTaskApproval',
+        query: {
+          tabVal: this.info.summaryApprovalButton ? '1' : '2',
+        },
+      });
+    },
+    onSubmit() {
+      let collectionAnswerlisd = this.$refs.detailItem.collectionAnswerlisd;
+      let collectionItemList = this.$refs.detailItem.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);
+        });
+    },
+    approvalStoreFun(type) {
+      if (type == 'pass') {
+        this.changeApprovalFun('1');
+      } else {
+        if (this.approvalMessage != '') {
+          this.changeApprovalFun('2');
+        } else {
+          this.$notify({ type: 'warning', message: '请输入审批意见' });
+        }
+      }
+    },
+    changeApprovalFun(approvalStatus) {
+      this.toastLoading(0, '加载中...', true);
+      changeApproval({
+        summaryApprovalId: this.$route.query.summaryApprovalId || '', //	Long	主管任务审批id
+        userSummaryId: this.$route.query.userSummaryId, //	Long	主管任务填写主键id
+        approvalStatus: approvalStatus, //	string	审批状态:1-通过 2-拒绝
+        approvalOpinion: this.approvalMessage, //	string	审批意见,如果审批状态为拒绝则不能为空
+      }).then((res) => {
+        this.toastLoading().clear();
+        if (res.code == 200) {
+          this.$router.replace({
+            path: '/SUPTaskApproval',
+          });
+        }
+      });
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.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;
+}
+.bottomBtn {
+  position: fixed;
+  bottom: 0;
+  z-index: 10;
+  height: 50px;
+  width: 100%;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+  .van-button {
+    /* flex: 1; */
+    width: 40%;
+  }
+}
+.approvalRemarh {
+  width: 94%;
+  margin: 0px auto;
+  border-radius: 6px;
+  margin-bottom: 40px;
+  .approvalLabel {
+    font-size: 14px;
+    padding: 5px 0;
+  }
+}
+</style>
+<style lang="scss">
+.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;
+}
+.SUPTaskApprovalDetail {
+  .newCarList {
+    width: 94%;
+    padding: 14px;
+    margin: 0px auto;
+    border-radius: 8px;
+    overflow: hidden;
+    background: #fff;
+    margin-top: 10px;
+  }
+  .newCarList .van-cell {
+    border-radius: 6px;
+    overflow: hidden;
+  }
+  .newCarList .newlist .title {
+    /* line-height: 32px; */
+  }
+  .newCarList .van-cell__right-icon {
+    top: 5px;
+  }
+  .newCarList .newlist {
+    box-sizing: border-box;
+  }
+  .newCarList .newlist .title {
+    font-size: 14px;
+    font-weight: bold;
+    color: #333;
+    padding: 5px 0;
+    /* line-height: 14px; */
+  }
+  .newCarList .newlist .info {
+    font-size: 14px;
+    color: #999;
+    line-height: 26px;
+  }
+  .newCarList .newlist .title p {
+    padding: 0;
+    margin: 0;
+  }
+  .newCarList .newlist .title .textLeft {
+    display: inline-block;
+    /* padding-bottom: 10px; */
+  }
+  .newCarList .newlist .title .textRight {
+    float: right;
+    color: #0057ba;
+  }
+}
+</style>

+ 859 - 0
src/views/week/SUPTaskApproval/detailItem.vue

@@ -0,0 +1,859 @@
+<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>
+          <van-field
+            v-model="item.answerValue"
+            :placeholder="item.customName"
+            type="number"
+            :disabled="true"
+            @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="true"
+            @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="false"
+              :uploadid="uploadid2"
+              @newimgarr="newimgarr1"
+              imgText="上传照片"
+              :indexImg="index"
+              :customId="item.customId"
+              :summaryId="item.summaryId"
+              :allowWriteAgain="false"
+              @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="true"
+            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.answerName }}</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="true"
+            :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="true"
+            :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, getDeptsByUser } 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 [];
+      },
+    },
+    approvalStatus: {
+      type: String,
+      default: '',
+    },
+    source: {
+      type: String,
+      default: '',
+    },
+  },
+  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: '',
+      activaFlag: true,
+    };
+  },
+  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].answerName = 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 (this.collectionItemList[index].answerName) {
+        if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(this.collectionItemList[index].answerName)) {
+          this.collectionItemList[index].answerName = this.collectionItemList[
+            index
+          ].answerName.replace(
+            /\.\d{2,}$/,
+            this.collectionItemList[index].answerName.substr(
+              this.collectionItemList[index].answerName.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.collectionItemList[q].answerType == 'dq' ||
+        //     this.collectionItemList[q].answerType == 'xsb') &&
+        //   this.activaFlag
+        // ) {
+        //   this.activaFlag = false;
+        //   if (this.collectionItemList[q].answerType == 'xsb') {
+        //     this.getDeptsBy(this.collectionItemList[q].answerValue);
+        //     this.getDeptInfo(
+        //       'dept',
+        //       this.collectionItemList[q].answerType,
+        //       this.collectionItemList[q].answerValue
+        //     );
+        //   } else {
+        //     this.getDeptInfo(
+        //       'dept',
+        //       this.collectionItemList[q].answerType,
+        //       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, answerName) {
+      this.deptForm.type = type;
+      if (grade == 'dq') {
+        this.deptForm.parentId = this.companyCode;
+      } else if (grade == 'xsb') {
+        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 (answerName) {
+              let findCompany = this.companyList.find((item) => item.deptName == answerName);
+              // this.onSalesRegionConfirm(findCompany);
+            } else {
+              this.onSalesRegionConfirm(this.regionList[0]);
+            }
+          }
+        } else if (grade == 'xsb') {
+          if (res.data.dept != null) {
+            this.deptList = res.data.dept;
+            if (answerName) {
+              let findCompany = this.regionList.find((item) => item.deptName == answerName);
+              // this.onSalesDepartmentConfirm(findCompany);
+            } else {
+              this.onSalesDepartmentConfirm(this.deptList[0]);
+            }
+          }
+        } else if (grade == 'gs') {
+          this.companyList = res.data.company;
+          if (answerName) {
+            let findCompany = this.companyList.find((item) => item.deptName == answerName);
+            // 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;
+          }
+        }
+      });
+    },
+    getDeptsBy(answerName) {
+      getDeptsByUser().then((res) => {
+        if (res.data && res.code == 200) {
+          let arr = [];
+          res.data.forEach((val) => {
+            arr.push({
+              ancestors: val.ancestors || '',
+              deptCode: val.deptCode || '',
+              deptId: val.deptId || '',
+              deptLevel: val.deptLevel || '',
+              deptName: val.deptName || '',
+              parentId: val.parentId || '',
+            });
+          });
+          this.deptList = arr;
+          if (answerName) {
+            let findCompany = this.regionList.find((item) => item.deptCode == answerName);
+            // this.onSalesDepartmentConfirm(findCompany);
+          } else {
+            this.onSalesDepartmentConfirm(this.deptList[0]);
+          }
+        }
+      });
+    },
+    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;
+      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');
+        }
+      }
+    },
+    onregionConfirm(val) {
+      this.RegionShow = false;
+      this.companyCode = val.deptId;
+      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 == 'xsb') {
+          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');
+        }
+      }
+    },
+    onSalesDepartmentConfirm(val) {
+      this.SalesDepartmentShow = false;
+      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>

+ 144 - 0
src/views/week/SUPTaskApproval/index.vue

@@ -0,0 +1,144 @@
+<template>
+  <div class="SUPTaskApproval">
+    <van-nav-bar class="navBar" title="主管任务审批" left-arrow @click-left="onClickLeft" />
+    <van-tabs class="myTab" type="card" v-model="tabVal" color="#0057ba" @change="tabChange">
+      <van-tab title="待审批" name="1"></van-tab>
+      <van-tab title="已审批" name="2"></van-tab>
+    </van-tabs>
+    <div class="content">
+      <van-list v-model="loading" :finished="finished" finished-text="--已经到底了--">
+        <div class="newCarList" v-for="(item, index) in list" :key="index">
+          <van-cell is-link>
+            <div class="newlist" @click="approveFn(item)">
+              <div class="title">
+                <p class="textLeft">{{ item.summaryTaskName }}</p>
+              </div>
+              <div class="info">提交人:{{ item.applyUserName }}</div>
+              <div class="info">部门:{{ item.applyDeptName }}</div>
+              <div class="info">拜访时间:{{ item.todoTime }}</div>
+            </div>
+          </van-cell>
+        </div>
+        <van-empty description="" v-if="list.length == 0" />
+      </van-list>
+    </div>
+  </div>
+</template>
+<script>
+import { getSummaryApprovalList } from '@/api/SUPTaskApproval.js';
+export default {
+  data() {
+    return {
+      tabVal: '1',
+      list: [],
+      loading: false,
+      finished: true,
+    };
+  },
+  activated() {
+    this.tabVal = this.$route.query.tabVal || '1';
+    this.getApprovalList();
+  },
+  methods: {
+    tabChange(name) {
+      window.scrollTo(0, 0);
+      this.list = [];
+      this.tabVal = name;
+      this.getApprovalList();
+    },
+    onClickLeft() {
+      this.$router.replace({
+        path: '/My/index',
+      });
+    },
+    getApprovalList() {
+      this.toastLoading(0, '加载中...', true);
+      getSummaryApprovalList({ type: this.tabVal })
+        .then((res) => {
+          this.toastLoading().clear();
+          if (res.code == 200 && res.data) {
+            this.list = res.data;
+          }
+        })
+        .catch((err) => {
+          this.toastLoading().clear();
+          this.$toast(err.msg);
+        });
+    },
+    approveFn(row) {
+      this.$router.push({
+        path: '/SUPTaskApprovalDetail',
+        query: {
+          userSummaryId: row.userSummaryId,
+          summaryApprovalId: row.summaryApprovalId,
+        },
+      });
+    },
+  },
+};
+</script>
+<style lang="scss">
+.SUPTaskApproval {
+  .myTab {
+    .van-tabs__nav--card {
+      margin: 0 !important;
+      border-left: 0;
+      border-right: 0;
+    }
+    .van-tabs__wrap,
+    .van-tabs__nav--card {
+      height: 39px;
+    }
+    .van-tab {
+      line-height: 40px;
+    }
+  }
+  .van-tabs__nav--card .van-tab.van-tab--active {
+    background-color: #0057ba !important;
+  }
+  .content {
+    .newCarList {
+      margin: 14px;
+      border-radius: 8px;
+      overflow: hidden;
+    }
+    .newCarList .van-cell {
+      border-radius: 6px;
+      overflow: hidden;
+    }
+    .newCarList .newlist .title {
+      /* line-height: 32px; */
+    }
+    .newCarList .van-cell__right-icon {
+      top: 5px;
+    }
+    .newCarList .newlist {
+      box-sizing: border-box;
+    }
+    .newCarList .newlist .title {
+      font-size: 14px;
+      font-weight: bold;
+      color: #333;
+      padding: 5px 0;
+      /* line-height: 14px; */
+    }
+    .newCarList .newlist .info {
+      font-size: 14px;
+      color: #999;
+      line-height: 26px;
+    }
+    .newCarList .newlist .title p {
+      padding: 0;
+      margin: 0;
+    }
+    .newCarList .newlist .title .textLeft {
+      display: inline-block;
+      /* padding-bottom: 10px; */
+    }
+    .newCarList .newlist .title .textRight {
+      float: right;
+      color: #0057ba;
+    }
+  }
+}
+</style>

+ 62 - 6
src/views/week/VisitSummary.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="bgcolor">
+  <div class="bgcolor VisitSummary">
     <!--        顶部条-->
     <van-nav-bar class="navBar" title="主管任务查询" left-arrow @click-left="onClickLeft" />
     <div class="container contentpd16">
@@ -39,6 +39,13 @@
             <van-field v-model="formData.summaryTaskName" placeholder="请输入任务名称" />
           </van-cell>
         </van-col>
+        <van-col span="24">
+          <van-cell
+            :title="approvalStatus.text"
+            is-link
+            @click="approvalStatusShow = true"
+            arrow-direction="down" />
+        </van-col>
       </van-row>
       <br />
       <van-button type="info" size="small" plain class="Btn100" @click="searchBtn">查找</van-button>
@@ -64,9 +71,21 @@
               <div class="title">
                 <p class="textLeft">{{ item.nickName }}的{{ item.summaryTaskName }}</p>
               </div>
+              <div class="info">部门:{{ item.deptName }}</div>
               <div class="info">提交时间:{{ item.createTime }}</div>
             </div>
           </van-cell>
+          <div class="approvalStatusBtn" v-if="item.approvalStatus">
+            <van-button type="primary" size="small" v-if="item.approvalStatus == '2'"
+              >审批通过</van-button
+            >
+            <van-button type="info" size="small" v-if="item.approvalStatus == '1'"
+              >提交待审批</van-button
+            >
+            <van-button color="red" size="small" v-if="item.approvalStatus == '3'"
+              >拒绝待提交</van-button
+            >
+          </div>
         </div>
         <van-empty v-if="list.length == 0" />
       </van-list>
@@ -126,6 +145,14 @@
         @confirm="onEndTimeConfirm"
         @cancel="EndTimeShow = false" />
     </van-popup>
+    <!-- approvalStatus:审批状态:1-待审批 2-审批通过 3-拒绝待提交 -->
+    <van-popup v-model="approvalStatusShow" capture position="bottom">
+      <van-picker
+        show-toolbar
+        :columns="approvalStatusList"
+        @confirm="onSalesApprovalStatus"
+        @cancel="approvalStatusShow = false" />
+    </van-popup>
   </div>
 </template>
 
@@ -178,9 +205,19 @@ export default {
         pageSize: 10, // 当前每页条数  int类型
       },
       tableList: [],
+      approvalStatusShow: false,
+      approvalStatusList: [
+        //1-待审批 2-审批通过 3-拒绝待提交
+        { text: '审批状态(全部)', value: '' },
+        { text: '待审批', value: '1' },
+        { text: '审批通过', value: '2' },
+        { text: '拒绝待提交', value: '3' },
+      ],
+      approvalStatus: { text: '审批状态(全部)', value: '' },
     };
   },
-  created() {
+  activated() {
+    this.approvalStatus = this.approvalStatusList[0];
     this.userList = [];
     this.formData.startTime = this.getThreeDaysAgo();
     // this.formData.startTime = this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'),2)
@@ -310,6 +347,7 @@ export default {
       this.formData.regionId = this.regionCode; // 大区id,必传  Long类型
       this.formData.deptId = this.deptCode; // 部门id,如果为周报或日报为必传  Long类型
       this.formData.userId = this.userCode; // 业务员id,如果为日报为必传      Long类型
+      this.formData.approvalStatus = this.approvalStatus.value;
       queryHistorySummaryList(this.formData).then((res) => {
         loading1.clear();
         if (res.code == 200) {
@@ -453,13 +491,11 @@ export default {
     dailyFn(row) {
       this.$router.push({
         path: '/VisitSummaryDetail',
-        query: { userSummaryId: row.userSummaryId },
+        query: { userSummaryId: row.userSummaryId, source: 'VisitSummary' },
       });
     },
     onClickLeft() {
-      this.$router.replace({
-        path: '/My/index',
-      });
+      this.$router.go(-1);
     },
     regionClick() {
       // if(this.powerGrade>4){
@@ -547,6 +583,10 @@ export default {
 
       this.EndTimeShow = false;
     },
+    onSalesApprovalStatus(val) {
+      this.approvalStatus = val;
+      this.approvalStatusShow = false;
+    },
   },
 };
 </script>
@@ -635,3 +675,19 @@ export default {
   margin: 4px 0;
 }
 </style>
+<style scoped lang="scss">
+.VisitSummary {
+  .brud {
+    position: relative;
+  }
+  .approvalStatusBtn {
+    position: absolute;
+    bottom: 40px;
+    right: 10px;
+    .van-button {
+      border-radius: 5px;
+      width: 78px;
+    }
+  }
+}
+</style>

+ 5 - 1
src/views/week/VisitSummaryAdd.vue

@@ -426,7 +426,11 @@ export default {
         this.timer = setTimeout(() => {
           this.flagclick = true;
         }, 2000);
-        insertCustomAnswer(this.collectionItemList)
+        insertCustomAnswer({
+          userSummaryId: '', //	Long	用户总结id,如果为新增则不填,编辑则必填
+          summaryId: this.$route.query.summaryId, //Long	主管任务id
+          customItemList: this.collectionItemList, //List<Object>	答案列表
+        })
           .then((res) => {
             if (res.code == 200) {
               this.$router.go(-1);

+ 171 - 18
src/views/week/VisitSummaryDetail.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div v-if="info" class="VisitSummaryDetail">
     <!--        顶部条-->
     <div class="navBarTOP">
       <van-nav-bar
@@ -26,31 +26,63 @@
       ">
       <div style="padding: 4px 0">
         <van-icon :name="ry" size="16" style="float: left" />
-        <span>&nbsp;{{ info.nickName }} - {{ info.postName }}</span>
+        <span style="font-size: 13px; margin-left: 8px"
+          >&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>
+        <span style="font-size: 13px; margin-left: 8px">&nbsp;所属部门:{{ info.deptName }}</span>
       </div>
       <div style="padding: 4px 0">
         <van-icon :name="tm" size="16" style="float: left" />
-        <span>&nbsp;提交时间:{{ info.createTime }}</span>
+        <span style="font-size: 13px; margin-left: 8px">&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">
-      <componVisitSummary
-        :collectionItemLists="collectionItemLists"
-        ref="componVisitSummary"></componVisitSummary>
+      <!-- 退回待提交 summaryUpdate:Boolean类型,true-允许编辑,false-不允许编辑 -->
+      <template v-if="info.approvalStatus == '3' && info.summaryUpdate">
+        <componVisitSummary
+          :collectionItemLists="collectionItemLists"
+          :approvalStatus="info.approvalStatus"
+          ref="componVisitSummary"></componVisitSummary>
+      </template>
+      <!-- 补填、详情 -->
+      <template v-else>
+        <allowWriteAgainSummary
+          :collectionItemLists="collectionItemLists"
+          :approvalStatus="info.approvalStatus"
+          ref="allowWriteAgainSummary"></allowWriteAgainSummary>
+      </template>
+    </div>
+    <div
+      class="newCarList"
+      v-for="(item, index) in info.summaryApprovals"
+      :key="index"
+      v-if="info.summaryApprovals">
+      <div class="newlist">
+        <div class="info">审批人:{{ item.handleUserName }}</div>
+        <div class="info">审批结果:{{ setApprovalStatus(item.approvalStatus) }}</div>
+        <div class="info">审批时间:{{ item.handleTime }}</div>
+        <div class="info">审批意见:{{ item.approvalOpinion }}</div>
+      </div>
     </div>
     <br />
-    <div class="tc" style="padding: 0 16px" v-if="writeAgain">
+    <!-- 从查询列表来 -->
+    <!-- approvalStatus//1-待审批 2-审批通过 3-拒绝待提交 -->
+    <div class="tc" style="padding: 0 16px" v-if="writeAgain && !info.approvalStatus">
       <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">
         补填保存
       </van-button>
     </div>
+    <div class="tc" style="padding: 0 16px" v-if="info.approvalStatus == '3' && info.summaryUpdate">
+      <van-button class="submitBtn" block type="info" color="#0057ba" @click="submitApproval">
+        提交审批
+      </van-button>
+    </div>
     <br />
     <br />
     <br />
@@ -62,17 +94,19 @@ 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 { getSummaryMobilo, insertCustomAnswer } from '@/api/index';
 import { ImagePreview } from 'vant';
 import deleteUploadImg from '@/components/deleteUploadImg';
 import componVisitSummary from '@/views/week/componVisitSummary';
+import allowWriteAgainSummary from '@/views/week/allowWriteAgainSummary';
 import { writeAgainCustomAnswer } from '@/api/week';
+import { changeApproval } from '@/api/SUPTaskApproval.js';
 export default {
   name: 'daily',
-  components: { deleteUploadImg, componVisitSummary },
+  components: { deleteUploadImg, componVisitSummary, allowWriteAgainSummary },
   data() {
     return {
-      info: {},
+      info: null,
       zw: zw,
       tm: tm,
       ry: ry,
@@ -96,16 +130,26 @@ export default {
       type: '-1',
       collectionItemLists: [],
       writeAgain: false,
+      approvalMessage: '',
+      source: '',
       //
     };
   },
   activated() {
+    this.source = this.$route.query.source || '';
     this.powerGrade = localStorage.getItem('powerGrade');
     this.getDetailById();
     this.num = 0;
     this.userTodayPlanNum();
   },
   methods: {
+    setApprovalStatus(status) {
+      if (status == '1') {
+        return '通过';
+      } else if (status == '2') {
+        return '拒绝';
+      }
+    },
     pviewFn(val, imgVal) {
       var imgList = [];
       var photos = this.reportTarget.photos[val].photos;
@@ -175,13 +219,11 @@ export default {
       // });
     },
     onClickLeft() {
-      this.$router.replace({
-        path: '/VisitSummary',
-      });
+      this.$router.go(-1);
     },
     onSubmit() {
-      let collectionAnswerlisd = this.$refs.componVisitSummary.collectionAnswerlisd;
-      let collectionItemList = this.$refs.componVisitSummary.collectionItemList;
+      let collectionAnswerlisd = this.$refs.allowWriteAgainSummary.collectionAnswerlisd;
+      let collectionItemList = this.$refs.allowWriteAgainSummary.collectionItemList;
       for (var c = 0; c < collectionAnswerlisd.length; c++) {
         for (var b = 0; b < collectionItemList.length; b++) {
           if (collectionAnswerlisd[c].id == collectionItemList[b].customId) {
@@ -219,10 +261,48 @@ export default {
           this.$toast(err.msg);
         });
     },
+    submitApproval() {
+      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 zpDataList = collectionItemList.find((item) => item.answerType == 'zp');
+      if (zpDataList) {
+        let fileIdList = [];
+        zpDataList.fileInfoList.forEach((item) => {
+          fileIdList.push(item.id);
+        });
+        zpDataList.fileIdList = fileIdList;
+      }
+      insertCustomAnswer({
+        userSummaryId: this.info.userSummaryId, //	Long	用户总结id,如果为新增则不填,编辑则必填
+        summaryId: this.info.summaryId, //Long	主管任务id
+        customItemList: collectionItemList,
+      })
+        .then((res) => {
+          if (res.code == 200) {
+            this.$toast('操作成功!');
+            this.$router.replace({
+              path: '/VisitSummary',
+            });
+          } else {
+            this.$toast(res.msg);
+          }
+        })
+        .catch((err) => {
+          this.$toast(err.msg);
+        });
+    },
   },
 };
 </script>
-<style scoped>
+<style scoped lang="scss">
 .container {
   background-color: white;
 }
@@ -271,8 +351,32 @@ export default {
   font-weight: initial;
   font-size: 14px;
 }
+.bottomBtn {
+  position: fixed;
+  bottom: 0;
+  z-index: 10;
+  height: 50px;
+  width: 100%;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+  .van-button {
+    /* flex: 1; */
+    width: 40%;
+  }
+}
+.approvalRemarh {
+  width: 94%;
+  margin: 0px auto;
+  border-radius: 6px;
+  margin-bottom: 40px;
+  .approvalLabel {
+    font-size: 14px;
+    padding: 5px 0;
+  }
+}
 </style>
-<style>
+<style lang="scss">
 .table-headermd {
   font-size: 1.2rem;
   text-align: center;
@@ -350,4 +454,53 @@ export default {
 .z-cells .van-cell {
   padding-bottom: 0;
 }
+
+.VisitSummaryDetail {
+  .newCarList {
+    width: 94%;
+    padding: 14px;
+    margin: 0px auto;
+    border-radius: 8px;
+    overflow: hidden;
+    background: #fff;
+    margin-top: 10px;
+  }
+  .newCarList .van-cell {
+    border-radius: 6px;
+    overflow: hidden;
+  }
+  .newCarList .newlist .title {
+    /* line-height: 32px; */
+  }
+  .newCarList .van-cell__right-icon {
+    top: 5px;
+  }
+  .newCarList .newlist {
+    box-sizing: border-box;
+  }
+  .newCarList .newlist .title {
+    font-size: 14px;
+    font-weight: bold;
+    color: #333;
+    padding: 5px 0;
+    /* line-height: 14px; */
+  }
+  .newCarList .newlist .info {
+    font-size: 14px;
+    color: #999;
+    line-height: 26px;
+  }
+  .newCarList .newlist .title p {
+    padding: 0;
+    margin: 0;
+  }
+  .newCarList .newlist .title .textLeft {
+    display: inline-block;
+    /* padding-bottom: 10px; */
+  }
+  .newCarList .newlist .title .textRight {
+    float: right;
+    color: #0057ba;
+  }
+}
 </style>

+ 153 - 126
src/views/week/VisitSummaryMy.vue

@@ -1,84 +1,96 @@
 <template>
-  <div class="bgcolor">
+  <div class="bgcolor VisitSummaryMy">
     <!--        顶部条-->
     <van-nav-bar
-        class="navBar"
-        title="家装推广会历史提报查询"
-        left-arrow
-        @click-left="onClickLeft"
-    />
+      class="navBar"
+      title="家装推广会历史提报查询"
+      left-arrow
+      @click-left="onClickLeft" />
     <div class="container contentpd16">
       <van-row gutter="20">
         <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">
-      <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>
+            <div class="approvalStatusBtn" v-if="item.approvalStatus">
+              <van-button type="primary" size="small" v-if="item.approvalStatus == '2'"
+                >审批通过</van-button
+              >
+              <van-button type="info" size="small" v-if="item.approvalStatus == '1'"
+                >提交待审批</van-button
+              >
+              <van-button color="red" size="small" v-if="item.approvalStatus == '3'"
+                >拒绝待提交</van-button
+              >
             </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="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,
@@ -90,46 +102,45 @@ export default {
       endmaxDate: new Date(),
       strtcurrentDate: new Date(),
       endcurrentDate: new Date(),
-      list:[],
+      list: [],
       loading: false,
       finished: true,
-      formData:{
-        type:"1", // 汇报类型或入口 1-下属业务员日报 2-下属销售部主管周报 3-下属大区主管半月报
-        startTime:"", // 开始时间,必传  格式:yyyy-MM-dd  String类型
-        endTime:"", // 结束时间,必传  格式:yyyy-MM-dd  String类型
-        pageNum:1 , // 当前页码  int类型
-        pageSize:10, // 当前每页条数  int类型
+      formData: {
+        type: '1', // 汇报类型或入口 1-下属业务员日报 2-下属销售部主管周报 3-下属大区主管半月报
+        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.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.searchBtn()
+    this.userList = [];
+    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.searchBtn();
   },
   watch: {
-    $route(to, from) {
-    }
+    $route(to, from) {},
   },
   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(){
-      this.formData.pageNum=1
+    searchBtn() {
+      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,
@@ -138,19 +149,19 @@ export default {
         this.list = [];
         this.refreshing = false;
       }
-      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) {
+      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;
         }
-      })
+      });
     },
     getThreeDaysAgo() {
       let myDate = new Date();
@@ -159,14 +170,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]; //获取当前日期的月份
@@ -189,50 +196,50 @@ 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;
     },
     dailyFn(row) {
       this.$router.push({
-        path: "/VisitSummaryDetail",
-        query: {userSummaryId: row.userSummaryId,}
-      })
+        path: '/VisitSummaryDetail',
+        query: { userSummaryId: row.userSummaryId },
+      });
     },
     onClickLeft() {
-      this.$router.go(-1)
+      this.$router.go(-1);
     },
     StartTimeClick() {
       this.StartTimeShow = true;
@@ -241,26 +248,28 @@ export default {
       this.EndTimeShow = true;
     },
     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 {
@@ -277,7 +286,7 @@ export default {
 
 .cardContent .title p {
   padding: 0;
-  margin: 0
+  margin: 0;
 }
 
 .cardContent .title .textLeft {
@@ -321,27 +330,45 @@ 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>
+<style scoped lang="scss">
+.VisitSummaryMy {
+  .brud {
+    position: relative;
+  }
+  .approvalStatusBtn {
+    position: absolute;
+    bottom: 4px;
+    right: 1px;
+    .van-button {
+      border-radius: 5px;
+      width: 78px;
+    }
+  }
+}
+</style>

+ 852 - 0
src/views/week/allowWriteAgainSummary.vue

@@ -0,0 +1,852 @@
+<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.answerName }}</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, getDeptsByUser } 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: 'allowWriteAgainSummary',
+  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: '',
+      activaFlag: true,
+    };
+  },
+  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].answerName = 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 (this.collectionItemList[index].answerName) {
+        if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(this.collectionItemList[index].answerName)) {
+          this.collectionItemList[index].answerName = this.collectionItemList[
+            index
+          ].answerName.replace(
+            /\.\d{2,}$/,
+            this.collectionItemList[index].answerName.substr(
+              this.collectionItemList[index].answerName.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.collectionItemList[q].answerType == 'dq' ||
+        //     this.collectionItemList[q].answerType == 'xsb') &&
+        //   this.activaFlag
+        // ) {
+        //   this.activaFlag = false;
+        //   if (this.collectionItemList[q].answerType == 'xsb') {
+        //     this.getDeptsBy(this.collectionItemList[q].answerName);
+        //     this.getDeptInfo(
+        //       'dept',
+        //       this.collectionItemList[q].answerType,
+        //       this.collectionItemList[q].answerName
+        //     );
+        //   } else {
+        //     this.getDeptInfo(
+        //       'dept',
+        //       this.collectionItemList[q].answerType,
+        //       this.collectionItemList[q].answerName
+        //     );
+        //   }
+        // }
+        // 单选
+        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, answerName) {
+      this.deptForm.type = type;
+      if (grade == 'dq') {
+        this.deptForm.parentId = this.companyCode;
+      } else if (grade == 'xsb') {
+        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 (answerName) {
+              let findCompany = this.companyList.find((item) => item.deptName == answerName);
+              // this.onSalesRegionConfirm(findCompany);
+            } else {
+              this.onSalesRegionConfirm(this.regionList[0]);
+            }
+          }
+        } else if (grade == 'xsb') {
+          if (res.data.dept != null) {
+            this.deptList = res.data.dept;
+            if (answerName) {
+              let findCompany = this.regionList.find((item) => item.deptName == answerName);
+              // this.onSalesDepartmentConfirm(findCompany);
+            } else {
+              this.onSalesDepartmentConfirm(this.deptList[0]);
+            }
+          }
+        } else if (grade == 'gs') {
+          this.companyList = res.data.company;
+          if (answerName) {
+            let findCompany = this.companyList.find((item) => item.deptName == answerName);
+            // 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;
+          }
+        }
+      });
+    },
+    getDeptsBy(answerName) {
+      getDeptsByUser().then((res) => {
+        if (res.data && res.code == 200) {
+          let arr = [];
+          res.data.forEach((val) => {
+            arr.push({
+              ancestors: val.ancestors || '',
+              deptCode: val.deptCode || '',
+              deptId: val.deptId || '',
+              deptLevel: val.deptLevel || '',
+              deptName: val.deptName || '',
+              parentId: val.parentId || '',
+            });
+          });
+          this.deptList = arr;
+          if (answerName) {
+            let findCompany = this.regionList.find((item) => item.deptCode == answerName);
+            // this.onSalesDepartmentConfirm(findCompany);
+          } else {
+            this.onSalesDepartmentConfirm(this.deptList[0]);
+          }
+        }
+      });
+    },
+    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;
+      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');
+        }
+      }
+    },
+    onregionConfirm(val) {
+      this.RegionShow = false;
+      this.companyCode = val.deptId;
+      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 == 'xsb') {
+          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');
+        }
+      }
+    },
+    onSalesDepartmentConfirm(val) {
+      this.SalesDepartmentShow = false;
+      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>

+ 159 - 94
src/views/week/componVisitSummary.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="componVisitSummary">
-    <van-form ref="tabstoreVal">
+    <van-form ref="tabstoreVal" v-if="collectionItemList">
       <div v-for="(item, index) in collectionItemList" :key="index">
         <div v-if="item.answerType == 'sz'" class="formLabel z-cell">
           <van-cell>
@@ -8,12 +8,10 @@
               <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 }}
@@ -31,7 +29,6 @@
             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 }}
@@ -52,14 +49,12 @@
               :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>
@@ -70,7 +65,6 @@
             </template>
           </van-cell>
           <van-field
-            :disabled="!item.allowWriteAgain"
             v-model="item.answerValue"
             :formatter="formatter"
             :placeholder="item.customName"></van-field>
@@ -78,19 +72,56 @@
             {{ item.remark }}
           </p>
         </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
+          v-if="item.answerType == 'dq'"
+          class="formLabel z-cell"
+          @click="SalesRegionClick(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
-          class="formLabel z-cell z-cells z-celly"
-          v-if="item.answerType == 'gs' || item.answerType == 'dq' || item.answerType == 'xsb'">
+          v-if="item.answerType == 'xsb'"
+          class="formLabel z-cell"
+          @click="SalesDepartmentClick(index)">
           <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
-            >
+            <template #title>
+              <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
+            </template>
           </van-cell>
-          <p class="mg0">{{ item.answerValue }}</p>
+          <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 == 'duox'" class="formLabel z-cell">
           <van-cell>
@@ -99,7 +130,6 @@
             </template>
           </van-cell>
           <z-checkbox
-            :disabled="!item.allowWriteAgain"
             :answerType="item.answerType"
             :checkboxval="item.answerValue"
             :collectionType="item.customOptionList"
@@ -114,7 +144,6 @@
             </template>
           </van-cell>
           <z-radio
-            :disabled="!item.allowWriteAgain"
             :answerType="item.answerType"
             :collectionType="item.collectionType"
             :radio="item.answerValue"
@@ -180,7 +209,7 @@
 </template>
 
 <script>
-import { insertCustomAnswer, getSummaryMobileDeptInfo } from '@/api/index';
+import { insertCustomAnswer, getSummaryMobileDeptInfo, getDeptsByUser } from '@/api/index';
 import zRadio from '@/components/zRadio2';
 import zCheckbox from '@/components/zCheckbox2';
 import uploadImg from '@/components/uploadVTask';
@@ -196,6 +225,14 @@ export default {
         return [];
       },
     },
+    approvalStatus: {
+      type: String,
+      default: '',
+    },
+    source: {
+      type: String,
+      default: '',
+    },
   },
   data() {
     return {
@@ -250,6 +287,7 @@ export default {
       collectionAnswerlisd: [],
       flagclick: true,
       index: '',
+      activaFlag: true,
     };
   },
   created() {
@@ -290,7 +328,7 @@ export default {
     },
     onConfirm(date) {
       this.showCalendar = false;
-      this.collectionItemList[this.dateIndex].answerValue = this.formatDate(date);
+      this.collectionItemList[this.dateIndex].answerName = this.formatDate(date);
     },
     formatter(value) {
       return value.replace(
@@ -299,16 +337,18 @@ export default {
       );
     },
     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
-          )
-        );
+      if (this.collectionItemList[index].answerName) {
+        if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(this.collectionItemList[index].answerName)) {
+          this.collectionItemList[index].answerName = this.collectionItemList[
+            index
+          ].answerName.replace(
+            /\.\d{2,}$/,
+            this.collectionItemList[index].answerName.substr(
+              this.collectionItemList[index].answerName.indexOf('.'),
+              3
+            )
+          );
+        }
       }
     },
     zSelectVal(value) {
@@ -378,11 +418,29 @@ export default {
       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 == 'gs' ||
+            this.collectionItemList[q].answerType == 'dq' ||
+            this.collectionItemList[q].answerType == 'xsb') &&
+          this.activaFlag
+        ) {
+          this.activaFlag = false;
+          if (this.collectionItemList[q].answerType == 'xsb') {
+            this.getDeptsBy(this.collectionItemList[q].answerName);
+            this.getDeptInfo(
+              'dept',
+              this.collectionItemList[q].answerType,
+              this.collectionItemList[q].answerName
+            );
+          } else {
+            this.getDeptInfo(
+              'dept',
+              this.collectionItemList[q].answerType,
+              this.collectionItemList[q].answerName
+            );
+          }
+        }
         // 单选
         if (this.collectionItemList[q].answerType == 'dx') {
           let findCustom = this.collectionItemList[q].customOptionList.find((item) => item.checked);
@@ -479,11 +537,11 @@ export default {
       var days = (endData - stratDate) / (1000 * 60 * 60 * 24);
       return days;
     },
-    getDeptInfo(type, grade, answerValue) {
+    getDeptInfo(type, grade, answerName) {
       this.deptForm.type = type;
-      if (grade == '1') {
+      if (grade == 'dq') {
         this.deptForm.parentId = this.companyCode;
-      } else if (grade == '2') {
+      } else if (grade == 'xsb') {
         this.deptForm.parentId = this.regionCode;
       } else {
         this.deptForm.type = '';
@@ -493,9 +551,9 @@ export default {
         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);
+            if (answerName) {
+              let findCompany = this.companyList.find((item) => item.deptName == answerName);
+              // this.onSalesRegionConfirm(findCompany);
             } else {
               this.onSalesRegionConfirm(this.regionList[0]);
             }
@@ -503,18 +561,18 @@ export default {
         } 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);
+            if (answerName) {
+              let findCompany = this.regionList.find((item) => item.deptName == answerName);
+              // 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);
+          if (answerName) {
+            let findCompany = this.companyList.find((item) => item.deptName == answerName);
+            // this.onregionConfirm(findCompany);
           } else {
             this.onregionConfirm(this.companyList[0]);
           }
@@ -527,6 +585,30 @@ export default {
         }
       });
     },
+    getDeptsBy(answerName) {
+      getDeptsByUser().then((res) => {
+        if (res.data && res.code == 200) {
+          let arr = [];
+          res.data.forEach((val) => {
+            arr.push({
+              ancestors: val.ancestors || '',
+              deptCode: val.deptCode || '',
+              deptId: val.deptId || '',
+              deptLevel: val.deptLevel || '',
+              deptName: val.deptName || '',
+              parentId: val.parentId || '',
+            });
+          });
+          this.deptList = arr;
+          if (answerName) {
+            let findCompany = this.regionList.find((item) => item.deptCode == answerName);
+            // this.onSalesDepartmentConfirm(findCompany);
+          } else {
+            this.onSalesDepartmentConfirm(this.deptList[0]);
+          }
+        }
+      });
+    },
     dailyFn(row) {
       if (row.status != '0') {
         if (row.status == -1) {
@@ -580,64 +662,47 @@ export default {
     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);
-          }
+      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');
         }
       }
-      // 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);
-          }
+      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 == 'xsb') {
+          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');
         }
       }
     },
     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;
-          }
+      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;
         }
       }
     },

+ 39 - 0
src/views/week/index.vue

@@ -190,6 +190,31 @@
               <template #icon>
                 <van-icon :name="history" class="zicon" />
               </template>
+              <template #title>
+                <span>主管任务查询</span>
+                <span
+                  style="font-weight: 600; font-size: 16px; color: red; margin-left: 15px"
+                  v-if="summaryApprovalFeedbackNum"
+                  >({{ summaryApprovalFeedbackNum }})</span
+                >
+              </template>
+            </van-cell>
+            <van-cell
+              title="主管任务审批"
+              is-link
+              to="/SUPTaskApproval"
+              v-if="summaryApprovalButton">
+              <template #icon>
+                <van-icon :name="history" class="zicon" />
+              </template>
+              <template #title>
+                <span>主管任务审批</span>
+                <span
+                  style="font-weight: 600; font-size: 16px; color: red; margin-left: 15px"
+                  v-if="summaryPendingApprovalNum"
+                  >({{ summaryPendingApprovalNum }})</span
+                >
+              </template>
             </van-cell>
             <van-cell
               title="家装推广会历史提报查询"
@@ -199,6 +224,14 @@
               <template #icon>
                 <van-icon :name="history" class="zicon" />
               </template>
+              <template #title>
+                <span>家装推广会历史提报查询</span>
+                <span
+                  style="font-weight: 600; font-size: 16px; color: red; margin-left: 15px"
+                  v-if="summaryApprovalFeedbackNum"
+                  >({{ summaryApprovalFeedbackNum }})</span
+                >
+              </template>
             </van-cell>
           </div>
         </van-cell-group>
@@ -256,6 +289,9 @@ export default {
       notAllocationNum: 0, //待分配客资数量
       isAssignFlag: false,
       photoApprovalNum: 0,
+      summaryApprovalButton: false,
+      summaryPendingApprovalNum: 0,
+      summaryApprovalFeedbackNum: 0,
     };
   },
   watch: {
@@ -336,11 +372,14 @@ export default {
         this.reportTargetAll = res.data.reportTargetAll;
         this.jzTaskButton = res.data.jzTaskButton;
         this.summaryTaskButton = res.data.summaryTaskButton;
+        this.summaryApprovalButton = res.data.summaryApprovalButton;
         this.customerClueButton = res.data.customerClueButton;
         this.customerClueNum = res.data.customerClueNum;
         this.updataTime = res.data.reportTargetAll.updateTime;
         this.thisWeekRemarkNum = res.data.thisWeekRemarkNum; //查询本周点评的数量,null不需要展示
         this.photoApprovalNum = res.data.photoApprovalNum; //首页照片异常待反馈数量
+        this.summaryPendingApprovalNum = res.data.summaryPendingApprovalNum;
+        this.summaryApprovalFeedbackNum = res.data.summaryApprovalFeedbackNum;
         if (res.data.deptLevel === 0) {
           this.showDaily = false;
           this.showWeekly = false;