Newer
Older
smartcity_merchant_front / src / views / shop / merchantdetail.vue
<!--案卷详情 只读-->
<template>
  <app-container style="margin-bottom: 10px">
    <el-row class="table-title">
      <el-col :span="6"><div class="title-header"><i class="el-icon-menu"/>商户信息</div></el-col>
    </el-row>
    <el-form v-if="caseDetail.merchantInfo!== undefined" ref="caseform" class="form" label-width="90px">
      <el-row :gutter="20">
        <el-col>
          <el-form-item label="商户名称">
            <table-cell-read :text="caseDetail.merchantInfo.merchantName"/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="三包编号">
            <table-cell-read :text="caseDetail.merchantInfo.shopCode"/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="租用状态">
            <table-cell-read :text="caseDetail.shopInfo.rentStatusName"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row >
        <el-col :span="6">
          <el-form-item label="联系人">
            <table-cell-read :text="caseDetail.merchantInfo.contactName"/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="联系电话">
            <table-cell-read :text="caseDetail.merchantInfo.contactPhone"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="更新时间">
            <table-cell-read :text="caseDetail.merchantInfo.updateTime"/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="更新来源">
            <table-cell-read :text="caseDetail.merchantInfo.sourceName"/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="更新人员">
            <table-cell-read :text="caseDetail.merchantInfo.updateUserName"/>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <el-row v-show="showChangeImage">
      <el-tabs type="border-card" class="image-container">
        <el-tab-pane v-if="fileIdChange.length>0" label="商户图片">
          <el-image v-for="(img, index) in fileIdChange" :key="img" :src="img" :preview-src-list="fileIdChange" fit="contain" class="image"/>
        </el-tab-pane>
      </el-tabs>
    </el-row>
    <el-row class="table-title">
      <el-col :span="6"><div class="title-header"><i class="el-icon-menu"/>店铺信息</div></el-col>
      <el-col :span="12" :offset="6" class="edit_btns">
        <el-button class="edit_btn" size="small" @click="dialogVisible = true">查看地图</el-button>
      </el-col>
    </el-row>
    <el-form v-if="caseDetail.shopInfo!==undefined" ref="caseform" class="form" label-width="90px">
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="三包编号">
            <table-cell-read :text="caseDetail.shopInfo.shopCode"/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="租用面积(㎡)" label-width="120px">
            <table-cell-read :text="caseDetail.shopInfo.rentArea.toString()"/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="所在街道">
            <table-cell-read :text="caseDetail.shopInfo.streetName"/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="所在社区">
            <table-cell-read :text="caseDetail.shopInfo.communityName"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="详细地址">
            <table-cell-read :text="caseDetail.shopInfo.address"/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="大队负责人">
            <table-cell-read :text="caseDetail.shopInfo.chargeName"/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="联系电话">
            <table-cell-read :text="caseDetail.shopInfo.chargePhone"/>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <el-row class="table-title">
      <el-col :span="6"><div class="title-header"><i class="el-icon-menu"/>商户处罚记录</div></el-col>
    </el-row>
    <el-table :data="list" class="table" border >
      <el-table-column :index="indexMethod" align="center" type="index" label="序号" width="55"/>
      <el-table-column v-for="column in columns" :key="column.value" :label="column.text" :width="column.width" :align="column.align" show-overflow-tooltip>
        <template slot-scope="scope">
          <span :class="column.class">{{ scope.row[column.value] }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="120" align="center">
        <template slot-scope="scope">
          <el-button type="primary" size="mini" @click="dialogVisible = true">地图</el-button>
          <el-button type="primary" size="mini" @click="pic(scope.row)">附件</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-dialog
      :visible.sync="dialogVisible"
      :append-to-body="true"
      title="位置详情"
    >
      <arc-gis-map-shop v-if="caseDetail.shopInfo!==undefined" :position="caseDetail.shopInfo.regionPoints" />
    </el-dialog>
    <el-dialog
      :visible.sync="dialogVisible1"
      :append-to-body="true"
      title="商户处罚附件"
    >
      <el-row>
        <el-tabs type="border-card" class="image-container">
          <el-tab-pane label="商户处罚图片">
            <el-image v-for="(img, index) in fileImage" :key="img" :src="img" :preview-src-list="fileImage" fit="contain" class="image"/>
          </el-tab-pane>
        </el-tabs>
      </el-row>
    </el-dialog>
  </app-container>
</template>

<script>
// import 'element-ui/lib/theme-chalk/index.css'
import { merchantDetail } from '@/api/merchant/merchant'
import { punishListByMerchant } from '@/api/merchant/punish'
import ArcGisMapShop from '@/components/Map/arcgisMapShop'

export default {
  name: 'MerchantDetail',
  components: { ArcGisMapShop },
  data() {
    return {
      id: '',
      imgurl: process.env.BASE_API + '/static/',
      showNeedVisit: false,
      fileIdChange: [], // 核实照片id
      caseDetail: {},
      operationKey: '', // 案件处理按钮key
      recordList: [], // 流转记录列表
      list: [], // 流转记录列表
      fileImage: [],
      processForm: { // 提交案卷处理表单
        processId: '', // 流程实例ID
        bizId: '', // 业务表单ID(caseId)
        currState: '', // 当前案件状态
        changeState: '', // 案件流转后状态
        remarks: '', // 审批意见
        approvalResult: '' // 审批结果标志
      },
      columns: [
        {
          text: '处罚类型',
          value: 'punishTypeName',
          align: 'center'
        },
        {
          text: '处罚意见',
          value: 'punishRemarks',
          align: 'center'
        },
        {
          text: '上报时间',
          value: 'punishTime',
          align: 'center'
        }
      ],
      rules: {
        refuseReason: [{ required: true, message: '驳回原因不能为空', trigger: ['blur', 'change'] }]
      }, // 前端校验规则
      dialogVisible: false,
      dialogVisible1: false
    }
  },
  computed: {
    // 是否显示案卷图片
    showChangeImage: function() {
      if (this.caseDetail.merchantInfo !== undefined) {
        if (this.caseDetail.merchantInfo.images.length === 0) {
          return false
        } else {
          return true
        }
      }
    }
  },
  mounted() {
    this.id = this.$route.params.id
    this.initData()
    this.fetchData()
  },
  methods: {
    pic(row) {
      const imgUrl = process.env.BASE_API + '/static/'
      if (row.punishImage.length !== 0) {
        this.fileImage = row.punishImage.split(',')
        this.fileImage = this.fileImage.map(item => imgUrl + item)
      }
      this.dialogVisible1 = true
    },
    indexMethod(index) {
      return index + 1
    },
    check(row) {
      this.$router.push({ path: '/changeDetail/' + row.recordId })
    },
    async initData() {
      // 查询案件详情接口
      const resDetail = await merchantDetail(this.id)
      this.caseDetail = resDetail.data
      console.log(this.caseDetail)
      // 解析图片id
      const imgUrl = process.env.BASE_API + '/static/'
      if (this.caseDetail.merchantInfo.images) {
        this.fileIdChange = this.caseDetail.merchantInfo.images.split(',')
        this.fileIdChange = this.fileIdChange.map(item => imgUrl + item)
      }
    },
    async fetchData() {
      // 查询案件详情接口
      const resDetail = await punishListByMerchant(this.id)
      this.list = resDetail.data
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  $tableTitleHeight:46px;
  .table-title{
    background-color: rgb(255, 255, 255);
    height: 46px;
    .title-header{
      line-height:$tableTitleHeight;
      color: #606266;
      font-size: 15px;
      i{
        margin-left: 5px;
        margin-right: 5px;
      }
    }
  }
  .edit_btns{
    .edit_btn{
      float:right;
      margin:7px 3px;//为了需要居中显示margin-top和bottom要用$tableTitleHeight减去按钮原高度除以2
    }
  }
  .app-container{
    // padding-top: 50px;
    margin-bottom: 20px;
  }
  .form{
    margin: 20px;
    // margin-left: 20px;
    // margin-right: 20px;
  }
  .table{
    margin: 20px;
    width: 98%;
  }
  .title{
    margin-left: 38px;
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 20px;
  }
  .content{
    margin-left: 50px;
    font-size: 14px;
    margin-bottom: 10px;
  }
  .button{
    margin-bottom: 30px;
  }

  .image-container {
    margin-left: 40px;
    margin-right: 20px;
    margin-bottom: 20px;
  }
  .el-image.image {
    width: 150px;
    height: 150px;
    margin-right: 20px;
  }
   /deep/ .gutter{
    background-color: #f3f3f3;
  }
  /deep/ .el-icon-circle-close{
    color: #e2e2e2
  }
</style>