Merge remote-tracking branch 'origin/build' into build
This commit is contained in:
@@ -7,18 +7,14 @@
|
||||
<template slot="content">
|
||||
<ai-search-bar class="search-bar">
|
||||
<template #left>
|
||||
<el-cascader
|
||||
size="small"
|
||||
v-model="search.ids"
|
||||
:options="rulesOps"
|
||||
<ai-select
|
||||
v-model="search.applyItemId"
|
||||
@change="(search.current = 1), getList()"
|
||||
placeholder="请选择事件/类型"
|
||||
clearable
|
||||
:props="rulesProps"
|
||||
@change="search.current = 1, getList()"
|
||||
ref="eventTypeSearch">
|
||||
</el-cascader>
|
||||
:selectList="dictList">
|
||||
</ai-select>
|
||||
<el-date-picker
|
||||
v-model="search.beginDate"
|
||||
v-model="search.createTimeStart"
|
||||
type="date"
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd"
|
||||
@@ -26,7 +22,7 @@
|
||||
@change="search.current = 1, getList()">
|
||||
</el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="search.endDate"
|
||||
v-model="search.createTimeEnd"
|
||||
type="date"
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd"
|
||||
@@ -108,17 +104,14 @@
|
||||
current: 1,
|
||||
size: 10,
|
||||
areaId: '',
|
||||
ids: '',
|
||||
applyItemId: '',
|
||||
girdId: '',
|
||||
createTimeStart: '',
|
||||
createTimeEnd: '',
|
||||
girdName: ''
|
||||
},
|
||||
userList: [],
|
||||
rulesProps: {
|
||||
label: 'ruleName',
|
||||
value: 'id',
|
||||
checkStrictly: true
|
||||
},
|
||||
rulesOps: [],
|
||||
dictList: [],
|
||||
total: 10,
|
||||
colConfigs: [
|
||||
{ prop: 'applyItemName', label: '事件类型', align: 'left' },
|
||||
@@ -151,12 +144,13 @@
|
||||
|
||||
methods: {
|
||||
getRulesList () {
|
||||
this.instance.post(`/app/appintegralsystemrule/listByAppletFD?current=1&size=3000`).then((res) => {
|
||||
this.instance.post(`/app/appintegralrule/listByAppletFD?current=1&size=3000`).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.rulesOps = this.toTree(res.data.records)
|
||||
this.rulesOps.push({
|
||||
ruleName: '积分申请',
|
||||
id: '积分申请'
|
||||
this.dictList = res.data.records.map(v => {
|
||||
return {
|
||||
dictName: v.ruleName,
|
||||
dictValue: v.id
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -171,31 +165,10 @@
|
||||
}
|
||||
},
|
||||
|
||||
toTree (data) {
|
||||
let result = []
|
||||
if (!Array.isArray(data)) {
|
||||
return result
|
||||
}
|
||||
let map = {}
|
||||
data.forEach((item) => {
|
||||
map[item.id] = item
|
||||
})
|
||||
data.forEach((item) => {
|
||||
let parent = map[item.parentRuleId]
|
||||
if (parent) {
|
||||
(parent.children || (parent.children = [])).push(item)
|
||||
} else {
|
||||
result.push(item)
|
||||
}
|
||||
})
|
||||
return result
|
||||
},
|
||||
|
||||
getList () {
|
||||
this.instance.post(`/app/appintegraluserapply/list`, null, {
|
||||
params: {
|
||||
...this.search,
|
||||
// areaId: this.search.areaId
|
||||
...this.search
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
|
||||
@@ -129,11 +129,13 @@ export default {
|
||||
...mapState(['user']),
|
||||
colConfigs() {
|
||||
return [
|
||||
{ prop: "userName", label: '姓名', align: "left", },
|
||||
{ prop: "girdName", label: '所属网格', align: "center" },
|
||||
{ prop: "integral", label: '积分余额', align: "center", sortable: "custom" },
|
||||
{ prop: "totalIntegral", label: '累计积分', align: "center", sortable: "custom" },
|
||||
{ prop: "usedIntegral", label: '已用积分', align: "center", sortable: "custom" },
|
||||
{ prop: "integralUserName", label: '姓名', align: "left", },
|
||||
{ prop: "areaName", label: '所属地区', align: "center" },
|
||||
{ prop: "auditDesc", label: '调整说明', align: "center" },
|
||||
{ prop: "applyItemName", label: '类型', align: "center" },
|
||||
{ prop: "applyIntegral", label: '积分', align: "center" },
|
||||
{ prop: "auditTime", label: '操作时间', align: "center", sortable: "custom" },
|
||||
{ prop: "auditUserName", label: '操作人', align: "center", sortable: "custom" },
|
||||
{ slot: "options" },
|
||||
]
|
||||
},
|
||||
@@ -149,7 +151,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getTableData() {
|
||||
this.instance.post(`/app/appintegraluser/integralManager`,null,{
|
||||
this.instance.post(`/app/appintegraluserapply/list`,null,{
|
||||
params: {
|
||||
...this.search,
|
||||
current: this.current,
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
},
|
||||
|
||||
created () {
|
||||
console.log(this.params.id)
|
||||
console.log(this.params)
|
||||
this.dict.load('integralType').then(() => {
|
||||
this.getInfo()
|
||||
this.getList()
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<template slot="content">
|
||||
<ai-search-bar class="search-bar">
|
||||
<template #left>
|
||||
<el-button type="primary" size="small" icon="iconfont iconAdd" @click="changeIntegral('',0)"> 批量调整积分</el-button>
|
||||
<ai-download
|
||||
:instance="instance"
|
||||
url="/app/appwechatuserqujing/export"
|
||||
@@ -34,14 +35,45 @@
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
<el-table-column slot="options" width="100px" fixed="right" label="操作" align="center">
|
||||
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button type="text" @click="toDetail(row.integralUserId)">详情</el-button>
|
||||
<el-button type="text" @click="changeIntegral(row,1)">调整积分</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
<ai-dialog
|
||||
title="调整积分"
|
||||
:visible.sync="dialog"
|
||||
:destroyOnClose="true"
|
||||
width="720px"
|
||||
@onConfirm="onConfirm"
|
||||
@closed="form={},chooseUserList=[]">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="选择人员" prop="ids">
|
||||
<ai-person-select :instance="instance" keys="openId" customRightText :customClicker="true" :chooseUserList="chooseUserList"
|
||||
url="/app/appwechatuserqujing/listByFdAppletUser" headerTitle="用户列表"
|
||||
:isMultiple="true" dialogTitle="选择" @selectPerson="selectPerson" class="aipersonselect">
|
||||
<template name="option" v-slot:option="{ item }">
|
||||
<span class="iconfont iconProlife">{{ item.realName }}</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="integral">
|
||||
<el-input v-model.trim="form.integral" placeholder="请输入正数" size="small"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ai-dialog>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
@@ -64,6 +96,15 @@
|
||||
title: '',
|
||||
areaId: ''
|
||||
},
|
||||
form: {
|
||||
ids: [],
|
||||
eventDesc: "",
|
||||
enclosure: "",
|
||||
integralCalcType: "",
|
||||
integral: ''
|
||||
},
|
||||
dialog: false,
|
||||
chooseUserList: [],
|
||||
total: 0,
|
||||
colConfigs: [
|
||||
{ prop: 'realName', label: '姓名', align: 'left', width: '200px' },
|
||||
@@ -89,6 +130,16 @@
|
||||
return {
|
||||
...this.search
|
||||
}
|
||||
},
|
||||
|
||||
rules() {
|
||||
return {
|
||||
ids: [{required: true, message: '请选择人员', trigger: 'blur'}],
|
||||
eventDesc: [{required: true, message: '请输入调整说明', trigger: 'blur'}],
|
||||
integralCalcType: [{required: true, message: '请选择类型', trigger: 'change'}],
|
||||
integral: [{required: true, message: '请输入积分', trigger: 'blur' },
|
||||
{pattern: /^([1-9]\d*|0)(\.\d{1,2})?$/, message: '请输入正数且最多只能保留两位小数'}],
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -112,15 +163,96 @@
|
||||
})
|
||||
},
|
||||
|
||||
remove(id) {
|
||||
this.$confirm('确定删除该数据?').then(() => {
|
||||
this.instance.post(`/app/appcontentinfo/deleteIntegralApply?ids=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('下架成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
selectPerson(val) {
|
||||
if (val) {
|
||||
this.personList = val
|
||||
this.form.ids = [...this.personList.map(e => e.openId)]
|
||||
} else {
|
||||
this.form.ids = this.chooseUserList.map(e => e.openId)
|
||||
}
|
||||
},
|
||||
|
||||
changeIntegral(row,type) {
|
||||
if(type==0) {
|
||||
this.dialog = true
|
||||
} else if(type ==1) {
|
||||
this.chooseUserList = [{
|
||||
openId: row.openId,
|
||||
name: row.realName
|
||||
}]
|
||||
this.form = {
|
||||
...this.form,
|
||||
...row,
|
||||
ids: this.chooseUserList.map(e => e.openId)
|
||||
}
|
||||
|
||||
this.dialog = true
|
||||
}
|
||||
},
|
||||
|
||||
changeTableSort(col) {
|
||||
if(col.prop === 'integral') { // 剩余积分
|
||||
this.search.sortFiled = 0
|
||||
if(col.order === 'ascending') {
|
||||
this.search.sortRule = true
|
||||
} else if(col.order === 'descending') {
|
||||
this.search.sortRule = false
|
||||
} else if(col.order === null) {
|
||||
this.search.sortRule = ''
|
||||
}
|
||||
} else if(col.prop === 'totalIntegral') { // 累计积分
|
||||
this.search.sortFiled = 1
|
||||
if(col.order === 'ascending') {
|
||||
this.search.sortRule = true
|
||||
} else if(col.order === 'descending') {
|
||||
this.search.sortRule = false
|
||||
} else if(col.order === null) {
|
||||
this.search.sortRule = ''
|
||||
}
|
||||
} else if(col.prop === 'usedIntegral') { // 已用积分
|
||||
this.search.sortFiled = 2
|
||||
if(col.order === 'ascending') {
|
||||
this.search.sortRule = true
|
||||
} else if(col.order === 'descending') {
|
||||
this.search.sortRule = false
|
||||
} else if(col.order === null) {
|
||||
this.search.sortRule = ''
|
||||
}
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
|
||||
onConfirm() {
|
||||
if(this.flag) return
|
||||
|
||||
if(this.form.file?.length) {
|
||||
this.form.enclosure = this.form.file[0].url
|
||||
}
|
||||
this.$refs.form.validate((valid)=> {
|
||||
if(valid) {
|
||||
this.flag = true
|
||||
this.instance.post(`/app/appintegraluser/changeIntegral`,{
|
||||
ids: this.form.ids,
|
||||
eventDesc: this.form.eventDesc,
|
||||
enclosure: this.form.enclosure, // 附件
|
||||
integralCalcType: this.form.integralCalcType,
|
||||
integral: this.form.integral,
|
||||
integralUserType: 3
|
||||
}).then(res => {
|
||||
if(res?.code == 0) {
|
||||
this.$message.success('调整积分成功')
|
||||
setTimeout(() =>{
|
||||
this.dialog = false
|
||||
this.getList()
|
||||
this.flag = false
|
||||
}, 600)
|
||||
} else {
|
||||
this.flag = false
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
toDetail(id) {
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
<div class="userlist">
|
||||
<div class="user" v-for="(item, index) in userList" :key="index" v-if="item">
|
||||
<img :src="item.avatarUrl1" v-if="item.avatarUrl1" alt="">
|
||||
<h2 v-else>{{ formatName(item.userName || item.name) }}</h2>
|
||||
<span>{{ item.userName || item.name }}</span>
|
||||
<h2 v-else>{{ formatName(item.userName || item.name || item.realName) }}</h2>
|
||||
<span>{{ item.userName || item.name || item.realName }}</span>
|
||||
<i class="iconfont iconOverrule remove-icon" v-if="!disabled" @click="removeUser(item, index)"></i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -55,7 +55,7 @@
|
||||
v-for="(item, index) in meta || tableData"
|
||||
:key="index"
|
||||
@click="chooseItem(item, index)"
|
||||
:class="{ selectedLi: getIsActive(item.id)}">
|
||||
:class="{ selectedLi: getIsActive(item[keys])}">
|
||||
<slot v-if="customRightText" name="option" :item="item"></slot>
|
||||
<template v-else>
|
||||
<span class="iconfont iconProlife">{{ item.name }}</span>
|
||||
@@ -91,7 +91,7 @@
|
||||
:disable-transitions="true"
|
||||
:key="i"
|
||||
closable
|
||||
@close="cancelSelect(item, i)">{{ item.name || item.userName }}
|
||||
@close="cancelSelect(item, i)">{{ item.name || item.userName || item.realName }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div class="add_tag" v-else style="display:flex;align-items:center;justify-content:center;width:100%;">
|
||||
@@ -117,6 +117,10 @@ export default {
|
||||
return []
|
||||
}
|
||||
},
|
||||
keys: {
|
||||
type: String,
|
||||
default: 'id',
|
||||
},
|
||||
dialogTitle: String,
|
||||
headerTitle: {
|
||||
type: String,
|
||||
@@ -218,7 +222,7 @@ export default {
|
||||
this.selectPeople = []
|
||||
}
|
||||
|
||||
let index = this.selectPeople.findIndex(item => item.id === user.id)
|
||||
let index = this.selectPeople.findIndex(item => item[this.keys] === user[this.keys])
|
||||
|
||||
if (index > -1) {
|
||||
this.selectPeople.splice(index, 1)
|
||||
@@ -244,7 +248,7 @@ export default {
|
||||
},
|
||||
|
||||
getIsActive(id) {
|
||||
return this.selectPeople.findIndex(item => item.id === id) > -1
|
||||
return this.selectPeople.findIndex(item => item[this.keys] === id) > -1
|
||||
},
|
||||
|
||||
clearAll() {
|
||||
|
||||
Reference in New Issue
Block a user