From 8657bcda4b7e3f9e73be601b61ffe2738d2e9571 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 10 十月 2023 19:59:49 +0800
Subject: [PATCH] 编码设置的配置

---
 src/views/client/contacts/index.vue                           |   25 +
 src/views/client/client/index.vue                             |   25 +
 src/views/client/contacts/AddContactsDialog.vue               |   11 
 src/api/common/standard.js                                    |   15 +
 src/views/client/salesLead/index.vue                          |   25 +
 src/views/client/followupRecords/AddFollowupRecordsDialog.vue |   49 ++++
 src/views/client/salesLead/AddSalesLeadDialog.vue             |   13 
 src/components/wordInput.vue                                  |  301 ++++++++++++++++++++++++++++++
 src/views/client/client/AddClientManageDialog.vue             |   13 
 src/views/client/followupRecords/mixin/codeMixin.js           |   93 +++++++++
 10 files changed, 522 insertions(+), 48 deletions(-)

diff --git a/src/api/common/standard.js b/src/api/common/standard.js
new file mode 100644
index 0000000..f46e844
--- /dev/null
+++ b/src/api/common/standard.js
@@ -0,0 +1,15 @@
+// import request from "@/common/untils/request.js"
+import axios from "axios"
+//缂栫爜瑙勮寖鍒楄〃
+// export function getCodeStandardList  (data)  {
+//   return request({
+//     url: "/api/code/getCodeList",
+//     method: "post",
+//     data,
+//   });
+// }
+export function getCodeStandardList(data) {
+  return  axios.get(`/api/code/getCodeList`, {
+    params: data
+  })
+}
diff --git a/src/components/wordInput.vue b/src/components/wordInput.vue
new file mode 100644
index 0000000..fe0a4a4
--- /dev/null
+++ b/src/components/wordInput.vue
@@ -0,0 +1,301 @@
+
+<template>
+  <div class="input-box">
+   
+    <div
+      class="input-content"
+      @keydown="keydown"
+      @keyup="keyup"
+      @paste="paste"
+      @mousewheel="mousewheel"
+      @input="inputEvent"
+      v-for="(item, index) in codeList"
+    >
+      <input
+        max="9"
+        min="0"
+        v-for="ele in item"
+        maxlength="1"
+        :data-index="ele"
+        ref="firstinput"
+        v-model.trim.number="input[ele]"
+        :disabled="disabled"
+      />
+      <span
+        style="
+          height: 100%;
+          display: inline-block;
+          line-height: 24px;
+          width: 24px;
+          text-align: center;
+        "
+        class="el-icon-minus"
+        v-if="index - (codeList.length - 1)"
+      ></span>
+      <!-- <input
+        max="9"
+        min="0"
+        maxlength="1"
+        data-index="1"
+        v-model.trim.number="input[1]"
+        type="number"
+      />
+     
+      <input
+        max="9"
+        min="0"
+        maxlength="1"
+        data-index="5"
+        v-model.trim.number="input[5]"
+        type="number"
+      /> -->
+    </div>
+  </div>
+</template>
+
+<script>
+
+export default {
+  data() {
+    return {
+      // 瀛樻斁绮樿创杩涙潵鐨勬暟瀛�
+      pasteResult: [],
+      inputList: [],
+      codeList: [],
+      // input: this.inputValue || [],
+    };
+  },
+  props: ["code", "codenumer", "sum", "disabled", "del", "inputValue"],
+  computed: {
+    input() {
+      // code 鏄埗缁勪欢浼犺繘鏉ョ殑榛樿鍊硷紝蹇呴』鏄�6浣嶉暱搴︾殑鏁扮粍锛岃繖閲屽氨涓嶅啀鍋氬閿欏垽鏂鐞�
+      // 鏈�鍚庣┖鏁扮粍鏄粯璁ゅ��
+      // return this.code || this.pasteResult.length === 6
+      //   ? this.pasteResult
+      //   : ["", "", "", "", "", ""];
+      if(this.inputValue){
+        return this.inputValue
+      }else{
+        return this.code || this.pasteResult.length === 6 ? this.pasteResult : [];
+      }
+      
+    },
+    // input: {
+    //   get () {
+    //     if (this.visible) {
+    //       // 娉ㄥ唽鍏ㄥ眬鐩戝惉浜嬩欢 [ 鐩墠鍙�冭檻榧犳爣瑙i櫎瑙﹀彂 ]
+    //       window.addEventListener('mousedown', this.watchContextmenu)
+    //     }
+    //     return this.visible
+    //   },
+    //   set (newVal) {
+    //     this.$emit('update:visible', newVal)
+    //   }
+    // },
+  },
+  methods: {
+    // 瑙e喅涓�涓緭鍏ユ杈撳叆澶氫釜瀛楃
+    inputEvent(e) {
+      var index = e.target.dataset.index * 1;
+      var el = e.target;
+      this.$set(this.input, index, el.value.slice(0, 1));
+    },
+    keydown(e) {
+      var index = e.target.dataset.index * 1;
+      var el = e.target;
+      if (e.key === "Backspace") {
+        if (this.input[index]&&this.input[index].length > 0) {
+          this.$set(this.input, index, "");
+        } else {
+          if (el.previousElementSibling) {
+            el.previousElementSibling.focus();
+            this.$set(this.input, index - 1, "");
+          }
+        }
+      } else if (e.key === "Delete") {
+        if (this.input[index]&&this.input[index].length > 0) {
+          this.$set(this.input, index, "");
+        } else {
+          if (el.nextElementSibling) {
+            this.$set(this.input, (index = 1), "");
+          }
+        }
+        if (el.nextElementSibling) {
+          el.nextElementSibling.focus();
+        }
+      } else if (e.key === "Home") {
+        el.parentElement.children[0] && el.parentElement.children[0].focus();
+      } else if (e.key === "End") {
+        el.parentElement.children[this.input.length - 1] &&
+          el.parentElement.children[this.input.length - 1].focus();
+      } else if (e.key === "ArrowLeft") {
+        if (el.previousElementSibling) {
+          el.previousElementSibling.focus();
+        }
+      } else if (e.key === "ArrowRight") {
+        if (el.nextElementSibling) {
+          el.nextElementSibling.focus();
+        }
+      } else if (e.key === "ArrowUp") {
+        if (this.input[index] * 1 < 9) {
+          this.$set(this.input, index, (this.input[index] * 1 + 1).toString());
+        }
+      } else if (e.key === "ArrowDown") {
+        if (this.input[index] * 1 > 0) {
+          this.$set(this.input, index, (this.input[index] * 1 - 1).toString());
+        }
+      }
+    },
+    keyup(e) {
+      var index = e.target.dataset.index * 1;
+      var el = e.target;
+      // console.log(this.input);
+      this.$emit("codeList", this.input);
+      if (/Digit|Numpad|Key/i.test(e.code)) {
+        // this.$set(this.input, index, e.code.replace(/Digit|Numpad|Key/i, ""));
+        this.$set(this.input, index, e.key);
+        el.nextElementSibling && el.nextElementSibling.focus();
+        if (index === 5) {
+          let number=0
+          if(this.codenumer&&this.codenumer.length>0){
+            for(let i in this.codenumer){
+              number=number+Number(this.codenumer[i])
+            }
+          }
+          console.log(this.pasteResult,'===keyup');
+          if (this.input.join("").length === number) {
+            document.activeElement.blur();
+            this.$emit("complete", this.input);
+          }
+        }
+      } else {
+        if (this.input[index] === "") {
+          this.$set(this.input, index, "");
+        }
+      }
+    },
+    mousewheel(e) {
+      var index = e.target.dataset.index;
+      if (e.wheelDelta > 0) {
+        if (this.input[index] * 1 < 9) {
+          this.$set(this.input, index, (this.input[index] * 1 + 1).toString());
+        }
+      } else if (e.wheelDelta < 0) {
+        if (this.input[index] * 1 > 0) {
+          this.$set(this.input, index, (this.input[index] * 1 - 1).toString());
+        }
+      } else if (e.key === "Enter") {
+        if (this.input.join("").length === 6) {
+          document.activeElement.blur();
+          this.$emit("complete", this.input);
+        }
+      }
+    },
+    paste(e) {
+      // 褰撹繘琛岀矘璐存椂
+      e.clipboardData.items[0].getAsString((str) => {
+        if (str.toString().length === 6) {
+          this.pasteResult = str.split("");
+          document.activeElement.blur();
+          this.$emit("complete", this.input);
+        }
+      });
+    },
+    save() {
+      this.inputList = []
+      var arrlist = [];
+      var list = [];
+      if(this.codenumer&&this.codenumer.length>0){
+        this.codenumer.forEach(item=>{
+          this.inputList.push(item);
+        })
+        this.inputList.forEach((item, index) => {
+          var arr = [];
+          var x = list.length;
+          var y = list.length + item;
+          for (let index = x; index < y; index++) {
+            arr.push(index);
+            list.push(index);
+          }
+          arrlist.push(arr);
+        });
+      }
+      this.codeList = arrlist;
+      // console.log(this.codeList);
+    },
+    delcode(val) {
+      this.codeList.splice(val, 1);
+      this.inputList.splice(val, 1);
+    },
+  },
+  watch: {
+    codenumer(val) {
+      console.log(val);
+      this.save();
+    },
+    sum(val) {
+      if (val == 0) {
+        this.codeList.splice(this.del, 1);
+        this.inputList.splice(this.del, 1);
+      }
+      //浣跨敤瀹氭椂鍣ㄩ槻姝㈠垹闄ょ殑鏃跺�欐墽琛�
+      setTimeout(() => {
+        // 闃叉杩炵画杈撳叆鐩稿悓涓暟鏃舵牸瀛愪笉澧炲姞;
+        if (this.inputList.length < val) {
+          console.log(val, "sum");
+          this.save();
+        }
+      }, 200);
+      // console.log(this.inputList.length, val);
+      // console.log("鏁扮粍闀垮害", "杈撳叆娆℃暟");
+    },
+    del(val) {},
+  },
+  created() {
+    this.save();
+  },
+
+  mounted() {
+    // 绛夊緟dom娓叉煋瀹屾垚锛屽湪鎵цfocus,鍚﹀垯鏃犳硶鑾峰彇鍒扮劍鐐�
+    // this.$nextTick(() => {
+    //   this.$refs.firstinput.focus();
+    // });
+    // console.log(this.inputList);
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.input-box {
+  // display: table-cell;
+  display: inline-block;
+  .input-content {
+    // width: 512px;
+    // height: 32px;
+    // display: flex;
+    // align-items: center;
+    // justify-content: space-between;
+    display: inline-block;
+    margin-right: 0px;
+    input {
+      color: inherit;
+      font-family: inherit;
+      border: 0;
+      outline: 0;
+      border-bottom: 1px solid #919191;
+      height: 24px;
+      width: 24px;
+      font-size:18px;
+      text-align: center;
+      border: #919191 1px solid;
+      margin: 2px 3px;
+      box-sizing: border-box;
+    }
+  }
+  input::-webkit-outer-spin-button,
+  input::-webkit-inner-spin-button {
+    appearance: none;
+    margin: 0;
+  }
+}
+</style>
diff --git a/src/views/client/client/AddClientManageDialog.vue b/src/views/client/client/AddClientManageDialog.vue
index 5c15e02..62e3560 100644
--- a/src/views/client/client/AddClientManageDialog.vue
+++ b/src/views/client/client/AddClientManageDialog.vue
@@ -13,7 +13,7 @@
         :model="editConfig.infomation"
         :rules="rules"
         label-position="right"
-        label-width="308px"
+        label-width="130px"
         size="mini"
         style="height: 60vh; overflow-x: hidden"
       >
@@ -59,7 +59,7 @@
                     v-model="editConfig.infomation.member_id"
                     placeholder="璇烽�夋嫨"
                     size="mini"
-                    style="width: 63%"
+                    style="width: 100%"
                   >
                     <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id">
                     </el-option>
@@ -106,7 +106,7 @@
                     v-model="editConfig.infomation.client_level_id"
                     placeholder="璇烽�夋嫨"
                     size="mini"
-                    style="width: 63%"
+                    style="width: 100%"
                   >
                     <el-option v-for="item in importantLevelOptions" :key="item.id" :label="item.name" :value="item.id">
                     </el-option>
@@ -133,6 +133,7 @@
                     value-format="yyyy-MM-dd"
                     type="date"
                     placeholder="閫夋嫨鏃ユ湡"
+                    style="width: 100%"
                   >
                   </el-date-picker>
                 </el-form-item>
@@ -144,6 +145,7 @@
                     value-format="yyyy-MM-dd"
                     type="date"
                     placeholder="閫夋嫨鏃ユ湡"
+                    style="width: 100%"
                   >
                   </el-date-picker>
                 </el-form-item>
@@ -218,6 +220,7 @@
                     value-format="yyyy-MM-dd HH:mm:ss"
                     type="datetime"
                     placeholder="閫夋嫨鏃ユ湡鏃堕棿"
+                    style="width: 100%"
                   >
                   </el-date-picker>
                 </el-form-item>
@@ -515,7 +518,7 @@
   },
   data() {
     return {
-      dialogWidth: "80%",
+      dialogWidth: "50%",
       editConfig: this.editClientManageConfig,
       rules: {
         name: [
@@ -756,7 +759,7 @@
         }
         .common-select {
           .common-select-sel {
-            width: 270px;
+            width: 100%;
           }
         }
       }
diff --git a/src/views/client/client/index.vue b/src/views/client/client/index.vue
index 357b5fc..1496972 100644
--- a/src/views/client/client/index.vue
+++ b/src/views/client/client/index.vue
@@ -28,7 +28,7 @@
         >
           <template slot="leftButton">
             <el-button size="small" type="primary"  @click="addBtnClick">鏂板缓</el-button>
-            <el-button size="small"  @click="delClick">鍒犻櫎</el-button>
+            <!-- <el-button size="small"  @click="delClick">鍒犻櫎</el-button> -->
           </template>
         </CommonSearch>
       </div>
@@ -47,7 +47,7 @@
               @selTableCol="selTableCol"
           >
             <template slot="tableButton">
-              <el-table-column label="鎿嶄綔" width="150">
+              <el-table-column label="鎿嶄綔" width="180">
                 <template slot-scope="scope">
                   <el-button v-if="activeName === 'first'" type="text" size="small" @click="allocationBtnClick(scope.row)"
                   >鍒嗛厤</el-button
@@ -55,7 +55,7 @@
                   <el-button v-else type="text" size="small" @click="changeHighSeasClick(scope.row)">鍙樻洿鍏捣</el-button>
                   <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button>
                   <el-button @click="followupClick(scope.row)" type="text" size="small">璺熻繘</el-button>
-                  <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> -->
+                  <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button>
                 </template>
               </el-table-column>
             </template>
@@ -174,6 +174,7 @@
   methods: {
     setTable() {
       this.tableList = {
+        selectIndex: true,
         tableInfomation: [],
         allcol: [],
         showcol: this.showCol,
@@ -306,15 +307,24 @@
       }
     },
     // 鍒犻櫎
-    delClick() {
-      if (this.selValueList && this.selValueList.length > 0) {
+    delClick(id) {
+      if(!id){
+        if (this.selValueList && this.selValueList.length == 0) {
+          this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�")
+          return true;
+        }
+      }
         this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
           confirmButtonText: "纭畾",
           cancelButtonText: "鍙栨秷",
           type: "warning"
         })
           .then(() => {
-            getDeleteClient({ ids: this.selValueList }).then((response) => {
+            let params={ids: this.selValueList }
+            if(id){
+              params={ids: [id]}
+            }
+            getDeleteClient(params).then((response) => {
               if (response.code === 200) {
                 this.$message.success("鍒犻櫎鎴愬姛")
                 this.getData()
@@ -324,9 +334,6 @@
             })
           })
           .catch(() => {})
-      } else {
-        this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�")
-      }
     },
     getSelectArray(val) {
       console.log(val)
diff --git a/src/views/client/contacts/AddContactsDialog.vue b/src/views/client/contacts/AddContactsDialog.vue
index 3b3bc45..e53b170 100644
--- a/src/views/client/contacts/AddContactsDialog.vue
+++ b/src/views/client/contacts/AddContactsDialog.vue
@@ -14,7 +14,7 @@
         :model="editConfig.infomation"
         :rules="rules"
         label-position="right"
-        label-width="308px"
+        label-width="120px"
         size="mini"
       >
         <!-- 淇℃伅 -->
@@ -41,6 +41,7 @@
                       :fetch-suggestions="querySearchAsync"
                       value-key="name"
                       @select="handleSelectClient"
+                      style="width: 100%"
                     ></el-autocomplete>
                     <div class="common-select-btn" @click="selClientClick">
                       <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i>
@@ -72,7 +73,7 @@
               </el-col>
               <el-col :span="12">
                 <el-form-item v-if="isUnflod" label="閿�鍞礋璐d汉" prop="member_id">
-                  <el-select v-model="editConfig.infomation.member_id" placeholder="璇烽�夋嫨" size="mini">
+                  <el-select v-model="editConfig.infomation.member_id" placeholder="璇烽�夋嫨" size="mini" style="width: 100%">
                     <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id">
                     </el-option>
                   </el-select>
@@ -95,6 +96,7 @@
                     v-model="editConfig.infomation.birthday"
                     value-format="yyyy-MM-dd"
                     type="date"
+                    style="width: 100%"
                     placeholder="閫夋嫨鏃ユ湡"
                   >
                   </el-date-picker>
@@ -276,7 +278,7 @@
   },
   data() {
     return {
-      dialogWidth: "80%",
+      dialogWidth: "50%",
       editConfig: this.editContactsConfig,
       rules: {
         name: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -509,7 +511,7 @@
         }
         .common-select {
           .common-select-sel {
-            width: 270px;
+            width:100%;
           }
         }
       }
@@ -527,6 +529,7 @@
       justify-content: center;
       align-items: center;
       color: #6166d3;
+      cursor: pointer;
     }
     .dialog-footer {
       background-color: #f5f5f5;
diff --git a/src/views/client/contacts/index.vue b/src/views/client/contacts/index.vue
index 00dfcf3..af6ace0 100644
--- a/src/views/client/contacts/index.vue
+++ b/src/views/client/contacts/index.vue
@@ -15,7 +15,7 @@
         >
           <template slot="leftButton">
             <el-button size="small" type="primary"  @click="addBtnClick">鏂板缓</el-button>
-            <el-button size="small"  @click="delClick">鍒犻櫎</el-button>
+            <!-- <el-button size="small"  @click="delClick">鍒犻櫎</el-button> -->
           </template>
         </CommonSearch>
       </div>
@@ -34,11 +34,11 @@
               @selTableCol="selTableCol"
           >
             <template slot="tableButton">
-              <el-table-column label="鎿嶄綔" width="90" fixed="right">
+              <el-table-column label="鎿嶄綔" width="130" fixed="right">
                 <template slot-scope="scope">
                   <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button>
                   <el-button @click="followupClick(scope.row)" type="text" size="small">璺熻繘</el-button>
-                  <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> -->
+                  <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button>
                 </template>
               </el-table-column>
             </template>
@@ -156,6 +156,7 @@
   methods: {
     setTable() {
       this.tableList = {
+        selectIndex: true,
         tableInfomation: [],
         allcol: [],
         showcol: this.showCol,
@@ -238,15 +239,24 @@
       this.editConfig.infomation = { ...row }
     },
     // 鍒犻櫎
-    delClick() {
-      if (this.selValueList && this.selValueList.length > 0) {
+    delClick(id) {
+      if(!id){
+        if (this.selValueList && this.selValueList.length == 0) {
+          this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�")
+          return true;
+        }
+      }
         this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
           confirmButtonText: "纭畾",
           cancelButtonText: "鍙栨秷",
           type: "warning"
         })
           .then(() => {
-            getDeleteContact({ ids: this.selValueList }).then((response) => {
+            let params={ids: this.selValueList }
+            if(id){
+              params={ids: [id]}
+            }
+            getDeleteContact(params).then((response) => {
               if (response.code === 200) {
                 this.$message.success("鍒犻櫎鎴愬姛")
                 this.getData()
@@ -256,9 +266,6 @@
             })
           })
           .catch(() => {})
-      } else {
-        this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�")
-      }
     },
     getSelectArray(val) {
       console.log(val)
diff --git a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue
index 2dd0b08..662d570 100644
--- a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue
+++ b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue
@@ -22,6 +22,28 @@
           <div v-if="isUnflod" class="basic-info-title">鍩烘湰淇℃伅</div>
           <div class="basic-info-view">
             <el-row>
+              <el-col :span="12" v-if="isUnflod">
+                <!-- <el-form-item label="璺熻繘璁板綍缂栧彿" prop="number">
+                  <el-input v-model="editConfig.infomation.number" style="width: 100%"></el-input>
+                </el-form-item> -->
+                <el-form-item label="璺熻繘璁板綍缂栧彿" prop="number">
+                  <WordInput
+                    v-if="codenumer && (explain != '' || isIdDisabled)"
+                    :codenumer="codenumer"
+                    :sum="sum"
+                    :disabled="editConfig.infomation.id || isIdDisabled"
+                    :inputValue="inputValue"
+                    @codeList="codeList"
+                  />
+                  <span v-else style="color: #f56c6c"
+                    >璇蜂紭鍏堥厤缃紪鐮佽鑼�
+                    <el-button type="text"  @click="numberClick">
+                        閰嶇疆瑙勮寖
+                      </el-button
+                    ></span
+                  >
+                </el-form-item>
+              </el-col>
               <el-col :span="12">
                 <el-form-item label="瀹㈡埛鍚嶇О" prop="client_name">
                   <div class="custom-name">
@@ -47,11 +69,6 @@
                       <i class="el-icon-remove-outline" title="娓呴櫎"></i>
                     </div>
                   </div>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12" v-if="isUnflod">
-                <el-form-item label="璺熻繘璁板綍缂栧彿" prop="number">
-                  <el-input v-model="editConfig.infomation.number" style="width: 100%"></el-input>
                 </el-form-item>
               </el-col>
               <el-col v-if="isUnflod" :span="12">
@@ -324,8 +341,10 @@
 import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog"
 import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog"
 import SelectLeadDialog from "@/views/other/commonDialog/SelectLeadDialog"
+import codeMixin from "./mixin/codeMixin";
 export default {
   name: "AddFollowupRecordsDialog",
+  mixins: [codeMixin],
   props: {
     editContactsConfig: {
       type: Object,
@@ -408,7 +427,7 @@
       clientId: this.editContactsConfig.infomation.client_id,
       contactId: this.editContactsConfig.infomation.contact_id,
       saleChanceId: this.editContactsConfig.infomation.sale_chance_id,
-      saleLeadId: this.editContactsConfig.infomation.sales_leads_id
+      saleLeadId: this.editContactsConfig.infomation.sales_leads_id,
     }
   },
   created() {
@@ -418,8 +437,26 @@
     this.$store.dispatch("geLead")
     this.getCommonData()
     this.getContactInfoList()
+    this.getRCodeStandardList();
+  },
+  watch:{
+    'editConfig.visible'(val){
+      if(val){
+        this.formInfo()
+      }
+    },
+    'editConfig.infomation'(){
+      this.formInfo()
+    }
   },
   methods: {
+    formInfo(){
+      this.objCode.codeStandID = ''
+      if(this.editConfig.infomation.number&&this.editConfig.infomation.codeStandardID){
+        this.objCode.codeStandID = this.editConfig.infomation.codeStandardID;
+      }
+      this.getRCodeStandardList();
+    }, 
     getCommonData() {
       getAllData().then((res) => {
         console.log(res)
diff --git a/src/views/client/followupRecords/mixin/codeMixin.js b/src/views/client/followupRecords/mixin/codeMixin.js
new file mode 100644
index 0000000..dd856eb
--- /dev/null
+++ b/src/views/client/followupRecords/mixin/codeMixin.js
@@ -0,0 +1,93 @@
+import WordInput from "@/components/wordInput";
+import { getCodeStandardList } from "@/api/common/standard";
+export default {
+  components: {
+    WordInput,
+  },
+  data() {
+    return {
+      // 缂栫爜
+      // 鏄惁鑷姩鐢熸垚
+      isIdDisabled: false,
+      inputValue: [],
+      explain: "",
+      codenumer: 0, //姣忔杈撳叆鐨勭紪鐮�
+      codenumberList: [], //鏁存潯缂栫爜
+      sum: 0,
+      objCode: { name: "", page: 0, pageSize: 0, type: "璺熻繘璁板綍缂栫爜" },
+    };
+  },
+  
+  methods: {
+    async getRCodeStandardList() {
+      try {
+        const res = await getCodeStandardList(this.objCode);
+        this.codenumer = [];
+        this.sum = 0;
+        this.explain = "";
+        if(res.data.code==200){
+          const {
+            List = [],
+            AutoRule = {},
+            Method,
+          } = (res.data.data&&res.data.data.data) ? res.data.data.data[0] : [];
+          let autoRule=AutoRule
+          let method=Method?Method:0
+          let rules=List
+          if (method == 0 && res.data.data.data.length > 0) {
+            rules.forEach((item, index) => {
+              // setTimeout(() => {
+              //   this.codenumer = item.length;
+              //   this.sum++;
+              // }, 200);
+              this.codenumer.push(item.Length);
+              this.sum++;
+              this.explain += item.Name + (index === rules.Length - 1 ? "" : "/");
+            });
+          }
+          if (method == 1) {
+            if (Object.keys(autoRule).length > 0) {
+              this.isIdDisabled = true;
+              if (autoRule.PrefixMethod == 1) {
+                let prefix = autoRule.PrefixValue.split("").length;
+  
+                this.codenumer.push(prefix);
+                if (autoRule.SuffixMethod == 2) {
+                  this.codenumer.push(8);
+                }
+                if (autoRule.AutoLength) {
+                  this.codenumer.push(autoRule.AutoLength);
+                }
+                this.sum = prefix + Number(autoRule.AutoLength);
+                this.codeList(
+                  this.editConfig.infomation.number ? this.editConfig.infomation.number : autoRule.PrefixValue
+                );
+              }
+            }
+          }
+  
+          this.$forceUpdate();
+        }else{
+          this.$message.error(res.data.msg?res.data.msg:'鑾峰彇缂栫爜瑙勮寖澶辫触锛岃閲嶈瘯锛�')
+        }
+       
+      } catch (err) {
+        console.log(err);
+      }
+    },
+    codeList(val) {
+      console.log(val,'===val  codelist')
+      this.inputValue = val;
+      this.codenumberList = val.toString();
+      this.editConfig.infomation.number =
+        this.codenumberList.length > 0
+          ? this.codenumberList.replace(/,/g, "")
+          : "";
+      console.log(this.codenumberList.replace(/,/g, ""));
+    },
+    // 閰嶇疆缂栫爜瑙勮寖鐨勮烦杞�
+    numberClick(){
+      window.open('http://www.fai365.com:9080/facilty','_blank')
+    },
+  },
+};
diff --git a/src/views/client/salesLead/AddSalesLeadDialog.vue b/src/views/client/salesLead/AddSalesLeadDialog.vue
index db84fa9..96ecfcc 100644
--- a/src/views/client/salesLead/AddSalesLeadDialog.vue
+++ b/src/views/client/salesLead/AddSalesLeadDialog.vue
@@ -11,7 +11,7 @@
         :model="editConfig.infomation"
         :rules="rules"
         label-position="right"
-        label-width="308px"
+        label-width="130px"
         size="mini"
       >
         <!-- 淇℃伅 -->
@@ -22,12 +22,12 @@
             <el-row>
               <el-col :span="12">
                 <el-form-item label="瀹㈡埛鍚嶇О" prop="name">
-                  <el-input v-model="editConfig.infomation.name"></el-input>
+                  <el-input v-model="editConfig.infomation.name" style="width: 100%"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="閿�鍞嚎绱㈢紪鍙�" prop="number">
-                  <el-input v-model="editConfig.infomation.number"></el-input>
+                  <el-input v-model="editConfig.infomation.number" style="width: 100%"></el-input>
                 </el-form-item>
               </el-col>
               <!-- </el-row>
@@ -86,7 +86,7 @@
               </el-col>
               <el-col :span="12">
                 <el-form-item label="璐熻矗浜�" prop="member_id">
-                  <el-select v-model="editConfig.infomation.member_id" placeholder="璇烽�夋嫨" size="mini">
+                  <el-select v-model="editConfig.infomation.member_id" placeholder="璇烽�夋嫨" style="width: 100%" size="mini">
                     <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id">
                     </el-option>
                   </el-select>
@@ -251,7 +251,7 @@
   computed: {},
   data() {
     return {
-      dialogWidth: "80%",
+      dialogWidth: "50%",
       editConfig: this.editSalesLeadConfig,
       rules: {
         name: [{ required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: "blur" }],
@@ -418,7 +418,7 @@
       .common-select {
         display: flex;
         .common-select-sel {
-          width: 270px;
+          width:100%;
         }
         .common-select-btn {
           margin-left: 5px;
@@ -433,6 +433,7 @@
     height: 30px;
     justify-content: center;
     align-items: center;
+    cursor:pointer;
     color: #6166d3;
   }
 }
diff --git a/src/views/client/salesLead/index.vue b/src/views/client/salesLead/index.vue
index 014a51c..d629572 100644
--- a/src/views/client/salesLead/index.vue
+++ b/src/views/client/salesLead/index.vue
@@ -12,7 +12,7 @@
         >
           <template slot="leftButton">
             <el-button size="small" type="primary"  @click="addBtnClick">鏂板缓</el-button>
-            <el-button size="small"  @click="delClick">鍒犻櫎</el-button>
+            <!-- <el-button size="small"  @click="delClick">鍒犻櫎</el-button> -->
           </template>
 
         </CommonSearch>
@@ -31,12 +31,12 @@
               @selTableCol="selTableCol"
           >
             <template slot="tableButton">
-              <el-table-column label="鎿嶄綔" width="120">
+              <el-table-column label="鎿嶄綔" width="160">
                 <template slot-scope="scope">
                   <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button>
                   <el-button @click="followupClick(scope.row)" type="text" size="small">璺熻繘</el-button>
                   <el-button @click="advanceClick(scope.row)" type="text" size="small">鎺ㄨ繘</el-button>
-                  <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> -->
+                  <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button>
                 </template>
               </el-table-column>
             </template>
@@ -156,6 +156,7 @@
   methods: {
     setTable() {
       this.tableList = {
+        selectIndex: true,
         tableInfomation: [],
         allcol: [],
         showcol: this.showCol,
@@ -243,8 +244,13 @@
       }
     },
     // 鍒犻櫎
-    delClick() {
-      if (this.selValueList && this.selValueList.length > 0) {
+    delClick(id) {
+      if(!id){
+        if (this.selValueList && this.selValueList.length == 0) {
+          this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�")
+          return true;
+        }
+      }
         this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
           confirmButtonText: "纭畾",
           cancelButtonText: "鍙栨秷",
@@ -252,7 +258,11 @@
         })
           .then(() => {
             console.log("dddd")
-            getDeleteSalesLeads({ ids: this.selValueList }).then((response) => {
+            let params={ids: this.selValueList }
+            if(id){
+              params={ids: [id]}
+            }
+            getDeleteSalesLeads(params).then((response) => {
               if (response.code === 200) {
                 this.$message.success("鍒犻櫎鎴愬姛")
                 this.getData()
@@ -262,9 +272,6 @@
             })
           })
           .catch(() => {})
-      } else {
-        this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�")
-      }
     },
     getSelectArray(val) {
       this.selValueList = []

--
Gitblit v1.8.0