tanyanfei 4 éve
szülő
commit
ad3c2d7f1d
2 módosított fájl, 40 hozzáadás és 3 törlés
  1. 3 0
      src/api.js
  2. 37 3
      src/views/activity/apply.vue

+ 3 - 0
src/api.js

@@ -507,4 +507,7 @@ export default {
 	getArticleSearch: params => {
 		return axios.get(`${baseURL}/api/admin/article/search`, { params: params });
 	},
+	sendMsg: params => {
+		return axios.post(`${baseURL}/api/admin/activity/msg`, params);
+	},
 }

+ 37 - 3
src/views/activity/apply.vue

@@ -10,17 +10,21 @@
             <p>活动地址:{{info.address}}</p>
             <p>活动时间:{{info.begin_time}}--{{info.end_time}}</p>
             <p>活动简介:{{info.desc}}</p>
-            <el-button size='small' type="primary">发送短信</el-button>
+            <el-button @click="sendmsg" size='small' type="primary">发送短信</el-button>
       </div>
        
       <el-table
                     class="table"
                     :data="list"
                     height='38vh'
+                     @selection-change="handleSelectionChange"
                     border  v-loading="loading"
                     default-expand-all row-key="id"
                     style="width: 100%">
-                   
+                    <el-table-column
+                    type="selection"
+                    width="55">
+                    </el-table-column>
                     <el-table-column
                     prop="name"  
                     label="姓名">
@@ -97,10 +101,40 @@ export default {
             dialogVisible2:false,
             dialogVisible3:false,
             proof_img:'',
-            info:{}
+            info:{},
+            signup_ids:[]
         }
     },
     methods:{
+        sendmsg(){
+            if(this.signup_ids.length<=0){
+                    this.$message({
+                                message: "请选择需要发送短信的用户",
+                                type: "error",
+                    });
+                    return
+            }
+            this.$confirm("确定发送短信吗", "提示", {
+                type: "warning",
+            }).then(() => {
+                this.$api.sendMsg({ signup_ids: this.signup_ids.join(',') }).then((res) => {
+                    if(res.data.code == 0){
+                            this.$message({
+                                message: "发送成功",
+                                type: "success",
+                            });
+                    }
+                });
+            });  
+        },
+        handleSelectionChange(val) {
+            console.log(val)
+            var ids=[]
+            val.forEach(item => {
+                ids.push(item.id)
+            });
+            this.signup_ids=ids;
+        },
         download(){
             this.$api.getSignupData().then(res=>{
                 var elink = document.createElement("a");