Prechádzať zdrojové kódy

主管任务增加经销商选项

zhujindu 6 mesiacov pred
rodič
commit
b1f5d65bc6

+ 1 - 1
src/views/week/SUPTaskApproval/detailItem.vue

@@ -312,7 +312,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(

+ 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>

+ 5 - 5
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>
@@ -333,9 +333,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) {
@@ -351,7 +351,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(

+ 121 - 8
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,25 @@
             :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">
+                <div class="selectItem">{{ val.chainName }} &nbsp; ({{ val.chainCode }})</div>
+                <van-icon name="clear" size="16" @click="closeJXS(item, index)" />
+              </div>
+            </div>
+            <div class="addJXS">
+              <van-icon name="add-o" size="24" @click="addJXS" />
+            </div>
+            <div class="tips">选择参与的客户,可多选</div>
+          </div>
+        </div>
         <br />
       </div>
     </van-form>
@@ -203,13 +219,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 +334,12 @@ export default {
       flagclick: true,
       index: '',
       activaFlag: true,
+      moreTypeShow: false,
+      agentValue: '',
+      chainsData: [],
+      chainName: '',
+      chainCode: '',
+      jxsList: [],
     };
   },
   created() {
@@ -311,7 +363,6 @@ export default {
   },
   methods: {
     showCalendarClick(val) {
-      if (!val.allowWriteAgain) return;
       this.dateIndex = val;
       this.showCalendar = true;
     },
@@ -328,7 +379,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 +782,45 @@ export default {
       this.formData.pageNum = 1;
       this.EndTimeShow = false;
     },
+    // 添加经销商
+    addJXS() {
+      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.chainName != undefined) {
+        let JXSSataList = this.collectionItemList.find((item) => item.answerType == 'jxs');
+        if (!JXSSataList.chainList) {
+          JXSSataList.chainList = [];
+        }
+        JXSSataList.chainList.push({
+          chainName: value.chainName,
+          chainCode: value.chainCode,
+        });
+      }
+      this.moreTypeShow = false;
+    },
   },
 };
 </script>
@@ -787,6 +877,29 @@ export default {
     font-size: 16px;
   }
 }
+.jxsBox {
+  .jxsContent {
+    margin-bottom: 10px;
+    .item {
+      padding: 5px;
+      display: flex;
+      background: #e9e9e9;
+      margin: 5px 0;
+      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>
 <style>
 .table-headermd {