Browse Source

解除黑名单

shibei_master
ZhaoTongYao 3 years ago
parent
commit
dfebf58b09
  1. 5
      src/mixins/view-module.js
  2. 4
      src/views/modules/plugins/rent/rentblacklist-add-or-update.vue
  3. 60
      src/views/modules/plugins/rent/rentblacklist.vue

5
src/mixins/view-module.js

@ -63,6 +63,11 @@ export default {
}
this.dataList = this.mixinViewModuleOptions.getDataListIsPage ? res.data.list : res.data
this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0
this.dataList.forEach(item => {
if (item.gender) {
item.gender = item.gender == '0' ? '女' : item.gender == '1' ? '男' : item.gender
}
})
}).catch(() => {
this.dataListLoading = false
})

4
src/views/modules/plugins/rent/rentblacklist-add-or-update.vue

@ -163,12 +163,10 @@ export default {
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
console.log(this.dataForm)
return
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/pli/power/rentBlacklist/', this.dataForm).then(({ data: res }) => {
this.$http[!this.dataForm.id ? 'post' : 'put']('/pli/power/rentBlacklist/save', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}

60
src/views/modules/plugins/rent/rentblacklist.vue

@ -58,8 +58,9 @@
<el-table-column prop="joinReason" label="原因" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-button type="text" size="small" @click="removeBlacklist(scope.row.id)">解除黑名单</el-button>
<!-- <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> -->
</template>
</el-table-column>
</el-table>
@ -74,6 +75,16 @@
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<el-dialog
title="解除黑名单的原因"
:visible.sync="blacklistVisible"
width="40%">
<textarea v-model="blacklistReason" placeholder="请输入解除黑名单的原因" class="blacklist-reason"></textarea>
<span slot="footer" class="dialog-footer">
<el-button @click="blacklistVisible = false"> </el-button>
<el-button type="primary" @click="confirmRemoveBlacklist"> </el-button>
</span>
</el-dialog>
</div>
</el-card>
</template>
@ -94,7 +105,10 @@ export default {
timeRange: '',
dataForm: {
id: ''
}
},
blacklistVisible: false, //
blacklistReason: '', //
removeId: '', // id
}
},
watch: {
@ -106,10 +120,48 @@ export default {
this.dataForm.startTime = "";
this.dataForm.endTime = "";
}
},
}
},
components: {
AddOrUpdate
},
methods: {
removeBlacklist (id) {
this.blacklistVisible = true
this.blacklistReason = ''
this.removeId = id
},
confirmRemoveBlacklist () {
const params = {
id: this.removeId,
removeReason: this.blacklistReason
}
this.$http.post('/pli/power/rentBlacklist/update', params).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.blacklistVisible = false
this.getDataList()
}
})
}).catch(() => {})
}
}
}
</script>
<style lang="scss" scoped>
.blacklist-reason {
width: 100%;
height: 80px;
border: 1px solid #e4e4e4;
border-radius: 4px;
resize: none;
padding: 8px;
box-sizing: border-box;
}
</style>
Loading…
Cancel
Save