206
This commit is contained in:
		| @@ -18,7 +18,7 @@ | |||||||
|             ref="eventTypeSearch"> |             ref="eventTypeSearch"> | ||||||
|           </el-cascader> |           </el-cascader> | ||||||
|           <el-date-picker |           <el-date-picker | ||||||
|             v-model="search.beginDate" |             v-model="search.createTimeStart" | ||||||
|             type="date" |             type="date" | ||||||
|             size="small" |             size="small" | ||||||
|             value-format="yyyy-MM-dd" |             value-format="yyyy-MM-dd" | ||||||
| @@ -26,7 +26,7 @@ | |||||||
|             @change="search.current = 1, getList()"> |             @change="search.current = 1, getList()"> | ||||||
|           </el-date-picker> |           </el-date-picker> | ||||||
|           <el-date-picker |           <el-date-picker | ||||||
|             v-model="search.endDate" |             v-model="search.createTimeEnd" | ||||||
|             type="date" |             type="date" | ||||||
|             size="small" |             size="small" | ||||||
|             value-format="yyyy-MM-dd" |             value-format="yyyy-MM-dd" | ||||||
| @@ -110,6 +110,8 @@ | |||||||
|           areaId: '', |           areaId: '', | ||||||
|           ids: '', |           ids: '', | ||||||
|           girdId: '', |           girdId: '', | ||||||
|  |           createTimeStart: '', | ||||||
|  |           createTimeEnd: '', | ||||||
|           girdName: '' |           girdName: '' | ||||||
|         }, |         }, | ||||||
|         userList: [], |         userList: [], | ||||||
|   | |||||||
| @@ -129,11 +129,13 @@ export default { | |||||||
|     ...mapState(['user']), |     ...mapState(['user']), | ||||||
|     colConfigs() { |     colConfigs() { | ||||||
|       return [ |       return [ | ||||||
|         { prop: "userName", label: '姓名', align: "left",  }, |         { prop: "integralUserName", label: '姓名', align: "left",  }, | ||||||
|         { prop: "girdName", label: '所属网格', align: "center" }, |         { prop: "areaName", label: '所属地区', align: "center" }, | ||||||
|         { prop: "integral", label: '积分余额', align: "center", sortable: "custom" }, |         { prop: "auditDesc", label: '调整说明', align: "center" }, | ||||||
|         { prop: "totalIntegral", label: '累计积分', align: "center", sortable: "custom" }, |         { prop: "applyItemName", label: '类型', align: "center" }, | ||||||
|         { prop: "usedIntegral", label: '已用积分', align: "center", sortable: "custom"  }, |         { prop: "applyIntegral", label: '积分', align: "center" }, | ||||||
|  |         { prop: "auditTime", label: '操作时间', align: "center", sortable: "custom" }, | ||||||
|  |         { prop: "auditUserName", label: '操作人', align: "center", sortable: "custom" }, | ||||||
|         { slot: "options" }, |         { slot: "options" }, | ||||||
|       ] |       ] | ||||||
|     }, |     }, | ||||||
| @@ -149,7 +151,7 @@ export default { | |||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
|     getTableData() { |     getTableData() { | ||||||
|       this.instance.post(`/app/appintegraluser/integralManager`,null,{ |       this.instance.post(`/app/appintegraluserapply/list`,null,{ | ||||||
|         params: { |         params: { | ||||||
|           ...this.search, |           ...this.search, | ||||||
|           current: this.current, |           current: this.current, | ||||||
|   | |||||||
| @@ -96,7 +96,7 @@ | |||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     created () { |     created () { | ||||||
|       console.log(this.params.id) |       console.log(this.params) | ||||||
|       this.dict.load('integralType').then(() => { |       this.dict.load('integralType').then(() => { | ||||||
|         this.getInfo() |         this.getInfo() | ||||||
|         this.getList() |         this.getList() | ||||||
|   | |||||||
| @@ -4,6 +4,7 @@ | |||||||
|     <template slot="content"> |     <template slot="content"> | ||||||
|       <ai-search-bar class="search-bar"> |       <ai-search-bar class="search-bar"> | ||||||
|         <template #left> |         <template #left> | ||||||
|  |           <el-button type="primary" size="small" icon="iconfont iconAdd" @click="changeIntegral('',0)"> 批量调整积分</el-button> | ||||||
|           <ai-download |           <ai-download | ||||||
|             :instance="instance" |             :instance="instance" | ||||||
|             url="/app/appwechatuserqujing/export" |             url="/app/appwechatuserqujing/export" | ||||||
| @@ -34,14 +35,45 @@ | |||||||
|         :current.sync="search.current" |         :current.sync="search.current" | ||||||
|         :size.sync="search.size" |         :size.sync="search.size" | ||||||
|         @getList="getList"> |         @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 }"> |           <template slot-scope="{ row }"> | ||||||
|             <div class="table-options"> |             <div class="table-options"> | ||||||
|               <el-button type="text" @click="toDetail(row.integralUserId)">详情</el-button> |               <el-button type="text" @click="toDetail(row.integralUserId)">详情</el-button> | ||||||
|  |               <el-button type="text" @click="changeIntegral(row,1)">调整积分</el-button> | ||||||
|             </div> |             </div> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|       </ai-table> |       </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> |     </template> | ||||||
|   </ai-list> |   </ai-list> | ||||||
| </template> | </template> | ||||||
| @@ -64,6 +96,15 @@ | |||||||
|           title: '', |           title: '', | ||||||
|           areaId: '' |           areaId: '' | ||||||
|         }, |         }, | ||||||
|  |         form: { | ||||||
|  |           ids: [], | ||||||
|  |           eventDesc: "", | ||||||
|  |           enclosure: "", | ||||||
|  |           integralCalcType: "", | ||||||
|  |           integral: '' | ||||||
|  |         }, | ||||||
|  |         dialog: false, | ||||||
|  |         chooseUserList: [], | ||||||
|         total: 0, |         total: 0, | ||||||
|         colConfigs: [ |         colConfigs: [ | ||||||
|           { prop: 'realName',  label: '姓名', align: 'left', width: '200px' }, |           { prop: 'realName',  label: '姓名', align: 'left', width: '200px' }, | ||||||
| @@ -89,6 +130,16 @@ | |||||||
|         return { |         return { | ||||||
|           ...this.search |           ...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) { |       selectPerson(val) { | ||||||
|         this.$confirm('确定删除该数据?').then(() => { |         if (val) { | ||||||
|           this.instance.post(`/app/appcontentinfo/deleteIntegralApply?ids=${id}`).then(res => { |           this.personList = val | ||||||
|             if (res.code == 0) { |           this.form.ids = [...this.personList.map(e => e.openId)] | ||||||
|               this.$message.success('下架成功!') |         } else { | ||||||
|               this.getList() |           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) { |       toDetail(id) { | ||||||
|   | |||||||
| @@ -12,8 +12,8 @@ | |||||||
|       <div class="userlist"> |       <div class="userlist"> | ||||||
|         <div class="user" v-for="(item, index) in userList" :key="index" v-if="item"> |         <div class="user" v-for="(item, index) in userList" :key="index" v-if="item"> | ||||||
|           <img :src="item.avatarUrl1" v-if="item.avatarUrl1" alt=""> |           <img :src="item.avatarUrl1" v-if="item.avatarUrl1" alt=""> | ||||||
|           <h2 v-else>{{ formatName(item.userName || item.name) }}</h2> |           <h2 v-else>{{ formatName(item.userName || item.name || item.realName) }}</h2> | ||||||
|           <span>{{ item.userName || item.name }}</span> |           <span>{{ item.userName || item.name || item.realName }}</span> | ||||||
|           <i class="iconfont iconOverrule remove-icon" v-if="!disabled" @click="removeUser(item, index)"></i> |           <i class="iconfont iconOverrule remove-icon" v-if="!disabled" @click="removeUser(item, index)"></i> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
| @@ -55,7 +55,7 @@ | |||||||
|                 v-for="(item, index) in meta || tableData" |                 v-for="(item, index) in meta || tableData" | ||||||
|                 :key="index" |                 :key="index" | ||||||
|                 @click="chooseItem(item, index)" |                 @click="chooseItem(item, index)" | ||||||
|                 :class="{ selectedLi: getIsActive(item.id)}"> |                 :class="{ selectedLi: getIsActive(item[keys])}"> | ||||||
|               <slot v-if="customRightText" name="option" :item="item"></slot> |               <slot v-if="customRightText" name="option" :item="item"></slot> | ||||||
|               <template v-else> |               <template v-else> | ||||||
|                 <span class="iconfont iconProlife">{{ item.name }}</span> |                 <span class="iconfont iconProlife">{{ item.name }}</span> | ||||||
| @@ -91,7 +91,7 @@ | |||||||
|                 :disable-transitions="true" |                 :disable-transitions="true" | ||||||
|                 :key="i" |                 :key="i" | ||||||
|                 closable |                 closable | ||||||
|                 @close="cancelSelect(item, i)">{{ item.name || item.userName }} |                 @close="cancelSelect(item, i)">{{ item.name || item.userName || item.realName }} | ||||||
|             </el-tag> |             </el-tag> | ||||||
|           </div> |           </div> | ||||||
|           <div class="add_tag" v-else style="display:flex;align-items:center;justify-content:center;width:100%;"> |           <div class="add_tag" v-else style="display:flex;align-items:center;justify-content:center;width:100%;"> | ||||||
| @@ -117,6 +117,10 @@ export default { | |||||||
|         return [] |         return [] | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |     keys: { | ||||||
|  |       type: String, | ||||||
|  |       default: 'id', | ||||||
|  |     }, | ||||||
|     dialogTitle: String, |     dialogTitle: String, | ||||||
|     headerTitle: { |     headerTitle: { | ||||||
|       type: String, |       type: String, | ||||||
| @@ -218,7 +222,7 @@ export default { | |||||||
|         this.selectPeople = [] |         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) { |       if (index > -1) { | ||||||
|         this.selectPeople.splice(index, 1) |         this.selectPeople.splice(index, 1) | ||||||
| @@ -244,7 +248,7 @@ export default { | |||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     getIsActive(id) { |     getIsActive(id) { | ||||||
|       return this.selectPeople.findIndex(item => item.id === id) > -1 |       return this.selectPeople.findIndex(item => item[this.keys] === id) > -1 | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     clearAll() { |     clearAll() { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user