This commit is contained in:
yanran200730
2022-03-22 17:31:11 +08:00
11 changed files with 899 additions and 1332 deletions

View File

@@ -0,0 +1,36 @@
<template>
<section class="AppVideoPublic">
<component :is="currentComponent" :instance="instance" :dict="dict" :permissions="permissions"/>
</section>
</template>
<script>
import ProductList from "./vpList";
import ProductAdd from "./vpAdd";
export default {
name: "AppVideoPublic",
components: {ProductAdd, ProductList},
label: "视频宣传",
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
currentComponent() {
return this.$route.hash == "#add" ? ProductAdd : ProductList
}
},
created() {
this.dict.load("videoNewsStatus")
}
}
</script>
<style lang="scss" scoped>
.AppVideoPublic {
height: 100%;
}
</style>

View File

@@ -0,0 +1,209 @@
<template>
<section class="vpAdd">
<ai-detail>
<ai-title slot="title" :title="addTitle" isShowBottomBorder isShowBack @onBackClick="back"/>
<template #content>
<el-form size="small" label-width="120px" :model="form" ref="VideoForm" :rules="rules">
<ai-card title="基本信息">
<template #content>
<el-form-item label="标题" prop="title">
<el-input v-model="form.title" placeholder="请输入" clearable show-word-limit maxlength="30"/>
</el-form-item>
<el-form-item label="视频" prop="videoUrl">
<video v-if="hasVideo" class="video-com" muted :src="form.videoUrl" controls="controls"/>
<el-upload :show-file-list="false" ref="upload1" action :http-request="submitUpload"
:accept="accept" :limit="1">
<div class="video" v-if="!hasVideo">
<div class="icon">
<ai-icon type="svg" icon="iconVideo"/>
<span>上传视频</span>
</div>
<span class="tips">支持mp4格式单个文件最大100MB</span>
</div>
<el-button v-else style="margin-top: 10px;">重新选择</el-button>
</el-upload>
</el-form-item>
<el-form-item label="视频封面" prop="thumbUrl">
<ai-uploader :instance="instance" :value="thumb" @change="handleUploader" key="file" :limit="1">
<template slot="tips">
<p>最多上传1张图片,单个文件最大10MB支持jpgjpegpng格式</p>
</template>
</ai-uploader>
</el-form-item>
</template>
</ai-card>
</el-form>
</template>
<template #footer>
<el-button @click="back">取消</el-button>
<el-button type="primary" @click="submit">保存</el-button>
</template>
</ai-detail>
</section>
</template>
<script>
import mp4box from "mp4box";
export default {
name: "vpAdd",
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
addTitle() {
return !!this.$route.query.id ? "编辑视频" : "添加视频"
},
rules() {
return {
title: [{required: true, message: "请输入标题"}],
thumbUrl: [{required: true, message: "请上传视频封面"}],
videoUrl: [{required: true, message: "请上传视频封面"}],
}
},
hasVideo() {
return !!this.form.videoUrl
},
thumb(){
return this.form.thumbUrl?[{url:this.form.thumbUrl}]:[]
}
},
data() {
return {
dialog: false,
form: {videoUrl: ""},
accept: ".mp4"
}
},
methods: {
getDetail() {
let {id} = this.$route.query
id && this.instance.post("/appvideonews/getById", null, {
params: {id}
}).then(res => {
if (res?.data) {
this.form = res.data
}
})
},
submit() {
this.$refs.VideoForm.validate(v => {
if (v) {
let {form} = this
this.instance.post("/appvideonews/addOrUpdate", form).then(res => {
if (res?.code == 0) {
this.$message.success("提交成功!")
this.back()
}
})
}
})
},
back() {
this.$router.push({})
},
submitUpload(file) {
this.$refs.upload1?.clearFiles();
this.$refs.VideoForm?.clearValidate('videoFile');
const fileType = file.file.name.split(".")[1];
const size = file.file.size / 1024 / 1024 > 100;
let mp4boxfile = mp4box.createFile();
const reader = new FileReader();
reader.readAsArrayBuffer(file.file);
reader.onload = (e) => {
const arrayBuffer = e.target.result;
arrayBuffer.fileStart = 0;
mp4boxfile.appendBuffer(arrayBuffer);
};
mp4boxfile.onReady = (info) => {
let codec = info.mime.match(/codecs="(\S*),/)[1]
if (codec.indexOf('avc') === -1) {
return this.$message.error("视频编码格式不支持")
}
if (size) {
return this.$message.error("视频大小不能超过100M");
}
if (fileType && this.accept.indexOf(fileType.toLocaleLowerCase()) > -1) {
let formData = new FormData()
formData.append('file', file.file);
this.instance.post(`/admin/file/add-unlimited`, formData).then(res => {
if (res && res.data) {
let videoList = res.data[0].split(";");
this.form.videoUrl = videoList[0]
}
})
} else {
return this.$message.error("视频格式错误")
}
}
},
handleUploader(list) {
this.form.thumbUrl = list?.[0]?.url
this.$refs.VideoForm.validateField("thumbUrl")
}
},
created() {
this.getDetail()
}
}
</script>
<style lang="scss" scoped>
.vpAdd {
height: 100%;
video {
width: 100%;
height: 100%;
object-fit: fill;
}
::v-deep input[type="number"] {
line-height: 1px !important;
&::-webkit-outer-spin-button, &::-webkit-inner-spin-button {
-webkit-appearance: none !important;
}
}
.video {
width: 640px;
height: 360px;
border-radius: 4px;
border: 1px dashed #D0D4DC;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.icon {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
span:nth-child(2) {
display: inline-block;
font-size: 16px;
color: #333333;
line-height: 30px;
}
.iconfont {
display: inline-block;
font-size: 40px;
color: #2266FF;
}
}
.tips {
display: inline-block;
font-size: 12px;
color: #999999;
line-height: 26px;
}
}
}
</style>

View File

@@ -0,0 +1,128 @@
<template>
<section class="vpList">
<ai-list>
<ai-title slot="title" title="视频宣传" isShowBottomBorder/>
<template #content>
<ai-search-bar>
<template #left>
<el-button type="primary" icon="iconfont iconAdd" @click="handleEdit()">添加</el-button>
</template>
<template #right>
<el-input size="small" placeholder="搜索标题" v-model="search.productName" clearable
@change="page.current=1,getTableData()"/>
</template>
</ai-search-bar>
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size"
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
<el-table-column slot="options" label="操作" fixed="right" align="center" width="200px">
<template slot-scope="{row}">
<el-button v-if="row.status==0" type="text" @click="handlePublic(row)">发布</el-button>
<el-button v-else-if="row.status==1" type="text" @click="handlePublic(row)">取消发布</el-button>
<el-button type="text" @click="handleEdit(row.id)">编辑</el-button>
<el-button type="text" @click="handleDelete(row.id)">删除</el-button>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
</section>
</template>
<script>
import {mapState} from "vuex";
export default {
name: "vpList",
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
...mapState(['user']),
isFinanceUser() {
return !!this.user.financeUser?.id
}
},
data() {
return {
search: {productName: ""},
page: {current: 1, size: 10, total: 0},
tableData: [],
colConfigs: [
{label: "标题", prop: "title"},
{label: "浏览数量", prop: "viewCount", align: "center", width: 100},
{label: "发布人", prop: "publishUserName", width: 120},
{label: "发布时间", prop: "publishTime"},
{label: "状态", prop: "status", dict: "videoNewsStatus", align: "center"},
{slot: "options"}
]
}
},
methods: {
getTableData() {
this.instance.post("/appvideonews/list", null, {
params: {...this.page, ...this.search}
}).then(res => {
if (res?.data) {
this.tableData = res.data?.records
this.page.total = res.data.total
}
})
},
showDetail(id) {
this.$router.push({query: {id}})
},
handleEdit(id) {
this.$router.push({query: {id}, hash: "#add"})
},
handleDelete(ids) {
this.$confirm("是否要删除该视频?").then(() => {
this.instance.post("/appvideonews/delete", null, {
params: {ids}
}).then(res => {
if (res?.code == 0) {
this.$message.success("删除成功!")
this.getTableData()
}
})
}).catch(() => 0)
},
handleIsHot(row) {
let {id, isHot} = row
this.instance.post("appfinancialproduct/setIsHot", null, {
params: {id, isHot}
}).then(res => {
if (res?.code == 0) {
this.$message.success("修改成功!")
this.getTableData()
} else {
}
})
},
handlePublic(row) {
let openLabel = row.status == 1 ? "取消发布" : "发布", status = (Number(row.status) + 1) % 2
this.$confirm(`是否要${openLabel}视频?`).then(() => {
this.instance.post("/appvideonews/setStatus", null, {
params: {id: row.id, status}
}).then(res => {
if (res?.code == 0) {
this.$message.success(openLabel + "成功!")
this.getTableData()
}
})
}).catch(() => 0)
},
},
created() {
this.getTableData()
}
}
</script>
<style lang="scss" scoped>
.vpList {
height: 100%;
}
</style>

View File

@@ -1,573 +0,0 @@
<template>
<section class="scoreFamily">
<ai-list v-show="!detailShow">
<template slot="title">
<ai-title title="家庭积分" :isShowBottomBorder="true" :instance="instance" :isShowArea="true" @change="getList()" v-model="areaId"></ai-title>
</template>
<template slot="content">
<ai-search-bar bottomBorder>
<template slot="left">
<el-select size="small" v-model="searchObj.isPositive" placeholder="积分是否大于0" clearable @change="page.current = 1,getList()">
<el-option
v-for="(item,i) in isPositiveList"
:key="i"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</template>
<template slot="right">
<el-input
v-model="searchObj.con"
size="small"
placeholder="户主姓名"
v-throttle="() => {page.current = 1, getList()}"
@clear="search.current = 1, search.con = '', getList()"
clearable
suffix-icon="iconfont iconSearch" />
</template>
</ai-search-bar>
<ai-search-bar class="mt10">
<template slot="left">
<ai-download :instance="instance" type="primary" url="/app/appvillagerintegraldetail/listExport" :params="params" fileName="家庭积分"></ai-download>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="page.total"
ref="aitableex"
:current.sync="page.current"
:size.sync="page.size"
@getList="getList">
<el-table-column label="操作" slot="options" fixed="right" align="center" width="180">
<template v-slot="{row}">
<div class="table-options">
<!-- <el-button type="text" title="编辑" @click="edit(row)" :disabled="!$permissions('app_appvillagerintegralfamily_edit')">编辑</el-button> -->
<el-button type="text" title="家庭成员" @click="familyMember(row)" :disabled="!$permissions('app_appvillagerintegralfamilymember_edit')">家庭成员</el-button>
<el-button type="text" :disabled="!$permissions('app_appvillagerintegralfamily_detail')" title="详情" @click="goDetail(row)">详情</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
<detail v-if="detailShow" @goBack="goBack" :detailInfo='detailInfo' :instance='instance' :dict='dict'></detail>
<ai-dialog
:title="dialog.title"
:visible.sync="dialog.visible"
:customFooter="true"
:destroyOnClose="true"
@close="init('ruleForm')"
width="520px">
<div class="form_div">
<el-form ref="ruleForm" :model="dialogInfo" :rules="formRules" size="small" label-suffix=""
label-width="120px">
<el-form-item label="类型" prop="personType">
<el-radio-group v-model="dialogInfo.personType" @change="typeChange"
:disabled="dialog.title.indexOf('修改')!=-1">
<el-radio label="0">户籍居民</el-radio>
<el-radio label="1">外来人员</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="dialog.title.indexOf('家庭')!=-1?'户主':'姓名'" prop="name">
<el-row type="flex" :gutter="8">
<el-col>
<el-input v-model="dialogInfo.name" disabled clearable/>
</el-col>
<el-col>
<ai-person-select :instance="instance" :key="personUrl" :url="personUrl" @selectPerson="getSelect"
v-if="dialog.title.indexOf('添加')!=-1"></ai-person-select>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="身份证号" prop="idNumber">
<el-input v-model="dialogInfo.idNumber" disabled clearable/>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input type="number" v-model="dialogInfo.phone" maxlength="11" clearable/>
</el-form-item>
<el-form-item label="所属组" prop="villageGroup" v-if="dialog.title.indexOf('家庭')!=-1">
<el-select v-model="dialogInfo.villageGroup" placeholder="请选择...">
<el-option
v-for="(item,i) in dict.getDict('integralVillageGroup')"
:key="i"
:label="item.dictName"
:value="item.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status" v-if="dialog.title.indexOf('家庭')!=-1">
<el-select v-model="dialogInfo.status" placeholder="请选择...">
<el-option
v-for="(item,i) in dict.getDict('integralRuleStatus')"
:key="i"
:label="item.dictName"
:value="item.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="与户主关系" prop="householdRelation" v-if="dialog.title.indexOf('成员')!=-1">
<el-select
v-model="dialogInfo.householdRelation"
placeholder="请选择"
size="mini"
clearable
style="width:216px;"
>
<el-option
v-for="(item,i) in dict.getDict('householdRelation')"
:label="item.dictName"
:key="i"
:value="item.dictValue"
></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<div class="dialog-footer" slot="footer">
<el-button @click="dialog.visible=false" size="medium">取消</el-button>
<el-button @click="onConfirm('ruleForm')" type="primary" size="medium">确认</el-button>
</div>
</ai-dialog>
<ai-dialog class="family-list"
title="成员列表"
:visible.sync="addMemberVisible"
:customFooter="true"
:destroyOnClose="true"
width="780px">
<!-- <p class="add_btn">
<span class="iconfont iconAdd" @click="addFamily()"></span>
<span @click="addFamily()">添加家庭成员</span>
</p> -->
<ai-table
:tableData="familyList"
:col-configs="familycolConfigs"
:total="familyPage.total"
:current.sync="familyPage.current"
:size.sync="familyPage.size"
:isShowPagination="false"
@getList="familyMember(rowInfo)">
<el-table-column label="与户主关系" slot="householdRelation" align="center" width="120">
<template v-slot="{row}">
<span v-if="row.householdName == 1">户主</span>
<span v-else>{{dict.getLabel('householdRelation', row.householdRelation)}}</span>
</template>
</el-table-column>
<el-table-column label="类型" slot="personType" align="center" width="120">
<template v-slot="{row}">户籍居民</template>
</el-table-column>
<el-table-column label="身份证号" slot="idNumber" align="center" width="165">
<template v-slot="{row}">
<ai-id mode="show" :show-eyes="false" :value="row.idNumber"/>
</template>
</el-table-column>
<!-- <el-table-column label="操作" slot="options" align="center">
<template v-slot="{row}">
<el-button type="text"
v-if="row.householdRelation!=11&&$permissions('app_appvillagerintegralfamilymember_edit')"
icon="iconfont iconEdit" title="编辑" @click="editFamily(row)"/>
<el-button type="text"
v-if="row.householdRelation!=11&&$permissions('app_appvillagerintegralfamilymember_del')"
icon="iconfont iconDelete" title="删除" @click="deleteFamily(row.id)"/>
</template>
</el-table-column> -->
</ai-table>
<div class="dialog-footer" slot="footer">
<el-button @click="addMemberVisible=false" size="medium"> </el-button>
</div>
</ai-dialog>
</section>
</template>
<script>
import {mapState} from 'vuex';
import detail from './detail'
export default {
name: 'AppScoreFamily',
label: "家庭积分",
props: {
instance: Function,
dict: Object,
permissions: Function
},
components: {detail},
data() {
return {
areaId: '',
searchObj: {
personType: '',
villageGroup: '',
status: '',
con: '',
isPositive: '',
},
isPositiveList: [{
dictName: '是',
dictValue: '1'
}, {
dictName: '否',
dictValue: '0'
}],
page: {
current: 1,
size: 10,
total: 0
},
familyPage: {
current: 1,
size: 100,
total: 0
},
exportParams: {},
tableData: [],
dialog: {
title: '添加家庭',
visible: false
},
dialogInfo: {
personType: '0',
name: '',
idNumber: '',
phone: '',
villageGroup: '',
status: '',
areaId: '',
householdRelation: '',
avatar: ''
},
addMemberVisible: false,
detailShow: false,
personUrl: '',
familyList: [],
familyId: '',
detailInfo: {},
rowInfo: {}
}
},
computed: {
...mapState(['user']),
params () {
return {
...this.searchObj,
areaId: this.areaId,
exportType: 0
}
},
colConfigs() {
return [
{
prop: 'name',
label: '户主',
},
{
prop: 'phone',
align: 'center',
label: '联系电话',
},
{
prop: 'householdAreaName',
align: 'center',
label: '所在村',
},
{
prop: 'familyIntegral',
align: 'center',
label: '家庭积分',
},
{
prop: 'familyUsedIntegral',
align: 'center',
label: '已用积分',
},
{
prop: 'familySurplusIntegral',
align: 'center',
label: '剩余积分',
},
{
prop: 'familyNum',
align: 'center',
label: '成员数',
},
]
},
familycolConfigs() {
return [
// {
// prop: 'householdRelation',
// align: 'center',
// label: '与户主关系',
// render(h, {row}) {
// return h('span', {}, _.$dict.getLabel('householdRelation', row.householdRelation))
// }
// },
{
slot: 'householdRelation',
},
{
prop: 'residentType',
align: 'center',
label: '类型',
formart: v => this.dict.getLabel('residentType', v)
},
{
prop: 'name',
align: 'center',
label: '姓名',
},
{
prop: 'idNumber',
align: 'center',
slot: 'idNumber',
label: '身份证号',
width: 165,
},
{
prop: 'phone',
align: 'center',
label: '联系电话',
width: 120,
}
]
},
formRules() {
let IdNumberPass = (rule, value, callback) => {
if (value) {
console.log(this.idCardNoUtil);
if (this.idCardNoUtil.checkIdCardNo(value)) {
callback();
} else {
callback(new Error("身份证号格式错误"));
}
} else {
callback(new Error("请输入身份证号"));
}
};
if (this.dialog.title.indexOf('家庭') != -1) {
return {
personType: [{required: true, message: "请选择类型", trigger: 'change'}],
name: [{required: true, message: "请填写户主", trigger: 'change'}],
idNumber: [{required: true, validator: IdNumberPass, trigger: 'change'}],
phone: [{required: true, message: "请填写联系电话", trigger: 'blur'}],
villageGroup: [{required: true, message: "请选择所属组", trigger: 'change'}],
status: [{required: true, message: "请选择状态", trigger: 'change'}],
householdRelation: [{required: true, message: "请选择与户主关系", trigger: 'change'}]
}
} else {
return {
personType: [{required: true, message: "请选择类型", trigger: 'change'}],
name: [{required: true, message: "请填写户主", trigger: 'change'}],
idNumber: [{required: true, validator: IdNumberPass, trigger: 'change'}],
villageGroup: [{required: true, message: "请选择所属组", trigger: 'change'}],
status: [{required: true, message: "请选择状态", trigger: 'change'}],
householdRelation: [{required: true, message: "请选择与户主关系", trigger: 'change'}]
}
}
}
},
created() {
this.areaId = this.user.info.areaId;
this.dict.load('integralVillageGroup', 'integralRuleStatus', 'integralPersonType', 'householdRelation', 'residentType');
this.getList();
},
methods: {
getList() {
this.instance.post("/app/appresident/familyIntegral", null, {
params: {
...this.searchObj,
...this.page,
areaId: this.areaId
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.page.total = res.data.total
}
})
},
typeChange(val) {
val == '0' ? this.personUrl = '/app/appresident/list?fileStatus=0' : this.personUrl = '/app/apprecurrentpopulation/list?fileStatus=0';
this.dialogInfo.name = "";
this.dialogInfo.idNumber = "";
this.dialogInfo.phone = "";
this.dialogInfo.avatar = "";
this.dialogInfo.areaId = "";
},
add() {
this.dialog.visible = true;
this.dialog.title = '添加家庭';
},
addFamily() {
this.dialog.visible = true;
this.dialog.title = '添加成员';
},
onConfirm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.dialog.title.indexOf('家庭') != -1) {
this.instance.post("/app/appvillagerintegralfamily/addOrUpdate", {
...this.dialogInfo,
}, null).then(res => {
if (res.code == 0) {
this.dialog.visible = false;
if (this.dialog.title.indexOf('添加') != -1) {
this.$message.success("添加成功")
} else {
this.$message.success("修改成功")
}
this.getList();
}
})
} else {
this.instance.post("/app/appvillagerintegralfamilymember/addOrUpdate", {
...this.dialogInfo,
familyId: this.familyId,
familyIdNumber: this.rowInfo.idNumber,
familyName: this.rowInfo.name
}, null).then(res => {
if (res.code == 0) {
this.dialog.visible = false;
if (this.dialog.title.indexOf('添加') != -1) {
this.$message.success("添加成功")
} else {
this.$message.success("修改成功")
}
this.familyMember(this.rowInfo);
this.getList();
}
})
}
} else {
return false;
}
});
},
init(formName) {
this.$refs[formName].clearValidate();
Object.keys(this.dialogInfo).forEach(e => {
this.dialogInfo[e] = ''
})
this.dialogInfo.personType = '0';
this.personUrl = '';
},
reset() {
Object.keys(this.searchObj).forEach(e => {
this.searchObj[e] = ''
});
this.getList();
},
edit(row) {
this.dialog.visible = true;
this.dialog.title = '修改家庭';
this.dialogInfo = {...row}
},
editFamily(row) {
this.dialog.visible = true;
this.dialog.title = '修改成员';
this.dialogInfo = {...row}
},
deleteFamily(ids) {
ids && this.$confirm("是否要删除该家庭成员", {
type: 'error'
}).then(() => {
this.instance.post("/app/appvillagerintegralfamilymember/delete", null, {
params: {ids}
}).then(res => {
if (res?.code == 0) {
this.$message.success("删除成功!")
this.familyMember(this.rowInfo);
}
})
}).catch(() => {
})
},
getSelect(val) {
console.log(val)
if (val) {
this.dialogInfo.name = val.name;
this.dialogInfo.idNumber = val.idNumber;
this.dialogInfo.avatar = val.photo;
if (this.dialogInfo.personType == 0) {
this.dialogInfo.areaId = val.householdAreaId;
} else {
this.dialogInfo.areaId = val.currentAreaId;
}
} else {
this.dialogInfo.name = '';
this.dialogInfo.idNumber = '';
this.dialogInfo.phone = '';
this.dialogInfo.areaId = '';
this.dialogInfo.avatar = '';
this.$refs['rules'].clearValidate();
}
},
familyMember(row) {
this.rowInfo = {...row}
this.familyId = row.id;
this.instance.post(`/app/appresident/detail?id=${row.id}`).then(res => {
if (res.code == 0) {
this.familyList = res.data.family;
this.familyPage.total = res.data.family.length;
this.addMemberVisible = true;
}
})
},
goBack() {
this.detailShow = false;
},
goDetail(row) {
this.detailInfo = {...row};
this.detailShow = true;
}
}
}
</script>
<style lang="scss" scoped>
.scoreFamily {
height: 100%;
background: #f3f6f9;
overflow: auto;
.form_div {
width: 380px;
}
.add_btn {
color: #5088FF;
font-size: 14px;
line-height: 36px;
text-align: right;
span {
cursor: pointer;
}
span:nth-child(2) {
margin-left: 4px;
}
}
.iconfont {
cursor: pointer;
}
.iconAll_Profile {
padding: 0 8px;
}
.family-list{
::v-deep .el-table--small{
font-size: 14px!important;
}
}
}
</style>

View File

@@ -1,211 +0,0 @@
<template>
<ai-detail class="family_detail">
<template slot="title">
<ai-title title="余额明细" :isShowBack="true" :isShowBottomBorder="true" @onBackClick="$emit('goBack')"></ai-title>
</template>
<template slot="content">
<div class="detail-info">
<div class="detail-info__item">
<h2>户主</h2>
<span>{{ detailInfo.name }}</span>
</div>
<div class="detail-info__item">
<h2>累计积分</h2>
<span style="color: #2266FF;">{{ detailInfo.familyIntegral || 0 }}</span>
</div>
<div class="detail-info__item">
<h2>剩余积分</h2>
<span style="color: #2266FF;">{{ detailInfo.familySurplusIntegral || 0 }}</span>
</div>
<div class="detail-info__item">
<h2>已消费</h2>
<span>{{ detailInfo.familyUsedIntegral || 0 }}</span>
</div>
</div>
<ai-card title="余额变动明细">
<template slot="right">
<ai-download
:instance="instance"
url="/app/appvillagerintegraldetail/export"
:disabled="!Boolean(tableData.length)"
:params="{familyId:detailInfo.id,bizType:doType}"
fileName="余额变动明细">
<span class="iconfont iconExported">导出</span>
</ai-download>
</template>
<template #content>
<el-select v-model="doType" placeholder="请选择类型" size='small' clearable @change="page.current=1,getList()">
<el-option
v-for="(item,i) in dict.getDict('integralDetailType')"
:label="item.dictName"
:key="i"
:value="item.dictValue">
</el-option>
</el-select>
<ai-table
style="margin-top: 16px;"
:tableData="tableData"
:col-configs="colConfigs"
:total="page.total"
:border="true"
:stripe="false"
:current.sync="page.current"
:size.sync="page.size"
@getList="getList">
</ai-table>
</template>
</ai-card>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'balance',
props: {
detailInfo: {
type: Object,
require: true
},
instance: Function,
dict: Object
},
data() {
return {
page: {
current: 1,
size: 10,
total: 0
},
doType: '',
tableData: []
}
},
created() {
this.dict.load('integralDetailType')
this.getList()
},
computed: {
colConfigs() {
const _this = this
return [
{
prop: 'doTime',
label: '时间'
},
{
prop: 'bizType',
align: 'center',
label: '类型',
render(h, {row}) {
return h('span', {}, _this.dict.getLabel('integralDetailType', row.bizType))
}
},
{
prop: 'changeIntegral',
align: 'center',
label: '变动积分',
formart: v => v > 0 ? `+${v}` : v
},
{
prop: 'nowIntegral',
align: 'center',
label: '剩余积分'
},
{
prop: 'description',
label: '事件类型',
}
]
}
},
methods: {
getList() {
this.instance.post('/app/appvillagerintegraldetail/list', null, {
params: {
...this.page,
familyId: this.detailInfo.id,
bizType: this.doType
}
}).then(res => {
if (res.code === 0) {
this.tableData = res.data.records
this.page.total = res.data.total
}
})
}
}
}
</script>
<style lang="scss" scoped>
.family_detail {
height: 100%;
background-color: #fff;
::v-deep .ai-card__body {
padding: 12px 16px 20px !important;
}
.detail-info {
display: flex;
align-items: center;
margin-bottom: 20px;
.detail-info__item {
flex: 1;
height: 96px;
margin-right: 20px;
padding: 16px 24px;
background: #FFFFFF;
box-shadow: 0 4px 6px -2px rgba(15, 15, 21, 0.15);
border-radius: 4px;
&:last-child {
margin-right: 0;
}
h2 {
margin-bottom: 8px;
color: #888888;
font-size: 16px;
font-weight: bold;
}
span {
display: block;
line-height: 32px;
font-size: 24px;
font-weight: bold;
color: #222;
}
}
}
.iconExported {
color: #5088FF;
font-size: 12px;
cursor: pointer;
}
.info {
padding: 16px 0 16px 0;
}
.do_type {
height: 56px;
}
.fs-14 {
::v-deep .el-table--small {
font-size: 14px !important;
}
}
}
</style>

View File

@@ -24,7 +24,7 @@ import scoreChange from "./scoreChange";
export default {
name: 'AppScoreManage',
label: "积分管理",
label: "积分管理(秀山)",
components: {pointsDeclaration, pointsDetails, pointsAppeal, scoreChange},
props: {
instance: Function,

View File

@@ -1,408 +1,35 @@
<template>
<section class="scoreFamily">
<ai-list v-show="!detailShow">
<template slot="title">
<ai-title title="个人积分" :isShowBottomBorder="true" :instance="instance" :isShowArea="true" @change="getList()" v-model="areaId"></ai-title>
</template>
<template slot="content">
<ai-search-bar bottomBorder>
<template slot="left">
<el-select size="small" v-model="searchObj.householdName" placeholder="是否户主" clearable @change="page.current = 1,getList()">
<el-option
v-for="(item,i) in householdNameList"
:key="i"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
<el-select size="small" v-model="searchObj.isPositive" placeholder="积分是否大于0" clearable @change="page.current = 1,getList()">
<el-option
v-for="(item,i) in isPositiveList"
:key="i"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</template>
<template slot="right">
<el-input
v-model="searchObj.con"
size="small"
placeholder="个人姓名"
v-throttle="() => {page.current = 1, getList()}"
@clear="page.current = 1, searchObj.con = '', getList()"
clearable
suffix-icon="iconfont iconSearch" />
</template>
</ai-search-bar>
<ai-search-bar class="mt10">
<template slot="left">
<ai-download :instance="instance" type="primary" url="/app/appvillagerintegraldetail/listExport?exportType=1" :params="params" fileName="个人积分"></ai-download>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="page.total"
style="margin-top: 12px;"
:current.sync="page.current"
:size.sync="page.size"
@getList="getList">
<el-table-column label="操作" slot="options" fixed="right" align="center" width="180">
<template v-slot="{row}">
<div class="table-options">
<el-button type="text" title="家庭成员" @click="familyMember(row)" :disabled="!$permissions('app_appvillagerintegralfamilymember_edit')">家庭成员</el-button>
<el-button type="text" :disabled="!$permissions('app_appvillagerintegralfamily_detail')" title="详情" @click="goDetail(row)">详情</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
<detail v-if="detailShow" @goBack="goBack" :detailInfo='detailInfo' :instance='instance' :dict='dict'></detail>
<ai-dialog class="family-list"
title="成员列表"
:visible.sync="addMemberVisible"
:customFooter="true"
:destroyOnClose="true"
width="780px">
<ai-table
:tableData="familyList"
:col-configs="familycolConfigs"
:total="familyPage.total"
:current.sync="familyPage.current"
:size.sync="familyPage.size"
:isShowPagination="false"
tableSize="small"
@getList="familyMember(rowInfo)">
<el-table-column label="与户主关系" slot="householdRelation" align="center" width="120">
<template v-slot="{row}">
<span v-if="row.householdIdNumber == row.idNumber">户主</span>
<span v-else>{{dict.getLabel('householdRelation', row.householdRelation)}}</span>
</template>
</el-table-column>
<el-table-column label="身份证号" slot="idNumber" align="center" width="165">
<template v-slot="{row}">
<ai-id mode="show" :show-eyes="false" :value="row.idNumber"/>
</template>
</el-table-column>
</ai-table>
<div class="dialog-footer" slot="footer">
<el-button @click="addMemberVisible=false" size="medium"> </el-button>
</div>
</ai-dialog>
<section class="AppScorePersonal">
<component :is="currentComponent" :instance="instance" :dict="dict" :permissions="permissions"/>
</section>
</template>
<script>
import {mapState} from 'vuex';
import detail from './detail'
import SpList from "./spList";
export default {
name: 'AppScorePersonal',
label: "个人积分",
label: "积分统计(秀山)",
components: {SpList, detail},
props: {
instance: Function,
dict: Object,
permissions: Function
},
components: {detail},
data() {
return {
areaId: '',
searchObj: {
householdName: '',
con: '',
isPositive: ''
},
householdNameList: [{
dictName: '是',
dictValue: '1'
}, {
dictName: '否',
dictValue: '0'
}],
isPositiveList: [{
dictName: '是',
dictValue: '1'
}, {
dictName: '否',
dictValue: '0'
}],
page: {
current: 1,
size: 10,
total: 0
},
familyPage: {
current: 1,
size: 10,
total: 0
},
exportParams: {},
tableData: [],
dialog: {
title: '添加家庭',
visible: false
},
dialogInfo: {
personType: '0',
name: '',
idNumber: '',
phone: '',
villageGroup: '',
status: '',
areaId: '',
householdRelation: '',
avatar: ''
},
addMemberVisible: false,
detailShow: false,
personUrl: '',
familyList: [],
familyId: '',
detailInfo: {},
rowInfo: {}
}
},
computed: {
...mapState(['user']),
params () {
return {
...this.searchObj,
areaId: this.areaId,
exportType: 1
}
},
colConfigs() {
return [
{
prop: 'name',
label: '姓名',
},
{
prop: 'phone',
align: 'center',
label: '联系电话',
},
{
prop: 'residentType',
align: 'center',
label: '类型',
formart: v => this.dict.getLabel('residentType', v)
},
{
prop: 'householdAreaName',
align: 'center',
label: '所在村'
},
{
prop: 'personalIntegral',
align: 'center',
label: '个人积分',
},
{
prop: 'personalUsedIntegral',
align: 'center',
label: '已用积分',
},
{
prop: 'householdName',
align: 'center',
label: '是否户主',
formart: v => v === '1' ? '是' : '否'
}
]
},
familycolConfigs() {
return [
{
prop: 'householdRelation',
align: 'center',
slot: 'householdRelation',
label: '与户主关系',
width: 165,
},
// {
// prop: 'householdRelation',
// align: 'center',
// label: '与户主关系',
// render(h, {row}) {
// return h('span', {}, _.$dict.getLabel('householdRelation', row.householdRelation))
// }
// },
{
prop: 'residentType',
align: 'center',
label: '类型',
formart: v => this.dict.getLabel('residentType', v)
},
{
prop: 'name',
align: 'center',
label: '姓名',
},
{
prop: 'idNumber',
align: 'center',
slot: 'idNumber',
label: '身份证号',
width: 165,
},
{
prop: 'phone',
align: 'center',
label: '联系电话',
width: 120,
}
]
},
formRules() {
let IdNumberPass = (rule, value, callback) => {
if (value) {
console.log(this.idCardNoUtil);
if (this.idCardNoUtil.checkIdCardNo(value)) {
callback();
} else {
callback(new Error("身份证号格式错误"));
}
} else {
callback(new Error("请输入身份证号"));
}
};
if (this.dialog.title.indexOf('家庭') != -1) {
return {
personType: [{required: true, message: "请选择类型", trigger: 'change'}],
name: [{required: true, message: "请填写户主", trigger: 'change'}],
idNumber: [{required: true, validator: IdNumberPass, trigger: 'change'}],
phone: [{required: true, message: "请填写联系电话", trigger: 'blur'}],
villageGroup: [{required: true, message: "请选择所属组", trigger: 'change'}],
status: [{required: true, message: "请选择状态", trigger: 'change'}],
householdRelation: [{required: true, message: "请选择与户主关系", trigger: 'change'}]
}
} else {
return {
personType: [{required: true, message: "请选择类型", trigger: 'change'}],
name: [{required: true, message: "请填写户主", trigger: 'change'}],
idNumber: [{required: true, validator: IdNumberPass, trigger: 'change'}],
villageGroup: [{required: true, message: "请选择所属组", trigger: 'change'}],
status: [{required: true, message: "请选择状态", trigger: 'change'}],
householdRelation: [{required: true, message: "请选择与户主关系", trigger: 'change'}]
}
}
currentComponent() {
return this.$route.query.id ? detail : SpList
}
},
created() {
this.areaId = this.user.info.areaId;
this.dict.load('integralVillageGroup', 'integralRuleStatus', 'integralPersonType', 'householdRelation', 'residentType');
this.getList();
},
methods: {
getList() {
this.instance.post("/app/appresident/personalIntegral", null, {
params: {
...this.searchObj,
...this.page,
areaId: this.areaId
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records.map(v => {
return v
})
this.page.total = res.data.total
}
})
},
typeChange(val) {
val == '0' ? this.personUrl = '/app/appresident/list?fileStatus=0' : this.personUrl = '/app/apprecurrentpopulation/list?fileStatus=0';
this.dialogInfo.name = "";
this.dialogInfo.idNumber = "";
this.dialogInfo.phone = "";
this.dialogInfo.avatar = "";
this.dialogInfo.areaId = "";
},
add() {
this.dialog.visible = true;
this.dialog.title = '添加家庭';
},
addFamily() {
this.dialog.visible = true;
this.dialog.title = '添加成员';
},
init(formName) {
this.$refs[formName].clearValidate();
Object.keys(this.dialogInfo).forEach(e => {
this.dialogInfo[e] = ''
})
this.dialogInfo.personType = '0';
this.personUrl = '';
},
familyMember (row) {
this.instance.post(`/app/appresident/detail?id=${row.id}`).then(res => {
if (res.code === 0) {
this.familyList = res.data.family
this.familyPage.total = res.data.family.length
this.addMemberVisible = true
}
})
},
goBack() {
this.detailShow = false;
},
goDetail(row) {
this.detailInfo = {...row};
this.detailShow = true;
}
this.dict.load('integralVillageGroup', 'integralRuleStatus', 'integralPersonType', 'householdRelation', 'residentType', "integralDetailType");
}
}
</script>
<style lang="scss" scoped>
.scoreFamily {
.AppScorePersonal {
height: 100%;
background: #f3f6f9;
overflow: auto;
.form_div {
width: 380px;
}
.add_btn {
color: #5088FF;
font-size: 14px;
line-height: 36px;
text-align: right;
span {
cursor: pointer;
}
span:nth-child(2) {
margin-left: 4px;
}
}
.iconfont {
cursor: pointer;
}
.iconAll_Profile {
padding: 0 8px;
}
.family-list{
::v-deep .el-table--small{
font-size: 14px!important;
}
}
}
</style>

View File

@@ -1,13 +1,13 @@
<template>
<ai-detail class="family_detail">
<ai-detail class="spDetail">
<template slot="title">
<ai-title title="个人积分明细" :isShowBack="true" :isShowBottomBorder="true" @onBackClick="$emit('goBack')" ></ai-title>
<ai-title title="积分明细" :isShowBack="true" :isShowBottomBorder="true" @onBackClick="$router.push({})"></ai-title>
</template>
<template slot="content">
<div class="detail-info">
<div class="detail-info__item">
<h2>姓名</h2>
<span>{{ info.name }}</span>
<h2>账号</h2>
<span>{{ info.phone || "-" }}</span>
</div>
<div class="detail-info__item">
<h2>个人积分</h2>
@@ -20,35 +20,27 @@
</div>
<ai-card title="余额变动明细">
<template slot="right">
<!-- <ai-download
:instance="instance"
url="/app/appvillagerintegraldetail/export"
:disabled="!Boolean(tableData.length)"
:params="{familyName:detailInfo.name,doType:doType}"
fileName="余额变动明细">
<span class="iconfont iconExported">导出</span>
</ai-download> -->
</template>
<template #content>
<el-select v-model="doType" placeholder="请选择类型" size='small' clearable @change="page.current=1,getList()">
<el-select v-model="doType" placeholder="请选择类型" size='small' clearable @change="page.current=1,getList()">
<el-option
v-for="(item,i) in dict.getDict('integralDetailType')"
:label="item.dictName"
:key="i"
:value="item.dictValue">
v-for="(item,i) in dict.getDict('integralDetailType')"
:label="item.dictName"
:key="i"
:value="item.dictValue">
</el-option>
</el-select>
<ai-table class="fs-14"
style="margin-top: 16px;"
:tableData="tableData"
:col-configs="colConfigs"
:total="page.total"
:current.sync="page.current"
:size.sync="page.size"
:isShowPagination="false"
tableSize="small"
:border="true"
@getList="getList">
style="margin-top: 16px;"
:tableData="tableData"
:col-configs="colConfigs"
:total="page.total"
:current.sync="page.current"
:size.sync="page.size"
:isShowPagination="false"
tableSize="small"
:border="true"
@getList="getList">
</ai-table>
</template>
</ai-card>
@@ -57,149 +49,148 @@
</template>
<script>
export default {
name: 'balance',
export default {
name: 'spDetail',
props: {
instance: Function,
dict: Object
},
props: {
detailInfo: {
type: Object,
require: true
data() {
return {
page: {
current: 1,
size: 10,
total: 0
},
instance: Function,
dict: Object
},
info: {},
doType: '',
tableData: []
}
},
data () {
return {
page: {
current: 1,
size: 10,
total: 0
created() {
this.getList()
},
computed: {
colConfigs() {
const _this = this
return [
{
prop: 'doTime',
label: '时间',
align: 'left'
},
info: {},
doType: '',
tableData: []
}
},
{
prop: 'doType',
align: 'center',
label: '类型',
render(h, {row}) {
return h('span', {}, _this.dict.getLabel('integralDetailType', row.bizType))
}
},
{
prop: 'changeIntegral',
align: 'center',
label: '变动积分'
},
{
prop: 'nowIntegral',
align: 'center',
label: '剩余积分'
},
{
prop: 'description',
label: '事件类型',
align: 'left'
}
]
}
},
created () {
this.dict.load('integralDetailType')
this.getList()
},
computed: {
colConfigs () {
const _this = this
return [
{
prop: 'doTime',
label: '时间',
align:'left'
},
{
prop: 'doType',
align: 'center',
label: '类型',
render (h, {row}) {
return h('span',{}, _this.dict.getLabel('integralDetailType', row.bizType))
methods: {
getList() {
let {id} = this.$route.query
this.instance.post(`/app/appresident/detail?id=${id}`).then(res => {
if (res.code == 0) {
this.info = res.data.resident
this.instance.post(`/app/appvillagerintegraldetail/IntegralList?bizType=${this.doType}&type=1&residentId=${res.data.resident.id}`, null, {
params: this.page
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
}
},
{
prop: 'changeIntegral',
align: 'center',
label: '变动积分'
},
{
prop: 'nowIntegral',
align: 'center',
label: '剩余积分'
},
{
prop: 'description',
label: '事件类型',
align:'left'
}
]
}
},
methods: {
getList () {
this.instance.post(`/app/appresident/detail?id=${this.detailInfo.id}`).then(res => {
if (res.code === 0) {
this.info = res.data.resident
this.instance.post(`/app/appvillagerintegraldetail/IntegralList?bizType=${this.doType}&type=1&residentId=${res.data.resident.id}`, null, {
params: this.page
}).then(res => {
if (res.code === 0) {
this.tableData = res.data.records
}
})
}
})
}
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.family_detail{
height: 100%;
background-color: #fff;
.spDetail {
height: 100%;
background-color: #fff;
::v-deep .ai-card__body {
padding: 12px 16px 20px!important;
}
::v-deep .ai-card__body {
padding: 12px 16px 20px !important;
}
.detail-info {
display: flex;
align-items: center;
margin-bottom: 20px;
.detail-info {
display: flex;
align-items: center;
margin-bottom: 20px;
.detail-info__item {
flex: 1;
height: 96px;
margin-right: 20px;
padding: 16px 24px;
background: #FFFFFF;
box-shadow: 0 4px 6px -2px rgba(15, 15, 21, 0.15);
border-radius: 4px;
.detail-info__item {
flex: 1;
height: 96px;
margin-right: 20px;
padding: 16px 24px;
background: #FFFFFF;
box-shadow: 0 4px 6px -2px rgba(15, 15, 21, 0.15);
border-radius: 4px;
&:last-child {
margin-right: 0;
}
h2 {
margin-bottom: 8px;
color: #888888;
font-size: 16px;
font-weight: bold;
}
span {
display: block;
line-height: 32px;
font-size: 24px;
font-weight: bold;
color: #222;
}
&:last-child {
margin-right: 0;
}
}
.iconExported{
color:#5088FF;
font-size: 12px;
cursor: pointer;
}
.info{
padding: 16px 0 16px 0;
}
.do_type{
height: 56px;
}
.fs-14{
::v-deep .el-table--small{
font-size: 14px!important;
h2 {
margin-bottom: 8px;
color: #888888;
font-size: 16px;
font-weight: bold;
}
span {
display: block;
line-height: 32px;
font-size: 24px;
font-weight: bold;
color: #222;
}
}
}
.iconExported {
color: #5088FF;
font-size: 12px;
cursor: pointer;
}
.info {
padding: 16px 0 16px 0;
}
.do_type {
height: 56px;
}
.fs-14 {
::v-deep .el-table--small {
font-size: 14px !important;
}
}
}
</style>

View File

@@ -0,0 +1,358 @@
<template>
<section class="spList">
<ai-list>
<ai-title slot="title" title="个人积分" isShowBottomBorder/>
<template slot="content">
<ai-search-bar bottomBorder>
<template slot="left">
<el-select size="small" v-model="searchObj.isPositive" placeholder="积分是否大于0" clearable
@change="page.current = 1,getList()">
<el-option
v-for="(item,i) in isPositiveList"
:key="i"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</template>
<template slot="right">
<el-input v-model="searchObj.con" size="small" placeholder="个人姓名"
@change="page.current = 1, searchObj.con = '', getList()" clearable
suffix-icon="iconfont iconSearch"/>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="page.total"
style="margin-top: 12px;"
:current.sync="page.current"
:size.sync="page.size"
@getList="getList">
<el-table-column label="操作" slot="options" fixed="right" align="center" width="180">
<template v-slot="{row}">
<div class="table-options">
<el-button type="text" :disabled="!$permissions('app_appvillagerintegralfamily_detail')" title="详情"
@click="goDetail(row)">详情
</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
<ai-dialog class="family-list"
title="成员列表"
:visible.sync="addMemberVisible"
:customFooter="true"
:destroyOnClose="true"
width="780px">
<ai-table
:tableData="familyList"
:col-configs="familycolConfigs"
:total="familyPage.total"
:current.sync="familyPage.current"
:size.sync="familyPage.size"
:isShowPagination="false"
tableSize="small"
@getList="familyMember(rowInfo)">
<el-table-column label="与户主关系" slot="householdRelation" align="center" width="120">
<template v-slot="{row}">
<span v-if="row.householdIdNumber == row.idNumber">户主</span>
<span v-else>{{ dict.getLabel('householdRelation', row.householdRelation) }}</span>
</template>
</el-table-column>
<el-table-column label="身份证号" slot="idNumber" align="center" width="165">
<template v-slot="{row}">
<ai-id mode="show" :show-eyes="false" :value="row.idNumber"/>
</template>
</el-table-column>
</ai-table>
<div class="dialog-footer" slot="footer">
<el-button @click="addMemberVisible=false" size="medium"> </el-button>
</div>
</ai-dialog>
</section>
</template>
<script>
import {mapState} from "vuex";
export default {
name: "spList",
props: {
instance: Function,
dict: Object,
permissions: Function
},
data() {
return {
areaId: '',
searchObj: {
householdName: '',
con: '',
isPositive: ''
},
householdNameList: [{
dictName: '是',
dictValue: '1'
}, {
dictName: '否',
dictValue: '0'
}],
isPositiveList: [{
dictName: '是',
dictValue: '1'
}, {
dictName: '否',
dictValue: '0'
}],
page: {
current: 1,
size: 10,
total: 0
},
familyPage: {
current: 1,
size: 10,
total: 0
},
exportParams: {},
tableData: [],
dialog: {
title: '添加家庭',
visible: false
},
dialogInfo: {
personType: '0',
name: '',
idNumber: '',
phone: '',
villageGroup: '',
status: '',
areaId: '',
householdRelation: '',
avatar: ''
},
addMemberVisible: false,
personUrl: '',
familyList: [],
familyId: '',
detailInfo: {},
rowInfo: {}
}
},
computed: {
...mapState(['user']),
params() {
return {
...this.searchObj,
areaId: this.areaId,
exportType: 1
}
},
colConfigs() {
return [
{
prop: 'phone',
align: 'center',
label: '用户账号',
},
{
prop: 'personalIntegral',
align: 'center',
label: '获取积分',
},
{
prop: 'personalUsedIntegral',
align: 'center',
label: '已用积分',
},
{
align: 'center',
label: '剩余积分',
render: (h, {row}) => h('span', null, row.personalIntegral - row.personalUsedIntegral)
}
]
},
familycolConfigs() {
return [
{
prop: 'householdRelation',
align: 'center',
slot: 'householdRelation',
label: '与户主关系',
width: 165,
},
// {
// prop: 'householdRelation',
// align: 'center',
// label: '与户主关系',
// render(h, {row}) {
// return h('span', {}, _.$dict.getLabel('householdRelation', row.householdRelation))
// }
// },
{
prop: 'residentType',
align: 'center',
label: '类型',
formart: v => this.dict.getLabel('residentType', v)
},
{
prop: 'name',
align: 'center',
label: '姓名',
},
{
prop: 'idNumber',
align: 'center',
slot: 'idNumber',
label: '身份证号',
width: 165,
},
{
prop: 'phone',
align: 'center',
label: '联系电话',
width: 120,
}
]
},
formRules() {
let IdNumberPass = (rule, value, callback) => {
if (value) {
console.log(this.idCardNoUtil);
if (this.idCardNoUtil.checkIdCardNo(value)) {
callback();
} else {
callback(new Error("身份证号格式错误"));
}
} else {
callback(new Error("请输入身份证号"));
}
};
if (this.dialog.title.indexOf('家庭') != -1) {
return {
personType: [{required: true, message: "请选择类型", trigger: 'change'}],
name: [{required: true, message: "请填写户主", trigger: 'change'}],
idNumber: [{required: true, validator: IdNumberPass, trigger: 'change'}],
phone: [{required: true, message: "请填写联系电话", trigger: 'blur'}],
villageGroup: [{required: true, message: "请选择所属组", trigger: 'change'}],
status: [{required: true, message: "请选择状态", trigger: 'change'}],
householdRelation: [{required: true, message: "请选择与户主关系", trigger: 'change'}]
}
} else {
return {
personType: [{required: true, message: "请选择类型", trigger: 'change'}],
name: [{required: true, message: "请填写户主", trigger: 'change'}],
idNumber: [{required: true, validator: IdNumberPass, trigger: 'change'}],
villageGroup: [{required: true, message: "请选择所属组", trigger: 'change'}],
status: [{required: true, message: "请选择状态", trigger: 'change'}],
householdRelation: [{required: true, message: "请选择与户主关系", trigger: 'change'}]
}
}
}
},
created() {
this.areaId = this.user.info.areaId;
this.getList();
},
methods: {
getList() {
this.instance.post("/app/appportaluser/list", null, {
params: {
...this.searchObj,
...this.page,
areaId: this.areaId
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records.map(v => {
return v
})
this.page.total = res.data.total
}
})
},
typeChange(val) {
val == '0' ? this.personUrl = '/app/appresident/list?fileStatus=0' : this.personUrl = '/app/apprecurrentpopulation/list?fileStatus=0';
this.dialogInfo.name = "";
this.dialogInfo.idNumber = "";
this.dialogInfo.phone = "";
this.dialogInfo.avatar = "";
this.dialogInfo.areaId = "";
},
add() {
this.dialog.visible = true;
this.dialog.title = '添加家庭';
},
addFamily() {
this.dialog.visible = true;
this.dialog.title = '添加成员';
},
init(formName) {
this.$refs[formName].clearValidate();
Object.keys(this.dialogInfo).forEach(e => {
this.dialogInfo[e] = ''
})
this.dialogInfo.personType = '0';
this.personUrl = '';
},
familyMember(row) {
this.instance.post(`/app/appresident/detail?id=${row.id}`).then(res => {
if (res.code === 0) {
this.familyList = res.data.family
this.familyPage.total = res.data.family.length
this.addMemberVisible = true
}
})
},
goDetail(row) {
this.$router.push({query: {id: row.id}})
}
}
}
</script>
<style lang="scss" scoped>
.spList {
height: 100%;
.form_div {
width: 380px;
}
.add_btn {
color: #5088FF;
font-size: 14px;
line-height: 36px;
text-align: right;
span {
cursor: pointer;
}
span:nth-child(2) {
margin-left: 4px;
}
}
.iconfont {
cursor: pointer;
}
.iconAll_Profile {
padding: 0 8px;
}
.family-list {
::v-deep .el-table--small {
font-size: 14px !important;
}
}
}
</style>

View File

@@ -145,7 +145,7 @@
<script>
export default {
name: "AppScoreRules",
label: "积分规则",
label: "积分规则(秀山)",
props: {
instance: Function,
dict: Object,

View File

@@ -2,25 +2,27 @@
<div class="AppScoreSupermarket">
<ai-list v-show="!detailShow">
<template slot="title">
<ai-title title="积分超市" :isShowBottomBorder="false" :instance="instance" :isShowArea="true" v-model="areaId" @change="changeArea"></ai-title>
<ai-title title="积分超市" :isShowBottomBorder="false" :instance="instance" :isShowArea="true" v-model="areaId"
@change="changeArea"></ai-title>
</template>
<template slot="tabs">
<el-tabs v-model="currIndex">
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :name="String(i)" :label="tab.label">
<component
:is="tab.comp"
v-if="currIndex === String(i)"
:areaId="areaId"
:ref="tab.name"
@showDetail="showDetail"
:instance="instance"
:dict="dict"
:permissions="permissions" />
:is="tab.comp"
v-if="currIndex === String(i)"
:areaId="areaId"
:ref="tab.name"
@showDetail="showDetail"
:instance="instance"
:dict="dict"
:permissions="permissions"/>
</el-tab-pane>
</el-tabs>
</template>
</ai-list>
<component v-if="detailShow" :is="currDet" :areaId="areaId" :info="info" @goBack="goBack" :instance="instance" :dict="dict" :permissions="permissions"/>
<component v-if="detailShow" :is="currDet" :areaId="areaId" :info="info" @goBack="goBack" :instance="instance"
:dict="dict" :permissions="permissions"/>
</div>
</template>
@@ -34,7 +36,7 @@ import {mapState} from 'vuex'
export default {
name: "AppScoreSupermarket",
label: "积分超市",
label: "积分超市(秀山)",
components: {orderManagement, goodsManagement, storeManagement, addOrderDetail, addGoods},
props: {
instance: Function,