Преглед изворни кода

feature_20260316_日报分享内容自定义配置

zhujindu пре 1 месец
родитељ
комит
240bdffee7
3 измењених фајлова са 91 додато и 44 уклоњено
  1. 7 2
      src/components/share.vue
  2. 1 1
      src/components/shareReportCustom.vue
  3. 83 41
      src/views/week/dailyDetails.vue

+ 7 - 2
src/components/share.vue

@@ -56,12 +56,12 @@
           </div>
         </div>
         <!-- 旧的日报内容 -->
-        <!-- <template v-if="checkedPlan && reportContents">
+        <template v-if="checkedPlan && reportContents && isHistory == '1'">
           <template v-for="value in reportContents">
             <div :class="['text']">{{ value.dictValue }}</div>
             <div class="content">{{ value.content }}</div>
           </template>
-        </template> -->
+        </template>
         <!-- 日报指标 -->
         <template v-if="isTarget">
           <shareAtarget :reportInfo="reportTarget"></shareAtarget>
@@ -187,6 +187,11 @@ export default {
       type: Boolean,
       default: true,
     },
+    // 是否为历史汇报:0-新汇报 1-历史汇报
+    isHistory: {
+      type: String,
+      default: '0',
+    },
   },
   data() {
     return {

+ 1 - 1
src/components/shareReportCustom.vue

@@ -5,7 +5,7 @@
         <div
           v-for="(item, index) in value.sfaReportCustomCollections"
           :key="item.reportCustomCollectionId">
-          <template v-if="item.isShare">
+          <template v-if="item.isShare == '1'">
             <template
               v-if="
                 item.reportCustomCollectionType == 'sz' || item.reportCustomCollectionType == 'wb'

+ 83 - 41
src/views/week/dailyDetails.vue

@@ -174,7 +174,8 @@
       :reportContents="reportContents"
       :checkedPlan="checkedPlan"
       :isTarget="isTarget"
-      :isReportCustom="isReportCustom"></share>
+      :isReportCustom="isReportCustom"
+      :isHistory="reportTarget.isHistory"></share>
     <!--分享图片列表 -->
     <el-dialog
       title="选择分享的内容"
@@ -184,13 +185,15 @@
       :close-on-click-modal="false"
       @close="wuliaoTableClose"
       custom-class="shareImgFlag">
-      <div v-if="reportTarget.photoSummary">
+      <div>
         <!-- <p style="margin-bottom: 10px; margin-top: 0; display: flex">
           今日总结&明日规划的文本内容<van-checkbox
             v-model="checkedPlan"
             style="margin-left: 10px"></van-checkbox>
         </p> -->
-        <p style="margin-bottom: 10px; margin-top: 0; display: flex">
+        <p
+          style="margin-bottom: 10px; margin-top: 0; display: flex"
+          v-if="reportTarget.isHistory == '0'">
           日报指标<van-checkbox v-model="isTarget" style="margin-left: 10px"></van-checkbox>
         </p>
         <p
@@ -200,30 +203,32 @@
             v-model="isReportCustom"
             style="margin-left: 10px"></van-checkbox>
         </p>
-        <p style="margin-top: 0">请点击勾选想要分享的今日拜访照片</p>
-        <div class="shareVisitImg">
-          <template v-for="(itemImg, indexImg) in reportTarget.photoSummary">
-            <div>
-              <img :src="itemImg.fileUrl" alt="" @click="selectImg(itemImg)" />
-              <van-icon
-                @click.stop
-                name="success"
-                class="activaImg"
-                color="#fff"
-                size="15"
-                style="
-                  position: absolute;
-                  right: 0;
-                  bottom: 0;
-                  /* margin: -15px 0 0 -15px; */
-                  pointer-events: none;
-                  background: #2b73cf;
-                  border: 2px solid #fff;
-                "
-                v-if="itemImg.checked" />
-            </div>
-          </template>
-        </div>
+        <template v-if="reportTarget.photoSummary">
+          <p style="margin-top: 0">请点击勾选想要分享的今日拜访照片</p>
+          <div class="shareVisitImg">
+            <template v-for="(itemImg, indexImg) in reportTarget.photoSummary">
+              <div>
+                <img :src="itemImg.fileUrl" alt="" @click="selectImg(itemImg)" />
+                <van-icon
+                  @click.stop
+                  name="success"
+                  class="activaImg"
+                  color="#fff"
+                  size="15"
+                  style="
+                    position: absolute;
+                    right: 0;
+                    bottom: 0;
+                    /* margin: -15px 0 0 -15px; */
+                    pointer-events: none;
+                    background: #2b73cf;
+                    border: 2px solid #fff;
+                  "
+                  v-if="itemImg.checked" />
+              </div>
+            </template>
+          </div>
+        </template>
       </div>
       <span slot="footer" class="footer-btn">
         <van-button plain type="primary" @click="shareImgFlag = false">取 消</van-button>
@@ -391,29 +396,66 @@ export default {
       });
       this.urlList = [];
       this.reportRemarksIndex = index;
+      // <!-- isHistory 是否为历史汇报:0-新汇报 1-历史汇报 -->
+      if (this.reportTarget.isHistory == '0') {
+        this.setPhotoSummary();
+        this.shareImgFlag = true;
+      } else {
+        this.setPhotoSummary();
+        // 没有图片直接打开分享
+        if (this.reportTarget.photoSummary && this.reportTarget.photoSummary.length) {
+          // 选择分享的图片
+          this.setShareFlag = true;
+        }
+      }
+    },
+    setPhotoSummary() {
       if (this.reportTarget.photoSummary && this.reportTarget.photoSummary.length) {
         // 重置分享图片状态
         this.reportTarget.photoSummary.forEach((item) => {
-          // item.photos.forEach((val) => {
           this.$set(item, 'checked', false);
-          // });
         });
-        // 选择分享的图片
-        this.shareImgFlag = true;
-      } else {
-        this.setShareFlag = true;
       }
     },
     // 确认分享
     confirmShare() {
-      this.reportTarget.photoSummary.forEach((item) => {
-        // item.photos.forEach((val) => {
-        if (item.checked) this.urlList.push(item.fileUrl);
-        // });
-      });
-      if (this.urlList.length == 0 && !this.checkedPlan) {
-        this.$notify({ type: 'warning', message: '请选择分享内容!', className: 'notifyIndex' });
-        return;
+      // 旧的分享没有图标不会进来
+      // 是否有图片
+      if (this.reportTarget.photoSummary) {
+        this.reportTarget.photoSummary.forEach((item) => {
+          if (item.checked) this.urlList.push(item.fileUrl);
+        });
+
+        if (this.reportTarget.isHistory == '0') {
+          if (this.urlList.length == 0 && !this.isTarget && !this.isReportCustom) {
+            this.$notify({
+              type: 'warning',
+              message: '请选择分享内容!',
+              className: 'notifyIndex',
+            });
+            return;
+          }
+        } else {
+          if (this.urlList.length == 0 && !this.checkedPlan) {
+            this.$notify({
+              type: 'warning',
+              message: '请选择分享内容!',
+              className: 'notifyIndex',
+            });
+            return;
+          }
+        }
+      } else {
+        if (this.reportTarget.isHistory == '0') {
+          if (!this.isTarget && !this.isReportCustom) {
+            this.$notify({
+              type: 'warning',
+              message: '请选择分享内容!',
+              className: 'notifyIndex',
+            });
+            return;
+          }
+        }
       }
       buryingPoint({
         systemModel: '日报审核',