卢龙web端功能迁移

This commit is contained in:
liuye
2023-10-17 11:25:18 +08:00
parent 3ade163fbd
commit eed32e32a7
37 changed files with 10779 additions and 0 deletions

View File

@@ -0,0 +1,270 @@
<template>
<ai-detail class="detail">
<template slot="title">
<ai-title title="积分审核" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
<template #rightBtn>
<el-button size="small" type="primary" @click="isShow = true" v-if="info.status === '0'">审核</el-button>
</template>
</ai-title>
</template>
<template slot="content">
<ai-card title="基本信息">
<template #content>
<ai-wrapper>
<ai-info-item label="事件类型" isLine :value="info.applyItemName"></ai-info-item>
<ai-info-item label="申请人" :value="info.integralUserName"></ai-info-item>
<ai-info-item label="手机号" :value="info.phone"></ai-info-item>
<ai-info-item label="所属地区" :value="info.areaName"></ai-info-item>
<ai-info-item label="所属网格" :value="info.girdName"></ai-info-item>
<ai-info-item label="审核时间" v-if="info.status === '1'" :value="info.auditTime"></ai-info-item>
<ai-info-item label="申请时间" v-if="info.status === '0'" :value="info.createTime"></ai-info-item>
<ai-info-item label="状态">
<span>{{ dict.getLabel('appIntegralApplyEventStatus', info.status) }}</span>
<span v-if="info.status === '1'" style="margin-left: 10px; color: green">积分+{{ info.applyIntegral }}</span>
</ai-info-item>
<ai-info-item label="审批意见" v-if="info.status === '2'" isLine>
<span style="color: red;">{{ info.auditDesc }}</span>
</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="事件信息">
<template #right>
<el-button size="small" type="primary" @click="showEvent" v-if="info.status === '0'">编辑</el-button>
</template>
<template #content>
<ai-wrapper>
<ai-info-item label="积分值" isLine :value="info.applyIntegral"></ai-info-item>
<ai-info-item label="事件描述" isLine :value="info.content"></ai-info-item>
<ai-info-item label="图片" isLine v-if="info.images && info.images.length">
<div class="files">
<!-- <div class="file-item" v-for="(item, index) in info.images" :key="index" v-viewer="{movable: true}">
<img :src="item.url">
</div> -->
<ai-uploader
:instance="instance"
fileType="img"
acceptType=".jpg,.png,.jpeg,.JPG,.PNG,.JPEG"
v-model="info.images"
:limit="9" :disabled="true">
</ai-uploader>
</div>
</ai-info-item>
<ai-info-item label="视频" isLine v-if="info.videos && info.videos.length">
<div class="files">
<div class="file-item" v-for="(item, index) in info.videos" :key="index">
<video controls :src="item.url"></video>
</div>
</div>
</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-dialog
:visible.sync="isShow"
@onConfirm="onConfirm"
@close="onClose"
width="890px"
title="审核">
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
<el-form-item label="是否通过" prop="auditStatus" style="width: 100%;" :rules="[{required: true, message: '请选择是否通过', trigger: 'change'}]">
<el-radio-group v-model="form.auditStatus">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="auditDesc" v-if="form.auditStatus === '0'" label="审批意见" style="width: 100%" :rules="[{required: true, message: '请输入审批意见', trigger: 'blur'}]">
<el-input size="small" type="textarea" :rows="5" v-model="form.auditDesc" clearable placeholder="请输入审批意见"></el-input>
</el-form-item>
</el-form>
</ai-dialog>
<ai-dialog
:visible.sync="isShowEvent"
@onConfirm="onEventConfirm"
@close="onClose"
width="890px"
title="编辑">
<el-form class="ai-form" :model="eventForm" label-width="120px" ref="eventForm">
<el-form-item label="积分值" prop="applyIntegral" :rules="[{required: true, message: '请输入积分值', trigger: 'change'}]">
<el-input-number style="width: 200px;" size="small" :precision="2" type="input" v-model="eventForm.applyIntegral" clearable placeholder="请输入积分值" :min="0"></el-input-number>
</el-form-item>
<el-form-item prop="content" label="事件描述" style="width: 100%" :rules="[{required: true, message: '请输入事件描述', trigger: 'blur'}]">
<el-input size="small" type="textarea" :rows="5" :maxlength="300" show-word-limit v-model="eventForm.content" clearable placeholder="请输入事件描述"></el-input>
</el-form-item>
<el-form-item style="width: 100%" label="图片">
<ai-uploader
:instance="instance"
fileType="img"
acceptType=".jpg,.png,.jpeg"
v-model="eventForm.images"
:limit="9">
</ai-uploader>
</el-form-item>
<el-form-item style="width: 100%" label="视频">
<ai-uploader
:instance="instance"
fileType="file"
acceptType=".mp4,.MOV"
v-model="eventForm.videos"
:limit="9">
</ai-uploader>
</el-form-item>
</el-form>
</ai-dialog>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
info: {},
form: {
auditDesc: '',
auditStatus: ''
},
eventForm: {
files: null,
images: [],
videos: [],
content: '',
applyIntegral: ''
},
isShowEvent: false,
isShow: false
}
},
created () {
this.getInfo()
},
methods: {
getInfo () {
this.instance.post(`/app/appintegraluserapply/queryDetailById?id=${this.params.id}`).then(res => {
if (res.code == 0) {
if (res.data) {
this.info = {
...res.data,
files: res.data.files.map(v => {
return {
...v,
postfix: v.postfix.toLowerCase()
}
})
}
if (res.data.status === '0') {
this.eventForm.files = res.data.files
this.eventForm.content = res.data.content
this.eventForm.applyIntegral = res.data.applyIntegral
}
this.info.images = res.data.files.filter(e => (['jpeg', 'jpg', 'png', 'JPG', 'JPEG', 'PNG'].includes(e.postfix.split('.')[1])))
this.info.videos = res.data.files.filter(e => (['mp4', 'MP4', 'MOV'].includes(e.postfix.split('.')[1])))
}
}
})
},
showEvent () {
this.eventForm.files = null
this.eventForm.content = this.info.content
this.eventForm.applyIntegral = this.info.applyIntegral
this.eventForm.images = this.info.images
this.eventForm.videos = this.info.videos
this.isShowEvent = true
},
onClose () {
this.form.auditDesc = ''
this.form.auditStatus = ''
},
onEventConfirm () {
if ((this.eventForm.images.length + this.eventForm.videos.length) > 9) {
return this.$message.error('图片和视频不得超过9个')
} else {
this.eventForm.files = [...this.eventForm.images,...this.eventForm.videos]
}
this.$refs.eventForm.validate((valid) => {
if (valid) {
this.instance.post(`/app/appintegraluserapply/updateByGirdMember`, {
...this.eventForm,
id: this.params.id,
}).then(res => {
if (res.code == 0) {
this.$message.success('编辑成功!')
this.isShowEvent = false
this.getInfo()
}
})
}
})
},
onConfirm () {
this.$refs.form.validate((valid) => {
if (valid) {
this.instance.post(`/app/appintegraluserapply/auditById`, {
...this.form,
id: this.params.id
}).then(res => {
if (res.code == 0) {
this.$message.success('审核成功!')
this.isShow = false
this.getInfo()
}
})
}
})
},
cancel () {
this.$emit('change', {
type: 'List',
isRefresh: true
})
}
}
}
</script>
<style scoped lang="scss">
.detail {
.files {
display: flex;
align-items: center;
flex-wrap: wrap;
.file-item {
width: 118px;
height: 118px;
margin: 0 20px 20px 0;
img, video {
width: 100%;
height: 100%;
object-fit: cover;
}
img {
cursor: pointer;
transition: all ease 0.3s;
&:hover {
opacity: 0.7;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,293 @@
<template>
<ai-list class="AppIntegratingAudit">
<template slot="title">
<ai-title title="积分审核" isShowBottomBorder v-model="search.areaId" isShowArea :hideLevel="hideLevel - 1" @change="changeArea">
</ai-title>
</template>
<template slot="content">
<ai-search-bar class="search-bar">
<template #left>
<ai-select
v-model="search.applyItemId"
@change="(search.current = 1), getList()"
placeholder="请选择事件/类型"
:selectList="dictList">
</ai-select>
<el-date-picker
v-model="search.createTimeStart"
type="date"
size="small"
value-format="yyyy-MM-dd"
placeholder="选择开始日期"
@change="search.current = 1, getList()">
</el-date-picker>
<el-date-picker
v-model="search.createTimeEnd"
type="date"
size="small"
value-format="yyyy-MM-dd"
placeholder="选择结束日期"
@change="search.current = 1, getList()">
</el-date-picker>
<ai-picker
:instance="instance"
:multiple="false"
dialogTitle="选择网格"
:ops="{ label: 'girdName' }"
pageTitle="网格"
action="/app/appgirdinfo/girdList"
v-model="userList"
@pick="onGridChange">
<div class="userSelcet">
<span style="color: #606266;" v-if="search.girdId">{{ search.girdName }}</span>
<span v-else>请选择网格</span>
<i class="el-icon-arrow-up" v-if="!search.girdId"></i>
<i class="el-icon-circle-close" v-if="search.girdId" @click.stop="userList = [], search.girdId = '', search.girdName = '', search.current = 1, getList()"></i>
</div>
</ai-picker>
<ai-select
v-model="search.status"
@change="(search.current = 1), getList()"
placeholder="请选择状态"
:selectList="$dict.getDict('appIntegralApplyEventStatus')">
</ai-select>
</template>
<template #right>
<el-input
v-model="search.createUserName"
class="search-input"
size="small"
v-throttle="() => {search.current = 1, getList()}"
placeholder="请输入申请人、审批人"
clearable
@clear="search.current = 1, search.createUserName = '', getList()"
suffix-icon="iconfont iconSearch">
</el-input>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
style="margin-top: 6px;"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="options" width="180px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
<!-- <el-button type="text" @click="remove(row.id)">删除</el-button> -->
<el-button type="text" @click="push(row.id)" v-if="row.status === '1' && row.pushStatus === '0'">推送精选</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
</template>
<script>
import { MessageBox } from 'element-ui'
import { mapState } from 'vuex'
export default {
name: 'List',
props: {
instance: Function,
dict: Object
},
data () {
return {
search: {
current: 1,
size: 10,
areaId: '',
applyItemId: '',
girdId: '',
createTimeStart: '',
createTimeEnd: '',
girdName: ''
},
userList: [],
dictList: [],
total: 10,
colConfigs: [
{ prop: 'applyItemName', label: '事件类型', align: 'left' },
{ prop: 'integralUserName', label: '申请人', align: 'center' },
{ prop: 'areaName', label: '所属地区', align: 'center' },
{ prop: 'girdName', label: '所属网格', align: 'center' },
{ prop: 'createTime', label: '申请时间', align: 'center' },
{ prop: 'status', label: '状态', align: 'center', format: v => this.dict.getLabel('appIntegralApplyEventStatus', v) },
{ prop: 'auditUserName', label: '审批人', align: 'center' },
{ prop: 'pushStatus', label: '推送精选', align: 'center', format: v => this.dict.getLabel('appIntegralApplyEventPushStatus', v) }
],
tableData: [],
dateList: []
}
},
computed: {
...mapState(['user']),
hideLevel () {
return this.user.info.areaList?.length || 0
}
},
created () {
this.search.areaId = this.user.info.areaId
this.$dict.load('appIntegralApplyEventStatus', 'appIntegralApplyEventPushStatus').then(() => {
this.getList()
this.getRulesList()
})
},
methods: {
getRulesList () {
this.instance.post(`/app/appintegralrule/listByAppletFD?current=1&size=3000`).then((res) => {
if (res.code === 0) {
this.dictList = res.data.records.map(v => {
return {
dictName: v.ruleName,
dictValue: v.id
}
})
}
})
},
onGridChange (e) {
if (e.length) {
this.search.girdId = e[0].id
this.search.girdName = e[0].girdName
this.search.current = 1
this.getList()
}
},
getList () {
this.instance.post(`/app/appintegraluserapply/list`, null, {
params: {
...this.search
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
},
changeArea () {
this.search.current = 1
this.$nextTick(() => {
this.getList()
})
},
push (id) {
MessageBox.confirm('是否将精选内容对全体居民公开,选则否将只对本村/社区居民公开。', '推送精选', {
distinguishCancelAndClose: true,
confirmButtonText: '是',
type: 'warning',
closeOnClickModal: false,
center: true,
customClass: 'AiConfirm',
cancelButtonText: '否'
}).then(() => {
this.instance.post(`/app/appintegraluserapply/pushById?id=${id}&status=1`).then(res => {
if (res.code == 0) {
this.getList()
this.$message.success('推送成功')
}
})
}).catch((e) => {
e === 'cancel' && this.instance.post(`/app/appintegraluserapply/pushById?id=${id}&status=0`).then(res => {
if (res.code == 0) {
this.getList()
this.$message.success('推送成功')
}
})
})
},
remove (id) {
this.$confirm('确定删除该帖子?').then((e) => {
this.instance.post(`/app/appintegraluserapply/delete?id=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
toDetail (id) {
this.$emit('change', {
type: 'Detail',
params: {
id: id || ''
}
})
},
toAdd(id) {
this.$emit('change', {
type: 'Add',
params: {
id: id || ''
}
})
}
}
}
</script>
<style lang="scss" scoped>
.AppIntegratingAudit {
.userSelcet {
display: flex;
align-items: center;
justify-content: space-between;
width: 215px;
height: 32px;
line-height: 32px;
border-radius: 4px;
border: 1px solid #d0d4dc;
overflow: hidden;
cursor: pointer;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
&:hover {
border-color: $placeholderColor;
}
i {
display: flex;
position: relative;
align-items: center;
justify-content: center;
width: 30px;
height: 100%;
line-height: 32px;
font-size: 14px;
text-align: center;
color: #d0d4dc;
transform: rotateZ(180deg);
}
.el-icon-circle-close:hover {
opacity: 0.6;
}
span {
flex: 1;
padding: 0 15px;
font-size: 12px;
color: $placeholderColor;
}
}
}
</style>