积分规则 积分维护
This commit is contained in:
@@ -34,19 +34,19 @@
|
|||||||
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
|
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
|
||||||
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
<template slot-scope="{row}">
|
<template slot-scope="{row}">
|
||||||
<el-button type="text" @click="getFamilyByPartyId(row.idNumber)">家庭成员</el-button>
|
<!-- <el-button type="text" @click="getFamilyByPartyId(row.idNumber)">家庭成员</el-button> -->
|
||||||
<el-button type="text" @click="showDetail(row.id)">详情</el-button>
|
<el-button type="text" @click="showDetail(row.id)">详情</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</ai-table>
|
</ai-table>
|
||||||
</template>
|
</template>
|
||||||
</ai-list>
|
</ai-list>
|
||||||
<ai-dialog :visible.sync="dialog" title="家庭成员" :customFooter="true" width="780px" @close="familyList=[]">
|
<!-- <ai-dialog :visible.sync="dialog" title="家庭成员" :customFooter="true" width="780px" @close="familyList=[]">
|
||||||
<ai-table :tableData="familyList" :isShowPagination="false" :col-configs="familyCols" :dict="dict"/>
|
<ai-table :tableData="familyList" :isShowPagination="false" :col-configs="familyCols" :dict="dict"/>
|
||||||
<div class="dialog-footer" slot="footer">
|
<div class="dialog-footer" slot="footer">
|
||||||
<el-button @click="dialog=false">关 闭</el-button>
|
<el-button @click="dialog=false">关 闭</el-button>
|
||||||
</div>
|
</div>
|
||||||
</ai-dialog>
|
</ai-dialog> -->
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -67,9 +67,6 @@ export default {
|
|||||||
{label: "党员姓名", prop: "name", align: "center"},
|
{label: "党员姓名", prop: "name", align: "center"},
|
||||||
{label: "党员类型", prop: "name", align: "center"},
|
{label: "党员类型", prop: "name", align: "center"},
|
||||||
{label: "获得积分", prop: "name", align: "center"},
|
{label: "获得积分", prop: "name", align: "center"},
|
||||||
// {label: "个人积分", prop: "integral", align: "center"},
|
|
||||||
// {label: "家庭积分", prop: "familySurplusIntegral", align: "center"},
|
|
||||||
// {label: "学习强国", prop: "learningIntegral", align: "center"},
|
|
||||||
{slot: "options"}
|
{slot: "options"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
<template>
|
|
||||||
<section class="AppPartyScoreFlow">
|
|
||||||
<component :is="currentPage" v-bind="$props"/>
|
|
||||||
</section>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import PsfList from "./psfList";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "AppPartyScoreFlow",
|
|
||||||
components: {PsfList},
|
|
||||||
label: "积分明细(三涧溪)",
|
|
||||||
props: {
|
|
||||||
instance: Function,
|
|
||||||
dict: Object,
|
|
||||||
permissions: Function
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
currentPage() {
|
|
||||||
return PsfList
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.dict.load("partyIntegralType")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.AppPartyScoreFlow {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,156 +0,0 @@
|
|||||||
<template>
|
|
||||||
<section class="psfList">
|
|
||||||
<ai-list>
|
|
||||||
<ai-title slot="title" title="党员积分明细" isShowBottomBorder/>
|
|
||||||
<template #content>
|
|
||||||
<ai-search-bar>
|
|
||||||
<template #left>
|
|
||||||
<el-button type="primary" icon="iconfont iconAdd" @click="dialog=true">添加</el-button>
|
|
||||||
<el-date-picker type="daterange" placeholder="日期" size="small" clearable v-model="createTime"
|
|
||||||
@change="handleSearchTime" start-placeholder="开始时间" end-placeholder="结束时间"
|
|
||||||
value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00','23:59:59']"/>
|
|
||||||
</template>
|
|
||||||
<template #right>
|
|
||||||
<el-input size="small" placeholder="搜索党员" v-model="search.partyName" clearable
|
|
||||||
@change="page.current=1,getTableData()" suffix-icon="iconfont iconSearch"/>
|
|
||||||
<ai-import :instance="instance" :dict="dict" importUrl="/appcollectiveeconomyequity/import" url="/appcollectiveeconomyequity/downloadTemplate" name="集体经济组织股权管理信息" @success="getTableData(), $message.success('导入成功!')">
|
|
||||||
<el-button size="small">导入</el-button>
|
|
||||||
</ai-import>
|
|
||||||
</template>
|
|
||||||
</ai-search-bar>
|
|
||||||
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size"
|
|
||||||
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
|
|
||||||
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<el-button type="text" @click="showDetail(row)">详情</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</ai-table>
|
|
||||||
</template>
|
|
||||||
</ai-list>
|
|
||||||
<ai-dialog :visible.sync="dialog" title="积分对象" width="600px" @close="form={}" @onConfirm="submit"
|
|
||||||
:customFooter="!isAdd">
|
|
||||||
<el-form v-if="isAdd" :model="form" size="small" ref="DialogForm" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="选择人员" prop="partyId">
|
|
||||||
<ai-select v-model="form.partyId" action="/app/appparty/list" :instance="instance"
|
|
||||||
:prop="{label:'name'}"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="调整说明" prop="remark">
|
|
||||||
<el-input type="textarea" placeholder="请输入" v-model="form.remark" maxlength="100" show-word-limit rows="3"
|
|
||||||
clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="类型" prop="integralType">
|
|
||||||
<ai-select v-model="form.integralType" :selectList="dict.getDict('partyIntegralType')"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="积分" prop="integral">
|
|
||||||
<el-input v-model.number="form.integral" placeholder="请输入正整数" clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<ai-wrapper v-else>
|
|
||||||
<ai-info-item label="对象" :value="form.partyName"/>
|
|
||||||
<ai-info-item label="调整说明" :value="form.remark" isLine/>
|
|
||||||
<ai-info-item label="类型" :value="dict.getLabel('partyIntegralType',form.integralType)"/>
|
|
||||||
<ai-info-item label="积分" :value="form.integral"/>
|
|
||||||
</ai-wrapper>
|
|
||||||
</ai-dialog>
|
|
||||||
</section>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {mapState} from "vuex";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "psfList",
|
|
||||||
props: {
|
|
||||||
instance: Function,
|
|
||||||
dict: Object,
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(['user']),
|
|
||||||
colConfigs() {
|
|
||||||
return [
|
|
||||||
{label: "对象", prop: "partyName"},
|
|
||||||
{label: "调整说明", prop: "remark", align: "center"},
|
|
||||||
{label: "时间", prop: "createTime"},
|
|
||||||
{label: "类型", prop: "integralType", align: "center", dict: "partyIntegralType"},
|
|
||||||
{label: "积分", prop: "integral", align: "center"},
|
|
||||||
{slot: "options"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
isAdd() {
|
|
||||||
return !this.form.id
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
search: {},
|
|
||||||
page: {current: 1, size: 10, total: 0},
|
|
||||||
tableData: [],
|
|
||||||
dialog: false,
|
|
||||||
form: {},
|
|
||||||
rules: {
|
|
||||||
partyId: {required: true, message: "请选择人员"},
|
|
||||||
remark: {required: true, message: "请输入调整说明"},
|
|
||||||
integralType: {required: true, message: "请选择类型"},
|
|
||||||
integral: [
|
|
||||||
{required: true, message: "请输入分数"},
|
|
||||||
{pattern: /^\d+$/g, message: "请输入正整数"}
|
|
||||||
],
|
|
||||||
},
|
|
||||||
createTime: "",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getTableData() {
|
|
||||||
this.instance.post("/app/apppartyintegralinfo/list", null, {
|
|
||||||
params: {...this.page, ...this.search}
|
|
||||||
}).then(res => {
|
|
||||||
if (res?.data) {
|
|
||||||
this.tableData = res.data?.records?.map(e => ({
|
|
||||||
...e,
|
|
||||||
integral: (e.integralType == 0 ? "-" : '+') + e.integral
|
|
||||||
}))
|
|
||||||
this.page.total = res.data.total
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
showDetail(row) {
|
|
||||||
this.form = JSON.parse(JSON.stringify(row))
|
|
||||||
this.dialog = true
|
|
||||||
},
|
|
||||||
submit() {
|
|
||||||
this.$refs.DialogForm.validate(v => {
|
|
||||||
if (v) {
|
|
||||||
let loading = this.$loading({text: "提交中..."})
|
|
||||||
this.instance.post("/app/apppartyintegralinfo/addOrUpdate", this.form).then(res => {
|
|
||||||
loading.close()
|
|
||||||
if (res?.code == 0) {
|
|
||||||
this.$message.success("提交成功!")
|
|
||||||
this.dialog = false
|
|
||||||
this.getTableData()
|
|
||||||
}
|
|
||||||
}).catch(() => loading.close())
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleSearchTime(v) {
|
|
||||||
this.page.current = 1
|
|
||||||
this.search.startTime = v?.[0]
|
|
||||||
this.search.endTime = v?.[1]
|
|
||||||
this.getTableData()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getTableData()
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.psfList {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
75
project/sanjianxi/apps/AppScoreManage/AppScoreManage.vue
Normal file
75
project/sanjianxi/apps/AppScoreManage/AppScoreManage.vue
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
<template>
|
||||||
|
<ai-list>
|
||||||
|
<template slot="title">
|
||||||
|
<ai-title title="积分维护" :isShowBottomBorder="false" :instance="instance" :isShowArea="false" 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)" :ref="tab.name"
|
||||||
|
:areaId="areaId" :instance="instance" :dict="dict" :permissions="permissions"/>
|
||||||
|
<!-- -->
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</template>
|
||||||
|
</ai-list>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import pointsDetails from "./pointsDetails.vue"
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
import scoreChange from "./scoreChange";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AppScoreManage',
|
||||||
|
label: "积分维护(三涧溪)",
|
||||||
|
components: { pointsDetails, scoreChange},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
tabs() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: "积分明细",
|
||||||
|
name: "pointsDetails",
|
||||||
|
comp: pointsDetails,
|
||||||
|
permission: "app_apppartyfee_statistics",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "积分调整",
|
||||||
|
name: "scoreChange",
|
||||||
|
comp: scoreChange,
|
||||||
|
permission: "",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.areaId = this.user.info.areaId
|
||||||
|
this.dict.load("integralCalcType")
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeArea() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs[this.tabs[Number(this.currIndex)].name][0].getList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeName: "pointsDetails",
|
||||||
|
currIndex: '0',
|
||||||
|
areaId: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
||||||
212
project/sanjianxi/apps/AppScoreManage/pointsDetails.vue
Normal file
212
project/sanjianxi/apps/AppScoreManage/pointsDetails.vue
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
<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.partyName"
|
||||||
|
class="search-input"
|
||||||
|
size="small"
|
||||||
|
placeholder="搜索党员"
|
||||||
|
clearable
|
||||||
|
v-throttle="() => {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" :dict="dict"
|
||||||
|
:current.sync="search.current"
|
||||||
|
:size.sync="search.size"
|
||||||
|
@getList="getList">
|
||||||
|
<el-table-column slot="integral" label="积分" align="center">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<span>{{ row.integralType == 1 ? '+' : '-' }}{{ row.integral }}</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" :customFooter="true" :destroyOnClose="true" width="720px">
|
||||||
|
<ai-wrapper>
|
||||||
|
<ai-info-item label="户主:" :value="dialogInfo.familyName"/>
|
||||||
|
<ai-info-item label="对象:" :value="dialogInfo.residentName"/>
|
||||||
|
<ai-info-item label="事件:" :value="dialogInfo.eventDesc" isLine/>
|
||||||
|
<ai-info-item label="时间:" :value="dialogInfo.doTime" isLine/>
|
||||||
|
<ai-info-item label="积分:">
|
||||||
|
{{ dialogInfo.changeIntegral >= 0 ? '增加' : '减少' }}
|
||||||
|
<span style="color:#26f" v-text="Math.abs(dialogInfo.changeIntegral)"/>分
|
||||||
|
</ai-info-item>
|
||||||
|
<ai-info-item label="积分余额:" :value="dialogInfo.nowIntegral"/>
|
||||||
|
</ai-wrapper>
|
||||||
|
<div class="dialog-footer" slot="footer">
|
||||||
|
<el-button @click="dialog=false">关闭</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,
|
||||||
|
partyName: '',
|
||||||
|
startTime: null,
|
||||||
|
endTime: null,
|
||||||
|
},
|
||||||
|
total: 10,
|
||||||
|
colConfigs: [
|
||||||
|
{prop: "partyName", label: "对象", align: "center"},
|
||||||
|
{prop: "remark", label: "调整说明", align: "center"},
|
||||||
|
{prop: "createTime", label: "时间", align: "center"},
|
||||||
|
{prop: "integralType", label: "类型", align: "center", render: (h, {row}) => h('span', `${row.integralType == 0 ? '减分' : '加分'}`)},
|
||||||
|
{slot: "integral", label: "积分", align: "center",},
|
||||||
|
{slot: "options", label: "操作", align: "center"},
|
||||||
|
],
|
||||||
|
tableData: [],
|
||||||
|
dialog: false,
|
||||||
|
dialogInfo: {},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.$dict.load(["integralDeclareDoType","integralDetailType",]).then(() => {
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.instance.post(`/app/apppartyintegralinfo/list`, null, {
|
||||||
|
params: {
|
||||||
|
...this.search,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
if (res?.data) {
|
||||||
|
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 = true
|
||||||
|
this.instance.post(`/app/apppartyintegralinfo/queryDetailById?id=${row.id}`).then((res) => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.dialogInfo = res.data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
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>
|
||||||
147
project/sanjianxi/apps/AppScoreManage/scoreChange.vue
Normal file
147
project/sanjianxi/apps/AppScoreManage/scoreChange.vue
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
<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" :dict="dict"
|
||||||
|
: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?areaId=' + 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="eventDesc">
|
||||||
|
<el-input v-model.trim="form.eventDesc" placeholder="请输入..." type="textarea" :rows="4" show-word-limit
|
||||||
|
maxlength="100"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类型" prop="integralCalcType">
|
||||||
|
<ai-select v-model="form.integralCalcType" :selectList="dict.getDict('integralCalcType')"/>
|
||||||
|
</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'},],
|
||||||
|
eventDesc: [{required: true, message: '请输入调整说明', trigger: 'blur'},],
|
||||||
|
integralCalcType: [{required: true, message: '请选择类型', trigger: 'change'},],
|
||||||
|
changeIntegral: [{required: true, validator: (r, v, cb) => v > 0 ? cb() : cb("请输入正数")}],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
colConfigs() {
|
||||||
|
return [
|
||||||
|
{prop: "residentName", label: "姓名"},
|
||||||
|
{prop: "eventDesc", label: "调整说明"},
|
||||||
|
{prop: "integralCalcType", label: "类型", dict: "integralCalcType", align: 'center'},
|
||||||
|
{prop: "changeIntegral", label: "积分", align: "center", render: (h, {row}) => h('p',{textAlign:'center'}, `${row.integralCalcType > 0 ? '+' : '-'}${row.changeIntegral}`)},
|
||||||
|
{prop: "doTime", label: "操作时间"},
|
||||||
|
{prop: "createUserName", 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).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, type: 0}
|
||||||
|
}).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>
|
||||||
@@ -1,350 +1,74 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="AppScoreRules">
|
<ai-list>
|
||||||
<ai-list v-if="permissions('app_appvillagerintegralrule_detail')">
|
<template slot="title">
|
||||||
<template slot="title">
|
<ai-title title="积分维护" :isShowBottomBorder="false" :instance="instance" :isShowArea="false" v-model="areaId"
|
||||||
<ai-title title="积分规则" isShowBottomBorder></ai-title>
|
@change="changeArea"></ai-title>
|
||||||
</template>
|
</template>
|
||||||
<template slot="content">
|
<template slot="tabs">
|
||||||
<ai-search-bar bottomBorder>
|
<el-tabs v-model="currIndex">
|
||||||
<template slot="left">
|
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label">
|
||||||
<ai-select
|
<component :is="tab.comp" v-if="currIndex === String(i)" :ref="tab.name"
|
||||||
v-model="search.status"
|
:areaId="areaId" :instance="instance" :dict="dict" :permissions="permissions"/>
|
||||||
@change="page.current = 1, getList()"
|
</el-tab-pane>
|
||||||
placeholder="请选择状态"
|
</el-tabs>
|
||||||
:selectList="dict.getDict('integralRuleStatus')">
|
</template>
|
||||||
</ai-select>
|
</ai-list>
|
||||||
</template>
|
|
||||||
<template slot="right">
|
|
||||||
<el-input size="small" placeholder="事件名称" v-model="search.partyName" clearable
|
|
||||||
@change="page.current=1,getTableData()" suffix-icon="iconfont iconSearch"/>
|
|
||||||
</template>
|
|
||||||
</ai-search-bar>
|
|
||||||
|
|
||||||
<ai-search-bar style="margin-top: 16px;">
|
|
||||||
<template #left>
|
|
||||||
<el-button type="primary" icon="iconfont iconAdd" @click="dialog=true">添加</el-button>
|
|
||||||
</template>
|
|
||||||
</ai-search-bar>
|
|
||||||
|
|
||||||
<ai-table
|
|
||||||
:tableData="tableData"
|
|
||||||
:col-configs="colConfigs"
|
|
||||||
:total="page.total" :dict="dict"
|
|
||||||
:current.sync="page.current"
|
|
||||||
:size.sync="page.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.status == 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-empty v-else>暂无应用权限</ai-empty>
|
|
||||||
|
|
||||||
<ai-dialog :title="dialogTitle" :visible.sync="dialog" @onConfirm="onConfirm" @closed="form={ladderRule: [],pass: 0}" width="800px">
|
|
||||||
<div class="form_div">
|
|
||||||
<el-form ref="DialogForm" :model="form" :rules="formRules" size="small" label-suffix=":" label-width="100px">
|
|
||||||
|
|
||||||
<el-form-item label="事件名称" prop="eventType">
|
|
||||||
<el-input v-model="form.name" clearable placeholder="请输入事件名称" type="text" maxlength="30" show-word-limit/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="简介说明" prop="eventType">
|
|
||||||
<el-input v-model="form.name" clearable placeholder="请输入简介说明" type="text" maxlength="100" show-word-limit/>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="规则" prop="ruleType" required>
|
|
||||||
<el-radio-group v-model="form.pass" @change="typeChange">
|
|
||||||
<el-radio :label="0">常规</el-radio>
|
|
||||||
<el-radio :label="1">区间</el-radio>
|
|
||||||
<el-radio :label="2">阶梯</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="周期范围" prop="scoringCycle">
|
|
||||||
<ai-select v-model="form.scoringCycle" :selectList="dict.getDict('integralRuleScoringCycle')"/>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="奖励次数">
|
|
||||||
<el-input placeholder="请输入,周期范围内,不填写表示不限制" v-model.number="form.numberLimit" clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- 常规 -->
|
|
||||||
<el-form-item label="积分分值" prop="integral" v-if="form.pass == 0">
|
|
||||||
<el-input placeholder="请输入" v-model="form.integral" clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- 区间 -->
|
|
||||||
<el-form-item label="积分分值" prop="integral" v-if="form.pass == 1">
|
|
||||||
<ai-range v-model="form.num" ref="resetagefoo" />
|
|
||||||
</el-form-item>
|
|
||||||
<!-- 阶梯 -->
|
|
||||||
<el-form-item label="积分分值" prop="integral" v-if="form.pass == 2">
|
|
||||||
<el-button type="text" @click="innerVisible = true" style="float: right;">添加</el-button>
|
|
||||||
<ai-table :tableData="integralData" :isShowPagination="false" :col-configs="integralConfigs" :dict="dict">
|
|
||||||
<el-table-column slot="options" align="center" label="操作" fixed="right" width="160px">
|
|
||||||
<el-row type="flex" justify="center" align="middle" slot-scope="{row}">
|
|
||||||
<el-button v-if="$permissions('admin_sysuser_distribute')&&!!row.sysUserId"
|
|
||||||
type="text" @click="appAllot(row)">删除
|
|
||||||
</el-button>
|
|
||||||
</el-row>
|
|
||||||
</el-table-column>
|
|
||||||
</ai-table>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-dialog width="30%" title="添加积分分值" :visible.sync="innerVisible" append-to-body>
|
|
||||||
<el-form ref="innerForm" :model="table" :rules="formRules" size="small" label-suffix=":" label-width="100px">
|
|
||||||
<el-form-item label="加分项" prop="integral">
|
|
||||||
<ai-select v-model="form.scoringCycle" :selectList="dict.getDict('integralRuleScoringCycle')"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="获得积分">
|
|
||||||
<el-input placeholder="请输入" v-model="form.integral" disabled/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="innerVisible = false">取 消</el-button>
|
|
||||||
<el-button type="primary" @click="save">保存</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ai-dialog>
|
|
||||||
</section>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import applyForIntegral from "./components/applyForIntegral.vue"
|
||||||
|
import automaticallyAddCent from "./components/automaticallyAddCent.vue";
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AppScoreRules",
|
name: 'AppScoreManage',
|
||||||
label: "积分规则(三涧溪)",
|
label: "积分维护(三涧溪)",
|
||||||
|
components: { applyForIntegral, automaticallyAddCent},
|
||||||
props: {
|
props: {
|
||||||
instance: Function,
|
instance: Function,
|
||||||
dict: Object,
|
dict: Object,
|
||||||
permissions: Function
|
permissions: Function
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
isEdit() {
|
...mapState(['user']),
|
||||||
return !!this.form.id
|
tabs() {
|
||||||
},
|
return [
|
||||||
dialogTitle() {
|
{
|
||||||
return this.isEdit ? "编辑积分规则" : "添加积分规则"
|
label: "积分申请",
|
||||||
},
|
name: "applyForIntegral",
|
||||||
etOps() {
|
comp: applyForIntegral,
|
||||||
return {
|
permission: "app_apppartyfee_statistics",
|
||||||
lazy: true,
|
},
|
||||||
value: "dictValue",
|
{
|
||||||
label: "dictName",
|
label: "自动加分",
|
||||||
lazyLoad: (node, resolve) => {
|
name: "automaticallyAddCent",
|
||||||
if (node.level == 0) resolve(this.dict.getDict('integralRuleEvent'))
|
comp: automaticallyAddCent,
|
||||||
else if (node.level == 1) {
|
permission: "",
|
||||||
let dict = 'integralRuleEvent' + node.value
|
},
|
||||||
this.dict.load(dict).then(() => {
|
]
|
||||||
let nodes = this.dict.getDict(dict).map(e => ({...e, leaf: true}))
|
}
|
||||||
resolve(nodes)
|
},
|
||||||
})
|
created() {
|
||||||
}
|
this.areaId = this.user.info.areaId
|
||||||
}
|
this.dict.load("integralCalcType")
|
||||||
}
|
},
|
||||||
},
|
methods: {
|
||||||
|
changeArea() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs[this.tabs[Number(this.currIndex)].name][0].getList()
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
search: {status: "", eventType: null},
|
activeName: "pointsDetails",
|
||||||
page: {current: 1, size: 10, total: 0},
|
currIndex: '0',
|
||||||
colConfigs: [
|
areaId: ''
|
||||||
{prop: "event", label: "事件名称", dict: "integralRuleEvent"},
|
|
||||||
{prop: "type", label: "简介", dict: "integralRuleEventType"},
|
|
||||||
{prop: "ruleType", label: "规则", dict: "integralRuleRuleType"},
|
|
||||||
{prop: "scoringCycle", label: "周期范围", dict: "integralRuleScoringCycle"},
|
|
||||||
{prop: "status", label: "状态", align: "center", width: 96, dict: "integralRuleStatus"},
|
|
||||||
{slot: "options", label: "操作", align: "center"},
|
|
||||||
],
|
|
||||||
integralConfigs: [
|
|
||||||
{prop: "event", label: "加分项", dict: "integralRuleEvent"},
|
|
||||||
{prop: "event", label: "获得积分", dict: "integralRuleEvent"},
|
|
||||||
{slot: "options", label: "操作", align: "center"},
|
|
||||||
],
|
|
||||||
tableData: [],
|
|
||||||
dialog: false,
|
|
||||||
form: {
|
|
||||||
ladderRule: [],
|
|
||||||
pass: 0,
|
|
||||||
},
|
|
||||||
formRules: {
|
|
||||||
eventType: [{required: true, message: "请选择事件/类型", trigger: "change"}],
|
|
||||||
scoringCycle: [{required: true, message: "请选择周期范围", trigger: "change"}],
|
|
||||||
integral: [{required: true, pattern: /^\d*[.\d]\d?$/, message: "请输入积分分值,最多保留一位小数"}],
|
|
||||||
numberLimit: [{pattern: /^\d*$/, message: "请输入正整数"}]
|
|
||||||
},
|
|
||||||
cacheOps: [],
|
|
||||||
integralFrom: '',
|
|
||||||
integralTo: '',
|
|
||||||
integralData: [],
|
|
||||||
innerVisible: false,
|
|
||||||
table: {},
|
|
||||||
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.dict.load("integralRuleStatus", "integralRuleRuleType", 'integralRuleScoringCycle', 'integralRuleEvent', 'integralRuleEventType').then(() => {
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getList() {
|
|
||||||
this.instance.post(`/app/appvillagerintegralrule/list`, null, {
|
|
||||||
params: {...this.search, ...this.page},
|
|
||||||
}).then(res => {
|
|
||||||
if (res?.data) {
|
|
||||||
this.tableData = res.data.records;
|
|
||||||
this.page.total = res.data.total;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
toEdit(row) {
|
|
||||||
this.form = this.$copy(row)
|
|
||||||
let {ladderRule, event, type} = this.form,
|
|
||||||
dict = 'integralRuleEvent' + event
|
|
||||||
this.dict.load(dict).then(() => {
|
|
||||||
this.form.eventType = [event, type]
|
|
||||||
this.form.ladderRule = JSON.parse(ladderRule || "[]")
|
|
||||||
this.cacheOps = this.dict.getDict('integralRuleEvent').map(e => {
|
|
||||||
if (e.dictValue == event) {
|
|
||||||
e.children = this.dict.getDict(dict).map(d => ({...d, leaf: true}))
|
|
||||||
}
|
|
||||||
return e
|
|
||||||
})
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.dialog = true
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 保存
|
|
||||||
save() {
|
|
||||||
this.$refs.innerForm.validate((valid)=>{
|
|
||||||
if (valid) {
|
|
||||||
this.innerData.push(this.table)
|
|
||||||
}
|
|
||||||
this.innerVisible = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
typeChange(val) {
|
|
||||||
this.form.pass = val
|
|
||||||
},
|
|
||||||
|
|
||||||
handleInputFrom(event) {
|
|
||||||
this.$emit('focusfrom', event)
|
|
||||||
},
|
|
||||||
|
|
||||||
handleInputTo(event) {
|
|
||||||
this.$emit('blurto', event)
|
|
||||||
},
|
|
||||||
|
|
||||||
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) {
|
|
||||||
let 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.page.current = 1
|
|
||||||
this.search.classification = ""
|
|
||||||
this.search.integralType = ""
|
|
||||||
this.search.ruleStatus = ""
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
onConfirm() {
|
|
||||||
if(this.form.ruleType==1 && !this.form.ladderRule.length) {
|
|
||||||
return this.$message.error('请添加规则')
|
|
||||||
}
|
|
||||||
this.$refs.DialogForm.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
let formData = this.$copy(this.form)
|
|
||||||
formData.ladderRule = JSON.stringify(formData.ladderRule)
|
|
||||||
formData.integral = formData.integral || 0
|
|
||||||
this.instance.post(`/app/appvillagerintegralrule/addOrUpdate`, formData).then((res) => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.$message.success(`${this.isEdit ? '编辑成功' : '添加成功'}`)
|
|
||||||
this.onReset()
|
|
||||||
this.dialog = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleTypeSearch(v) {
|
|
||||||
this.search.event = v?.[0]
|
|
||||||
this.search.type = v?.[1]
|
|
||||||
this.page.current = 1
|
|
||||||
this.$refs.eventTypeSearch.dropDownVisible = false
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
handleTypeForm(v) {
|
|
||||||
if (this.dialog) {
|
|
||||||
this.form.event = v?.[0]
|
|
||||||
this.form.type = v?.[1]
|
|
||||||
this.form.ruleType = !this.form.event ? null : this.form.event == 3 ? 1 : 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleDelete(i) {
|
|
||||||
this.$confirm("是否要删除该规则?").then(() => {
|
|
||||||
this.form.ladderRule.splice(i, 1)
|
|
||||||
}).catch(() => 0)
|
|
||||||
},
|
|
||||||
checkIntegral(v) {
|
|
||||||
return /\.\d{2,}$/.test(v) ? Math.abs(v).toFixed(1) : Math.abs(v)
|
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.AppScoreRules {
|
|
||||||
height: 100%;
|
|
||||||
background: #f3f6f9;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,377 @@
|
|||||||
|
<template>
|
||||||
|
<section class="applyForIntegral">
|
||||||
|
<ai-list v-if="permissions('app_appvillagerintegralrule_detail')">
|
||||||
|
<template slot="content">
|
||||||
|
<ai-search-bar bottomBorder>
|
||||||
|
<template slot="left">
|
||||||
|
<ai-select
|
||||||
|
v-model="search.status"
|
||||||
|
@change="page.current = 1, getList()"
|
||||||
|
placeholder="请选择状态"
|
||||||
|
:selectList="dict.getDict('integralRuleStatus')">
|
||||||
|
</ai-select>
|
||||||
|
</template>
|
||||||
|
<template slot="right">
|
||||||
|
<el-input size="small" placeholder="事件名称" v-model="search.partyName" clearable
|
||||||
|
@change="page.current=1,getTableData()" suffix-icon="iconfont iconSearch"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
|
||||||
|
<ai-search-bar style="margin-top: 16px;">
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" icon="iconfont iconAdd" @click="dialog=true">添加</el-button>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
|
||||||
|
<ai-table
|
||||||
|
:tableData="tableData"
|
||||||
|
:col-configs="colConfigs"
|
||||||
|
:total="page.total" :dict="dict"
|
||||||
|
:current.sync="page.current"
|
||||||
|
:size.sync="page.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.status == 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-empty v-else>暂无应用权限</ai-empty>
|
||||||
|
|
||||||
|
<ai-dialog :title="dialogTitle" :visible.sync="dialog" @onConfirm="onConfirm" @closed="close" width="800px">
|
||||||
|
<div class="form_div">
|
||||||
|
<el-form ref="DialogForm" :model="form" :rules="formRules" size="small" label-suffix=":" label-width="100px">
|
||||||
|
|
||||||
|
<el-form-item label="事件名称" prop="eventName">
|
||||||
|
<el-input v-model="form.eventName" clearable placeholder="请输入事件名称" type="text" maxlength="30" show-word-limit/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="简介说明" prop="eventDesc">
|
||||||
|
<el-input v-model="form.eventDesc" clearable placeholder="请输入简介说明" type="text" maxlength="100" show-word-limit/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="规则" prop="ruleType" required>
|
||||||
|
<el-radio-group v-model="form.ruleType" @change="typeChange">
|
||||||
|
<el-radio :label="0">常规</el-radio>
|
||||||
|
<el-radio :label="2">区间</el-radio>
|
||||||
|
<el-radio :label="1">阶梯</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="周期范围" prop="scoringCycle">
|
||||||
|
<ai-select v-model="form.scoringCycle" :selectList="dict.getDict('integralRuleScoringCycle')"/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="奖励次数">
|
||||||
|
<el-input placeholder="请输入,周期范围内,不填写表示不限制" v-model.number="form.numberLimit" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 常规 -->
|
||||||
|
<el-form-item label="积分分值" prop="integral" v-if="form.ruleType == 0">
|
||||||
|
<el-input placeholder="请输入" v-model="form.integral" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 区间 -->
|
||||||
|
<el-form-item label="积分分值" prop="integralArr" v-if="form.ruleType == 2">
|
||||||
|
<ai-range v-model="form.integralArr" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 阶梯 -->
|
||||||
|
<el-form-item label="积分分值" prop="ladderIntegral" v-if="form.ruleType == 1">
|
||||||
|
<el-row type="flex" justify="space-between">
|
||||||
|
<div></div>
|
||||||
|
<el-button v-if="form.ruleType==1" type="text" icon="iconfont iconAdd"
|
||||||
|
@click="form.ladderIntegral.push({ viewCount: null, integral: null })">添加
|
||||||
|
</el-button>
|
||||||
|
</el-row>
|
||||||
|
<el-table v-if="form.ruleType==1" :data="form.ladderIntegral" size="mini" border stripe>
|
||||||
|
<el-table-column label="加分项" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<el-input class="tableInput" v-model.number="row.viewCount" clearable placeholder="请输入"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="获得积分" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<el-input class="tableInput" v-model="row.integral" clearable placeholder="请输入" type="number"
|
||||||
|
@keyup.native="row.integral=checkIntegral(row.integral)"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template slot-scope="{ $index }">
|
||||||
|
<el-button type="text" @click="handleDelete($index)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ai-dialog>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "applyForIntegral",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isEdit() {
|
||||||
|
return !!this.form.id
|
||||||
|
},
|
||||||
|
dialogTitle() {
|
||||||
|
return this.isEdit ? "编辑积分规则" : "添加积分规则"
|
||||||
|
},
|
||||||
|
etOps() {
|
||||||
|
return {
|
||||||
|
lazy: true,
|
||||||
|
value: "dictValue",
|
||||||
|
label: "dictName",
|
||||||
|
lazyLoad: (node, resolve) => {
|
||||||
|
if (node.level == 0) resolve(this.dict.getDict('integralRuleEvent'))
|
||||||
|
else if (node.level == 1) {
|
||||||
|
let dict = 'integralRuleEvent' + node.value
|
||||||
|
this.dict.load(dict).then(() => {
|
||||||
|
let nodes = this.dict.getDict(dict).map(e => ({...e, leaf: true}))
|
||||||
|
resolve(nodes)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
search: {status: "", eventType: null},
|
||||||
|
page: {current: 1, size: 10, total: 0},
|
||||||
|
colConfigs: [
|
||||||
|
{prop: "event", label: "事件名称", dict: "integralRuleEvent"},
|
||||||
|
{prop: "type", label: "简介", dict: "integralRuleEventType"},
|
||||||
|
{prop: "ruleType", label: "规则", dict: "integralRuleRuleType"},
|
||||||
|
{prop: "scoringCycle", label: "周期范围", dict: "integralRuleScoringCycle"},
|
||||||
|
{prop: "status", label: "状态", align: "center", width: 96, dict: "integralRuleStatus"},
|
||||||
|
{slot: "options", label: "操作", align: "center"},
|
||||||
|
],
|
||||||
|
integralConfigs: [
|
||||||
|
{prop: "event", label: "加分项", dict: "integralRuleEvent"},
|
||||||
|
{prop: "event", label: "获得积分", dict: "integralRuleEvent"},
|
||||||
|
{slot: "options", label: "操作", align: "center"},
|
||||||
|
],
|
||||||
|
tableData: [],
|
||||||
|
dialog: false,
|
||||||
|
form: {
|
||||||
|
eventName: '',
|
||||||
|
eventDesc: '',
|
||||||
|
ruleType: 0,
|
||||||
|
scoringCycle: '',
|
||||||
|
numberLimit: '', //奖励次数
|
||||||
|
integral: '', // 常规
|
||||||
|
integralMin: '', // 区间
|
||||||
|
integralMax: '',
|
||||||
|
integralArr: [],
|
||||||
|
ladderRule: '', // 阶梯
|
||||||
|
ladderIntegral: [],
|
||||||
|
},
|
||||||
|
formRules: {
|
||||||
|
eventName: [{required: true, message: "请输入事件名称" }],
|
||||||
|
eventDesc: [{required: true, message: "请输入简介说明" }],
|
||||||
|
ruleType: [{required: true, message: "请选择规则" }],
|
||||||
|
scoringCycle: [{required: true, message: "请选择周期范围" }],
|
||||||
|
integral: [{required: true, pattern: /^\d*[.\d]\d?$/, message: "请输入积分分值,最多保留一位小数"}],
|
||||||
|
numberLimit: [{pattern: /^\d*$/, message: "请输入正整数"}],
|
||||||
|
integralArr: [{required: true, message: "请输入积分分值"}],
|
||||||
|
ladderIntegral: [{required: true, message: "请输入积分分值"}]
|
||||||
|
},
|
||||||
|
cacheOps: [],
|
||||||
|
integralFrom: '',
|
||||||
|
integralTo: '',
|
||||||
|
integralData: [],
|
||||||
|
innerVisible: false,
|
||||||
|
table: {},
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("integralRuleStatus", "integralRuleRuleType", 'integralRuleScoringCycle', 'integralRuleEvent', 'integralRuleEventType').then(() => {
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.instance.post(`/app/appvillagerintegralrule/list`, null, {
|
||||||
|
params: {...this.search, ...this.page},
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data.records;
|
||||||
|
this.page.total = res.data.total;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
toEdit(row) {
|
||||||
|
this.form = this.$copy(row)
|
||||||
|
let {ladderRule, event, type} = this.form,
|
||||||
|
dict = 'integralRuleEvent' + event
|
||||||
|
this.dict.load(dict).then(() => {
|
||||||
|
this.form.eventType = [event, type]
|
||||||
|
this.form.ladderRule = JSON.parse(ladderRule || "[]")
|
||||||
|
this.cacheOps = this.dict.getDict('integralRuleEvent').map(e => {
|
||||||
|
if (e.dictValue == event) {
|
||||||
|
e.children = this.dict.getDict(dict).map(d => ({...d, leaf: true}))
|
||||||
|
}
|
||||||
|
return e
|
||||||
|
})
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.dialog = true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 保存
|
||||||
|
save() {
|
||||||
|
this.$refs.innerForm.validate((valid)=>{
|
||||||
|
if (valid) {
|
||||||
|
this.innerData.push(this.table)
|
||||||
|
}
|
||||||
|
this.innerVisible = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
close() {
|
||||||
|
this.form = {
|
||||||
|
eventName: '',
|
||||||
|
eventDesc: '',
|
||||||
|
ruleType: 0,
|
||||||
|
scoringCycle: '',
|
||||||
|
numberLimit: '',
|
||||||
|
integral: '',
|
||||||
|
integralMin: '',
|
||||||
|
integralMax: '',
|
||||||
|
ladderRule: [],
|
||||||
|
integralArr: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
typeChange(val) {
|
||||||
|
this.form.ruleType = val
|
||||||
|
this.form.scoringCycle = ''
|
||||||
|
this.form.numberLimit = ''
|
||||||
|
this.form.integral = ''
|
||||||
|
this.form.integralArr = []
|
||||||
|
this.form.ladderRule = []
|
||||||
|
},
|
||||||
|
|
||||||
|
handleInputFrom(event) {
|
||||||
|
this.$emit('focusfrom', event)
|
||||||
|
},
|
||||||
|
|
||||||
|
handleInputTo(event) {
|
||||||
|
this.$emit('blurto', event)
|
||||||
|
},
|
||||||
|
|
||||||
|
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) {
|
||||||
|
let 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.page.current = 1
|
||||||
|
this.search.classification = ""
|
||||||
|
this.search.integralType = ""
|
||||||
|
this.search.ruleStatus = ""
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
onConfirm() {
|
||||||
|
this.$refs.DialogForm.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.form.integralMin = this.form.integralArr[0]
|
||||||
|
this.form.integralMax = this.form.integralArr[1]
|
||||||
|
this.form.ladderRule = JSON.stringify(this.form.ladderIntegral)
|
||||||
|
|
||||||
|
this.instance.post(`/app/apppartyintegralrule/addOrUpdate`, {
|
||||||
|
...this.form,
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success(`${this.isEdit ? '编辑成功' : '添加成功'}`)
|
||||||
|
this.onReset()
|
||||||
|
this.dialog = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleTypeSearch(v) {
|
||||||
|
this.search.event = v?.[0]
|
||||||
|
this.search.type = v?.[1]
|
||||||
|
this.page.current = 1
|
||||||
|
this.$refs.eventTypeSearch.dropDownVisible = false
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
handleTypeForm(v) {
|
||||||
|
if (this.dialog) {
|
||||||
|
this.form.event = v?.[0]
|
||||||
|
this.form.type = v?.[1]
|
||||||
|
this.form.ruleType = !this.form.event ? null : this.form.event == 3 ? 1 : 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleDelete(i) {
|
||||||
|
this.$confirm("是否要删除该规则?").then(() => {
|
||||||
|
this.form.ladderRule.splice(i, 1)
|
||||||
|
}).catch(() => 0)
|
||||||
|
},
|
||||||
|
checkIntegral(v) {
|
||||||
|
return /\.\d{2,}$/.test(v) ? Math.abs(v).toFixed(1) : Math.abs(v)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.applyForIntegral {
|
||||||
|
height: 100%;
|
||||||
|
background: #f3f6f9;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
<template>
|
||||||
|
<div class="">
|
||||||
|
<template>
|
||||||
|
<ai-search-bar style="margin-top: 16px;">
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" icon="iconfont iconAdd" @click="dialog=true">添加</el-button>
|
||||||
|
</template>
|
||||||
|
<template #content>
|
||||||
|
<ai-table
|
||||||
|
:tableData="tableData"
|
||||||
|
:col-configs="colConfigs"
|
||||||
|
:total="page.total" :dict="dict"
|
||||||
|
:current.sync="page.current"
|
||||||
|
:size.sync="page.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.status == 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-search-bar>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "applyForIntegral",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableData: [],
|
||||||
|
page: {current: 1, size: 10, total: 0},
|
||||||
|
colConfigs: [
|
||||||
|
{prop: "event", label: "事件名称", dict: "integralRuleEvent"},
|
||||||
|
{prop: "type", label: "简介", dict: "integralRuleEventType"},
|
||||||
|
{prop: "ruleType", label: "规则", dict: "integralRuleRuleType"},
|
||||||
|
{prop: "scoringCycle", label: "周期范围", dict: "integralRuleScoringCycle"},
|
||||||
|
{prop: "status", label: "状态", align: "center", width: 96, dict: "integralRuleStatus"},
|
||||||
|
{slot: "options", label: "操作", align: "center"},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
create() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
|
||||||
|
},
|
||||||
|
toEdit(row) {
|
||||||
|
this.form = this.$copy(row)
|
||||||
|
let {ladderRule, event, type} = this.form,
|
||||||
|
dict = 'integralRuleEvent' + event
|
||||||
|
this.dict.load(dict).then(() => {
|
||||||
|
this.form.eventType = [event, type]
|
||||||
|
this.form.ladderRule = JSON.parse(ladderRule || "[]")
|
||||||
|
this.cacheOps = this.dict.getDict('integralRuleEvent').map(e => {
|
||||||
|
if (e.dictValue == event) {
|
||||||
|
e.children = this.dict.getDict(dict).map(d => ({...d, leaf: true}))
|
||||||
|
}
|
||||||
|
return e
|
||||||
|
})
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.dialog = true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
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) {
|
||||||
|
let 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();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
57
project/xiushan/apps/AppCreditInquiry/AppCreditInquiry.vue
Normal file
57
project/xiushan/apps/AppCreditInquiry/AppCreditInquiry.vue
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<template>
|
||||||
|
<section class="AppCreditInquiry">
|
||||||
|
<!-- <keep-alive :include="['List']">
|
||||||
|
<component ref="component" :is="component" :instance="instance" :params="params" :dict="dict" @change="onChange"/>
|
||||||
|
</keep-alive> -->
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import List from "./components/List.vue";
|
||||||
|
// import Add from "./components/Add.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppCreditInquiry",
|
||||||
|
label: "信用查询",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
},
|
||||||
|
// components: {Add, List},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
component: "List",
|
||||||
|
params: {},
|
||||||
|
include: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onChange(data) {
|
||||||
|
if (data.type === "Add") {
|
||||||
|
this.component = "Add";
|
||||||
|
this.params = data.params;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.type === "List") {
|
||||||
|
this.component = "List";
|
||||||
|
this.params = data.params;
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (data.isRefresh) {
|
||||||
|
this.$refs.component.getTableData();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("portalUserStatus", "enterpriseStatus", "userEnterpriseStatus","enterpriseType")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.AppCreditInquiry {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user