瀏覽代碼

no message

dingxin 6 年之前
父節點
當前提交
04077c963f
共有 1 個文件被更改,包括 25 次插入5 次删除
  1. 25
    5
      VUECODE/smart-property-manage/src/views/social/announcement/index.vue

+ 25
- 5
VUECODE/smart-property-manage/src/views/social/announcement/index.vue 查看文件

@@ -139,7 +139,7 @@ export default {
139 139
         const resData = res.data
140 140
         this.listAnnouncement = resData.list
141 141
         this.listQuery.pageNum = resData.pageNum
142
-        this.listQuery.pageSize = 10
142
+        this.listQuery.pageSize = resData.pageSize
143 143
         this.total = resData.total
144 144
         this.listLoading = false
145 145
       }).catch(() => {
@@ -180,7 +180,7 @@ export default {
180 180
         this.$message.error('请选择一行数据进行修改!')
181 181
         return
182 182
       }
183
-       let ide= this.deleteIds[0]
183
+      let ide= this.deleteIds[0]
184 184
        this.listQuery.id = ide 
185 185
       this.$store.dispatch('AnnouncementById', this.listQuery).then((res) => {
186 186
         const resData = res.data
@@ -192,21 +192,41 @@ export default {
192 192
           this.$message.error('已作废不可以修改')
193 193
           return
194 194
         }
195
-          this.$router.push({ name: 'announcement-edit', params: { id: ids[0] }})
196
-      })
195
+       this.$router.push({ name: 'announcement-edit', params: { id: ids[0] }})
196
+      }) 
197 197
       },
198 198
     deleteAnnouncement(){
199
-      const ids = this.deleteIds
199
+       let ide= this.deleteIds[0]
200
+       this.listQuery.id = ide 
201
+      this.$store.dispatch('AnnouncementById', this.listQuery).then((res) => {
202
+        const resData = res.data
203
+        const announcement = resData.tpAnnouncement
204
+        const imgList = resData.studentList
205
+        this.listQuery = announcement
206
+        console.log("1",this.listQuery.status)
207
+        if(this.listQuery.status == 0){
208
+          this.$message.error('已作废不可以作废')
209
+          return
210
+        }
211
+        this.deleteId()     
212
+      })    
213
+    },
214
+
215
+    deleteId(){
216
+       const ids = this.deleteIds
200 217
       this.listLoading = true
201 218
       console.log(ids)
202 219
       this.$store.dispatch('DeleteAnnouncement', ids).then((res) => {
203 220
         this.listLoading = false
221
+        this.listQuery.announcementTitle = ''
204 222
         this.dataQuery()
205 223
       }).catch(() => {
206 224
         this.listLoading = false
207 225
         console.log('error DeleteAnnouncement')
208 226
       })
209 227
     },
228
+
229
+
210 230
     clickTitle(id) {
211 231
       this.$router.push({ name: 'contentParticulars-details' ,params: { id: id }})
212 232
     },