积分维护

This commit is contained in:
shijingjing
2022-06-29 18:44:06 +08:00
parent d7568eb799
commit 39f5bcbd5a
5 changed files with 36 additions and 78 deletions

View File

@@ -34,19 +34,12 @@
@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="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-table :tableData="familyList" :isShowPagination="false" :col-configs="familyCols" :dict="dict"/>
<div class="dialog-footer" slot="footer">
<el-button @click="dialog=false"> </el-button>
</div>
</ai-dialog> -->
</section> </section>
</template> </template>
@@ -70,18 +63,6 @@ export default {
{slot: "options"} {slot: "options"}
] ]
}, },
familyCols() {
return [
{
label: '与户主关系', prop: 'householdRelation', align: 'center', width: 165,
render: (h, {row}) => h('p', this.dict.getLabel('householdRelation', row.householdRelation || "户主"))
},
{label: '类型', prop: 'residentType', align: 'center', dict: "residentType"},
{label: '姓名', prop: 'name', align: 'center'},
{label: '身份证号', render: (h, {row}) => h('p', this.idCardNoUtil.hideId(row.idNumber)), width: 165},
{label: '联系电话', prop: 'phone', align: 'center', width: 120}
]
}
}, },
data() { data() {
return { return {
@@ -90,8 +71,6 @@ export default {
}, },
page: {current: 1, size: 10, total: 0}, page: {current: 1, size: 10, total: 0},
tableData: [], tableData: [],
dialog: false,
familyList: [],
organizationName: '', organizationName: '',
organizationTree: [], organizationTree: [],
defaultExpanded: [], defaultExpanded: [],
@@ -148,16 +127,6 @@ export default {
showDetail(id) { showDetail(id) {
this.$router.push({query: {id}}) this.$router.push({query: {id}})
}, },
getFamilyByPartyId(idNumber) {
this.instance.post("/app/appresident/queryHomeMember", null, {
params: {idNumber}
}).then(res => {
if (res?.data) {
this.familyList = res.data?.family || []
this.dialog = true
}
})
}
}, },
created() { created() {
this.getTableData() this.getTableData()

View File

@@ -47,15 +47,13 @@
</ai-list> </ai-list>
<ai-dialog title="详情" :visible.sync="dialog" :customFooter="true" :destroyOnClose="true" width="720px"> <ai-dialog title="详情" :visible.sync="dialog" :customFooter="true" :destroyOnClose="true" width="720px">
<ai-wrapper> <ai-wrapper>
<ai-info-item label="户主" :value="dialogInfo.familyName"/> <ai-info-item label="党员" :value="dialogInfo.partyName" isLine/>
<ai-info-item label="对象" :value="dialogInfo.residentName"/> <ai-info-item label="事件" :value="dict.getLabel('partyIntegralDetailType',dialogInfo.type)" dict/>
<ai-info-item label="事件" :value="dialogInfo.eventDesc" isLine/> <ai-info-item label="类型">
<ai-info-item label="时间:" :value="dialogInfo.doTime" isLine/> {{ dialogInfo.partyIntegralDetailType == 1 ? '加分' : '减分' }}
<ai-info-item label="积分:">
{{ dialogInfo.changeIntegral >= 0 ? '增加' : '减少' }}
<span style="color:#26f" v-text="Math.abs(dialogInfo.changeIntegral)"/>
</ai-info-item> </ai-info-item>
<ai-info-item label="积分余额" :value="dialogInfo.nowIntegral"/> <ai-info-item label="分值" :value="dialogInfo.integral" isLine/>
<ai-info-item label="时间:" :value="dialogInfo.createTime" isLine/>
</ai-wrapper> </ai-wrapper>
<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>
@@ -100,7 +98,7 @@ export default {
}, },
mounted() { mounted() {
this.$dict.load(["integralDeclareDoType","integralDetailType",]).then(() => { this.$dict.load(["integralDeclareDoType","integralDetailType","partyIntegralDetailType"]).then(() => {
this.getList(); this.getList();
}); });
}, },
@@ -122,11 +120,11 @@ export default {
timeChange() { timeChange() {
if (this.searchDotime) { if (this.searchDotime) {
this.search.doTimeStart = this.searchDotime[0] this.search.startTime = this.searchDotime[0]
this.search.doTimeEnd = this.searchDotime[1] this.search.endTime = this.searchDotime[1]
} else { } else {
this.search.doTimeStart = null this.search.startTime = null
this.search.doTimeEnd = null this.search.endTime = null
} }
this.search.current = 1 this.search.current = 1
this.getList() this.getList()

View File

@@ -7,8 +7,6 @@
<el-button type="primary" icon="iconfont iconAdd" @click="dialog=true" <el-button type="primary" icon="iconfont iconAdd" @click="dialog=true"
:disabled="!permissions('app_appvillagerintegraldetail_change')">添加 :disabled="!permissions('app_appvillagerintegraldetail_change')">添加
</el-button> </el-button>
<ai-import :instance="instance" :dict="dict" name="积分调整" type="appvillagerintegraldetail"
v-if="permissions('app_appvillagerintegraldetail_change')" @success="getList"/>
</template> </template>
</ai-search-bar> </ai-search-bar>
<ai-table <ai-table
@@ -47,7 +45,7 @@
<ai-select v-model="form.integralCalcType" :selectList="dict.getDict('integralCalcType')"/> <ai-select v-model="form.integralCalcType" :selectList="dict.getDict('integralCalcType')"/>
</el-form-item> </el-form-item>
<el-form-item label="积分" prop="changeIntegral"> <el-form-item label="积分" prop="changeIntegral">
<el-input v-model.trim.num="form.changeIntegral" placeholder="请输入正数" size="small"></el-input> <el-input v-model.trim.num ="form.changeIntegral" placeholder="请输入正数" size="small"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ai-dialog> </ai-dialog>

View File

@@ -162,8 +162,6 @@ export default {
search: {status: "", eventName: ""}, search: {status: "", eventName: ""},
page: {current: 1, size: 10, total: 0}, page: {current: 1, size: 10, total: 0},
colConfigs: [ colConfigs: [
// {prop: "event", label: "事件", dict: "integralRuleEvent", align: "center"},
// {prop: "type", label: "类型", dict: "integralRuleEventType", align: "center"},
{prop: "eventName", label: "事件名称", dict: "integralRuleEvent", align: "center"}, {prop: "eventName", label: "事件名称", dict: "integralRuleEvent", align: "center"},
{prop: "eventDesc", label: "简介", dict: "integralRuleEventType", align: "center"}, {prop: "eventDesc", label: "简介", dict: "integralRuleEventType", align: "center"},
{prop: "ruleType", label: "规则", dict: "integralRuleRuleType", align: "center"}, {prop: "ruleType", label: "规则", dict: "integralRuleRuleType", align: "center"},
@@ -179,10 +177,10 @@ export default {
tableData: [], tableData: [],
dialog: false, dialog: false,
form: { form: {
classify: 0, classify: '0',
eventName: '', eventName: '',
eventDesc: '', eventDesc: '',
ruleType: 0, ruleType: '0',
scoringCycle: '', scoringCycle: '',
numberLimit: '', //奖励次数 numberLimit: '', //奖励次数
integral: '', // 常规 integral: '', // 常规
@@ -231,25 +229,14 @@ export default {
this.form.ladderIntegral.push({ viewCount: null, integral: null }) this.form.ladderIntegral.push({ viewCount: null, integral: null })
}, },
toEdit(row) { toEdit(row) {
console.log(row); this.instance.post(`/app/apppartyintegralrule/queryDetailById?id=${row.id}`).then((res) => {
this.form = { ...row } if(res?.data) {
this.form.ruleType = row.ruleType this.form = res.data
this.dialog = true this.form.ladderIntegral = JSON.parse(res.data.ladderRule)
// let {ladderRule, event, type} = this.form, this.form.ruleType = res.data.ruleType
// dict = 'integralRuleEvent' + event this.dialog = true
// 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
// })
// })
}, },
close() { close() {
@@ -319,8 +306,8 @@ export default {
onConfirm(id) { onConfirm(id) {
this.$refs.DialogForm.validate((valid) => { this.$refs.DialogForm.validate((valid) => {
if (valid) { if (valid) {
this.form.integralMin = this.form.integralArr[0] this.form.integralMin = this.form.integralArr[0] || ''
this.form.integralMax = this.form.integralArr[1] this.form.integralMax = this.form.integralArr[1] || ''
this.form.ladderRule = JSON.stringify(this.form.ladderIntegral) this.form.ladderRule = JSON.stringify(this.form.ladderIntegral)
this.instance.post(`/app/apppartyintegralrule/addOrUpdate`, { this.instance.post(`/app/apppartyintegralrule/addOrUpdate`, {

View File

@@ -122,13 +122,19 @@ export default {
} }
}, },
created() { created() {
this.dict.load("integralRuleStatus", "integralRuleRuleType", 'integralRuleScoringCycle', 'integralRuleEvent', 'integralRuleEventType','partyIntegralRuleEvent','integralRuleEvent4').then(() => { this.$dict.load("integralRuleStatus", "integralRuleRuleType", 'integralRuleScoringCycle', 'integralRuleEvent', 'integralRuleEventType','partyIntegralRuleEvent','integralRuleEvent4').then(() => {
this.getList(); this.getList();
this.cacheOps = this.$dict.getDict('partyIntegralRuleEvent').map(e => {
if (e.dictValue == event) { // let {,event, type} = this.form,
e.children = this.dict.getDict(dict).map(d => ({...d, leaf: true})) let dict = 'integralRuleEvent4' + this.form.event
} this.$dict.load(dict).then(() => {
return e // this.form.eventType = [event, type]
this.cacheOps = this.dict.getDict('partyIntegralRuleEvent').map(e => {
if (e.dictValue == this.form.event) {
e.children = this.$dict.getDict(dict).map(d => ({...d, leaf: true}))
}
return e
})
}) })
}); });
}, },