jiangping
2023-12-29 f9691d544e62d6c04dbfe45d05a6c7bc5e004291
admin/src/components/business/QRcode.vue
@@ -8,18 +8,17 @@
    >
        <div class="box" id="print-content">
            <div class="box_item" v-for="(item, index) in list" :key="index">
                <div class="box_item_title">微信</div>
<!--                <div class="box_item_title">微信</div>-->
                <div class="box_item_qr">
<!--                    <img src="../../assets/images/login_img.png" />-->
<!--                    <span>2341111/34</span>-->
                    <img :src="item.info" />
                    <span>{{item.siteId}}/{{item.code}}</span>
                    <img :src="item.imgfullurl" />
<!--                    <span>{{item.siteId}}/{{item.code}}</span>-->
                </div>
                <div class="box_item_footer">扫码取车</div>
<!--                <div class="box_item_footer">扫码取车</div>-->
            </div>
        </div>
        <template v-slot:footer>
            <el-button type="primary" v-print="'#print-content'">打印</el-button>
<!--            <el-button type="primary" v-print="'#print-content'">打印</el-button>-->
            <el-button type="primary" :loading="isWorking.export" v-if="isLoading==false" @click="exportImages">打包下载</el-button>
            <el-button @click="close">返回</el-button>
        </template>
    </GlobalWindow>
@@ -28,13 +27,15 @@
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { qrcodeList } from '@/api/business/sites'
import { qrcodeList,exportImages } from '@/api/business/sites'
export default {
  name: 'QRcode',
  extends: BaseOpera,
  components: { GlobalWindow },
  data () {
    return {
      siteId:'',
      isLoading : true,
      list: []
    }
  },
@@ -49,13 +50,28 @@
      this.list = []
      this.title = title
      this.visible = true
      this.siteId = id
      var that = this
      qrcodeList(id)
        .then(res => {
          that.isLoading = false
          this.list = res
        })
    },
    close () {
      this.visible = false
    },
    exportImages () {
      exportImages( this.siteId)
          .then(response => {
            this.download(response)
          })
          .catch(e => {
            this.$tip.apiFailed(e)
          })
          .finally(() => {
            this.isWorking.export = false
          })
    }
  }
}
@@ -70,7 +86,7 @@
        flex-wrap: wrap;
        .box_item {
            width: 152px;
            height: 228px;
            height: auto;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
@@ -98,7 +114,7 @@
                justify-content: space-between;
                img {
                    width: 126px;
                    height: 126px;
                    height: 146px;
                }
                span {
                    font-size: 13px;