qymljy 1 anno fa
parent
commit
22bab66592

+ 46 - 21
src/HManagement/addressList/addressBook/detail/index.vue

@@ -191,28 +191,53 @@ export default {
       this.tagList = res.data.option
     },
     onDel(){
-      this.$confirm('是否确认删除当前联系人?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        closeOnClickModal:false,
-        type: 'warning'
-      }).then(async () => {
-        const res = await this.$api.requested({
-          "id": "20220831164703",
-          "content": {
-            "sys_phonebookid":this.$route.query.id,
-          }
-        })
-        this.tool.showMessage(res,()=>{
-          this.$store.dispatch('changeDetailDrawer',false)
-          this.$emit('delSuccess')
-        })
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: '已取消删除'
+      if (this.mainData.islinkcustomer == 1 || this.mainData.islinkproject == 1){
+        this.$confirm('当前联系人已存在关联客户/项目,是否确定删除?', '提示', {
+          confirmButtonText: '确定删除',
+          cancelButtonText: '取消',
+          closeOnClickModal:false,
+          type: 'warning'
+        }).then(async () => {
+          const  res = await this.$api.requested({
+            "id": "20220831164703",
+            "content": {
+              "sys_phonebookid":this.mainData.sys_phonebookid
+            }
+          })
+          this.tool.showMessage(res,()=>{
+            this.$store.dispatch('changeDetailDrawer',false)
+            this.$emit('delSuccess')
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          });
         });
-      });
+      }else {
+        this.$confirm('是否确认删除当前联系人?', '提示', {
+          confirmButtonText: '确定删除',
+          cancelButtonText: '取消',
+          closeOnClickModal:false,
+          type: 'warning'
+        }).then(async () => {
+          const  res = await this.$api.requested({
+            "id": "20220831164703",
+            "content": {
+              "sys_phonebookid":this.mainData.sys_phonebookid
+            }
+          })
+          this.tool.showMessage(res,()=>{
+            this.$store.dispatch('changeDetailDrawer',false)
+            this.$emit('delSuccess')
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          });
+        });
+      }
     },
     // 监听切换数据,上一页,下一页
     pageChange(id,rowindex){

+ 1 - 2
src/HManagement/addressList/addressBook/index.vue

@@ -36,7 +36,7 @@
         </div>
         <div class="inline-16 mt-10">
           <span class="search__label">标签:</span>
-          <el-select  v-model="tags" placeholder="请选择标签" size="small" @change="selectChange" clearable @clear="clearSearch" filterable class="inline-16" multiple>
+          <el-select  v-model="tags" placeholder="请选择标签" size="small" @change="selectChange" clearable @clear="clearSearch" filterable class="inline-16" multiple @focus="getTagList">
             <el-option
                 v-for="item in tagList"
                 :key="item.index"
@@ -279,7 +279,6 @@ export default {
   },
   mounted() {
     /*this.querytemplet()*/
-    this.getTagList()
     this.listData(1)
   }
 }