浏览代码

Merge branch 'feature_20260228_周报半月报动态配置' into release

# Conflicts:
#	src/views/week/daily.vue
#	src/views/week/dailyApproval.vue
#	src/views/week/dailyDetails.vue
#	src/views/week/dailyHistoricalDetails.vue
#	src/views/week/doubleHistoricalWeeklyDetils.vue
#	src/views/week/doubleWeekly.vue
#	src/views/week/doubleWeeklyApproval.vue
#	src/views/week/doubleWeeklyDetils.vue
#	src/views/week/weekly.vue
#	src/views/week/weeklyApproval.vue
#	src/views/week/weeklyApprovalDetils.vue
#	src/views/week/weeklyHistoricalDetils.vue
zhujindu 3 周之前
父节点
当前提交
4430615cd3

+ 51 - 42
src/views/week/doubleHistoricalWeeklyDetils.vue

@@ -3,7 +3,6 @@
     <!--        顶部条-->
     <div class="navBarTOP">
       <van-nav-bar class="navBar" title="半月报详情" left-arrow @click-left="onClickLeft" />
-      <!--      <p style="margin-left: 16px;    font-size: 14px;">{{title}}</p>-->
     </div>
     <div class="lineGrey"></div>
     <div class="lineGrey"></div>
@@ -16,46 +15,54 @@
       <van-collapse v-model="activeNames">
         <Atarget :reportInfo="reportTarget"></Atarget>
         <Btarget :reportInfo="reportTarget"></Btarget>
-        <van-collapse-item title="上期工作成果" name="7">
-          <div style="margin-top: -10px">
-            <div v-for="(item, index) in reportContentsList2" :key="index">
-              <!--              <p class="texttitle"><span class="opint"></span><span>{{selectDictLabel(weekType,item.doubleWeekType)}}</span></p>-->
-              <p class="texttitle texttitle2">计划工作进度</p>
-              <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
-                <van-field
-                  v-model="reportContentsList1[index].doubleWeekContent"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
-              </div>
-              <p class="texttitle texttitle2">实际工作进度</p>
-              <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
-                <van-field
-                  v-model="item.doubleWeekContent"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
+        <div class="contentContainer" v-if="reportTarget.isHistory == '0'">
+          <!-- isHistory 是否为历史汇报:0-新汇报 1-历史汇报 -->
+          <reportCustom
+            ref="reportCustom"
+            :disabled="true"
+            :reportCustomData="reportTarget.customTaskList"></reportCustom>
+        </div>
+        <template v-else>
+          <van-collapse-item title="上期工作成果" name="7">
+            <div style="margin-top: -10px">
+              <div v-for="(item, index) in reportContentsList2" :key="index">
+                <!--              <p class="texttitle"><span class="opint"></span><span>{{selectDictLabel(weekType,item.doubleWeekType)}}</span></p>-->
+                <p class="texttitle texttitle2">计划工作进度</p>
+                <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
+                  <van-field
+                    v-model="reportContentsList1[index].doubleWeekContent"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
+                <p class="texttitle texttitle2">实际工作进度</p>
+                <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
+                  <van-field
+                    v-model="item.doubleWeekContent"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
               </div>
             </div>
-          </div>
-        </van-collapse-item>
-        <van-collapse-item title="本期工作规划" name="8">
-          <div style="margin-top: -10px">
-            <div v-for="(item2, index2) in reportContentsList3" :key="index2">
-              <!--              <p class="texttitle"><span class="opint"></span><span>{{selectDictLabel(weekType,item2.doubleWeekType)}}</span></p>-->
-              <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
-                <van-field
-                  v-model="item2.doubleWeekContent"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
+          </van-collapse-item>
+          <van-collapse-item title="本期工作规划" name="8">
+            <div style="margin-top: -10px">
+              <div v-for="(item2, index2) in reportContentsList3" :key="index2">
+                <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
+                  <van-field
+                    v-model="item2.doubleWeekContent"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
               </div>
             </div>
-          </div>
-        </van-collapse-item>
+          </van-collapse-item>
+        </template>
       </van-collapse>
       <div
         class="contentContainer"
@@ -94,7 +101,6 @@
             <div style="padding: 10px 0">
               <van-field v-model="item.remarkContent" rows="4" autosize readonly type="textarea" />
             </div>
-            <!-- <p style="text-align: right">点评时间:{{ item.createTime }}</p> -->
           </div>
         </div>
       </div>
@@ -117,10 +123,6 @@
       <van-button type="info" size="small" plain class="Btn1" @click="submint">提交点评</van-button>
     </div>
     <br />
-    <!--    <div class="envelopes" @click="openEnterpriseChat" >-->
-    <!--      <img :src="envelopes">-->
-    <!--      <p>红包奖励</p>-->
-    <!--    </div>-->
     <br /><br />
     <br /><br />
   </div>
@@ -148,6 +150,7 @@ import neiwaiqiangpingtu from '@/views/componentsTarget/neiwaiqiangpingtu';
 import zhiganwaiqiangSAP from '@/views/componentsTarget/zhiganwaiqiangSAP';
 import Atarget from '@/views/home/Atarget.vue';
 import Btarget from '@/views/home/Btarget.vue';
+import reportCustom from './reportCustom.vue';
 export default {
   name: 'home',
   components: {
@@ -160,6 +163,7 @@ export default {
     zhiganwaiqiangSAP,
     Atarget,
     Btarget,
+    reportCustom,
   },
   data() {
     return {
@@ -202,6 +206,7 @@ export default {
       managerRemarkContent: '',
       isDiy: false,
       type: '-1',
+      JZQuota: false,
       //
     };
   },
@@ -364,6 +369,10 @@ export default {
       });
       getDetailById({ reportId: this.$route.query.reportId }).then((res) => {
         loading1.clear();
+        this.JZQuota = false;
+        if (res.data.postType == 'JZ') {
+          this.JZQuota = true;
+        }
         this.title =
           res.data.deptName + '-' + res.data.postName + '-' + res.data.nickName + '的半月报';
         this.ptitle = res.data.pdeptName + '-' + res.data.ppostName + '-' + res.data.pnickName;

+ 220 - 125
src/views/week/doubleWeekly.vue

@@ -29,68 +29,72 @@
       <van-collapse v-model="activeNames">
         <Atarget :reportInfo="reportTarget"></Atarget>
         <Btarget :reportInfo="reportTarget"></Btarget>
-        <van-collapse-item title="上期工作成果" name="7" class="collapsettitle">
-          <template #title>
-            <div>上期工作成果 <span class="colorRed">(必填)</span></div>
-          </template>
-          <div style="margin-top: -10px">
-            <div class="weekContent" v-for="(item2, index2) in reportContentsList2" :key="index2">
-              <!--              <p class="texttitle"><span class="opint"></span><span>{{ item2.title }}</span><span-->
-              <!--                  class="colorRed">(必填)</span></p>-->
-              <p class="texttitle texttitle2">计划工作进度</p>
-              <p class="contentContainerp1">
-                <van-field
-                  v-model="reportContentsList3[index2].doubleWeekContent"
-                  rows="4"
-                  autosize
-                  readonly
-                  :formatter="formatter"
-                  type="textarea" />
-              </p>
-              <!--              <p style="min-height: 32px;">{{ reportContentsList3[index2].doubleWeekContent }}</p>-->
-              <p class="texttitle texttitle2">实际工作进度</p>
-              <p class="contentContainerp">
-                <van-field
-                  v-model="item2.doubleWeekContent"
-                  rows="4"
-                  autosize
-                  maxlength="800"
-                  :formatter="formatter"
-                  type="textarea"
-                  show-word-limit />
-              </p>
+        <!-- isHistory 是否为历史汇报:0-新汇报 1-历史汇报 -->
+        <div class="contentContainer" v-if="reportTarget.isHistory == '0'">
+          <reportCustom
+            ref="reportCustom"
+            :reportCustomData="reportTarget.customTaskList"></reportCustom>
+        </div>
+        <template v-else>
+          <van-collapse-item title="上期工作成果" name="7" class="collapsettitle">
+            <template #title>
+              <div>上期工作成果 <span class="colorRed">(必填)</span></div>
+            </template>
+            <div style="margin-top: -10px">
+              <div class="weekContent" v-for="(item2, index2) in reportContentsList2" :key="index2">
+                <!--              <p class="texttitle"><span class="opint"></span><span>{{ item2.title }}</span><span-->
+                <!--                  class="colorRed">(必填)</span></p>-->
+                <p class="texttitle texttitle2">计划工作进度</p>
+                <p class="contentContainerp1">
+                  <van-field
+                    v-model="reportContentsList3[index2].doubleWeekContent"
+                    rows="4"
+                    autosize
+                    readonly
+                    :formatter="formatter"
+                    type="textarea" />
+                </p>
+                <!--              <p style="min-height: 32px;">{{ reportContentsList3[index2].doubleWeekContent }}</p>-->
+                <p class="texttitle texttitle2">实际工作进度</p>
+                <p class="contentContainerp">
+                  <van-field
+                    v-model="item2.doubleWeekContent"
+                    rows="4"
+                    autosize
+                    maxlength="800"
+                    :formatter="formatter"
+                    type="textarea"
+                    show-word-limit />
+                </p>
+              </div>
             </div>
-          </div>
-        </van-collapse-item>
-        <van-collapse-item title="本期工作规划" name="8" class="collapsettitle">
-          <template #title>
-            <div>本期工作规划 <span class="colorRed">(必填)</span></div>
-          </template>
-          <div style="margin-top: -10px">
-            <div class="weekContent" v-for="(item, index) in reportContentsList1" :key="index">
-              <!--              <p class="texttitle"><span class="opint"></span><span>{{ item.title }}</span><span-->
-              <!--                  class="colorRed">(必填)</span></p>-->
-              <p class="contentContainerp">
-                <van-field
-                  v-model="item.doubleWeekContent"
-                  rows="4"
-                  autosize
-                  maxlength="800"
-                  type="textarea"
-                  show-word-limit
-                  :formatter="formatter" />
-              </p>
+          </van-collapse-item>
+          <van-collapse-item title="本期工作规划" name="8" class="collapsettitle">
+            <template #title>
+              <div>本期工作规划 <span class="colorRed">(必填)</span></div>
+            </template>
+            <div style="margin-top: -10px">
+              <div class="weekContent" v-for="(item, index) in reportContentsList1" :key="index">
+                <p class="contentContainerp">
+                  <van-field
+                    v-model="item.doubleWeekContent"
+                    rows="4"
+                    autosize
+                    maxlength="800"
+                    type="textarea"
+                    show-word-limit
+                    :formatter="formatter" />
+                </p>
+              </div>
             </div>
-          </div>
-        </van-collapse-item>
+          </van-collapse-item>
+        </template>
       </van-collapse>
       <br />
       <br />
-      <!--      <div class="contentborder">-->
       <van-button type="info" size="small" plain class="Btn100" @click="submint"
         >提交半月报</van-button
       >
-      <!--      </div>-->
     </div>
     <br />
     <br />
@@ -114,6 +118,7 @@ import neiwaiqiangpingtu from '@/views/componentsTarget/neiwaiqiangpingtu';
 import zhiganwaiqiangSAP from '@/views/componentsTarget/zhiganwaiqiangSAP';
 import Atarget from '@/views/home/Atarget.vue';
 import Btarget from '@/views/home/Btarget.vue';
+import reportCustom from './reportCustom.vue';
 
 export default {
   name: 'home',
@@ -127,6 +132,7 @@ export default {
     zhiganwaiqiangSAP,
     Atarget,
     Btarget,
+    reportCustom,
   },
   data() {
     return {
@@ -158,6 +164,7 @@ export default {
       weekType: [],
       temporaryShow: '',
       type: '-1',
+      JZQuota: false,
     };
   },
   created() {
@@ -210,6 +217,10 @@ export default {
       getDetailById({ reportId: this.$route.query.reportId }).then((res) => {
         loading1.clear();
         if (res.code == 200) {
+          this.JZQuota = false;
+          if (res.data.postType == 'JZ') {
+            this.JZQuota = true;
+          }
           if (res.data.status != '0' && res.data.status != '2') {
             this.$dialog
               .alert({
@@ -345,97 +356,181 @@ export default {
       });
     },
     tsContentsFn() {
+      if (this.isclick) {
+        if (this.reportTarget.isHistory == '1') {
+          this.reportTarget.reportContents = [];
+          this.reportTarget.reportContents = this.reportContentsList2
+            .concat(this.reportContentsList1)
+            .concat(this.reportContentsList3);
+          this.tsContentsFun(null);
+        } else {
+          // 新的
+          if (this.reportTarget.customTaskList && this.reportTarget.customTaskList.length) {
+            // 配置任务
+            this.filterReportCustomData((reportCustomAnswers) => {
+              this.tsContentsFun(reportCustomAnswers);
+            });
+          } else {
+            // 没有配置任务
+            this.tsContentsFun(null);
+          }
+        }
+      }
+    },
+    tsContentsFun(reportCustomAnswers) {
       let loading1 = this.$toast.loading({
         duration: 0,
         message: '数据提交中...',
         forbidClick: true,
       });
-      if (this.isclick) {
-        this.reportTarget.reportContents = [];
-        this.reportTarget.reportContents = this.reportContentsList2
-          .concat(this.reportContentsList1)
-          .concat(this.reportContentsList3);
-        this.reportTarget.status = '1';
-        this.isclick = false;
-        tsContents(this.reportTarget).then((res) => {
-          loading1.clear();
-          this.isclick = true;
-          if (res.code == 200) {
-            this.$dialog
-              .alert({
-                title: '系统提示',
-                message: '暂存成功',
-              })
-              .then(() => {
-                // if(this.$route.query.reportId!=undefined){
-                //   window.location.replace(window.location.origin+"/mobile/myHistoricalDaily")
-                // }else{
-                //   window.location.replace(window.location.origin+"/mobile/home")
-                // }
-              });
+      if (reportCustomAnswers) this.reportTarget.reportCustomAnswers = reportCustomAnswers;
+      this.reportTarget.status = '1';
+      this.isclick = false;
+      tsContents(this.reportTarget).then((res) => {
+        loading1.clear();
+        this.isclick = true;
+        if (res.code == 200) {
+          this.$dialog
+            .alert({
+              title: '系统提示',
+              message: '暂存成功',
+            })
+            .then(() => {
+              // if(this.$route.query.reportId!=undefined){
+              //   window.location.replace(window.location.origin+"/mobile/myHistoricalDaily")
+              // }else{
+              //   window.location.replace(window.location.origin+"/mobile/home")
+              // }
+            });
+        } else {
+          this.$toast.fail(res.msg);
+        }
+      });
+    },
+    reportCustomTabstoreVal(callback) {
+      // 必填校验
+      this.$refs.reportCustom.$refs.tabstoreVal
+        .validate()
+        .then(() => {
+          // 验证通过
+          this.filterReportCustomData(callback);
+        })
+        .catch((errors) => {
+          this.toastLoading().clear();
+          return;
+        });
+    },
+    filterReportCustomData(callback) {
+      let reportCustomData = this.$refs.reportCustom ? this.$refs.reportCustom.fromData : {} || {};
+      let reportCustomAnswers = [];
+      for (let i = 0; i < reportCustomData.length; i++) {
+        let customData = reportCustomData[i].sfaReportCustomCollections
+          ? reportCustomData[i].sfaReportCustomCollections
+          : [];
+        for (let x = 0; x < customData.length; x++) {
+          if (
+            customData[x].reportCustomCollectionType == 'dx' ||
+            customData[x].reportCustomCollectionType == 'duox'
+          ) {
+            let optionData = customData[x].sfaReportCustomOptions;
+            for (let y = 0; y < optionData.length; y++) {
+              if (optionData[y].answerValue == 'Y') {
+                reportCustomAnswers.push({
+                  reportCustomTaskId: customData[x].reportCustomTaskId,
+                  reportCustomCollectionId: optionData[y].reportCustomCollectionId,
+                  reportCustomOptionId: optionData[y].reportCustomOptionId,
+                  answerValue: 'Y',
+                });
+              }
+            }
           } else {
-            this.$toast.fail(res.msg);
+            if (customData[x].answerValue)
+              reportCustomAnswers.push({
+                reportCustomTaskId: customData[x].reportCustomTaskId,
+                reportCustomCollectionId: customData[x].reportCustomCollectionId,
+                answerValue: customData[x].answerValue,
+              });
           }
-        });
+        }
       }
+      console.log(reportCustomAnswers);
+      callback && callback(reportCustomAnswers);
     },
     // 提交日报
     submint() {
-      let loading1 = this.$toast.loading({
-        duration: 0,
-        message: '数据提交中...',
-        forbidClick: true,
-      });
       if (this.isclick) {
-        this.reportTarget.reportContents = [];
-        for (var x = 0; x < this.reportContentsList2.length; x++) {
-          if (this.reportContentsList2[x].doubleWeekContent.trim() == '') {
-            this.$toast('请完善上期半月报内容!');
+        // 旧的
+        if (this.reportTarget.isHistory == '1') {
+          this.reportTarget.reportContents = [];
+          for (var x = 0; x < this.reportContentsList2.length; x++) {
+            if (this.reportContentsList2[x].doubleWeekContent.trim() == '') {
+              this.$toast('请完善上期半月报内容!');
+              return false;
+            }
+          }
+          for (var j = 0; j < this.reportContentsList1.length; j++) {
+            if (this.reportContentsList1[j].doubleWeekContent.trim() == '') {
+              this.$toast('请完善本期半月报内容!');
+              return false;
+            }
+          }
+          if (this.reportContentsList2[0].doubleWeekContent.length > 800) {
+            this.$toast('上期半月报内容超过800字!');
             return false;
           }
-        }
-        for (var j = 0; j < this.reportContentsList1.length; j++) {
-          if (this.reportContentsList1[j].doubleWeekContent.trim() == '') {
-            this.$toast('请完善本期半月报内容!');
+          if (this.reportContentsList1[0].doubleWeekContent.length > 800) {
+            this.$toast('本期半月报内容超过800字!');
             return false;
           }
-        }
-        if (this.reportContentsList2[0].doubleWeekContent.length > 800) {
-          this.$toast('上期半月报内容超过800字!');
-          return false;
-        }
-        if (this.reportContentsList1[0].doubleWeekContent.length > 800) {
-          this.$toast('本期半月报内容超过800字!');
-          return false;
-        }
-        this.reportTarget.reportContents = this.reportContentsList2
-          .concat(this.reportContentsList1)
-          .concat(this.reportContentsList3);
-        this.reportTarget.status = '1';
-        this.isclick = false;
-        updateReport(this.reportTarget).then((res) => {
-          loading1.clear();
-          this.isclick = true;
-          if (res.code == 200) {
-            this.$dialog
-              .alert({
-                title: '系统提示',
-                message: '提交成功',
-              })
-              .then(() => {
-                if (this.$route.query.reportId != undefined) {
-                  window.location.replace(window.location.origin + '/mobile/myHistoricalDaily');
-                } else {
-                  this.onClickLeft();
-                  // window.location.replace(window.location.origin + '/mobile/home');
-                }
-              });
+          this.reportTarget.reportContents = this.reportContentsList2
+            .concat(this.reportContentsList1)
+            .concat(this.reportContentsList3);
+          this.submintFun();
+        } else {
+          // 新的
+          if (this.reportTarget.customTaskList && this.reportTarget.customTaskList.length) {
+            // 配置任务
+            this.reportCustomTabstoreVal((reportCustomAnswers) => {
+              this.submintFun(reportCustomAnswers);
+            });
           } else {
-            this.$toast.fail(res.msg);
+            // 没有配置任务
+            this.submintFun(null);
           }
-        });
+        }
       }
     },
+    submintFun(reportCustomAnswers) {
+      let loading1 = this.$toast.loading({
+        duration: 0,
+        message: '数据提交中...',
+        forbidClick: true,
+      });
+      if (reportCustomAnswers) this.reportTarget.reportCustomAnswers = reportCustomAnswers;
+      this.reportTarget.status = '1';
+      this.isclick = false;
+      updateReport(this.reportTarget).then((res) => {
+        loading1.clear();
+        this.isclick = true;
+        if (res.code == 200) {
+          this.$dialog
+            .alert({
+              title: '系统提示',
+              message: '提交成功',
+            })
+            .then(() => {
+              if (this.$route.query.reportId != undefined) {
+                window.location.replace(window.location.origin + '/mobile/myHistoricalDaily');
+              } else {
+                this.onClickLeft();
+                // window.location.replace(window.location.origin + '/mobile/home');
+              }
+            });
+        } else {
+          this.$toast.fail(res.msg);
+        }
+      });
+    },
     getReportInfo() {
       let loading1 = this.$toast.loading({
         duration: 0,

+ 53 - 37
src/views/week/doubleWeeklyApproval.vue

@@ -15,46 +15,55 @@
       <van-collapse v-model="activeNames">
         <Atarget :reportInfo="reportTarget"></Atarget>
         <Btarget :reportInfo="reportTarget"></Btarget>
-        <van-collapse-item title="上期工作成果" name="7">
-          <div style="margin-top: -10px">
-            <div v-for="(item, index) in reportContentsList2" :key="index">
-              <!--              <p class="texttitle"><span class="opint"></span><span>{{selectDictLabel(weekType,item.doubleWeekType)}}</span></p>-->
-              <p class="texttitle texttitle2">计划工作进度</p>
-              <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
-                <van-field
-                  v-model="reportContentsList1[index].doubleWeekContent"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
-              </div>
-              <p class="texttitle texttitle2">实际工作进度</p>
-              <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
-                <van-field
-                  v-model="item.doubleWeekContent"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
+        <div class="contentContainer" v-if="reportTarget.isHistory == '0'">
+          <!-- isHistory 是否为历史汇报:0-新汇报 1-历史汇报 -->
+
+          <reportCustom
+            ref="reportCustom"
+            :disabled="true"
+            :reportCustomData="reportTarget.customTaskList"></reportCustom>
+        </div>
+        <template v-else>
+          <van-collapse-item title="上期工作成果" name="7">
+            <div style="margin-top: -10px">
+              <div v-for="(item, index) in reportContentsList2" :key="index">
+                <!--              <p class="texttitle"><span class="opint"></span><span>{{selectDictLabel(weekType,item.doubleWeekType)}}</span></p>-->
+                <p class="texttitle texttitle2">计划工作进度</p>
+                <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
+                  <van-field
+                    v-model="reportContentsList1[index].doubleWeekContent"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
+                <p class="texttitle texttitle2">实际工作进度</p>
+                <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
+                  <van-field
+                    v-model="item.doubleWeekContent"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
               </div>
             </div>
-          </div>
-        </van-collapse-item>
-        <van-collapse-item title="本期工作规划" name="8">
-          <div style="margin-top: -10px">
-            <div v-for="(item2, index2) in reportContentsList3" :key="index2">
-              <!--              <p class="texttitle"><span class="opint"></span><span>{{selectDictLabel(weekType,item2.doubleWeekType)}}</span></p>-->
-              <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
-                <van-field
-                  v-model="item2.doubleWeekContent"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
+          </van-collapse-item>
+          <van-collapse-item title="本期工作规划" name="8">
+            <div style="margin-top: -10px">
+              <div v-for="(item2, index2) in reportContentsList3" :key="index2">
+                <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
+                  <van-field
+                    v-model="item2.doubleWeekContent"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
               </div>
             </div>
-          </div>
-        </van-collapse-item>
+          </van-collapse-item>
+        </template>
       </van-collapse>
       <div class="contentContainer">
         <p class="contentContainerTitle">打分 <span>请点亮小星星,一颗小星星代表1分</span></p>
@@ -114,6 +123,7 @@ import neiwaiqiangpingtu from '@/views/componentsTarget/neiwaiqiangpingtu';
 import zhiganwaiqiangSAP from '@/views/componentsTarget/zhiganwaiqiangSAP';
 import Atarget from '@/views/home/Atarget.vue';
 import Btarget from '@/views/home/Btarget.vue';
+import reportCustom from './reportCustom.vue';
 
 export default {
   name: 'home',
@@ -127,6 +137,7 @@ export default {
     zhiganwaiqiangSAP,
     Atarget,
     Btarget,
+    reportCustom,
   },
   data() {
     return {
@@ -160,6 +171,7 @@ export default {
       updateReport: {},
       weekType: [],
       type: '-1',
+      JZQuota: false,
       reportTarget: {},
     };
   },
@@ -174,7 +186,7 @@ export default {
     $route(to, from) {
       this.powerGrade = localStorage.getItem('powerGrade');
       if (to.path == '/doubleWeeklyApproval') {
-        this.getDetailById();
+        this.getReportInfo();
         this.number == 0;
         this.Content = '';
       }
@@ -268,6 +280,10 @@ export default {
       getDetailById({ reportId: this.$route.query.reportId }).then((res) => {
         loading1.clear();
         if (res.code == 200) {
+          this.JZQuota = false;
+          if (res.data.postType == 'JZ') {
+            this.JZQuota = true;
+          }
           if (res.data.status != '1') {
             this.$dialog
               .alert({

+ 58 - 40
src/views/week/doubleWeeklyDetils.vue

@@ -3,62 +3,78 @@
     <!--        顶部条-->
     <div class="navBarTOP">
       <van-nav-bar class="navBar" title="半月报详情" left-arrow @click-left="onClickLeft" />
-      <!--      <p style="text-align: right;margin-right: 16px;color: #1e5398;">{{title}}</p>-->
     </div>
     <div class="lineGrey"></div>
     <div class="lineGrey"></div>
     <div class="lineGrey"></div>
     <div class="lineGrey"></div>
     <div class="lineGrey"></div>
-    <!--    <div class="lineGrey"></div>-->
     <!--        主体内容-->
     <div class="container linep">
       <van-collapse v-model="activeNames">
         <Atarget :reportInfo="reportTarget"></Atarget>
         <Btarget :reportInfo="reportTarget"></Btarget>
-        <van-collapse-item title="上期工作成果" name="7">
-          <div style="margin-top: -10px">
-            <div v-for="(item, index) in reportContentsList2" :key="index">
-              <!--              <p class="texttitle"><span class="opint"></span><span>{{selectDictLabel(weekType,item.doubleWeekType)}}</span></p>-->
-              <p class="texttitle texttitle2">计划工作进度</p>
-              <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
-                <van-field
-                  v-model="reportContentsList1[index].doubleWeekContent"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
+        <div class="contentContainer" v-if="reportTarget.isHistory == '0'">
+          <!-- isHistory 是否为历史汇报:0-新汇报 1-历史汇报 -->
+          <reportCustom
+            ref="reportCustom"
+            :disabled="true"
+            :reportCustomData="reportTarget.customTaskList"></reportCustom>
+        </div>
+        <template v-else>
+          <van-collapse-item title="上期工作成果" name="7">
+            <div style="margin-top: -10px">
+              <div v-for="(item, index) in reportContentsList2" :key="index">
+                <p class="texttitle texttitle2">计划工作进度</p>
+                <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
+                  <van-field
+                    v-model="reportContentsList1[index].doubleWeekContent"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
+                <p class="texttitle texttitle2">实际工作进度</p>
+                <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
+                  <van-field
+                    v-model="item.doubleWeekContent"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
               </div>
-              <!--              <p  style="min-height: 32px;">{{reportContentsList1[index].doubleWeekContent}}</p>-->
-              <p class="texttitle texttitle2">实际工作进度</p>
-              <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
-                <van-field
-                  v-model="item.doubleWeekContent"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
+            </div>
+          </van-collapse-item>
+          <van-collapse-item title="本期工作规划" name="8">
+            <div style="margin-top: -10px">
+              <div v-for="(item2, index2) in reportContentsList3" :key="index2">
+                <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
+                  <van-field
+                    v-model="item2.doubleWeekContent"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
               </div>
-              <!--              <p>{{}}</p>-->
             </div>
-          </div>
-        </van-collapse-item>
-        <van-collapse-item title="本期工作规划" name="8">
-          <div style="margin-top: -10px">
-            <div v-for="(item2, index2) in reportContentsList3" :key="index2">
-              <!--              <p class="texttitle"><span class="opint"></span><span>{{selectDictLabel(weekType,item2.doubleWeekType)}}</span></p>-->
-              <!--              <p>{{item2.doubleWeekContent}}</p>-->
-              <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
-                <van-field
-                  v-model="item2.doubleWeekContent"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
+          </van-collapse-item>
+          <van-collapse-item title="本期工作规划" name="8">
+            <div style="margin-top: -10px">
+              <div v-for="(item2, index2) in reportContentsList3" :key="index2">
+                <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
+                  <van-field
+                    v-model="item2.doubleWeekContent"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
               </div>
             </div>
-          </div>
-        </van-collapse-item>
+          </van-collapse-item>
+        </template>
         <div
           class="contentContainer"
           v-if="reportTarget.status > 1 || reportTarget.reportRemarks != null">
@@ -127,6 +143,7 @@ import neiwaiqiangpingtu from '@/views/componentsTarget/neiwaiqiangpingtu';
 import zhiganwaiqiangSAP from '@/views/componentsTarget/zhiganwaiqiangSAP';
 import Atarget from '@/views/home/Atarget.vue';
 import Btarget from '@/views/home/Btarget.vue';
+import reportCustom from './reportCustom.vue';
 
 export default {
   name: 'home',
@@ -140,6 +157,7 @@ export default {
     zhiganwaiqiangSAP,
     Atarget,
     Btarget,
+    reportCustom,
   },
   data() {
     return {

+ 266 - 172
src/views/week/weekly.vue

@@ -32,102 +32,110 @@
           <Atarget :reportInfo="reportTarget"></Atarget>
           <Btarget :reportInfo="reportTarget"></Btarget>
         </template>
-        <van-collapse-item title="上周工作成果" name="8">
-          <div style="margin-top: -10px">
-            <div v-for="(item2, index2) in reportContentsList2" :key="index2">
-              <div v-if="index2 < 7">
-                <p class="texttitle">
+        <!-- isHistory 是否为历史汇报:0-新汇报 1-历史汇报 -->
+        <div class="contentContainer" v-if="reportTarget.isHistory == '0'">
+          <reportCustom
+            ref="reportCustom"
+            :reportCustomData="reportTarget.customTaskList"></reportCustom>
+        </div>
+        <template v-else>
+          <van-collapse-item title="上周工作成果" name="8">
+            <div style="margin-top: -10px">
+              <div v-for="(item2, index2) in reportContentsList2" :key="index2">
+                <div v-if="index2 < 7">
+                  <p class="texttitle">
+                    <span class="opint"></span
+                    ><span v-if="!reportTarget.hideWeekDate">{{
+                      weeklyTimeDivision(item2.contentTime, 0)
+                    }}</span
+                    ><span>{{ weeklyTimeDivision(item2.contentTime, 1) }}</span
+                    ><span v-if="index2 < 5" class="colorRed">(必填)</span>
+                  </p>
+                  <p>
+                    <span class="blackcolor">上午:</span
+                    >{{ reportContentsList3[index2].weekContentAm }}
+                  </p>
+                  <p>
+                    <span class="blackcolor">下午:</span
+                    >{{ reportContentsList3[index2].weekContentPm }}
+                  </p>
+                  <p class="texttitle texttitle2">实际工作进度</p>
+                  <p>
+                    <van-field
+                      class="weeklyinput"
+                      v-model="item2.weekContentAm"
+                      label="上午:"
+                      placeholder="请输入" />
+                    <van-field
+                      class="weeklyinput"
+                      v-model="item2.weekContentPm"
+                      label="下午:"
+                      placeholder="请输入" />
+                  </p>
+                </div>
+                <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作重点</p>
+                <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer1">
+                  <van-field
+                    v-model="reportContentsList3[index2].weekContentSummary"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
+                <p v-if="index2 == 7" class="texttitle">
+                  <span class="opint"></span>上周工作成果<span class="colorRed">(必填)</span>
+                </p>
+                <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
+                  <van-field
+                    v-model="item2.weekContentSummary"
+                    rows="4"
+                    autosize
+                    maxlength="800"
+                    show-word-limit
+                    type="textarea" />
+                </div>
+              </div>
+            </div>
+          </van-collapse-item>
+          <van-collapse-item title="本周工作规划" name="9">
+            <div style="margin-top: -10px">
+              <div v-for="(item, index) in reportContentsList1" :key="index">
+                <p class="texttitle" v-if="index < 7">
                   <span class="opint"></span
                   ><span v-if="!reportTarget.hideWeekDate">{{
-                    weeklyTimeDivision(item2.contentTime, 0)
+                    weeklyTimeDivision(item.contentTime, 0)
                   }}</span
-                  ><span>{{ weeklyTimeDivision(item2.contentTime, 1) }}</span
-                  ><span v-if="index2 < 5" class="colorRed">(必填)</span>
-                </p>
-                <p>
-                  <span class="blackcolor">上午:</span
-                  >{{ reportContentsList3[index2].weekContentAm }}
+                  ><span>{{ weeklyTimeDivision(item.contentTime, 1) }}</span
+                  ><span v-if="index < 5" class="colorRed">(必填)</span>
                 </p>
-                <p>
-                  <span class="blackcolor">下午:</span
-                  >{{ reportContentsList3[index2].weekContentPm }}
-                </p>
-                <p class="texttitle texttitle2">实际工作进度</p>
-                <p>
+                <p v-if="index < 7">
                   <van-field
                     class="weeklyinput"
-                    v-model="item2.weekContentAm"
                     label="上午:"
-                    placeholder="请输入" />
+                    placeholder="请输入"
+                    v-model="item.weekContentAm" />
                   <van-field
                     class="weeklyinput"
-                    v-model="item2.weekContentPm"
                     label="下午:"
-                    placeholder="请输入" />
+                    placeholder="请输入"
+                    v-model="item.weekContentPm" />
                 </p>
-              </div>
-              <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作重点</p>
-              <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer1">
-                <van-field
-                  v-model="reportContentsList3[index2].weekContentSummary"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
-              </div>
-              <p v-if="index2 == 7" class="texttitle">
-                <span class="opint"></span>上周工作成果<span class="colorRed">(必填)</span>
-              </p>
-              <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
-                <van-field
-                  v-model="item2.weekContentSummary"
-                  rows="4"
-                  autosize
-                  maxlength="800"
-                  show-word-limit
-                  type="textarea" />
-              </div>
-            </div>
-          </div>
-        </van-collapse-item>
-        <van-collapse-item title="本周工作规划" name="9">
-          <div style="margin-top: -10px">
-            <div v-for="(item, index) in reportContentsList1" :key="index">
-              <p class="texttitle" v-if="index < 7">
-                <span class="opint"></span
-                ><span v-if="!reportTarget.hideWeekDate">{{
-                  weeklyTimeDivision(item.contentTime, 0)
-                }}</span
-                ><span>{{ weeklyTimeDivision(item.contentTime, 1) }}</span
-                ><span v-if="index < 5" class="colorRed">(必填)</span>
-              </p>
-              <p v-if="index < 7">
-                <van-field
-                  class="weeklyinput"
-                  label="上午:"
-                  placeholder="请输入"
-                  v-model="item.weekContentAm" />
-                <van-field
-                  class="weeklyinput"
-                  label="下午:"
-                  placeholder="请输入"
-                  v-model="item.weekContentPm" />
-              </p>
-              <p v-if="index == 7" class="texttitle">
-                <span class="opint"></span>本周工作重点<span class="colorRed">(必填)</span>
-              </p>
-              <div v-if="index == 7" style="padding: 10px 0" class="contentContainer">
-                <van-field
-                  v-model="item.weekContentSummary"
-                  rows="4"
-                  autosize
-                  maxlength="800"
-                  show-word-limit
-                  type="textarea" />
+                <p v-if="index == 7" class="texttitle">
+                  <span class="opint"></span>本周工作重点<span class="colorRed">(必填)</span>
+                </p>
+                <div v-if="index == 7" style="padding: 10px 0" class="contentContainer">
+                  <van-field
+                    v-model="item.weekContentSummary"
+                    rows="4"
+                    autosize
+                    maxlength="800"
+                    show-word-limit
+                    type="textarea" />
+                </div>
               </div>
             </div>
-          </div>
-        </van-collapse-item>
+          </van-collapse-item>
+        </template>
       </van-collapse>
       <br />
       <br />
@@ -153,6 +161,7 @@ import moshouqiSAP from '@/views/componentsTarget/moshouqiSAP';
 import fangshuiSAP from '@/views/componentsTarget/fangshuiSAP';
 import Atarget from '@/views/home/Atarget.vue';
 import Btarget from '@/views/home/Btarget.vue';
+import reportCustom from './reportCustom.vue';
 export default {
   name: 'home',
   components: {
@@ -169,6 +178,7 @@ export default {
     fangshuiSAP,
     Atarget,
     Btarget,
+    reportCustom,
   },
   data() {
     return {
@@ -357,115 +367,199 @@ export default {
       });
     },
     tsContentsFn() {
-      let loading1 = this.$toast.loading({
-        duration: 0,
-        message: '数据提交中...',
-        forbidClick: true,
-      });
       if (this.isclick) {
-        this.reportTarget.reportContents = [];
-        this.reportTarget.reportContents = this.reportContentsList2
-          .concat(this.reportContentsList1)
-          .concat(this.reportContentsList3);
-        this.reportTarget.status = '1';
-        console.log(this.reportContentsList1);
-        console.log(this.reportContentsList2);
-        console.log(this.reportContentsList3);
-        console.log(this.reportTarget.reportContents);
-        this.isclick = false;
-        tsContents(this.reportTarget).then((res) => {
-          loading1.clear();
-          this.isclick = true;
-          if (res.code == 200) {
-            this.$dialog
-              .alert({
-                title: '系统提示',
-                message: '暂存成功',
-              })
-              .then(() => {
-                // if(this.$route.query.reportId!=undefined){
-                //   window.location.replace(window.location.origin+"/mobile/myHistoricalDaily")
-                // }else{
-                //   window.location.replace(window.location.origin+"/mobile/home")
-                // }
-              });
+        if (this.reportTarget.isHistory == '1') {
+          this.reportTarget.reportContents = [];
+          this.reportTarget.reportContents = this.reportContentsList2
+            .concat(this.reportContentsList1)
+            .concat(this.reportContentsList3);
+          console.log(this.reportContentsList1);
+          console.log(this.reportContentsList2);
+          console.log(this.reportContentsList3);
+          console.log(this.reportTarget.reportContents);
+          this.tsContentsFun(null);
+        } else {
+          // 新的
+          if (this.reportTarget.customTaskList && this.reportTarget.customTaskList.length) {
+            // 配置任务
+            this.filterReportCustomData((reportCustomAnswers) => {
+              this.tsContentsFun(reportCustomAnswers);
+            });
           } else {
-            this.$toast.fail(res.msg);
+            // 没有配置任务
+            this.tsContentsFun(null);
           }
-        });
+        }
       }
     },
-    // 提交日报
-    submint() {
+    tsContentsFun(reportCustomAnswers) {
       let loading1 = this.$toast.loading({
         duration: 0,
         message: '数据提交中...',
         forbidClick: true,
       });
-      if (this.isclick) {
-        this.reportTarget.reportContents = [];
-        for (var j = 0; j < 5; j++) {
+      if (reportCustomAnswers) this.reportTarget.reportCustomAnswers = reportCustomAnswers;
+      this.reportTarget.status = '1';
+      this.isclick = false;
+      tsContents(this.reportTarget).then((res) => {
+        loading1.clear();
+        this.isclick = true;
+        if (res.code == 200) {
+          this.$dialog
+            .alert({
+              title: '系统提示',
+              message: '暂存成功',
+            })
+            .then(() => {
+              // if(this.$route.query.reportId!=undefined){
+              //   window.location.replace(window.location.origin+"/mobile/myHistoricalDaily")
+              // }else{
+              //   window.location.replace(window.location.origin+"/mobile/home")
+              // }
+            });
+        } else {
+          this.$toast.fail(res.msg);
+        }
+      });
+    },
+    reportCustomTabstoreVal(callback) {
+      // 必填校验
+      this.$refs.reportCustom.$refs.tabstoreVal
+        .validate()
+        .then(() => {
+          // 验证通过
+          this.filterReportCustomData(callback);
+        })
+        .catch((errors) => {
+          this.toastLoading().clear();
+          return;
+        });
+    },
+    filterReportCustomData(callback) {
+      let reportCustomData = this.$refs.reportCustom ? this.$refs.reportCustom.fromData : {} || {};
+      let reportCustomAnswers = [];
+      for (let i = 0; i < reportCustomData.length; i++) {
+        let customData = reportCustomData[i].sfaReportCustomCollections
+          ? reportCustomData[i].sfaReportCustomCollections
+          : [];
+        for (let x = 0; x < customData.length; x++) {
           if (
-            this.reportContentsList1[j].weekContentAm.trim() == '' ||
-            this.reportContentsList1[j].weekContentPm.trim() == ''
+            customData[x].reportCustomCollectionType == 'dx' ||
+            customData[x].reportCustomCollectionType == 'duox'
           ) {
-            this.$toast('请完善本周规划内容!');
-            return false;
+            let optionData = customData[x].sfaReportCustomOptions;
+            for (let y = 0; y < optionData.length; y++) {
+              if (optionData[y].answerValue == 'Y') {
+                reportCustomAnswers.push({
+                  reportCustomTaskId: customData[x].reportCustomTaskId,
+                  reportCustomCollectionId: optionData[y].reportCustomCollectionId,
+                  reportCustomOptionId: optionData[y].reportCustomOptionId,
+                  answerValue: 'Y',
+                });
+              }
+            }
+          } else {
+            if (customData[x].answerValue)
+              reportCustomAnswers.push({
+                reportCustomTaskId: customData[x].reportCustomTaskId,
+                reportCustomCollectionId: customData[x].reportCustomCollectionId,
+                answerValue: customData[x].answerValue,
+              });
           }
         }
-        for (var x = 0; x < 5; x++) {
-          if (
-            this.reportContentsList2[x].weekContentAm.trim() == '' ||
-            this.reportContentsList2[x].weekContentPm.trim() == ''
-          ) {
-            this.$toast('请完善上周周报内容!');
+      }
+      console.log(reportCustomAnswers);
+      callback && callback(reportCustomAnswers);
+    },
+    // 提交日报
+    submint() {
+      if (this.isclick) {
+        // 旧的
+        if (this.reportTarget.isHistory == '1') {
+          this.reportTarget.reportContents = [];
+          for (var j = 0; j < 5; j++) {
+            if (
+              this.reportContentsList1[j].weekContentAm.trim() == '' ||
+              this.reportContentsList1[j].weekContentPm.trim() == ''
+            ) {
+              this.$toast('请完善本周规划内容!');
+              return false;
+            }
+          }
+          for (var x = 0; x < 5; x++) {
+            if (
+              this.reportContentsList2[x].weekContentAm.trim() == '' ||
+              this.reportContentsList2[x].weekContentPm.trim() == ''
+            ) {
+              this.$toast('请完善上周周报内容!');
+              return false;
+            }
+          }
+          if (this.reportContentsList2[7].weekContentSummary.trim() == '') {
+            this.$toast('请完善上周工作成果!');
             return false;
           }
-        }
-        if (this.reportContentsList2[7].weekContentSummary.trim() == '') {
-          this.$toast('请完善上周工作成果!');
-          return false;
-        }
-        if (this.reportContentsList1[7].weekContentSummary.trim() == '') {
-          this.$toast('请完善本周工作重点!');
-          return false;
-        }
-        if (this.reportContentsList1[7].weekContentSummary.length > 800) {
-          this.$toast('上周工作重点超过800字');
-          return false;
-        }
-        if (this.reportContentsList2[7].weekContentSummary.length > 800) {
-          this.$toast('上周工作成果超过800字!');
-          return false;
-        }
-        this.reportTarget.reportContents = this.reportContentsList2
-          .concat(this.reportContentsList1)
-          .concat(this.reportTarget.reportContents);
-        this.reportTarget.status = '1';
-        this.isclick = false;
-        updateReport(this.reportTarget).then((res) => {
-          loading1.clear();
-          this.isclick = true;
-          if (res.code == 200) {
-            this.$dialog
-              .alert({
-                title: '系统提示',
-                message: '提交成功',
-              })
-              .then(() => {
-                if (this.$route.query.reportId != undefined) {
-                  window.location.replace(window.location.origin + '/mobile/myHistoricalDaily');
-                } else {
-                  this.onClickLeft();
-                  // window.location.replace(window.location.origin + '/mobile/home');
-                }
-              });
+          if (this.reportContentsList1[7].weekContentSummary.trim() == '') {
+            this.$toast('请完善本周工作重点!');
+            return false;
+          }
+          if (this.reportContentsList1[7].weekContentSummary.length > 800) {
+            this.$toast('上周工作重点超过800字');
+            return false;
+          }
+          if (this.reportContentsList2[7].weekContentSummary.length > 800) {
+            this.$toast('上周工作成果超过800字!');
+            return false;
+          }
+          this.reportTarget.reportContents = this.reportContentsList2
+            .concat(this.reportContentsList1)
+            .concat(this.reportTarget.reportContents);
+          this.submintFun();
+        } else {
+          // 新的
+          if (this.reportTarget.customTaskList && this.reportTarget.customTaskList.length) {
+            // 配置任务
+            this.reportCustomTabstoreVal((reportCustomAnswers) => {
+              this.submintFun(reportCustomAnswers);
+            });
           } else {
-            this.$toast.fail(res.msg);
+            // 没有配置任务
+            this.submintFun(null);
           }
-        });
+        }
       }
     },
+    submintFun(reportCustomAnswers) {
+      let loading1 = this.$toast.loading({
+        duration: 0,
+        message: '数据提交中...',
+        forbidClick: true,
+      });
+      if (reportCustomAnswers) this.reportTarget.reportCustomAnswers = reportCustomAnswers;
+      this.reportTarget.status = '1';
+      this.isclick = false;
+      updateReport(this.reportTarget).then((res) => {
+        loading1.clear();
+        this.isclick = true;
+        if (res.code == 200) {
+          this.$dialog
+            .alert({
+              title: '系统提示',
+              message: '提交成功',
+            })
+            .then(() => {
+              if (this.$route.query.reportId != undefined) {
+                window.location.replace(window.location.origin + '/mobile/myHistoricalDaily');
+              } else {
+                this.onClickLeft();
+                // window.location.replace(window.location.origin + '/mobile/home');
+              }
+            });
+        } else {
+          this.$toast.fail(res.msg);
+        }
+      });
+    },
     getReportInfo() {
       let loading1 = this.$toast.loading({
         duration: 0,

+ 78 - 62
src/views/week/weeklyApproval.vue

@@ -17,74 +17,88 @@
           <Atarget :reportInfo="reportTarget"></Atarget>
           <Btarget :reportInfo="reportTarget"></Btarget>
         </template>
-        <van-collapse-item title="上周工作成果" name="8">
-          <div style="margin-top: -10px">
-            <div v-for="(item2, index2) in reportContentsList2" :key="index2">
-              <div v-if="index2 < 7">
-                <p class="texttitle">
+        <div class="contentContainer" v-if="reportTarget.isHistory == '0'">
+          <!-- isHistory 是否为历史汇报:0-新汇报 1-历史汇报 -->
+
+          <reportCustom
+            ref="reportCustom"
+            :disabled="true"
+            :reportCustomData="reportTarget.customTaskList"></reportCustom>
+        </div>
+        <template v-else>
+          <van-collapse-item title="上周工作成果" name="8">
+            <div style="margin-top: -10px">
+              <div v-for="(item2, index2) in reportContentsList2" :key="index2">
+                <div v-if="index2 < 7">
+                  <p class="texttitle">
+                    <span class="opint"></span
+                    ><span v-if="!reportTarget.hideWeekDate">{{
+                      weeklyTimeDivision(item2.contentTime, 0)
+                    }}</span
+                    ><span>{{ weeklyTimeDivision(item2.contentTime, 1) }}</span>
+                  </p>
+                  <p>
+                    <span class="colorbalck">上午:</span
+                    >{{ reportContentsList1[index2].weekContentAm }}
+                  </p>
+                  <p>
+                    <span class="colorbalck">下午:</span
+                    >{{ reportContentsList1[index2].weekContentPm }}
+                  </p>
+                  <p class="texttitle texttitle2">实际工作进度</p>
+                  <p><span class="colorbalck">上午:</span>{{ item2.weekContentAm }}</p>
+                  <p><span class="colorbalck">下午:</span>{{ item2.weekContentPm }}</p>
+                </div>
+                <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作重点</p>
+                <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
+                  <van-field
+                    v-model="reportContentsList1[index2].weekContentSummary"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
+                <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作成果</p>
+                <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
+                  <van-field
+                    v-model="item2.weekContentSummary"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
+              </div>
+            </div>
+          </van-collapse-item>
+          <van-collapse-item title="本周工作规划" name="9">
+            <div style="margin-top: -10px">
+              <div v-for="(item, index) in reportContentsList3" :key="index">
+                <p v-if="index < 7" class="texttitle">
                   <span class="opint"></span
                   ><span v-if="!reportTarget.hideWeekDate">{{
-                    weeklyTimeDivision(item2.contentTime, 0)
+                    weeklyTimeDivision(item.contentTime, 0)
                   }}</span
-                  ><span>{{ weeklyTimeDivision(item2.contentTime, 1) }}</span>
+                  ><span>{{ weeklyTimeDivision(item.contentTime, 1) }}</span>
                 </p>
-                <p>
-                  <span class="colorbalck">上午:</span
-                  >{{ reportContentsList1[index2].weekContentAm }}
+                <p v-if="index < 7">
+                  <span class="colorbalck">上午:</span>{{ item.weekContentAm }}
                 </p>
-                <p>
-                  <span class="colorbalck">下午:</span
-                  >{{ reportContentsList1[index2].weekContentPm }}
+                <p v-if="index < 7">
+                  <span class="colorbalck">下午:</span>{{ item.weekContentPm }}
                 </p>
-                <p class="texttitle texttitle2">实际工作进度</p>
-                <p><span class="colorbalck">上午:</span>{{ item2.weekContentAm }}</p>
-                <p><span class="colorbalck">下午:</span>{{ item2.weekContentPm }}</p>
-              </div>
-              <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作重点</p>
-              <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
-                <van-field
-                  v-model="reportContentsList1[index2].weekContentSummary"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
-              </div>
-              <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作成果</p>
-              <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
-                <van-field
-                  v-model="item2.weekContentSummary"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
-              </div>
-            </div>
-          </div>
-        </van-collapse-item>
-        <van-collapse-item title="本周工作规划" name="9">
-          <div style="margin-top: -10px">
-            <div v-for="(item, index) in reportContentsList3" :key="index">
-              <p v-if="index < 7" class="texttitle">
-                <span class="opint"></span
-                ><span v-if="!reportTarget.hideWeekDate">{{
-                  weeklyTimeDivision(item.contentTime, 0)
-                }}</span
-                ><span>{{ weeklyTimeDivision(item.contentTime, 1) }}</span>
-              </p>
-              <p v-if="index < 7"><span class="colorbalck">上午:</span>{{ item.weekContentAm }}</p>
-              <p v-if="index < 7"><span class="colorbalck">下午:</span>{{ item.weekContentPm }}</p>
-              <p v-if="index == 7" class="texttitle"><span class="opint"></span>本周工作重点</p>
-              <div v-if="index == 7" style="padding: 10px 0" class="contentContainer">
-                <van-field
-                  v-model="item.weekContentSummary"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
+                <p v-if="index == 7" class="texttitle"><span class="opint"></span>本周工作重点</p>
+                <div v-if="index == 7" style="padding: 10px 0" class="contentContainer">
+                  <van-field
+                    v-model="item.weekContentSummary"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
               </div>
             </div>
-          </div>
-        </van-collapse-item>
+          </van-collapse-item>
+        </template>
       </van-collapse>
       <div class="contentContainer">
         <p class="contentContainerTitle">打分 <span>请点亮小星星,一颗小星星代表1分</span></p>
@@ -146,6 +160,7 @@ import moshouqiSAP from '@/views/componentsTarget/moshouqiSAP';
 import fangshuiSAP from '@/views/componentsTarget/fangshuiSAP';
 import Atarget from '@/views/home/Atarget.vue';
 import Btarget from '@/views/home/Btarget.vue';
+import reportCustom from './reportCustom.vue';
 export default {
   name: 'weeklyApproval',
   components: {
@@ -162,6 +177,7 @@ export default {
     fangshuiSAP,
     Atarget,
     Btarget,
+    reportCustom,
   },
   data() {
     return {
@@ -192,7 +208,7 @@ export default {
       powerGrade: '',
       value: '2',
       Content: '',
-      number: '',
+      number: 0,
       timeList: [],
       reportTargetAll: {},
       reportContentsList1: [],
@@ -270,7 +286,7 @@ export default {
         message: '数据提交中...',
         forbidClick: true,
       });
-      if (this.number == '0') {
+      if (this.number == 0) {
         this.$toast('评分未选择');
         return false;
       }

+ 76 - 60
src/views/week/weeklyApprovalDetils.vue

@@ -17,74 +17,88 @@
           <Atarget :reportInfo="reportTarget"></Atarget>
           <Btarget :reportInfo="reportTarget"></Btarget>
         </template>
-        <van-collapse-item title="上周工作成果" name="8">
-          <div style="margin-top: -10px">
-            <div v-for="(item2, index2) in reportContentsList2" :key="index2">
-              <div v-if="index2 < 7">
-                <p class="texttitle">
+        <div class="contentContainer" v-if="reportTarget.isHistory == '0'">
+          <!-- isHistory 是否为历史汇报:0-新汇报 1-历史汇报 -->
+
+          <reportCustom
+            ref="reportCustom"
+            :disabled="true"
+            :reportCustomData="reportTarget.customTaskList"></reportCustom>
+        </div>
+        <template v-else>
+          <van-collapse-item title="上周工作成果" name="8">
+            <div style="margin-top: -10px">
+              <div v-for="(item2, index2) in reportContentsList2" :key="index2">
+                <div v-if="index2 < 7">
+                  <p class="texttitle">
+                    <span class="opint"></span
+                    ><span v-if="!reportTarget.hideWeekDate">{{
+                      weeklyTimeDivision(item2.contentTime, 0)
+                    }}</span
+                    ><span>{{ weeklyTimeDivision(item2.contentTime, 1) }}</span>
+                  </p>
+                  <p>
+                    <span class="colorbalck">上午:</span
+                    >{{ reportContentsList1[index2].weekContentAm }}
+                  </p>
+                  <p>
+                    <span class="colorbalck">下午:</span
+                    >{{ reportContentsList1[index2].weekContentPm }}
+                  </p>
+                  <p class="texttitle texttitle2">实际工作进度</p>
+                  <p><span class="colorbalck">上午:</span>{{ item2.weekContentAm }}</p>
+                  <p><span class="colorbalck">下午:</span>{{ item2.weekContentPm }}</p>
+                </div>
+                <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作重点</p>
+                <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
+                  <van-field
+                    v-model="reportContentsList1[index2].weekContentSummary"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
+                <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作成果</p>
+                <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
+                  <van-field
+                    v-model="item2.weekContentSummary"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
+              </div>
+            </div>
+          </van-collapse-item>
+          <van-collapse-item title="本周工作规划" name="9">
+            <div style="margin-top: -10px">
+              <div v-for="(item, index) in reportContentsList3" :key="index">
+                <p v-if="index < 7" class="texttitle">
                   <span class="opint"></span
                   ><span v-if="!reportTarget.hideWeekDate">{{
-                    weeklyTimeDivision(item2.contentTime, 0)
+                    weeklyTimeDivision(item.contentTime, 0)
                   }}</span
-                  ><span>{{ weeklyTimeDivision(item2.contentTime, 1) }}</span>
+                  ><span>{{ weeklyTimeDivision(item.contentTime, 1) }}</span>
                 </p>
-                <p>
-                  <span class="colorbalck">上午:</span
-                  >{{ reportContentsList1[index2].weekContentAm }}
+                <p v-if="index < 7">
+                  <span class="colorbalck">上午:</span>{{ item.weekContentAm }}
                 </p>
-                <p>
-                  <span class="colorbalck">下午:</span
-                  >{{ reportContentsList1[index2].weekContentPm }}
+                <p v-if="index < 7">
+                  <span class="colorbalck">下午:</span>{{ item.weekContentPm }}
                 </p>
-                <p class="texttitle texttitle2">实际工作进度</p>
-                <p><span class="colorbalck">上午:</span>{{ item2.weekContentAm }}</p>
-                <p><span class="colorbalck">下午:</span>{{ item2.weekContentPm }}</p>
-              </div>
-              <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作重点</p>
-              <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
-                <van-field
-                  v-model="reportContentsList1[index2].weekContentSummary"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
-              </div>
-              <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作成果</p>
-              <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
-                <van-field
-                  v-model="item2.weekContentSummary"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
+                <p v-if="index == 7" class="texttitle"><span class="opint"></span>本周工作重点</p>
+                <div v-if="index == 7" style="padding: 10px 0" class="contentContainer">
+                  <van-field
+                    v-model="item.weekContentSummary"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
               </div>
             </div>
-          </div>
-        </van-collapse-item>
-        <van-collapse-item title="本周工作规划" name="9">
-          <div style="margin-top: -10px">
-            <div v-for="(item, index) in reportContentsList3" :key="index">
-              <p v-if="index < 7" class="texttitle">
-                <span class="opint"></span
-                ><span v-if="!reportTarget.hideWeekDate">{{
-                  weeklyTimeDivision(item.contentTime, 0)
-                }}</span
-                ><span>{{ weeklyTimeDivision(item.contentTime, 1) }}</span>
-              </p>
-              <p v-if="index < 7"><span class="colorbalck">上午:</span>{{ item.weekContentAm }}</p>
-              <p v-if="index < 7"><span class="colorbalck">下午:</span>{{ item.weekContentPm }}</p>
-              <p v-if="index == 7" class="texttitle"><span class="opint"></span>本周工作重点</p>
-              <div v-if="index == 7" style="padding: 10px 0" class="contentContainer">
-                <van-field
-                  v-model="item.weekContentSummary"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
-              </div>
-            </div>
-          </div>
-        </van-collapse-item>
+          </van-collapse-item>
+        </template>
         <div
           class="contentContainer"
           v-if="reportTarget.status > 1 || reportTarget.reportRemarks != null">
@@ -160,6 +174,7 @@ import moshouqiSAP from '@/views/componentsTarget/moshouqiSAP';
 import fangshuiSAP from '@/views/componentsTarget/fangshuiSAP';
 import Atarget from '@/views/home/Atarget.vue';
 import Btarget from '@/views/home/Btarget.vue';
+import reportCustom from './reportCustom.vue';
 
 export default {
   name: 'home',
@@ -177,6 +192,7 @@ export default {
     fangshuiSAP,
     Atarget,
     Btarget,
+    reportCustom,
   },
   data() {
     return {

+ 76 - 60
src/views/week/weeklyHistoricalDetils.vue

@@ -18,74 +18,88 @@
           <Atarget :reportInfo="reportTarget"></Atarget>
           <Btarget :reportInfo="reportTarget"></Btarget>
         </template>
-        <van-collapse-item title="上周工作成果" name="8">
-          <div style="margin-top: -10px">
-            <div v-for="(item2, index2) in reportContentsList2" :key="index2">
-              <div v-if="index2 < 7">
-                <p class="texttitle">
+        <div class="contentContainer" v-if="reportTarget.isHistory == '0'">
+          <!-- isHistory 是否为历史汇报:0-新汇报 1-历史汇报 -->
+
+          <reportCustom
+            ref="reportCustom"
+            :disabled="true"
+            :reportCustomData="reportTarget.customTaskList"></reportCustom>
+        </div>
+        <template v-else>
+          <van-collapse-item title="上周工作成果" name="8">
+            <div style="margin-top: -10px">
+              <div v-for="(item2, index2) in reportContentsList2" :key="index2">
+                <div v-if="index2 < 7">
+                  <p class="texttitle">
+                    <span class="opint"></span
+                    ><span v-if="!reportTarget.hideWeekDate">{{
+                      weeklyTimeDivision(item2.contentTime, 0)
+                    }}</span
+                    ><span>{{ weeklyTimeDivision(item2.contentTime, 1) }}</span>
+                  </p>
+                  <p>
+                    <span class="colorbalck">上午:</span
+                    >{{ reportContentsList1[index2].weekContentAm }}
+                  </p>
+                  <p>
+                    <span class="colorbalck">下午:</span
+                    >{{ reportContentsList1[index2].weekContentPm }}
+                  </p>
+                  <p class="texttitle texttitle2">实际工作进度</p>
+                  <p><span class="colorbalck">上午:</span>{{ item2.weekContentAm }}</p>
+                  <p><span class="colorbalck">下午:</span>{{ item2.weekContentPm }}</p>
+                </div>
+                <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作重点</p>
+                <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
+                  <van-field
+                    v-model="reportContentsList1[index2].weekContentSummary"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
+                <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作成果</p>
+                <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
+                  <van-field
+                    v-model="item2.weekContentSummary"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
+              </div>
+            </div>
+          </van-collapse-item>
+          <van-collapse-item title="本周工作规划" name="9">
+            <div style="margin-top: -10px">
+              <div v-for="(item, index) in reportContentsList3" :key="index">
+                <p v-if="index < 7" class="texttitle">
                   <span class="opint"></span
                   ><span v-if="!reportTarget.hideWeekDate">{{
-                    weeklyTimeDivision(item2.contentTime, 0)
+                    weeklyTimeDivision(item.contentTime, 0)
                   }}</span
-                  ><span>{{ weeklyTimeDivision(item2.contentTime, 1) }}</span>
+                  ><span>{{ weeklyTimeDivision(item.contentTime, 1) }}</span>
                 </p>
-                <p>
-                  <span class="colorbalck">上午:</span
-                  >{{ reportContentsList1[index2].weekContentAm }}
+                <p v-if="index < 7">
+                  <span class="colorbalck">上午:</span>{{ item.weekContentAm }}
                 </p>
-                <p>
-                  <span class="colorbalck">下午:</span
-                  >{{ reportContentsList1[index2].weekContentPm }}
+                <p v-if="index < 7">
+                  <span class="colorbalck">下午:</span>{{ item.weekContentPm }}
                 </p>
-                <p class="texttitle texttitle2">实际工作进度</p>
-                <p><span class="colorbalck">上午:</span>{{ item2.weekContentAm }}</p>
-                <p><span class="colorbalck">下午:</span>{{ item2.weekContentPm }}</p>
-              </div>
-              <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作重点</p>
-              <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
-                <van-field
-                  v-model="reportContentsList1[index2].weekContentSummary"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
-              </div>
-              <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作成果</p>
-              <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
-                <van-field
-                  v-model="item2.weekContentSummary"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
+                <p v-if="index == 7" class="texttitle"><span class="opint"></span>本周工作重点</p>
+                <div v-if="index == 7" style="padding: 10px 0" class="contentContainer">
+                  <van-field
+                    v-model="item.weekContentSummary"
+                    rows="4"
+                    autosize
+                    readonly
+                    type="textarea" />
+                </div>
               </div>
             </div>
-          </div>
-        </van-collapse-item>
-        <van-collapse-item title="本周工作规划" name="9">
-          <div style="margin-top: -10px">
-            <div v-for="(item, index) in reportContentsList3" :key="index">
-              <p v-if="index < 7" class="texttitle">
-                <span class="opint"></span
-                ><span v-if="!reportTarget.hideWeekDate">{{
-                  weeklyTimeDivision(item.contentTime, 0)
-                }}</span
-                ><span>{{ weeklyTimeDivision(item.contentTime, 1) }}</span>
-              </p>
-              <p v-if="index < 7"><span class="colorbalck">上午:</span>{{ item.weekContentAm }}</p>
-              <p v-if="index < 7"><span class="colorbalck">下午:</span>{{ item.weekContentPm }}</p>
-              <p v-if="index == 7" class="texttitle"><span class="opint"></span>本周工作重点</p>
-              <div v-if="index == 7" style="padding: 10px 0" class="contentContainer">
-                <van-field
-                  v-model="item.weekContentSummary"
-                  rows="4"
-                  autosize
-                  readonly
-                  type="textarea" />
-              </div>
-            </div>
-          </div>
-        </van-collapse-item>
+          </van-collapse-item>
+        </template>
       </van-collapse>
       <div
         class="contentContainer"
@@ -172,6 +186,7 @@ import moshouqiSAP from '@/views/componentsTarget/moshouqiSAP';
 import fangshuiSAP from '@/views/componentsTarget/fangshuiSAP';
 import Atarget from '@/views/home/Atarget.vue';
 import Btarget from '@/views/home/Btarget.vue';
+import reportCustom from './reportCustom.vue';
 export default {
   name: 'home',
   components: {
@@ -188,6 +203,7 @@ export default {
     fangshuiSAP,
     Atarget,
     Btarget,
+    reportCustom,
   },
   data() {
     return {