婚丧嫁娶

This commit is contained in:
花有清香月有阴
2021-12-20 16:12:47 +08:00
parent 4748f2da80
commit f560481eb9
7 changed files with 1319 additions and 58 deletions

View File

@@ -0,0 +1,230 @@
<template>
<div class="add">
<div class="header-description">
<u-form :model="forms" ref="uForm" label-width="auto" :border-bottom="false">
<u-form-item label="类型" prop="type" required :border-bottom="false" right-icon="arrow-right">
<u-input v-model="forms.type" disabled placeholder="请选择类型" @click="showStstus = true" />
<u-select v-model="showStstus" :list="$dict.getDict('marriageType')" value-name="dictValue" label-name="dictName" @confirm="selectStatus"></u-select>
</u-form-item>
<div class="line"></div>
<u-form-item label="事主姓名" prop="name" required :border-bottom="false" class="names">
<u-input v-model="forms.name" placeholder="请输入事主姓名" maxlength="30" />
</u-form-item>
<u-form-item label="方式" prop="modeType" required :border-bottom="false" class="modeTypes" right-icon="arrow-right">
<u-input v-model="forms.modeType" disabled placeholder="请选择类型" @click="showModeType = true" />
<u-select v-model="showModeType" :list="$dict.getDict('modeType')" value-name="dictValue" label-name="dictName" @confirm="selectStatus"></u-select>
</u-form-item>
<u-form-item label="联系电话" prop="phone" required :border-bottom="false" class="phones">
<u-input v-model="forms.phone" placeholder="请输入联系电话" maxlength="16" />
</u-form-item>
<div class="line"></div>
<u-form-item label="地址" prop="address" required :border-bottom="false" right-icon="arrow-right">
<u-input v-model="forms.address" placeholder="请输入地址" />
</u-form-item>
<div class="line"></div>
<u-form-item label="活动详情" prop="content" required :border-bottom="false" label-position="top" class="contents">
<u-input v-model="forms.content" placeholder="请输入详细描述信息" type="textarea" auto-height height="100" maxlength="500" />
</u-form-item>
<div class="line"></div>
<u-form-item label="图片上传 (最多9张)" prop="files" :border-bottom="false" class="avatars" label-position="top">
<AiUploader :def.sync="forms.files" multiple placeholder="上传图片" :limit="9"></AiUploader>
</u-form-item>
<div class="line"></div>
</u-form>
</div>
<div class="btn" @click="submit">确认上报</div>
<AiBack></AiBack>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'Add',
components: {},
props: {},
data() {
return {
forms: {
type: '',
typeValue: '',
name: '',
modeType: '',
modeTypeValue: '',
phone: '',
address: '',
content: '',
personType: 0,
files: [],
},
showStstus: false,
showModeType: false,
flag: false,
}
},
computed: { ...mapState(['user']) },
onLoad() {
console.log(this.user.id)
this.$dict.load('marriageType', 'modeType')
},
mounted() {},
methods: {
submit() {
if (this.flag) return
this.$refs.uForm.validate((valid) => {
if (valid) {
if (!this.forms.type) {
return this.$u.toast('请选择')
}
if (!this.forms.name) {
return this.$u.toast('请输入事主姓名')
}
if (!this.forms.phone) {
return this.$u.toast('请输入联系电话')
}
if (!this.forms.address) {
return this.$u.toast('请输入地址')
}
if (!this.forms.content) {
return this.$u.toast('请输入详细描述信息')
}
const imgs = []
if (this.forms.files) {
this.forms.files.map((e) => {
imgs.push({ url: e.url, id: e.id })
})
}
this.flag = true
this.$http
.post(`/app/appvisitvondolence/addOrUpdate`, {
type: this.forms.typeValue,
name: this.forms.name,
modeType: this.forms.modeTypeValue,
phone: this.forms.phone,
address: this.forms.address,
content: this.forms.content,
createUserId: this.user.id,
personType: this.forms.personType,
fileIds: imgs || [],
})
.then((res) => {
if (res.code == 0) {
this.$u.toast('发布成功')
this.flag = false
uni.navigateTo({ url: `./AppMarryAndDie` })
}
})
} else {
this.$u.toast('失败')
}
})
},
selectStatus(e) {
if (this.showStstus == true) {
console.log(e)
this.forms.type = e[0].label
this.forms.typeValue = e[0].value
}
if (this.showModeType == true) {
console.log(e)
this.forms.modeType = e[0].label
this.forms.modeTypeValue = e[0].value
}
},
},
}
</script>
<style lang="scss" scoped>
.add {
height: 100%;
padding-bottom: 112px;
.header-description {
::v-deep .u-form {
.u-form-item {
padding: 0 45px !important;
.u-form-item__body {
.u-form-item--right__content__slot {
padding-bottom: 0;
.u-input {
text-align: right !important;
}
}
}
}
.names,
.modeTypes,
.phones {
.u-form-item__body {
border-bottom: 1px solid #dddddd;
}
}
.u-form-item:last-child {
margin-bottom: 40px;
}
.avatars,
.contents {
padding-bottom: 20px !important;
.u-form-item__body {
.u-form-item--right__content__slot {
.u-input {
text-align: left !important;
}
}
.default {
width: 160px;
height: 160px;
}
}
}
.line {
height: 24px;
background: #f3f6f9;
}
}
}
.btn {
position: fixed;
bottom: 0;
width: 100%;
height: 112px;
line-height: 112px;
background: #1365dd;
text-align: center;
font-size: 32px;
font-weight: 500;
color: #ffffff;
}
}
</style>

View File

@@ -0,0 +1,219 @@
<template>
<div class="AllActiveList">
<div class="top">
<AiCard>
<template #custom>
<div class="left">
<span class="nums"> 2 </span>
<span class="hint">全部活动</span>
</div>
<div class="right">
<span class="nums">4</span>
<span class="hint">本月新增</span>
</div>
</template>
</AiCard>
</div>
<template v-if="datas.length > 0">
<AiCard v-for="(item, i) in datas" :key="i">
<template #custom>
<div class="names">
<span>事主姓名</span>
<span class="right">{{ item.name }}</span>
</div>
<div class="phones">
<span>联系方式</span>
<span class="right">{{ item.phone }}</span>
</div>
<div class="times">
<span>上报时间</span>
<span class="right" v-if="item.createTime">{{ item.createTime.substring(0, item.createTime.length - 3) }}</span>
</div>
<div class="areaNames">
<span>上报地点</span>
<span class="right">{{ item.address }}</span>
</div>
<span class="types" :style="{ background: item.type == 0 ? '#FF65B8' : item.type == 1 ? '#FF883C' : '#1AAAFF' }">
{{ $dict.getLabel('marriageType', item.type) }}
</span>
</template>
<template #menu>
<div class="menu" @tap.stop="toDetele(item)">删除</div>
</template>
</AiCard>
</template>
<AiEmpty description="暂无数据" v-else></AiEmpty>
<u-modal v-model="deletShow" content="您确认要删除该条信息吗?" :show-cancel-button="true" :mask-close-able="true" :show-title="false" @confirm="delet"></u-modal>
</div>
</template>
<script>
export default {
name: 'AllActiveList',
components: {},
props: {},
data() {
return {
data: [],
datas: [],
current: 1,
deletShow: false,
deletId: '',
current: 1,
}
},
computed: {},
watch: {},
onLoad() {
this.$dict.load('marriageType', 'modeType').then(() => {
this.getCount()
this.getList()
})
},
onShow() {},
methods: {
getCount() {
uni.showLoading({
title: '加载数据中',
})
this.$http.post('/app/appmarriagefuneralinfo/queryDataStatistics').then((res) => {
if (res.code == 0) {
this.data = res.data
this.data.map((e, i) => {
console.log(e.v1, i)
})
uni.hideLoading()
}
})
},
getList() {
uni.showLoading({
title: '加载数据中',
})
this.$http
.post('/app/appmarriagefuneralinfo/list', null, {
params: {
size: 6,
current: this.current,
},
})
.then((res) => {
if (res.code == 0) {
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
uni.hideLoading()
}
})
},
toDetele(item) {
this.deletShow = true
this.deletId = item.id
},
delet() {
this.$http.post(`/app/appmarriagefuneralinfo/queryDetailById?ids=${this.deletId}`).then((res) => {
if (res.code == 0) {
this.$u.toast('删除成功!')
this.getList()
}
})
},
},
}
</script>
<style scoped lang="scss">
.AllActiveList {
height: 100%;
.top {
.AiCard {
background: #f3f6f9;
::v-deep .start {
background: #fff;
.fill {
display: flex;
align-items: center;
padding: 38px 0;
.left,
.right {
width: 50%;
display: flex;
flex-direction: column;
align-items: center;
.nums {
font-size: 64px;
font-weight: bold;
color: #3192f4;
}
.hint {
font-size: 28px;
font-weight: 500;
}
}
}
}
}
}
::v-deep .AiCard {
background: #f3f6f9;
.start {
display: flex;
align-items: center;
background: #fff;
padding: 32px 32px 36px 32px;
border-radius: 16px;
.names,
.phones,
.times,
.areaNames {
display: flex;
.right {
width: 76%;
margin-left: 32px;
font-size: 26px;
color: #333333;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.types {
display: inline-block;
margin-top: 32px;
border-radius: 8px;
padding: 4px 8px;
color: #fff;
}
}
.mask {
.moreMenu {
transform: translate(-175px, 20px);
.menu {
text-align: center;
line-height: 80px;
width: 192px;
height: 80px;
font-size: 28px;
font-weight: 400;
color: #333333;
}
}
}
}
}
</style>

View File

@@ -4,7 +4,7 @@
<div v-if="currentTabs == 0" class="msg">
<div class="box">
<div class="card">
<div class="card" @click="toList(0)">
<div class="imgleft">
<span class="titles">活动登记情况</span>
<span class="titlesContent">查看全部活动和本月新增</span>
@@ -13,7 +13,7 @@
<img src="./yan.jpg" alt="" />
</div>
<div class="card">
<div class="card" @click="toList(1)">
<div class="imgleft">
<span class="titles">干部参与情况</span>
<span class="titlesContent">查看全部参与操办信息和本月新增</span>
@@ -22,7 +22,7 @@
<img src="./yan.jpg" alt="" />
</div>
<div class="card">
<div class="card" @click="toList(2)">
<div class="imgleft">
<span class="titles">婚礼登记情况</span>
<span class="titlesContent">查看全部婚礼和本月新增</span>
@@ -31,7 +31,7 @@
<img src="./yan.jpg" alt="" />
</div>
<div class="card">
<div class="card" @click="toList(3)">
<div class="imgleft">
<span class="titles">丧礼登记情况</span>
<span class="titlesContent">查看全部丧礼和本月新增</span>
@@ -46,16 +46,59 @@
<div class="chart">
<p>本年统计</p>
<div class="yearStatistics" id="yearStatistic" style="height: 300px"></div>
<div class="yearStatistics" id="yearStatistic"></div>
</div>
</div>
<div v-if="currentTabs == 1" class="myReport">1</div>
<div v-if="currentTabs == 1" class="myReport">
<template v-if="datas.length > 0">
<AiCard v-for="(item, i) in datas" :key="i">
<template #custom>
<div class="names">
<span>事主姓名</span>
<span class="right">{{ item.name }}</span>
</div>
<div class="phones">
<span>联系方式</span>
<span class="right">{{ item.phone }}</span>
</div>
<div class="times">
<span>上报时间</span>
<span class="right" v-if="item.createTime">{{ item.createTime.substring(0, item.createTime.length - 3) }}</span>
</div>
<div class="areaNames">
<span>上报地点</span>
<span class="right">{{ item.address }}</span>
</div>
<span class="types" :style="{ background: item.type == 0 ? '#FF65B8' : item.type == 1 ? '#FF883C' : '#1AAAFF' }">
{{ $dict.getLabel('marriageType', item.type) }}
</span>
</template>
<template #menu>
<div class="menu" @tap.stop="toDetele(item)">删除</div>
</template>
</AiCard>
<u-loadmore :status="loadmore" color="#999" font-size="24" margin-top="32" margin-bottom="80" />
</template>
<AiEmpty description="暂无数据" v-else></AiEmpty>
<div class="fixedBtn" @click="toAdd">我要上报</div>
<u-modal v-model="deletShow" content="您确认要删除该条信息吗?" :show-cancel-button="true" :mask-close-able="true" :show-title="false" @confirm="delet"></u-modal>
</div>
</div>
</template>
<script>
import echarts from 'echarts'
import { mapState } from 'vuex'
export default {
name: 'AppMarryAndDie',
@@ -64,7 +107,6 @@ export default {
props: {},
data() {
return {
keyword: '',
currentTabs: 0,
tabList: [
{
@@ -75,24 +117,65 @@ export default {
},
],
Echart: null,
datas: [],
current: 1,
deletShow: false,
deletId: '',
}
},
computed: {},
computed: {
...mapState(['user', 'global']),
loadmore() {
return this.pages <= this.current ? 'loading ' : 'nomore'
},
},
watch: {},
onLoad() {
this.getList()
this.getEchart()
this.$dict.load('marriageType', 'modeType').then(() => {
this.getList()
this.getEchart()
})
},
mounted() {
this.Echart = echarts.init(document.getElementById('yearStatistic'))
},
methods: {
getList() {},
getList() {
this.$http
.post('/app/appmarriagefuneralinfo/list', null, {
params: {
size: 6,
current: this.current,
// createUserId: this.user.id,
},
})
.then((res) => {
if (res.code == 0) {
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
this.pages = res.data.pages
}
})
},
toDetele(item) {
this.deletShow = true
this.deletId = item.id
},
delet() {
this.$http.post(`/app/appmarriagefuneralinfo/queryDetailById?ids=${this.deletId}`).then((res) => {
if (res.code == 0) {
this.$u.toast('删除成功!')
this.getList()
}
})
},
change(index) {
this.keyword = ''
this.currentTabs = index
this.getList()
this.getEchart()
},
getEchart() {
@@ -104,72 +187,38 @@ export default {
},
initEchart(data) {
console.log(data)
var option = {
xAxis: {
type: 'category',
data: data.map((v) => v.name.replace('数量', '')),
// boundaryGap: false,
axisLine: {
lineStyle: { color: '#157EFF' },
},
axisTick: {
show: false,
alignWithLabel: false,
lineStyle: {
width: 100,
},
},
axisLabel: {
show: true, //是否显示刻度标签
interval: 0, //坐标轴刻度标签的显示间隔 0强制显示所有标签1表示『隔一个标签显示一个标签』如果值为 2表示隔两个标签显示一个标签以此类推
rotate: 50, //x轴数据太多可以尝试旋转一定角度不至于太难看
//刻度标签旋转的角度,在类目轴的类目标签显示不下的时候可以通过旋转防止标签之间重叠。旋转的角度从 -90 度到 90 度
show: true,
interval: 0,
},
axisTick: {
//坐标轴刻度相关设置
// show: true, //是否显示坐标轴刻度。
// inside: false, //坐标轴刻度是否朝内,默认朝外。
// length: 7, //坐标轴刻度的长度。
interval: 'auto',
},
axisLabel: { color: '#666', margin: 19 },
// axisTick: {
// alignWithLabel: false,
// },
// splitLine: {
// show: true,
// lineStyle: {
// width: 0,
// type: 'solid',
// color: '#f5f5f5',
// },
// },
},
yAxis: {
type: 'value',
axisLabel: {
show: true,
interval: 0, //不间隔显示x轴上的文字否则文字放不下时将会自动间隔显示
textStyle: {
// color: '#fff',
},
},
axisLine: {
//轴线颜色
lineStyle: {
color: 'rgba(255,255,255,0.2)',
color: '#666',
},
},
splitLine: {
//分割线样式
show: true,
lineStyle: {
color: '#D8DDE6',
},
},
axisLabel: {
show: true, //是否显示刻度标签
interval: 0,
},
},
series: [
{
@@ -183,6 +232,29 @@ export default {
option && this.Echart.setOption(option)
},
toAdd() {
uni.navigateTo({ url: `./Add` })
},
toList(num) {
if (num == 0) {
console.log('全部')
uni.navigateTo({ url: `./AllActiveList` })
}
if (num == 1) {
console.log('干部')
uni.navigateTo({ url: `./CadreList` })
}
if (num == 2) {
console.log('婚礼')
uni.navigateTo({ url: `./MarryList` })
}
if (num == 3) {
console.log('丧礼')
uni.navigateTo({ url: `./FuneralList` })
}
},
},
}
</script>
@@ -193,8 +265,10 @@ uni-page-body {
}
.AppMarryAndDie {
height: 100%;
background: #fff;
.msg {
height: 100%;
background: #fff;
.box {
display: flex;
justify-content: space-between;
@@ -208,6 +282,7 @@ uni-page-body {
margin-top: 8px;
padding: 18px 24px 34px;
box-sizing: border-box;
background: #f6f7f8;
.imgleft {
display: flex;
flex-direction: column;
@@ -238,12 +313,89 @@ uni-page-body {
}
.chart {
p {
padding: 26px 0 26px 32px;
font-size: 32px;
font-weight: 500;
}
.yearStatistics {
width: 100%;
// height: 500px;
// background: pink;
height: 600px;
}
}
}
.myReport {
background: #f3f6f9;
padding-bottom: 112px;
::v-deep .AiCard {
background: #f3f6f9;
.start {
display: flex;
align-items: center;
background: #fff;
padding: 32px 32px 36px 32px;
border-radius: 16px;
.names,
.phones,
.times,
.areaNames {
display: flex;
.right {
width: 76%;
margin-left: 32px;
font-size: 26px;
color: #333333;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.types {
display: inline-block;
margin-top: 32px;
border-radius: 8px;
padding: 4px 8px;
color: #fff;
}
}
.mask {
.moreMenu {
transform: translate(-175px, 20px);
.menu {
text-align: center;
line-height: 80px;
width: 192px;
height: 80px;
font-size: 28px;
font-weight: 400;
color: #333333;
}
}
}
}
.u-load-more-wrap {
background: #f3f6f9 !important;
margin: 0 !important;
padding: 30px 0;
}
.fixedBtn {
position: fixed;
width: 100%;
z-index: 999;
bottom: 0;
background: #3975c6;
padding: 32px 0;
text-align: center;
font-size: 32px;
font-weight: 500;
color: #ffffff;
}
}
}
</style>

View File

@@ -0,0 +1,220 @@
<template>
<div class="CadreList">
<div class="top">
<AiCard>
<template #custom>
<div class="left">
<span class="nums"> 2 </span>
<span class="hint">全部干部参与</span>
</div>
<div class="right">
<span class="nums">4</span>
<span class="hint">本月新增</span>
</div>
</template>
</AiCard>
</div>
<template v-if="datas.length > 0">
<AiCard v-for="(item, i) in datas" :key="i">
<template #custom>
<div class="names">
<span>事主姓名</span>
<span class="right">{{ item.name }}</span>
</div>
<div class="phones">
<span>联系方式</span>
<span class="right">{{ item.phone }}</span>
</div>
<div class="times">
<span>上报时间</span>
<span class="right" v-if="item.createTime">{{ item.createTime.substring(0, item.createTime.length - 3) }}</span>
</div>
<div class="areaNames">
<span>上报地点</span>
<span class="right">{{ item.address }}</span>
</div>
<span class="types" :style="{ background: item.type == 0 ? '#FF65B8' : item.type == 1 ? '#FF883C' : '#1AAAFF' }">
{{ $dict.getLabel('marriageType', item.type) }}
</span>
</template>
<template #menu>
<div class="menu" @tap.stop="toDetele(item)">删除</div>
</template>
</AiCard>
</template>
<AiEmpty description="暂无数据" v-else></AiEmpty>
<u-modal v-model="deletShow" content="您确认要删除该条信息吗?" :show-cancel-button="true" :mask-close-able="true" :show-title="false" @confirm="delet"></u-modal>
</div>
</template>
<script>
export default {
name: 'CadreList',
components: {},
props: {},
data() {
return {
data: [],
datas: [],
current: 1,
deletShow: false,
deletId: '',
current: 1,
}
},
computed: {},
watch: {},
onLoad() {
this.$dict.load('marriageType', 'modeType').then(() => {
this.getCount()
this.getList()
})
},
onShow() {},
methods: {
getCount() {
uni.showLoading({
title: '加载数据中',
})
this.$http.post('/app/appmarriagefuneralinfo/queryDataStatistics').then((res) => {
if (res.code == 0) {
this.data = res.data
this.data.map((e, i) => {
console.log(e.v1, i)
})
uni.hideLoading()
}
})
},
getList() {
uni.showLoading({
title: '加载数据中',
})
this.$http
.post('/app/appmarriagefuneralinfo/list', null, {
params: {
size: 6,
current: this.current,
type: 2,
},
})
.then((res) => {
if (res.code == 0) {
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
uni.hideLoading()
}
})
},
toDetele(item) {
this.deletShow = true
this.deletId = item.id
},
delet() {
this.$http.post(`/app/appmarriagefuneralinfo/queryDetailById?ids=${this.deletId}`).then((res) => {
if (res.code == 0) {
this.$u.toast('删除成功!')
this.getList()
}
})
},
},
}
</script>
<style scoped lang="scss">
.CadreList {
height: 100%;
.top {
.AiCard {
background: #f3f6f9;
::v-deep .start {
background: #fff;
.fill {
display: flex;
align-items: center;
padding: 38px 0;
.left,
.right {
width: 50%;
display: flex;
flex-direction: column;
align-items: center;
.nums {
font-size: 64px;
font-weight: bold;
color: #3192f4;
}
.hint {
font-size: 28px;
font-weight: 500;
}
}
}
}
}
}
::v-deep .AiCard {
background: #f3f6f9;
.start {
display: flex;
align-items: center;
background: #fff;
padding: 32px 32px 36px 32px;
border-radius: 16px;
.names,
.phones,
.times,
.areaNames {
display: flex;
.right {
width: 76%;
margin-left: 32px;
font-size: 26px;
color: #333333;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.types {
display: inline-block;
margin-top: 32px;
border-radius: 8px;
padding: 4px 8px;
color: #fff;
}
}
.mask {
.moreMenu {
transform: translate(-175px, 20px);
.menu {
text-align: center;
line-height: 80px;
width: 192px;
height: 80px;
font-size: 28px;
font-weight: 400;
color: #333333;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,220 @@
<template>
<div class="FuneralList">
<div class="top">
<AiCard>
<template #custom>
<div class="left">
<span class="nums"> 2 </span>
<span class="hint">全部丧礼</span>
</div>
<div class="right">
<span class="nums">4</span>
<span class="hint">本月新增</span>
</div>
</template>
</AiCard>
</div>
<template v-if="datas.length > 0">
<AiCard v-for="(item, i) in datas" :key="i">
<template #custom>
<div class="names">
<span>事主姓名</span>
<span class="right">{{ item.name }}</span>
</div>
<div class="phones">
<span>联系方式</span>
<span class="right">{{ item.phone }}</span>
</div>
<div class="times">
<span>上报时间</span>
<span class="right" v-if="item.createTime">{{ item.createTime.substring(0, item.createTime.length - 3) }}</span>
</div>
<div class="areaNames">
<span>上报地点</span>
<span class="right">{{ item.address }}</span>
</div>
<span class="types" :style="{ background: item.type == 0 ? '#FF65B8' : item.type == 1 ? '#FF883C' : '#1AAAFF' }">
{{ $dict.getLabel('marriageType', item.type) }}
</span>
</template>
<template #menu>
<div class="menu" @tap.stop="toDetele(item)">删除</div>
</template>
</AiCard>
</template>
<AiEmpty description="暂无数据" v-else></AiEmpty>
<u-modal v-model="deletShow" content="您确认要删除该条信息吗?" :show-cancel-button="true" :mask-close-able="true" :show-title="false" @confirm="delet"></u-modal>
</div>
</template>
<script>
export default {
name: 'FuneralList',
components: {},
props: {},
data() {
return {
data: [],
datas: [],
current: 1,
deletShow: false,
deletId: '',
current: 1,
}
},
computed: {},
watch: {},
onLoad() {
this.$dict.load('marriageType', 'modeType').then(() => {
this.getCount()
this.getList()
})
},
onShow() {},
methods: {
getCount() {
uni.showLoading({
title: '加载数据中',
})
this.$http.post('/app/appmarriagefuneralinfo/queryDataStatistics').then((res) => {
if (res.code == 0) {
this.data = res.data
this.data.map((e, i) => {
console.log(e.v1, i)
})
uni.hideLoading()
}
})
},
getList() {
uni.showLoading({
title: '加载数据中',
})
this.$http
.post('/app/appmarriagefuneralinfo/list', null, {
params: {
size: 6,
current: this.current,
type: 1,
},
})
.then((res) => {
if (res.code == 0) {
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
uni.hideLoading()
}
})
},
toDetele(item) {
this.deletShow = true
this.deletId = item.id
},
delet() {
this.$http.post(`/app/appmarriagefuneralinfo/queryDetailById?ids=${this.deletId}`).then((res) => {
if (res.code == 0) {
this.$u.toast('删除成功!')
this.getList()
}
})
},
},
}
</script>
<style scoped lang="scss">
.FuneralList {
height: 100%;
.top {
.AiCard {
background: #f3f6f9;
::v-deep .start {
background: #fff;
.fill {
display: flex;
align-items: center;
padding: 38px 0;
.left,
.right {
width: 50%;
display: flex;
flex-direction: column;
align-items: center;
.nums {
font-size: 64px;
font-weight: bold;
color: #3192f4;
}
.hint {
font-size: 28px;
font-weight: 500;
}
}
}
}
}
}
::v-deep .AiCard {
background: #f3f6f9;
.start {
display: flex;
align-items: center;
background: #fff;
padding: 32px 32px 36px 32px;
border-radius: 16px;
.names,
.phones,
.times,
.areaNames {
display: flex;
.right {
width: 76%;
margin-left: 32px;
font-size: 26px;
color: #333333;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.types {
display: inline-block;
margin-top: 32px;
border-radius: 8px;
padding: 4px 8px;
color: #fff;
}
}
.mask {
.moreMenu {
transform: translate(-175px, 20px);
.menu {
text-align: center;
line-height: 80px;
width: 192px;
height: 80px;
font-size: 28px;
font-weight: 400;
color: #333333;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,220 @@
<template>
<div class="MarryList">
<div class="top">
<AiCard>
<template #custom>
<div class="left">
<span class="nums"> 2 </span>
<span class="hint">全部婚礼</span>
</div>
<div class="right">
<span class="nums">4</span>
<span class="hint">本月新增</span>
</div>
</template>
</AiCard>
</div>
<template v-if="datas.length > 0">
<AiCard v-for="(item, i) in datas" :key="i">
<template #custom>
<div class="names">
<span>事主姓名</span>
<span class="right">{{ item.name }}</span>
</div>
<div class="phones">
<span>联系方式</span>
<span class="right">{{ item.phone }}</span>
</div>
<div class="times">
<span>上报时间</span>
<span class="right" v-if="item.createTime">{{ item.createTime.substring(0, item.createTime.length - 3) }}</span>
</div>
<div class="areaNames">
<span>上报地点</span>
<span class="right">{{ item.address }}</span>
</div>
<span class="types" :style="{ background: item.type == 0 ? '#FF65B8' : item.type == 1 ? '#FF883C' : '#1AAAFF' }">
{{ $dict.getLabel('marriageType', item.type) }}
</span>
</template>
<template #menu>
<div class="menu" @tap.stop="toDetele(item)">删除</div>
</template>
</AiCard>
</template>
<AiEmpty description="暂无数据" v-else></AiEmpty>
<u-modal v-model="deletShow" content="您确认要删除该条信息吗?" :show-cancel-button="true" :mask-close-able="true" :show-title="false" @confirm="delet"></u-modal>
</div>
</template>
<script>
export default {
name: 'MarryList',
components: {},
props: {},
data() {
return {
data: [],
datas: [],
current: 1,
deletShow: false,
deletId: '',
current: 1,
}
},
computed: {},
watch: {},
onLoad() {
this.$dict.load('marriageType', 'modeType').then(() => {
this.getCount()
this.getList()
})
},
onShow() {},
methods: {
getCount() {
uni.showLoading({
title: '加载数据中',
})
this.$http.post('/app/appmarriagefuneralinfo/queryDataStatistics').then((res) => {
if (res.code == 0) {
this.data = res.data
this.data.map((e, i) => {
console.log(e.v1, i)
})
uni.hideLoading()
}
})
},
getList() {
uni.showLoading({
title: '加载数据中',
})
this.$http
.post('/app/appmarriagefuneralinfo/list', null, {
params: {
size: 6,
current: this.current,
type: 0,
},
})
.then((res) => {
if (res.code == 0) {
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
uni.hideLoading()
}
})
},
toDetele(item) {
this.deletShow = true
this.deletId = item.id
},
delet() {
this.$http.post(`/app/appmarriagefuneralinfo/queryDetailById?ids=${this.deletId}`).then((res) => {
if (res.code == 0) {
this.$u.toast('删除成功!')
this.getList()
}
})
},
},
}
</script>
<style scoped lang="scss">
.MarryList {
height: 100%;
.top {
.AiCard {
background: #f3f6f9;
::v-deep .start {
background: #fff;
.fill {
display: flex;
align-items: center;
padding: 38px 0;
.left,
.right {
width: 50%;
display: flex;
flex-direction: column;
align-items: center;
.nums {
font-size: 64px;
font-weight: bold;
color: #3192f4;
}
.hint {
font-size: 28px;
font-weight: 500;
}
}
}
}
}
}
::v-deep .AiCard {
background: #f3f6f9;
.start {
display: flex;
align-items: center;
background: #fff;
padding: 32px 32px 36px 32px;
border-radius: 16px;
.names,
.phones,
.times,
.areaNames {
display: flex;
.right {
width: 76%;
margin-left: 32px;
font-size: 26px;
color: #333333;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.types {
display: inline-block;
margin-top: 32px;
border-radius: 8px;
padding: 4px 8px;
color: #fff;
}
}
.mask {
.moreMenu {
transform: translate(-175px, 20px);
.menu {
text-align: center;
line-height: 80px;
width: 192px;
height: 80px;
font-size: 28px;
font-weight: 400;
color: #333333;
}
}
}
}
}
</style>