feat: 门店档案

This commit is contained in:
wanglei
2024-06-23 17:30:00 +08:00
parent ea0ec60401
commit a293259fb9
5 changed files with 778 additions and 1 deletions

View File

@@ -1,2 +1,3 @@
VUE_APP_SCOPE=fengdu
VUE_APP_API=https://web.fdfengshou.cn/
#VUE_APP_API=https://web.fdfengshou.cn/
VUE_APP_API=http://192.168.1.87:9000/

View File

@@ -0,0 +1,66 @@
<template>
<div class="app-archives">
<keep-alive :include="['List']">
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
</keep-alive>
</div>
</template>
<script>
import List from "./components/List.vue";
import Detail from "./components/Detail.vue";
import Add from "./components/Add.vue";
export default {
name: 'AppArchives',
label: '门店档案',
props: {
instance: Function,
dict: Object
},
components: {
List,
Detail,
Add
},
data() {
return {
component: 'List',
params: {},
include: []
}
},
methods: {
onChange (data) {
if (data.type === 'Add') {
this.component = 'Add'
this.params = data.params
}
if (data.type === 'Detail') {
this.component = 'Detail'
this.params = data.params
}
if (data.type === 'List') {
this.component = 'List'
this.params = data.params
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList()
}
})
}
}
}
}
</script>
<style lang="scss" scoped>
.app-archives{
height: 100%;
background: #F3F6F9;
overflow: auto;
}
</style>

View File

@@ -0,0 +1,175 @@
<template>
<ai-detail class="add">
<template slot="title">
<ai-title title="添加档案" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title>
</template>
<template slot="content">
<el-form class="content-right" :model="form" ref="ruleForm" :rules="rules" label-width="130px"
label-position="right" size="small">
<ai-card title="基本信息">
<template #content>
<el-row type="flex">
<el-form-item label="经营者姓名:" style="width: 100%;" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" autocomplete="off"
size="small" maxlength="20"
show-word-limit></el-input>
</el-form-item>
<el-form-item label="身份证号:" style="width: 100%;" prop="idcard">
<el-input v-model="form.name" placeholder="请输入身份证号" autocomplete="off"
size="small" maxlength="18"
show-word-limit></el-input>
</el-form-item>
</el-row>
<el-row type="flex">
<el-form-item label="性别:" style="width: 100%;" prop="name">
<el-select placeholder="性别" size="small" style="width: 100%;"></el-select>
</el-form-item>
<el-form-item label="联系电话:" style="width: 100%;" prop="idcard">
<el-input v-model="form.name" placeholder="请输入联系电话" autocomplete="off"
size="small" maxlength="18"
show-word-limit></el-input>
</el-form-item>
</el-row>
<el-row type="flex">
<el-form-item label="出生日期:" style="width: 100%;" prop="name">
<el-date-picker value-format="yyyy-MM-dd" size="small" placeholder="请选择出生日期" disabled style="width: 100%"></el-date-picker>
</el-form-item>
<el-form-item label="年龄:" style="width: 100%;" prop="idcard">
<el-input v-model="form.name" placeholder="请输入年龄" disabled autocomplete="off" size="small"></el-input>
</el-form-item>
</el-row>
</template>
</ai-card>
<ai-card title="门店信息">
<template #content>
<el-row type="flex">
<div class="flex-colum">
<el-form-item label="门店名称:" style="width: 100%;" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" autocomplete="off"
size="small" maxlength="20"
show-word-limit></el-input>
</el-form-item>
<el-form-item label="经营类型:" style="width: 100%;" prop="name">
<el-select placeholder="请选择经营范围" size="small" style="width: 100%;"></el-select>
</el-form-item>
<el-form-item label="所属片区:" style="width: 100%;" prop="name">
<el-select placeholder="请选择所属片区" size="small" style="width: 100%;"></el-select>
</el-form-item>
</div>
<el-form-item label="" style="width: 100%;" prop="idcard">
<ai-uploader
:instance="instance"
isShowTip
v-model="form.thumbUrl"
:limit="1"
:cropOps="cropOps"
is-crop>
<template slot="tips">
<p>最多上传1张图片,单个文件最大10MB支持jpgjpegpng格式</p>
<p>图片比例1.61</p>
</template>
</ai-uploader>
</el-form-item>
</el-row>
<el-form-item label="社会信用代码:" style="width: 100%;" prop="name">
<el-input v-model="form.code" placeholder="请输入社会统一信用代码" size="small"></el-input>
</el-form-item>
<el-form-item label="门店住址:" style="width: 100%;" prop="name">
<ai-area-select :instance="instance" clearable v-model="form.areaId" always-show @name="v=>form.areaName=v"/>
</el-form-item>
<el-form-item label="" style="width:100%">
<el-input
size="small"
placeholder="请输入详细地址"
clearable
v-model="form.householdAddress"
maxlength="50"
show-word-limit
></el-input>
</el-form-item>
<el-form-item label="门店描述:" style="width: 100%">
<el-input v-model="form.desc" placeholder="请输入门店描述" type="textarea" :rows="3"></el-input>
</el-form-item>
</template>
</ai-card>
</el-form>
</template>
<template #footer>
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="handleSave">保存</el-button>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Add',
props: {
instance: Function,
dict: Object,
params: Object
},
data() {
return {
form: {},
rules: {}
}
},
methods: {
handleSave(){
},
cancel() {
this.$emit('change', {
type: 'List',
isRefresh: true
})
}
}
}
</script>
<style scoped lang="scss">
.add {
.flex-colum{
width: 100%;
display: flex;
flex-direction: column;
}
.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,198 @@
<template>
<ai-detail class="detail">
<template slot="title">
<ai-title title="档案详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></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-wrapper>
</template>
</ai-card>
<ai-card title="门店信息">
<template #content>
<ai-wrapper>
<ai-info-item label="门店名称" isLine :value="info.applyIntegral"></ai-info-item>
<ai-info-item label="门店照片" isLine v-if="info.images && info.images.length">
<div class="files">
<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 :value="info.applyIntegral"></ai-info-item>
<ai-info-item label="所属片区" isLine :value="info.applyIntegral"></ai-info-item>
<ai-info-item label="社会信用代码" isLine :value="info.applyIntegral"></ai-info-item>
<ai-info-item label="门店住址" isLine :value="info.applyIntegral"></ai-info-item>
<ai-info-item label="门店描述" isLine :value="info.applyIntegral"></ai-info-item>
</ai-wrapper>
</template>
</ai-card>
</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,337 @@
<template>
<ai-list class="app-archives_list">
<template slot="title">
<ai-title title="门店档案" isShowBottomBorder>
</ai-title>
</template>
<template slot="content">
<ai-search-bar class="search-bar">
<template #left>
<el-input placeholder="请输入门店名称" size="small" clearable></el-input>
<ai-select
v-model="search.applyItemId"
@change="(search.current = 1), getList()"
placeholder="是否户主"
:selectList="dictList">
</ai-select>
<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-select
v-model="search.status"
@change="(search.current = 1), getList()"
placeholder="经营类型"
:selectList="$dict.getDict('appIntegralApplyEventStatus')">
</ai-select>
<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-search-bar class="search-bar">
<template #left>
<el-button type="primary" icon="iconfont iconAdd" @click="handleAdd">添加</el-button>
<el-button icon="iconfont iconDelete">删除</el-button>
</template>
<template #right>
<ai-import :instance="instance" :dict="dict" type="appintegraluser" name="门店档案"
@success="getList()">
<el-button icon="iconfont iconImport">导入</el-button>
</ai-import>
<ai-download :instance="instance" url="/app/appintegraluser/girdIntegralExport" :params="search" fileName="门店档案"
:disabled="tableData.length == 0">
</ai-download>
</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
label="门店照片"
slot="pic"
align="left">
<template v-slot="{ row }">
<img :src="row.picUrl" alt="" v-viewer>
</template>
</el-table-column>
<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)">查看</el-button>
<el-button type="text" @click="handleEdit(row)">修改</el-button>
<el-button type="text" @click="handleDelete(row)">删除</el-button>
<el-button type="text" >生成二维码</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: [
{type: "selection"},
{ slot: 'pic', align: 'center' },
{ 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'},
{ prop: 'auditUserName', label: '经营类型', align: 'center' },
{ prop: 'pushStatus', label: '门店评分', align: 'center'}
],
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: {
handleAdd(){
this.$emit('change', {
type: 'Add',
params: {}
})
},
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 || ''
}
})
},
handleEdit({id}){
this.$emit('change', {
type: 'Add',
params: {
id: id || ''
}
})
},
handleDelete({id}){
this.$confirm('确定删除该数据?').then(() => {
console.log(id)
})
},
toAdd(id) {
this.$emit('change', {
type: 'Add',
params: {
id: id || ''
}
})
}
}
}
</script>
<style lang="scss" scoped>
.app-archives_list {
.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>