积分审核
This commit is contained in:
		
							
								
								
									
										62
									
								
								packages/shandong/AppIntegralAudit/AppIntegralAudit.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								packages/shandong/AppIntegralAudit/AppIntegralAudit.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,62 @@ | ||||
| <template> | ||||
|   <div class="AppHealthReport"> | ||||
|     <keep-alive :include="['List']"> | ||||
|       <component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component> | ||||
|     </keep-alive> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   import List from './components/List.vue' | ||||
|   import Detail from './components/Detail.vue' | ||||
|  | ||||
|   export default { | ||||
|     name: 'AppIntegralAudit', | ||||
|     label: '积分审核', | ||||
|  | ||||
|     components: { | ||||
|       List, | ||||
|       Detail | ||||
|     }, | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object, | ||||
|       permissions: Function | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         component: 'List', | ||||
|         params: {} | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       onChange (data) { | ||||
|         if (data.type === 'Detail') { | ||||
|           this.component = 'Detail' | ||||
|           this.isShowDetail = true | ||||
|           this.params = data.params | ||||
|         } | ||||
|  | ||||
|         if (data.type === 'list') { | ||||
|           this.component = 'List' | ||||
|           this.params = data.params | ||||
|  | ||||
|           this.$nextTick(() => { | ||||
|             if (data.isRefresh) { | ||||
|               this.$refs.component.getList() | ||||
|             } | ||||
|           }) | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
|   .AppHealthReport { | ||||
|     height: 100%; | ||||
|   } | ||||
| </style> | ||||
							
								
								
									
										203
									
								
								packages/shandong/AppIntegralAudit/components/Detail.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										203
									
								
								packages/shandong/AppIntegralAudit/components/Detail.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,203 @@ | ||||
|  <template> | ||||
|   <ai-detail class="audit"> | ||||
|     <template slot="title"> | ||||
|       <ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(true)"> | ||||
|       </ai-title> | ||||
|     </template> | ||||
|     <template slot="content"> | ||||
|       <ai-card title="基本信息"> | ||||
|         <template #content> | ||||
|           <ai-wrapper | ||||
|             label-width="120px"> | ||||
|             <ai-info-item label="申请人" :value="info.residentName"></ai-info-item> | ||||
|             <ai-info-item label="申请时间" :value="info.createTime"></ai-info-item> | ||||
|             <ai-info-item label="积分类型" :value="dict.getLabel('atWillReportType', info.applyIntegralType)"></ai-info-item> | ||||
|             <ai-info-item label="申请描述" :value="info.description" isLine></ai-info-item> | ||||
|             <ai-info-item label="联系电话" isLine :value="info.residentPhone"></ai-info-item> | ||||
|             <ai-info-item label="图片" isLine> | ||||
|               <ai-uploader v-model="info.applyFiles" disabled></ai-uploader> | ||||
|             </ai-info-item> | ||||
|           </ai-wrapper> | ||||
|         </template> | ||||
|       </ai-card> | ||||
|       <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' ? '通过' : '拒绝'" isLine></ai-info-item> | ||||
|             <ai-info-item label="原因" v-if="info.auditStatus === '2'" isLine :value="info.auditOpinion"></ai-info-item> | ||||
|             <ai-info-item label="积分规则类别" v-if="info.auditStatus === '1'" :value="dict.getLabel('atWillReportType', info.auditIntegralType)"></ai-info-item> | ||||
|             <ai-info-item label="积分规则事项" v-if="info.auditStatus === '1'" :value="info.auditRuleName"></ai-info-item> | ||||
|             <ai-info-item label="积分调整" isLine v-if="info.auditStatus === '1'" :value="(info.auditIntegral >= 0 ? '+' + info.auditIntegral : info.auditIntegral) + '分'"></ai-info-item> | ||||
|             <ai-info-item label="审核人" :value="info.auditUserName"></ai-info-item> | ||||
|             <ai-info-item label="审核时间" :value="info.auditTime"></ai-info-item> | ||||
|           </ai-wrapper> | ||||
|         </div> | ||||
|       </ai-card> | ||||
|       <ai-dialog | ||||
|         :visible.sync="isShow" | ||||
|         width="800px" | ||||
|         @close="onClose" | ||||
|         title="事件审核" | ||||
|         @onConfirm="onConfirm"> | ||||
|         <el-form class="ai-form" label-width="120px" :model="form" ref="form"> | ||||
|           <el-form-item label="是否通过审核" prop="pass" style="width: 100%;" :rules="[{ required: true, message: '请选择是否通过审核' }]"> | ||||
|             <el-radio-group v-model="form.pass"> | ||||
|               <el-radio label="0">否</el-radio> | ||||
|               <el-radio label="1">是</el-radio> | ||||
|             </el-radio-group> | ||||
|           </el-form-item> | ||||
|           <el-form-item v-if="form.pass === '1'" label="积分规则类别" prop="auditRuleId" style="width: 100%;" :rules="[{ required: true, message: '请选择积分规则类别' }]"> | ||||
|             <div class="flex-warpper"> | ||||
|               <ai-select | ||||
|                 v-model="form.auditIntegralType" | ||||
|                 clearable | ||||
|                 style="width: 180px;" | ||||
|                 placeholder="请选择积分规则类别" | ||||
|                 :selectList="dict.getDict('atWillReportType')" | ||||
|                 @change="onChange"> | ||||
|               </ai-select> | ||||
|               <ai-select | ||||
|                 v-model="form.auditRuleId" | ||||
|                 clearable | ||||
|                 style="width: 180px;margin: 0 10px;" | ||||
|                 placeholder="请选择积分规则事项" | ||||
|                 :selectList="ruleList"> | ||||
|               </ai-select> | ||||
|               <span>{{ integralText }}</span> | ||||
|             </div> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="审核意见" v-if="form.pass === '0'" prop="opinion" style="width: 100%;" :rules="[{ required: true, message: '请输入审核意见' }]"> | ||||
|             <el-input type="textarea" :rows="5" :maxlength="500" v-model="form.opinion" clearable placeholder="请输入审核意见" show-word-limit></el-input> | ||||
|           </el-form-item> | ||||
|         </el-form> | ||||
|       </ai-dialog> | ||||
|     </template> | ||||
|     <template #footer > | ||||
|       <el-button @click="cancel">取消</el-button> | ||||
|       <el-button type="primary" @click="isShow = true" v-if="info.auditStatus === '0'">审核</el-button> | ||||
|     </template> | ||||
|   </ai-detail> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   export default { | ||||
|     name: 'Detail', | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object, | ||||
|       params: Object | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         total: 0, | ||||
|         info: { | ||||
|           auditStatus: '0' | ||||
|         }, | ||||
|         id: '', | ||||
|         isShow: false, | ||||
|         form: { | ||||
|           auditIntegralType: '', | ||||
|           auditRuleId: '', | ||||
|           opinion: '', | ||||
|           pass: '' | ||||
|         }, | ||||
|         ruleList: [] | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     computed: { | ||||
|       integralText () { | ||||
|         if (!this.form.auditRuleId) { | ||||
|           return '' | ||||
|         } | ||||
|  | ||||
|         const integral = this.ruleList.filter(v => v.dictValue === this.form.auditRuleId)[0].integral | ||||
|  | ||||
|         return integral >= 0 ? `+${integral}分` : `${integral}分` | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     created () { | ||||
|       if (this.params && this.params.id) { | ||||
|         this.id = this.params.id | ||||
|         this.dict.load(['atWillReportType', 'auditStatus']).then(() => { | ||||
|           this.getInfo(this.params.id) | ||||
|         }) | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       getInfo (id) { | ||||
|         this.instance.post(`/app/appvillagerintegraldeclare/queryDetailById?id=${id}`).then(res => { | ||||
|           if (res.code === 0) { | ||||
|             this.info = res.data | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       onClose () { | ||||
|         this.form.auditIntegralType = '' | ||||
|         this.form.auditRuleId = '' | ||||
|         this.form.pass = '' | ||||
|         this.form.opinion = '' | ||||
|         this.id = '' | ||||
|       }, | ||||
|  | ||||
|       onConfirm() { | ||||
|         this.$refs.form.validate(v => { | ||||
|           if (v) { | ||||
|             this.instance.post('/app/appvillagerintegraldeclare/examine', null, { | ||||
|               params: { | ||||
|                 ...this.form, | ||||
|                 id: this.params.id, | ||||
|                 auditIntegral: this.form.auditRuleId ? this.ruleList.filter(v => v.dictValue === this.form.auditRuleId)[0].integral : '', | ||||
|                 auditRuleName: this.form.auditRuleId ? this.ruleList.filter(v => v.dictValue === this.form.auditRuleId)[0].ruleName : '' | ||||
|               } | ||||
|             }).then(res => { | ||||
|               if (res.code == 0) { | ||||
|                 this.isShow = false | ||||
|                 this.getInfo(this.params.id) | ||||
|                 this.$message.success('审核成功!') | ||||
|               } | ||||
|             }) | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       onChange (e) { | ||||
|         this.form.auditRuleId = '' | ||||
|         this.instance.post(`/app/appvillagerintegralrule/list?size=1000&classification=${e}`).then(res => { | ||||
|           if (res?.code == 0) { | ||||
|             this.ruleList = res.data.records.map(v => { | ||||
|               return { | ||||
|                 dictName: v.ruleName, | ||||
|                 dictValue: v.id, | ||||
|                 ruleName: v.ruleName, | ||||
|                 integral: v.integral | ||||
|               } | ||||
|             }) | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       cancel (isRefresh) { | ||||
|         this.$emit('change', { | ||||
|           type: 'list', | ||||
|           isRefresh: !!isRefresh | ||||
|         }) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
|   .audit { | ||||
|     .flex-warpper { | ||||
|       display: flex; | ||||
|       align-items: center; | ||||
|     } | ||||
|   } | ||||
| </style> | ||||
							
								
								
									
										237
									
								
								packages/shandong/AppIntegralAudit/components/List.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										237
									
								
								packages/shandong/AppIntegralAudit/components/List.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,237 @@ | ||||
| <template> | ||||
|   <ai-list class="list"> | ||||
|     <ai-title | ||||
|       slot="title" | ||||
|       title="积分审核" | ||||
|       v-if="search.areaId" | ||||
|       isShowBottomBorder | ||||
|       :instance="instance" | ||||
|       :disabledLevel="disabledLevel" | ||||
|       isShowArea | ||||
|       v-model="search.areaId" | ||||
|       @change="changeArea"> | ||||
|     </ai-title> | ||||
|     <template slot="content"> | ||||
|       <div class="content"> | ||||
|         <ai-search-bar> | ||||
|           <template #left> | ||||
|             <ai-select | ||||
|               v-model="search.applyIntegralType" | ||||
|               clearable | ||||
|               placeholder="请选择积分类型" | ||||
|               :selectList="dict.getDict('atWillReportType')" | ||||
|               @change="search.current = 1, getList()"> | ||||
|             </ai-select> | ||||
|             <ai-select | ||||
|               v-model="search.auditStatus" | ||||
|               clearable | ||||
|               placeholder="请选择审核状态" | ||||
|               :selectList="dict.getDict('auditStatus')" | ||||
|               @change="search.current = 1, getList()"> | ||||
|             </ai-select> | ||||
|             <el-date-picker | ||||
|               value-format="yyyy-MM-dd" | ||||
|               v-model="search.createTimeStart" | ||||
|               type="date" | ||||
|               size="small" | ||||
|               unlink-panels | ||||
|               placeholder="选择开始日期" | ||||
|               @change="search.current = 1, getList()" /> | ||||
|             <el-date-picker | ||||
|               value-format="yyyy-MM-dd" | ||||
|               v-model="search.createTimeEnd" | ||||
|               type="date" | ||||
|               size="small" | ||||
|               unlink-panels | ||||
|               placeholder="选择结束日期" | ||||
|               @change="search.current = 1, getList()" /> | ||||
|           </template> | ||||
|           <template #right> | ||||
|             <el-input | ||||
|               v-model="search.residentName" | ||||
|               size="small" | ||||
|               placeholder="请输入姓名" | ||||
|               clearable | ||||
|               @keyup.enter.native="search.current = 1, getList()" | ||||
|               @clear="search.current = 1, search.residentName = '', getList()" | ||||
|               suffix-icon="iconfont iconSearch"> | ||||
|             </el-input> | ||||
|           </template> | ||||
|         </ai-search-bar> | ||||
|         <ai-table | ||||
|           :tableData="tableData" | ||||
|           :col-configs="colConfigs" | ||||
|           :total="total" | ||||
|           v-loading="loading" | ||||
|           style="margin-top: 8px;" | ||||
|           :current.sync="search.current" | ||||
|           :size.sync="search.size" | ||||
|           @getList="getList"> | ||||
|           <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.id)">详情</el-button> | ||||
|               </div> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|         </ai-table> | ||||
|       </div> | ||||
|     </template> | ||||
|   </ai-list> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   import { mapState } from 'vuex' | ||||
|   export default { | ||||
|     name: 'List', | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         search: { | ||||
|           current: 1, | ||||
|           size: 10, | ||||
|           residentName: '', | ||||
|           applyIntegralType: '', | ||||
|           areaId: '', | ||||
|           auditStatus: '', | ||||
|           createTimeStart: '', | ||||
|           createTimeEnd: '' | ||||
|         }, | ||||
|         dictList: [{ | ||||
|           dictName: '否', | ||||
|           dictValue: '0' | ||||
|         }, { | ||||
|           dictName: '是', | ||||
|           dictValue: '1' | ||||
|         }], | ||||
|         info: {}, | ||||
|         colConfigs: [ | ||||
|           { prop: 'residentName', label: '申请人' }, | ||||
|           { prop: 'residentPhone', align: 'center', label: '联系电话' }, | ||||
|           { prop: 'createTime', align: 'center', label: '申请时间' }, | ||||
|           { prop: 'applyIntegralType', align: 'center', label: '积分类型', formart: v => this.dict.getLabel('atWillReportType', v) },  | ||||
|           { prop: 'auditStatus', align: 'center', label: '状态', formart: v => v ? this.dict.getLabel('auditStatus', v) : '-' },  | ||||
|           { prop: 'auditUserName', align: 'center', label: '审批人' },  | ||||
|           { prop: 'auditTime', align: 'center', label: '审批时间' } | ||||
|         ], | ||||
|         tableData: [], | ||||
|         total: 0, | ||||
|         loading: false, | ||||
|         disabledLevel: 0 | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     computed: { | ||||
|       ...mapState(['user']), | ||||
|  | ||||
|       param () { | ||||
|         return { | ||||
|  | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     created () { | ||||
|       this.disabledLevel = this.user.info.areaList.length - 1 | ||||
|       this.search.areaId = this.user.info.areaId | ||||
|       this.loading = true | ||||
|       this.dict.load(['atWillReportType', 'auditStatus']).then(() => { | ||||
|         this.getList() | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       getList () { | ||||
|         this.instance.post(`/app/appvillagerintegraldeclare/list`, null, { | ||||
|           params: { | ||||
|             ...this.search | ||||
|           } | ||||
|         }).then(res => { | ||||
|           if (res.code == 0) { | ||||
|             this.tableData = res.data.records | ||||
|             this.total = res.data.total | ||||
|             this.loading = false | ||||
|           } else { | ||||
|             this.loading = false | ||||
|           } | ||||
|         }).catch(() => { | ||||
|           this.loading = false | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       toDetail (id) { | ||||
|         this.$emit('change', { | ||||
|           type: 'Detail', | ||||
|           params: { | ||||
|             id: id || '' | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       changeArea () { | ||||
|         this.search.current = 1 | ||||
|  | ||||
|         this.$nextTick(() => { | ||||
|           this.getList() | ||||
|         }) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
|   .list { | ||||
|     ::v-deep .ai-list__content { | ||||
|       padding: 0!important; | ||||
|  | ||||
|       .ai-list__content--right-wrapper { | ||||
|         background: transparent!important; | ||||
|         box-shadow: none!important; | ||||
|         margin: 0!important; | ||||
|         padding: 12px 16px 12px!important; | ||||
|       } | ||||
|     } | ||||
|     .statistics-top { | ||||
|       display: flex; | ||||
|       align-items: center; | ||||
|       margin-bottom: 20px; | ||||
|  | ||||
|       & > div { | ||||
|         flex: 1; | ||||
|         height: 96px; | ||||
|         line-height: 1; | ||||
|         margin-right: 20px; | ||||
|         padding: 16px 24px; | ||||
|         background: #FFFFFF; | ||||
|         box-shadow: 0px 4px 6px -2px rgba(15, 15, 21, 0.15); | ||||
|         border-radius: 4px; | ||||
|  | ||||
|         &:last-child { | ||||
|           margin-right: 0; | ||||
|         } | ||||
|  | ||||
|         h3 { | ||||
|           font-size: 24px; | ||||
|         } | ||||
|  | ||||
|         span { | ||||
|           display: block; | ||||
|           margin-bottom: 16px; | ||||
|           color: #888888; | ||||
|           font-size: 16px; | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|  | ||||
|     .content { | ||||
|       padding: 16px; | ||||
|       background: #FFFFFF; | ||||
|       box-shadow: 0px 4px 6px -2px rgba(15, 15, 21, 0.15); | ||||
|     } | ||||
|   } | ||||
| </style> | ||||
		Reference in New Issue
	
	Block a user