From c151ca367935e76a76aa651412712fae1829444c Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Fri, 7 Apr 2023 11:19:51 +0800 Subject: [PATCH] 206 --- .../AppIntegratingAudit/components/List.vue | 6 +- .../AppIntegratingDjust/components/List.vue | 14 +- .../components/Detail.vue | 2 +- .../components/List.vue | 150 ++++++++++++++++-- ui/packages/common/AiPersonSelect.vue | 16 +- 5 files changed, 164 insertions(+), 24 deletions(-) diff --git a/project/fengdu/app/AppIntegratingAudit/components/List.vue b/project/fengdu/app/AppIntegratingAudit/components/List.vue index 0fddd089..dd106908 100644 --- a/project/fengdu/app/AppIntegratingAudit/components/List.vue +++ b/project/fengdu/app/AppIntegratingAudit/components/List.vue @@ -18,7 +18,7 @@ ref="eventTypeSearch"> { this.getInfo() this.getList() diff --git a/project/fengdu/app/AppResidentIntegrating/components/List.vue b/project/fengdu/app/AppResidentIntegrating/components/List.vue index b986bc42..b2832acf 100644 --- a/project/fengdu/app/AppResidentIntegrating/components/List.vue +++ b/project/fengdu/app/AppResidentIntegrating/components/List.vue @@ -4,6 +4,7 @@ @@ -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) { diff --git a/ui/packages/common/AiPersonSelect.vue b/ui/packages/common/AiPersonSelect.vue index d5fba9a5..adc9c842 100644 --- a/ui/packages/common/AiPersonSelect.vue +++ b/ui/packages/common/AiPersonSelect.vue @@ -12,8 +12,8 @@
-

{{ formatName(item.userName || item.name) }}

- {{ item.userName || item.name }} +

{{ formatName(item.userName || item.name || item.realName) }}

+ {{ item.userName || item.name || item.realName }}
@@ -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])}">