|
|
@@ -77,6 +77,14 @@
|
|
|
label="创建时间"
|
|
|
width="180"
|
|
|
></el-table-column>
|
|
|
+ <el-table-column prop="isShelves" label="是否上架">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <el-switch
|
|
|
+ v-model="row.isShelves"
|
|
|
+ @change="handleChange(row,$event)">
|
|
|
+ </el-switch>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" width="250">
|
|
|
<template slot-scope="{row}">
|
|
|
<el-button size="mini" type="primary" @click="handlePeople(row)">参与人员</el-button>
|
|
|
@@ -282,20 +290,51 @@
|
|
|
});
|
|
|
},
|
|
|
onDetailModalClose(refreshed) {
|
|
|
- this.showModal = false;
|
|
|
+ this.showModal = false;
|
|
|
|
|
|
- if(refreshed) {
|
|
|
- this.changePage(this.pageIndex);
|
|
|
- }
|
|
|
- },
|
|
|
- onDetailModalClose2(refreshed) {
|
|
|
- this.showModal2 = false;
|
|
|
+ if(refreshed) {
|
|
|
+ this.changePage(this.pageIndex);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onDetailModalClose2(refreshed) {
|
|
|
+ this.showModal2 = false;
|
|
|
|
|
|
- if(refreshed) {
|
|
|
- this.changePage(this.pageIndex);
|
|
|
+ if(refreshed) {
|
|
|
+ this.changePage(this.pageIndex);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleChange(record,val){
|
|
|
+ var self = this;
|
|
|
+ var formData = new FormData();
|
|
|
+
|
|
|
+ formData.append("id", record.id);
|
|
|
+ formData.append("status", val);
|
|
|
+
|
|
|
+ self.loading = true;
|
|
|
+
|
|
|
+ volunteerTasksApi.changeStatus(formData).then(function(response) {
|
|
|
+ self.loading = false;
|
|
|
+
|
|
|
+ var jsonData = response.data;
|
|
|
+
|
|
|
+ if(jsonData.result){
|
|
|
+ self.changePage(self.pageIndex);
|
|
|
+ self.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "修改成功!"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ self.$message({
|
|
|
+ message: jsonData.message + "",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch((error)=>{
|
|
|
+ self.loading = false;
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
- },
|
|
|
mounted: function() {
|
|
|
this.changePage(1);
|
|
|
},
|