164 lines
		
	
	
		
			4.9 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			164 lines
		
	
	
		
			4.9 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
<template>
 | 
						|
  <ai-detail class="detail">
 | 
						|
    <template slot="title">
 | 
						|
      <ai-title title="积分审核" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
 | 
						|
      </ai-title>
 | 
						|
    </template>
 | 
						|
    <template slot="content">
 | 
						|
      <ai-card title="基本信息">
 | 
						|
        <template #right>
 | 
						|
          <el-button size="small" type="primary" @click="isShow = true" v-if="info.status === '0'">审核</el-button>
 | 
						|
        </template>
 | 
						|
        <template #content>
 | 
						|
          <ai-wrapper>
 | 
						|
            <ai-info-item label="事件类型" isLine :value="info.applyItemName"></ai-info-item>
 | 
						|
            <ai-info-item label="申请人" :value="info.createUserName"></ai-info-item>
 | 
						|
            <ai-info-item label="手机号" :value="info.phone"></ai-info-item>
 | 
						|
            <ai-info-item label="所属地区" :value="info.areaName"></ai-info-item>
 | 
						|
            <ai-info-item label="所属网格" :value="info.girdName"></ai-info-item>
 | 
						|
            <ai-info-item label="审核时间" v-if="info.auditTime" :value="info.auditTime"></ai-info-item>
 | 
						|
            <ai-info-item label="状态">
 | 
						|
              <span>{{ dict.getLabel('appIntegralApplyEventStatus', info.status) }}</span>
 | 
						|
              <span v-if="info.status === '1'" style="margin-left: 10px; color: green">积分+{{ info.applyIntegral }}</span>
 | 
						|
            </ai-info-item>
 | 
						|
            <ai-info-item label="事件描述" isLine :value="info.content"></ai-info-item>
 | 
						|
            <ai-info-item label="活动附件" isLine>
 | 
						|
              <div class="files">
 | 
						|
                <div class="file-item" v-for="(item, index) in info.files" :key="index">
 | 
						|
                  <img :src="item.url" v-viewer="{movable: true}" v-if="item.postfix !== '.mp4'">
 | 
						|
                  <video controls v-else :src="item.url"></video>
 | 
						|
                </div>
 | 
						|
              </div>
 | 
						|
            </ai-info-item>
 | 
						|
          </ai-wrapper>
 | 
						|
        </template>
 | 
						|
      </ai-card>
 | 
						|
      <ai-dialog
 | 
						|
        :visible.sync="isShow"
 | 
						|
        @onConfirm="onConfirm"
 | 
						|
        @close="onClose"
 | 
						|
        width="890px"
 | 
						|
        title="审核">
 | 
						|
        <el-form class="ai-form" :model="form" label-width="120px" ref="form">
 | 
						|
          <el-form-item label="是否通过" prop="auditStatus" style="width: 100%;" :rules="[{required: true, message: '请选择是否通过', trigger: 'change'}]">
 | 
						|
            <el-radio-group v-model="form.auditStatus">
 | 
						|
              <el-radio label="0">否</el-radio>
 | 
						|
              <el-radio label="1">是</el-radio>
 | 
						|
            </el-radio-group>
 | 
						|
          </el-form-item>
 | 
						|
          <el-form-item prop="auditDesc" v-if="form.auditStatus === '0'" label="审批意见" style="width: 100%" :rules="[{required: true, message: '请输入审批意见', trigger: 'blur'}]">
 | 
						|
            <el-input size="small" type="textarea" :rows="5" v-model="form.auditDesc" clearable placeholder="请输入审批意见"></el-input>
 | 
						|
          </el-form-item>
 | 
						|
        </el-form>
 | 
						|
      </ai-dialog>
 | 
						|
    </template>
 | 
						|
  </ai-detail>
 | 
						|
</template>
 | 
						|
 | 
						|
<script>
 | 
						|
  export default {
 | 
						|
    name: 'Detail',
 | 
						|
 | 
						|
    props: {
 | 
						|
      instance: Function,
 | 
						|
      dict: Object,
 | 
						|
      params: Object
 | 
						|
    },
 | 
						|
 | 
						|
    data () {
 | 
						|
      return {
 | 
						|
        info: {},
 | 
						|
        form: {
 | 
						|
          auditDesc: '',
 | 
						|
          auditStatus: ''
 | 
						|
        },
 | 
						|
        isShow: false
 | 
						|
      }
 | 
						|
    },
 | 
						|
 | 
						|
    created () {
 | 
						|
      this.getInfo()
 | 
						|
    },
 | 
						|
 | 
						|
    methods: {
 | 
						|
      getInfo () {
 | 
						|
        this.instance.post(`/app/appintegraluserapply/queryDetailById?id=${this.params.id}`).then(res => {
 | 
						|
          if (res.code == 0) {
 | 
						|
            if (res.data) {
 | 
						|
              this.info = {
 | 
						|
                ...res.data,
 | 
						|
                files: res.data.files.map(v => {
 | 
						|
                  return {
 | 
						|
                    ...v,
 | 
						|
                    postfix: v.postfix.toLowerCase()
 | 
						|
                  }
 | 
						|
                })
 | 
						|
              }
 | 
						|
            }
 | 
						|
          }
 | 
						|
        })
 | 
						|
      },
 | 
						|
 | 
						|
      onClose () {
 | 
						|
        this.id = ''
 | 
						|
        this.form.auditDesc = ''
 | 
						|
        this.form.auditStatus = ''
 | 
						|
      },
 | 
						|
 | 
						|
      onConfirm () {
 | 
						|
        this.$refs.form.validate((valid) => {
 | 
						|
          if (valid) {
 | 
						|
            this.instance.post(`/app/appintegraluserapply/auditById`, {
 | 
						|
              ...this.form,
 | 
						|
              id: this.params.id
 | 
						|
            }).then(res => {
 | 
						|
              if (res.code == 0) {
 | 
						|
                this.$message.success('审核成功!')
 | 
						|
                this.isShow = false
 | 
						|
                this.getInfo()
 | 
						|
              }
 | 
						|
            })
 | 
						|
          }
 | 
						|
        })
 | 
						|
      },
 | 
						|
 | 
						|
      cancel () {
 | 
						|
        this.$emit('change', {
 | 
						|
          type: 'List',
 | 
						|
          isRefresh: true
 | 
						|
        })
 | 
						|
      }
 | 
						|
    }
 | 
						|
  }
 | 
						|
</script>
 | 
						|
 | 
						|
<style scoped lang="scss">
 | 
						|
  .detail {
 | 
						|
    .files {
 | 
						|
      display: flex;
 | 
						|
      align-items: center;
 | 
						|
      flex-wrap: wrap;
 | 
						|
      .file-item {
 | 
						|
        width: 240px;
 | 
						|
        height: 240px;
 | 
						|
        margin: 0 20px 20px 0;
 | 
						|
 | 
						|
        img, video {
 | 
						|
          width: 100%;
 | 
						|
          height: 100%;
 | 
						|
          object-fit: cover;
 | 
						|
        }
 | 
						|
 | 
						|
        img {
 | 
						|
          cursor: pointer;
 | 
						|
          transition: all ease 0.3s;
 | 
						|
 | 
						|
          &:hover {
 | 
						|
            opacity: 0.7;
 | 
						|
          }
 | 
						|
        }
 | 
						|
      }
 | 
						|
    }
 | 
						|
  }
 | 
						|
</style>
 |