8 changed files with 2398 additions and 292 deletions
@ -0,0 +1,725 @@ |
|||
<template> |
|||
<div v-if="pageLoading" class="resi-container"> |
|||
<el-card ref="searchCard" class="search-card"> |
|||
<div class=""> |
|||
<el-form ref="searchForm" :inline="true" :model="searchForm" size="small" label-width="100px" class="demo-form-inline"> |
|||
<div> |
|||
<!-- <el-form-item label="所属党组织" prop="partyOrgId"> |
|||
<el-cascader |
|||
v-model="partyOrgRange" |
|||
:options="optionsG" |
|||
:props="partyProps" |
|||
clearable |
|||
@change="handlePartyChange"></el-cascader> |
|||
</el-form-item> --> |
|||
<el-form-item label="姓名" prop="name"> |
|||
<el-input v-model="searchForm.name" placeholder="请输入" class="input-width" clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="手机号" prop="mobile"> |
|||
<el-input v-model="searchForm.mobile" placeholder="请输入" class="input-width" clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="身份证" prop="idCard"> |
|||
<el-input v-model="searchForm.idCard" placeholder="请输入" class="input-width" clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="审核状态" prop="status"> |
|||
<el-select v-model="searchForm.status" filterable :disabled="disabled" placeholder="请选择" class="input-width" clearable> |
|||
<el-option |
|||
v-for="item in zwList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</el-form-item> |
|||
</div> |
|||
<el-form-item label="申请时间" |
|||
prop="startTime"> |
|||
<el-date-picker v-model="timeRange" |
|||
size="small" |
|||
type="daterange" |
|||
value-format="yyyy-MM-dd" |
|||
@change="handleTimeChange" |
|||
range-separator="至" |
|||
start-placeholder="开始时间" |
|||
end-placeholder="结束时间"> |
|||
</el-date-picker> |
|||
|
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button class="diy-button--search" size="small" @click="handleSearch">查询</el-button> |
|||
<el-button class="diy-button--reset" size="small" @click="resetForm('searchForm')">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
</el-card> |
|||
<el-card class="resi-card-table"> |
|||
|
|||
<!-- <div class="resi-row-btn"> |
|||
<el-button class="diy-button--add" size="small" @click="handleAdd">批量审核</el-button> |
|||
|
|||
</div> --> |
|||
|
|||
<el-table |
|||
:data="tableData" |
|||
row-key="id" |
|||
v-loading="tableLoading" |
|||
border |
|||
:height="tableHeight" |
|||
style="width: 100%" |
|||
class="resi-table" |
|||
@select="handleSelection" |
|||
> |
|||
<!-- <el-table-column type="selection" align="center" width="50"> |
|||
</el-table-column> --> |
|||
<el-table-column label="序号" type="index" align="center" width="50"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="name" |
|||
label="姓名" |
|||
align="center" |
|||
width="100" |
|||
/> |
|||
<el-table-column |
|||
prop="gender" |
|||
label="性别" |
|||
align="center" |
|||
width="100" |
|||
/> |
|||
<el-table-column |
|||
prop="idCard" |
|||
label="身份证号" |
|||
align="center" |
|||
min-width="180" |
|||
/> |
|||
<el-table-column |
|||
prop="mobile" |
|||
label="手机号" |
|||
align="center" |
|||
min-width="160" |
|||
/> |
|||
<el-table-column |
|||
prop="gridName" |
|||
label="所在网格" |
|||
align="center" |
|||
min-width="160" |
|||
show-overflow-tooltip |
|||
/> |
|||
<el-table-column |
|||
prop="title" |
|||
label="标题" |
|||
align="center" |
|||
show-overflow-tooltip |
|||
min-width="180" |
|||
/> |
|||
<el-table-column |
|||
prop="ruleName" |
|||
label="类别" |
|||
align="center" |
|||
min-width="160" |
|||
/> |
|||
<el-table-column |
|||
prop="createdTime" |
|||
label="申请时间" |
|||
align="center" |
|||
width="160" |
|||
/> |
|||
<el-table-column |
|||
prop="status" |
|||
label="审核状态" |
|||
align="center" |
|||
show-overflow-tooltip |
|||
width="100" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<span v-if="scope.row.status == 0">待审核</span> |
|||
<span v-else-if="scope.row.status == 2">已通过</span> |
|||
<span v-else-if="scope.row.status == 1">已驳回</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column fixed="right" label="操作" align="center" width="100"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
@click="handleLook(scope.row)" |
|||
type="text" |
|||
size="small" |
|||
class="btn-color-look" |
|||
>查看</el-button |
|||
> |
|||
<el-button |
|||
v-if="scope.row.status == 0" |
|||
@click="handleEdit(scope.row, 'edit')" |
|||
type="text" |
|||
size="small" |
|||
class="btn-color-edit" |
|||
>审核</el-button |
|||
> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div> |
|||
<el-pagination |
|||
@size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange" |
|||
:current-page.sync="currentPage" |
|||
:page-sizes="[20, 50, 100, 200]" |
|||
:page-size="pageSize" |
|||
layout="sizes, prev, pager, next, total" |
|||
:total="total" |
|||
> |
|||
</el-pagination> |
|||
</div> |
|||
</el-card> |
|||
<el-dialog title="审核信息" :visible.sync="dialogFormVisible"> |
|||
<template v-if="!isBatch"> |
|||
<div class="d-title">{{ detailInfo.title }}</div> |
|||
<div class="d-desc">{{ detailInfo.statement }}</div> |
|||
<div class="input-width1" style="display: flex;"> |
|||
<el-image |
|||
v-for="item in detailInfo.annexList" |
|||
:key="item" |
|||
style="width: 100px; height: 100px; margin-right: 10px;" |
|||
:src="item" |
|||
:preview-src-list="detailInfo.annexList"> |
|||
</el-image> |
|||
</div> |
|||
<div class="d-tips">申请人:{{ detailInfo.showName }}</div> |
|||
<div class="d-tips">申请时间:{{ detailInfo.createdTime }}</div> |
|||
<el-divider></el-divider> |
|||
</template> |
|||
<div class=""></div> |
|||
<el-form :model="form"> |
|||
<el-form-item label="申请类别:" :label-width="'100px'"> |
|||
<span>{{ detailInfo.ruleName }}</span> |
|||
</el-form-item> |
|||
<el-form-item label="申请积分:" :label-width="'100px'"> |
|||
<span>{{ detailInfo.pointValue }}</span> |
|||
</el-form-item> |
|||
<el-form-item label="审核状态:" prop="status" :label-width="'100px'"> |
|||
<el-select v-model="form.status" placeholder="请选择" :disabled="disabled" class="input-width"> |
|||
<el-option |
|||
v-for="item in zwLists" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="备注:" prop="remark" :label-width="'100px'"> |
|||
<el-input v-model="form.remark" type="textarea" :disabled="disabled" autocomplete="off" class="input-width"></el-input> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="handlerCancle">取 消</el-button> |
|||
<el-button v-if="!disabled" type="primary" @click="handleSubmit">确 定</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
<el-dialog title="详情" :visible.sync="dialogVisible" width="800px"> |
|||
<el-form :model="detailInfo" inline> |
|||
|
|||
<div> |
|||
<el-form-item label="所属网格:" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.gridName}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="姓名:" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.name}}</div> |
|||
</el-form-item> |
|||
|
|||
</div> |
|||
<div> |
|||
<!-- <el-form-item label="性别" prop="remark" :label-width="'100px'"> |
|||
<el-input v-model="form.remark" autocomplete="off" class="input-width"></el-input> |
|||
</el-form-item> --> |
|||
<el-form-item label="手机号:" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.mobile}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="身份证:" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.idCard}}</div> |
|||
</el-form-item> |
|||
</div> |
|||
<div> |
|||
|
|||
<el-form-item label="积分类别:" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.ruleName}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="积分分值:" prop="status" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.pointValue}}</div> |
|||
</el-form-item> |
|||
</div> |
|||
<div> |
|||
<el-form-item label="标题:" prop="status" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.title}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="内容:" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.statement}}</div> |
|||
</el-form-item> |
|||
|
|||
</div> |
|||
<el-form-item label="附件:" :label-width="'100px'"> |
|||
<div class="input-width1" style="display: flex;"> |
|||
<el-image |
|||
v-for="item in detailInfo.annexList" |
|||
:key="item" |
|||
style="width: 100px; height: 100px; margin-right: 10px;" |
|||
:src="item" |
|||
:preview-src-list="detailInfo.annexList"> |
|||
</el-image> |
|||
</div> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="handlerCancle">关闭</el-button> |
|||
<!-- <el-button type="primary" @click="handleSubmit">确 定</el-button> --> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
export default { |
|||
data() { |
|||
return { |
|||
dialogVisible: false, |
|||
dialogFormVisible: false, |
|||
tableLoading: false, |
|||
disabled: false, |
|||
pageLoading: false, |
|||
isBatch: false, |
|||
currentPage: 1, |
|||
pageSize: 20, |
|||
total: null, |
|||
tableData: [], |
|||
searchH: 0, |
|||
addType: 'add', |
|||
optionsG: [], |
|||
zwLists: [ |
|||
{ |
|||
label: '通过', |
|||
value: '2' |
|||
}, |
|||
{ |
|||
label: '驳回', |
|||
value: '1' |
|||
} |
|||
], |
|||
zwList: [ |
|||
{ |
|||
label: '待审核', |
|||
value: '0' |
|||
}, |
|||
{ |
|||
label: '已通过', |
|||
value: '2' |
|||
}, |
|||
{ |
|||
label: '已驳回', |
|||
value: '1' |
|||
} |
|||
], |
|||
selectionList: [], |
|||
tempList: [], |
|||
partyOrgRange: [], |
|||
timeRange: [], |
|||
customerId: '', |
|||
searchForm: { |
|||
// partyOrgId: '', |
|||
mobile: '', |
|||
idCard: '', |
|||
name: '', |
|||
status: '', |
|||
startTime: '', |
|||
endTime: '', |
|||
categoryCode: 'party_building' |
|||
}, |
|||
form: { |
|||
ids: [], |
|||
status: '2', |
|||
remark: '' |
|||
}, |
|||
detailInfo: {}, |
|||
partyProps: { |
|||
label: 'partyOrgName', |
|||
value: 'id', |
|||
checkStrictly: true |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapGetters(['clientHeight', 'iframeHeight']), |
|||
tableHeight() { |
|||
const h = this.clientHeight - this.searchH - 280 + this.iframeHeigh |
|||
const _h = this.clientHeight - 280 - this.searchH |
|||
return this.$store.state.inIframe ? h : _h |
|||
} |
|||
}, |
|||
async created() { |
|||
this.customerId = localStorage.getItem('customerId') |
|||
this.getTableData() |
|||
this.getGridList('query') |
|||
this.pageLoading = true |
|||
|
|||
}, |
|||
|
|||
mounted() { |
|||
|
|||
this.$nextTick(() => { |
|||
this.searchH = this.$refs.searchCard.$el.offsetHeight |
|||
console.log('tableHeight', this.tableHeight) |
|||
}) |
|||
|
|||
}, |
|||
methods: { |
|||
handleSelection(val) { |
|||
this.selectionList = [...val] |
|||
}, |
|||
handleSizeChange(val) { |
|||
console.log(`每页 ${val} 条`) |
|||
this.pageSize = val |
|||
this.getTableData() |
|||
}, |
|||
handleCurrentChange(val) { |
|||
console.log(`当前页: ${val}`) |
|||
this.currentPage = val |
|||
if (this.selectionList.length > 0 && val !== 1) { |
|||
this.tempList = [...this.tempList, ...this.selectionList] |
|||
} |
|||
this.getTableData() |
|||
}, |
|||
handlePartyChange(val) { |
|||
console.log('val------pp', val) |
|||
this.searchForm.partyOrgId = val[val.length - 1] |
|||
}, |
|||
handleFilterSpan(row, item) { |
|||
let _val = '' |
|||
if (item.options && item.options.length > 0) { |
|||
item.options.forEach((n) => { |
|||
if (n.value === row[item.columnName]) _val = n.label |
|||
}) |
|||
} |
|||
return _val || row[item.columnName] |
|||
}, |
|||
handleTimeChange (val) { |
|||
if (val.length > 0) { |
|||
this.searchForm.startTime = val[0] |
|||
this.searchForm.endTime = val[1] |
|||
} else { |
|||
this.searchForm.startTime = '' |
|||
this.searchForm.endTime = '' |
|||
} |
|||
|
|||
}, |
|||
|
|||
handleDelimg(item, index) { |
|||
this.form.imageList.splice(index, 1) |
|||
}, |
|||
handleSearch(val) { |
|||
console.log('searchhh--', val) |
|||
this.currentPage = 1 |
|||
this.getTableData() |
|||
}, |
|||
resetForm(formName) { |
|||
this.timeRange = [] |
|||
this.searchForm.startTime = '' |
|||
this.searchForm.endTime = '' |
|||
this.$refs[formName].resetFields() |
|||
this.handleSearch() |
|||
}, |
|||
handleAdd() { |
|||
if (this.selectionList.length == 0) return this.$message.warning('请选择数据') |
|||
this.dialogFormVisible = true |
|||
}, |
|||
|
|||
handlerCancle() { |
|||
this.detailInfo = {} |
|||
this.selectionList = [] |
|||
this.tempList = [] |
|||
this.disabled = false |
|||
this.form = { |
|||
ids: [], |
|||
status: '2', |
|||
remark: '' |
|||
} |
|||
this.dialogFormVisible = false |
|||
this.dialogVisible = false |
|||
}, |
|||
async handleLook(row) { |
|||
this.disabled = true |
|||
this.isBatch = false |
|||
await this.getDetail(row.id) |
|||
this.dialogFormVisible = true |
|||
}, |
|||
async handleEdit(row, addType) { |
|||
this.form.ids = [row.id] |
|||
this.isBatch = false |
|||
// this.detailInfo = { ...row } |
|||
await this.getDetail(row.id) |
|||
this.dialogFormVisible = true |
|||
}, |
|||
|
|||
handleDel(row) { |
|||
let params = { |
|||
ids: [row.id] |
|||
} |
|||
console.log('row1', row) |
|||
this.$http |
|||
.post('/resi/partymember/icPartyMember/delete', [row.id]) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
this.$message.success('删除成功') |
|||
this.getTableData() |
|||
} |
|||
}) |
|||
.catch((err) => { |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
}, |
|||
async handleSubmit() { |
|||
|
|||
if (this.form.ids.length == 0) { |
|||
if (this.tempList.length > 0) this.form.ids = Array.from(new Set(this.tempList.map(item => item.id))) |
|||
else this.form.ids = Array.from(new Set(this.selectionList.map(item => item.id))) |
|||
|
|||
} |
|||
this.$http |
|||
.post('/point/apply/examine/submit', this.form) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
this.$message.success('操作成功') |
|||
this.handlerCancle() |
|||
this.getTableData() |
|||
} |
|||
}) |
|||
.catch((err) => { |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
}, |
|||
async getDetail(id) { |
|||
let params = { |
|||
id, |
|||
} |
|||
this.$http |
|||
.post(`/point/apply/detail/${id}`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
this.detailInfo = { ...res.data } |
|||
if (this.disabled) { |
|||
this.form.status = res.data.status |
|||
this.form.remark = res.data.remark |
|||
} |
|||
} |
|||
}) |
|||
.catch((err) => { |
|||
console.log('row4', err) |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
}, |
|||
async getGridList(type, agencyId) { |
|||
const { user } = await this.$store.state |
|||
console.log('user---ppp', user) |
|||
// addorupdate query |
|||
await this.$http |
|||
.get('/resi/partymember/icPartyOrg/getSearchTreelist', { params: {agencyId: agencyId || user.agencyId} }) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
console.log('获取查询详情成功', res.data) |
|||
|
|||
this.optionsG = this.deepArrTOnull(res.data) |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
}, |
|||
deepArrTOnull(arr) { |
|||
let a = [] |
|||
a = arr.map(item => { |
|||
return { |
|||
...item, |
|||
children: (item.children.length > 0 && this.deepArrTOnull(item.children) )|| null |
|||
} |
|||
}) |
|||
return a |
|||
}, |
|||
async getTableData() { |
|||
this.tableLoading = true |
|||
const { user } = await this.$store.state |
|||
let params = { |
|||
...this.searchForm, |
|||
agencyId: user.agencyId, |
|||
pageNo: this.currentPage, |
|||
pageSize: this.pageSize |
|||
} |
|||
await this.$http |
|||
.post('/point/apply/listall', params) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
this.tableData = res.data.list |
|||
this.total = res.data.total |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
this.tableLoading = false |
|||
} |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "@/assets/scss/buttonstyle.scss"; |
|||
|
|||
.resi-container .resi-card-table { |
|||
::v-deep .el-table th { |
|||
color: #fff; |
|||
background-color: rgba(33, 149, 254, 1); |
|||
// border-right: 1px solid rgba(33, 149, 254, 1); |
|||
} |
|||
} |
|||
.resi-table { |
|||
::v-deep .el-button--text { |
|||
text-decoration: underline; |
|||
} |
|||
::v-deep .btn-color-del { |
|||
margin-left: 10px; |
|||
color: rgba(213, 16, 16, 1); |
|||
} |
|||
::v-deep .btn-color-edit { |
|||
color: rgba(0, 167, 169, 1); |
|||
} |
|||
} |
|||
.input-width { |
|||
width: 200px; |
|||
|
|||
} |
|||
.form-wr { |
|||
.input-width { |
|||
width: 260px; |
|||
|
|||
} |
|||
.input-width-textarea { |
|||
width: 500px; |
|||
} |
|||
.imsg-list { |
|||
display: flex; |
|||
align-items: center; |
|||
.imgs-item { |
|||
position: relative; |
|||
margin-right: 10px; |
|||
.el-icon-delete { |
|||
position: absolute; |
|||
top: 0; |
|||
right: 0; |
|||
font-size: 18px; |
|||
color: red; |
|||
z-index: 3; |
|||
cursor: pointer; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
.div-content { |
|||
width: 100%; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
white-space: nowrap; |
|||
} |
|||
|
|||
.d-title { |
|||
text-align: center; |
|||
font-size: 18px; |
|||
} |
|||
.d-desc { |
|||
margin: 10px 0; |
|||
// font-size: ; |
|||
text-indent: 2em; |
|||
line-height: 16px; |
|||
} |
|||
.d-tips { |
|||
color: #999; |
|||
margin-top: 10px; |
|||
} |
|||
</style> |
|||
|
|||
<style lang="scss" scoped> |
|||
|
|||
.resi-row-btn { |
|||
display: flex; |
|||
margin-bottom: 13px; |
|||
::v-deep .el-button { |
|||
// margin-left: 10px; |
|||
border: 0; |
|||
} |
|||
::v-deep .el-select { |
|||
margin-right: 10px; |
|||
} |
|||
.el-button--success { |
|||
background: rgba(34, 193, 195, 1); |
|||
} |
|||
.el-button { |
|||
margin-left: 10px; |
|||
border: 0; |
|||
} |
|||
.el-button--success { |
|||
background: rgba(34, 193, 195, 1); |
|||
} |
|||
.el-button--warning { |
|||
background: rgba(254, 179, 73, 1); |
|||
} |
|||
.el-button--danger { |
|||
background: rgba(254, 98, 82, 1); |
|||
} |
|||
} |
|||
.avatar-uploader { |
|||
::v-deep |
|||
.el-upload { |
|||
cursor: pointer; |
|||
position: relative; |
|||
overflow: hidden; |
|||
} |
|||
.el-upload:hover { |
|||
border-color: #409EFF; |
|||
} |
|||
.avatar { |
|||
width: 100px; |
|||
height: 100px; |
|||
display: block; |
|||
} |
|||
.avatar-uploader-icon { |
|||
border: 1px dashed #d9d9d9; |
|||
border-radius: 6px; |
|||
font-size: 28px; |
|||
color: #8c939d; |
|||
width: 100px; |
|||
height: 100px; |
|||
line-height: 100px; |
|||
text-align: center; |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
.resi-btns { |
|||
margin-top: 20px; |
|||
text-align: center; |
|||
} |
|||
.input-width1 { |
|||
width: 250px; |
|||
} |
|||
</style> |
@ -0,0 +1,728 @@ |
|||
<template> |
|||
<div v-if="pageLoading" class="resi-container"> |
|||
<el-card ref="searchCard" class="search-card"> |
|||
<div class=""> |
|||
<el-form ref="searchForm" :inline="true" :model="searchForm" size="small" label-width="100px" class="demo-form-inline"> |
|||
<div> |
|||
<!-- <el-form-item label="所属党组织" prop="partyOrgId"> |
|||
<el-cascader |
|||
v-model="partyOrgRange" |
|||
:options="optionsG" |
|||
:props="partyProps" |
|||
clearable |
|||
@change="handlePartyChange"></el-cascader> |
|||
</el-form-item> --> |
|||
<el-form-item label="姓名" prop="name"> |
|||
<el-input v-model="searchForm.name" placeholder="请输入" class="input-width" clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="手机号" prop="mobile"> |
|||
<el-input v-model="searchForm.mobile" placeholder="请输入" class="input-width" clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="身份证" prop="idCard"> |
|||
<el-input v-model="searchForm.idCard" placeholder="请输入" class="input-width" clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="审核状态" prop="status"> |
|||
<el-select v-model="searchForm.status" filterable :disabled="disabled" placeholder="请选择" class="input-width" clearable> |
|||
<el-option |
|||
v-for="item in zwList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</el-form-item> |
|||
</div> |
|||
<el-form-item label="申请时间" |
|||
prop="startTime"> |
|||
<el-date-picker v-model="timeRange" |
|||
size="small" |
|||
type="daterange" |
|||
value-format="yyyy-MM-dd" |
|||
@change="handleTimeChange" |
|||
range-separator="至" |
|||
start-placeholder="开始时间" |
|||
end-placeholder="结束时间"> |
|||
</el-date-picker> |
|||
|
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button class="diy-button--search" size="small" @click="handleSearch">查询</el-button> |
|||
<el-button class="diy-button--reset" size="small" @click="resetForm('searchForm')">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
</el-card> |
|||
<el-card class="resi-card-table"> |
|||
|
|||
<!-- <div class="resi-row-btn"> |
|||
<el-button class="diy-button--add" size="small" @click="handleAdd">批量审核</el-button> |
|||
|
|||
</div> --> |
|||
|
|||
<el-table |
|||
:data="tableData" |
|||
row-key="id" |
|||
v-loading="tableLoading" |
|||
border |
|||
:height="tableHeight" |
|||
style="width: 100%" |
|||
class="resi-table" |
|||
@select="handleSelection" |
|||
> |
|||
<!-- <el-table-column type="selection" align="center" width="50"> |
|||
</el-table-column> --> |
|||
<el-table-column label="序号" type="index" align="center" width="50"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="name" |
|||
label="姓名" |
|||
align="center" |
|||
width="100" |
|||
/> |
|||
<el-table-column |
|||
prop="gender" |
|||
label="性别" |
|||
align="center" |
|||
width="100" |
|||
/> |
|||
<el-table-column |
|||
prop="idCard" |
|||
label="身份证号" |
|||
align="center" |
|||
min-width="180" |
|||
/> |
|||
<el-table-column |
|||
prop="mobile" |
|||
label="手机号" |
|||
align="center" |
|||
min-width="160" |
|||
/> |
|||
<el-table-column |
|||
prop="gridName" |
|||
label="所在网格" |
|||
align="center" |
|||
min-width="160" |
|||
show-overflow-tooltip |
|||
/> |
|||
<el-table-column |
|||
prop="title" |
|||
label="标题" |
|||
align="center" |
|||
show-overflow-tooltip |
|||
min-width="180" |
|||
/> |
|||
<el-table-column |
|||
prop="ruleName" |
|||
label="类别" |
|||
align="center" |
|||
min-width="160" |
|||
/> |
|||
<el-table-column |
|||
prop="createdTime" |
|||
label="申请时间" |
|||
align="center" |
|||
width="160" |
|||
/> |
|||
<el-table-column |
|||
prop="status" |
|||
label="审核状态" |
|||
align="center" |
|||
show-overflow-tooltip |
|||
width="100" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<span v-if="scope.row.status == 0">待审核</span> |
|||
<span v-else-if="scope.row.status == 2">已通过</span> |
|||
<span v-else-if="scope.row.status == 1">已驳回</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column fixed="right" label="操作" align="center" width="100"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
@click="handleLook(scope.row)" |
|||
type="text" |
|||
size="small" |
|||
class="btn-color-look" |
|||
>查看</el-button |
|||
> |
|||
<el-button |
|||
v-if="scope.row.status == 0" |
|||
@click="handleEdit(scope.row, 'edit')" |
|||
type="text" |
|||
size="small" |
|||
class="btn-color-edit" |
|||
>审核</el-button |
|||
> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div> |
|||
<el-pagination |
|||
@size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange" |
|||
:current-page.sync="currentPage" |
|||
:page-sizes="[20, 50, 100, 200]" |
|||
:page-size="pageSize" |
|||
layout="sizes, prev, pager, next, total" |
|||
:total="total" |
|||
> |
|||
</el-pagination> |
|||
</div> |
|||
</el-card> |
|||
<el-dialog title="审核信息" :visible.sync="dialogFormVisible"> |
|||
<template v-if="!isBatch"> |
|||
<div class="d-title">{{ detailInfo.title }}</div> |
|||
<div class="d-desc">{{ detailInfo.statement }}</div> |
|||
<div class="input-width1" style="display: flex;"> |
|||
<el-image |
|||
v-for="item in detailInfo.annexList" |
|||
:key="item" |
|||
style="width: 100px; height: 100px; margin-right: 10px;" |
|||
:src="item" |
|||
:preview-src-list="detailInfo.annexList"> |
|||
</el-image> |
|||
</div> |
|||
<div class="d-tips">申请人:{{ detailInfo.showName }}</div> |
|||
<div class="d-tips">申请时间:{{ detailInfo.createdTime }}</div> |
|||
<el-divider></el-divider> |
|||
</template> |
|||
<div class=""></div> |
|||
<el-form :model="form"> |
|||
<el-form-item label="申请类别:" :label-width="'100px'"> |
|||
<span>{{ detailInfo.ruleName }}</span> |
|||
</el-form-item> |
|||
<el-form-item label="申请积分:" :label-width="'100px'"> |
|||
<span>{{ detailInfo.pointValue }}</span> |
|||
</el-form-item> |
|||
<el-form-item label="审核状态:" prop="status" :label-width="'100px'"> |
|||
<el-select v-model="form.status" placeholder="请选择" :disabled="disabled" class="input-width"> |
|||
<el-option |
|||
v-for="item in zwLists" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="备注:" prop="remark" :label-width="'100px'"> |
|||
<el-input v-model="form.remark" type="textarea" :disabled="disabled" autocomplete="off" class="input-width"></el-input> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="handlerCancle">取 消</el-button> |
|||
<el-button v-if="!disabled" type="primary" @click="handleSubmit">确 定</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
<el-dialog title="详情" :visible.sync="dialogVisible" width="800px"> |
|||
<el-form :model="detailInfo" inline> |
|||
|
|||
<div> |
|||
<el-form-item label="所属网格:" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.gridName}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="姓名:" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.name}}</div> |
|||
</el-form-item> |
|||
|
|||
</div> |
|||
<div> |
|||
<!-- <el-form-item label="性别" prop="remark" :label-width="'100px'"> |
|||
<el-input v-model="form.remark" autocomplete="off" class="input-width"></el-input> |
|||
</el-form-item> --> |
|||
<el-form-item label="手机号:" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.mobile}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="身份证:" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.idCard}}</div> |
|||
</el-form-item> |
|||
</div> |
|||
<div> |
|||
|
|||
<el-form-item label="积分类别:" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.ruleName}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="积分分值:" prop="status" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.pointValue}}</div> |
|||
</el-form-item> |
|||
</div> |
|||
<div> |
|||
<el-form-item label="标题:" prop="status" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.title}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="内容:" :label-width="'100px'"> |
|||
<div class="input-width1">{{detailInfo.statement}}</div> |
|||
</el-form-item> |
|||
|
|||
</div> |
|||
<el-form-item label="附件:" :label-width="'100px'"> |
|||
<div class="input-width1" style="display: flex;"> |
|||
<el-image |
|||
v-for="item in detailInfo.annexList" |
|||
:key="item" |
|||
style="width: 100px; height: 100px; margin-right: 10px;" |
|||
:src="item" |
|||
:preview-src-list="detailInfo.annexList"> |
|||
</el-image> |
|||
</div> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="handlerCancle">关闭</el-button> |
|||
<!-- <el-button type="primary" @click="handleSubmit">确 定</el-button> --> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
export default { |
|||
data() { |
|||
return { |
|||
dialogVisible: false, |
|||
dialogFormVisible: false, |
|||
tableLoading: false, |
|||
disabled: false, |
|||
pageLoading: false, |
|||
currentPage: 1, |
|||
pageSize: 20, |
|||
total: null, |
|||
tableData: [], |
|||
searchH: 0, |
|||
addType: 'add', |
|||
optionsG: [], |
|||
zwLists: [ |
|||
{ |
|||
label: '通过', |
|||
value: '2' |
|||
}, |
|||
{ |
|||
label: '驳回', |
|||
value: '1' |
|||
} |
|||
], |
|||
zwList: [ |
|||
{ |
|||
label: '待审核', |
|||
value: '0' |
|||
}, |
|||
{ |
|||
label: '已通过', |
|||
value: '2' |
|||
}, |
|||
{ |
|||
label: '已驳回', |
|||
value: '1' |
|||
} |
|||
], |
|||
selectionList: [], |
|||
tempList: [], |
|||
partyOrgRange: [], |
|||
timeRange: [], |
|||
customerId: '', |
|||
isBatch: false, |
|||
searchForm: { |
|||
// partyOrgId: '', |
|||
mobile: '', |
|||
idCard: '', |
|||
name: '', |
|||
status: '', |
|||
startTime: '', |
|||
endTime: '', |
|||
categoryCode: 'moral_education' |
|||
}, |
|||
form: { |
|||
ids: [], |
|||
status: '2', |
|||
remark: '' |
|||
}, |
|||
detailInfo: {}, |
|||
partyProps: { |
|||
label: 'partyOrgName', |
|||
value: 'id', |
|||
checkStrictly: true |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapGetters(['clientHeight', 'iframeHeight']), |
|||
tableHeight() { |
|||
const h = this.clientHeight - this.searchH - 280 + this.iframeHeigh |
|||
const _h = this.clientHeight - 280 - this.searchH |
|||
return this.$store.state.inIframe ? h : _h |
|||
} |
|||
}, |
|||
async created() { |
|||
this.customerId = localStorage.getItem('customerId') |
|||
this.getTableData() |
|||
this.getGridList('query') |
|||
this.pageLoading = true |
|||
|
|||
}, |
|||
|
|||
mounted() { |
|||
|
|||
this.$nextTick(() => { |
|||
this.searchH = this.$refs.searchCard.$el.offsetHeight |
|||
console.log('tableHeight', this.tableHeight) |
|||
}) |
|||
|
|||
}, |
|||
methods: { |
|||
handleSelection(val) { |
|||
this.selectionList = [...val] |
|||
}, |
|||
handleSizeChange(val) { |
|||
console.log(`每页 ${val} 条`) |
|||
this.pageSize = val |
|||
this.getTableData() |
|||
}, |
|||
handleCurrentChange(val) { |
|||
console.log(`当前页: ${val}`) |
|||
this.currentPage = val |
|||
if (this.selectionList.length > 0 && val !== 1) { |
|||
this.tempList = [...this.tempList, ...this.selectionList] |
|||
} |
|||
this.getTableData() |
|||
}, |
|||
handlePartyChange(val) { |
|||
console.log('val------pp', val) |
|||
this.searchForm.partyOrgId = val[val.length - 1] |
|||
}, |
|||
handleFilterSpan(row, item) { |
|||
let _val = '' |
|||
if (item.options && item.options.length > 0) { |
|||
item.options.forEach((n) => { |
|||
if (n.value === row[item.columnName]) _val = n.label |
|||
}) |
|||
} |
|||
return _val || row[item.columnName] |
|||
}, |
|||
handleTimeChange (val) { |
|||
if (val.length > 0) { |
|||
this.searchForm.startTime = val[0] |
|||
this.searchForm.endTime = val[1] |
|||
} else { |
|||
this.searchForm.startTime = '' |
|||
this.searchForm.endTime = '' |
|||
} |
|||
|
|||
}, |
|||
|
|||
handleDelimg(item, index) { |
|||
this.form.imageList.splice(index, 1) |
|||
}, |
|||
handleSearch(val) { |
|||
console.log('searchhh--', val) |
|||
this.currentPage = 1 |
|||
this.getTableData() |
|||
}, |
|||
resetForm(formName) { |
|||
this.timeRange = [] |
|||
this.searchForm.startTime = '' |
|||
this.searchForm.endTime = '' |
|||
this.$refs[formName].resetFields() |
|||
this.handleSearch() |
|||
}, |
|||
handleAdd() { |
|||
if (this.selectionList.length == 0) return this.$message.warning('请选择数据') |
|||
this.isBatch = true |
|||
this.dialogFormVisible = true |
|||
}, |
|||
|
|||
handlerCancle() { |
|||
this.detailInfo = {} |
|||
this.selectionList = [] |
|||
this.tempList = [] |
|||
this.disabled = false |
|||
this.isBatch = false |
|||
this.form = { |
|||
ids: [], |
|||
status: '2', |
|||
remark: '' |
|||
} |
|||
this.dialogFormVisible = false |
|||
this.dialogVisible = false |
|||
}, |
|||
async handleLook(row) { |
|||
this.disabled = true |
|||
this.isBatch = false |
|||
await this.getDetail(row.id) |
|||
this.dialogFormVisible = true |
|||
}, |
|||
async handleEdit(row, addType) { |
|||
this.form.ids = [row.id] |
|||
this.isBatch = false |
|||
// this.detailInfo = { ...row } |
|||
await this.getDetail(row.id) |
|||
this.dialogFormVisible = true |
|||
}, |
|||
|
|||
handleDel(row) { |
|||
let params = { |
|||
ids: [row.id] |
|||
} |
|||
console.log('row1', row) |
|||
this.$http |
|||
.post('/resi/partymember/icPartyMember/delete', [row.id]) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
this.$message.success('删除成功') |
|||
this.getTableData() |
|||
} |
|||
}) |
|||
.catch((err) => { |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
}, |
|||
async handleSubmit() { |
|||
|
|||
if (this.form.ids.length == 0) { |
|||
if (this.tempList.length > 0) this.form.ids = Array.from(new Set(this.tempList.map(item => item.id))) |
|||
else this.form.ids = Array.from(new Set(this.selectionList.map(item => item.id))) |
|||
|
|||
} |
|||
this.$http |
|||
.post('/point/apply/examine/submit', this.form) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
this.$message.success('操作成功') |
|||
this.handlerCancle() |
|||
this.getTableData() |
|||
} |
|||
}) |
|||
.catch((err) => { |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
}, |
|||
async getDetail(id) { |
|||
let params = { |
|||
id, |
|||
} |
|||
this.$http |
|||
.post(`/point/apply/detail/${id}`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
this.detailInfo = { ...res.data } |
|||
if (this.disabled) { |
|||
this.form.status = res.data.status |
|||
this.form.remark = res.data.remark |
|||
} |
|||
|
|||
// this.dialogVisible = true |
|||
} |
|||
}) |
|||
.catch((err) => { |
|||
console.log('row4', err) |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
}, |
|||
async getGridList(type, agencyId) { |
|||
const { user } = await this.$store.state |
|||
console.log('user---ppp', user) |
|||
// addorupdate query |
|||
await this.$http |
|||
.get('/resi/partymember/icPartyOrg/getSearchTreelist', { params: {agencyId: agencyId || user.agencyId} }) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
console.log('获取查询详情成功', res.data) |
|||
|
|||
this.optionsG = this.deepArrTOnull(res.data) |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
}, |
|||
deepArrTOnull(arr) { |
|||
let a = [] |
|||
a = arr.map(item => { |
|||
return { |
|||
...item, |
|||
children: (item.children.length > 0 && this.deepArrTOnull(item.children) )|| null |
|||
} |
|||
}) |
|||
return a |
|||
}, |
|||
async getTableData() { |
|||
this.tableLoading = true |
|||
const { user } = await this.$store.state |
|||
let params = { |
|||
...this.searchForm, |
|||
agencyId: user.agencyId, |
|||
pageNo: this.currentPage, |
|||
pageSize: this.pageSize |
|||
} |
|||
await this.$http |
|||
.post('/point/apply/listall', params) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
this.tableData = res.data.list |
|||
this.total = res.data.total |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
this.tableLoading = false |
|||
} |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "@/assets/scss/buttonstyle.scss"; |
|||
|
|||
.resi-container .resi-card-table { |
|||
::v-deep .el-table th { |
|||
color: #fff; |
|||
background-color: rgba(33, 149, 254, 1); |
|||
// border-right: 1px solid rgba(33, 149, 254, 1); |
|||
} |
|||
} |
|||
.resi-table { |
|||
::v-deep .el-button--text { |
|||
text-decoration: underline; |
|||
} |
|||
::v-deep .btn-color-del { |
|||
margin-left: 10px; |
|||
color: rgba(213, 16, 16, 1); |
|||
} |
|||
::v-deep .btn-color-edit { |
|||
color: rgba(0, 167, 169, 1); |
|||
} |
|||
} |
|||
.input-width { |
|||
width: 200px; |
|||
|
|||
} |
|||
.form-wr { |
|||
.input-width { |
|||
width: 260px; |
|||
|
|||
} |
|||
.input-width-textarea { |
|||
width: 500px; |
|||
} |
|||
.imsg-list { |
|||
display: flex; |
|||
align-items: center; |
|||
.imgs-item { |
|||
position: relative; |
|||
margin-right: 10px; |
|||
.el-icon-delete { |
|||
position: absolute; |
|||
top: 0; |
|||
right: 0; |
|||
font-size: 18px; |
|||
color: red; |
|||
z-index: 3; |
|||
cursor: pointer; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
.div-content { |
|||
width: 100%; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
white-space: nowrap; |
|||
} |
|||
.d-title { |
|||
text-align: center; |
|||
font-size: 18px; |
|||
} |
|||
.d-desc { |
|||
margin: 10px 0; |
|||
// font-size: ; |
|||
text-indent: 2em; |
|||
line-height: 16px; |
|||
} |
|||
.d-tips { |
|||
color: #999; |
|||
margin-top: 10px; |
|||
} |
|||
</style> |
|||
|
|||
<style lang="scss" scoped> |
|||
|
|||
.resi-row-btn { |
|||
display: flex; |
|||
margin-bottom: 13px; |
|||
::v-deep .el-button { |
|||
// margin-left: 10px; |
|||
border: 0; |
|||
} |
|||
::v-deep .el-select { |
|||
margin-right: 10px; |
|||
} |
|||
.el-button--success { |
|||
background: rgba(34, 193, 195, 1); |
|||
} |
|||
.el-button { |
|||
margin-left: 10px; |
|||
border: 0; |
|||
} |
|||
.el-button--success { |
|||
background: rgba(34, 193, 195, 1); |
|||
} |
|||
.el-button--warning { |
|||
background: rgba(254, 179, 73, 1); |
|||
} |
|||
.el-button--danger { |
|||
background: rgba(254, 98, 82, 1); |
|||
} |
|||
} |
|||
.avatar-uploader { |
|||
::v-deep |
|||
.el-upload { |
|||
cursor: pointer; |
|||
position: relative; |
|||
overflow: hidden; |
|||
} |
|||
.el-upload:hover { |
|||
border-color: #409EFF; |
|||
} |
|||
.avatar { |
|||
width: 100px; |
|||
height: 100px; |
|||
display: block; |
|||
} |
|||
.avatar-uploader-icon { |
|||
border: 1px dashed #d9d9d9; |
|||
border-radius: 6px; |
|||
font-size: 28px; |
|||
color: #8c939d; |
|||
width: 100px; |
|||
height: 100px; |
|||
line-height: 100px; |
|||
text-align: center; |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
.resi-btns { |
|||
margin-top: 20px; |
|||
text-align: center; |
|||
} |
|||
.input-width1 { |
|||
width: 250px; |
|||
} |
|||
</style> |
@ -0,0 +1,517 @@ |
|||
<template> |
|||
<div v-if="pageLoading" |
|||
class="resi-container"> |
|||
<el-card class="resi-card-table"> |
|||
<div class="resi-row-btn"> |
|||
<el-button class="diy-button--add" |
|||
size="small" |
|||
@click="handleAdd('1', 'add')">添加积分类别</el-button> |
|||
</div> |
|||
|
|||
<el-table :data="tableData" |
|||
row-key="id" |
|||
v-loading="tableLoading" |
|||
:height="tableHeight" |
|||
style="width: 100%" |
|||
class="resi-table" |
|||
border> |
|||
<el-table-column v-for="item in tableHeader" |
|||
:key="item.columnName" |
|||
:prop="item.columnName" |
|||
:label="item.label" |
|||
:align="item.align"> |
|||
</el-table-column> |
|||
<el-table-column label="操作" |
|||
align="center" |
|||
width="200"> |
|||
<template slot-scope="scope"> |
|||
<el-button v-if="scope.row.pid == 0" |
|||
@click="handleAdd('2', 'add', scope.row.id)" |
|||
type="text" |
|||
size="small" |
|||
class="btn-color-1j">添加二级分类</el-button> |
|||
<el-button v-if="scope.row.pid != 0 && scope.row.categoryName" |
|||
@click="handleAdd('3', 'add', scope.row.id, scope.row.pid, scope.row.categoryName)" |
|||
type="text" |
|||
size="small" |
|||
class="btn-color-2j">添加积分规则</el-button> |
|||
<el-button v-if="scope.row.pid != 0" |
|||
@click="handleEdit(scope.row, 'edit', scope.row.categoryName ? '4' : scope.row.ruleName ? '5' : '1')" |
|||
type="text" |
|||
size="small" |
|||
class="btn-color-edit">修改</el-button> |
|||
<el-button v-if="scope.row.pid != 0" |
|||
@click="handleDel(scope.row)" |
|||
type="text" |
|||
size="small" |
|||
class="btn-color-del">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-card> |
|||
|
|||
<el-dialog :title="addLevel == '1' ? '添加积分分类' : addLevel == '2' ? '添加二级分类' : addLevel == '3' ? '添加积分规则' : addLevel == '4' ? '修改二级分类' : addLevel == '5' ? '修改积分规则' : ''" |
|||
:visible.sync="dialogVisible" |
|||
width="40%" |
|||
append-to-body |
|||
:close-on-click-modal="false" |
|||
:before-close="handlerCancle"> |
|||
<el-form label-width="100px" |
|||
:model="form" |
|||
:rules="rules" |
|||
ref="ruleForm"> |
|||
<el-form-item label="上级分类" |
|||
prop="pid"> |
|||
<el-select class="item_width_1" |
|||
v-model="form.pid" |
|||
placeholder="请选择" |
|||
size="small" |
|||
:disabled="addLevel == '2' || addLevel == '3' || addLevel == '4' || addLevel == '5' ? true : false" |
|||
clearable> |
|||
<el-option v-for="item in typeList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="类别名称" |
|||
prop="categoryName"> |
|||
<el-input :disabled="addLevel == '3' || addLevel == '5' ? true : false" v-model="form.categoryName" |
|||
size="small" |
|||
style="width: 180px;"></el-input> |
|||
</el-form-item> |
|||
<el-form-item v-if="addLevel == '3' || addLevel == '5'" label="规则名称" |
|||
prop="ruleName"> |
|||
<el-input v-model="form.ruleName" |
|||
size="small" |
|||
style="width: 180px;"></el-input> |
|||
</el-form-item> |
|||
<el-form-item v-if="addLevel == '3' || addLevel == '5'" |
|||
label="加减分值" |
|||
prop="pointValue"> |
|||
<el-input-number v-model="form.pointValue" |
|||
size="small" |
|||
label="描述文字"></el-input-number> |
|||
(减分请输入负数) |
|||
</el-form-item> |
|||
<el-form-item v-if="addLevel == '3' || addLevel == '5'" |
|||
label="居民端积分申请" |
|||
prop="applyFlag" |
|||
label-width="140px"> |
|||
<el-radio v-model="form.applyFlag" label="0">允许申请</el-radio> |
|||
<el-radio v-model="form.applyFlag" label="1">不允许申请</el-radio> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="resi-btns"> |
|||
<el-button size="small" |
|||
@click="handlerCancle">取消</el-button> |
|||
<el-button type="primary" |
|||
size="small" |
|||
:loading="btnLoading" |
|||
@click="handleSUbmit">提交</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
export default { |
|||
data () { |
|||
return { |
|||
tableLoading: false, |
|||
btnLoading: false, |
|||
pageLoading: false, |
|||
dialogVisible: false, |
|||
tableData: [], |
|||
sHeight: 0, |
|||
addLevel: '1', |
|||
addType: 'add', |
|||
tableHeader: [ |
|||
{ |
|||
label: '积分类别', |
|||
align: 'left', |
|||
columnName: 'categoryName' |
|||
}, { |
|||
label: '积分规则', |
|||
columnName: 'ruleName', |
|||
align: 'center' |
|||
} |
|||
], |
|||
typeList: [], //类别 |
|||
form: { // 新增修改相关 |
|||
categoryName: '', // 类别名称 |
|||
pid: '', // 上级类别ID |
|||
newPid: '', // 添加积分规则用到的pid |
|||
ruleName: '', // 积分规则名称 |
|||
pointValue: '', // 加减积分 |
|||
applyFlag: '0' // 允许申请0,不允许申请1 |
|||
}, |
|||
ruleform:{}, // 积分规则查询相关数据,由于只是修改名称/分值/是否申请 所以之前的数据不做改变只做展示用 全部放在form里面 |
|||
typeform: {}, // 积分二级分类 |
|||
rules: { |
|||
pid: [{ required: true, message: '请选择分类', trigger: 'blur' }], |
|||
categoryName: [{ required: true, message: '类别名称不能为空', trigger: 'blur' }], |
|||
ruleName: [{ required: true, message: '规则名称不能为空', trigger: 'blur' }], |
|||
pointValue: [{ required: true, message: '加减分值不能为空', trigger: 'blur' }], |
|||
applyFlag: [{ required: true, message: '请选择积分申请', trigger: 'blur' }] |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
tableHeight () { |
|||
const h = this.clientHeight - this.sHeight + this.iframeHeigh |
|||
const _h = this.clientHeight - this.sHeight |
|||
return this.$store.state.inIframe ? h : _h |
|||
}, |
|||
|
|||
...mapGetters(['clientHeight', 'iframeHeight']) |
|||
}, |
|||
async created () { |
|||
this.getTableData() |
|||
this.pageLoading = true |
|||
}, |
|||
mounted () { |
|||
this.$nextTick(() => { |
|||
this.sHeight = 210 |
|||
}) |
|||
}, |
|||
methods: { |
|||
// 列表添加相关 |
|||
handleAdd (type, addType, id, pid, categoryName) { |
|||
if (type === '1') { |
|||
this.form.pid = '' |
|||
this.form.categoryName = '' |
|||
} |
|||
this.addLevel = type |
|||
this.addType = addType |
|||
if (type == '2') { |
|||
this.form.pid = id |
|||
this.form.categoryName = '' |
|||
} |
|||
|
|||
if (type == '3') { |
|||
this.form.pid = pid |
|||
this.form.newPid = id |
|||
this.form.categoryName = categoryName |
|||
} |
|||
this.dialogVisible = true |
|||
}, |
|||
handlerCancle () { |
|||
this.dialogVisible = false |
|||
}, |
|||
// 列表修改点击事件 |
|||
async handleEdit (row, addType, level) { |
|||
console.log(addType, level) |
|||
let url = '' |
|||
if (level === '4') { |
|||
url = `/point/additiverule/categorydetail/${row.id}` |
|||
} else if(level === '5') { |
|||
url = `/point/additiverule/ruledetail/${row.id}` |
|||
|
|||
await this.$http.post(`/point/additiverule/categorydetail/${row.pid}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
this.form.pid = res.data.pid // 分类 |
|||
this.form.categoryName = res.data.categoryName // 类别名称 |
|||
this.form.newPid = res.data.id // 类别 id |
|||
} |
|||
}) |
|||
} |
|||
this.addLevel = level |
|||
this.addType = addType |
|||
this.dialogVisible = true |
|||
await this.$http.post(url).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
if (this.addLevel === '4' ) { |
|||
this.form.pid = res.data.pid // 分类 |
|||
this.form.categoryName = res.data.categoryName // 类别名称 |
|||
this.form.newPid = res.data.id // 类别 id |
|||
this.typeform = { ...res.data } |
|||
} else { |
|||
this.form.applyFlag = res.data.applyFlag // 积分规则 只有这三块内容可以修改 |
|||
this.form.ruleName = res.data.ruleName |
|||
this.form.pointValue = res.data.pointValue |
|||
this.ruleform = { ...res.data } |
|||
} |
|||
|
|||
} |
|||
}) |
|||
}, |
|||
// 添加积分类别 |
|||
async addLevelFirst () { |
|||
const _form = { |
|||
pid: this.form.pid, // 上级类别ID |
|||
categoryName: this.form.categoryName // 类别名称 |
|||
} |
|||
await this.$http |
|||
.post('/point/additiverule/addcategory', _form) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
this.dialogVisible = false |
|||
this.getTableData() |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
this.btnLoading = false |
|||
}, |
|||
// 添加积分规则 |
|||
async addLevelChild () { |
|||
const _form = { |
|||
ruleName: this.form.ruleName, |
|||
pid: this.form.newPid, |
|||
pointValue: this.form.pointValue, |
|||
applyFlag: this.form.applyFlag |
|||
} |
|||
await this.$http |
|||
.post('/point/additiverule/addrule', _form) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
this.dialogVisible = false |
|||
this.getTableData() |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
this.form.ruleName = '' |
|||
this.form.pointValue = '' |
|||
this.btnLoading = false |
|||
}, |
|||
// 提交按钮 |
|||
handleSUbmit () { |
|||
this.$refs.ruleForm.validate(async (valid) => { |
|||
if (valid) { |
|||
this.btnLoading = true |
|||
if (this.addType == 'add') { |
|||
if (this.addLevel == '1' || this.addLevel == '2') this.addLevelFirst() |
|||
else this.addLevelChild() |
|||
} else this.editCate() |
|||
|
|||
} else { |
|||
console.log('error submit!!'); |
|||
return false; |
|||
} |
|||
}); |
|||
}, |
|||
// 修改提交 |
|||
async editCate () { |
|||
if (this.addLevel === '4' ) { // 分类修改 |
|||
this.typeform.categoryName = this.form.categoryName |
|||
this.typeform.type = 'category' |
|||
} else { |
|||
this.ruleform.ruleName = this.form.ruleName |
|||
this.ruleform.pointValue = this.form.pointValue |
|||
this.ruleform.applyFlag = this.form.applyFlag |
|||
this.ruleform.type = 'rule' |
|||
} |
|||
console.log(JSON.stringify(this.ruleform)) |
|||
await this.$http |
|||
.post('/point/additiverule/modify', this.addLevel==='4' ? this.typeform : this.ruleform) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
this.dialogVisible = false |
|||
this.getTableData() |
|||
this.$message.success('保存成功') |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
this.btnLoading = false |
|||
}, |
|||
// 删除 |
|||
handleDel (row) { |
|||
this.$confirm("确认删除?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning" |
|||
}).then(() => { |
|||
let params = [row.id] |
|||
console.log('row1', row) |
|||
this.$http.post('/point/additiverule/delete', params) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
console.log('row3', row) |
|||
this.$message.success('删除成功') |
|||
this.getTableData() |
|||
} |
|||
}) |
|||
.catch((err) => { |
|||
console.log('row4', err) |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
}).catch(err => { |
|||
console.log(err) |
|||
}); |
|||
}, |
|||
// 查询积分类别规则列表 |
|||
async getTableData () { |
|||
this.typeList = [] |
|||
this.tableData = [] |
|||
this.tableLoading = true |
|||
let params = {} |
|||
await this.$http.post('/point/additiverule/list4tree', params).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
let list = [] |
|||
if (res.data.length > 0) { |
|||
res.data.forEach(element => { // 一级循环 |
|||
if (element.pid === '0') { |
|||
element.children = [] |
|||
list.push(element) |
|||
this.typeList.push({ //类别 |
|||
value: element.id, |
|||
label: element.categoryName |
|||
}) |
|||
} |
|||
}); |
|||
} |
|||
if (list.length > 0) { // 二级循环 |
|||
res.data.forEach(element => { |
|||
if (element.pid) { |
|||
list.forEach((item, index) => { |
|||
if (element.pid === item.id) { |
|||
element.children = [] |
|||
list[index].children.push(element) |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
} |
|||
if (list.length > 0) { // 三级循环 |
|||
res.data.forEach(element => { |
|||
if (element.pid) { |
|||
list.forEach((item, index) => { |
|||
if (item.children.length > 0 ) { |
|||
item.children.forEach((itemC, indexC) => { |
|||
if (element.pid === itemC.id) { |
|||
list[index].children[indexC].children.push(element) |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
} |
|||
this.tableData = list.map((item, index) => { |
|||
return { |
|||
...item, |
|||
index: index + 1, |
|||
children: item.children.map(n => { |
|||
return { |
|||
...n |
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
this.tableLoading = false |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.resi-container .resi-card-table { |
|||
::v-deep .el-table { |
|||
th { |
|||
color: #fff; |
|||
background-color: rgba(33, 149, 254, 1); |
|||
} |
|||
|
|||
.cell { |
|||
span:nth-of-type(3) { |
|||
display: inline-block; |
|||
width: 90%; |
|||
word-break: break-all; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
.resi-table { |
|||
::v-deep .el-button--text { |
|||
text-decoration: underline; |
|||
} |
|||
::v-deep .btn-color-del { |
|||
margin-left: 10px; |
|||
color: rgba(213, 16, 16, 1); |
|||
} |
|||
::v-deep .btn-color-2j { |
|||
margin-left: 10px; |
|||
color: #fdaf30; |
|||
} |
|||
::v-deep .btn-color-1j { |
|||
margin-left: 10px; |
|||
color: #3cb357; |
|||
} |
|||
::v-deep .btn-color-edit { |
|||
color: rgba(0, 167, 169, 1); |
|||
} |
|||
} |
|||
</style> |
|||
|
|||
<style lang="scss" scoped> |
|||
.resi-row-btn { |
|||
display: flex; |
|||
margin-bottom: 13px; |
|||
::v-deep .el-button { |
|||
// margin-left: 10px; |
|||
border: 0; |
|||
} |
|||
::v-deep .el-select { |
|||
margin-right: 10px; |
|||
} |
|||
.el-button--success { |
|||
background: rgba(34, 193, 195, 1); |
|||
} |
|||
} |
|||
.avatar-uploader { |
|||
::v-deep .el-upload { |
|||
cursor: pointer; |
|||
position: relative; |
|||
overflow: hidden; |
|||
} |
|||
.el-upload:hover { |
|||
border-color: #409eff; |
|||
} |
|||
.avatar { |
|||
width: 70px; |
|||
height: 70px; |
|||
display: block; |
|||
} |
|||
.avatar-uploader-icon { |
|||
border: 1px dashed #d9d9d9; |
|||
border-radius: 6px; |
|||
font-size: 28px; |
|||
color: #8c939d; |
|||
width: 70px; |
|||
height: 70px; |
|||
line-height: 70px; |
|||
text-align: center; |
|||
} |
|||
} |
|||
|
|||
.resi-btns { |
|||
margin-top: 20px; |
|||
text-align: center; |
|||
} |
|||
</style> |
Loading…
Reference in new issue