Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -15,8 +15,8 @@
|
||||
<ai-info-item label="规则类型">
|
||||
{{ integralInfo.ruleType==0? '常规': integralInfo.ruleType==1? '阶梯': '区间'}}
|
||||
</ai-info-item>
|
||||
<ai-info-item label="申请描述" :value="integralInfo.eventDesc" isLine></ai-info-item>
|
||||
<ai-info-item label="图片资料" isLine v-show="info.files">
|
||||
<ai-info-item label="申请描述" :value="info.description" isLine></ai-info-item>
|
||||
<ai-info-item label="图片资料" isLine v-show="info.files.length">
|
||||
<ai-uploader v-model="info.files" disabled></ai-uploader>
|
||||
</ai-info-item>
|
||||
</ai-wrapper>
|
||||
@@ -25,11 +25,12 @@
|
||||
<ai-card title="审核详情" v-if="info.auditStatus !== '0'">
|
||||
<div slot="content" style="margin-top: 16px;margin-bottom:24px">
|
||||
<ai-wrapper label-width="120px">
|
||||
<ai-info-item label="审核结果" :value="info.auditStatus === '1' ? '通过' : '拒绝'"></ai-info-item>
|
||||
<ai-info-item label="审核结果" :value="info.auditStatus == '1' ? '通过' : '拒绝'"></ai-info-item>
|
||||
<!-- 通过 -->
|
||||
<ai-info-item label="积分调整" v-if="integralInfo.ruleType == '1'" :value="'+' + info.auditIntegral + '分' + '('+ info.auditIntegralItem +')'"></ai-info-item>
|
||||
<ai-info-item label="积分调整" v-if="integralInfo.ruleType == '1' && info.auditStatus == '1'" :value="'+' + info.auditIntegral + '分' + '('+ info.auditIntegralItem +')'"></ai-info-item>
|
||||
<!-- 未通过(阶梯状态下显示加分项) -->
|
||||
<ai-info-item label="积分调整" v-else :value="'+' + info.auditIntegral + '分' "></ai-info-item>
|
||||
<ai-info-item label="积分调整" v-if="integralInfo.ruleType != '1' && info.auditStatus == '1'" :value="'+' + info.auditIntegral + '分' "></ai-info-item>
|
||||
<ai-info-item label="积分调整" v-if="info.auditStatus != 1" :value="'0分'"></ai-info-item>
|
||||
<ai-info-item label="审核人" :value="info.auditUserName"></ai-info-item>
|
||||
<ai-info-item label="审核时间" :value="info.auditTime"></ai-info-item>
|
||||
<ai-info-item label="驳回理由" v-if="info.auditStatus == '2'" isLine :value="info.auditOpinion"></ai-info-item>
|
||||
@@ -52,8 +53,8 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- 常规 -->
|
||||
<el-form-item label="积分分值" style="width: 100%;" :rules="[{ required: true, message: '请输入积分分值' }]" v-show="integralInfo.ruleType == 0 && form.pass == 1">
|
||||
<el-input v-model.number="form.auditIntegral" placeholder="请输入1-10的整数"></el-input>
|
||||
<el-form-item label="积分分值" style="width: 100%;" v-show="integralInfo.ruleType == 0 && form.pass == 1">
|
||||
{{ integralInfo.ruleType == 0? '+'+ integralInfo.integral : '' }}
|
||||
</el-form-item>
|
||||
<!-- 区间 -->
|
||||
<el-form-item label="区间范围" style="width: 100%;" v-show="integralInfo.ruleType == 2 && form.pass == 1">
|
||||
@@ -150,12 +151,17 @@ export default {
|
||||
if (res?.data) {
|
||||
this.info = res.data,
|
||||
this.integralInfo = res.data.integralRule
|
||||
this.scoreItem = JSON.parse(res.data.integralRule.ladderRule).map(e=>{
|
||||
return {
|
||||
dictName: e.viewCount,
|
||||
dictValue: e.integral.toString()
|
||||
}
|
||||
})
|
||||
if(res.data.integralRule.ruleType == 1) {
|
||||
this.scoreItem = JSON.parse(res.data.integralRule.ladderRule)?.map(e=>{
|
||||
return {
|
||||
dictName: e.viewCount,
|
||||
dictValue: e.integral.toString()
|
||||
}
|
||||
})
|
||||
}
|
||||
if(res.data.integralRule.ruleType == 0) {
|
||||
this.form.auditIntegral = this.integralInfo.integral
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -187,6 +193,12 @@ export default {
|
||||
},
|
||||
|
||||
onConfirm() {
|
||||
if(this.integralInfo.ruleType == 2 && this.form.pass == 1) {
|
||||
this.form.integralItem = this.scoreItem.filter(e=> e.dictValue == this.form.auditIntegral)[0]?.dictName
|
||||
}
|
||||
if(this.integralInfo.ruleType == 0 && this.form.pass == 1) {
|
||||
this.form.auditIntegral = this.integralInfo.integral
|
||||
}
|
||||
this.$refs.form.validate(v => {
|
||||
if (v) {
|
||||
this.instance.post('/app/apppartyintegraldeclare/examine', null, {
|
||||
|
||||
@@ -20,16 +20,16 @@
|
||||
@change="search.current = 1, getList()">
|
||||
</ai-select>
|
||||
<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>
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd"></el-date-picker>
|
||||
</template>
|
||||
<template #right>
|
||||
<el-input
|
||||
v-model="search.residentName"
|
||||
size="small"
|
||||
placeholder="请输入姓名/事件类型"
|
||||
placeholder="请输入姓名/事件名称"
|
||||
clearable
|
||||
v-throttle="() => {search.current = 1, getList()}"
|
||||
@clear="search.current = 1, search.residentName = '', getList()"
|
||||
@clear="search.current = 1, search.partyName = '', getList()"
|
||||
suffix-icon="iconfont iconSearch">
|
||||
</el-input>
|
||||
</template>
|
||||
@@ -70,7 +70,6 @@
|
||||
search: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
areaId: '',
|
||||
auditStatus: '', //审核状态
|
||||
createTimeStart: '',
|
||||
createTimeEnd: '',
|
||||
@@ -89,7 +88,7 @@
|
||||
{ prop: 'partyName', label: '申请人' },
|
||||
{ prop: 'partyPhone', align: 'center', label: '联系电话' },
|
||||
{ prop: 'createTime', align: 'center', label: '申请时间' },
|
||||
{ prop: 'integralRuleName', align: 'center', label: '积分类型'},
|
||||
{ prop: 'integralRuleName', align: 'center', label: '事件名称'},
|
||||
{ prop: 'auditStatus', align: 'center', label: '状态', formart: v => v ? this.dict.getLabel('integralDeclareStatus', v) : '-' },
|
||||
{ prop: 'auditUserName', align: 'center', label: '审批人' },
|
||||
{ prop: 'auditTime', align: 'center', label: '审批时间' }
|
||||
|
||||
@@ -7,31 +7,29 @@
|
||||
<ai-card hideTitle class="staCard fill">
|
||||
<template #content>
|
||||
<div class="color-999" v-text="`姓名`"/>
|
||||
<b v-text="detail.name"/>
|
||||
<b v-text="name"/>
|
||||
</template>
|
||||
</ai-card>
|
||||
<ai-card hideTitle class="staCard fill">
|
||||
<template slot="content">
|
||||
<div class="color-999" v-text="`党员积分`"/>
|
||||
<b class="color-26f" v-text="detail.integral||0"/>
|
||||
<b class="color-26f" v-text="nowIntegral || 0"/>
|
||||
</template>
|
||||
</ai-card>
|
||||
</el-row>
|
||||
<ai-card title="余额变动明细">
|
||||
<template #right>
|
||||
<ai-download :instance="instance" :url="`/app/apppartyintegralinfo/listExport?partyId=${id}`" fileName="党员积分" :disabled="detailTable.length == 0">
|
||||
<el-button icon="iconfont iconExported" :disabled="detailTable.length == 0">导出</el-button>
|
||||
</ai-download>
|
||||
</template>
|
||||
<template #content>
|
||||
<ai-table :tableData="detail.integralInfoList" :isShowPagination="false" :col-configs="colConfigs"
|
||||
:dict="dict"/>
|
||||
<ai-table :tableData="detailTable" isShowPagination :total="total" :current.sync="page.current"
|
||||
:size.sync="page.size" @getList="getDetail()" :col-configs="colConfigs" :dict="dict"/>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
</ai-detail>
|
||||
<ai-dialog :visible.sync="dialog" title="学习强国设置" width="500px" @close="form={}" @onConfirm="submit">
|
||||
<el-form :model="form" size="small" ref="DialogForm" :rules="rules" label-width="110px">
|
||||
<el-form-item label="学习强国积分" prop="learningIntegral">
|
||||
<el-input v-model.number="form.learningIntegral" placeholder="请输入正整数" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ai-dialog>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -55,45 +53,42 @@ export default {
|
||||
{label: "剩余积分", prop: "residualIntegral", align: 'center'},
|
||||
{label: "调整说明", prop: "remark"},
|
||||
],
|
||||
dialog: false,
|
||||
form: {},
|
||||
rules: {
|
||||
learningIntegral: [
|
||||
{required: true, message: "请输入学习强国积分"},
|
||||
{pattern: /^\d+$/g, message: "请输入正整数"}
|
||||
]
|
||||
}
|
||||
},
|
||||
id: '',
|
||||
name: '',
|
||||
nowIntegral: '',
|
||||
page: {current: 1, size: 10},
|
||||
total: 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getDetail() {
|
||||
let {id} = this.$route.query
|
||||
this.instance.post("/app/appparty/getPartyIntegralDetail", null, {
|
||||
params: {id}
|
||||
let { id, name, nowIntegral } = this.$route.query
|
||||
this.instance.post("/app/apppartyintegralinfo/list", null, {
|
||||
params: {
|
||||
partyId: id,
|
||||
...this.page,
|
||||
total: this.total
|
||||
}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.detail = res.data
|
||||
this.detailTable = res.data.records
|
||||
this.total = res.data.total
|
||||
this.name = name
|
||||
this.nowIntegral = nowIntegral
|
||||
this.id = id
|
||||
}
|
||||
})
|
||||
},
|
||||
back() {
|
||||
this.$router.push({})
|
||||
},
|
||||
submit() {
|
||||
this.$refs.DialogForm.validate(v => {
|
||||
if (v) {
|
||||
this.instance.post("/app/appparty/editLearningIntegral", null,{
|
||||
params:this.form
|
||||
}).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.$message.success("提交成功!")
|
||||
this.dialog = false
|
||||
this.getDetail()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleEditLearningIntergral(partyMemberId) {
|
||||
this.dialog = true
|
||||
this.form = {partyMemberId}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<ai-party-tree
|
||||
:filter-node-method="filterNode"
|
||||
ref="tree"
|
||||
default-first-option
|
||||
:instance="instance"
|
||||
:root="user.info.organizationId"
|
||||
:current-node-key="user.info.id"
|
||||
@@ -19,7 +20,7 @@
|
||||
<template #left>
|
||||
<div>统计周期</div>
|
||||
<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>
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd"></el-date-picker>
|
||||
</template>
|
||||
<template #right>
|
||||
<el-input size="small" placeholder="党员姓名" v-model="search.name" clearable
|
||||
@@ -33,7 +34,7 @@
|
||||
@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.partyId)">详情</el-button>
|
||||
<el-button type="text" @click="showDetail(row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
@@ -53,12 +54,15 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
orgTree() {
|
||||
return this.$refs.tree?.$refs?.partyTree
|
||||
},
|
||||
colConfigs() {
|
||||
return [
|
||||
{label: "排行榜", prop: "orderIndex", align: "center"},
|
||||
{label: "党员姓名", prop: "name", align: "center"},
|
||||
{label: "党员类型", prop: "partyType", dict: "partyType", align: "center"},
|
||||
{label: "获得积分", prop: "nowIntegral", align: "center"},
|
||||
{label: "获得积分", prop: "integral", align: "center"},
|
||||
{slot: "options"}
|
||||
]
|
||||
},
|
||||
@@ -130,8 +134,9 @@ export default {
|
||||
return data.name.indexOf(value) !== -1
|
||||
},
|
||||
|
||||
showDetail(id) {
|
||||
this.$router.push({query: {id}})
|
||||
showDetail(row) {
|
||||
console.log(row);
|
||||
this.$router.push({query: { id: row.partyId, name: row.name, nowIntegral: row.nowIntegral}})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<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"/>
|
||||
:instance="instance" :dict="dict"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
@@ -27,7 +27,6 @@ export default {
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function
|
||||
},
|
||||
|
||||
computed: {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<ai-search-bar>
|
||||
<template slot="left">
|
||||
<el-date-picker size="small" v-model="searchDotime" type="daterange" range-separator="至" @change="timeChange"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy" format="yyyy"></el-date-picker>
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd"></el-date-picker>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<el-input
|
||||
@@ -36,7 +36,6 @@
|
||||
<el-button
|
||||
type="text"
|
||||
title="详情"
|
||||
:disabled="!$permissions('app_appvillagerintegraldetail_detail')"
|
||||
@click="viewItem(row)">
|
||||
详情
|
||||
</el-button>
|
||||
@@ -50,7 +49,7 @@
|
||||
<ai-info-item label="党员:" :value="dialogInfo.partyName" isLine/>
|
||||
<ai-info-item label="事件:" :value="dict.getLabel('partyIntegralDetailType',dialogInfo.type)" dict/>
|
||||
<ai-info-item label="类型:">
|
||||
{{ dialogInfo.partyIntegralDetailType == 1 ? '加分' : '减分' }}
|
||||
{{ dialogInfo.integralType == 1 ? '加分' : '减分' }}
|
||||
</ai-info-item>
|
||||
<ai-info-item label="分值:" :value="dialogInfo.integral" isLine/>
|
||||
<ai-info-item label="时间:" :value="dialogInfo.createTime" isLine/>
|
||||
@@ -69,7 +68,6 @@ export default {
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
areaId: String
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -84,8 +82,8 @@ export default {
|
||||
},
|
||||
total: 10,
|
||||
colConfigs: [
|
||||
{prop: "partyName", label: "对象", align: "center"},
|
||||
{prop: "remark", label: "调整说明", align: "center"},
|
||||
{prop: "partyName", label: "对象", width: "150px"},
|
||||
{prop: "remark", label: "调整说明",},
|
||||
{prop: "createTime", label: "时间", align: "center"},
|
||||
{prop: "integralType", label: "类型", align: "center", render: (h, {row}) => h('span', `${row.integralType == 0 ? '减分' : '加分'}`)},
|
||||
{slot: "integral", label: "积分", align: "center",},
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
<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>
|
||||
<el-button type="primary" icon="iconfont iconAdd" @click="dialog=true">添加</el-button>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
@@ -60,8 +58,6 @@ export default {
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
areaId: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -94,7 +90,7 @@ export default {
|
||||
},
|
||||
colConfigs() {
|
||||
return [
|
||||
{prop: "partyName", label: "姓名", align: 'center'},
|
||||
{prop: "partyName", label: "姓名",},
|
||||
{prop: "remark", label: "调整说明", align: 'center'},
|
||||
{prop: "integralType", label: "类型", dict: "partyIntegralType", align: 'center'},
|
||||
{prop: "integral", label: "积分", align: "center", render: (h, {row}) => h('p',{textAlign:'center'}, `${row.integralType == 1 ? '+' : '-'}${row.integral}`)},
|
||||
@@ -114,6 +110,7 @@ export default {
|
||||
}
|
||||
},
|
||||
onConfirm() {
|
||||
if(this.flag) return
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
this.flag = true
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
<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"/>
|
||||
<component :is="tab.comp" v-if="currIndex === String(i)" :ref="tab.name" :instance="instance" :dict="dict"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
@@ -27,7 +26,6 @@ export default {
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function
|
||||
},
|
||||
|
||||
computed: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<section class="applyForIntegral">
|
||||
<ai-list v-if="permissions('app_appvillagerintegralrule_detail')">
|
||||
<ai-list>
|
||||
<template slot="content">
|
||||
<ai-search-bar bottomBorder>
|
||||
<template slot="left">
|
||||
@@ -42,12 +42,12 @@
|
||||
<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 type="text" @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>
|
||||
<el-button type="text" @click="changeStatus(row.id, 1)" v-else>启用</el-button>
|
||||
<el-button type="text" @click="toEdit(row)">编辑</el-button>
|
||||
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -56,7 +56,7 @@
|
||||
</template>
|
||||
</ai-list>
|
||||
|
||||
<ai-empty v-else>暂无应用权限</ai-empty>
|
||||
<!-- <ai-empty v-else>暂无应用权限</ai-empty> -->
|
||||
|
||||
<ai-dialog :title="dialogTitle" :visible.sync="dialog" @onConfirm="onConfirm" @closed="close" width="800px">
|
||||
<div class="form_div">
|
||||
@@ -88,7 +88,7 @@
|
||||
<el-input placeholder="请输入" v-model="form.integral" clearable/>
|
||||
</el-form-item>
|
||||
<!-- 区间 -->
|
||||
<el-form-item label="积分分值" prop="integralArr" v-if="form.ruleType == '2'">
|
||||
<el-form-item label="积分分值" v-if="form.ruleType == '2'">
|
||||
<ai-range v-model="form.integralArr" clearable/>
|
||||
</el-form-item>
|
||||
<!-- 阶梯 -->
|
||||
@@ -130,7 +130,6 @@ export default {
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function
|
||||
},
|
||||
computed: {
|
||||
isEdit() {
|
||||
@@ -162,17 +161,16 @@ export default {
|
||||
search: {status: "", eventName: ""},
|
||||
page: {current: 1, size: 10, total: 0},
|
||||
colConfigs: [
|
||||
{prop: "eventName", label: "事件名称", dict: "integralRuleEvent", "show-overflow-tooltip": true},
|
||||
{prop: "eventDesc", label: "简介", dict: "integralRuleEventType", "show-overflow-tooltip": true},
|
||||
{prop: "eventName", label: "事件名称", "show-overflow-tooltip": true},
|
||||
{prop: "eventDesc", label: "简介", "show-overflow-tooltip": true},
|
||||
{prop: "ruleType", label: "规则", dict: "partyIntegralRuleRuleType", align: "center"},
|
||||
{prop: "scoringCycle", label: "周期范围", dict: "integralRuleScoringCycle", align: "center"},
|
||||
{prop: "scoringCycle", label: "积分分值", dict: "integralRuleScoringCycle", align: "center"},
|
||||
{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"},
|
||||
{prop: "event", label: "加分项",},
|
||||
{prop: "event", label: "获得积分",},
|
||||
{slot: "options", label: "操作", align: "center"},
|
||||
],
|
||||
tableData: [],
|
||||
@@ -198,7 +196,6 @@ export default {
|
||||
scoringCycle: [{required: true, message: "请选择周期范围" }],
|
||||
integral: [{required: true, pattern: /^\d*[.\d]\d?$/, message: "请输入积分分值,最多保留一位小数"}],
|
||||
numberLimit: [{pattern: /^\d*$/, message: "请输入正整数"}],
|
||||
integralArr: [{required: true, message: "请输入积分分值", trigger: "change"}],
|
||||
ladderIntegral: [{required: true, message: "请输入积分分值"}]
|
||||
},
|
||||
cacheOps: [],
|
||||
@@ -215,14 +212,7 @@ export default {
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
integralArr: {
|
||||
handler(v) {
|
||||
this.form.integralMin = v?.[0] || ''
|
||||
this.form.integralMax = v?.[1] || ''
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/apppartyintegralrule/list?classify=0`, null, {
|
||||
@@ -240,10 +230,13 @@ export default {
|
||||
toEdit(row) {
|
||||
this.instance.post(`/app/apppartyintegralrule/queryDetailById?id=${row.id}`).then((res) => {
|
||||
if(res?.data) {
|
||||
// console.log(res);
|
||||
this.form = res.data
|
||||
this.form.ladderIntegral = JSON.parse(res.data.ladderRule)
|
||||
this.form.ruleType = res.data.ruleType
|
||||
this.form.integralArr = [ res.data.integralMin, res.data.integralMax ]
|
||||
if(res.data.ruleType == 1) {
|
||||
this.form.ladderIntegral = JSON.parse(res.data.ladderRule)
|
||||
}
|
||||
this.dialog = true
|
||||
}
|
||||
})
|
||||
@@ -262,6 +255,7 @@ export default {
|
||||
integralMax: '',
|
||||
ladderRule: [],
|
||||
integralArr: [],
|
||||
ladderIntegral: []
|
||||
}
|
||||
},
|
||||
|
||||
@@ -271,7 +265,8 @@ export default {
|
||||
this.form.numberLimit = ''
|
||||
this.form.integral = ''
|
||||
this.form.integralArr = []
|
||||
this.form.ladderRule = []
|
||||
this.form.ladderRule = ''
|
||||
this.form.ladderIntegral = []
|
||||
},
|
||||
|
||||
remove(id) {
|
||||
@@ -307,23 +302,38 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
onConfirm() {
|
||||
this.form.integralMin = this.form.integralArr?.[0] || ''
|
||||
this.form.integralMax = this.form.integralArr?.[1] || ''
|
||||
this.form.ladderRule = JSON.stringify(this.form.ladderIntegral)
|
||||
if(this.form.ruleType == 2) {
|
||||
|
||||
if(this.form.integralMin >= this.form.integralMax) {
|
||||
return this.$message.error('请输入正确的区间范围')
|
||||
this.form.integralMin = this.form.integralArr[0] || ''
|
||||
this.form.integralMax = this.form.integralArr[1] || ''
|
||||
|
||||
if(!this.form.integralArr[0] && !this.form.integralArr[1]) {
|
||||
return this.$message.error('请输入积分分值')
|
||||
}
|
||||
if(this.form.integralMin >= this.form.integralMax) {
|
||||
return this.$message.error('请输入正确积分区间')
|
||||
}
|
||||
}
|
||||
if(this.form.ruleType == 1) {
|
||||
this.form.ladderRule = JSON.stringify(this.form.ladderIntegral)
|
||||
}
|
||||
|
||||
if(this.form.ruleType == 2 || this.form.ruleType == 0) {
|
||||
this.form.ladderRule = ''
|
||||
}
|
||||
|
||||
this.$refs.DialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.instance.post(`/app/apppartyintegralrule/addOrUpdate`, {
|
||||
...this.form,
|
||||
id: this.form.id || ''
|
||||
id: this.form.id || '',
|
||||
integralMin: this.form.integralArr[0] || '',
|
||||
integralMax: this.form.integralArr[1] || '',
|
||||
}).then((res) => {
|
||||
if (res?.code == 0) {
|
||||
this.$message.success(`${this.isEdit ? '编辑成功' : '添加成功'}`)
|
||||
this.dialog = false;
|
||||
this.close()
|
||||
this.getList()
|
||||
}
|
||||
});
|
||||
|
||||
@@ -38,12 +38,12 @@
|
||||
<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 type="text" @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>
|
||||
<el-button type="text" @click="changeStatus(row.id, 1)" v-else>启用</el-button>
|
||||
<el-button type="text" @click="toEdit(row)">编辑</el-button>
|
||||
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -85,7 +85,6 @@ export default {
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user