Browse Source

Merge branch 'feature_20250603_主管任务增加经销商选项' into release

# Conflicts:
#	src/views/week/VisitSummaryAdd.vue
zhujindu 5 months ago
parent
commit
2cec38f842

+ 9 - 0
src/api/index.js

@@ -986,3 +986,12 @@ export function getDeptsByUser(query) {
     params: query,
   });
 }
+
+// 获取管辖经销商接口
+export function chainsList(query) {
+  return request({
+    url: '/mobile/chains/list',
+    method: 'get',
+    params: query,
+  });
+}

+ 48 - 2
src/views/week/SUPTaskApproval/detailItem.vue

@@ -121,6 +121,27 @@
             :zRadiocolumns="item.customOptionList"
             @zSelectVal="zSelectVal"></z-radio>
         </div>
+        <div v-if="item.answerType == 'jxs'" class="formLabel z-cell">
+          <van-cell>
+            <template #title>
+              <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
+            </template>
+          </van-cell>
+          <div class="jxsBox">
+            <div class="jxsContent">
+              <div class="item" v-for="(val, index) in item.chainList">
+                <el-popover
+                  placement="bottom"
+                  trigger="click"
+                  :content="val.chainName + '(' + val.chainCode + ')'">
+                  <template slot="reference">
+                    <div class="selectItem">{{ val.chainName }} &nbsp; ({{ val.chainCode }})</div>
+                  </template>
+                </el-popover>
+              </div>
+            </div>
+          </div>
+        </div>
         <br />
       </div>
     </van-form>
@@ -298,7 +319,7 @@ export default {
     },
     onConfirm(date) {
       this.showCalendar = false;
-      this.collectionItemList[this.dateIndex].answerName = this.formatDate(date);
+      this.collectionItemList[this.dateIndex].answerValue = this.formatDate(date);
     },
     formatter(value) {
       return value.replace(
@@ -759,7 +780,32 @@ export default {
   }
 }
 </style>
-<style>
+<style lang="scss">
+.jxsBox {
+  .jxsContent {
+    margin-bottom: 10px;
+    .item {
+      padding: 5px;
+      background: #e9e9e9;
+      margin: 5px 0;
+      .el-popover__reference-wrapper {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+      }
+      .selectItem {
+        flex: 1;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        font-size: 14px;
+      }
+    }
+  }
+  .tips {
+    text-align: right;
+  }
+}
 .table-headermd {
   font-size: 12px;
   text-align: center;

+ 114 - 91
src/views/week/VisitSummary.vue

@@ -39,7 +39,7 @@
             <van-field v-model="formData.summaryTaskName" placeholder="请输入任务名称" />
           </van-cell>
         </van-col>
-        <van-col span="24">
+        <van-col span="12">
           <van-cell
             :title="approvalStatus.text"
             is-link
@@ -70,22 +70,20 @@
             <div class="cardContent" @click="dailyFn(item)">
               <div class="title">
                 <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
+                  >
+                </div>
               </div>
               <div class="info">部门:{{ item.deptName }}</div>
               <div class="info">提交时间:{{ item.createTime }}</div>
             </div>
           </van-cell>
-          <div class="approvalStatusBtn" v-if="item.approvalStatus">
-            <van-button type="primary" size="small" v-if="item.approvalStatus == '2'"
-              >审批通过</van-button
-            >
-            <van-button type="info" size="small" v-if="item.approvalStatus == '1'"
-              >提交待审批</van-button
-            >
-            <van-button color="red" size="small" v-if="item.approvalStatus == '3'"
-              >拒绝待提交</van-button
-            >
-          </div>
         </div>
         <van-empty v-if="list.length == 0" />
       </van-list>
@@ -590,103 +588,128 @@ export default {
   },
 };
 </script>
-<style>
-.cardContent {
-  padding: 0;
-  box-sizing: border-box;
-}
+<style lang="scss">
+.VisitSummary {
+  .cardContent {
+    padding: 0;
+    box-sizing: border-box;
+  }
 
-.cardContent .title {
-  font-size: 15px;
-  font-weight: bold;
-  color: #333;
-  line-height: 22px;
-}
+  .cardContent .title {
+    font-size: 15px;
+    font-weight: bold;
+    color: #333;
+    line-height: 22px;
+    display: flex;
+    justify-content: space-between;
+  }
 
-.cardContent .title p {
-  padding: 0;
-  margin: 0;
-}
+  .cardContent .title p {
+    padding: 0;
+    margin: 0;
+  }
 
-.cardContent .title .textLeft {
-  display: inline-block;
-  padding-bottom: 10px;
-}
+  .cardContent .title .textLeft {
+    display: inline-block;
+    padding-bottom: 10px;
+  }
 
-.cardContent .title .textRight {
-  float: right;
-  color: #0057ba;
-}
+  .cardContent .title .textRight {
+    float: right;
+    color: #0057ba;
+  }
 
-.cardContent .info {
-  font-size: 14px;
-  color: #666;
-  line-height: 26px;
-}
+  .cardContent .info {
+    font-size: 14px;
+    color: #666;
+    line-height: 26px;
+  }
 
-.search-icon {
-  font-size: 16px;
-  line-height: inherit;
-  margin-top: 4px;
-}
+  .search-icon {
+    font-size: 16px;
+    line-height: inherit;
+    margin-top: 4px;
+  }
 
-.brud {
-  margin: 16px;
-  border-radius: 8px;
-  overflow: hidden;
-}
+  .brud {
+    margin: 16px;
+    border-radius: 8px;
+    overflow: hidden;
+  }
 
-.contentpd16 {
-  padding: 16px;
-  background-color: white;
-}
+  .contentpd16 {
+    padding: 16px;
+    background-color: white;
+  }
 
-.Btn100 {
-  margin: 0 auto 10px;
-  display: block;
-  width: 100%;
-  border-radius: 5px;
-  color: #fff !important;
-  background-color: #0057ba;
-  border: 1px solid #0057ba;
-  height: 36px;
-}
+  .Btn100 {
+    margin: 0 auto 10px;
+    display: block;
+    width: 100%;
+    border-radius: 5px;
+    color: #fff !important;
+    background-color: #0057ba;
+    border: 1px solid #0057ba;
+    height: 36px;
+  }
 
-.contentpd16 .van-cell {
-  background-color: #ebf4ff;
-  margin: 8px 0;
-  border-radius: 5px;
-  padding: 4px 16px;
-}
-.elTreeTableLsiy th.el-table__cell > .cell {
-  text-align: center;
-}
-.elTreeTableLsiy td.el-table__cell div {
-  text-align: right;
-}
-.elTreeTableLsiy .el-table__cell {
-  padding: 2px 0;
-}
-.elTreeTableLsiy .el-table__cell:first-child .cell {
-  text-align: center;
-}
-.contentpd16 .inputSearch .van-cell {
-  padding: 0;
-  margin: 4px 0;
+  .contentpd16 .van-cell {
+    background-color: #ebf4ff;
+    margin: 8px 0;
+    border-radius: 5px;
+    padding: 4px 16px;
+  }
+  .elTreeTableLsiy th.el-table__cell > .cell {
+    text-align: center;
+  }
+  .elTreeTableLsiy td.el-table__cell div {
+    text-align: right;
+  }
+  .elTreeTableLsiy .el-table__cell {
+    padding: 2px 0;
+  }
+  .elTreeTableLsiy .el-table__cell:first-child .cell {
+    text-align: center;
+  }
+  .contentpd16 .inputSearch .van-cell {
+    padding: 0;
+    margin: 4px 0;
+  }
 }
 </style>
-<style scoped lang="scss">
+<style lang="scss">
 .VisitSummary {
   .brud {
     position: relative;
   }
   .approvalStatusBtn {
-    position: absolute;
-    bottom: 40px;
-    right: 10px;
-    .van-button {
+    span {
+      color: #fff;
       border-radius: 5px;
-      width: 78px;
+      display: inline-block;
+      padding: 3px 5px;
+      font-size: 14px;
+      width: 80px;
+      text-align: center;
+    }
+    .approvalStatusBtn1 {
+      background-color: #12ea7a;
+    }
+    .approvalStatusBtn2 {
+      background-color: rgb(112, 33, 239);
+    }
+    .approvalStatusBtn3 {
+      background-color: red;
+    }
+  }
+  .van-cell__title {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    span {
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
     }
   }
 }

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

@@ -162,15 +162,39 @@
               :zRadiocolumns="item.customOptionList"
               @zSelectVal="zSelectVal"></z-radio>
           </div>
+          <div v-if="item.answerType == 'jxs'" class="formLabel z-cell">
+            <van-cell>
+              <template #title>
+                <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
+              </template>
+            </van-cell>
+            <div class="jxsBox">
+              <div class="jxsContent">
+                <div class="item" v-for="(val, index) in item.chainList">
+                  <el-popover
+                    placement="bottom"
+                    trigger="click"
+                    :content="val.chainName + '(' + val.chainCode + ')'">
+                    <template slot="reference">
+                      <div class="selectItem">{{ val.chainName }} &nbsp; ({{ val.chainCode }})</div>
+                      <van-icon name="clear" size="16" @click="closeJXS(item, index)" />
+                    </template>
+                  </el-popover>
+                </div>
+              </div>
+              <div class="addJXS"><van-icon name="add-o" size="24" @click="addJXS" /></div>
+              <div class="tips">{{ item.remark }}</div>
+            </div>
+          </div>
           <br />
         </div>
       </van-form>
     </div>
     <br />
     <div class="tc" style="padding: 0 16px">
-      <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit"
-        >提交汇报</van-button
-      >
+      <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">
+        提交汇报
+      </van-button>
     </div>
     <br />
     <van-calendar
@@ -224,6 +248,32 @@
         @cancel="EndTimeShow = false"
         @confirm="onEndTimeConfirm" />
     </van-popup>
+    <!-- 经销商 -->
+    <van-popup v-model="moreTypeShow" position="bottom">
+      <van-row style="background-color: #f5f5f5">
+        <van-col span="20">
+          <van-field
+            left-icon="search"
+            style="margin-top: 2px; border-radius: 6px; overflow: hidden"
+            v-model="agentValue"
+            label=""
+            placeholder="请输入关键词"
+            clearable />
+        </van-col>
+        <van-col
+          span="4"
+          style="text-align: center; line-height: 48px"
+          @click="getChainsList(agentValue)">
+          <div style="background-color: #0057ba; color: #fff">搜索</div>
+        </van-col>
+      </van-row>
+      <van-picker
+        show-toolbar
+        :columns="chainsData"
+        value-key="chainName"
+        @confirm="onConfirmChainsList"
+        @cancel="moreTypeShow = false" />
+    </van-popup>
   </div>
 </template>
 
@@ -235,6 +285,7 @@ import {
   getDeptInfo,
   getSummaryMobileDeptInfo,
   getDeptsByUser,
+  chainsList,
 } from '@/api/index';
 import zRadio from '@/components/zRadio2';
 import zCheckbox from '@/components/zCheckbox2';
@@ -300,6 +351,12 @@ export default {
       flagclick: true,
       index: '',
       activaFlag: true,
+      moreTypeShow: false,
+      agentValue: '',
+      chainsData: [],
+      chainName: '',
+      chainCode: '',
+      jxsList: [],
     };
   },
   created() {
@@ -420,6 +477,18 @@ export default {
         });
         zpDataList.fileIdList = fileIdList;
       }
+      // 经销商
+      // let JXSSataList = this.collectionItemList.find((item) => item.answerType == 'jxs');
+      // if (this.jxsList.length) {
+      //   let fileIdList = [];
+      //   this.jxsList.forEach((item) => {
+      //     fileIdList.push({
+      //       chainCode: item.chainCode,
+      //       chainName: item.chainName,
+      //     });
+      //   });
+      //   JXSSataList.chainList = fileIdList;
+      // }
       if (this.flagclick) {
         this.flagclick = false;
         this.timer = null;
@@ -813,10 +882,55 @@ export default {
       this.formData.pageNum = 1;
       this.EndTimeShow = false;
     },
+    // 添加经销商
+    addJXS() {
+      this.agentValue = '';
+      this.moreTypeShow = true;
+      this.getChainsList();
+    },
+    // 删除经销商
+    closeJXS(item, index) {
+      item.chainList.splice(index, 1);
+    },
+    getChainsList(value = '') {
+      this.chainsData = [];
+      chainsList({
+        chainCode: '', //	string	经销商编码
+        chainName: value, //	string	经销商名称
+      })
+        .then((res) => {
+          if (res.code == 200 && res.rows) {
+            this.chainsData = res.rows;
+          } else {
+            this.chainsData = [];
+          }
+        })
+        .catch(() => {
+          this.chainsData = [];
+        });
+    },
+    onConfirmChainsList(value) {
+      if (value && value.chainName != undefined) {
+        let JXSSataList = this.collectionItemList.find((item) => item.answerType == 'jxs');
+        if (!JXSSataList.chainList) {
+          JXSSataList.chainList = [];
+        }
+        let isFlag = JXSSataList.chainList.find((val) => val.chainCode == value.chainCode);
+        if (!isFlag) {
+          JXSSataList.chainList.push({
+            chainName: value.chainName,
+            chainCode: value.chainCode,
+          });
+          this.moreTypeShow = false;
+        } else {
+          this.$toast('当前经销商已添加,不能重复添加!');
+        }
+      }
+    },
   },
 };
 </script>
-<style scoped>
+<style scoped lang="scss">
 .container {
   background-color: white;
 }
@@ -872,7 +986,7 @@ export default {
   font-size: 16px;
 }
 </style>
-<style>
+<style lang="scss">
 .table-headermd {
   font-size: 12px;
   text-align: center;
@@ -969,4 +1083,29 @@ export default {
   margin: 0;
   margin-top: -10px;
 }
+.jxsBox {
+  .jxsContent {
+    margin-bottom: 10px;
+    .item {
+      padding: 5px;
+      background: #e9e9e9;
+      margin: 5px 0;
+      .el-popover__reference-wrapper {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+      }
+      .selectItem {
+        flex: 1;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        font-size: 14px;
+      }
+    }
+  }
+  .tips {
+    text-align: right;
+  }
+}
 </style>

+ 4 - 1
src/views/week/VisitSummaryDetail.vue

@@ -73,7 +73,10 @@
     <br />
     <!-- 从查询列表来 -->
     <!-- approvalStatus//1-待审批 2-审批通过 3-拒绝待提交 -->
-    <div class="tc" style="padding: 0 16px" v-if="writeAgain && !info.approvalStatus">
+    <div
+      class="tc"
+      style="padding: 0 16px"
+      v-if="writeAgain && (!info.approvalStatus || info.approvalStatus == '1')">
       <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">
         补填保存
       </van-button>

+ 155 - 7
src/views/week/allowWriteAgainSummary.vue

@@ -32,7 +32,7 @@
             placeholder="点击选择日期"
             readonly
             :disabled="!item.allowWriteAgain"
-            @click="showCalendarClick(index)" />
+            @click="showCalendarClick(item, index)" />
           <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
             {{ item.remark }}
           </p>
@@ -122,6 +122,36 @@
             :zRadiocolumns="item.customOptionList"
             @zSelectVal="zSelectVal"></z-radio>
         </div>
+        <div v-if="item.answerType == 'jxs'" class="formLabel z-cell">
+          <van-cell>
+            <template #title>
+              <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
+            </template>
+          </van-cell>
+          <div class="jxsBox">
+            <div class="jxsContent">
+              <div class="item" v-for="(val, index) in item.chainList">
+                <el-popover
+                  placement="bottom"
+                  trigger="click"
+                  :content="val.chainName + '(' + val.chainCode + ')'">
+                  <template slot="reference">
+                    <div class="selectItem">{{ val.chainName }} &nbsp; ({{ val.chainCode }})</div>
+                    <van-icon
+                      name="clear"
+                      size="16"
+                      @click="closeJXS(item, index)"
+                      v-if="item.allowWriteAgain" />
+                  </template>
+                </el-popover>
+              </div>
+            </div>
+            <div class="addJXS">
+              <van-icon name="add-o" size="24" @click="addJXS" v-if="item.allowWriteAgain" />
+            </div>
+            <div class="tips" v-if="item.allowWriteAgain">{{ item.remark }}</div>
+          </div>
+        </div>
         <br />
       </div>
     </van-form>
@@ -176,11 +206,42 @@
         @cancel="EndTimeShow = false"
         @confirm="onEndTimeConfirm" />
     </van-popup>
+    <!-- 经销商 -->
+    <van-popup v-model="moreTypeShow" position="bottom">
+      <van-row style="background-color: #f5f5f5">
+        <van-col span="20">
+          <van-field
+            left-icon="search"
+            style="margin-top: 2px; border-radius: 6px; overflow: hidden"
+            v-model="agentValue"
+            label=""
+            placeholder="请输入关键词"
+            clearable />
+        </van-col>
+        <van-col
+          span="4"
+          style="text-align: center; line-height: 48px"
+          @click="getChainsList(agentValue)">
+          <div style="background-color: #0057ba; color: #fff">搜索</div>
+        </van-col>
+      </van-row>
+      <van-picker
+        show-toolbar
+        :columns="chainsData"
+        value-key="chainName"
+        @confirm="onConfirmChainsList"
+        @cancel="moreTypeShow = false" />
+    </van-popup>
   </div>
 </template>
 
 <script>
-import { insertCustomAnswer, getSummaryMobileDeptInfo, getDeptsByUser } from '@/api/index';
+import {
+  insertCustomAnswer,
+  getSummaryMobileDeptInfo,
+  getDeptsByUser,
+  chainsList,
+} from '@/api/index';
 import zRadio from '@/components/zRadio2';
 import zCheckbox from '@/components/zCheckbox2';
 import uploadImg from '@/components/uploadVTask';
@@ -251,6 +312,12 @@ export default {
       flagclick: true,
       index: '',
       activaFlag: true,
+      moreTypeShow: false,
+      agentValue: '',
+      chainsData: [],
+      chainName: '',
+      chainCode: '',
+      jxsList: [],
     };
   },
   created() {
@@ -273,9 +340,9 @@ export default {
     },
   },
   methods: {
-    showCalendarClick(val) {
-      if (!val.allowWriteAgain) return;
-      this.dateIndex = val;
+    showCalendarClick(item, index) {
+      if (!item.allowWriteAgain) return;
+      this.dateIndex = index;
       this.showCalendar = true;
     },
     formatDate(date) {
@@ -291,7 +358,7 @@ export default {
     },
     onConfirm(date) {
       this.showCalendar = false;
-      this.collectionItemList[this.dateIndex].answerName = this.formatDate(date);
+      this.collectionItemList[this.dateIndex].answerValue = this.formatDate(date);
     },
     formatter(value) {
       return value.replace(
@@ -435,6 +502,17 @@ export default {
           });
           this.collectionItemList[q].fileIdList = fileIdList;
         }
+        // 照片
+        if (
+          this.collectionItemList[q].answerType == 'jxs' &&
+          this.collectionItemList[q].chainList
+        ) {
+          // let fileIdList = [];
+          // this.collectionItemList[q].fileInfoList.forEach((item) => {
+          //   fileIdList.push(item.id);
+          // });
+          this.jxsList = this.collectionItemList[q].chainList;
+        }
       }
     },
     getThreeDaysAgo() {
@@ -695,6 +773,51 @@ export default {
       this.formData.pageNum = 1;
       this.EndTimeShow = false;
     },
+    // 添加经销商
+    addJXS() {
+      this.agentValue = '';
+      this.moreTypeShow = true;
+      this.getChainsList();
+    },
+    // 删除经销商
+    closeJXS(item, index) {
+      item.chainList.splice(index, 1);
+    },
+    getChainsList(value = '') {
+      this.chainsData = [];
+      chainsList({
+        chainCode: '', //	string	经销商编码
+        chainName: value, //	string	经销商名称
+      })
+        .then((res) => {
+          if (res.code == 200 && res.rows) {
+            this.chainsData = res.rows;
+          } else {
+            this.chainsData = [];
+          }
+        })
+        .catch(() => {
+          this.chainsData = [];
+        });
+    },
+    onConfirmChainsList(value) {
+      if (value && value.chainName != undefined) {
+        let JXSSataList = this.collectionItemList.find((item) => item.answerType == 'jxs');
+        if (!JXSSataList.chainList) {
+          JXSSataList.chainList = [];
+        }
+        let isFlag = JXSSataList.chainList.find((val) => val.chainCode == value.chainCode);
+        if (!isFlag) {
+          JXSSataList.chainList.push({
+            chainName: value.chainName,
+            chainCode: value.chainCode,
+          });
+          this.moreTypeShow = false;
+        } else {
+          this.$toast('当前经销商已添加,不能重复添加!');
+        }
+      }
+    },
   },
 };
 </script>
@@ -752,7 +875,32 @@ export default {
   }
 }
 </style>
-<style>
+<style lang="scss">
+.jxsBox {
+  .jxsContent {
+    margin-bottom: 10px;
+    .item {
+      padding: 5px;
+      background: #e9e9e9;
+      margin: 5px 0;
+      .el-popover__reference-wrapper {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+      }
+      .selectItem {
+        flex: 1;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        font-size: 14px;
+      }
+    }
+  }
+  .tips {
+    text-align: right;
+  }
+}
 .table-headermd {
   font-size: 12px;
   text-align: center;

+ 137 - 9
src/views/week/componVisitSummary.vue

@@ -44,10 +44,7 @@
             <p style="margin-top: 0">
               <span style="font-size: 12px; color: #888">{{ item.remark }}</span>
             </p>
-            <delete-upload-img
-              :isDelete="false"
-              :imgs="item.fileInfoList"
-              :isEdit="item.allowWriteAgain"></delete-upload-img>
+            <delete-upload-img :isDelete="false" :imgs="item.fileInfoList"></delete-upload-img>
             <upload-img
               :uploadid="uploadid2"
               @newimgarr="newimgarr1"
@@ -151,6 +148,32 @@
             :zRadiocolumns="item.customOptionList"
             @zSelectVal="zSelectVal"></z-radio>
         </div>
+        <div v-if="item.answerType == 'jxs'" class="formLabel z-cell">
+          <van-cell>
+            <template #title>
+              <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
+            </template>
+          </van-cell>
+          <div class="jxsBox">
+            <div class="jxsContent">
+              <div class="item" v-for="(val, index) in item.chainList">
+                <el-popover
+                  placement="bottom"
+                  trigger="click"
+                  :content="val.chainName + '(' + val.chainCode + ')'">
+                  <template slot="reference">
+                    <div class="selectItem">{{ val.chainName }} &nbsp; ({{ val.chainCode }})</div>
+                    <van-icon name="clear" size="16" @click="closeJXS(item, index)" />
+                  </template>
+                </el-popover>
+              </div>
+            </div>
+            <div class="addJXS">
+              <van-icon name="add-o" size="24" @click="addJXS" />
+            </div>
+            <div class="tips">{{ item.remark }}</div>
+          </div>
+        </div>
         <br />
       </div>
     </van-form>
@@ -203,13 +226,43 @@
         title="选择查找结束时间"
         type="date"
         @cancel="EndTimeShow = false"
-        @confirm="onEndTimeConfirm" />
+        @confirm="onEndTimeConfirm" /> </van-popup
+    ><!-- 经销商 -->
+    <van-popup v-model="moreTypeShow" position="bottom">
+      <van-row style="background-color: #f5f5f5">
+        <van-col span="20">
+          <van-field
+            left-icon="search"
+            style="margin-top: 2px; border-radius: 6px; overflow: hidden"
+            v-model="agentValue"
+            label=""
+            placeholder="请输入关键词"
+            clearable />
+        </van-col>
+        <van-col
+          span="4"
+          style="text-align: center; line-height: 48px"
+          @click="getChainsList(agentValue)">
+          <div style="background-color: #0057ba; color: #fff">搜索</div>
+        </van-col>
+      </van-row>
+      <van-picker
+        show-toolbar
+        :columns="chainsData"
+        value-key="chainName"
+        @confirm="onConfirmChainsList"
+        @cancel="moreTypeShow = false" />
     </van-popup>
   </div>
 </template>
 
 <script>
-import { insertCustomAnswer, getSummaryMobileDeptInfo, getDeptsByUser } from '@/api/index';
+import {
+  insertCustomAnswer,
+  getSummaryMobileDeptInfo,
+  getDeptsByUser,
+  chainsList,
+} from '@/api/index';
 import zRadio from '@/components/zRadio2';
 import zCheckbox from '@/components/zCheckbox2';
 import uploadImg from '@/components/uploadVTask';
@@ -288,6 +341,12 @@ export default {
       flagclick: true,
       index: '',
       activaFlag: true,
+      moreTypeShow: false,
+      agentValue: '',
+      chainsData: [],
+      chainName: '',
+      chainCode: '',
+      jxsList: [],
     };
   },
   created() {
@@ -311,7 +370,6 @@ export default {
   },
   methods: {
     showCalendarClick(val) {
-      if (!val.allowWriteAgain) return;
       this.dateIndex = val;
       this.showCalendar = true;
     },
@@ -328,7 +386,7 @@ export default {
     },
     onConfirm(date) {
       this.showCalendar = false;
-      this.collectionItemList[this.dateIndex].answerName = this.formatDate(date);
+      this.collectionItemList[this.dateIndex].answerValue = this.formatDate(date);
     },
     formatter(value) {
       return value.replace(
@@ -731,6 +789,51 @@ export default {
       this.formData.pageNum = 1;
       this.EndTimeShow = false;
     },
+    // 添加经销商
+    addJXS() {
+      this.agentValue = '';
+      this.moreTypeShow = true;
+      this.getChainsList();
+    },
+    // 删除经销商
+    closeJXS(item, index) {
+      item.chainList.splice(index, 1);
+    },
+    getChainsList(value = '') {
+      this.chainsData = [];
+      chainsList({
+        chainCode: '', //	string	经销商编码
+        chainName: value, //	string	经销商名称
+      })
+        .then((res) => {
+          if (res.code == 200 && res.rows) {
+            this.chainsData = res.rows;
+          } else {
+            this.chainsData = [];
+          }
+        })
+        .catch(() => {
+          this.chainsData = [];
+        });
+    },
+    onConfirmChainsList(value) {
+      if (value && value.chainName != undefined) {
+        let JXSSataList = this.collectionItemList.find((item) => item.answerType == 'jxs');
+        if (!JXSSataList.chainList) {
+          JXSSataList.chainList = [];
+        }
+        let isFlag = JXSSataList.chainList.find((val) => val.chainCode == value.chainCode);
+        if (!isFlag) {
+          JXSSataList.chainList.push({
+            chainName: value.chainName,
+            chainCode: value.chainCode,
+          });
+          this.moreTypeShow = false;
+        } else {
+          this.$toast('当前经销商已添加,不能重复添加!');
+        }
+      }
+    },
   },
 };
 </script>
@@ -788,7 +891,32 @@ export default {
   }
 }
 </style>
-<style>
+<style lang="scss">
+.jxsBox {
+  .jxsContent {
+    margin-bottom: 10px;
+    .item {
+      padding: 5px;
+      background: #e9e9e9;
+      margin: 5px 0;
+      .el-popover__reference-wrapper {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+      }
+      .selectItem {
+        flex: 1;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        font-size: 14px;
+      }
+    }
+  }
+  .tips {
+    text-align: right;
+  }
+}
 .table-headermd {
   font-size: 12px;
   text-align: center;

+ 1 - 1
src/views/week/systemSettings.vue

@@ -5,7 +5,7 @@
       <div class="module">
         <div class="title">拜访设置</div>
         <div class="box">
-          <div class="label">拍照模糊时取原照片,但会每张保存到本地相册</div>
+          <div class="label">允许拍照时缩放,但每张会保存到本地相册</div>
           <div class="value">
             <van-switch v-model="switchChecked" size="20" @change="change" />
           </div>