浏览代码

主管任务暂存

zhujindu 5 月之前
父节点
当前提交
9713d743f1
共有 3 个文件被更改,包括 106 次插入29 次删除
  1. 9 0
      src/api/index.js
  2. 38 6
      src/views/week/VisitSummary.vue
  3. 59 23
      src/views/week/VisitSummaryAdd.vue

+ 9 - 0
src/api/index.js

@@ -1013,3 +1013,12 @@ export function chainsList(query) {
     params: query,
   });
 }
+
+// 主管任务答案暂存接口(同主管任务答案保存接口一致,但是接口不校验答案是否必填)
+export function temporarilyCustomAnswer(data) {
+  return request({
+    url: 'mobile/summaryMobile/temporarilyCustomAnswer',
+    method: 'post',
+    data: data,
+  });
+}

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

@@ -46,6 +46,13 @@
             @click="approvalStatusShow = true"
             arrow-direction="down" />
         </van-col>
+        <van-col span="12">
+          <van-cell
+            :title="storageStatus.text"
+            is-link
+            @click="storageStatusShow = true"
+            arrow-direction="down" />
+        </van-col>
       </van-row>
       <br />
       <van-button type="info" size="small" plain class="Btn100" @click="searchBtn">查找</van-button>
@@ -72,12 +79,16 @@
                 <p class="textLeft">{{ item.nickName }}的{{ item.summaryTaskName }}</p>
                 <div class="approvalStatusBtn" v-if="item.approvalStatus">
                   <span class="approvalStatusBtn1" v-if="item.approvalStatus == '2'">审批通过</span>
-                  <span class="approvalStatusBtn2" v-if="item.approvalStatus == '1'"
-                    >提交待审批</span
-                  >
-                  <span class="approvalStatusBtn3" v-if="item.approvalStatus == '3'"
-                    >拒绝待提交</span
-                  >
+                  <span class="approvalStatusBtn2" v-if="item.approvalStatus == '1'">
+                    提交待审批
+                  </span>
+                  <span class="approvalStatusBtn3" v-if="item.approvalStatus == '3'">
+                    拒绝待提交
+                  </span>
+                </div>
+                <div class="approvalStatusBtn" v-if="item.status">
+                  <span class="approvalStatusBtn1" v-if="item.status == '0'">审批通过</span>
+                  <span class="approvalStatusBtn2" v-if="item.status == '1'">提交待审批</span>
                 </div>
               </div>
               <div class="info">部门:{{ item.deptName }}</div>
@@ -151,6 +162,14 @@
         @confirm="onSalesApprovalStatus"
         @cancel="approvalStatusShow = false" />
     </van-popup>
+    <!-- status:状态:1-待审批 2-审批通过 3-拒绝待提交 -->
+    <van-popup v-model="storageStatusShow" capture position="bottom">
+      <van-picker
+        show-toolbar
+        :columns="storageStatusList"
+        @confirm="onStorageStatus"
+        @cancel="storageStatusShow = false" />
+    </van-popup>
   </div>
 </template>
 
@@ -212,10 +231,18 @@ export default {
         { text: '拒绝待提交', value: '3' },
       ],
       approvalStatus: { text: '审批状态(全部)', value: '' },
+      storageStatus: { text: '已提交', value: '1' },
+      storageStatusList: [
+        // 0-暂存,1-已提交
+        { text: '已提交', value: '1' },
+        { text: '暂存', value: '0' },
+      ],
+      storageStatusShow: false,
     };
   },
   activated() {
     this.approvalStatus = this.approvalStatusList[0];
+    this.storageStatus = this.storageStatusList[0];
     this.userList = [];
     this.formData.startTime = this.getThreeDaysAgo();
     // this.formData.startTime = this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'),2)
@@ -346,6 +373,7 @@ export default {
       this.formData.deptId = this.deptCode; // 部门id,如果为周报或日报为必传  Long类型
       this.formData.userId = this.userCode; // 业务员id,如果为日报为必传      Long类型
       this.formData.approvalStatus = this.approvalStatus.value;
+      this.formData.status = this.storageStatus.value;
       queryHistorySummaryList(this.formData).then((res) => {
         loading1.clear();
         if (res.code == 200) {
@@ -585,6 +613,10 @@ export default {
       this.approvalStatus = val;
       this.approvalStatusShow = false;
     },
+    onStorageStatus(val) {
+      this.storageStatus = val;
+      this.storageStatusShow = false;
+    },
   },
 };
 </script>

+ 59 - 23
src/views/week/VisitSummaryAdd.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="bgcolor">
+  <div class="bgcolor VisitSummaryAdd">
     <!--        顶部条-->
 
     <!--        顶部条-->
@@ -194,6 +194,7 @@
     </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="info" color="#0057ba" @click="onSubmit">
         提交汇报
       </van-button>
@@ -288,6 +289,7 @@ import {
   getSummaryMobileDeptInfo,
   getDeptsByUser,
   chainsList,
+  temporarilyCustomAnswer,
 } from '@/api/index';
 import zRadio from '@/components/zRadio2';
 import zCheckbox from '@/components/zCheckbox2';
@@ -463,6 +465,32 @@ export default {
     },
     onLoad() {},
     onSubmit() {
+      this.setParams(() => {
+        if (this.flagclick) {
+          this.flagclick = false;
+          this.timer = null;
+          this.timer = setTimeout(() => {
+            this.flagclick = true;
+          }, 2000);
+          insertCustomAnswer({
+            userSummaryId: '', //	Long	用户总结id,如果为新增则不填,编辑则必填
+            summaryId: this.$route.query.summaryId, //Long	主管任务id
+            customItemList: this.collectionItemList, //List<Object>	答案列表
+          })
+            .then((res) => {
+              if (res.code == 200) {
+                this.$router.go(-1);
+              } else {
+                this.$toast(res.msg);
+              }
+            })
+            .catch((err) => {
+              this.$toast(err.msg);
+            });
+        }
+      });
+    },
+    setParams(callback) {
       for (var c = 0; c < this.collectionAnswerlisd.length; c++) {
         for (var b = 0; b < this.collectionItemList.length; b++) {
           if (this.collectionAnswerlisd[c].id == this.collectionItemList[b].customId) {
@@ -491,28 +519,7 @@ export default {
       //   });
       //   JXSSataList.chainList = fileIdList;
       // }
-      if (this.flagclick) {
-        this.flagclick = false;
-        this.timer = null;
-        this.timer = setTimeout(() => {
-          this.flagclick = true;
-        }, 2000);
-        insertCustomAnswer({
-          userSummaryId: '', //	Long	用户总结id,如果为新增则不填,编辑则必填
-          summaryId: this.$route.query.summaryId, //Long	主管任务id
-          customItemList: this.collectionItemList, //List<Object>	答案列表
-        })
-          .then((res) => {
-            if (res.code == 200) {
-              this.$router.go(-1);
-            } else {
-              this.$toast(res.msg);
-            }
-          })
-          .catch((err) => {
-            this.$toast(err.msg);
-          });
-      }
+      callback && callback();
     },
     getReportInfo() {
       let loading1 = this.$toast.loading({
@@ -929,6 +936,26 @@ 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>
@@ -987,6 +1014,15 @@ export default {
 .z-cell .van-cell__title {
   font-size: 16px;
 }
+.VisitSummaryAdd {
+  .tc {
+    display: flex;
+    justify-content: space-between;
+    .submitBtn {
+      width: 45%;
+    }
+  }
+}
 </style>
 <style lang="scss">
 .table-headermd {