迁移积分应用
This commit is contained in:
573
project/xiushan/apps/creditScore/scoreFamily/AppScoreFamily.vue
Normal file
573
project/xiushan/apps/creditScore/scoreFamily/AppScoreFamily.vue
Normal file
@@ -0,0 +1,573 @@
|
||||
<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="户主姓名"
|
||||
@keyup.enter.native="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>
|
||||
211
project/xiushan/apps/creditScore/scoreFamily/detail.vue
Normal file
211
project/xiushan/apps/creditScore/scoreFamily/detail.vue
Normal file
@@ -0,0 +1,211 @@
|
||||
<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>
|
||||
@@ -0,0 +1,84 @@
|
||||
<template>
|
||||
<ai-list>
|
||||
<template slot="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" :label="tab.label">
|
||||
<component :is="tab.comp" v-if="currIndex === String(i)" :bizType="tab.bizType" :ref="tab.name"
|
||||
:areaId="areaId" :instance="instance" :dict="dict" :permissions="permissions"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pointsDeclaration from "./pointsDeclaration.vue"
|
||||
import pointsDetails from "./pointsDetails.vue"
|
||||
import pointsAppeal from './pointsAppeal'
|
||||
import {mapState} from 'vuex'
|
||||
import scoreChange from "./scoreChange";
|
||||
|
||||
export default {
|
||||
name: 'AppScoreManage',
|
||||
label: "积分管理",
|
||||
components: {pointsDeclaration, pointsDetails, pointsAppeal, scoreChange},
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
tabs() {
|
||||
return [
|
||||
// {
|
||||
// label: "积分申报",
|
||||
// name: "pointsDeclaration",
|
||||
// comp: pointsDeclaration,
|
||||
// permission: "app_apppartyfee_record",
|
||||
// bizType: '0'
|
||||
// },
|
||||
// { label: "积分申诉", name: "pointsAppeal", comp: pointsAppeal, permission: "app_apppartyfee_config", bizType: '1'},
|
||||
{
|
||||
label: "积分明细",
|
||||
name: "pointsDetails",
|
||||
comp: pointsDetails,
|
||||
permission: "app_apppartyfee_statistics",
|
||||
bizType: '2'
|
||||
},
|
||||
{
|
||||
label: "积分调整",
|
||||
name: "scoreChange",
|
||||
comp: scoreChange,
|
||||
permission: "",
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.areaId = this.user.info.areaId
|
||||
},
|
||||
methods: {
|
||||
changeArea() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs[this.tabs[Number(this.currIndex)].name][0].getList()
|
||||
})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: "pointsDeclaration",
|
||||
currIndex: '0',
|
||||
areaId: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
628
project/xiushan/apps/creditScore/scoreManage/pointsAppeal.vue
Normal file
628
project/xiushan/apps/creditScore/scoreManage/pointsAppeal.vue
Normal file
@@ -0,0 +1,628 @@
|
||||
<template>
|
||||
<section class="pointsDeclaration">
|
||||
<ai-list isTabs>
|
||||
<template slot="content">
|
||||
<ai-search-bar bottomBorder>
|
||||
<template slot="left">
|
||||
<el-button type="primary" icon="iconfont iconAdd" @click="onAdd"
|
||||
v-if="$permissions('app_appvillagerintegraldeclare_edit')">代申诉
|
||||
</el-button>
|
||||
<el-button icon="iconfont iconEdit" @click="batchAduit()" :disabled="!Boolean(selectionList.length)"
|
||||
v-if="$permissions('app_appvillagerintegraldeclare_edit')">批量审核
|
||||
</el-button>
|
||||
<ai-select
|
||||
v-model="search.status"
|
||||
@change="page.current = 1, getList()"
|
||||
placeholder="发布状态"
|
||||
:selectList="dict.getDict('integralDeclareStatus')">
|
||||
</ai-select>
|
||||
<div class="times_div">
|
||||
<p class="times">申诉时间</p>
|
||||
<el-date-picker
|
||||
v-model="search.declareTimeStart"
|
||||
type="date"
|
||||
size="small"
|
||||
@change="page.current = 1,getList()"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="开始日期">
|
||||
</el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="search.declareTimeEnd"
|
||||
type="date"
|
||||
size="small"
|
||||
@change="page.current = 1,getList()"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<el-input
|
||||
v-model="search.familyName"
|
||||
class="search-input"
|
||||
size="mini"
|
||||
placeholder="申诉人/申诉对象/..."
|
||||
clearable
|
||||
@keyup.enter.native="page.current = 1, getList()"
|
||||
@clear="page.current = 1, getList()"
|
||||
suffix-icon="iconfont iconSearch"/>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="page.total"
|
||||
:current.sync="page.current"
|
||||
:size.sync="page.size"
|
||||
@getList="getList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column slot="selection" type="selection" width="55" :selectable="row=>row.status==0"/>
|
||||
<el-table-column slot="options" label="操作" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<span
|
||||
class="iconfont iconEdit icon-color89B"
|
||||
v-if="row.status === '0'&&$permissions('app_appvillagerintegraldeclare_edit')"
|
||||
title="编辑"
|
||||
@click="toEdit(row)"
|
||||
></span>
|
||||
<span
|
||||
class="iconfont iconShow icon-color89B"
|
||||
v-if="row.status !== '0'&&$permissions('app_appvillagerintegraldeclare_detail')"
|
||||
title="详情"
|
||||
@click="toEdit(row)"
|
||||
></span>
|
||||
<!-- <span
|
||||
class="iconfont iconDelete icon-color89B"
|
||||
v-if="$permissions('app_appofficialdocumentinfo_del')"
|
||||
title="删除"
|
||||
@click="remove(row.id)"
|
||||
></span> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
<ai-dialog
|
||||
title="积分代申诉"
|
||||
:visible.sync="dialog.visibleAdd"
|
||||
:customFooter="true"
|
||||
:destroyOnClose="true"
|
||||
width="720px"
|
||||
@close="init('ruleForm')"
|
||||
>
|
||||
<div class="form_div">
|
||||
<el-form
|
||||
ref="ruleForm"
|
||||
:model="dialogInfo"
|
||||
:rules="formRules"
|
||||
size="small"
|
||||
label-suffix=":"
|
||||
label-width="140px"
|
||||
>
|
||||
<el-form-item label="代申诉家庭" prop="users">
|
||||
<ai-person-select :customClicker="true" :isMultiple="true" :chooseUserList.sync="dialogInfo.users"
|
||||
:instance="instance" url="/app/appvillagerintegralfamilymember/list">
|
||||
<template name="option" v-slot:option="{ item }">
|
||||
<span class="iconfont iconProlife">{{ item.name }}</span>
|
||||
<ai-id mode="show" :show-eyes="false" :value="item.idNumber"/>
|
||||
</template>
|
||||
</ai-person-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="代申诉说明" prop="declareDescription">
|
||||
<el-input type="textarea" :rows="3" placeholder="请输入…" maxlength="100" show-word-limit
|
||||
v-model="dialogInfo.declareDescription"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="照片" prop="fileList">
|
||||
<div class="upload">
|
||||
<ai-uploader :instance="instance" v-model="dialogInfo.fileList" :limit="9"></ai-uploader>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="dialog.visibleAdd=false" size="medium">取消</el-button>
|
||||
<el-button @click="declare('ruleForm')" type="primary" size="medium">提交</el-button>
|
||||
</div>
|
||||
</ai-dialog>
|
||||
<ai-dialog
|
||||
title="申诉审核"
|
||||
:visible.sync="dialog.visibleDetail"
|
||||
:customFooter="true"
|
||||
:destroyOnClose="true"
|
||||
width="720px"
|
||||
@close="init('rules')"
|
||||
>
|
||||
<div class="form_content" v-if="!isBatch">
|
||||
<div class="form_flex form_info">
|
||||
<div>
|
||||
<span class="form_label">申诉人:</span>
|
||||
<span class="form_value">{{ rowInfo.declareName }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="form_label">申诉对象:</span>
|
||||
<span class="form_value">{{ rowInfo.declareObjName }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="form_label">户主:</span>
|
||||
<span class="form_value">{{ rowInfo.familyName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_info">
|
||||
<span class="form_label">申诉说明:</span>
|
||||
<span class="form_value">{{ rowInfo.declareDescription }}</span>
|
||||
</div>
|
||||
<div class="form_info">
|
||||
<span class="form_label">申诉时间:</span>
|
||||
<span class="form_value">{{ rowInfo.declareTime }}</span>
|
||||
</div>
|
||||
<div class="form_info">
|
||||
<span class="form_label">照片:</span>
|
||||
<span class="form_value">
|
||||
<ai-uploader :disabled="true" :instance="instance" v-model="rowInfo.fileList" :limit="9"></ai-uploader>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_div">
|
||||
<el-form
|
||||
ref="rules"
|
||||
:model="dialogDetail"
|
||||
:rules="formRules"
|
||||
size="small"
|
||||
label-suffix=":"
|
||||
v-show="rowInfo.status==0"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="类型" prop="doType">
|
||||
<el-radio-group v-model="dialogDetail.doType" @change="changeDoType">
|
||||
<el-radio label="1">加分</el-radio>
|
||||
<el-radio label="0">扣分</el-radio>
|
||||
<el-radio label="2">拒绝</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="事项" prop="ruleId" v-if='dialogDetail.doType!=2'>
|
||||
<el-select v-model="dialogDetail.ruleId" placeholder="请选择..." @change="ruleChange">
|
||||
<el-option
|
||||
v-for="(item,i) in rulesList"
|
||||
:key="i"
|
||||
:label="item.ruleName"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="积分" prop="doIntegral" v-if='dialogDetail.doType!=2'>
|
||||
<el-col :span="1.5" style="margin-right: 8px;">{{ dialogDetail.doType == 0 ? '减少' : '增加' }}</el-col>
|
||||
<el-col :span="6" style="margin-right: 8px;width:120px;">
|
||||
<el-input type="number" v-model="dialogDetail.doIntegral" :placeholder="placeholder"
|
||||
:disabled="integralEdit"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1" style="margin-right: 8px;">分</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注说明">
|
||||
<el-input type="textarea" :rows="3" maxlength="100" placeholder="请输入…" show-word-limit
|
||||
v-model="dialogDetail.remark"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<ai-wrapper
|
||||
label-width="70px"
|
||||
v-if="rowInfo.status!=0"
|
||||
:columnsNumber="1">
|
||||
<ai-info-item label="类型:"><span
|
||||
:style="{color:colorList[rowInfo.status]}">{{ dict.getLabel('integralDeclareStatus', rowInfo.status) }}</span>
|
||||
</ai-info-item>
|
||||
<ai-info-item label="事项:" v-if='rowInfo.doType!=2'><span>{{ rowInfo.ruleName }}</span></ai-info-item>
|
||||
<ai-info-item label="积分:" v-if='rowInfo.doType!=2'>{{ rowInfo.doType == 0 ? '减少' : '增加' }}<span
|
||||
style="color:#2266FF">{{ Math.abs(rowInfo.doIntegral) }}</span>分
|
||||
</ai-info-item>
|
||||
<ai-info-item label="备注说明:"><span>{{ rowInfo.remark || '-' }}</span></ai-info-item>
|
||||
</ai-wrapper>
|
||||
</div>
|
||||
<div class="dialog-footer" slot="footer" v-if="rowInfo.status==0">
|
||||
<el-button @click="dialog.visibleDetail=false" size="medium">取消</el-button>
|
||||
<el-button @click="onConfirm('rules')" type="primary" size="medium">提交</el-button>
|
||||
</div>
|
||||
</ai-dialog>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "pointsAppeal",
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
bizType: String,
|
||||
areaId: String
|
||||
},
|
||||
|
||||
data() {
|
||||
var integral = (rule, value, callback) => {
|
||||
if (value) {
|
||||
if (/^[1-9]\d*$/.test(value)) {
|
||||
if (!this.integralEdit) {
|
||||
if (Number(value) >= this.sectionNum.min && Number(value) <= this.sectionNum.max) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error(`请输入${this.sectionNum.min}至${this.sectionNum.max}之间的正整数积分`));
|
||||
}
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
|
||||
} else {
|
||||
callback(new Error('请输入正整数'));
|
||||
}
|
||||
} else {
|
||||
callback(new Error('请输入正整数'));
|
||||
}
|
||||
};
|
||||
return {
|
||||
search: {
|
||||
status: '',
|
||||
familyName: '',
|
||||
declareTimeStart: null,
|
||||
declareTimeEnd: null
|
||||
},
|
||||
page: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0
|
||||
},
|
||||
colConfigs: [
|
||||
{slot: "selection", label: "", align: "center"},
|
||||
{prop: "declareName", label: "申诉人", align: "center"},
|
||||
{prop: "declareObjName", label: "申诉对象", align: "center", hide: this.bizType == 1},
|
||||
{
|
||||
prop: "familyName",
|
||||
label: "户主",
|
||||
},
|
||||
{
|
||||
prop: "declareDescription",
|
||||
label: "申诉说明",
|
||||
align: "left",
|
||||
width: 300
|
||||
},
|
||||
{
|
||||
prop: "declareTime",
|
||||
label: "申诉时间",
|
||||
align: "left",
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
prop: "declareName",
|
||||
label: "操作人",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
label: "状态",
|
||||
align: "center",
|
||||
render: (h, {row}) => {
|
||||
return h('span', {style: {color: this.dict.getColor('integralDeclareStatus', row.status)}}, this.dict.getLabel('integralDeclareStatus', row.status))
|
||||
},
|
||||
},
|
||||
{slot: "options", label: "操作", align: "center"},
|
||||
],
|
||||
tableData: [],
|
||||
dialog: {
|
||||
visibleAdd: false,
|
||||
visibleDetail: false,
|
||||
title: '积分代申诉'
|
||||
},
|
||||
dialogInfo: {
|
||||
users: [],
|
||||
reportIds: [],
|
||||
declareDescription: "",
|
||||
fileList: [],
|
||||
},
|
||||
dialogDetail: {
|
||||
doType: '1',
|
||||
ruleId: '',
|
||||
doIntegral: '',
|
||||
remark: '',
|
||||
aduitIds: [],
|
||||
ruleName: ''
|
||||
},
|
||||
isBatch: false,
|
||||
rulesList: [],
|
||||
rowInfo: {},
|
||||
formRules: {
|
||||
users: [{required: true, message: "请选择人员", trigger: "change"},],
|
||||
declareDescription: [{required: true, message: "代申诉说明", trigger: "blur"}],
|
||||
// fileList: [{ required: true, message: "请上传照片", trigger: "blur" },],
|
||||
ruleId: [{required: true, message: "请选择事项", trigger: "blur"}],
|
||||
doIntegral: [{required: true, validator: integral, trigger: "blur"}],
|
||||
doType: [{required: true, message: "请选择类型", trigger: "change"}]
|
||||
},
|
||||
selectionList: [],
|
||||
integralEdit: false,
|
||||
sectionNum: {
|
||||
min: null,
|
||||
max: null
|
||||
},
|
||||
placeholder: '请输入...'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
colorList() {
|
||||
return {
|
||||
'0': '#FF8822',
|
||||
'1': '#2EA222',
|
||||
'2': '#FF4466'
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.dict
|
||||
.load([
|
||||
'integralDeclareStatus',
|
||||
'integralDeclareDoType'
|
||||
]).then(() => {
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/appvillagerintegraldeclare/list`, null, {
|
||||
params: {
|
||||
...this.search,
|
||||
...this.page,
|
||||
bizType: this.bizType,
|
||||
areaId: this.areaId
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records;
|
||||
this.page.total = res.data.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selectionList = val
|
||||
this.dialogDetail.aduitIds = [];
|
||||
val.forEach(e => {
|
||||
this.dialogDetail.aduitIds.push(e.id);
|
||||
})
|
||||
},
|
||||
// getSelect(val){
|
||||
// for(let e of val){
|
||||
// this.dialogInfo.reportIds.push(e.id)
|
||||
// }
|
||||
// },
|
||||
getColor(status) {
|
||||
return this.dict.getColor('integralDeclareStatus', status)
|
||||
},
|
||||
onChange(val) {
|
||||
|
||||
},
|
||||
declare(formName) {
|
||||
this.dialogInfo.reportIds = [];
|
||||
for (let e of this.dialogInfo.users) {
|
||||
this.dialogInfo.reportIds.push(e.id)
|
||||
}
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.instance.post("/app/appvillagerintegraldeclare/addOrUpdate", {
|
||||
...this.dialogInfo,
|
||||
bizType: this.bizType
|
||||
}, null).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.dialog.visibleAdd = false;
|
||||
this.getList();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
init(formName) {
|
||||
this.$refs[formName].clearValidate();
|
||||
this.dialogDetail = {
|
||||
doType: '1',
|
||||
ruleId: '',
|
||||
doIntegral: '',
|
||||
remark: '',
|
||||
aduitIds: [],
|
||||
ruleName: ''
|
||||
}
|
||||
this.dialogInfo = {
|
||||
users: [],
|
||||
reportIds: [],
|
||||
declareDescription: "",
|
||||
fileList: [],
|
||||
};
|
||||
this.rulesList = [];
|
||||
},
|
||||
//批量审核
|
||||
batchAduit() {
|
||||
this.isBatch = true;
|
||||
this.rowInfo.status = 0;
|
||||
this.dialog.visibleDetail = true;
|
||||
this.getRules('1')
|
||||
},
|
||||
getRowDetail(row) {
|
||||
this.instance.post(`/app/appvillagerintegraldeclare/queryDetailById`, null, {
|
||||
params: {
|
||||
id: row.id
|
||||
},
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.rowInfo = {...res.data}
|
||||
this.dialog.visibleDetail = true;
|
||||
this.dialogDetail.aduitIds = [];
|
||||
this.dialogDetail.aduitIds.push(row.id);
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
toEdit(row) {
|
||||
this.isBatch = false;
|
||||
this.getRowDetail(row);
|
||||
this.getRules('1')
|
||||
},
|
||||
changeDoType(val) {
|
||||
this.dialogDetail.ruleId = "";
|
||||
this.dialogDetail.ruleName = "";
|
||||
this.dialogDetail.doIntegral = "";
|
||||
this.placeholder = '请输入...';
|
||||
this.$refs.rules.clearValidate();
|
||||
this.getRules(val)
|
||||
},
|
||||
ruleChange(val) {
|
||||
let item = this.rulesList.find(e => e.id == val);
|
||||
this.dialogDetail.doIntegral = '';
|
||||
this.$refs.rules.clearValidate();
|
||||
if (item) {
|
||||
//固定区间
|
||||
this.dialogDetail.ruleName = item.ruleName;
|
||||
if (item.integralValueType == 0) {
|
||||
this.dialogDetail.doIntegral = Math.abs(item.integral);
|
||||
this.integralEdit = true;
|
||||
} else {
|
||||
this.integralEdit = false;
|
||||
if (Math.abs(item.integralEnd) > Math.abs(item.integralStart)) {
|
||||
this.sectionNum.min = Math.abs(item.integralStart);
|
||||
this.sectionNum.max = Math.abs(item.integralEnd);
|
||||
} else {
|
||||
this.sectionNum.max = Math.abs(item.integralStart);
|
||||
this.sectionNum.min = Math.abs(item.integralEnd);
|
||||
}
|
||||
this.placeholder = `${this.sectionNum.min}~${this.sectionNum.max}`
|
||||
}
|
||||
}
|
||||
},
|
||||
//事项查询
|
||||
getRules(integralType) {
|
||||
this.instance.post(`/app/appvillagerintegralrule/list`, null, {
|
||||
params: {
|
||||
integralType,
|
||||
size: 10000000
|
||||
},
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.rulesList = res.data.records.filter(e => e.ruleStatus == 1);
|
||||
}
|
||||
});
|
||||
},
|
||||
remove(id) {
|
||||
this.$confirm("确定删除该公文及其相关的流转信息?").then(() => {
|
||||
this.instance
|
||||
.post(`/app/appofficialdocumentinfo/delete?ids=${id}`)
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success("删除成功!");
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
onReset() {
|
||||
Object.keys(this.search).forEach(e => {
|
||||
this.search[e] = "";
|
||||
});
|
||||
this.search.declareTimeStart = null;
|
||||
this.search.declareTimeEnd = null;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
onAdd() {
|
||||
this.dialog.visibleAdd = true;
|
||||
},
|
||||
|
||||
onConfirm(formName) {
|
||||
this.$refs[formName].validate(v => {
|
||||
if (v) {
|
||||
this.instance.post("/app/appvillagerintegraldeclare/aduit", {
|
||||
...this.dialogDetail,
|
||||
}, null).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.dialog.visibleDetail = false;
|
||||
this.$message.success("提交成功!");
|
||||
this.dialogDetail.aduitIds = [];
|
||||
this.getList();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.pointsDeclaration {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background: #f3f6f9;
|
||||
|
||||
.times_div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.times {
|
||||
display: block;
|
||||
width: 72px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
background: #F5F5F5;
|
||||
border-radius: 2px 0px 0px 2px;
|
||||
border: 1px solid #D0D4DC;
|
||||
font-size: 14px;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.form_content {
|
||||
border-bottom: 1px solid #eee;
|
||||
|
||||
.form_flex {
|
||||
display: flex;
|
||||
|
||||
div {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.form_info {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.form_label {
|
||||
display: inline-block;
|
||||
color: #999;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.form_value {
|
||||
display: inline-block;
|
||||
color: #333;
|
||||
width: calc(100% - 80px);
|
||||
}
|
||||
}
|
||||
|
||||
.form_div {
|
||||
padding-top: 24px;
|
||||
}
|
||||
|
||||
.status-0 {
|
||||
color: #ff8822;
|
||||
}
|
||||
|
||||
.status-1 {
|
||||
color: #2266ff;
|
||||
}
|
||||
|
||||
.status-2 {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,619 @@
|
||||
<template>
|
||||
<section class="pointsDeclaration">
|
||||
<ai-list isTabs>
|
||||
<template slot="content">
|
||||
<ai-search-bar bottomBorder>
|
||||
<template slot="left">
|
||||
<el-button type="primary" icon="iconfont iconAdd" @click="onAdd"
|
||||
v-if="$permissions('app_appvillagerintegraldeclare_edit')">代申报
|
||||
</el-button>
|
||||
<el-button icon="iconfont iconEdit" @click="batchAduit()" :disabled="!selectionList.length"
|
||||
v-if="$permissions('app_appvillagerintegraldeclare_edit')">批量审核
|
||||
</el-button>
|
||||
<ai-select
|
||||
v-model="search.status"
|
||||
@change="page.current = 1, getList()"
|
||||
placeholder="发布状态"
|
||||
:selectList="dict.getDict('integralDeclareStatus')">
|
||||
</ai-select>
|
||||
<div class="times_div">
|
||||
<p class="times">申报时间</p>
|
||||
<el-date-picker
|
||||
v-model="search.declareTimeStart"
|
||||
type="date"
|
||||
size="small"
|
||||
@change="page.current = 1,getList()"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="开始日期">
|
||||
</el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="search.declareTimeEnd"
|
||||
type="date"
|
||||
size="small"
|
||||
@change="page.current = 1,getList()"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<el-input
|
||||
v-model="search.familyName"
|
||||
class="search-input"
|
||||
size="mini"
|
||||
placeholder="申诉人/申诉对象/..."
|
||||
clearable
|
||||
@keyup.enter.native="page.current = 1, getList()"
|
||||
@clear="page.current = 1, getList()"
|
||||
suffix-icon="iconfont iconSearch"/>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="page.total"
|
||||
:current.sync="page.current"
|
||||
:size.sync="page.size"
|
||||
@getList="getList"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column slot="selection" type="selection" width="55" :selectable="row=>row.status==0"/>
|
||||
<el-table-column slot="options" label="操作" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button
|
||||
type="text"
|
||||
:disabled="row.status === '0' || $permissions('app_appvillagerintegraldeclare_edit')"
|
||||
title="编辑"
|
||||
@click="toEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
:disabled="$permissions('app_appvillagerintegraldeclare_detail')"
|
||||
title="详情"
|
||||
@click="toEdit(row)">
|
||||
详情
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
<ai-dialog
|
||||
title="积分代申报"
|
||||
:visible.sync="dialog.visibleAdd"
|
||||
:customFooter="true"
|
||||
:destroyOnClose="true"
|
||||
width="720px"
|
||||
@close="init('ruleForm')">
|
||||
<div class="form_div">
|
||||
<el-form
|
||||
ref="ruleForm"
|
||||
:model="dialogInfo"
|
||||
:rules="formRules"
|
||||
size="small"
|
||||
label-suffix=":"
|
||||
label-width="140px">
|
||||
<el-form-item label="代申报家庭" prop="users">
|
||||
<ai-person-select :customClicker="true" :isMultiple="true" :chooseUserList.sync="dialogInfo.users"
|
||||
:instance="instance" url="/app/appvillagerintegralfamilymember/list">
|
||||
<template name="option" v-slot:option="{ item }">
|
||||
<span class="iconfont iconProlife">{{ item.name }}</span>
|
||||
<ai-id mode="show" :show-eyes="false" :value="item.idNumber"/>
|
||||
</template>
|
||||
</ai-person-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="代申报说明" prop="declareDescription">
|
||||
<el-input type="textarea" :rows="3" placeholder="请输入…" maxlength="100" show-word-limit
|
||||
v-model="dialogInfo.declareDescription"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="照片" prop="fileList">
|
||||
<div class="upload">
|
||||
<ai-uploader :instance="instance" v-model="dialogInfo.fileList" :limit="9"></ai-uploader>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="dialog.visibleAdd=false" size="medium">取消</el-button>
|
||||
<el-button @click="declare('ruleForm')" type="primary" size="medium">提交</el-button>
|
||||
</div>
|
||||
</ai-dialog>
|
||||
<ai-dialog
|
||||
title="申报审核"
|
||||
:visible.sync="dialog.visibleDetail"
|
||||
:customFooter="true"
|
||||
:destroyOnClose="true"
|
||||
width="720px"
|
||||
@close="init('rules')">
|
||||
<div class="form_content" v-if="!isBatch">
|
||||
<div class="form_flex form_info">
|
||||
<div>
|
||||
<span class="form_label">申报人:</span>
|
||||
<span class="form_value">{{ rowInfo.declareName }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="form_label">申报对象:</span>
|
||||
<span class="form_value">{{ rowInfo.declareObjName }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="form_label">户主:</span>
|
||||
<span class="form_value">{{ rowInfo.familyName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_info">
|
||||
<span class="form_label">申报说明:</span>
|
||||
<span class="form_value">{{ rowInfo.declareDescription }}</span>
|
||||
</div>
|
||||
<div class="form_info">
|
||||
<span class="form_label">申报时间:</span>
|
||||
<span class="form_value">{{ rowInfo.declareTime }}</span>
|
||||
</div>
|
||||
<div class="form_info">
|
||||
<span class="form_label">照片:</span>
|
||||
<span class="form_value">
|
||||
<ai-uploader :disabled="true" :instance="instance" v-model="rowInfo.fileList" :limit="9"></ai-uploader>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_div">
|
||||
<el-form
|
||||
ref="rules"
|
||||
:model="dialogDetail"
|
||||
:rules="formRules"
|
||||
size="small"
|
||||
label-suffix=":"
|
||||
v-show="rowInfo.status==0"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="类型" prop="doType">
|
||||
<el-radio-group v-model="dialogDetail.doType" @change="changeDoType">
|
||||
<el-radio label="1">加分</el-radio>
|
||||
<el-radio label="0">扣分</el-radio>
|
||||
<el-radio label="2">拒绝</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="事项" prop="ruleId" v-if='dialogDetail.doType!=2'>
|
||||
<el-select v-model="dialogDetail.ruleId" placeholder="请选择..." @change="ruleChange">
|
||||
<el-option
|
||||
v-for="(item,i) in rulesList"
|
||||
:key="i"
|
||||
:label="item.ruleName"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="积分" prop="doIntegral" v-if='dialogDetail.doType!=2'>
|
||||
<el-col :span="1.5" style="margin-right: 8px;">{{ dialogDetail.doType == 0 ? '减少' : '增加' }}</el-col>
|
||||
<el-col :span="6" style="margin-right: 8px;width:120px;">
|
||||
<el-input type="number" v-model="dialogDetail.doIntegral" :placeholder="placeholder"
|
||||
:disabled="integralEdit"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1" style="margin-right: 8px;">分</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注说明">
|
||||
<el-input type="textarea" :rows="3" maxlength="100" placeholder="请输入…" show-word-limit
|
||||
v-model="dialogDetail.remark"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<ai-wrapper
|
||||
label-width="70px"
|
||||
v-if="rowInfo.status!=0"
|
||||
:columnsNumber="1">
|
||||
<ai-info-item label="类型:"><span
|
||||
:style="{color:colorList[rowInfo.status]}">{{ dict.getLabel('integralDeclareStatus', rowInfo.status) }}</span>
|
||||
</ai-info-item>
|
||||
<ai-info-item label="事项:" v-if='rowInfo.doType!=2'><span>{{ rowInfo.ruleName }}</span></ai-info-item>
|
||||
<ai-info-item label="积分:" v-if='rowInfo.doType!=2'>{{ rowInfo.doType == 0 ? '减少' : '增加' }}<span
|
||||
style="color:#2266FF">{{ Math.abs(rowInfo.doIntegral) }}</span>分
|
||||
</ai-info-item>
|
||||
<ai-info-item label="备注说明:"><span>{{ rowInfo.remark || '-' }}</span></ai-info-item>
|
||||
</ai-wrapper>
|
||||
</div>
|
||||
<div class="dialog-footer" slot="footer" v-if="rowInfo.status==0">
|
||||
<el-button @click="dialog.visibleDetail=false" size="medium">取消</el-button>
|
||||
<el-button @click="onConfirm('rules')" type="primary" size="medium">提交</el-button>
|
||||
</div>
|
||||
</ai-dialog>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "pointsDeclaration",
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
bizType: String,
|
||||
areaId: String
|
||||
},
|
||||
|
||||
data() {
|
||||
var integral = (rule, value, callback) => {
|
||||
if (value) {
|
||||
if (/^[1-9]\d*$/.test(value)) {
|
||||
if (!this.integralEdit) {
|
||||
if (Number(value) >= this.sectionNum.min && Number(value) <= this.sectionNum.max) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error(`请输入${this.sectionNum.min}至${this.sectionNum.max}之间的正整数积分`));
|
||||
}
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
|
||||
} else {
|
||||
callback(new Error('请输入正整数'));
|
||||
}
|
||||
} else {
|
||||
callback(new Error('请输入正整数'));
|
||||
}
|
||||
};
|
||||
return {
|
||||
search: {
|
||||
status: '',
|
||||
familyName: '',
|
||||
declareTimeStart: null,
|
||||
declareTimeEnd: null
|
||||
},
|
||||
page: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0
|
||||
},
|
||||
colConfigs: [
|
||||
{slot: "selection", label: ""},
|
||||
{prop: "declareName", label: "申报人", align: "center"},
|
||||
{prop: "declareObjName", label: "申报对象", align: "center", hide: this.bizType == 1},
|
||||
{
|
||||
prop: "familyName",
|
||||
label: "户主",
|
||||
},
|
||||
{
|
||||
prop: "declareDescription",
|
||||
label: "申诉说明",
|
||||
align: "left",
|
||||
width: 300
|
||||
},
|
||||
{
|
||||
prop: "declareTime",
|
||||
label: "申报时间",
|
||||
align: "left",
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
prop: "declareName",
|
||||
label: "操作人",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
label: "状态",
|
||||
align: "center",
|
||||
render: (h, {row}) => {
|
||||
return h('span', {style: {color: this.dict.getColor('integralDeclareStatus', row.status)}}, this.dict.getLabel('integralDeclareStatus', row.status))
|
||||
},
|
||||
},
|
||||
{slot: "options", label: "操作", align: "center"},
|
||||
],
|
||||
tableData: [],
|
||||
dialog: {
|
||||
visibleAdd: false,
|
||||
visibleDetail: false,
|
||||
title: '积分代申报'
|
||||
},
|
||||
dialogInfo: {
|
||||
users: [],
|
||||
reportIds: [],
|
||||
declareDescription: "",
|
||||
fileList: [],
|
||||
},
|
||||
dialogDetail: {
|
||||
doType: '1',
|
||||
ruleId: '',
|
||||
doIntegral: '',
|
||||
remark: '',
|
||||
aduitIds: [],
|
||||
ruleName: ''
|
||||
},
|
||||
isBatch: false,
|
||||
rulesList: [],
|
||||
rowInfo: {},
|
||||
formRules: {
|
||||
users: [{required: true, message: "请选择人员", trigger: "change"},],
|
||||
declareDescription: [{required: true, message: "代申报说明", trigger: "blur"}],
|
||||
// fileList: [{ required: true, message: "请上传照片", trigger: "blur" },],
|
||||
ruleId: [{required: true, message: "请选择事项", trigger: "blur"}],
|
||||
doIntegral: [{required: true, validator: integral, trigger: "blur"}],
|
||||
doType: [{required: true, message: "请选择类型", trigger: "change"}]
|
||||
},
|
||||
selectionList: [],
|
||||
integralEdit: false,
|
||||
sectionNum: {
|
||||
min: null,
|
||||
max: null
|
||||
},
|
||||
placeholder: '请输入...'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
colorList() {
|
||||
return {
|
||||
'0': '#FF8822',
|
||||
'1': '#2EA222',
|
||||
'2': '#FF4466'
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.dict
|
||||
.load([
|
||||
'integralDeclareStatus',
|
||||
'integralDeclareDoType'
|
||||
]).then(() => {
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/appvillagerintegraldeclare/list`, null, {
|
||||
params: {
|
||||
...this.search,
|
||||
...this.page,
|
||||
bizType: this.bizType,
|
||||
areaId: this.areaId
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records;
|
||||
this.page.total = res.data.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selectionList = val
|
||||
this.dialogDetail.aduitIds = [];
|
||||
val.forEach(e => {
|
||||
this.dialogDetail.aduitIds.push(e.id);
|
||||
})
|
||||
},
|
||||
// getSelect(val){
|
||||
// for(let e of val){
|
||||
// this.dialogInfo.reportIds.push(e.id)
|
||||
// }
|
||||
// },
|
||||
getColor(status) {
|
||||
return this.dict.getColor('integralDeclareStatus', status)
|
||||
},
|
||||
onChange(val) {
|
||||
|
||||
},
|
||||
declare(formName) {
|
||||
this.dialogInfo.reportIds = [];
|
||||
for (let e of this.dialogInfo.users) {
|
||||
this.dialogInfo.reportIds.push(e.id)
|
||||
}
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.instance.post("/app/appvillagerintegraldeclare/addOrUpdate", {
|
||||
...this.dialogInfo,
|
||||
bizType: this.bizType
|
||||
}, null).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.dialog.visibleAdd = false;
|
||||
this.getList();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
init(formName) {
|
||||
this.$refs[formName].clearValidate();
|
||||
this.dialogDetail = {
|
||||
doType: '1',
|
||||
ruleId: '',
|
||||
doIntegral: '',
|
||||
remark: '',
|
||||
aduitIds: [],
|
||||
ruleName: ''
|
||||
}
|
||||
this.dialogInfo = {
|
||||
users: [],
|
||||
reportIds: [],
|
||||
declareDescription: "",
|
||||
fileList: [],
|
||||
};
|
||||
this.rulesList = [];
|
||||
},
|
||||
//批量审核
|
||||
batchAduit() {
|
||||
this.isBatch = true;
|
||||
this.rowInfo.status = 0;
|
||||
this.dialog.visibleDetail = true;
|
||||
this.getRules('1')
|
||||
},
|
||||
getRowDetail(row) {
|
||||
this.instance.post(`/app/appvillagerintegraldeclare/queryDetailById`, null, {
|
||||
params: {
|
||||
id: row.id
|
||||
},
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.rowInfo = {...res.data}
|
||||
this.dialog.visibleDetail = true;
|
||||
this.dialogDetail.aduitIds = [];
|
||||
this.dialogDetail.aduitIds.push(row.id);
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
toEdit(row) {
|
||||
this.isBatch = false;
|
||||
this.getRowDetail(row);
|
||||
this.getRules('1')
|
||||
},
|
||||
changeDoType(val) {
|
||||
this.dialogDetail.ruleId = "";
|
||||
this.dialogDetail.ruleName = "";
|
||||
this.dialogDetail.doIntegral = "";
|
||||
this.placeholder = '请输入...';
|
||||
this.$refs.rules.clearValidate();
|
||||
this.getRules(val)
|
||||
},
|
||||
ruleChange(val) {
|
||||
let item = this.rulesList.find(e => e.id == val);
|
||||
this.dialogDetail.doIntegral = '';
|
||||
this.$refs.rules.clearValidate();
|
||||
if (item) {
|
||||
//固定区间
|
||||
this.dialogDetail.ruleName = item.ruleName;
|
||||
if (item.integralValueType == 0) {
|
||||
this.dialogDetail.doIntegral = Math.abs(item.integral);
|
||||
this.integralEdit = true;
|
||||
} else {
|
||||
this.integralEdit = false;
|
||||
if (Math.abs(item.integralEnd) > Math.abs(item.integralStart)) {
|
||||
this.sectionNum.min = Math.abs(item.integralStart);
|
||||
this.sectionNum.max = Math.abs(item.integralEnd);
|
||||
} else {
|
||||
this.sectionNum.max = Math.abs(item.integralStart);
|
||||
this.sectionNum.min = Math.abs(item.integralEnd);
|
||||
}
|
||||
this.placeholder = `${this.sectionNum.min}~${this.sectionNum.max}`
|
||||
}
|
||||
}
|
||||
},
|
||||
//事项查询
|
||||
getRules(integralType) {
|
||||
this.instance.post(`/app/appvillagerintegralrule/list`, null, {
|
||||
params: {
|
||||
integralType,
|
||||
size: 10000000
|
||||
},
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.rulesList = res.data.records.filter(e => e.ruleStatus == 1);
|
||||
}
|
||||
});
|
||||
},
|
||||
remove(id) {
|
||||
this.$confirm("确定删除该公文及其相关的流转信息?").then(() => {
|
||||
this.instance
|
||||
.post(`/app/appofficialdocumentinfo/delete?ids=${id}`)
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success("删除成功!");
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
onReset() {
|
||||
Object.keys(this.search).forEach(e => {
|
||||
this.search[e] = "";
|
||||
});
|
||||
this.search.declareTimeStart = null;
|
||||
this.search.declareTimeEnd = null;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
onAdd() {
|
||||
this.dialog.visibleAdd = true;
|
||||
},
|
||||
|
||||
onConfirm(formName) {
|
||||
this.$refs[formName].validate(v => {
|
||||
if (v) {
|
||||
this.instance.post("/app/appvillagerintegraldeclare/aduit", {
|
||||
...this.dialogDetail,
|
||||
}, null).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.dialog.visibleDetail = false;
|
||||
this.$message.success("提交成功!");
|
||||
this.dialogDetail.aduitIds = [];
|
||||
this.getList();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.pointsDeclaration {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background: #f3f6f9;
|
||||
|
||||
.times_div {
|
||||
.times {
|
||||
display: block;
|
||||
width: 72px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
background: #F5F5F5;
|
||||
border-radius: 2px 0px 0px 2px;
|
||||
border: 1px solid #D0D4DC;
|
||||
font-size: 14px;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.form_content {
|
||||
border-bottom: 1px solid #eee;
|
||||
|
||||
.form_flex {
|
||||
display: flex;
|
||||
|
||||
div {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.form_info {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.form_label {
|
||||
display: inline-block;
|
||||
color: #999;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.form_value {
|
||||
display: inline-block;
|
||||
color: #333;
|
||||
width: calc(100% - 80px);
|
||||
}
|
||||
}
|
||||
|
||||
.form_div {
|
||||
padding-top: 24px;
|
||||
}
|
||||
|
||||
.status-0 {
|
||||
color: #ff8822;
|
||||
}
|
||||
|
||||
.status-1 {
|
||||
color: #2266ff;
|
||||
}
|
||||
|
||||
.status-2 {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
283
project/xiushan/apps/creditScore/scoreManage/pointsDetails.vue
Normal file
283
project/xiushan/apps/creditScore/scoreManage/pointsDetails.vue
Normal file
@@ -0,0 +1,283 @@
|
||||
<template>
|
||||
<section class="pointsDetails">
|
||||
<ai-list isTabs>
|
||||
<template slot="content">
|
||||
<ai-search-bar bottomBorder>
|
||||
<template slot="left">
|
||||
<el-date-picker size="small" v-model="searchDotime" type="daterange" range-separator="至" @change="timeChange"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<el-input
|
||||
v-model="search.familyName"
|
||||
class="search-input"
|
||||
size="small"
|
||||
placeholder="对象、户主、事件类型"
|
||||
clearable
|
||||
@keyup.enter.native="search.current = 1, getList()"
|
||||
@clear="search.current = 1, getList()"
|
||||
suffix-icon="iconfont iconSearch" />
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
ref="aitableex"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
<el-table-column slot="changeIntegral" label="积分" align= "center">
|
||||
<template slot-scope="{ row }">
|
||||
<span>{{row.changeIntegral > 0 ? '+' : ''}}{{row.changeIntegral}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column slot="doType" label="类型" align= "center">
|
||||
<template slot-scope="{ row }">
|
||||
<span>{{ dict.getLabel('integralDetailType', row.bizType) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column slot="options" label="操作" align="center" fixed="right" width="120">
|
||||
<template slot-scope="{ row }">
|
||||
<el-button
|
||||
type="text"
|
||||
title="详情"
|
||||
:disabled="!$permissions('app_appvillagerintegraldetail_detail')"
|
||||
@click="viewItem(row)">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
<ai-dialog
|
||||
title="详情"
|
||||
:visible.sync="dialog.visible"
|
||||
:customFooter="true"
|
||||
:destroyOnClose="true"
|
||||
width="720px"
|
||||
>
|
||||
<div class="form_content">
|
||||
<div class="form_info">
|
||||
<span class="form_label">户主:</span>
|
||||
<span class="form_value">{{dialogInfo.familyName}}</span>
|
||||
</div>
|
||||
<div class="form_info">
|
||||
<span class="form_label">事项:</span>
|
||||
<span class="form_value">{{dialogInfo.ruleName}}</span>
|
||||
</div>
|
||||
<div class="form_flex form_info">
|
||||
<div>
|
||||
<span class="form_label">积分:</span>
|
||||
<span class="form_value">{{dialogInfo.changeIntegral >= 0 ? '增加' : '减少'}}<span style="color:#2266FF">{{Math.abs(dialogInfo.changeIntegral)}}</span>分</span>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<span class="form_label">途径:</span>
|
||||
<span class="form_value">{{$dict.getLabel("integralDetailBizType", dialogInfo.bizType)}}</span>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- <div class="form_info">
|
||||
<span class="form_label">{{dialogInfo.bizType == 1 ? '申诉' : '申报'}}说明:</span>
|
||||
<span
|
||||
class="form_value"
|
||||
>{{dialogInfo.description}}</span>
|
||||
</div>
|
||||
<div class="form_info">
|
||||
<span class="form_label">照片:</span>
|
||||
<span class="form_value" v-if="dialogInfo.fileList && dialogInfo.fileList.length">
|
||||
<ai-uploader :disabled="true" :instance="instance" v-model="dialogInfo.fileList" :limit="9" ></ai-uploader>
|
||||
</span>
|
||||
<span class="form_value" v-else>-</span>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="dialog.visible=false" size="medium">关闭</el-button>
|
||||
</div>
|
||||
</ai-dialog>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "pointsDeclaration",
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
areaId:String
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
searchDotime: [],
|
||||
search: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
familyName: '',
|
||||
doTimeStart: null,
|
||||
doTimeEnd: null
|
||||
},
|
||||
total: 10,
|
||||
colConfigs: [
|
||||
{ prop: "residentName", label: "对象", width:160 },
|
||||
{ prop: "familyName", label: "户主", align: "center", width:160 },
|
||||
{
|
||||
prop: "ruleName",
|
||||
label: "事件类型",
|
||||
"show-overflow-tooltip": true,
|
||||
width:420
|
||||
},
|
||||
{
|
||||
prop: "doTime",
|
||||
label: "时间",
|
||||
width:200
|
||||
},
|
||||
// {
|
||||
// prop: "doType",
|
||||
// label: "类型",
|
||||
// align: "center",
|
||||
// width: 100,
|
||||
// render: (h, params) => {
|
||||
// return h(
|
||||
// "span",
|
||||
// {
|
||||
// class: "status-" + params.row.doType,
|
||||
// },
|
||||
// this.$dict.getLabel("integralIntegralType", params.row.doType)
|
||||
// );
|
||||
// },
|
||||
// },
|
||||
{ slot: "doType", label: "类型", width: 100},
|
||||
{ slot: "changeIntegral", label: "积分", width: 100},
|
||||
// {
|
||||
// prop: "bizType",
|
||||
// label: "途径",
|
||||
// align: "center",
|
||||
// width: 100,
|
||||
// formart: (bizType) =>
|
||||
// this.$dict.getLabel("integralDetailBizType", bizType) || '-',
|
||||
// },
|
||||
{ slot: "options", label: "操作", align: "center" },
|
||||
],
|
||||
tableData: [],
|
||||
dialog: {
|
||||
visible: false,
|
||||
},
|
||||
dialogInfo: {},
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$dict
|
||||
.load([
|
||||
"integralDeclareDoType",
|
||||
"integralDetailType",
|
||||
"integralDetailBizType"
|
||||
])
|
||||
.then(() => {
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegraldetail/list`, null, {
|
||||
params: {
|
||||
...this.search,
|
||||
areaId: this.areaId,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records;
|
||||
this.total = res.data.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
timeChange() {
|
||||
if(this.searchDotime) {
|
||||
this.search.doTimeStart = this.searchDotime[0]
|
||||
this.search.doTimeEnd = this.searchDotime[1]
|
||||
}else {
|
||||
this.search.doTimeStart = null
|
||||
this.search.doTimeEnd = null
|
||||
}
|
||||
this.search.current = 1
|
||||
this.getList()
|
||||
},
|
||||
|
||||
viewItem(row) {
|
||||
this.dialog.visible = true
|
||||
this.instance.post(`/app/appvillagerintegraldetail/queryDetailById?id=${row.id}`, null, {}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.dialogInfo = res.data
|
||||
console.log(this.dialogInfo)
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onReset() {
|
||||
this.search.current = 1
|
||||
this.search.doTimeStart = null
|
||||
this.search.doTimeEnd = null
|
||||
this.search.familyName = ''
|
||||
this.searchDotime = []
|
||||
this.getList();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.pointsDetails {
|
||||
height: 100%;
|
||||
background: #f3f6f9;
|
||||
overflow: auto;
|
||||
.form_content {
|
||||
.form_flex {
|
||||
display: flex;
|
||||
div {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.form_info {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.form_label {
|
||||
display: inline-block;
|
||||
color: #999;
|
||||
vertical-align: top;
|
||||
width: 70px;
|
||||
text-align: right;
|
||||
}
|
||||
.form_value {
|
||||
display: inline-block;
|
||||
color: #333;
|
||||
width: calc(100% - 70px);
|
||||
// img {
|
||||
// width: 100px;
|
||||
// height: 100px;
|
||||
// margin: 0 8px 8px 0;
|
||||
// }
|
||||
}
|
||||
}
|
||||
.form_div {
|
||||
padding-top: 24px;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
.status-0 {
|
||||
color: #FF4466;
|
||||
}
|
||||
|
||||
.status-1 {
|
||||
color: #2EA222;
|
||||
}
|
||||
|
||||
.status-2 {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
176
project/xiushan/apps/creditScore/scoreManage/scoreChange.vue
Normal file
176
project/xiushan/apps/creditScore/scoreManage/scoreChange.vue
Normal file
@@ -0,0 +1,176 @@
|
||||
<template>
|
||||
<div class="scoreChange">
|
||||
<ai-list isTabs>
|
||||
<template slot="content">
|
||||
<ai-search-bar bottomBorder>
|
||||
<template slot="left">
|
||||
<el-button type="primary" icon="iconfont iconAdd" @click="dialog=true"
|
||||
:disabled="!permissions('app_appvillagerintegraldetail_change')">添加
|
||||
</el-button>
|
||||
<ai-import :instance="instance" :dict="dict" name="积分调整" type="appvillagerintegraldetail"
|
||||
v-if="permissions('app_appvillagerintegraldetail_change')" @success="getList"/>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="page.total"
|
||||
:current.sync="page.current"
|
||||
:size.sync="page.size"
|
||||
@getList="getList">
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
<ai-dialog
|
||||
title="添加积分调整"
|
||||
:visible.sync="dialog"
|
||||
:destroyOnClose="true"
|
||||
width="720px"
|
||||
@onConfirm="onConfirm"
|
||||
@closed="form={}">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="选择人员" prop="residentId">
|
||||
<ai-person-select :instance="instance" :customClicker="true"
|
||||
:url="'/app/appresident/list?auditType=1areaId=' + user.info.areaId"
|
||||
:isMultiple="false" dialogTitle="选择" @selectPerson="selectPerson">
|
||||
<template name="option" v-slot:option="{ item }">
|
||||
<span class="iconfont iconProlife">{{ item.name }}</span>
|
||||
<ai-id mode="show" :show-eyes="false" :value="item.idNumber"/>
|
||||
</template>
|
||||
</ai-person-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="调整说明" prop="description">
|
||||
<el-input v-model.trim="form.description" placeholder="请输入..." type="textarea" :rows="4" show-word-limit
|
||||
maxlength="100"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="doType">
|
||||
<el-radio-group v-model="form.doType">
|
||||
<el-radio label="0">加分</el-radio>
|
||||
<el-radio label="1">减分</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="积分" prop="changeIntegral">
|
||||
<el-input v-model.trim.num="form.changeIntegral" placeholder="请输入正整数" size="small"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ai-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex"
|
||||
|
||||
export default {
|
||||
name: "scoreChange",
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
areaId: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
page: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 10
|
||||
},
|
||||
form: {},
|
||||
dialog: false,
|
||||
personList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(["user"]),
|
||||
rules() {
|
||||
return {
|
||||
residentId: [{required: true, message: '请选择人员', trigger: 'blur'},],
|
||||
description: [{required: true, message: '请输入调整说明', trigger: 'blur'},],
|
||||
doType: [{required: true, message: '请输入调整说明', trigger: 'change'},],
|
||||
changeIntegral: [
|
||||
{
|
||||
required: true, validator: (rule, value, callback) => {
|
||||
if (!/^[1-9]\d*$/.test(value)) {
|
||||
callback(new Error('请输入正整数'))
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
},],
|
||||
}
|
||||
},
|
||||
colConfigs() {
|
||||
return [
|
||||
{prop: "residentName", label: "姓名"},
|
||||
{prop: "description", label: "调整说明"},
|
||||
{
|
||||
prop: "changeIntegral", label: "类型", align: "center",
|
||||
render: (h, {row}) => [< span> {+row.changeIntegral > 0 ? "加分" : '减分'
|
||||
} < /span>]
|
||||
},
|
||||
{
|
||||
prop: "changeIntegral",
|
||||
label: "积分",
|
||||
align: "center",
|
||||
render: (h, {row}) => [
|
||||
<span>{row.changeIntegral > 0 ? `+${row.changeIntegral}` : `${row.changeIntegral}`}</span>]
|
||||
},
|
||||
{prop: "doTime", label: "操作时间"},
|
||||
{prop: "declareObjName", label: "操作人", align: "center"},
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
selectPerson(val) {
|
||||
if (val) {
|
||||
this.form.residentId = val.id
|
||||
this.personList = [{...val}]
|
||||
} else {
|
||||
this.form.residentId = ""
|
||||
this.personList = []
|
||||
}
|
||||
},
|
||||
onConfirm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
this.instance.post(`/app/appvillagerintegraldetail/changeIntegral`, {
|
||||
...this.form,
|
||||
changeIntegral: this.form.doType == 0 ? `+${this.form.changeIntegral}` : `-${this.form.changeIntegral}`
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success("添加成功")
|
||||
this.dialog = false
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
this.instance.post(`/app/appvillagerintegraldetail/list`, null, {
|
||||
params: {
|
||||
...this.page,
|
||||
areaId: this.areaId,
|
||||
doType: 2
|
||||
}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.tableData = res.data.records
|
||||
this.page.total = res.data.total
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.scoreChange {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,408 @@
|
||||
<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="个人姓名"
|
||||
@keyup.enter.native="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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex';
|
||||
import detail from './detail'
|
||||
|
||||
export default {
|
||||
name: 'AppScorePersonal',
|
||||
label: "个人积分",
|
||||
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'}]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
</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>
|
||||
205
project/xiushan/apps/creditScore/scorePersonal/detail.vue
Normal file
205
project/xiushan/apps/creditScore/scorePersonal/detail.vue
Normal file
@@ -0,0 +1,205 @@
|
||||
<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>{{ info.name }}</span>
|
||||
</div>
|
||||
<div class="detail-info__item">
|
||||
<h2>个人积分</h2>
|
||||
<span style="color: #2266FF;">{{ info.personalIntegral || 0 }}</span>
|
||||
</div>
|
||||
<div class="detail-info__item">
|
||||
<h2>已用积分</h2>
|
||||
<span style="color: #2266FF;">{{ info.personalUsedIntegral || 0 }}</span>
|
||||
</div>
|
||||
</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-option
|
||||
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">
|
||||
</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
|
||||
},
|
||||
info: {},
|
||||
doType: '',
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
|
||||
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))
|
||||
}
|
||||
},
|
||||
{
|
||||
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;
|
||||
|
||||
::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>
|
||||
424
project/xiushan/apps/creditScore/scoreRules/AppScoreRules.vue
Normal file
424
project/xiushan/apps/creditScore/scoreRules/AppScoreRules.vue
Normal file
@@ -0,0 +1,424 @@
|
||||
<template>
|
||||
<section class="AppScoreRules">
|
||||
<ai-list v-if="$permissions('app_appvillagerintegralrule_detail')">
|
||||
<template slot="title">
|
||||
<ai-title title="积分规则" isShowBottomBorder></ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-search-bar bottomBorder>
|
||||
<template slot="left">
|
||||
<ai-select
|
||||
v-model="search.classification"
|
||||
@change="search.current = 1, getList()"
|
||||
placeholder="请选择分类"
|
||||
:selectList="dict.getDict('atWillReportType')">
|
||||
</ai-select>
|
||||
<ai-select
|
||||
v-model="search.integralType"
|
||||
@change="search.current = 1, getList()"
|
||||
placeholder="请选择类型"
|
||||
:selectList="dict.getDict('integralIntegralType')">
|
||||
</ai-select>
|
||||
<ai-select
|
||||
v-model="search.ruleStatus"
|
||||
@change="search.current = 1, getList()"
|
||||
placeholder="请选择状态"
|
||||
:selectList="dict.getDict('integralRuleStatus')">
|
||||
</ai-select>
|
||||
</template>
|
||||
<template slot="right">
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-search-bar style="margin-top: 16px;">
|
||||
<template #left>
|
||||
<el-button type="primary" icon="iconfont iconAdd" @click="addRule">添加</el-button>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
ref="aitableex"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
<el-table-column slot="integral" label="分值" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<span
|
||||
v-if="row.integralValueType == 1">
|
||||
{{ row.integralStart > 0 ? '+' + row.integralStart : row.integralStart }} ~ {{ row.integralEnd > 0 ? '+' + row.integralEnd : row.integralEnd }}
|
||||
</span>
|
||||
<span v-else>{{ row.integral > 0 ? '+' : '' }}{{ row.integral }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column slot="options" label="操作" align="center" fixed="right" width="200">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button type="text" :disabled="!$permissions('app_appvillagerintegralrule_edit')" @click="changeStatus(row.id, 0)" v-if="row.ruleStatus == 1">停用</el-button>
|
||||
<el-button type="text" :disabled="!$permissions('app_appvillagerintegralrule_edit')" @click="changeStatus(row.id, 1)" v-else >启用</el-button>
|
||||
<el-button type="text" :disabled="!$permissions('app_appvillagerintegralrule_edit')" @click="toEdit(row)">编辑</el-button>
|
||||
<el-button type="text" :disabled="!$permissions('app_appvillagerintegralrule_del')" @click="remove(row.id)">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
|
||||
<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="100px">
|
||||
<el-form-item label="类别" prop="classification">
|
||||
<ai-select
|
||||
size="small"
|
||||
v-model="dialogInfo.classification"
|
||||
placeholder="请选择..."
|
||||
:selectList="dict.getDict('atWillReportType')">
|
||||
</ai-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="事项" prop="ruleName">
|
||||
<el-input placeholder="请输入…" v-model="dialogInfo.ruleName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="规则说明" prop="ruleDescription">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
placeholder="请输入…"
|
||||
v-model="dialogInfo.ruleDescription">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="integralType">
|
||||
<el-radio-group v-model="dialogInfo.integralType">
|
||||
<el-radio label="1">加分</el-radio>
|
||||
<el-radio label="0">扣分</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="分值" prop="integralValueType">
|
||||
<el-radio-group v-model="dialogInfo.integralValueType" @change="numTypeChange">
|
||||
<el-radio label="0">固定分值</el-radio>
|
||||
<el-radio label="1">区间分值</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="积分" required v-if="dialogInfo.integralValueType == '1'">
|
||||
<el-col :span="7" style="width: 30%;">
|
||||
<el-form-item prop="integralStart">
|
||||
<el-input placeholder="请输入整数" v-model="dialogInfo.integralStart"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="line" :span="1" style="width: 4%;text-align:center;">-</el-col>
|
||||
<el-col :span="7" style="width: 30%;">
|
||||
<el-form-item prop="integralEnd">
|
||||
<el-input placeholder="请输入整数" v-model="dialogInfo.integralEnd"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="line" :span="9" style="width: 36%;"></el-col>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="积分" required v-if="dialogInfo.integralValueType == '0'">
|
||||
<el-form-item prop="integral">
|
||||
<el-input placeholder="请输入自然数" v-model="dialogInfo.integral"></el-input>
|
||||
</el-form-item>
|
||||
</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>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "AppScoreRules",
|
||||
label: "积分规则",
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
},
|
||||
|
||||
data() {
|
||||
var integralPass = (rule, value, callback) => {
|
||||
if (value) {
|
||||
if ((/(^[0-9]\d*$)/.test(value))) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("请输入自然数"));
|
||||
}
|
||||
} else {
|
||||
callback(new Error("请输入积分"));
|
||||
}
|
||||
};
|
||||
var integralStartPass = (rule, value, callback) => {
|
||||
if (value) {
|
||||
if ((/(^[1-9]\d*$)/.test(value))) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("请输入整数积分"));
|
||||
}
|
||||
} else {
|
||||
callback(new Error("请输入积分"));
|
||||
}
|
||||
};
|
||||
var integralEndPass = (rule, value, callback) => {
|
||||
if (value) {
|
||||
if ((/(^[1-9]\d*$)/.test(value))) {
|
||||
if (Number(value) < Number(this.dialogInfo.integralStart)) {
|
||||
callback(new Error("请输入大于前面数字的积分"));
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
} else {
|
||||
callback(new Error("请输入整数积分"));
|
||||
}
|
||||
} else {
|
||||
callback(new Error("请输入积分"));
|
||||
}
|
||||
};
|
||||
return {
|
||||
search: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
classification: "",
|
||||
integralType: "",
|
||||
ruleStatus: "",
|
||||
},
|
||||
total: 10,
|
||||
colConfigs: [
|
||||
{
|
||||
prop: "classification", label: "类型", width: 168,
|
||||
formart: (classification) =>
|
||||
this.dict.getLabel("atWillReportType", classification),
|
||||
},
|
||||
{prop: "ruleName", label: "事项", "show-overflow-tooltip": true, width: 260},
|
||||
{prop: "ruleDescription", label: "规则说明", width: 390},
|
||||
{
|
||||
prop: "integralType",
|
||||
label: "类型",
|
||||
width: 60,
|
||||
formart: (integralType) =>
|
||||
this.dict.getLabel("integralIntegralType", integralType),
|
||||
},
|
||||
{slot: "integral", label: "分值", width: 70},
|
||||
{prop: "doTime", label: "最后编辑时间", width: 160},
|
||||
{prop: "doUserName", label: "操作人", width: 120},
|
||||
{
|
||||
prop: "ruleStatus",
|
||||
label: "状态",
|
||||
align: "center",
|
||||
width: 96,
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"span",
|
||||
{
|
||||
class: "status-" + params.row.ruleStatus,
|
||||
},
|
||||
this.dict.getLabel("integralRuleStatus", params.row.ruleStatus)
|
||||
);
|
||||
},
|
||||
},
|
||||
{slot: "options", label: "操作", align: "center"},
|
||||
],
|
||||
tableData: [],
|
||||
|
||||
dialog: {
|
||||
title: "",
|
||||
visible: false,
|
||||
},
|
||||
dialogInfo: {
|
||||
classification: "",
|
||||
ruleName: "",
|
||||
ruleDescription: "",
|
||||
integralType: '1',
|
||||
integralValueType: '0',
|
||||
integral: "",
|
||||
// integralStart: "",
|
||||
// integralEnd: "",
|
||||
doTime: '',
|
||||
id: '',
|
||||
doUserId: '',
|
||||
doUserName: '',
|
||||
},
|
||||
formRules: {
|
||||
classification: [
|
||||
{required: true, message: "请选择类型", trigger: "change"},
|
||||
],
|
||||
ruleName: [{required: true, message: "请输入事项", trigger: "blur"}],
|
||||
ruleDescription: [
|
||||
{required: true, message: "请输入规则说明", trigger: "blur"},
|
||||
],
|
||||
integralType: [
|
||||
{required: true, message: "请选择类型", trigger: "change"},
|
||||
],
|
||||
integralValueType: [
|
||||
{required: true, message: "请选择分值类型", trigger: "change"},
|
||||
],
|
||||
integral: [
|
||||
{required: true, validator: integralPass, trigger: "change"},
|
||||
],
|
||||
integralStart: [
|
||||
{required: true, validator: integralStartPass, trigger: "change"},
|
||||
],
|
||||
integralEnd: [
|
||||
{required: true, validator: integralEndPass, trigger: "change"},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
this.dict.load(["classification", "integralIntegralType", "integralRuleStatus", 'atWillReportType']).then(() => {
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralrule/list`, null, {
|
||||
params: {
|
||||
...this.search,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records;
|
||||
this.total = res.data.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
toEdit(row) {
|
||||
this.dialog.title = "编辑积分规则";
|
||||
this.dialog.visible = true;
|
||||
this.dialogInfo = {...row}
|
||||
this.dialogInfo.integralStart = Math.abs(this.dialogInfo.integralStart)
|
||||
this.dialogInfo.integralEnd = Math.abs(this.dialogInfo.integralEnd)
|
||||
this.dialogInfo.integral = Math.abs(this.dialogInfo.integral)
|
||||
},
|
||||
|
||||
remove(id) {
|
||||
this.$confirm("删除后不可恢复,是否要删除该事项?", {
|
||||
type: 'error'
|
||||
}).then(() => {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralrule/delete?ids=${id}`)
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success("删除成功!");
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
changeStatus(id, status) {
|
||||
var text = status == 1 ? '启用' : '停用'
|
||||
this.$confirm(`确定${text}该条规则?`).then(() => {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralrule/enableOrDisable?id=${id}`)
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(`${text}成功!`)
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onReset() {
|
||||
this.search.current = 1
|
||||
this.search.classification = ""
|
||||
this.search.integralType = ""
|
||||
this.search.ruleStatus = ""
|
||||
this.getList();
|
||||
},
|
||||
|
||||
onAdd() {
|
||||
this.$emit("change", {
|
||||
type: "add",
|
||||
});
|
||||
},
|
||||
|
||||
addRule() {
|
||||
this.dialog.title = "添加积分规则";
|
||||
this.dialog.visible = true;
|
||||
},
|
||||
|
||||
onConfirm(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralrule/addOrUpdate`, this.dialogInfo)
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(`${this.dialogInfo.id ? '编辑成功' : '添加成功'}`)
|
||||
this.onReset()
|
||||
this.onCancel();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
this.dialog.visible = false;
|
||||
},
|
||||
|
||||
numTypeChange() {
|
||||
// this.dialogInfo.integra = "";
|
||||
// this.dialogInfo.integralStart = "";
|
||||
// this.dialogInfo.integralEnd = "";
|
||||
},
|
||||
|
||||
init(formName) {
|
||||
this.$refs[formName].clearValidate();
|
||||
Object.keys(this.dialogInfo).forEach((e) => {
|
||||
this.dialogInfo[e] = "";
|
||||
});
|
||||
this.dialogInfo.integralType = '1'
|
||||
this.dialogInfo.integralValueType = '0'
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.AppScoreRules {
|
||||
height: 100%;
|
||||
background: #f3f6f9;
|
||||
|
||||
.cur-p {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
::v-deep .ai-list__content--right {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.status-0 {
|
||||
color: #ff4466;
|
||||
}
|
||||
|
||||
.status-1 {
|
||||
color: #2ea222;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,118 @@
|
||||
<template>
|
||||
<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>
|
||||
</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" />
|
||||
</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"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import orderManagement from './orderManagement'
|
||||
import goodsManagement from './goodsManagement'
|
||||
import storeManagement from './storeManagement'
|
||||
import addOrderDetail from './components/addOrder'
|
||||
import addGoods from './components/addGoods'
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "AppScoreSupermarket",
|
||||
label: "积分超市",
|
||||
components: {orderManagement, goodsManagement, storeManagement, addOrderDetail, addGoods},
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function
|
||||
},
|
||||
|
||||
computed: {
|
||||
tabs() {
|
||||
// .filter(item => {
|
||||
// return this.$permissions(item.permission)
|
||||
// })
|
||||
|
||||
return [
|
||||
{
|
||||
label: "订单管理",
|
||||
name: "orderManagement",
|
||||
comp: orderManagement,
|
||||
detail: addOrderDetail,
|
||||
permission: "app_apppartyfee_record"
|
||||
},
|
||||
{
|
||||
label: "商品管理",
|
||||
name: "goodsManagement",
|
||||
comp: goodsManagement,
|
||||
detail: addGoods,
|
||||
permission: "app_apppartyfee_config"
|
||||
},
|
||||
{
|
||||
label: "店铺管理",
|
||||
name: "storeManagement",
|
||||
comp: storeManagement,
|
||||
detail: '',
|
||||
permission: "app_apppartyfee_statistics"
|
||||
},
|
||||
]
|
||||
},
|
||||
...mapState(['user']),
|
||||
currDet() {
|
||||
return this.tabs[Number(this.currIndex)].detail;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.areaId = this.user.info.areaId;
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: "orderManagement",
|
||||
currIndex: 0,
|
||||
areaId: '',
|
||||
detailShow: false,
|
||||
info: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
this.detailShow = false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs[this.tabs[Number(this.currIndex)].name][0].getList();
|
||||
})
|
||||
},
|
||||
showDetail(obj) {
|
||||
this.info = {...obj};
|
||||
this.detailShow = true;
|
||||
},
|
||||
changeArea() {
|
||||
this.$nextTick(() => {
|
||||
if (this.currIndex == 0) this.$refs[this.tabs[Number(this.currIndex)].name][0].getShopList();
|
||||
if (this.currIndex == 1) this.$refs[this.tabs[Number(this.currIndex)].name][0].updateList();
|
||||
this.$refs[this.tabs[Number(this.currIndex)].name][0].getList();
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.AppScoreSupermarket {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,366 @@
|
||||
<template>
|
||||
<section class="add_order">
|
||||
<ai-detail>
|
||||
<template slot="title">
|
||||
<ai-title :title="title" isShowBack :isShowBottomBorder="true" @onBackClick="$emit('goBack')"></ai-title>
|
||||
</template>
|
||||
<template slot="content" v-if="!isEdit">
|
||||
<ai-card title="商品信息">
|
||||
<template #content>
|
||||
<div class="form_div">
|
||||
<el-form
|
||||
ref="rules"
|
||||
:model="forms"
|
||||
:rules="formRules"
|
||||
size="small"
|
||||
label-suffix=":"
|
||||
label-width="100px">
|
||||
<el-form-item label="店铺名称" prop="shopId">
|
||||
<el-select
|
||||
v-model="forms.shopId"
|
||||
placeholder="请选择..."
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="(item, i) in shopList"
|
||||
:key="i"
|
||||
:label="item.shopName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类型" prop="merchandiseType">
|
||||
<el-select
|
||||
v-model="forms.merchandiseType"
|
||||
placeholder="请选择..."
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="(item, i) in dict.getDict('integralMerchandiseType')"
|
||||
:key="i"
|
||||
:label="item.dictName"
|
||||
:value="item.dictValue">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称" prop="merchandiseName">
|
||||
<el-input
|
||||
v-model="forms.merchandiseName"
|
||||
placeholder="请输入..."
|
||||
maxlength="100"
|
||||
show-word-limit>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<div class="above">
|
||||
<div class="left">
|
||||
<el-form-item label="单价" prop="costIntegral">
|
||||
<el-input
|
||||
v-model="forms.costIntegral"
|
||||
placeholder="请输入..."
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="right">
|
||||
<el-form-item label="库存" prop="inventoryNumber">
|
||||
<el-input
|
||||
v-model="forms.inventoryNumber"
|
||||
placeholder="请输入...">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="forms.status">
|
||||
<el-radio label="1">上架中</el-radio>
|
||||
<el-radio label="0">已下架</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品图片" prop="fileList" ref="fileList">
|
||||
<div class="upload">
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
@change="changeFile"
|
||||
v-model="forms.fileList"
|
||||
:limit="9">
|
||||
</ai-uploader>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品详情" prop="description">
|
||||
<el-input
|
||||
v-model="forms.description"
|
||||
type="textarea"
|
||||
:rows="5"
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
placeholder="请输入...">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
<template slot="content" v-if="isEdit">
|
||||
<ai-card title="商品信息">
|
||||
<template #content>
|
||||
<div class="info">
|
||||
<ai-wrapper label-width="70px" :columnsNumber="1">
|
||||
<ai-info-item label="店铺名称"><span>{{ forms.shopName }}</span></ai-info-item>
|
||||
<ai-info-item label="商品类型"
|
||||
><span>{{
|
||||
dict.getLabel("integralMerchandiseType", forms.merchandiseType)
|
||||
}}</span></ai-info-item
|
||||
>
|
||||
<ai-info-item label="商品名称"
|
||||
><span>{{ forms.merchandiseName }}</span></ai-info-item
|
||||
>
|
||||
</ai-wrapper>
|
||||
<ai-wrapper label-width="70px" :columnsNumber="2">
|
||||
<ai-info-item label="单价"
|
||||
><span>{{ forms.costIntegral + "积分" }}</span></ai-info-item
|
||||
>
|
||||
<ai-info-item label="库存"
|
||||
><span>{{ forms.inventoryNumber }}</span></ai-info-item
|
||||
>
|
||||
<ai-info-item label="销量"
|
||||
><span>{{ forms.saleNumber || "0" }}</span></ai-info-item
|
||||
>
|
||||
</ai-wrapper>
|
||||
<ai-wrapper label-width="70px" :columnsNumber="1">
|
||||
<ai-info-item label="状态"
|
||||
><span
|
||||
:style="{
|
||||
color: dict.getColor(
|
||||
'integralMerchandiseStatus',
|
||||
forms.status
|
||||
),
|
||||
}"
|
||||
>{{
|
||||
dict.getLabel("integralMerchandiseStatus", forms.status)
|
||||
}}</span
|
||||
></ai-info-item
|
||||
>
|
||||
<ai-info-item label="商品图片">
|
||||
<ai-uploader
|
||||
:disabled="true"
|
||||
:instance="instance"
|
||||
v-model="forms.fileList"
|
||||
:limit="9"
|
||||
></ai-uploader>
|
||||
</ai-info-item>
|
||||
<ai-info-item label="商品详情"
|
||||
><span>{{ forms.description }}</span></ai-info-item
|
||||
>
|
||||
</ai-wrapper>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
<template slot="footer" v-if="!isEdit">
|
||||
<el-button @click="$emit('goBack')" style="width: 120px">取消</el-button>
|
||||
<el-button type="primary" @click="save('rules')" style="width: 120px">提 交</el-button>
|
||||
</template>
|
||||
</ai-detail>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex";
|
||||
export default {
|
||||
name: "addGoods",
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
info: Object,
|
||||
areaId: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
forms: {
|
||||
shopId: "",
|
||||
merchandiseType: "",
|
||||
merchandiseName: "",
|
||||
costIntegral: "",
|
||||
inventoryNumber: "",
|
||||
status: "",
|
||||
fileList: [],
|
||||
description: "",
|
||||
},
|
||||
shopList: [],
|
||||
title: "添加商品",
|
||||
showEdit: false,
|
||||
isEdit: false,
|
||||
detailInfo: {},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(["user"]),
|
||||
formRules() {
|
||||
var integral = (rule, value, callback) => {
|
||||
if (value) {
|
||||
if (/^[1-9]\d*$/.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("请输入正整数"));
|
||||
}
|
||||
} else {
|
||||
callback(new Error("请输入单价"));
|
||||
}
|
||||
};
|
||||
var integral2 = (rule, value, callback) => {
|
||||
if (value) {
|
||||
if (/^[1-9]\d*$/.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("请输入正整数"));
|
||||
}
|
||||
} else {
|
||||
callback(new Error("请输入库存"));
|
||||
}
|
||||
};
|
||||
return {
|
||||
shopId: [{ required: true, message: "请选择店铺", trigger: "change" }],
|
||||
merchandiseType: [
|
||||
{ required: true, message: "请选择商品类型", trigger: "change" },
|
||||
],
|
||||
merchandiseName: [
|
||||
{ required: true, message: "请输入商品名称", trigger: "blur" },
|
||||
],
|
||||
costIntegral: [
|
||||
{ required: true, validator: integral, trigger: "blur" },
|
||||
],
|
||||
inventoryNumber: [
|
||||
{ required: true, validator: integral2, trigger: "blur" },
|
||||
],
|
||||
status: [{ required: true, message: "请选择状态", trigger: "change" }],
|
||||
fileList: [
|
||||
{ required: true, message: "请上传商品图片", trigger: "change" },
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
created() {
|
||||
let l = Object.keys(this.info).length;
|
||||
if (this.info.isAdd) {
|
||||
this.showEdit = false;
|
||||
if (l > 1) {
|
||||
this.title = "修改商品";
|
||||
this.getShopList().then(() => {
|
||||
this.searchDetail(this.info.id);
|
||||
});
|
||||
} else {
|
||||
this.title = "添加商品";
|
||||
this.getShopList();
|
||||
}
|
||||
} else {
|
||||
this.title = "商品详情";
|
||||
this.isEdit = true;
|
||||
this.showEdit = true;
|
||||
this.getShopList().then(() => {
|
||||
this.searchDetail(this.info.id);
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getShopList() {
|
||||
return new Promise((reslove) => {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralshop/listForOperator`, null, {
|
||||
params: {
|
||||
size: 100000,
|
||||
areaId: this.areaId,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.shopList = res.data.records;
|
||||
reslove();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
changeFile() {
|
||||
this.$refs.fileList.$emit("el.form.change");
|
||||
},
|
||||
searchDetail(id) {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralmerchandise/queryDetailById`, null, {
|
||||
params: {
|
||||
id,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.forms = { ...res.data };
|
||||
let i = this.shopList.findIndex(
|
||||
(item) => item.id == this.forms.shopId
|
||||
);
|
||||
if (i > -1) {
|
||||
this.forms.shopName = this.shopList[i].shopName;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
edit() {
|
||||
this.isEdit = false;
|
||||
},
|
||||
save(formName, type) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.instance
|
||||
.post(
|
||||
`/app/appvillagerintegralmerchandise/addOrUpdate`,
|
||||
{
|
||||
...this.forms,
|
||||
areaId: this.user.info.areaId,
|
||||
},
|
||||
null
|
||||
)
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success("提交成功");
|
||||
if (type == "detail") {
|
||||
this.isEdit = true;
|
||||
} else {
|
||||
this.$emit("goBack");
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.add_order {
|
||||
height: 100%;
|
||||
.form_div {
|
||||
padding: 16px 0;
|
||||
}
|
||||
.above {
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
.left {
|
||||
width: 50%;
|
||||
float: left;
|
||||
}
|
||||
.right {
|
||||
width: 50%;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
.iconEdit,
|
||||
.Edit {
|
||||
color: #5088ff;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
padding-left: 8px;
|
||||
}
|
||||
.info {
|
||||
padding: 16px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,631 @@
|
||||
<template>
|
||||
<section class="add_order">
|
||||
<ai-detail>
|
||||
<template slot="title">
|
||||
<ai-title :title="title" :isShowBack="true" :isShowBottomBorder="true"
|
||||
@onBackClick="$emit('goBack')"></ai-title>
|
||||
</template>
|
||||
<template slot="content" v-if="info.isAdd">
|
||||
<ai-card title="订单信息">
|
||||
<template #content>
|
||||
<div class="form_div">
|
||||
<el-form
|
||||
ref="rules"
|
||||
:model="forms"
|
||||
:rules="formRules"
|
||||
size="small"
|
||||
label-suffix=":"
|
||||
label-width="100px">
|
||||
<el-form-item label="店铺名称" prop="shopId">
|
||||
<el-select
|
||||
v-model="forms.shopId"
|
||||
placeholder="请选择..."
|
||||
@change="(forms.merchandiseList = []), (goodIntegral = {})"
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="(item, i) in shopList"
|
||||
:key="i"
|
||||
:label="item.shopName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="兑换家庭" prop="name">
|
||||
<el-row type="flex" :gutter="8">
|
||||
<el-col
|
||||
>
|
||||
<el-input v-model="forms.name" disabled clearable
|
||||
/>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<ai-person-select
|
||||
:instance="instance"
|
||||
url="/app/appvillagerintegralfamilymember/list"
|
||||
headerTitle="家庭列表"
|
||||
dialogTitle="选择家庭"
|
||||
@selectPerson="getSelect"
|
||||
>
|
||||
<template name="option" v-slot:option="{ item }">
|
||||
<span class="iconfont iconProlife">{{ item.name }}</span>
|
||||
<ai-id
|
||||
mode="show"
|
||||
:show-eyes="false"
|
||||
:value="item.idNumber"
|
||||
/>
|
||||
<span>{{ item.phone }}</span>
|
||||
</template>
|
||||
</ai-person-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item label="积分余额">
|
||||
<p>
|
||||
<span style="color: #2266ff">{{ integral || "0" }}</span
|
||||
>分
|
||||
</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="兑换商品" prop="merchandiseList">
|
||||
<el-button @click="showGoodsList()" :disabled="!forms.shopId || !forms.name">选择商品</el-button>
|
||||
</el-form-item>
|
||||
<ai-table
|
||||
:tableData="forms.merchandiseList"
|
||||
:col-configs="colConfigs"
|
||||
:isShowPagination="false">
|
||||
<el-table-column
|
||||
label="商品图"
|
||||
slot="photo"
|
||||
align="center"
|
||||
width="150">
|
||||
<template v-slot="{ row }">
|
||||
<ai-uploader
|
||||
:disabled="true"
|
||||
:instance="instance"
|
||||
v-model="row.photo"
|
||||
:limit="9">
|
||||
</ai-uploader>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="兑换数量"
|
||||
width="180"
|
||||
slot="merchandiseNumber"
|
||||
align="center">
|
||||
<template v-slot="{ row }">
|
||||
<el-input-number
|
||||
:min="1"
|
||||
:max="row.inventoryNumber"
|
||||
size="mini"
|
||||
v-model="merchandiseNumbers[row.id]"
|
||||
@change="
|
||||
(currentValue, oldValue) =>
|
||||
changeNumber(currentValue, oldValue, row)
|
||||
"
|
||||
:step="1"
|
||||
step-strictly
|
||||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="消耗积分" slot="integral" align="center">
|
||||
<template v-slot="{ row }">
|
||||
<span>{{ goodIntegral[row.id] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
slot="options"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="60"
|
||||
>
|
||||
<template slot-scope="row">
|
||||
<el-button
|
||||
type="text"
|
||||
class="icon-color89B"
|
||||
icon="iconfont iconDelete"
|
||||
title="删除"
|
||||
@click="deleteGood(row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
<div class="total">
|
||||
<p class="num">
|
||||
<span>合计积分:</span>
|
||||
<span>{{ allIntegral }}</span>
|
||||
<span>分</span>
|
||||
</p>
|
||||
<p class="tip" v-if="allIntegral > Number(integral)">
|
||||
(积分不足,请删减商品)
|
||||
</p>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
<template slot="content" v-if="!info.isAdd">
|
||||
<ai-card title="订单信息">
|
||||
<template #content>
|
||||
<div class="info">
|
||||
<ai-wrapper label-width="70px" :columnsNumber="1">
|
||||
<ai-info-item label="订单号"><span>{{ detailInfo.orderCode }}</span></ai-info-item>
|
||||
<ai-info-item label="创建时间"><span>{{ detailInfo.createTime }}</span></ai-info-item>
|
||||
<ai-info-item label="店铺名"><span>{{ detailInfo.shopName }}</span></ai-info-item>
|
||||
<ai-info-item label="状态">
|
||||
<span :style="{ color: dict.getColor('integralOrderStatus', detailInfo.orderStatus)}">
|
||||
{{ dict.getLabel("integralOrderStatus", detailInfo.orderStatus) }}
|
||||
</span>
|
||||
</ai-info-item>
|
||||
</ai-wrapper>
|
||||
<ai-table
|
||||
:tableData="detailInfo.merchandiseList"
|
||||
:col-configs="colConfigs"
|
||||
:isShowPagination="false">
|
||||
<el-table-column
|
||||
label="商品图"
|
||||
slot="photo"
|
||||
align="center"
|
||||
width="150">
|
||||
<template v-slot="{ row }">
|
||||
<ai-uploader
|
||||
:disabled="true"
|
||||
:instance="instance"
|
||||
v-model="row.merchandisePhoto"
|
||||
:limit="9">
|
||||
</ai-uploader>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="兑换数量"
|
||||
width="200"
|
||||
slot="merchandiseNumber"
|
||||
align="center">
|
||||
<template v-slot="{ row }">
|
||||
{{ row.merchandiseNumber }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="消耗积分" slot="integral" align="center">
|
||||
<template v-slot="{ row }">
|
||||
<span>{{ Number(row.merchandiseNumber) * Number(row.costIntegral) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
<div class="total">
|
||||
<p class="num">
|
||||
<span>合计积分:</span>
|
||||
<span>{{ detailInfo.orderIntegral }}</span>
|
||||
<span>分</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
<ai-card title="兑换家庭信息">
|
||||
<template #content>
|
||||
<div class="info">
|
||||
<ai-wrapper label-width="70px" :columnsNumber="2">
|
||||
<ai-info-item label="户主"><span>{{ detailInfo.familyName }}</span></ai-info-item>
|
||||
<ai-info-item label="联系方式"><span>{{ detailInfo.familyPhone || "-" }}</span></ai-info-item>
|
||||
</ai-wrapper>
|
||||
<ai-wrapper label-width="70px" :columnsNumber="1">
|
||||
<ai-info-item label="备注"><span>{{ detailInfo.remark || "-" }}</span></ai-info-item>
|
||||
</ai-wrapper>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
<ai-card title="操作人信息">
|
||||
<template #content>
|
||||
<div class="info">
|
||||
<ai-wrapper label-width="70px">
|
||||
<ai-info-item label="操作人"><span>{{ detailInfo.createUserName || "-" }}</span></ai-info-item>
|
||||
<ai-info-item label="联系方式"><span>{{ detailInfo.createUserPhone || "-" }}</span></ai-info-item>
|
||||
<ai-info-item label="完成时间"><span>{{ detailInfo.finishTime || "-" }}</span></ai-info-item>
|
||||
</ai-wrapper>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
<template slot="footer" v-if="info.isAdd">
|
||||
<el-button @click="$emit('goBack')" style="width: 120px">取消</el-button>
|
||||
<el-button type="primary" @click="save('rules')" style="width: 120px"
|
||||
:disabled="allIntegral > Number(integral)">确认兑换
|
||||
</el-button>
|
||||
</template>
|
||||
</ai-detail>
|
||||
<ai-dialog
|
||||
title="选择商品"
|
||||
:visible.sync="showGoods"
|
||||
:customFooter="true"
|
||||
:destroyOnClose="true"
|
||||
class="goods"
|
||||
@close="init"
|
||||
border
|
||||
width="780px">
|
||||
<div class="border_div">
|
||||
<header>
|
||||
<span>商品列表</span>
|
||||
<el-input
|
||||
v-model="keyWord"
|
||||
size="mini"
|
||||
placeholder="商品关键字"
|
||||
@keyup.enter.native="showGoodsList()"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
suffix-icon="iconfont iconSearch"
|
||||
/>
|
||||
</header>
|
||||
<ai-table
|
||||
:tableData="goodList"
|
||||
:col-configs="goodsConfig"
|
||||
:isShowPagination="false"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
slot="selection"
|
||||
type="selection"
|
||||
width="55" :selectable="row=>Number(row.inventoryNumber)>0"
|
||||
/>
|
||||
</ai-table>
|
||||
</div>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="showGoods = false" size="medium">取消</el-button>
|
||||
<el-button @click="onConfirm()" type="primary" size="medium">确认</el-button>
|
||||
</div>
|
||||
</ai-dialog>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "addOrder",
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
info: Object,
|
||||
areaId: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
forms: {
|
||||
shopId: "",
|
||||
familyId: "",
|
||||
familyName: "",
|
||||
name: "",
|
||||
memberId: "",
|
||||
merchandiseList: [],
|
||||
phone: "",
|
||||
},
|
||||
integral: "",
|
||||
shopList: [],
|
||||
goodList: [],
|
||||
goodIntegral: {},
|
||||
merchandiseNumbers: {},
|
||||
showGoods: false,
|
||||
selectGoodList: [],
|
||||
keyWord: "",
|
||||
title: "",
|
||||
detailInfo: {},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(["user"]),
|
||||
formRules() {
|
||||
return {
|
||||
shopId: [{required: true, message: "请选择店铺", trigger: "change"}],
|
||||
name: [
|
||||
{required: true, message: "请选择兑换家庭", trigger: "change"},
|
||||
],
|
||||
merchandiseList: [
|
||||
{required: true, message: "请选择商品", trigger: "change"},
|
||||
],
|
||||
};
|
||||
},
|
||||
colConfigs() {
|
||||
return [
|
||||
{slot: "photo", prop: "photo", label: "商品图", align: "center"},
|
||||
{
|
||||
prop: "merchandiseName",
|
||||
label: "商品名",
|
||||
align: "left",
|
||||
width: 160,
|
||||
"show-overflow-tooltip": false,
|
||||
},
|
||||
{
|
||||
prop: "costIntegral",
|
||||
label: "单价",
|
||||
align: "center",
|
||||
width: 60,
|
||||
},
|
||||
{
|
||||
slot: "merchandiseNumber",
|
||||
prop: "merchandiseNumber",
|
||||
label: "兑换数量",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
prop: "inventoryNumber",
|
||||
label: "库存",
|
||||
align: "center",
|
||||
width: 60,
|
||||
hide: this.title == "兑换订单详情",
|
||||
},
|
||||
{
|
||||
slot: "integral",
|
||||
prop: "integral",
|
||||
label: "消耗积分",
|
||||
align: "center",
|
||||
},
|
||||
{slot: "options", label: "操作", align: "center"},
|
||||
];
|
||||
},
|
||||
goodsConfig() {
|
||||
return [
|
||||
{slot: "selection", label: "", align: "center"},
|
||||
{prop: "merchandiseName", label: "商品名", align: "left", width: 350},
|
||||
{prop: "costIntegral", label: "单价", align: "left"},
|
||||
{prop: "inventoryNumber", align: "center", label: "库存"},
|
||||
];
|
||||
},
|
||||
allIntegral() {
|
||||
let arr = Object.keys(this.goodIntegral);
|
||||
let all = 0;
|
||||
arr.forEach((e) => {
|
||||
all += this.goodIntegral[e];
|
||||
});
|
||||
return all;
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (this.info.isAdd) {
|
||||
this.title = "添加兑换订单";
|
||||
} else {
|
||||
this.title = "兑换订单详情";
|
||||
this.searchDetail(this.info.id);
|
||||
}
|
||||
this.getShopList();
|
||||
},
|
||||
methods: {
|
||||
getSelect(val) {
|
||||
if (val) {
|
||||
this.forms.familyName = val.familyName;
|
||||
this.forms.familyId = val.familyId;
|
||||
this.forms.name = val.name;
|
||||
this.forms.memberId = val.id;
|
||||
this.forms.phone = val.phone;
|
||||
this.integral = val.integral;
|
||||
} else {
|
||||
this.forms.familyName = "";
|
||||
this.forms.familyId = "";
|
||||
this.forms.name = "";
|
||||
this.forms.memberId = "";
|
||||
this.forms.phone = "";
|
||||
this.integral = 0;
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selectGoodList = [...val];
|
||||
},
|
||||
onConfirm() {
|
||||
this.selectGoodsInit(this.selectGoodList).then(() => {
|
||||
this.showGoods = false;
|
||||
});
|
||||
},
|
||||
init() {
|
||||
this.selectGoodList = [];
|
||||
this.goodList = [];
|
||||
},
|
||||
deleteGood(row) {
|
||||
console.log(row);
|
||||
this.$confirm("是否删除该商品?", {
|
||||
type: "error",
|
||||
})
|
||||
.then(() => {
|
||||
this.forms.merchandiseList.splice(row.$index, 1);
|
||||
this.$delete(this.goodIntegral, row.row.id);
|
||||
this.$delete(this.merchandiseNumbers, row.row.id);
|
||||
return this.$message.success("删除成功");
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
selectGoodsInit(val) {
|
||||
return new Promise((reslove) => {
|
||||
val.map((e) => {
|
||||
e.merchandiseNumber = 1;
|
||||
e.merchandiseId = e.id;
|
||||
this.$set(this.merchandiseNumbers, e.id, 1);
|
||||
this.$set(this.goodIntegral, e.id, Number(e.costIntegral));
|
||||
if (e.photo) {
|
||||
e.merchandisePhoto = e.photo;
|
||||
e.photo = [{...JSON.parse(e.photo)[0]}];
|
||||
} else {
|
||||
e.photo = [];
|
||||
}
|
||||
});
|
||||
this.forms.merchandiseList = this.forms.merchandiseList.concat([
|
||||
...val,
|
||||
]);
|
||||
reslove();
|
||||
});
|
||||
},
|
||||
showGoodsList() {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralmerchandise/list`, null, {
|
||||
params: {
|
||||
size: 100000,
|
||||
shopId: this.forms.shopId,
|
||||
merchandiseName: this.keyWord,
|
||||
status: "1",
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
if (this.forms.merchandiseList.length > 0) {
|
||||
this.forms.merchandiseList.forEach((e1) => {
|
||||
res.data.records.forEach((e2, index2) => {
|
||||
if (e1.id == e2.id) {
|
||||
res.data.records.splice(index2, 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
this.goodList = res.data.records;
|
||||
this.showGoods = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
changeNumber(currentValue, oldValue, row) {
|
||||
console.log(currentValue, oldValue, row);
|
||||
this.$set(
|
||||
this.goodIntegral,
|
||||
row.id,
|
||||
Number(currentValue) * Number(row.costIntegral)
|
||||
);
|
||||
},
|
||||
getShopList() {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralshop/listForOperator`, null, {
|
||||
params: {
|
||||
size: 100000,
|
||||
areaId: this.areaId,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.shopList = res.data.records;
|
||||
}
|
||||
});
|
||||
},
|
||||
save(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.forms.merchandiseList.forEach((e1, index1) => {
|
||||
Object.keys(this.merchandiseNumbers).forEach((e2) => {
|
||||
if (e1.id == e2) {
|
||||
this.forms.merchandiseList[
|
||||
index1
|
||||
].merchandiseNumber = this.merchandiseNumbers[e2];
|
||||
}
|
||||
});
|
||||
});
|
||||
this.instance
|
||||
.post(
|
||||
`/app/appvillagerintegralshoporder/addOrder`,
|
||||
{
|
||||
...this.forms,
|
||||
areaId: this.user.info.areaId,
|
||||
orderIntegral: this.allIntegral,
|
||||
},
|
||||
null
|
||||
)
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success("提交成功");
|
||||
this.$emit("goBack");
|
||||
} else {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
searchDetail(id) {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralshoporder/queryDetailById`, null, {
|
||||
params: {
|
||||
id,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.detailInfo = {...res.data};
|
||||
this.detailInfo.merchandiseList.map((e) => {
|
||||
let arr = JSON.parse(e.merchandisePhoto);
|
||||
e.merchandisePhoto = [{...arr[0]}];
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.add_order {
|
||||
height: 100%;
|
||||
|
||||
.form_div {
|
||||
padding: 16px 0;
|
||||
}
|
||||
|
||||
.goods {
|
||||
::v-deep .el-table td {
|
||||
border-bottom: none;
|
||||
padding: 2px 0;
|
||||
}
|
||||
|
||||
::v-deep .el-table th {
|
||||
padding: 2px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.total {
|
||||
width: 100%;
|
||||
padding: 32px 0;
|
||||
|
||||
p {
|
||||
text-align: right;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
|
||||
span:nth-child(1) {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
span:nth-child(2) {
|
||||
color: #2266ff;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.tip {
|
||||
color: #ff4466;
|
||||
}
|
||||
}
|
||||
|
||||
.border_div {
|
||||
overflow: hidden;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #d0d4dc;
|
||||
|
||||
header {
|
||||
height: 40px;
|
||||
background: #f5f5f5;
|
||||
padding: 0 8px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #d0d4dc;
|
||||
|
||||
span {
|
||||
color: #333333;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
padding: 16px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,336 @@
|
||||
<template>
|
||||
<section class="order_management">
|
||||
<ai-list isTabs>
|
||||
<template slot="content">
|
||||
<ai-search-bar bottomBorder>
|
||||
<template slot="left">
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="searchObj.shopId"
|
||||
placeholder="请选择店铺"
|
||||
clearable
|
||||
@change="(page.current = 1), getList()">
|
||||
<el-option
|
||||
v-for="(item, i) in shopList"
|
||||
:key="i"
|
||||
:label="item.shopName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="searchObj.merchandiseType"
|
||||
placeholder="请选择商品类型"
|
||||
clearable
|
||||
@change="(page.current = 1), getList()">
|
||||
<el-option
|
||||
v-for="(item, i) in dict.getDict('integralMerchandiseType')"
|
||||
:key="i"
|
||||
:label="item.dictName"
|
||||
:value="item.dictValue">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="searchObj.status"
|
||||
placeholder="请选择状态"
|
||||
clearable
|
||||
@change="(page.current = 1), getList()">
|
||||
<el-option
|
||||
v-for="(item, i) in dict.getDict('integralMerchandiseStatus')"
|
||||
:key="i"
|
||||
:label="item.dictName"
|
||||
:value="item.dictValue">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<el-input
|
||||
v-model="searchObj.merchandiseName"
|
||||
size="small"
|
||||
placeholder="商品名"
|
||||
@keyup.enter.native="(page.current = 1), getList()"
|
||||
@clear="(page.current = 1), searchObj.merchandiseName = '', getList()"
|
||||
clearable
|
||||
suffix-icon="iconfont iconSearch" />
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-search-bar class="mt10">
|
||||
<template slot="left">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="iconfont iconAdd"
|
||||
@click="add()"
|
||||
v-if="$permissions('app_appvillagerintegralmerchandise_edit')">
|
||||
添加
|
||||
</el-button>
|
||||
<ai-download
|
||||
:instance="instance"
|
||||
:fileName="'商品列表'"
|
||||
url="/app/appvillagerintegralmerchandise/export"
|
||||
v-if="$permissions('app_appvillagerintegralmerchandise_export')"
|
||||
:params="{ ...searchObj, areaId: areaId }">
|
||||
</ai-download>
|
||||
</template>
|
||||
<template slot="right"> </template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="page.total"
|
||||
:current.sync="page.current"
|
||||
:size.sync="page.size"
|
||||
@getList="getList">
|
||||
<el-table-column
|
||||
label="商品图"
|
||||
slot="photo"
|
||||
align="center"
|
||||
width="150">
|
||||
<template v-slot="{ row }">
|
||||
<ai-uploader
|
||||
:disabled="true"
|
||||
:instance="instance"
|
||||
v-model="row.photo"
|
||||
:limit="9">
|
||||
</ai-uploader>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" slot="options" align="center" width="200" fixed="right">
|
||||
<template v-slot="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button
|
||||
type="text"
|
||||
title="编辑"
|
||||
:disabled="!$permissions('app_appvillagerintegralmerchandise_edit') || row.enable != 1"
|
||||
@click="edit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
title="详情"
|
||||
:disabled="!$permissions('app_appvillagerintegralmerchandise_detail') || row.enable != 1"
|
||||
@click="goDetail(row)">
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
title="上架"
|
||||
:disabled="row.status != 0 || !$permissions('app_appvillagerintegralmerchandise_edit') || row.enable != 1"
|
||||
@click="changeStatus(row)">
|
||||
上架
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
title="下架"
|
||||
:disabled="row.status != 1 || !$permissions('app_appvillagerintegralmerchandise_edit') || row.enable != 1"
|
||||
@click="changeStatus(row)">
|
||||
下架
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "goodsManagement",
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
areaId: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
searchObj: {
|
||||
shopId: "",
|
||||
status: "",
|
||||
merchandiseName: "",
|
||||
merchandiseType: "",
|
||||
},
|
||||
page: {
|
||||
size: 10,
|
||||
current: 1,
|
||||
total: 0,
|
||||
},
|
||||
tableData: [],
|
||||
shopList: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
colConfigs() {
|
||||
let _ = this;
|
||||
return [
|
||||
{
|
||||
prop: "shopId",
|
||||
label: "店铺名称",
|
||||
},
|
||||
{
|
||||
slot: "photo",
|
||||
prop: "photo",
|
||||
align: "center",
|
||||
label: "商品图",
|
||||
},
|
||||
{
|
||||
prop: "merchandiseName",
|
||||
align: "left",
|
||||
label: "商品名",
|
||||
width: 180,
|
||||
"show-overflow-tooltip": false,
|
||||
},
|
||||
{
|
||||
prop: "costIntegral",
|
||||
align: "center",
|
||||
label: "单价",
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
prop: "inventoryNumber",
|
||||
align: "center",
|
||||
label: "库存",
|
||||
},
|
||||
{
|
||||
prop: "saleNumber",
|
||||
align: "center",
|
||||
label: "销量",
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
align: "center",
|
||||
label: "状态",
|
||||
render(h, { row }) {
|
||||
return h(
|
||||
"span",
|
||||
{
|
||||
style: {
|
||||
color: _.$dict.getColor(
|
||||
"integralMerchandiseStatus",
|
||||
row.status
|
||||
),
|
||||
},
|
||||
},
|
||||
_.$dict.getLabel("integralMerchandiseStatus", row.status)
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.dict.load("integralMerchandiseType", "integralMerchandiseStatus");
|
||||
this.getShopList().then(() => {
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralmerchandise/list`, null, {
|
||||
params: {
|
||||
...this.searchObj,
|
||||
...this.page,
|
||||
areaId: this.areaId,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records;
|
||||
this.tableData.map(e => {
|
||||
let i = this.shopList.findIndex((item) => item.id == e.shopId);
|
||||
if (i > -1) {
|
||||
e.shopId = this.shopList[i].shopName;
|
||||
}
|
||||
if (e.photo) {
|
||||
e.allPhoto = [...JSON.parse(e.photo)];
|
||||
e.photo = [{ ...e.allPhoto[0] }];
|
||||
} else {
|
||||
e.photo = [];
|
||||
}
|
||||
});
|
||||
this.page.total = res.data.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
updateList() {
|
||||
this.getShopList().then(() => {
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
Object.keys(this.searchObj).forEach((e) => {
|
||||
this.searchObj[e] = "";
|
||||
});
|
||||
this.getList();
|
||||
},
|
||||
add() {
|
||||
this.$emit("showDetail", { isAdd: true });
|
||||
},
|
||||
edit(row) {
|
||||
this.$emit("showDetail", { isAdd: true, ...row });
|
||||
},
|
||||
goDetail(row) {
|
||||
this.$emit("showDetail", { isAdd: false, ...row });
|
||||
},
|
||||
changeStatus(row) {
|
||||
let status =
|
||||
row.status == 0
|
||||
? `上架 ${row.shopId}-${row.merchandiseName}`
|
||||
: `下架 ${row.shopId}-${row.merchandiseName}`;
|
||||
this.$confirm(
|
||||
`<p>是否要<span style='color:#2266FF;'>${status}</span>?</p>`,
|
||||
{
|
||||
type: "error",
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
this.instance
|
||||
.post("/app/appvillagerintegralmerchandise/enableOrDisable", null, {
|
||||
params: { id: row.id },
|
||||
})
|
||||
.then((res) => {
|
||||
if (res?.code == 0) {
|
||||
this.$message.success("操作成功!");
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
getShopList() {
|
||||
return new Promise((reslove) => {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralshop/list`, null, {
|
||||
params: {
|
||||
size: 100000,
|
||||
areaId: this.areaId,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.shopList = res.data.records;
|
||||
reslove();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.order_management {
|
||||
background: #f3f6f9;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
.iconShow {
|
||||
padding: 0 8px;
|
||||
}
|
||||
.iconfont {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,491 @@
|
||||
<template>
|
||||
<section class="order_management">
|
||||
<ai-list isTabs>
|
||||
<template slot="content">
|
||||
<ai-search-bar>
|
||||
<template slot="left">
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="searchObj.shopId"
|
||||
placeholder="请选择店铺"
|
||||
clearable
|
||||
@change="(page.current = 1), getList()">
|
||||
<el-option
|
||||
v-for="(item, i) in shopList"
|
||||
:key="i"
|
||||
:label="item.shopName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="searchObj.orderStatus"
|
||||
placeholder="请选择状态"
|
||||
clearable
|
||||
@change="(page.current = 1), getList()">
|
||||
<el-option
|
||||
v-for="(item, i) in dict.getDict('integralOrderStatus')"
|
||||
:key="i"
|
||||
:label="item.dictName"
|
||||
:value="item.dictValue">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<div class="times_div">
|
||||
<p class="times">创建时间</p>
|
||||
<el-date-picker
|
||||
v-model="searchObj.createTimeStart"
|
||||
type="date"
|
||||
size="small"
|
||||
@change="(page.current = 1), getList()"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="开始日期">
|
||||
</el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="searchObj.createTimeEnd"
|
||||
type="date"
|
||||
size="small"
|
||||
@change="(page.current = 1), getList()"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template slot="right">
|
||||
<el-input
|
||||
v-model="searchObj.name"
|
||||
size="small"
|
||||
placeholder="订单号/商品名/兑换家庭"
|
||||
@keyup.enter.native="page.current = 1, getList()"
|
||||
@clear="page.current = 1, searchObj.name = '', getList()"
|
||||
clearable
|
||||
suffix-icon="iconfont iconSearch"
|
||||
/>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-search-bar>
|
||||
<template slot="left">
|
||||
<!-- <el-button type="primary" icon="iconfont iconAdd" @click="add()">添加</el-button> -->
|
||||
<ai-download
|
||||
:instance="instance"
|
||||
url="/app/appvillagerintegralshoporder/listExport"
|
||||
:params="{ ...searchObj, areaId: areaId, ids: ids.join(',') }"
|
||||
fileName="订单管理"
|
||||
v-if="$permissions('app_appvillagerintegralshoporder_export')">
|
||||
</ai-download>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-button type="primary">
|
||||
变更状态<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="1">批量完成</el-dropdown-item>
|
||||
<el-dropdown-item command="2">批量取消</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
<template slot="right"></template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="page.total"
|
||||
ref="aitableex"
|
||||
:current.sync="page.current"
|
||||
@select="onRowClick"
|
||||
@select-all="onRowClick"
|
||||
row-key="id"
|
||||
:default-expand-all="false"
|
||||
:tree-props="{ children: 'merchandiseList' }"
|
||||
:size.sync="page.size"
|
||||
@getList="getList">
|
||||
<el-table-column
|
||||
align="center"
|
||||
type="selection"
|
||||
:selectable="row=>row.orderStatus==0"
|
||||
width="55"
|
||||
slot="selection">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="订单号/创建时间"
|
||||
slot="orderCode"
|
||||
align="center"
|
||||
width="150">
|
||||
<template v-slot="{ row }">
|
||||
<el-row>
|
||||
<el-col>{{ row.orderCode }}</el-col>
|
||||
<el-col style="color: #999999">{{ row.createTime }}</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="商品图"
|
||||
slot="merchandisePhoto"
|
||||
align="center"
|
||||
width="130">
|
||||
<template v-slot="{ row }">
|
||||
<ai-uploader
|
||||
:disabled="true"
|
||||
:instance="instance"
|
||||
v-model="row.merchandisePhoto"
|
||||
:limit="9">
|
||||
</ai-uploader>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="兑换家庭" slot="familyName" align="left">
|
||||
<template v-slot="{ row }">
|
||||
<el-row>
|
||||
<el-col style="width: 100%">{{ row.familyName }}</el-col>
|
||||
<el-col style="color: #999999">{{ row.familyPhone }}</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人" slot="createUserName" align="left">
|
||||
<template v-slot="{ row }">
|
||||
<el-row>
|
||||
<el-col style="width: 100%">{{ row.createUserName }}</el-col>
|
||||
<el-col style="color: #999999">{{
|
||||
row.createUserPhone
|
||||
}}
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="订单状态"
|
||||
slot="orderStatus"
|
||||
align="center"
|
||||
width="130"
|
||||
fixed="right">
|
||||
<template v-slot="{ row }">
|
||||
<el-row v-if="row.isParent">
|
||||
<el-col
|
||||
style="width: 100%"
|
||||
:style="{
|
||||
color: dict.getColor(
|
||||
'integralOrderStatus',
|
||||
row.orderStatus
|
||||
),
|
||||
}"
|
||||
>{{
|
||||
dict.getLabel("integralOrderStatus", row.orderStatus)
|
||||
}}
|
||||
</el-col
|
||||
>
|
||||
<el-col style="width: 100%" v-if="row.orderStatus == 0"
|
||||
>{{ row.reserveDate }} {{ row.reserveTime }}
|
||||
</el-col
|
||||
>
|
||||
<el-col style="color: #2266ff; width: 100%" v-if="row.remark">
|
||||
<el-tooltip
|
||||
:disabled="!row.remark"
|
||||
class="item"
|
||||
effect="light"
|
||||
:content="row.remark"
|
||||
placement="left-end"
|
||||
>
|
||||
<el-link type="primary">备注</el-link>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
slot="options"
|
||||
align="center"
|
||||
width="120"
|
||||
fixed="right">
|
||||
<template v-slot="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button
|
||||
v-if="row.orderCode"
|
||||
type="text"
|
||||
@click="goDetail(row)"
|
||||
title="详情"
|
||||
:disabled="!$permissions('app_appvillagerintegralshoporder_detail')">
|
||||
详情
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "orderManagement",
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
areaId: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
searchObj: {
|
||||
name: "",
|
||||
orderStatus: "",
|
||||
createTimeStart: null,
|
||||
createTimeEnd: null,
|
||||
shopId: "",
|
||||
},
|
||||
page: {
|
||||
size: 10,
|
||||
current: 1,
|
||||
total: 0,
|
||||
},
|
||||
tableData: [],
|
||||
shopList: [],
|
||||
ids: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
colConfigs() {
|
||||
return [
|
||||
{slot: "selection"},
|
||||
{
|
||||
prop: "orderCode",
|
||||
align: "center",
|
||||
slot: "orderCode",
|
||||
label: "订单号/创建时间",
|
||||
},
|
||||
{
|
||||
prop: "merchandisePhoto",
|
||||
slot: "merchandisePhoto",
|
||||
align: "center",
|
||||
label: "商品图",
|
||||
},
|
||||
{
|
||||
prop: "merchandiseName",
|
||||
align: "left",
|
||||
label: "商品名",
|
||||
width: 180,
|
||||
"show-overflow-tooltip": false,
|
||||
},
|
||||
{
|
||||
prop: "costIntegral",
|
||||
align: "center",
|
||||
label: "单价",
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
prop: "merchandiseNumber",
|
||||
align: "center",
|
||||
label: "数量",
|
||||
},
|
||||
{
|
||||
prop: "allCostIntegral",
|
||||
align: "center",
|
||||
label: "消耗积分",
|
||||
},
|
||||
{
|
||||
prop: "familyName",
|
||||
align: "center",
|
||||
label: "兑换家庭",
|
||||
slot: "familyName",
|
||||
},
|
||||
{
|
||||
prop: "createUserName",
|
||||
align: "center",
|
||||
label: "操作人",
|
||||
slot: "createUserName",
|
||||
},
|
||||
{
|
||||
prop: "orderStatus",
|
||||
align: "center",
|
||||
label: "订单状态",
|
||||
fixed: "right",
|
||||
slot: "orderStatus",
|
||||
// render(h, {row}) {
|
||||
// return h('span', {style: {color: _.dict.getColor('integralOrderStatus', row.orderStatus)}}, _.dict.getLabel('integralOrderStatus', row.orderStatus))
|
||||
// }
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.dict.load("integralOrderStatus");
|
||||
this.getShopList();
|
||||
},
|
||||
methods: {
|
||||
onRowClick(row) {
|
||||
this.ids = row.map(e => e.id)
|
||||
},
|
||||
handleCommand(val) {
|
||||
if (this.ids.length == 0) {
|
||||
return this.$message.error("请选择商品")
|
||||
}
|
||||
this.instance.post(`/app/appvillagerintegralshoporder/changeOrderStatus`, null, {
|
||||
params: {
|
||||
ids: this.ids.join(","),
|
||||
status: val
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(`批量${val == 1 ? '完成' : '取消'}成功`)
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralshoporder/list`, null, {
|
||||
params: {
|
||||
...this.searchObj,
|
||||
...this.page,
|
||||
areaId: this.areaId,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records;
|
||||
this.tableData.map((e) => {
|
||||
e.merchandiseName = e.merchandiseList[0].merchandiseName;
|
||||
e.merchandiseNumber = e.merchandiseList[0].merchandiseNumber;
|
||||
e.merchandisePhoto = [
|
||||
{...JSON.parse(e.merchandiseList[0].merchandisePhoto)[0]},
|
||||
];
|
||||
e.idForWeb = e.merchandiseList[0].idForWeb;
|
||||
e.costIntegral = e.merchandiseList[0].costIntegral;
|
||||
e.allCostIntegral =
|
||||
Number(e.merchandiseList[0].costIntegral) *
|
||||
Number(e.merchandiseNumber);
|
||||
e.merchandiseList.splice(0, 1);
|
||||
e.isParent = true;
|
||||
if (e.merchandiseList.length > 0) {
|
||||
e.merchandiseList.map((e2) => {
|
||||
e2.createTime = "";
|
||||
let arr = JSON.parse(e2.merchandisePhoto);
|
||||
e2.merchandisePhoto = [{...arr[0]}];
|
||||
e2.allCostIntegral =
|
||||
Number(e2.costIntegral) * Number(e2.merchandiseNumber);
|
||||
e2.isParent = false;
|
||||
// e2.id = e2.orderId
|
||||
});
|
||||
}
|
||||
});
|
||||
this.page.total = res.data.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
getShopList() {
|
||||
return new Promise((reslove) => {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralshop/list`, null, {
|
||||
params: {
|
||||
size: 100000,
|
||||
areaId: this.areaId,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.shopList = res.data.records;
|
||||
reslove();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
Object.keys(this.searchObj).forEach((e) => {
|
||||
this.searchObj[e] = "";
|
||||
});
|
||||
this.searchObj.createTimeStart = null;
|
||||
this.searchObj.createTimeEnd = null;
|
||||
this.getList();
|
||||
},
|
||||
add() {
|
||||
this.$emit("showDetail", {isAdd: true});
|
||||
},
|
||||
goDetail(row) {
|
||||
console.log(row);
|
||||
this.$emit("showDetail", {isAdd: false, ...row});
|
||||
},
|
||||
finishOrder(row) {
|
||||
this.$confirm(`是否完成此订单?`, {
|
||||
type: "error",
|
||||
})
|
||||
.then(() => {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralshoporder/FinishOrder`, null, {
|
||||
params: {
|
||||
orderId: row.id,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success("已完成!");
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
overOrder(row) {
|
||||
this.$confirm(`是否结束此订单?`, {
|
||||
type: "error",
|
||||
})
|
||||
.then(() => {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralshoporder/overOrder`, null, {
|
||||
params: {
|
||||
orderId: row.id,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success("已结束!");
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.order_management {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background: #f3f6f9;
|
||||
|
||||
.times_div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.times {
|
||||
display: block;
|
||||
width: 72px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
background: #f5f5f5;
|
||||
border-radius: 2px 0px 0px 2px;
|
||||
border: 1px solid #d0d4dc;
|
||||
font-size: 14px;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.iconCorrect {
|
||||
color: #53b43b;
|
||||
}
|
||||
|
||||
.iconReject {
|
||||
color: #e75555;
|
||||
padding: 0 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,474 @@
|
||||
<template>
|
||||
<section class="storeManagement">
|
||||
<ai-list isTabs>
|
||||
<template slot="content">
|
||||
<ai-search-bar bottomBorder>
|
||||
<template slot="left">
|
||||
<el-button
|
||||
:disabled="!isLevel5"
|
||||
type="primary"
|
||||
icon="iconfont iconAdd"
|
||||
@click="onAdd">
|
||||
添加
|
||||
</el-button>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
ref="aitableex"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
<el-table-column
|
||||
slot="changeIntegral"
|
||||
label="积分"
|
||||
align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<span>{{ row.doType > 0 ? "+" : ""}}{{ row.changeIntegral }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column slot="options" label="操作" align="center" width="120" fixed="right">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button
|
||||
type="text"
|
||||
title="编辑"
|
||||
style="margin-right: 8px;"
|
||||
:disabled="!$permissions('app_appvillagerintegralshop_edit')"
|
||||
@click="editItem(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<ai-wechat-selecter :instance="instance" v-model="dialogInfo.operators" @change="getSelect">
|
||||
<el-button
|
||||
type="text"
|
||||
@click="statusChage(row)"
|
||||
title="授权"
|
||||
v-if="$permissions('app_appvillagerintegralshop_edit')">
|
||||
授权
|
||||
</el-button>
|
||||
</ai-wechat-selecter>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
<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="100px"
|
||||
>
|
||||
<el-form-item label="店铺名称" prop="shopName">
|
||||
<el-input
|
||||
placeholder="请输入…"
|
||||
v-model="dialogInfo.shopName"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="店主" prop="shopkeeper">
|
||||
<el-input
|
||||
placeholder="请输入…"
|
||||
v-model="dialogInfo.shopkeeper"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input
|
||||
placeholder="请输入…"
|
||||
v-model="dialogInfo.phone"
|
||||
maxlength="11"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺地址" prop="shopAddress">
|
||||
<el-input
|
||||
placeholder="请输入…"
|
||||
v-model="dialogInfo.shopAddress"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="dialogInfo.status">
|
||||
<el-radio label="1">启用</el-radio>
|
||||
<el-radio label="0">停用</el-radio>
|
||||
</el-radio-group>
|
||||
</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
|
||||
title="操作人授权"
|
||||
:visible.sync="dialog.visibleStatus"
|
||||
:customFooter="true"
|
||||
:destroyOnClose="true"
|
||||
@close="init('ruleStatus')"
|
||||
width="720px"
|
||||
>
|
||||
<div class="form_div">
|
||||
<el-form
|
||||
ref="ruleStatus"
|
||||
:model="dialogInfo"
|
||||
:rules="formRules"
|
||||
size="small"
|
||||
label-suffix=":"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="事件区域" prop="areaId">
|
||||
<ai-area-select
|
||||
clearable
|
||||
always-show
|
||||
:instance="instance"
|
||||
v-model="dialogInfo.areaId"
|
||||
:hide-level="2"
|
||||
:disabled-level="user.info.areaList.length"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作员" required>
|
||||
<el-col :span="14" style="width: 60%; margin-right: 8px">
|
||||
<el-form-item prop="operators">
|
||||
<div class="organ">
|
||||
<span v-if="dialogInfo.operators.length">
|
||||
<span
|
||||
v-for="(item, i) in dialogInfo.operators"
|
||||
:key="i"
|
||||
class="organzation"
|
||||
>{{ item.userName }}
|
||||
<span
|
||||
class="iconfont iconOverrule"
|
||||
@click.stop="delate(i)"
|
||||
></span>
|
||||
</span>
|
||||
</span>
|
||||
<span v-else style="color: #999">请选择</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7" style="width: 30%">
|
||||
<ai-person-select
|
||||
:instance="instance"
|
||||
:url="peopleAjaxUrl"
|
||||
:isMultiple="true"
|
||||
v-if="$permissions('app_appvillagerintegralshopoperator_edit')"
|
||||
@selectPerson="getSelect"
|
||||
:chooseUserList="dialogInfo.operators"
|
||||
>
|
||||
<template name="option" v-slot:option="{ item }">
|
||||
<span class="iconfont iconProlife">{{ item.userName }}</span>
|
||||
</template>
|
||||
</ai-person-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="dialog.visibleStatus = false" size="medium"
|
||||
>取消</el-button
|
||||
>
|
||||
<el-button @click="onConfirm('ruleStatus')" type="primary" size="medium"
|
||||
>确认</el-button
|
||||
>
|
||||
</div>
|
||||
</ai-dialog>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex";
|
||||
export default {
|
||||
name: "storeManagement",
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
areaId: String,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
searchDotime: [],
|
||||
search: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
},
|
||||
unitId: "",
|
||||
total: 10,
|
||||
colConfigs: [
|
||||
{ prop: "shopName", label: "店铺名称", align: "left" },
|
||||
{
|
||||
prop: "shopkeeper",
|
||||
label: "店主",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
prop: "phone",
|
||||
label: "联系电话",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
prop: "shopAddress",
|
||||
label: "店铺地址",
|
||||
align: "left",
|
||||
width: 280,
|
||||
},
|
||||
{
|
||||
prop: "names",
|
||||
label: "店铺操作员",
|
||||
align: "left",
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
label: "状态",
|
||||
align: "center",
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"span",
|
||||
{
|
||||
class: "status-" + params.row.status,
|
||||
},
|
||||
this.$dict.getLabel("assessmentStartStatus", params.row.status)
|
||||
);
|
||||
},
|
||||
},
|
||||
{ slot: "options", label: "操作", align: "center" },
|
||||
],
|
||||
tableData: [],
|
||||
dialog: {
|
||||
title: "",
|
||||
visible: false,
|
||||
visibleStatus: false,
|
||||
},
|
||||
dialogInfo: {
|
||||
shopName: "",
|
||||
shopkeeper: "",
|
||||
phone: "",
|
||||
shopAddress: "",
|
||||
status: "1",
|
||||
areaId: "",
|
||||
operators: [],
|
||||
},
|
||||
formRules: {
|
||||
shopName: [
|
||||
{ required: true, message: "请输入店铺名称", trigger: "change" },
|
||||
],
|
||||
shopkeeper: [
|
||||
{ required: true, message: "请输入店主", trigger: "blur" },
|
||||
],
|
||||
phone: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
|
||||
shopAddress: [
|
||||
{ required: true, message: "请输入店铺地址", trigger: "blur" },
|
||||
],
|
||||
status: [{ required: true, message: "请选择状态", trigger: "blur" }],
|
||||
areaId: [
|
||||
{ required: true, message: "请选择事件区域", trigger: "blur" },
|
||||
],
|
||||
operators: [
|
||||
{ required: true, message: "请选择操作员", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
peopleAjaxUrl: "/admin/user/page",
|
||||
isLevel5: false,
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(["user"]),
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.unitId = this.user.info.unitId;
|
||||
|
||||
this.$dict.load(["assessmentStartStatus"]).then(() => {
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.isLevel5 = this.areaId.substring(this.areaId.length - 3) != "000";
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralshop/list`, null, {
|
||||
params: {
|
||||
...this.search,
|
||||
areaId: this.areaId,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records;
|
||||
this.total = res.data.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
timeChange() {
|
||||
if (this.searchDotime) {
|
||||
this.search.doTimeStart = this.searchDotime[0];
|
||||
this.search.doTimeEnd = this.searchDotime[1];
|
||||
} else {
|
||||
this.search.doTimeStart = null;
|
||||
this.search.doTimeEnd = null;
|
||||
}
|
||||
this.search.current = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
editItem(row) {
|
||||
this.dialogInfo = { ...row };
|
||||
this.dialog.visible = true;
|
||||
},
|
||||
|
||||
statusChage(row) {
|
||||
this.dialogInfo = { ...row };
|
||||
if (this.dialogInfo.operators.length) {
|
||||
this.dialogInfo.operators.map((item) => {
|
||||
item.userName = item.name;
|
||||
});
|
||||
} else {
|
||||
this.dialogInfo.operators = [];
|
||||
}
|
||||
},
|
||||
|
||||
onReset() {
|
||||
this.search.current = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
onConfirm(formName) {
|
||||
if (this.dialogInfo.operators.length) {
|
||||
this.dialogInfo.operators.map((item) => {
|
||||
if (!item.name) {
|
||||
item.name = item.userName;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralshop/addOrUpdate`, this.dialogInfo)
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.onReset();
|
||||
this.onCancel();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
this.dialog.visible = false;
|
||||
this.dialog.visibleStatus = false;
|
||||
},
|
||||
|
||||
init(formName) {
|
||||
this.$refs[formName].clearValidate();
|
||||
Object.keys(this.dialogInfo).forEach((e) => {
|
||||
this.dialogInfo[e] = "";
|
||||
});
|
||||
this.dialogInfo.status = "1";
|
||||
this.dialogInfo.operators = [];
|
||||
},
|
||||
|
||||
getSelect(e) {
|
||||
this.dialogInfo.operators = e;
|
||||
this.dialogInfo.operators.map((item) => {
|
||||
if (!item.name) {
|
||||
item.name = item.userName;
|
||||
}
|
||||
});
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralshop/addOrUpdate`, this.dialogInfo)
|
||||
.then((res) => {
|
||||
this.dialogInfo.operators = []
|
||||
if (res.code == 0) {
|
||||
this.onReset();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.dialogInfo.operators = []
|
||||
})
|
||||
},
|
||||
|
||||
delate(index) {
|
||||
this.dialogInfo.operators.splice(index, 1);
|
||||
},
|
||||
|
||||
onAdd() {
|
||||
Object.keys(this.dialogInfo).forEach((e) => {
|
||||
this.dialogInfo[e] = "";
|
||||
});
|
||||
this.dialogInfo.status = "1";
|
||||
this.dialogInfo.operators = [];
|
||||
this.dialog.visible = true;
|
||||
this.dialogInfo.areaId = this.areaId;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.storeManagement {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background: #f3f6f9;
|
||||
.status-0 {
|
||||
color: #ff4466;
|
||||
}
|
||||
|
||||
.table-options {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.status-1 {
|
||||
color: #2ea222;
|
||||
}
|
||||
|
||||
.status-2 {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.ai-dialog__content--wrapper {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.organ {
|
||||
width: auto;
|
||||
height: auto;
|
||||
padding: 0px 10px;
|
||||
line-height: 32px;
|
||||
border: 1px solid #d0d4dc;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
box-sizing: border-box;
|
||||
color: #666;
|
||||
|
||||
.organzation {
|
||||
background-color: #eee;
|
||||
margin-right: 4px;
|
||||
padding: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user