소스 검색

文章评论

xiaoming_global 5 년 전
부모
커밋
3860af333c

+ 48 - 11
package-lock.json 파일 보기

@@ -114,6 +114,24 @@
114 114
         "any-observable": "^0.3.0"
115 115
       }
116 116
     },
117
+    "@types/node": {
118
+      "version": "12.0.10",
119
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.10.tgz",
120
+      "integrity": "sha512-LcsGbPomWsad6wmMNv7nBLw7YYYyfdYcz6xryKYQhx89c3XXan+8Q6AJ43G5XDIaklaVkK3mE4fCb0SBvMiPSQ=="
121
+    },
122
+    "@types/qrcode": {
123
+      "version": "1.3.3",
124
+      "resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.3.3.tgz",
125
+      "integrity": "sha512-+5vox9KhEPGP+d2ah8V+gnHAaTDvFHssLz8KJS7OgJuessGGybChJYfmo+fwNFzOVUtfcWkTCJqkFDRz15hCYw==",
126
+      "requires": {
127
+        "@types/node": "*"
128
+      }
129
+    },
130
+    "@types/spark-md5": {
131
+      "version": "3.0.1",
132
+      "resolved": "https://registry.npmjs.org/@types/spark-md5/-/spark-md5-3.0.1.tgz",
133
+      "integrity": "sha512-sjiWYRmuuFZMo/DdysQe/yX6x40Q0WZXsNgvbUIg7gUaQYNoXx4CqWq27rDikQyc+0JKkqsoNiIBAA0GUxbUXw=="
134
+    },
117 135
     "JSV": {
118 136
       "version": "4.0.2",
119 137
       "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz",
@@ -4718,7 +4736,8 @@
4718 4736
         "ansi-regex": {
4719 4737
           "version": "2.1.1",
4720 4738
           "bundled": true,
4721
-          "dev": true
4739
+          "dev": true,
4740
+          "optional": true
4722 4741
         },
4723 4742
         "aproba": {
4724 4743
           "version": "1.2.0",
@@ -4739,12 +4758,14 @@
4739 4758
         "balanced-match": {
4740 4759
           "version": "1.0.0",
4741 4760
           "bundled": true,
4742
-          "dev": true
4761
+          "dev": true,
4762
+          "optional": true
4743 4763
         },
4744 4764
         "brace-expansion": {
4745 4765
           "version": "1.1.11",
4746 4766
           "bundled": true,
4747 4767
           "dev": true,
4768
+          "optional": true,
4748 4769
           "requires": {
4749 4770
             "balanced-match": "^1.0.0",
4750 4771
             "concat-map": "0.0.1"
@@ -4759,17 +4780,20 @@
4759 4780
         "code-point-at": {
4760 4781
           "version": "1.1.0",
4761 4782
           "bundled": true,
4762
-          "dev": true
4783
+          "dev": true,
4784
+          "optional": true
4763 4785
         },
4764 4786
         "concat-map": {
4765 4787
           "version": "0.0.1",
4766 4788
           "bundled": true,
4767
-          "dev": true
4789
+          "dev": true,
4790
+          "optional": true
4768 4791
         },
4769 4792
         "console-control-strings": {
4770 4793
           "version": "1.1.0",
4771 4794
           "bundled": true,
4772
-          "dev": true
4795
+          "dev": true,
4796
+          "optional": true
4773 4797
         },
4774 4798
         "core-util-is": {
4775 4799
           "version": "1.0.2",
@@ -4886,7 +4910,8 @@
4886 4910
         "inherits": {
4887 4911
           "version": "2.0.3",
4888 4912
           "bundled": true,
4889
-          "dev": true
4913
+          "dev": true,
4914
+          "optional": true
4890 4915
         },
4891 4916
         "ini": {
4892 4917
           "version": "1.3.5",
@@ -4898,6 +4923,7 @@
4898 4923
           "version": "1.0.0",
4899 4924
           "bundled": true,
4900 4925
           "dev": true,
4926
+          "optional": true,
4901 4927
           "requires": {
4902 4928
             "number-is-nan": "^1.0.0"
4903 4929
           }
@@ -4912,6 +4938,7 @@
4912 4938
           "version": "3.0.4",
4913 4939
           "bundled": true,
4914 4940
           "dev": true,
4941
+          "optional": true,
4915 4942
           "requires": {
4916 4943
             "brace-expansion": "^1.1.7"
4917 4944
           }
@@ -4919,12 +4946,14 @@
4919 4946
         "minimist": {
4920 4947
           "version": "0.0.8",
4921 4948
           "bundled": true,
4922
-          "dev": true
4949
+          "dev": true,
4950
+          "optional": true
4923 4951
         },
4924 4952
         "minipass": {
4925 4953
           "version": "2.3.5",
4926 4954
           "bundled": true,
4927 4955
           "dev": true,
4956
+          "optional": true,
4928 4957
           "requires": {
4929 4958
             "safe-buffer": "^5.1.2",
4930 4959
             "yallist": "^3.0.0"
@@ -4943,6 +4972,7 @@
4943 4972
           "version": "0.5.1",
4944 4973
           "bundled": true,
4945 4974
           "dev": true,
4975
+          "optional": true,
4946 4976
           "requires": {
4947 4977
             "minimist": "0.0.8"
4948 4978
           }
@@ -5023,7 +5053,8 @@
5023 5053
         "number-is-nan": {
5024 5054
           "version": "1.0.1",
5025 5055
           "bundled": true,
5026
-          "dev": true
5056
+          "dev": true,
5057
+          "optional": true
5027 5058
         },
5028 5059
         "object-assign": {
5029 5060
           "version": "4.1.1",
@@ -5035,6 +5066,7 @@
5035 5066
           "version": "1.4.0",
5036 5067
           "bundled": true,
5037 5068
           "dev": true,
5069
+          "optional": true,
5038 5070
           "requires": {
5039 5071
             "wrappy": "1"
5040 5072
           }
@@ -5120,7 +5152,8 @@
5120 5152
         "safe-buffer": {
5121 5153
           "version": "5.1.2",
5122 5154
           "bundled": true,
5123
-          "dev": true
5155
+          "dev": true,
5156
+          "optional": true
5124 5157
         },
5125 5158
         "safer-buffer": {
5126 5159
           "version": "2.1.2",
@@ -5156,6 +5189,7 @@
5156 5189
           "version": "1.0.2",
5157 5190
           "bundled": true,
5158 5191
           "dev": true,
5192
+          "optional": true,
5159 5193
           "requires": {
5160 5194
             "code-point-at": "^1.0.0",
5161 5195
             "is-fullwidth-code-point": "^1.0.0",
@@ -5175,6 +5209,7 @@
5175 5209
           "version": "3.0.1",
5176 5210
           "bundled": true,
5177 5211
           "dev": true,
5212
+          "optional": true,
5178 5213
           "requires": {
5179 5214
             "ansi-regex": "^2.0.0"
5180 5215
           }
@@ -5218,12 +5253,14 @@
5218 5253
         "wrappy": {
5219 5254
           "version": "1.0.2",
5220 5255
           "bundled": true,
5221
-          "dev": true
5256
+          "dev": true,
5257
+          "optional": true
5222 5258
         },
5223 5259
         "yallist": {
5224 5260
           "version": "3.0.3",
5225 5261
           "bundled": true,
5226
-          "dev": true
5262
+          "dev": true,
5263
+          "optional": true
5227 5264
         }
5228 5265
       }
5229 5266
     },

+ 2 - 0
package.json 파일 보기

@@ -36,6 +36,8 @@
36 36
     "url": "https://github.com/PanJiaChen/vue-element-admin/issues"
37 37
   },
38 38
   "dependencies": {
39
+    "@types/qrcode": "^1.3.3",
40
+    "@types/spark-md5": "^3.0.1",
39 41
     "ajv": "^6.5.3",
40 42
     "axios": "0.17.1",
41 43
     "clipboard": "1.7.1",

+ 18 - 0
src/api/act/staffmanager.js 파일 보기

@@ -21,4 +21,22 @@ export function getAllStaffInfo (param,keyword) {
21 21
         method:'Get',
22 22
         params:params
23 23
     })
24
+}
25
+
26
+export function SaveStaffInfo(id,data){
27
+    console.log("id是什么呢?",id)
28
+     return request({
29
+         url:'/api/staff/EditStaffInfo?id='+id,
30
+         method:"Post",
31
+         data:data,
32
+     })
33
+} 
34
+
35
+export function DeleteStaffs(data){
36
+    console.log("删除的数据是?",data)
37
+    return request({
38
+        url:'/api/staff/DeleteStaffs',
39
+        method:"delete",
40
+        data:data,
41
+    })
24 42
 }

+ 43 - 6
src/api/act/submitinfo.js 파일 보기

@@ -18,14 +18,15 @@ export function getArticleType(params){
18 18
      })
19 19
 }
20 20
 
21
-export function GetAllArticles(param,status,keyword,id){
21
+export function GetAllArticles(status,id,keyword,limit,page){
22 22
     const params = {
23
-        param:param,
24 23
         status:status,
25
-        keyword:keyword,
26 24
         id:id,
25
+        keyword:keyword,
26
+        limit:limit,
27
+        page:page
27 28
     }
28
-    console.log("params是什么?",params)
29
+    console.log("params信息",params)
29 30
      return request({
30 31
          url:'/api/acticle/getAllArticles',
31 32
          method:'Get',
@@ -51,7 +52,7 @@ export function GetCategorys(params){
51 52
 }
52 53
 
53 54
 export function EditArticleCategory(id,data){
54
-    console.log("abc",data)
55
+    console.log("abc",id,data)
55 56
     return request({
56 57
         url:'/api/acticle/edit?id='+id,
57 58
         method:'Post',
@@ -116,6 +117,14 @@ export function openDelete(data){
116 117
     })
117 118
 }
118 119
 
120
+export function deleteArticle (id,data){
121
+    console.log("id是多少",id)
122
+    return request({
123
+        url:"/api/article/deleteArticle?id="+id,
124
+        method:"Get",
125
+        data:data
126
+    })
127
+}
119 128
 
120 129
 export function getEditArticle(id,param){
121 130
     console.log("params是啥?",param)
@@ -169,11 +178,39 @@ export function getAllComment(params){
169 178
     })
170 179
 }
171 180
 
172
-export function getArticleCommentDetail(params,id){
181
+export function getArticleCommentDetail(page,limit,title,publicTime,id){
173 182
     console.log("文章评论详情",id)
183
+    const params = {
184
+        page:page,
185
+        limit:limit,
186
+        title:title,
187
+        publicTime:publicTime,
188
+        id:id,
189
+    }
174 190
     return request({
175 191
         url:"/api/acticle/getArticleCommentDetail?id="+id,
176 192
         method:'Get',
177 193
         params:params,
178 194
     })
179 195
 }
196
+
197
+export function send(replycontent,acticlid,parentid){
198
+   const params = {
199
+       replycontent:replycontent,
200
+       acticlid:acticlid,
201
+       parentid:parentid,
202
+   }
203
+   return request({
204
+       url:"/api/acticle/send",
205
+       method:'Get',
206
+       params:params,
207
+   })
208
+}
209
+
210
+export function getReplyAllComents(params){
211
+    return request({
212
+       url:"/api/acticle/getReplyAllComents",
213
+       method:'Get',
214
+       params:params,
215
+    })
216
+}

+ 5 - 5
src/scrm_pages/article/acticleCategory.vue 파일 보기

@@ -8,7 +8,6 @@
8 8
         <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
9 9
           <el-checkbox style="width: 30px" @change="changeCheck" v-model="checkAllStatus">全选</el-checkbox>
10 10
           <el-button size="small" icon="el-icon-delete" @click="openDeleteCategorys">批量删除</el-button>
11
-
12 11
         </div>
13 12
 
14 13
         <el-row :gutter="12" style="margin-top: 10px">
@@ -135,17 +134,20 @@
135 134
         GetCategorys(this.listQuery).then(response=>{
136 135
              console.log(response.data.state)
137 136
              if(response.data.state === 1){
138
-               this.articsData = response.data.data.category 
137
+               this.articsData = response.data.data.category; 
139 138
                console.log(this.articsData)
140
-               this.total = response.data.data.total
139
+               this.total = response.data.data.total;
140
+               console.log("多少",this.total)
141 141
              }
142 142
         })
143 143
       },
144 144
        handleSizeChange(limit) {
145
+            console.log("为什么",limit)
145 146
             this.listQuery.limit = limit;
146 147
             this.GetCategorys();
147 148
         },
148 149
         handleCurrentChange(page) {
150
+            console.log("为啥",page)
149 151
             this.listQuery.page = page;
150 152
             this.GetCategorys();
151 153
         },
@@ -155,8 +157,6 @@
155 157
                  this.articData[key] = row[key]
156 158
                }
157 159
             }
158
-            console.log("是什么",this.articData) 
159
-            console.log("heh",this.articsData)  
160 160
              this.artilceIndex = index 
161 161
              this.$refs.editArticleForm.open();        
162 162
         },

+ 1 - 1
src/scrm_pages/article/articleComment.vue 파일 보기

@@ -22,7 +22,7 @@
22 22
           </el-table-column>
23 23
 
24 24
           <el-table-column label="评论状态" align="center">
25
-            <template>
25
+            <template  slot-scope="scope">
26 26
               <span>正常</span>
27 27
             </template>
28 28
           </el-table-column>

+ 181 - 11
src/scrm_pages/article/articleCommentDetail.vue 파일 보기

@@ -8,14 +8,59 @@
8 8
              <div class="title">{{listQuerty.title}}</div>
9 9
              <div>{{listQuerty.publicTime}}</div>
10 10
              <div class="sort">已按最新热度排序</div>
11
-            <div class="border"></div>          
11
+            <div class="border"></div>            
12
+            <div v-for="item in comments" :key="item.id">
13
+                <div class="img">
14
+                    <img :src="item.comment_user_avater" style="width:50px;height:50px">
15
+                </div>               
16
+                <div class="commentname">
17
+                    {{item.comment_user_name}}
18
+                    <span class="fortime">{{format(item.ctime)}}</span>
19
+                </div>
20
+                <div class="reply">
21
+                    |&nbsp;&nbsp;<span  @click="replyComments(item.id)">回复</span>&nbsp;&nbsp;
22
+                    |&nbsp;&nbsp;<span @click="spread()" id="copy" v-show="show">{{word}}</span>&nbsp;&nbsp;|
23
+                    &nbsp;&nbsp;删除&nbsp;&nbsp;
24
+                </div>
25
+                <div class="content">
26
+                    {{item.content}}
27
+                </div> 
28
+               <div class="reply_box" v-show="showindex===item.id">
29
+                        <textarea name="" id="" cols="156" rows="5" class="reply " placeholder="回复:" v-model="form.replycontent"></textarea>
30
+                        <div class="clearfix"></div>
31
+                        <div class="button" style="display: block;">
32
+                            <el-button @click="cancel()">取消</el-button>
33
+                            <el-button type="primary" @click="send(item)">发送</el-button>
34
+                       </div>
35
+                </div>
36
+                 <div class="reviewed" v-show="shows">
37
+                     <div v-for="(child) in item.childs" :key="child.id">
38
+                     你&nbsp;回复了&nbsp;{{item.comment_user_name}}:{{child.content}}
39
+                     <div  id="tub" class="el-icon-error" @click="clear()"></div>
40
+                     </div>
41
+                </div>           
42
+            <div class="border"></div>  
43
+           </div>
44
+             <el-pagination
45
+               @size-change="handleSizeChange"
46
+               @current-change="handleCurrentChange"
47
+               :page-sizes="[10,20,50,100]"
48
+               :page-size="10"
49
+               background
50
+               style="margin-top:20px;float: right"
51
+               layout="total, sizes, prev, pager, next, jumper"
52
+               :total="total">
53
+             </el-pagination>   
12 54
         </div>
13 55
      </div>
14 56
 </template>
15 57
 
16 58
 <script>
17 59
    import BreadCrumb from '../components/bread-crumb'
18
-   import { getArticleCommentDetail } from '@/api/act/submitinfo'
60
+   import { getArticleCommentDetail,send } from '@/api/act/submitinfo'
61
+   import {getFileExtension,uParseTime} from '@/utils/tools'
62
+import { constants } from 'crypto';
63
+import { truncateSync } from 'fs';
19 64
     export default {
20 65
         name: "articleCommentDetail",
21 66
         components:{
@@ -28,26 +73,104 @@
28 73
                    { path: '/articles/articleComment', name: '文章评论详情' }
29 74
                 ],
30 75
                 listQuerty:{
76
+                   page:1,
77
+                   limit:10,
31 78
                    title:'',
32 79
                    publicTime:'',
33
-                }
80
+                   id:0,
81
+                },
82
+                total:0,
83
+                comments:[],
84
+                show:true,
85
+                shows:false,
86
+                showindex:-1,
87
+                form:{
88
+                  replycontent:'',  
89
+                },
34 90
              }
35 91
          },
36
-         created(){
37
-            this.getArticleCommentDetail(); 
38
-         },
39 92
          methods:{
40 93
              getArticleCommentDetail(){
41 94
                  const id = this.$route.params && this.$route.params.id
42 95
                  console.log("id",id)
43
-                 getArticleCommentDetail(this.listQuerty,id).then(response=>{
96
+                 getArticleCommentDetail(this.listQuerty.page,this.listQuerty.limit,this.listQuerty.title,this.listQuerty.publicTime,id).then(response=>{
44 97
                         if(response.data.state == 1){
45
-                            var articles = response.data.data.articles
46
-                            this.listQuerty.title = articles.title
47
-                            this.listQuerty.publicTime =  articles.publicTime
98
+                            var articles = response.data.data.articles;
99
+                            var comment =  response.data.data.comment;
100
+                            this.comments =  response.data.data.comment;
101
+                             for (let index = 0; index < this.comments.length; index++) {
102
+                                        
103
+                                 this.$set(this.comments[index], "childs", []);                      
104
+                             }
105
+                            console.log("评论信息",this.comments);
106
+                            this.total =  response.data.data.total;
107
+                            console.log("total",this.total);
108
+                            var orgname = response.data.data.orgName;
109
+                            console.log("orgname",orgname);
110
+                            var orgID =   response.data.data.orgID;
111
+                            console.log("orgID",orgID);
112
+                            this.listQuerty.title = articles.title;
113
+                            this.listQuerty.publicTime =  articles.publicTime;
48 114
                             console.log("内容是设么",articles)
49 115
                         }
50 116
                  })
117
+             },
118
+          handleSizeChange(limit) {
119
+            this.listQuery.limit = limit;
120
+            this.getArticleCommentDetail();
121
+          },
122
+          handleCurrentChange(page){
123
+            this.listQuerty.page = page;
124
+            this.getArticleCommentDetail();
125
+          }, 
126
+          format(time){
127
+              return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}"); 
128
+          },
129
+          replyComments(id){
130
+              this.showindex = id;
131
+
132
+          },
133
+          cancel(){
134
+              this.showindex = -1;
135
+          },
136
+          spread(){
137
+             
138
+          },
139
+          send(parent){
140
+              const articid = this.$route.params && this.$route.params.id;
141
+              console.log("文章id",articid);
142
+               console.log("父类id",parent.id)
143
+               var replycontent =  this.form.replycontent;
144
+               if(replycontent == ""){
145
+                  this.$message.error("回复内容不能为空");
146
+                  this.shows = false;
147
+               }else{
148
+                   this.shows = true;
149
+                   send(replycontent,articid,parent.id).then(response=>{
150
+                   if(response.data.state ==1){
151
+                      var comment = response.data.data.comment;
152
+                      parent.childs.push(comment)
153
+                      console.log("内容",comment)
154
+                      console.log(parent.childs)
155
+                  }
156
+                })
157
+               }
158
+          },
159
+          clear(){
160
+             this.shows = false;
161
+          }
162
+         },
163
+          created(){
164
+            this.getArticleCommentDetail(); 
165
+         },
166
+         computed:{
167
+             word:function(){
168
+                if(this.show == true){
169
+                   return "展开";   
170
+                }
171
+                if(this.show == false){
172
+                    return "收起";
173
+                }
51 174
              }
52 175
          }
53 176
     }
@@ -57,7 +180,7 @@
57 180
 <style scoped>
58 181
    .border{
59 182
        border: 1px #dcdfe6 solid;
60
-       margin-top: 30px;
183
+       margin-top: 150px;
61 184
    }
62 185
    .title{
63 186
        font-size: 25px;
@@ -67,4 +190,51 @@
67 190
       float: right;
68 191
       font-size: 18px;
69 192
    }
193
+   .commentname{
194
+       margin-top: 20px;
195
+       font-size: 20px;
196
+       color: blue;
197
+       margin-left: 100px;
198
+   }
199
+   .reply{
200
+       float: right;
201
+       margin-top: -20px;
202
+       font-size: 20px;
203
+       color: #495060;
204
+   }
205
+   .content{
206
+       font-size: 20px;
207
+       margin-top: 15px;
208
+       margin-left: 100px;
209
+   }
210
+   .fortime{
211
+       font-size: 15px;
212
+       color: #495060;
213
+   }
214
+   .img{
215
+       float: left;
216
+       
217
+   }
218
+   .reply_box{
219
+       margin-top: 30px;
220
+   }
221
+   .button{
222
+       float: right;
223
+       margin-top: 5px;
224
+            
225
+   }
226
+   .reviewed{
227
+       float: right;
228
+       margin-top: 30px;
229
+       margin-left: 100px;
230
+       padding-top: 16px;
231
+       width: 1580px;
232
+       height:50px;
233
+       font-size: 15px;
234
+       border:1px solid #f4f7fa;
235
+       background-color: #f4f7fa;
236
+   }
237
+    #tub{
238
+      float: right;
239
+   }
70 240
 </style>

+ 99 - 72
src/scrm_pages/article/articleList.vue 파일 보기

@@ -8,7 +8,7 @@
8 8
           <div style="margin-bottom: 10px">
9 9
             <el-row :gutter="24">
10 10
               <el-col :span="8">
11
-                  <el-input style="width: 300px" v-model="keyword"  placeholder="请输入您需要搜索的内容"></el-input>
11
+                  <el-input style="width: 300px" v-model="listQuery.keyword"  placeholder="请输入您需要搜索的内容"></el-input>
12 12
                   <el-button type="primary"  icon="el-icon-search" @click="changeKey()">搜索</el-button>
13 13
               </el-col>
14 14
             </el-row>
@@ -33,25 +33,30 @@
33 33
               </ul>
34 34
             </div>
35 35
           </div>
36
-          <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
36
+
37
+            <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
38
+              <el-checkbox style="width: 30px">全选</el-checkbox> 
39
+              <el-button size="small" icon="el-icon-delete">批量删除</el-button>
40
+            </div> 
41
+           <!-- <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
37 42
             <el-checkbox style="width: 30px" @change="changeCheck" v-model="checkAllStatus">全选</el-checkbox>
38
-            <el-button size="small" icon="el-icon-delete" @click="openDeletearticles">批量删除</el-button>
39
-          </div>
40
-          <el-table ref="multipleTable" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="articsData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;"  @selection-change="handleSelectionChange">
43
+            <el-button size="small" icon="el-icon-delete">批量删除</el-button>
44
+          </div> -->
45
+          <!-- <el-table ref="multipleTable" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="articsData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;"  @selection-change="handleSelectionChange">
41 46
               <el-table-column
42
-                align="center" 
47
+                align="center"
43 48
                 type="selection"
44 49
                 width="55">
45
-              </el-table-column> 
50
+              </el-table-column>
46 51
              <el-table-column label="文章图片" align="center">
47 52
                <template slot-scope="scope">
48 53
                   <div class="parent">
49
-                 <span class="text">已发布</span>  
54
+                 <span class="text">已发布</span>
50 55
                  <div class="triangle-topleft">
51
-                       
56
+
52 57
                  </div>
53 58
                 <img :src="memberAvatar(scope.row)" style="width:100%;height:100%">
54
-          </div>     
59
+          </div>
55 60
                </template>
56 61
              </el-table-column>
57 62
             <el-table-column label="文章标题" align="center">
@@ -89,7 +94,14 @@
89 94
                 </el-tooltip>
90 95
               </template>
91 96
             </el-table-column>
92
-          </el-table>
97
+          </el-table> -->
98
+          
99
+             <template v-for="(article,index) in articsData">
100
+               <published-cell v-if="article.status == 1" :article="article"  :key="index" @delete="deleteArticle(article.id, index)"></published-cell>
101
+               <published-cell v-if="article.status == 2" :article="article"  :key="index" @delete="deleteArticle(article.id, index)"></published-cell>
102
+               <published-cell v-if="article.status == 3" :article="article"  :key="index" @delete="deleteArticle(article.id, index)"></published-cell>
103
+             </template>
104
+         
93 105
           <el-pagination
94 106
             @size-change="handleSizeChange"
95 107
             @current-change="handleCurrentChange"
@@ -106,11 +118,13 @@
106 118
 
107 119
 <script>
108 120
   import BreadCrumb from '../components/bread-crumb'
109
-  import { GetAllArticles,openDelete} from '@/api/act/submitinfo'
121
+  import { GetAllArticles,deleteArticle} from '@/api/act/submitinfo'
122
+  import PublishedCell from "@/scrm_pages/article/components/published_cell"
110 123
   export default {
111 124
     name: 'commentList',
112 125
     components:{
113
-      BreadCrumb
126
+      BreadCrumb,
127
+      PublishedCell,
114 128
     },
115 129
     inject:['reload'],
116 130
     data(){
@@ -128,44 +142,44 @@
128 142
             limit:10,
129 143
             classid:'',
130 144
             name:'',
145
+            keyword:'',
131 146
         },
132 147
         articsData:[],
133 148
         total:0,
134
-        selecting_status:'',
135
-        keyword:'',
136 149
         dialogVisible: false,
137
-         checkAllStatus:false,
150
+        checkAllStatus:false,
151
+        selecting_status:'',
138 152
       }
139 153
     },
140 154
     methods:{
141
-         GetAllArticles(){
142
-              GetAllArticles(this.listQuery,this.selecting_status,this.keyword,this.listQuery.classid).then(response=>{
155
+           GetAllArticles(){
156
+              GetAllArticles(this.selecting_status,this.listQuery.classid,this.listQuery.keyword,this.listQuery.limit,this.listQuery.page).then(response=>{
143 157
                      if(response.data.state === 1){
144
-                        this.articsData = response.data.data.articles  
158
+                        this.articsData = response.data.data.articles
145 159
                         this.total = response.data.data.total
146 160
                         console.log("文章列表",this.articsData)
147
-                        console.log("total",this.total)                                                   
161
+                        console.log("total",this.total)
148 162
                      }
149 163
                      if(typeof(response.data.data.category != 'undefined')){
150 164
                        this.tagOptions = response.data.data.category
151
-                        console.log("分类列表",this.tagOptions)                      
165
+                        console.log("分类列表",this.tagOptions)
152 166
                      }
153 167
               })
154 168
          },
155 169
          selectsign(id){
156
-           console.log("id",id)
170
+            console.log("id",id)
157 171
             this.listQuery.classid = id;
158 172
             this.listQuery.name = name;
159 173
             this.tagType = id;
160 174
             this.GetAllArticles();
161 175
          },
162
-          handleSizeChange(limit) {
163
-            this.listQuery.limit = limit;
164
-            this.GetAllAritcles();
176
+         handleSizeChange(limit) {
177
+          this.listQuery.limit = limit;
178
+          this.GetAllArticles();
165 179
         },
166 180
          handleCurrentChange(page) {
167
-            this.listQuery.page = page;
168
-            this.GetAllAritcles();
181
+          this.listQuery.page = page;
182
+          this.GetAllArticles();
169 183
         },
170 184
         changeKey(){
171 185
            this.GetAllArticles();
@@ -177,6 +191,7 @@
177 191
            this.$router.push({path:'/articles/createArticle'})
178 192
         },
179 193
         changeSelectingStatus(status){
194
+          console.log("status是多少?",status)
180 195
           this.selecting_status = status;
181 196
           this.GetAllArticles();
182 197
         },
@@ -186,65 +201,77 @@
186 201
               dangerouslyUseHTMLString:true,
187 202
              confirmButtonText: '确定',
188 203
              cancelButtonText: '取消',
189
-             type: 'warning' 
204
+             type: 'warning'
190 205
             }).then(()=>{
191 206
                 var ids = [];
192 207
                 ids.push(row.id);
193 208
                 openDelete({ids:ids}).then(response=>{
194 209
                     this.articsData.splice(index,1);
195 210
                     this.$message.success("删除成功");
196
-                }).catch(e=>{});       
211
+                }).catch(e=>{});
197 212
           }).catch(e=>{});
198 213
         },
199
-         
214
+
200 215
           handleSelectionChange(val){
201 216
              this.selectedArticles = val;
202 217
          },
203
-         changeCheck(){
204
-          this.$refs.multipleTable.clearSelection();
205
-           if (this.checkAllStatus) {
206
-            this.$refs.multipleTable.toggleAllSelection();
207
-            }
208
-          },
209
-
210
-          openDeletearticles(){
211
-            if (this.selectedArticles.length==0) {
212
-              this.$message.error("请选择要删除的信息");
213
-            return false;
214
-           } 
215
-           this.$confirm('确定要删除吗?删除后信息将无法恢复!','删除提示',{
218
+           deleteArticle(id,index){
219
+             this.$confirm('确定要删除吗?删除后信息将无法恢复!','删除提示',{
216 220
                dangerouslyUseHTMLString:true,
217
-               confirmButtonText: '确定',
218
-               cancelButtonText: '取消',
219
-               type: 'warning'
220
-           }).then(()=>{
221
-                var ids = [];
222
-                var idMap = {};
223
-                for (const index in this.selectedArticles) {
224
-                ids.push(this.selectedArticles[index].id);
225
-                idMap[this.selectedArticles[index].id] = this.selectedArticles[index].id;
226
-            }
227
-               openDelete({ids:ids}).then(response=>{
228
-                   if(response.data.state == 1){
229
-                         var articsDatalength = this.articsData.length;
230
-                     for (let index = articsDatalength-1; index >= 0; index--) {
231
-                    if(this.articsData[index].id in idMap) {
232
-                    this.articsData.splice(index, 1);
233
-                   }                  
234
-                 }
235
-                  this.$message.success("删除成功");   
221
+                confirmButtonText: '确定',
222
+                cancelButtonText: '取消',
223
+                type: 'warning'
224
+             }).then(()=>{
225
+                     deleteArticle(id).then(response=>{
226
+                if(response.data.state==1){
227
+                    this.articsData.splice(index,1)
228
+                    this.$message.success("删除成功")
236 229
                 }else{
237
-                   this.$message.success("删除失败");   
238
-                 }
239
-               }).catch(e=>{});
240
-           }).catch(() => {
241
-              return false        
242
-           }); 
243
-          }
230
+                  this.$message.error(response.msg)
231
+                }
232
+              }).catch(e=>{});
233
+             }).catch(() => {
234
+               return false
235
+            });        
236
+           }
237
+          // openDeletearticles(){
238
+          //   if (this.selectedArticles.length==0) {
239
+          //     this.$message.error("请选择要删除的信息");
240
+          //   return false;
241
+          //  }
242
+          //  this.$confirm('确定要删除吗?删除后信息将无法恢复!','删除提示',{
243
+          //      dangerouslyUseHTMLString:true,
244
+          //      confirmButtonText: '确定',
245
+          //      cancelButtonText: '取消',
246
+          //      type: 'warning'
247
+          //  }).then(()=>{
248
+          //       var ids = [];
249
+          //       var idMap = {};
250
+          //       for (const index in this.selectedArticles) {
251
+          //       ids.push(this.selectedArticles[index].id);
252
+          //       idMap[this.selectedArticles[index].id] = this.selectedArticles[index].id;
253
+          //   }
254
+          //      openDelete({ids:ids}).then(response=>{
255
+          //          if(response.data.state == 1){
256
+          //                var articsDatalength = this.articsData.length;
257
+          //            for (let index = articsDatalength-1; index >= 0; index--) {
258
+          //           if(this.articsData[index].id in idMap) {
259
+          //           this.articsData.splice(index, 1);
260
+          //          }
261
+          //        }
262
+          //         this.$message.success("删除成功");
263
+          //       }else{
264
+          //          this.$message.success("删除失败");
265
+          //        }
266
+          //      }).catch(e=>{});
267
+          //  }).catch(() => {
268
+          //     return false
269
+          //  });
270
+          // },
244 271
     },
245 272
     created(){
246
-      this.GetAllArticles()
247
-    }
273
+      this.GetAllArticles();
274
+    },
248 275
   }
249 276
 </script>
250 277
 
@@ -269,6 +296,6 @@
269 296
         border-top: 70px solid yellow;
270 297
         border-right: 70px solid transparent;
271 298
         position: relative;
272
-        margin-top: -140px;       
299
+        margin-top: -140px;
273 300
     }
274 301
 </style>

+ 154 - 40
src/scrm_pages/article/commentList.vue 파일 보기

@@ -4,22 +4,57 @@
4 4
           <bread-crumb :crumbs='crumbs'></bread-crumb>
5 5
         </div>
6 6
         <div class="app-container">
7
-          <div class="parent">
8
-                 <span class="text"></span>  
9
-                 <div class="triangle-topleft">
10
-                   
7
+            <div class="pl">
8
+              <el-checkbox><span class="comment">全部评论</span></el-checkbox>      
9
+            </div> 
10
+            <div class="border2"></div>
11
+            <div v-for="item in comments" :key="item.id">
12
+            <div class="check"><el-checkbox></el-checkbox></div>
13
+            <div class="img">
14
+                 <img :src="item.comment_user_avater" style="width:50px;height:50px">
15
+            </div>
16
+             <div>
17
+                <div class="commentname">{{item.comment_user_name}}<span class="time">{{item.ctime}}</span></div>
18
+                <div class="reply">
19
+                  |&nbsp;&nbsp;<span @click="replay()">回复</span>&nbsp;&nbsp;
20
+                  |&nbsp;&nbsp;展开&nbsp;&nbsp;
21
+                  |&nbsp;&nbsp;删除&nbsp;&nbsp;
22
+                  </div>
23
+                <div class="content">
24
+                  {{item.content}}
25
+                 </div> 
26
+                  <div class="reply_box" v-if="show">
27
+                        <textarea name="" id="" cols="163" rows="5" class="reply " placeholder="回复:"></textarea>
28
+                        <div class="clearfix"></div>
29
+                        <div class="button" style="display: block;" myAttr="123">
30
+                            <el-button @click="cancel()">取消</el-button>
31
+                            <el-button type="primary" @click="send()">发送</el-button>
32
+                       </div>
11 33
                  </div>
12
-                <div class="title">
13
-                  已使用
14
-                </div>
15
-                 <img src="/static/images/a.jpg" style="width:100%;height:100%">
16
-          </div>           
34
+                  <div class="reviewed" v-if="shows">
35
+                     你&nbsp;回复了&nbsp;:
36
+                  </div>   
37
+                <div class="border"></div>  
38
+             </div>  
39
+            </div>
40
+              <el-pagination
41
+               @size-change="handleSizeChange"
42
+               @current-change="handleCurrentChange"
43
+               :page-sizes="[10,20,50,100]"
44
+               :page-size="10"
45
+               background
46
+               style="margin-top:20px;float: right"
47
+               layout="total, sizes, prev, pager, next, jumper"
48
+               :total="total">
49
+             </el-pagination>             
17 50
         </div>
18 51
     </div>
19 52
 </template>
20 53
 
21 54
 <script>
22
-  import BreadCrumb from '../components/bread-crumb'
55
+   import BreadCrumb from '../components/bread-crumb'
56
+   import {getReplyAllComents} from '@/api/act/submitinfo'
57
+import { constants } from 'crypto';
23 58
   export default {
24 59
     name: 'commentList',
25 60
     components:{
@@ -31,42 +66,121 @@
31 66
           { path: false, name: '文章管理' },
32 67
           { path: '/articles/commentList', name: '评论列表' }
33 68
         ],
69
+        show:false,
70
+        shows:false,
71
+        form:{
72
+          page:1,
73
+          limit:10,
74
+          comment_user_name:'',
75
+          content:'',
76
+          comment_user_avater:'',
77
+        },
78
+        comments:[],
79
+        total:0,
34 80
       }
35 81
     },
36 82
     methods:{
83
+      replay(){
84
+        this.show = true;
85
+      },
86
+      cancel(){
87
+        this.show = false;
88
+      },
89
+      send(){
90
+        this.shows = true;
91
+      },
92
+      handleSizeChange(limit){
93
+         this.form.limit = limit;
94
+         this.getReplyAllComents();
95
+      },
96
+      handleCurrentChange(page){
97
+         this.form.page = page;
98
+         this.getReplyAllComents();
99
+      },
100
+        getReplyAllComents(){
101
+          getReplyAllComents(this.form).then(response=>{
102
+               if(response.data.state ==1){
103
+                var comments =  response.data.data.comments;
104
+                this.comments =  response.data.data.comments;
105
+                 console.log("评论列表",comments)
106
+                var total =  response.data.data.total;
107
+                 this.total =  response.data.data.total;
108
+                 console.log("总条数",total)
109
+               }
110
+          });
111
+        }
112
+    },
113
+    created(){
114
+      this.getReplyAllComents();
37 115
     }
38 116
   }
39 117
 </script>
40 118
 
41 119
 <style scoped>
42
-    .parent{
43
-        position: relative;
44
-        width: 200px;
45
-        height: 200px;
46
-        background: yellow;
47
-        font-size: 6px;
48
-    }
49
-    .parent .text{
50
-        display: inline-block;
51
-        transform: rotate(-45deg);
52
-        padding: 20px;
53
-        color: #fff;
54
-        position: relative;
55
-    }
56
-   .triangle-topleft{
57
-        width: 0;
58
-        height: 0;
59
-        border-top: 100px solid red;
60
-        border-right: 100px solid transparent;
61
-        position: relative;
62
-        margin-top: -42px;
63
-        top: 0px;
64
-        z-index: 0;   
65
-    }
66
-    .title{
67
-       transform: rotate(-45deg);
68
-       position: relative;
69
-       margin-top: -115px;
70
-       margin-left: -8px;
71
-    }
120
+
121
+      .border{
122
+       border: 1px #dcdfe6 solid;
123
+       margin-top: 140px;
124
+     }
125
+     .border2{
126
+       border: 1px #dcdfe6 solid;
127
+     }
128
+     .comment{
129
+       font-size: 20px;
130
+       color: black;
131
+       font-weight: 700;
132
+     }
133
+
134
+     .commentname{
135
+       margin-top: 20px;
136
+       font-size: 20px;
137
+       color: blue;
138
+       margin-left: 100px;
139
+   }
140
+   .reply{
141
+       float: right;
142
+       margin-top: -20px;
143
+       font-size: 20px;
144
+       color: #495060;
145
+   }
146
+   .content{
147
+       font-size: 20px;
148
+       margin-top: 15px;
149
+       margin-left: 100px;
150
+   }
151
+   .check{
152
+      margin-top: 20px;
153
+      float: left;
154
+   }
155
+   .time{
156
+     color: #495060;
157
+   }
158
+    .reply_box{
159
+       margin-top: 30px;
160
+   }
161
+   .button{
162
+       float: right;
163
+       margin-top: 5px;
164
+            
165
+   }
166
+     .reviewed{
167
+       float: right;
168
+       margin-top: 30px;
169
+       margin-left: 100px;
170
+       padding-top: 16px;
171
+       width: 1650px;
172
+       height:50px;
173
+       font-size: 15px;
174
+       border:1px solid #f4f7fa;
175
+       background-color: #f4f7fa;
176
+   }
177
+
178
+   .pl{
179
+     margin-bottom: 50px;
180
+   }
181
+   .img{
182
+     float: left;
183
+     margin-left: 20px;
184
+     margin-top: 20px;
185
+   }
72 186
 </style>

+ 1 - 0
src/scrm_pages/article/components/EditArticleForm.vue 파일 보기

@@ -89,6 +89,7 @@ export default {
89 89
                            console.log("返回响应",res.state)
90 90
                            if(res.state ===1 ){
91 91
                               var categorys = res.data.category; 
92
+                              console.log(categorys)
92 93
                               console.log("categorys是什么",categorys.name)
93 94
                               this.articsData[this.artilceIndex].name = categorys.name;
94 95
                               this.articsData[this.artilceIndex].summary = categorys.summary;

+ 185 - 0
src/scrm_pages/article/components/published_cell.vue 파일 보기

@@ -0,0 +1,185 @@
1
+<template>
2
+    <div class="clearfix">      
3
+    <div class="published-cell">
4
+        <div class="checkbox">
5
+            <el-checkbox></el-checkbox>
6
+        </div>
7
+        <div class="activity-image-panel">
8
+            <span class="status-text">{{status_text}}</span>
9
+            <img :src="article.imgs"/>
10
+        </div>
11
+        <div class="activity-info-panel">
12
+            <h3 class="title">
13
+                 <a>{{article.title}}</a>
14
+            </h3>
15
+            <div class="statistics">
16
+                阅读:{{article.real_read_num}} 丨 评论:{{article.comment_num}} 丨 点赞:{{article.star_num}}
17
+            </div>
18
+             <div>
19
+               <el-tooltip class="item" effect="dark" content="编辑" placement="top">
20
+                 <el-button
21
+                   size="mini"
22
+                   type="primary"
23
+                   icon="el-icon-edit-outline"
24
+                   @click="$router.push('/articles/editArticle/'+article.id)">
25
+                 </el-button>
26
+               </el-tooltip>
27
+               <el-tooltip class="item" effect="dark" content="删除" placement="top">
28
+                 <el-button
29
+                   size="mini"
30
+                   type="danger"
31
+                   icon="el-icon-delete"
32
+                   @click="deleteArticle()">
33
+                 </el-button>
34
+               </el-tooltip>
35
+             </div>
36
+        </div>
37
+        <div class="activity-time-panel">
38
+            <span class="center">酷医演示中心</span>
39
+            <span class="time">2019-06-08</span>
40
+        </div>
41
+    </div>
42
+</div>
43
+</template>
44
+
45
+<script>
46
+  import { parseTime } from "@/utils"
47
+    export default {
48
+        name: "published_cell",
49
+         props: {
50
+            article: {
51
+            type: Object,
52
+            required: true,
53
+        }
54
+    },
55
+        data(){
56
+          return{
57
+            show:false,
58
+          }
59
+        },
60
+      computed:{
61
+        status_text: function() {
62
+          if (this.article.article_status== 1) {
63
+            return "已发布"
64
+          } else if (this.article.article_status == 2) {
65
+            return "草稿"
66
+          }else{
67
+            return "未通过"
68
+          }
69
+        },
70
+        start_time: function() {
71
+          return parseTime(this.article.ctime, "{y}-{m}-{d} {h}-{i}")
72
+        },
73
+      },
74
+      methods:{
75
+         deleteArticle(){
76
+           this.$emit("delete")
77
+         },
78
+      
79
+     }
80
+    }
81
+</script>
82
+
83
+<style scoped rel="stylesheet/scss" lang="scss">
84
+   .published-cell {
85
+    padding: 20px 15px;
86
+    border: none;
87
+    border-bottom: 1px solid #e5e8ea;
88
+    float: left;
89
+    margin: 0;
90
+    width: 100%;
91
+    border-radius: 0;
92
+    position: relative;
93
+
94
+    .activity-image-panel {
95
+        width: 155px;
96
+        height: 122px;
97
+        border: 1px #dee2e5 solid;
98
+        display: flex;
99
+        justify-content: center;
100
+        position: relative;
101
+        -webkit-border-radius: 4px;
102
+        -moz-border-radius: 4px;
103
+        border-radius: 4px;
104
+        overflow: hidden;
105
+        float: left;
106
+
107
+        .status-text {
108
+            position: absolute;
109
+            font-size: 12px;
110
+            color: #fff;
111
+            top: 14px;
112
+            left: 3px;
113
+            -webkit-transform: rotate(316deg);
114
+            transform: rotate(316deg);
115
+        }
116
+
117
+        img {
118
+            width: 100%;
119
+            height: 100%;
120
+            object-fit: cover;
121
+            object-position: center;
122
+        }
123
+    }
124
+    .activity-image-panel::before {
125
+        border-top: 28px solid #5bd18b;
126
+        border-right: 28px solid transparent;
127
+        border-bottom: 28px solid transparent;
128
+        border-left: 28px solid #5bd18b;
129
+        position: absolute;
130
+        top: 0;
131
+        left: 0;
132
+        width: 0;
133
+        height: 0;
134
+        display: block;
135
+        content: "";
136
+    }
137
+
138
+    .activity-info-panel {
139
+        padding: 7px 20px;
140
+        width: 60%;
141
+        float: left;
142
+
143
+        .title {
144
+            padding-bottom: 5px;
145
+
146
+            a {
147
+                color: #495060;
148
+                font-size: 20px;
149
+                max-width: 100%;
150
+                font-weight: 500;
151
+                overflow: hidden;
152
+                white-space: nowrap;
153
+                text-overflow: ellipsis;
154
+                display: inline-block;
155
+            }
156
+        }
157
+
158
+        .statistics {
159
+            color: #a8b3ba;
160
+            font-size: 15px;
161
+            justify-content: space-between;
162
+            line-height: 30px;
163
+        }
164
+    }
165
+
166
+    .activity-time-panel {
167
+        float: right;
168
+        padding: 7px 0;
169
+
170
+        .time {
171
+            font-size: 15px;
172
+            color: #a8b3ba;
173
+        }
174
+    }
175
+    .center{
176
+        font-size:15px;
177
+        color: #a8b3ba;
178
+    }
179
+    .checkbox{
180
+        float:left;
181
+        position: relative;
182
+        left:-10px;
183
+    }
184
+}
185
+</style>

+ 1 - 1
src/scrm_pages/members/components/CreateMemberForm.vue 파일 보기

@@ -24,7 +24,7 @@
24 24
                     </el-col>
25 25
                     <el-col :span="12">
26 26
                         <el-form-item label="生日:" required prop="birthday">
27
-                            <el-date-picker v-model="form.birthday" prefix-icon="el-icon-date" :editable="false" style="width: 100%;" type="date" placeholder="请选择日期" align="right" format="yyyy-MM-dd" value-format="yyyy-MM-dd" ></el-date-picker>
27
+                            <el-date-picker v-model="form.birthday" prefix-icon="el-icon-date" :editable="false" style="width: 100%;" type="date" placeholder="请选择日期" align="right" format="yyyy-MM-dd" value-format="yyyy-MM-dd"></el-date-picker>
28 28
                         </el-form-item>
29 29
                     </el-col>
30 30
                 </el-row>

+ 1 - 0
src/scrm_pages/members/components/EditMemberForm.vue 파일 보기

@@ -234,6 +234,7 @@ export default {
234 234
                         var res = response.data;
235 235
                         if(res.state === 1) {
236 236
                             var member = res.data.member;
237
+                            console.log("member是什么?",member)
237 238
                             this.membersData[this.memberIndex].name = member.name;
238 239
                             this.membersData[this.memberIndex].avatar = member.avatar;
239 240
                             this.membersData[this.memberIndex].mobile = member.mobile;

+ 15 - 20
src/scrm_pages/systemsetting/components/CreateStaffForm.vue 파일 보기

@@ -37,9 +37,9 @@
37 37
                   </el-col>
38 38
                 </el-row>
39 39
                 <el-row>
40
-                    <el-col :span="8">
40
+                    <el-col :span="16">
41 41
                         <el-form-item label="员工职称:" required prop="user_type">
42
-                          <template>
42
+                          
43 43
                             <el-select v-model="form.user_type" placeholder="请选择">
44 44
                              <el-option
45 45
                                 v-for="item in user_types"
@@ -48,13 +48,8 @@
48 48
                                 :value="item.index">
49 49
                              </el-option>
50 50
                             </el-select>
51
-                          </template>
52
-                        </el-form-item>
53
-                    </el-col>
54 51
 
55
-                  <el-col :span="6">
56
-                      <template>
57
-                        <el-select v-model="form.user_title"  placeholder="请选择">
52
+                            <el-select v-model="form.user_title"  placeholder="请选择"> 
58 53
                           <el-option
59 54
                             v-for="item in user_titles"
60 55
                             :key="item.index"
@@ -62,8 +57,8 @@
62 57
                             :value="item.index">
63 58
                           </el-option>
64 59
                         </el-select>
65
-                      </template>
66
-                  </el-col>
60
+                        </el-form-item>
61
+                    </el-col>              
67 62
                   <el-col :span="4">
68 63
                       <el-form-item label="医生头像:" required prop="dochead">
69 64
                         <el-upload
@@ -78,7 +73,7 @@
78 73
                           <i v-else class="el-icon-plus avatar-uploader-icon"></i>
79 74
                         </el-upload>
80 75
                       </el-form-item>
81
-                    </el-col>
76
+                </el-col>
82 77
                 </el-row>
83 78
                  <el-row>
84 79
                      <el-col :span="24">
@@ -128,20 +123,16 @@
128 123
              }
129 124
           };
130 125
    
131
-           return {
132
-                crumbs: [
133
-          { path: false, name: '系统设置' },
134
-          { path: '/Systemsetting/staffmanagement', name: '员工管理' }
135
-        ],
126
+      return {
136 127
          centerDialogVisible: false,
137 128
           radio: '1',
138 129
           value: '',
139 130
           qiniuDomain: 'https://images.shengws.com/',
140 131
           uploadData: { token: '', key: '' },
141 132
          user_types: [
142
-            { index: 2, name: '医生' },
143
-            { index: 3, name: '护士' },
144
-            { index: 4, name: '运营' },
133
+            { index: 1, name: '医生' },
134
+            { index: 2, name: '护士' },
135
+            { index: 3, name: '运营' },
145 136
             ],
146 137
         user_titles: [
147 138
             { index: 1, name: '医士' },
@@ -202,6 +193,8 @@
202 193
               },
203 194
             handleAvatarSuccess(res, file) {
204 195
               this.form.dochead =  this.qiniuDomain + res.url;
196
+              console.log("上传路径",res.url)
197
+              console.log("上传轮机",this.form.dochead)
205 198
               },
206 199
              beforeAvatarUpload(file) {
207 200
               const isJPG = file.type === 'image/jpeg';
@@ -257,7 +250,9 @@
257 250
                     this.resetForm("staffform");
258 251
                     this.$message.success("保存成功");     
259 252
                  }
260
-               })
253
+               }).catch(e=>{});
254
+              }else{
255
+                return false;
261 256
               }
262 257
              })
263 258
             },

+ 264 - 0
src/scrm_pages/systemsetting/components/EditStaffForm.vue 파일 보기

@@ -0,0 +1,264 @@
1
+<template>
2
+    <div id="Edit-staff-form-box">
3
+          <el-dialog
4
+              title="添加会员"
5
+              :visible.sync="centerDialogVisible"
6
+              width="50%"
7
+              center>
8
+              <el-form label-width="100px" class="clearfix" :model="form" ref="staffform" :rules="staffrules">
9
+                 <el-row>
10
+                   <el-col :span="12">
11
+                      <el-form-item label="姓名:"  required prop="name">
12
+                           <el-input placeholder="请输入姓名" v-model="form.name">
13
+
14
+                           </el-input>
15
+                      </el-form-item>
16
+                   </el-col>
17
+                   <el-col :span="12">
18
+                     <el-form-item label="手机号:" required prop="phone">
19
+                       <el-input placeholder="请输入手机号" v-model="form.phone">
20
+
21
+                       </el-input>
22
+                     </el-form-item>
23
+                   </el-col>
24
+                 </el-row>
25
+                <el-row>
26
+                   <el-col :span="12">
27
+                       <el-form-item label="性别:" required prop="gender">
28
+                           <el-radio-group v-model="form.gender">
29
+                                <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in genderOptions" :key="index">{{gender.name}}</el-radio>
30
+                            </el-radio-group>
31
+                       </el-form-item>
32
+                   </el-col>
33
+                  <el-col :span="12">
34
+                   <el-form-item label="生日:" required prop="birthday">
35
+                        <el-date-picker v-model="form.birthday" prefix-icon="el-icon-date" :editable="false" style="width: 100%;" type="date" placeholder="请选择日期" align="right" format="yyyy-MM-dd" value-format="yyyy-MM-dd"></el-date-picker>
36
+                 </el-form-item>
37
+                  </el-col>
38
+                </el-row>
39
+                <el-row>
40
+                    <el-col :span="16">
41
+                        <el-form-item label="员工职称:" required prop="user_type">
42
+                          
43
+                            <el-select v-model="form.user_type" placeholder="请选择">
44
+                             <el-option
45
+                                v-for="item in user_types"
46
+                                :key="item.index"
47
+                                :label="item.name"
48
+                                :value="item.index">
49
+                             </el-option>
50
+                            </el-select>
51
+
52
+                            <el-select v-model="form.user_title"  placeholder="请选择"> 
53
+                          <el-option
54
+                            v-for="item in user_titles"
55
+                            :key="item.index"
56
+                            :label="item.name"
57
+                            :value="item.index">
58
+                          </el-option>
59
+                        </el-select>
60
+                        </el-form-item>
61
+                    </el-col>              
62
+                  <el-col :span="4">
63
+                      <el-form-item label="医生头像:" required prop="dochead">
64
+                        <el-upload
65
+                          v-loading="uploading"
66
+                          class="avatar-uploader"
67
+                          action="https://upload.qiniup.com"
68
+                          :show-file-list="false"
69
+                          :on-success="handleAvatarSuccess"
70
+                          :before-upload="beforeAvatarUpload"
71
+                          :on-error="handleAvatarError"
72
+                          :data="uploadData">
73
+                          <img v-if="form.dochead" :src="form.dochead" class="avatar">
74
+                          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
75
+                        </el-upload>
76
+                      </el-form-item>
77
+                </el-col>
78
+                </el-row>
79
+                 <el-row>
80
+                     <el-col :span="24">
81
+                         <el-form-item label="医生简介:" required prop="content">
82
+                           <keep-alive>
83
+                             <neditor ref="neditor"
84
+                                      id="editor"
85
+                                      v-bind:r_content="form.content">
86
+                             </neditor>
87
+                           </keep-alive>
88
+                         </el-form-item>
89
+                     </el-col>
90
+                 </el-row>
91
+              </el-form>
92
+              <span slot="footer" class="dialog-footer">
93
+              <el-button @click="centerDialogVisible = false">取 消</el-button>
94
+              <el-button type="primary" @click="SaveStaffInfo('staffform');">保存</el-button>
95
+               </span>
96
+          </el-dialog>
97
+    </div>
98
+</template>
99
+
100
+<script>
101
+    import Neditor from '@/components/Neditor'
102
+    import {getToken} from '@/api/qiniu'
103
+    import {checkMobile, uParseTime} from "@/utils/tools"
104
+    import {SaveStaffInfo} from '@/api/act/staffmanager'
105
+    import { getFileExtension} from '@/utils/tools'
106
+    
107
+    export default {
108
+        name: "EditStaffForm",
109
+          components:{
110
+           Neditor,
111
+       },
112
+        props:{
113
+         form:{
114
+          id:0,
115
+          name:'',
116
+          phone:'',
117
+          birthday:'',
118
+          gender:'',
119
+          user_type:'',
120
+          user_title:'',
121
+          dochead:'',
122
+          page:1,
123
+          limit:10,
124
+          content:'',
125
+        },
126
+        staffIndex:{
127
+          type:Number,
128
+          default:-1,
129
+        },
130
+          staffsData:{
131
+          type: Array,
132
+          default: function () {
133
+          return [];
134
+         }
135
+       }, 
136
+      },
137
+      data(){
138
+        var checkMobileRule = (rule, value, callback) => {
139
+          if (!checkMobile(value)) {
140
+            callback(new Error('请填写正确的手机号'));
141
+             }else {
142
+             callback();
143
+            }
144
+          };
145
+        return{
146
+          centerDialogVisible: false,
147
+          qiniuDomain: 'https://images.shengws.com/',
148
+          uploading: false,
149
+          uploadData: {token:'',key:''},
150
+         user_types: [
151
+            { index: 1, name: '医生' },
152
+            { index: 2, name: '护士' },
153
+            { index: 3, name: '运营' },
154
+            ],
155
+        user_titles: [
156
+            { index: 1, name: '医士' },
157
+            { index: 2, name: '医师' },
158
+            { index: 3, name: '住院医师' },
159
+            { index: 4, name: '主治医师' },
160
+            { index: 5, name: '副主任医师' },
161
+            { index: 6, name: '主任医师' },
162
+            { index: 7, name: '护士' },
163
+            { index: 8, name: '护师' },
164
+            { index: 9, name: '主管护师' },
165
+            { index: 10, name: '副主任护师' },
166
+            { index: 11, name: '主任护师' },
167
+            { index: 12, name: '运营专员' },
168
+            { index: 13, name: '运营主管' },
169
+            ],
170
+         keyword:'',
171
+        staffform:[],
172
+         staffrules:{
173
+            name: [{required: true, message: "姓名不能为空"},],
174
+            phone: [{required: true,message:"手机号码不能为空"},{validator:checkMobileRule}],
175
+            birthday: [{required: true,message:"生日不能为空"}],
176
+            gender: [{required: true,message:"性别不能为空"}],
177
+            user_type: [{required: true,message:"职称类别不能为空"}],
178
+            user_title: [{required: true,message:"职称不能为空"}],
179
+            content: [{required: true,message:"医生简介不能为空"}],
180
+            dochead: [{required: true,message:"头像不能为空"}],
181
+        },
182
+         genderOptions:[
183
+          {id:1, name:'男'},
184
+          {id:2, name:'女'},
185
+         ],
186
+         staffData:[], 
187
+        }
188
+      },
189
+      methods:{
190
+        open:function(){
191
+           this.centerDialogVisible = true;
192
+          },
193
+          staffCreateTime(time) {
194
+          return uParseTime(time, "{y}-{m}-{d}");
195
+        },
196
+            handleAvatarSuccess(res, file) {
197
+              console.log("路径",res.url,"文件名",file.name)
198
+              this.form.dochead = this.qiniuDomain + res.url;
199
+              this.uploading = false;
200
+              conso.log(this.form.dochead);
201
+              },
202
+             beforeAvatarUpload(file) {
203
+              const isJPG = file.type === 'image/jpeg';
204
+              console.log("是什么呢",isJPG)
205
+              const isLt2M = file.size / 1024 / 1024 < 2;
206
+             if (!isJPG) {
207
+              this.$message.error('上传头像图片只能是JPG或者png格式!');
208
+            }
209
+            if (!isLt2M) {
210
+              this.$message.error('上传头像图片大小不能超过 2MB!');
211
+            }
212
+
213
+             var date = new Date()
214
+             var ext = getFileExtension(file.name)
215
+             var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
216
+             this.uploading = true;
217
+             this.loadingText = '封面图片上传中'
218
+             const _self = this
219
+            return new Promise((resolve, reject) => {
220
+            getToken().then(response => {
221
+            const token = response.data.data.uptoken
222
+            console.log("token是什么?",token)
223
+            _self._data.uploadData.token = token
224
+             _self._data.uploadData.key = key
225
+               resolve(true)
226
+              }).catch(err => {
227
+                reject(false)
228
+                })
229
+               })
230
+              },
231
+        handleAvatarError(err, file, fileList) {
232
+          this.$message.error(err);
233
+            return false
234
+          },    
235
+          
236
+          SaveStaffInfo(forname){
237
+             this.$refs[forname].validate((valid)=>{
238
+                 if(valid){
239
+                    SaveStaffInfo(this.form.id,this.form).then(response=>{
240
+                        if(response.data.state==1){
241
+                           var userStaffInfo =  response.data.data.userStaffInfo;
242
+                           console.log("heeh",userStaffInfo)
243
+                           this.centerDialogVisible = false;
244
+                           this.$message.success("保存成功");
245
+                           this.staffsData[this.staffIndex].name = userStaffInfo.name;
246
+                           this.staffsData[this.staffIndex].phone = userStaffInfo.phone;
247
+                           this.staffsData[this.staffIndex].birthday = userStaffInfo.birthday;
248
+                           this.staffsData[this.staffIndex].gender = userStaffInfo.gender;
249
+                           this.staffsData[this.staffIndex].user_type = userStaffInfo.user_type;
250
+                           this.staffsData[this.staffIndex].user_title = userStaffInfo.user_title;
251
+                           this.staffsData[this.staffIndex].dochead = userStaffInfo.dochead;
252
+                           this.staffsData[this.staffIndex].content = userStaffInfo.content;
253
+                        }
254
+                    })
255
+                 }
256
+             })
257
+          }
258
+      }
259
+    }
260
+</script>
261
+
262
+<style scoped>
263
+
264
+</style>

+ 144 - 18
src/scrm_pages/systemsetting/staffmanagement.vue 파일 보기

@@ -14,13 +14,15 @@
14 14
              </el-row>
15 15
          </div>
16 16
          <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
17
-            <el-checkbox style="width: 30px">全选</el-checkbox>
18
-            <el-button size="small" icon="el-icon-delete" @click="">删除</el-button>
17
+            <el-checkbox style="width: 30px"  @change="changeCheck" v-model="checkAllStatus">全选</el-checkbox>
18
+            <el-button size="small" icon="el-icon-delete" @click="openDeleteStaffs">批量删除</el-button>
19 19
           </div>
20
-              <el-table ref="multipleTable" 
21
-              :header-cell-style="{ backgroundColor: 
22
-              'rgb(245, 247, 250)'}" 
23
-              :data="staffData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;">
20
+              <el-table ref="multipleTable"
21
+              :header-cell-style="{ backgroundColor:
22
+              'rgb(245, 247, 250)'}"
23
+              :data="staffsData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;"
24
+               @selection-change="handleSelectionChange"
25
+              >
24 26
               <el-table-column
25 27
                 type="selection"
26 28
                 width="55">
@@ -28,7 +30,7 @@
28 30
               <el-table-column label="员工" align="center">
29 31
                <template slot-scope="scope">
30 32
                   <div style="display:flex;align-items: center;">
31
-                   <img :src="staffAvatar(scope.row)" alt="" srcset="" style="width:50px;height:50px; border-radius:50%;margin-right:5px;" >
33
+                   <img :src="scope.row.dochead" alt="" srcset="" style="width:50px;height:50px; border-radius:50%;margin-right:5px;" >
32 34
                     <div>
33 35
                      <span>{{scope.row.name}}</span>
34 36
                     </div>
@@ -58,14 +60,22 @@
58 60
             </el-table-column>
59 61
             <el-table-column label="操作" align="center">
60 62
               <template slot-scope="scope">
61
-                <el-tooltip class="item" effect="dark" content="编辑" placement="top">
63
+                <el-tooltip class="item" effect="dark" content="编辑" placement="top" >
62 64
                   <el-button
63 65
                     size="mini"
64 66
                     type="primary"
65 67
                     icon="el-icon-edit-outline"
66
-                    >
68
+                    @click="openEdit(scope.row,scope.$index)">
67 69
                   </el-button>
68
-                  </el-tooltip>
70
+                </el-tooltip>
71
+                  <el-tooltip class="item" effect="dark" content="删除" placement="top">
72
+                  <el-button 
73
+                  size="mini"
74
+                   type="danger" 
75
+                   icon="el-icon-delete"
76
+                    @click="openDelete(scope.row,scope.$index)">
77
+                   </el-button>
78
+                </el-tooltip>
69 79
               </template>
70 80
             </el-table-column>
71 81
           </el-table>
@@ -81,22 +91,26 @@
81 91
           </el-pagination>
82 92
             <!-- 添加员工 -->
83 93
           <create-staff-form ref="createStaffForm" :staffsData="staffsData"></create-staff-form>
84
-
94
+          <!--编辑员工-->
95
+          <edit-staff-form ref="editStaffForm" :staffsData="staffsData" :form="staffData" :staffIndex = "staffIndex"></edit-staff-form>
85 96
     </div>
86 97
   </div>
87 98
 </template>
88 99
 
89 100
 <script>
90 101
   import BreadCrumb from '../components/bread-crumb'
91
-  import {getAllStaffInfo} from '@/api/act/staffmanager'
102
+  import {getAllStaffInfo,DeleteStaffs} from '@/api/act/staffmanager'
92 103
   import {getToken} from '@/api/qiniu'
93 104
   import {getFileExtension,uParseTime} from '@/utils/tools'
94 105
   import CreateStaffForm from "./components/CreateStaffForm";
106
+  import EditStaffForm from "./components/EditStaffForm";
95 107
   export default {
96 108
     name: 'articleComment',
97 109
     components:{
110
+      EditStaffForm,
98 111
       BreadCrumb,
99 112
       CreateStaffForm,
113
+      EditStaffForm,
100 114
     },
101 115
     data(){
102 116
       return{
@@ -142,11 +156,25 @@
142 156
           page:1,
143 157
           limit:10,
144 158
           content:'',
159
+        },
160
+        staffData:{
161
+          id:0,
162
+          name:'',
163
+          phone:'',
164
+          birthday:'',
165
+          gender:'',
166
+          user_type:'',
167
+          user_title:'',
168
+          dochead:'',
169
+          page:1,
170
+          limit:10,
171
+          content:'',
145 172
         },
146 173
          total:0,
147 174
          keyword:'',
148 175
         staffform:[],
149
-         staffData:[],
176
+        staffIndex:-1,
177
+        checkAllStatus:false,
150 178
       }
151 179
     },
152 180
     methods: {
@@ -178,8 +206,9 @@
178 206
         getAllStaffInfo(){
179 207
           getAllStaffInfo(this.form,this.keyword).then(response=>{
180 208
             if(response.data.state ==1){
181
-              this.staffData = response.data.data.userStaffInfo;
182
-              console.log("数据",this.staffData)
209
+              this.staffsData = response.data.data.userStaffInfo;
210
+              
211
+              console.log("员工管理数据",this.staffsData)
183 212
               this.total = response.data.data.total;
184 213
               console.log("总页数",this.total)
185 214
            }
@@ -195,12 +224,109 @@
195 224
                 return "医师";
196 225
             }else if(title == 3){
197 226
                 return "住院医师";
227
+            }else if(title == 4){
228
+                return "主治医师";
229
+            }else if(title == 5){
230
+                return "副主任医师";
231
+            }else if(title == 6){
232
+                return "主任医师";
233
+            }else if (title == 7){
234
+                return "护士";
235
+            }else if (title == 8){
236
+                return "护师";
237
+            }else if (title == 9){
238
+                return "主管护师";
239
+            }else if (title ==10){
240
+                return "副主任护师";
241
+            }else if (title == 11){
242
+                return "主任护师";
243
+            }else if (title == 12) {
244
+                return "运营专员";
245
+            }else if (title == 13) {
246
+                 return "运营主管";
198 247
             }
199 248
 
200
-        },     
201
-          changeKey(){
202
-          this.getAllStaffInfo()
249
+        },
250
+        changeKey(){
251
+          this.getAllStaffInfo();
203 252
          },
253
+        openEdit(row,index){
254
+           for(const key in this.staffData){
255
+             if(key === "birthday" && row.birthday!=0){    
256
+                this.staffData.birthday = uParseTime(row.birthday, "{y}-{m}-{d}");
257
+             }else if(key in row){
258
+                this.staffData[key] = row [key];
259
+                }
260
+                console.log("数据是多少",this.staffsData)
261
+                this.staffIndex = index;
262
+                this.$refs.editStaffForm.open();
263
+           }
264
+        },
265
+        openDelete(row,index){
266
+           this.$confirm('确认要删除该会员吗?<br>删除后,该会员信息将无法恢复','删除提示',{
267
+            dangerouslyUseHTMLString:true,
268
+            confirmButtonText: '确定',
269
+            cancelButtonText: '取消',
270
+            type: 'warning'
271
+           }).then(()=>{
272
+               var ids = [];
273
+              ids.push(row.id);
274
+              DeleteStaffs({ids:ids}).then(response=>{
275
+                    if(response.data.state == 1){
276
+                        this.staffsData.splice(index, 1);
277
+                        this.$message.success("删除会员成功");
278
+                    }else{
279
+                      this.$message.error(res.msg);
280
+                    }
281
+              }).catch(e=>{});
282
+           }).catch(() => {
283
+            return false        
284
+          }); 
285
+        },
286
+         changeCheck(){
287
+          this.$refs.multipleTable.clearSelection();
288
+          if (this.checkAllStatus) {
289
+            this.$refs.multipleTable.toggleAllSelection();
290
+          }
291
+        },
292
+          handleSelectionChange(val){
293
+          this.selectedStaffs = val;
294
+        },
295
+        openDeleteStaffs(){
296
+          if (this.selectedStaffs.length==0) {
297
+            this.$message.error("请选择要删除的会员");
298
+            return false;
299
+          }
300
+          this.$confirm('确认要删除所选的人员吗? <br>删除后,人员信息将无法恢复','删除提示',{
301
+             dangerouslyUseHTMLString:true,
302
+             confirmButtonText: '确定',
303
+             cancelButtonText: '取消',
304
+             type: 'warning'  
305
+          }).then(()=>{
306
+             var ids = [];
307
+             var idMap = {};
308
+            for (const index in this.selectedStaffs) {
309
+              ids.push(this.selectedStaffs[index].id);
310
+              idMap[this.selectedStaffs[index].id] = this.selectedStaffs[index].id;
311
+            }
312
+             
313
+             DeleteStaffs({ids:ids}).then(response=>{
314
+                if(response.data.state==1){
315
+                     var membersDataLength = this.staffsData.length;
316
+                for (let index = membersDataLength-1; index >= 0; index--) {
317
+                  if(this.staffsData[index].id in idMap) {
318
+                    this.staffsData.splice(index, 1);
319
+                  }                  
320
+                }
321
+                  this.$message.success("删除会员成功");
322
+                }else{
323
+                   this.$message.error(res.msg);
324
+                }
325
+             }).catch(e=>{});
326
+          }).catch(() => {
327
+            return false        
328
+          });
329
+        }
204 330
     },
205 331
     created(){
206 332
       this.getAllStaffInfo();