Browse Source

开发标签管理

liuxiaona 2 years ago
parent
commit
991aef99d5

+ 1 - 0
project/src/assets/config/interface_api.js

@@ -57,6 +57,7 @@ var api = {
57 57
   add_tag_group: "/api/tag/addTagGroup",
58 58
   order_tag_group: "/api/tag/updateTagGroupOrder",
59 59
   dele_tag_group: "/api/tag/deleteTagGroup",
60
+  edit_tag_group: "/api/tag/updateTagGroup",
60 61
 };
61 62
 
62 63
 export { api };

+ 85 - 10
project/src/components/assembly/tagGroup.vue

@@ -33,29 +33,34 @@
33 33
       <div class="group_item" style="align-items: baseline;margin-top: 10px">
34 34
         <div class="lable">标签名称:</div>
35 35
         <div class="opaArea">
36
-          <div v-for="(m,mIdx) in moreLable" :key="m.id" class="flex">
37
-            <el-input class="ipt_group tMar10" v-model="m.name" placeholder="请输入标签名称"></el-input>
36
+          <div v-for="(m,mIdx) in moreLable" :key="m.tag_id" class="flex">
37
+            <el-input class="ipt_group tMar10" v-model="m.tag_name" placeholder="请输入标签名称"></el-input>
38 38
             <span v-if="moreLable&&moreLable.length>1" class="flex">
39
-               <el-tooltip effect="light" content="删除该标签" placement="top-start">
39
+               <el-tooltip effect="light" content="删除该标签" placement="left">
40 40
                 <span class="minusIptGroup" @click="moreLable.splice(mIdx,1)">-</span>
41 41
                </el-tooltip>
42 42
                 <img src="../../assets/img/upNone.png" alt="" v-if="mIdx == 0" style="width: 20px;margin: 0 8px;cursor: pointer">
43
-               <el-tooltip effect="light" content="上移" placement="top-start">
43
+               <el-tooltip effect="light" content="上移" placement="left">
44 44
                  <img src="../../assets/img/up.png" alt="" v-if="mIdx > 0" @click="upClick(mIdx)" style="width: 20px;margin: 0 8px;cursor: pointer">
45 45
                </el-tooltip>
46 46
                 <img src="../../assets/img/downNone.png" alt="" v-if="mIdx == moreLable.length-1" style="width: 20px;cursor: pointer">
47
-               <el-tooltip effect="light" content="下移" placement="top-start">
47
+               <el-tooltip effect="light" content="下移" placement="left">
48 48
                  <img src="../../assets/img/down.png" alt="" v-if="mIdx < moreLable.length-1" @click="downClick(mIdx)" style="width: 20px;cursor: pointer">
49 49
                </el-tooltip>
50 50
               </span>
51 51
           </div>
52
-          <div class="addIptGroup" @click="moreLable.push({id:moreLable.length,name:''})">+ 添加标签</div>
52
+          <div class="addIptGroup" @click="moreLable.push({tag_id:moreLable.length,tag_name:''})">+ 添加标签</div>
53 53
         </div>
54 54
       </div>
55 55
     </div>
56 56
     <div slot="footer">
57
-      <el-button size="mini" @click="lableGroup = false">取 消</el-button>
58
-      <el-button size="mini" type="primary" @click="addTagGroup()">确 定</el-button>
57
+      <div class="flex">
58
+        <div class="f14 c-00B38A pointer" @click="deleTagGroup()" v-if="source == 'edit'">删除该标签组</div>
59
+        <div class="lMarauto">
60
+          <el-button size="mini" @click="lableGroup = false">取 消</el-button>
61
+          <el-button size="mini" type="primary" @click="source == 'add' ? addTagGroup() : editTagGroup()">确 定</el-button>
62
+        </div>
63
+      </div>
59 64
     </div>
60 65
   </el-dialog>
61 66
 </template>
@@ -68,11 +73,81 @@ export default {
68 73
     return{
69 74
       lableGroup:false,
70 75
       groupName:'',
71
-      moreLable:[{id:0,name:''}],//添加标签组时,新增标签的数据列表,传给后台
76
+      groupId:'',
77
+      moreLable:[{tag_id:0,tag_name:''}],//添加标签组时,新增标签的数据列表,传给后台
72 78
     }
73 79
   },
74 80
   methods:{
81
+    deleTagGroup(){
82
+      this.$confirm('是否删除该标签组?', '提示', {
83
+        confirmButtonText: '确定',
84
+        cancelButtonText: '取消',
85
+        type: 'warning'
86
+      }).then(() => {
87
+        this.$axios.post(this.URL.BASEURL + this.URL.dele_tag_group, {
88
+          group_id: this.groupId
89
+        }).then((res) => {
90
+          var res = res.data
91
+          if (res && res.errno == 0) {
92
+            this.lableGroup = false
93
+            this.$parent.init(1)
94
+          }
95
+          this.$message({
96
+            message: res.err,
97
+            type: "warning"
98
+          })
99
+        })
100
+      })
101
+    },
102
+    editTagGroup(){
103
+      if(this.groupName==''){
104
+        this.$message({
105
+          message: '标签组名称不能为空',
106
+          type: "warning"
107
+        })
108
+        return false
109
+      }
110
+      this.moreLable.forEach(m=>{
111
+        if(m.tag_name==''){
112
+          this.$message({
113
+            message: '标签名称不能为空',
114
+            type: "warning"
115
+          })
116
+          return false
117
+        }
118
+      })
119
+      this.$axios.post(this.URL.BASEURL + this.URL.edit_tag_group, {
120
+        group_name: this.groupName,
121
+        tag_list:this.moreLable
122
+      }).then((res) => {
123
+        var res = res.data
124
+        if (res && res.errno == 0) {
125
+          this.lableGroup = false
126
+          this.$parent.init(1)
127
+        }
128
+        this.$message({
129
+          message: res.err,
130
+          type: "warning"
131
+        })
132
+      })
133
+    },
75 134
     addTagGroup(){
135
+      if(this.groupName==''){
136
+        this.$message({
137
+          message: '标签组名称不能为空',
138
+          type: "warning"
139
+        })
140
+        return false
141
+      }
142
+      this.moreLable.forEach(m=>{
143
+        if(m.tag_name==''){
144
+          this.$message({
145
+            message: '标签名称不能为空',
146
+            type: "warning"
147
+          })
148
+          return false
149
+        }
150
+      })
76 151
       this.$axios.post(this.URL.BASEURL + this.URL.add_tag_group, {
77 152
         group_name: this.groupName,
78 153
         tag_list:this.moreLable
@@ -172,7 +247,7 @@ export default {
172 247
       align-items: center;
173 248
       margin-top: 20px;
174 249
       .lable{
175
-        width: 24%;
250
+        width: 19%;
176 251
         text-align: right;
177 252
       }
178 253
       .opaArea{

+ 27 - 17
project/src/components/detials/index.vue

@@ -3,18 +3,16 @@
3 3
     <div class="title padCon">
4 4
       <div class="flex">
5 5
         客户详情
6
-<!--
7
-      <span class="lMar8">
8
-          <el-tooltip effect="light" content="上一位" placement="bottom">
9
-            <i class="el-icon-arrow-left f16"></i>
10
-          </el-tooltip>
11
-        </span>
12
-        <span class="lMar8">
13
-           <el-tooltip effect="light" content="下一位" placement="bottom">
14
-            <i class="el-icon-arrow-right f16"></i>
15
-          </el-tooltip>
16
-        </span>
17
--->
6
+<!--      <span class="lMar8">-->
7
+<!--        <el-tooltip effect="light" content="上一位" placement="bottom">-->
8
+<!--          <i class="el-icon-arrow-left f16" @click="onPerson()"></i>-->
9
+<!--        </el-tooltip>-->
10
+<!--      </span>-->
11
+<!--      <span class="lMar8">-->
12
+<!--         <el-tooltip effect="light" content="下一位" placement="bottom">-->
13
+<!--          <i class="el-icon-arrow-right f16" @click="nextPerson()"></i>-->
14
+<!--        </el-tooltip>-->
15
+<!--      </span>-->
18 16
       </div>
19 17
       <div class="flex-align-center">
20 18
         <img src="../../assets/img/fullScreen.png" alt="" style="width: 13px;margin-right: 6px;cursor: pointer"  @click="changeWidth">
@@ -74,6 +72,7 @@
74 72
     </div>
75 73
 
76 74
     <el-dialog
75
+      v-loading="dialogLoading"
77 76
       title="选择企业标签"
78 77
       :visible.sync="comLableShow"
79 78
       :append-to-body="true"
@@ -85,8 +84,8 @@
85 84
           <div class="add" @click="iptshow = true,addLableVal = ''">+ 添加</div>
86 85
           <el-input v-if="iptshow" v-focus class="ipt" v-model="addLableVal" placeholder="请输入标签" @blur="iptBlur"></el-input>
87 86
         </template>
88
-        <div class="tMar10" v-for="l in lableArr" :key="l.group_id">
89
-          <div>
87
+        <div v-for="(l,lidx) in lableArr" :key="l.group_id" :class="lidx ==0 ? '' : 'tMar20'">
88
+          <div class="f16 fWeight600">
90 89
             {{l.group_name}}
91 90
           </div>
92 91
           <div class="lableItem_dad">
@@ -172,6 +171,7 @@ export default {
172 171
       // selfLableShow:false,
173 172
       acIdx:0,
174 173
       loading:false,
174
+      dialogLoading:false,
175 175
       iptshow:false,
176 176
       tabList:[
177 177
         {
@@ -218,8 +218,15 @@ export default {
218 218
     order,
219 219
   },
220 220
   methods:{
221
-    edit_tag(){
222
-      this.comLableShow = true
221
+    onPerson(){
222
+
223
+    },
224
+    nextPerson(){
225
+
226
+    },
227
+    edit_tag(){//选择企业标签框的确定
228
+      // this.comLableShow = true
229
+      this.dialogLoading = true
223 230
       this.$axios.post(this.URL.BASEURL + this.URL.tag_detial_edit,{
224 231
         external_userid:this.resInfo.external_userid,
225 232
         customer_id:this.rowProp.customer_id,
@@ -235,7 +242,7 @@ export default {
235 242
           this.comLableShow = false
236 243
           this.init()
237 244
         }
238
-
245
+        this.dialogLoading = false
239 246
       })
240 247
     },
241 248
     init_tag(){
@@ -317,6 +324,9 @@ export default {
317 324
 </script>
318 325
 <style lang="scss">
319 326
 .addLable_dialog{
327
+  .el-dialog__body{
328
+    padding: 15px 20px;
329
+  }
320 330
   .addLableBox{
321 331
 
322 332
     .add{

+ 1 - 1
project/src/components/manage/memberManage.vue

@@ -18,7 +18,7 @@
18 18
         </div>
19 19
         <div>
20 20
           <div v-for="c in depart_List" :key="c.department_id" class="tMar20 flex-align-center">
21
-            <i class="el-icon-circle-check c-00B38A f16 rMar7 pointer" v-if="checkVals.indexOf(c.department_id)>-1" @click="checkDepartId(c.department_id)"></i>
21
+            <i class="el-icon-success c-00B38A f16 rMar7 pointer" v-if="checkVals.indexOf(c.department_id)>-1" @click="checkDepartId(c.department_id)"></i>
22 22
             <i class="el-icon-circle rMar7 pointer" @click="checkDepartId(c.department_id)" v-else></i>
23 23
             {{c.department_id}}
24 24
           </div>

+ 14 - 8
project/src/components/manage/tagManage.vue

@@ -38,16 +38,14 @@
38 38
             <img src="../../assets/img/down.png" alt="" v-if="mIdx < tableData.length-1">
39 39
             上移
40 40
           </div>
41
-          <div class="pointer flex-align-center" @click="addLableGroup('edit')">
41
+          <div class="pointer flex-align-center" @click="addLableGroup('edit',item)">
42 42
             <img src="../../assets/img/edit.png" alt="">
43 43
             修改
44 44
           </div>
45 45
         </div>
46
-
47 46
       </div>
48 47
     </div>
49
-    <tagGroup ref="tagRef" :source="editOpa"></tagGroup>
50
-
48
+    <tagGroup ref="tagRef" :source="source"></tagGroup>
51 49
   </div>
52 50
 </template>
53 51
 <script>
@@ -62,8 +60,7 @@ export default {
62 60
       tableData: [],
63 61
       resetFlag: false,//重置
64 62
       input_keyword: '',
65
-      editOpa:'add',//判断是新增标签组还是修改标签组
66
-
63
+      source: 'add',//何种方式打开标签组
67 64
     }
68 65
   },
69 66
   directives:{
@@ -86,10 +83,19 @@ export default {
86 83
     addTag(){
87 84
 
88 85
     },
89
-    addLableGroup(opa){
90
-      this.editOpa = opa
86
+    addLableGroup(opa,item){
87
+      this.source = opa
91 88
       this.$nextTick(()=>{
92 89
         this.$refs.tagRef.lableGroup = true
90
+        if(opa=='edit'){
91
+          this.$refs.tagRef.groupName = item.group_name
92
+          this.$refs.tagRef.groupId = item.group_id
93
+          this.$refs.tagRef.moreLable = JSON.parse(JSON.stringify(item.tag_list))
94
+        }else if(opa=='add'){
95
+          this.$refs.tagRef.groupName = ''
96
+          this.$refs.tagRef.groupId = ''
97
+          this.$refs.tagRef.moreLable = [{tag_id:0,tag_name:''}]
98
+        }
93 99
       })
94 100
     },
95 101
     addLable(item){