technicianDialog.vue 3.04 KB
<!-- 修改备注 -->
<template>
  <d2-dialog title="查看技师施工图" :is-visible="remarkVisible" class="accountDailog" @closeDialog="handleClose"
    @confirmDialog="handleAddConfirm" :noCancel="true" btnOkLabel="返回">
    <el-form ref="refundForm" :model="infoForm" :rules="formRules" label-width="150px">
      <el-form-item label="技师姓名:">
        {{ infoForm.technicianName }}
      </el-form-item>
      <el-form-item label="子商品名称:">
        {{ infoForm.upgradeGoodsName }}
      </el-form-item>
      <el-form-item label="审核状态:">
        <span class="status">{{ infoForm.approveStatus == null ? '未审核' : infoForm.approveStatus == "Y" ? '通过' :
          '未通过' }}</span>
      </el-form-item>
      <el-form-item label="" class="imgItem">
        <img class="img" v-for="(item, index) in infoForm.constructionImgList" @click="
          handleEnlargeImg(infoForm.constructionImgList, 'customerPhoto', index)
          " :key="index" :src="item" alt="">
      </el-form-item>
    </el-form>
    <el-image-viewer v-if="imgVisible" :mask-closable="true" zIndex="3000" :on-close="closeImgViewer"
      :url-list="imgList" :initial-index="initialIndex" />
  </d2-dialog>
</template>

<script>
import { deepClone } from '@/common/util'
export default {
  name: 'technicianDialog',
  components: {
    "el-image-viewer": () =>
      import("element-ui/packages/image/src/image-viewer")
  },
  data() {
    return {
      userInfo: this.$store.state.d2admin.user.info,
      infoForm: {
        // remark: ''
      },
      imgVisible: false,
      index: 0,
      initialIndex: 0,
      imgList: [],
      imgUrlName: "",
      formRules: {
        remark: [{ required: true, message: '请输入备注信息', trigger: 'change' }]
      }
    }
  },

  props: {
    remarkVisible: {
      type: Boolean,
      default: false
    },
    detail: {
      type: Object,
      default: null
    }
  },

  watch: {
  },

  created() {
  },

  mounted() {
    this.infoForm = deepClone(this.detail)
  },

  methods: {
    closeImgViewer() {
      this.imgVisible = false
    },
    handleEnlargeImg(url, name, index) {
      this.imgVisible = !this.imgVisible
      // this.imgList = url
      console.log("url", url)
      this.initialIndex = index
      this.imgList = url
      this.imgUrlName = name
    },
    handleAddConfirm() {
      this.handleClose(true)
    },

    handleClose(flag) {
      this.$emit('dialogClose', flag)
    }
  }
}
</script>
<style scoped lang="scss">
.accountDailog .el-dialog {
  margin-top: 20vh !important;
  min-width: 700px;
}

::v-deep .el-textarea .el-input__count {
  right: 10px;
  bottom: -7px;
  font-size: 12px;
  color: #999999;
  background-color: transparent;
}

.accountDailog .el-select-dropdown__item {
  width: 395px !important;
}

.imgItem {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  padding: 0 10px;

  ::v-deep .el-form-item__content {
    margin-left: 0 !important;
  }
}

.img {
  width: 120px;
  height: 120px;
  margin-left: 10px;
}

// .img {}

.status {
  color: #2A58AD;
}
</style>