Просмотр исходного кода

Merge branch 'feature_20251015_主管任务门店扫码签到'

sunny 1 месяц назад
Родитель
Сommit
6b0a9a1624

+ 18 - 0
src/api/index.js

@@ -1080,6 +1080,24 @@ export function sendAndCheckVerCode(query) {
   });
 }
 
+// 获取签到记录
+export function getSummaryQrCheckList(query) {
+  return request({
+    url: '/mobile/summaryMobile/getSummaryQrCheckList',
+    method: 'get',
+    params: query,
+  });
+}
+
+// 打开扫码签到二维码
+export function getSummaryQrCodeUUID(query) {
+  return request({
+    url: '/mobile/summaryMobile/getSummaryQrCodeUUID',
+    method: 'get',
+    params: query,
+  });
+}
+
 // 电话确认接口
 export function confirmPhone(query) {
   return request({

+ 419 - 0
src/views/week/ActivityQRCode.vue

@@ -0,0 +1,419 @@
+<template>
+  <div class="ActivityQRCode">
+    <van-form
+      ref="tabstoreVal"
+      class="QRCodeActivity"
+      :readonly="
+        approvalStatus == '1' ||
+        approvalStatus == '2' ||
+        (approvalStatus == null && !!userSummaryId)
+      ">
+      <div class="activityItem">
+        <span class="van-f-red">*</span>
+        <van-field
+          v-model="activityForm.summaryEventName"
+          name="summaryEventName"
+          label="活动名称"
+          placeholder="请输入活动名称"
+          :rules="[{ required: true }]" />
+      </div>
+      <div class="activityItem">
+        <span class="van-f-red">*</span>
+        <van-field
+          readonly
+          clickable
+          name="summaryEventDate"
+          :value="activityForm.summaryEventDate"
+          label="活动日期"
+          placeholder="请选择活动日期"
+          @click="activityShowCalendarFun"
+          :rules="[{ required: true }]" />
+      </div>
+      <div class="activityItem">
+        <span class="van-f-red">*</span>
+        <van-field
+          readonly
+          clickable
+          name="qrStartTime"
+          :value="activityForm.qrStartTime"
+          label="生效开始日期"
+          placeholder="请选择开始日期"
+          @click="clickValidDateShow('start')"
+          :rules="[{ required: true }]" />
+      </div>
+      <div class="activityItem">
+        <span class="van-f-red">*</span>
+        <van-field
+          readonly
+          clickable
+          name="qrEndTime"
+          :value="activityForm.qrEndTime"
+          label="生效结束日期"
+          placeholder="请选择结束日期"
+          @click="clickValidDateShow('end')"
+          :rules="[{ required: true }]" />
+      </div>
+      <div class="activityItem">
+        <div class="van-cell QRCodeBtnBox">
+          <van-button style="width: 88px" class="QRCodeBtn" color="#0057ba" @click="openQRCode">
+            生成签到码
+          </van-button>
+          <div class="tips">
+            1、生成签到码后自动暂存任务;<br />2、请门店老板使用企微扫码签到
+            <!-- <div>1、点击【暂存】后签到码生效;</div>
+            <div>2、请门店老板使用企微扫码签到</div> -->
+          </div>
+        </div>
+      </div>
+      <div class="activityItem">
+        <div class="van-cell refreshBtnBox" style="padding: 5px 16px" @click="getQRChainList">
+          <div style="font-size: 16px; margin-right: 10px">
+            已签到成功门店:
+            <span style="margin-left: 5px; color: red">{{ QRChainList.length }}家 </span>
+          </div>
+          <div class="refresh">
+            <van-icon
+              style="font-weight: 600; margin-top: 1px"
+              name="replay"
+              size="20"
+              color="#1989fa" />
+          </div>
+        </div>
+      </div>
+      <div class="activityItem">
+        <div class="van-cell chainListBox">
+          <div class="jxsContent">
+            <div class="item" v-for="(val, index) in QRChainList">
+              <el-popover
+                placement="bottom"
+                trigger="click"
+                :content="val.storeName + '(' + val.storeCode + ')'">
+                <template slot="reference">
+                  <div class="selectItem">{{ val.storeName }} &nbsp; ({{ val.storeCode }})</div>
+                </template>
+              </el-popover>
+            </div>
+          </div>
+        </div>
+      </div>
+    </van-form>
+    <!-- 活动日期 -->
+    <van-calendar v-model="activityShowCalendar" @confirm="activityOnConfirm" />
+    <!-- 生效日期 -->
+    <van-popup v-model="validDateShow" capture position="bottom">
+      <van-datetime-picker
+        v-model="validDate"
+        :title="activate.title"
+        :min-date="activate.minDate"
+        :max-date="activate.maxDate"
+        type="datetime"
+        @cancel="validDateShow = false"
+        @confirm="onValidDateConfirm" />
+    </van-popup>
+    <!-- 二维码 -->
+    <div class="QRCodeBox" v-if="QRCodeBox">
+      <div class="centerBox">
+        <div class="title">{{ activityForm.summaryEventName }}</div>
+        <div class="activityDate">{{ activityForm.summaryEventDate }}</div>
+        <img class="QRCodeUrl" :src="this.QRCodeUrl" />
+        <div class="validTimeBox">
+          <div class="text">二维码有效期</div>
+          <div class="validTime">
+            <div>{{ activityForm.qrStartTime }}</div>
+            <div>~</div>
+            <div>{{ activityForm.qrEndTime }}</div>
+          </div>
+        </div>
+        <div class="close" @click="QRCodeBox = false">关闭</div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import { getSummaryQrCheckList, getSummaryQrCodeUUID } from '@/api/index';
+export default {
+  props: {
+    ActivityQRCodeData: {
+      type: Object,
+    },
+    qrUuid: {
+      type: String,
+    },
+    approvalStatus: {
+      type: String,
+    },
+    userSummaryId: {
+      type: [String, Number],
+    },
+  },
+  data() {
+    return {
+      // 活动数据
+      activityForm: {
+        summaryEventName: '',
+        summaryEventDate: '',
+        qrStartTime: '',
+        qrEndTime: '',
+      },
+      activityShowCalendar: false,
+      validDateShow: false,
+      QRCodeUrl: '',
+      QRCodeBox: false,
+      activate: {
+        type: '',
+        title: '',
+        minDate: new Date(),
+        maxDate: new Date(2035, 10, 1),
+      },
+      validDate: new Date(),
+      QRChainList: [],
+      qrUuids: null,
+    };
+  },
+  watch: {
+    ActivityQRCodeData: {
+      handler(val) {
+        if (val) this.activityForm = val;
+        if (this.qrUuid) {
+          this.qrUuids = this.qrUuid;
+          this.getQRChainList();
+        }
+        console.log(val);
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  methods: {
+    activityOnConfirm(date) {
+      this.activityForm.summaryEventDate = this.formatDate(date);
+      this.activityShowCalendar = false;
+    },
+    // 打开二维码
+    openQRCode(value) {
+      this.toastLoading(0, '加载中...', true);
+      // approvalStatus//1-待审批 2-审批通过 不支持修改,直接查看二维码
+      if (
+        this.approvalStatus == '1' ||
+        this.approvalStatus == '2' ||
+        this.approvalStatus == '3' ||
+        (this.approvalStatus == null && this.userSummaryId) ||
+        (this.qrUuid && this.userSummaryId)
+      ) {
+        getSummaryQrCodeUUID({ qrUuid: this.qrUuid, userSummaryId: this.userSummaryId }).then(
+          (res) => {
+            this.toastLoading().clear();
+            this.QRCodeUrl = res.data.base64Png;
+            this.QRCodeBox = true;
+          }
+        );
+      } else {
+        this.$refs.tabstoreVal
+          .validate()
+          .then(() => {
+            // 验证通过
+            this.$emit('onSubmit', (res) => {
+              this.toastLoading().clear();
+              this.QRCodeBox = true;
+              this.QRCodeUrl = res.data.base64Png;
+              this.qrUuids = res.data.qrUuid;
+            });
+          })
+          .catch((errors) => {
+            this.toastLoading().clear();
+            //验证失败
+            window.scrollTo(0, 0);
+          });
+      }
+    },
+    activityShowCalendarFun() {
+      if (
+        this.approvalStatus == '1' ||
+        this.approvalStatus == '2' ||
+        (this.approvalStatus == null && this.userSummaryId)
+      )
+        return;
+      this.activityShowCalendar = true;
+    },
+    clickValidDateShow(type) {
+      if (
+        this.approvalStatus == '1' ||
+        this.approvalStatus == '2' ||
+        (this.approvalStatus == null && this.userSummaryId)
+      )
+        return;
+      if (type == 'start') {
+        this.activate = {
+          type: type,
+          title: '请选择开始日期',
+          minDate: new Date(),
+          maxDate: new Date(2035, 9, 1),
+        };
+        this.validDate = new Date();
+      } else {
+        this.activate = {
+          type: type,
+          title: '请选择结束日期',
+          minDate: this.activityForm.qrStartTime
+            ? new Date(this.activityForm.qrStartTime)
+            : new Date(),
+          maxDate: new Date(2035, 9, 1),
+        };
+        this.validDate = this.activityForm.qrEndTime
+          ? new Date(this.activityForm.qrEndTime)
+          : new Date();
+      }
+      this.validDateShow = true;
+    },
+    onValidDateConfirm(date) {
+      let time = this.parseTime(new Date(date), '{y}-{m}-{d} {h}:{i}:{s}') + '';
+      if (this.activate.type == 'start') {
+        this.activityForm.qrStartTime = time;
+        if (
+          new Date(this.activityForm.qrStartTime).getTime() >
+          new Date(this.activityForm.qrEndTime).getTime()
+        ) {
+          this.activityForm.qrEndTime = null;
+        }
+      } else {
+        this.activityForm.qrEndTime = time;
+      }
+      this.validDateShow = false;
+    },
+    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}`;
+    },
+    getQRChainList() {
+      if (!this.qrUuids) return;
+      this.QRChainList = [];
+      this.toastLoading(0, '加载中...', true);
+      getSummaryQrCheckList({ qrUuid: this.qrUuids }).then((res) => {
+        this.toastLoading().clear();
+        if (res.code == 200) {
+          this.QRChainList = res.data || [];
+        } else {
+          this.QRChainList = [];
+        }
+      });
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.ActivityQRCode {
+  .QRCodeActivity {
+    background-color: white;
+    margin-bottom: 10px;
+    .activityItem {
+      display: flex;
+      .van-f-red {
+        position: relative;
+        left: 16px;
+        top: 10px;
+        z-index: 1;
+      }
+      .QRCodeBtnBox {
+        justify-content: space-between;
+        align-items: end;
+        .QRCodeBtn {
+          width: auto;
+          border-radius: 10px;
+        }
+        .tips {
+          flex: 1;
+          font-size: 14px;
+          line-height: 15px;
+          text-align: right;
+          color: red;
+        }
+        .van-button--normal {
+          padding: 0 8px;
+        }
+      }
+      .jxsContent {
+        margin-bottom: 10px;
+        .item {
+          padding: 5px;
+          background: #e9e9e9;
+          margin: 5px 0;
+          .el-popover__reference-wrapper {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+          }
+          .selectItem {
+            flex: 1;
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            font-size: 14px;
+          }
+        }
+      }
+    }
+  }
+  .QRCodeBox {
+    position: fixed;
+    width: 100%;
+    height: 100%;
+    z-index: 9999999999;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    .centerBox {
+      width: 90%;
+      // height: 100%;
+      background: rgba(255, 255, 255, 0.1);
+      backdrop-filter: blur(10px);
+      border-radius: 20px;
+      padding: 10px 20px;
+      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
+      text-align: center;
+      color: #fff;
+      font-size: 18px;
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      .title {
+        font-size: 24px;
+        font-weight: 600;
+        margin-bottom: 10px;
+      }
+      .activityDate {
+        // font-size: 20px;
+        margin: 10px 0;
+      }
+      .QRCodeUrl {
+        // width: 100%;
+        margin: 10px 0;
+      }
+      .validTimeBox {
+        margin-top: 10px;
+        .validTime {
+          margin: 10px 0;
+          font-size: 12px;
+        }
+      }
+      .close {
+        width: 40%;
+        padding: 10px 15px;
+        background: rgba(255, 255, 255, 0.2);
+        border-radius: 12px;
+      }
+    }
+  }
+}
+</style>

+ 30 - 6
src/views/week/SUPTaskApproval/SUPTaskApprovalDetail.vue

@@ -40,13 +40,20 @@
       </div>
     </div>
     <div class="lineGrey"></div>
-    <div
-      class="container linep"
-      style="background-color: #fff; width: 94%; margin: 0px auto; border-radius: 6px">
+    <div class="container linep" style="width: 94%; margin: 0px auto; border-radius: 6px">
       <detailItem
         :collectionItemLists="collectionItemLists"
         :approvalStatus="info.approvalStatus"
-        ref="detailItem"></detailItem>
+        ref="detailItem">
+        <!-- 活动扫码 -->
+        <ActivityQRCode
+          v-if="info.qrCodeCheck == '1'"
+          ref="ActivityQRCode"
+          :ActivityQRCodeData="ActivityQRCodeData"
+          :approvalStatus="info.approvalStatus"
+          :userSummaryId="info.userSummaryId"
+          :qrUuid="qrUuid"></ActivityQRCode>
+      </detailItem>
     </div>
     <div
       class="newCarList"
@@ -94,9 +101,10 @@ import deleteUploadImg from '@/components/deleteUploadImg';
 import detailItem from './detailItem';
 import { writeAgainCustomAnswer } from '@/api/week';
 import { changeApproval, getApprovalDetail } from '@/api/SUPTaskApproval.js';
+import ActivityQRCode from '../ActivityQRCode';
 export default {
   name: 'SUPTaskApprovalDetail',
-  components: { deleteUploadImg, detailItem },
+  components: { deleteUploadImg, detailItem, ActivityQRCode },
   data() {
     return {
       info: null,
@@ -125,10 +133,13 @@ export default {
       writeAgain: false,
       approvalMessage: '',
       tabVal: '1',
+      ActivityQRCodeData: {},
+      qrUuid: null,
       //
     };
   },
   activated() {
+    this.ActivityQRCodeData = {};
     this.powerGrade = localStorage.getItem('powerGrade');
     this.tabVal = this.$route.query.tabVal;
     this.getDetailById();
@@ -168,6 +179,13 @@ export default {
         summaryApprovalId: this.$route.query.summaryApprovalId,
       }).then((res) => {
         loading1.clear();
+        this.ActivityQRCodeData = {
+          summaryEventName: res.data.summaryEventName || '',
+          summaryEventDate: res.data.summaryEventDate || '',
+          qrStartTime: res.data.qrStartTime || '',
+          qrEndTime: res.data.qrEndTime || '',
+        };
+        this.qrUuid = res.data.qrUuid;
         this.reportTargetAll = res.data.reportTargetAll;
         this.info = res.data;
         this.type = res.data.userType;
@@ -294,7 +312,7 @@ export default {
 </script>
 <style scoped lang="scss">
 .container {
-  background-color: white;
+  // background-color: white;
 }
 
 .van-f-red {
@@ -493,5 +511,11 @@ export default {
     float: right;
     color: #0057ba;
   }
+
+  .linep .van-cell__title {
+    color: #646566;
+    font-weight: 500;
+    font-size: 14px;
+  }
 }
 </style>

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

@@ -1,5 +1,6 @@
 <template>
   <div class="componVisitSummary detailItem">
+    <slot></slot>
     <van-form ref="tabstoreVal">
       <div v-for="(item, index) in collectionItemList" :key="index">
         <div v-if="item.answerType == 'sz'" class="formLabel z-cell">
@@ -788,6 +789,9 @@ export default {
   .z-cell .van-cell__title {
     font-size: 16px;
   }
+  .van-form {
+    background-color: white;
+  }
 }
 </style>
 <style lang="scss">

+ 83 - 31
src/views/week/VisitSummaryAdd.vue

@@ -1,12 +1,8 @@
 <template>
   <div class="bgcolor VisitSummaryAdd">
-    <!--        顶部条-->
-
-    <!--        顶部条-->
     <div class="navBarTOP">
       <van-nav-bar class="navBar" left-arrow :title="title" @click-left="onClickLeft" />
     </div>
-    <!--        主体内容-->
     <div class="lineGrey"></div>
     <div class="lineGrey"></div>
     <div class="lineGrey"></div>
@@ -14,6 +10,11 @@
     <div class="lineGrey"></div>
     <div class="lineGrey" style="height: 6px"></div>
     <div class="container" style="width: 94%; margin: 0px auto; border-radius: 6px">
+      <!-- 活动扫码 -->
+      <ActivityQRCode
+        v-if="$route.query.qrCodeCheck == '1'"
+        @onSubmit="onStorage"
+        ref="ActivityQRCode"></ActivityQRCode>
       <van-form ref="tabstoreVal">
         <div v-for="(item, index) in collectionItemList" :key="index">
           <div v-if="item.answerType == 'sz'" class="formLabel z-cell">
@@ -215,7 +216,9 @@
     </div>
     <br />
     <div class="tc" style="padding: 0 16px">
-      <van-button class="submitBtn" block type="primary" @click="onStorage"> 暂存 </van-button>
+      <van-button class="submitBtn" block type="primary" @click="onStorage(null)">
+        暂存
+      </van-button>
       <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">
         提交汇报
       </van-button>
@@ -317,10 +320,10 @@ import zCheckbox from '@/components/zCheckbox2';
 // import uploadImg from "@/components/uo";
 import uploadImg from '@/components/uploadVTask';
 import deleteUploadImg from '@/components/deleteUploadImg2';
-
+import ActivityQRCode from './ActivityQRCode';
 export default {
   name: 'MyHistoricalWeekly',
-  components: { zRadio, zCheckbox, uploadImg, deleteUploadImg },
+  components: { zRadio, zCheckbox, uploadImg, deleteUploadImg, ActivityQRCode },
   data() {
     return {
       timeico: timeico,
@@ -382,8 +385,14 @@ export default {
       chainName: '',
       chainCode: '',
       jxsList: [],
+      userSummaryId: null,
+      qrUuid: null,
     };
   },
+  activated() {
+    this.userSummaryId = null;
+    this.qrUuid = null;
+  },
   created() {
     this.activaFlag = true;
     // this.formData.startTime = this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'),2)
@@ -486,7 +495,57 @@ export default {
       return val.slice(0, 4) + '-' + val.slice(4, 6) + '-' + val.slice(6, 8);
     },
     onLoad() {},
+    // 暂存 不校验答案是否必填
+    onStorage(callback) {
+      let ActivityQRCodeData = this.$refs.ActivityQRCode.activityForm || {};
+      this.setParams(() => {
+        temporarilyCustomAnswer({
+          userSummaryId: this.userSummaryId, //	Long	用户总结id,如果为新增则不填,编辑则必填
+          summaryId: this.$route.query.summaryId, //Long	主管任务id
+          customItemList: this.collectionItemList, //List<Object>	答案列表
+          ...ActivityQRCodeData, //任务名称、活动日期、签到时间
+          getQrCode: callback ? true : false, //是否需要反馈二维码(是:任务名称、活动日期、签到时间必填)
+          qrUuid: this.qrUuid || null,
+        })
+          .then((res) => {
+            if (res.code == 200) {
+              if (callback) {
+                this.userSummaryId = res.data.userSummaryId ? res.data.userSummaryId : null;
+                this.qrUuid = res.data.qrUuid ? res.data.qrUuid : null;
+                // 回传二维码
+                callback(res);
+              } else {
+                this.$router.go(-1);
+              }
+            } else {
+              this.$toast(res.msg);
+            }
+          })
+          .catch((err) => {
+            this.$toast(err.msg);
+          });
+      });
+    },
     onSubmit() {
+      if (this.$route.query.qrCodeCheck == '1') {
+        // 执行 ActivityQRCode from表单验证触发
+        this.$refs.ActivityQRCode.$refs.tabstoreVal
+          .validate()
+          .then(() => {
+            // 验证通过
+            let ActivityQRCodeData = this.$refs.ActivityQRCode.activityForm || {};
+            this.onSubmitFun(ActivityQRCodeData);
+          })
+          .catch((errors) => {
+            //验证失败
+            window.scrollTo(0, 0);
+            return;
+          });
+      } else {
+        this.onSubmitFun();
+      }
+    },
+    onSubmitFun(ActivityQRCodeData = {}) {
       this.setParams(() => {
         if (this.flagclick) {
           this.flagclick = false;
@@ -495,9 +554,11 @@ export default {
             this.flagclick = true;
           }, 2000);
           insertCustomAnswer({
-            userSummaryId: '', //	Long	用户总结id,如果为新增则不填,编辑则必填
+            userSummaryId: this.userSummaryId, //	Long	用户总结id,如果为新增则不填,编辑则必填
             summaryId: this.$route.query.summaryId, //Long	主管任务id
             customItemList: this.collectionItemList, //List<Object>	答案列表
+            ...ActivityQRCodeData,
+            qrUuid: this.qrUuid || null,
           })
             .then((res) => {
               if (res.code == 200) {
@@ -959,32 +1020,12 @@ export default {
         }
       }
     },
-    // 暂存 不校验答案是否必填
-    onStorage() {
-      this.setParams(() => {
-        temporarilyCustomAnswer({
-          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);
-            } else {
-              this.$toast(res.msg);
-            }
-          })
-          .catch((err) => {
-            this.$toast(err.msg);
-          });
-      });
-    },
   },
 };
 </script>
 <style scoped lang="scss">
 .container {
-  background-color: white;
+  // background-color: white;
 }
 
 .van-f-red {
@@ -1046,6 +1087,9 @@ export default {
       border-radius: 20px;
     }
   }
+  .van-form {
+    background-color: white;
+  }
 }
 </style>
 <style lang="scss">
@@ -1146,6 +1190,11 @@ export default {
   margin-top: -10px;
 }
 .jxsBox {
+  .tips {
+    text-align: right;
+  }
+}
+.VisitSummaryAdd {
   .jxsContent {
     margin-bottom: 10px;
     .item {
@@ -1166,8 +1215,11 @@ export default {
       }
     }
   }
-  .tips {
-    text-align: right;
+
+  .linep .van-cell__title {
+    color: #646566;
+    font-weight: 500;
+    font-size: 14px;
   }
 }
 </style>

+ 61 - 7
src/views/week/VisitSummaryDetail.vue

@@ -40,22 +40,38 @@
       </div>
     </div>
     <div class="lineGrey"></div>
-    <div
-      class="container linep"
-      style="background-color: #fff; width: 94%; margin: 0px auto; border-radius: 6px">
+    <div class="container linep" style="width: 94%; margin: 0px auto; border-radius: 6px">
       <!-- 退回待提交 summaryUpdate:Boolean类型,true-允许编辑,false-不允许编辑 -->
       <template v-if="info.approvalStatus == '3' && info.summaryUpdate">
         <componVisitSummary
           :collectionItemLists="collectionItemLists"
           :approvalStatus="info.approvalStatus"
-          ref="componVisitSummary"></componVisitSummary>
+          ref="componVisitSummary">
+          <!-- 活动扫码 -->
+          <ActivityQRCode
+            v-if="info.qrCodeCheck == '1'"
+            ref="ActivityQRCode"
+            :ActivityQRCodeData="ActivityQRCodeData"
+            :approvalStatus="info.approvalStatus"
+            :userSummaryId="$route.query.userSummaryId"
+            :qrUuid="qrUuid"></ActivityQRCode>
+        </componVisitSummary>
       </template>
       <!-- 补填、详情 -->
       <template v-else>
         <allowWriteAgainSummary
           :collectionItemLists="collectionItemLists"
           :approvalStatus="info.approvalStatus"
-          ref="allowWriteAgainSummary"></allowWriteAgainSummary>
+          ref="allowWriteAgainSummary">
+          <!-- 活动扫码 -->
+          <ActivityQRCode
+            v-if="info.qrCodeCheck == '1'"
+            ref="ActivityQRCode"
+            :ActivityQRCodeData="ActivityQRCodeData"
+            :approvalStatus="info.approvalStatus"
+            :userSummaryId="$route.query.userSummaryId"
+            :qrUuid="qrUuid"></ActivityQRCode>
+        </allowWriteAgainSummary>
       </template>
     </div>
     <div
@@ -104,9 +120,10 @@ import componVisitSummary from '@/views/week/componVisitSummary';
 import allowWriteAgainSummary from '@/views/week/allowWriteAgainSummary';
 import { writeAgainCustomAnswer } from '@/api/week';
 import { changeApproval } from '@/api/SUPTaskApproval.js';
+import ActivityQRCode from './ActivityQRCode';
 export default {
   name: 'daily',
-  components: { deleteUploadImg, componVisitSummary, allowWriteAgainSummary },
+  components: { deleteUploadImg, componVisitSummary, allowWriteAgainSummary, ActivityQRCode },
   data() {
     return {
       info: null,
@@ -135,10 +152,13 @@ export default {
       writeAgain: false,
       approvalMessage: '',
       source: '',
+      ActivityQRCodeData: {},
+      qrUuid: null,
       //
     };
   },
   activated() {
+    this.ActivityQRCodeData = {};
     this.source = this.$route.query.source || '';
     this.powerGrade = localStorage.getItem('powerGrade');
     this.getDetailById();
@@ -175,6 +195,13 @@ export default {
       });
       getSummaryMobilo({ userSummaryId: this.$route.query.userSummaryId }).then((res) => {
         loading1.clear();
+        this.ActivityQRCodeData = {
+          summaryEventName: res.data.summaryEventName || '',
+          summaryEventDate: res.data.summaryEventDate || '',
+          qrStartTime: res.data.qrStartTime || '',
+          qrEndTime: res.data.qrEndTime || '',
+        };
+        this.qrUuid = res.data.qrUuid;
         this.reportTargetAll = res.data.reportTargetAll;
         this.info = res.data;
         this.type = res.data.userType;
@@ -265,6 +292,25 @@ export default {
         });
     },
     submitApproval() {
+      if (this.info.qrCodeCheck == '1') {
+        // 执行 ActivityQRCode from表单验证触发
+        this.$refs.ActivityQRCode.$refs.tabstoreVal
+          .validate()
+          .then(() => {
+            // 验证通过
+            let ActivityQRCodeData = this.$refs.ActivityQRCode.activityForm || {};
+            this.submitApprovalFun(ActivityQRCodeData);
+          })
+          .catch((errors) => {
+            //验证失败
+            window.scrollTo(0, 0);
+            return;
+          });
+      } else {
+        this.submitApprovalFun();
+      }
+    },
+    submitApprovalFun(ActivityQRCodeData = {}) {
       let collectionAnswerlisd = this.$refs.componVisitSummary.collectionAnswerlisd;
       let collectionItemList = this.$refs.componVisitSummary.collectionItemList;
       for (var c = 0; c < collectionAnswerlisd.length; c++) {
@@ -287,6 +333,8 @@ export default {
         userSummaryId: this.info.userSummaryId, //	Long	用户总结id,如果为新增则不填,编辑则必填
         summaryId: this.info.summaryId, //Long	主管任务id
         customItemList: collectionItemList,
+        ...ActivityQRCodeData,
+        qrUuid: this.qrUuid,
       })
         .then((res) => {
           if (res.code == 200) {
@@ -307,7 +355,7 @@ export default {
 </script>
 <style scoped lang="scss">
 .container {
-  background-color: white;
+  // background-color: white;
 }
 
 .van-f-red {
@@ -505,5 +553,11 @@ export default {
     float: right;
     color: #0057ba;
   }
+
+  .linep .van-cell__title {
+    color: #646566;
+    font-weight: 500;
+    font-size: 14px;
+  }
 }
 </style>

+ 66 - 12
src/views/week/VisitSummaryStorageDetail.vue

@@ -41,18 +41,26 @@
       </div>
     </div>
     <div class="lineGrey"></div>
-    <div
-      class="container linep"
-      style="background-color: #fff; width: 94%; margin: 0px auto; border-radius: 6px">
+    <div class="container linep" style="width: 94%; margin: 0px auto; border-radius: 6px">
       <!-- 编辑 -->
       <componVisitSummary
         :collectionItemLists="collectionItemLists"
         :approvalStatus="info.approvalStatus"
-        ref="componVisitSummary"></componVisitSummary>
+        ref="componVisitSummary">
+        <!-- 活动扫码 -->
+        <ActivityQRCode
+          v-if="info.qrCodeCheck == '1'"
+          @onSubmit="onStorage"
+          ref="ActivityQRCode"
+          :ActivityQRCodeData="ActivityQRCodeData"
+          :qrUuid="qrUuid"></ActivityQRCode>
+      </componVisitSummary>
     </div>
     <br />
     <div class="tc" style="padding: 0 16px">
-      <van-button class="submitBtn" block type="primary" @click="onStorage"> 暂存 </van-button>
+      <van-button class="submitBtn" block type="primary" @click="onStorage(null)">
+        暂存
+      </van-button>
       <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">
         提交汇报
       </van-button>
@@ -77,9 +85,10 @@ import {
 import { ImagePreview } from 'vant';
 import deleteUploadImg from '@/components/deleteUploadImg';
 import componVisitSummary from '@/views/week/componVisitSummary';
+import ActivityQRCode from './ActivityQRCode';
 export default {
   name: 'daily',
-  components: { deleteUploadImg, componVisitSummary },
+  components: { deleteUploadImg, componVisitSummary, ActivityQRCode },
   data() {
     return {
       info: null,
@@ -108,10 +117,12 @@ export default {
       writeAgain: false,
       approvalMessage: '',
       source: '',
-      //
+      ActivityQRCodeData: {},
+      qrUuid: null,
     };
   },
   activated() {
+    this.ActivityQRCodeData = {};
     this.source = this.$route.query.source || '';
     this.powerGrade = localStorage.getItem('powerGrade');
     this.getDetailById();
@@ -148,6 +159,13 @@ export default {
       });
       getSummaryMobilo({ userSummaryId: this.$route.query.userSummaryId }).then((res) => {
         loading1.clear();
+        this.ActivityQRCodeData = {
+          summaryEventName: res.data.summaryEventName || '',
+          summaryEventDate: res.data.summaryEventDate || '',
+          qrStartTime: res.data.qrStartTime || '',
+          qrEndTime: res.data.qrEndTime || '',
+        };
+        this.qrUuid = res.data.qrUuid;
         this.reportTargetAll = res.data.reportTargetAll;
         this.info = res.data;
         this.type = res.data.userType;
@@ -198,19 +216,28 @@ export default {
       this.$router.go(-1);
     },
     // 暂存 不校验答案是否必填
-    onStorage() {
+    onStorage(callback) {
+      let ActivityQRCodeData = this.$refs.ActivityQRCode.activityForm || {};
       this.setParams((collectionItemList) => {
         temporarilyCustomAnswer({
           userSummaryId: this.info.userSummaryId,
           summaryId: this.info.summaryId, //Long	主管任务id
           customItemList: collectionItemList, //List<Object>	答案列表
+          ...ActivityQRCodeData, //任务名称、活动日期、签到时间
+          getQrCode: callback ? true : false, //是否需要反馈二维码(是:任务名称、活动日期、签到时间必填)
+          qrUuid: this.qrUuid || null,
         })
           .then((res) => {
             if (res.code == 200) {
               this.$toast('操作成功!');
-              this.$router.replace({
-                path: this.source,
-              });
+              if (callback) {
+                // 回传二维码
+                callback(res);
+              } else {
+                this.$router.replace({
+                  path: this.source,
+                });
+              }
             } else {
               this.$toast(res.msg);
             }
@@ -221,11 +248,32 @@ export default {
       });
     },
     onSubmit() {
+      if (this.info.qrCodeCheck == '1') {
+        // 执行 ActivityQRCode from表单验证触发
+        this.$refs.ActivityQRCode.$refs.tabstoreVal
+          .validate()
+          .then(() => {
+            // 验证通过
+            let ActivityQRCodeData = this.$refs.ActivityQRCode.activityForm || {};
+            this.onSubmitFun(ActivityQRCodeData);
+          })
+          .catch((errors) => {
+            //验证失败
+            window.scrollTo(0, 0);
+            return;
+          });
+      } else {
+        this.onSubmitFun();
+      }
+    },
+    onSubmitFun(ActivityQRCodeData = {}) {
       this.setParams((collectionItemList) => {
         insertCustomAnswer({
           userSummaryId: this.info.userSummaryId, //	Long	用户总结id,如果为新增则不填,编辑则必填
           summaryId: this.info.summaryId, //Long	主管任务id
           customItemList: collectionItemList,
+          ...ActivityQRCodeData,
+          qrUuid: this.qrUuid,
         })
           .then((res) => {
             if (res.code == 200) {
@@ -294,7 +342,7 @@ export default {
 </script>
 <style scoped lang="scss">
 .container {
-  background-color: white;
+  // background-color: white;
 }
 
 .van-f-red {
@@ -454,5 +502,11 @@ export default {
       border-radius: 20px;
     }
   }
+
+  .linep .van-cell__title {
+    color: #646566;
+    font-weight: 500;
+    font-size: 14px;
+  }
 }
 </style>

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

@@ -1,5 +1,6 @@
 <template>
   <div class="componVisitSummary">
+    <slot></slot>
     <van-form ref="tabstoreVal">
       <div v-for="(item, index) in collectionItemList" :key="index">
         <div v-if="item.answerType == 'sz'" class="formLabel z-cell">
@@ -891,6 +892,9 @@ export default {
   .z-cell .van-cell__title {
     font-size: 16px;
   }
+  .van-form {
+    background-color: white;
+  }
 }
 </style>
 <style lang="scss">

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

@@ -1,5 +1,6 @@
 <template>
   <div class="componVisitSummary">
+    <slot></slot>
     <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">
@@ -905,6 +906,9 @@ export default {
   .z-cell .van-cell__title {
     font-size: 16px;
   }
+  .van-form {
+    background-color: white;
+  }
 }
 </style>
 <style lang="scss">

+ 6 - 1
src/views/week/index.vue

@@ -187,7 +187,12 @@
               v-for="(item, index) in list"
               :key="index"
               :to="
-                '/VisitSummaryAdd?summaryId=' + item.summaryId + '&title=' + item.summaryTaskName
+                '/VisitSummaryAdd?summaryId=' +
+                item.summaryId +
+                '&title=' +
+                item.summaryTaskName +
+                '&qrCodeCheck=' +
+                item.qrCodeCheck
               ">
               <template #title>
                 <span class="custom-title">{{ item.summaryTaskName }}</span>