|
@@ -18,7 +18,7 @@
|
|
<a-row :gutter="24">
|
|
<a-row :gutter="24">
|
|
<a-col :span="8">
|
|
<a-col :span="8">
|
|
<a-form-item name="searchKey" label="名称关键词">
|
|
<a-form-item name="searchKey" label="名称关键词">
|
|
- <a-input v-model:value="searchFormState.searchKey" placeholder="请输入机构名称关键词" />
|
|
|
|
|
|
+ <a-input v-model:value="searchFormState.searchKey" placeholder="请输入门店名称关键词" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-col :span="8">
|
|
@@ -71,6 +71,8 @@
|
|
{{ $TOOL.dictTypeData('ORG_CATEGORY', record.category) }}
|
|
{{ $TOOL.dictTypeData('ORG_CATEGORY', record.category) }}
|
|
</template>
|
|
</template>
|
|
<template v-if="column.dataIndex === 'action'">
|
|
<template v-if="column.dataIndex === 'action'">
|
|
|
|
+ <a @click="showModal(record)" >二维码</a>
|
|
|
|
+ <a-divider type="vertical" />
|
|
<a @click="formRef.onOpen(record)" v-if="hasPerm('bizOrgEdit')">编辑</a>
|
|
<a @click="formRef.onOpen(record)" v-if="hasPerm('bizOrgEdit')">编辑</a>
|
|
<a-divider type="vertical" v-if="hasPerm(['bizOrgEdit', 'bizOrgDelete'], 'and')" />
|
|
<a-divider type="vertical" v-if="hasPerm(['bizOrgEdit', 'bizOrgDelete'], 'and')" />
|
|
<a-popconfirm title="删除此机构与下级机构吗?" @confirm="removeOrg(record)">
|
|
<a-popconfirm title="删除此机构与下级机构吗?" @confirm="removeOrg(record)">
|
|
@@ -83,6 +85,30 @@
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
<Form ref="formRef" @successful="tableRef.refresh()" />
|
|
<Form ref="formRef" @successful="tableRef.refresh()" />
|
|
|
|
+
|
|
|
|
+ <a-modal v-model:visible="open" title="二维码">
|
|
|
|
+ <div id="qrcode" style="text-align: center; margin: 15px;">
|
|
|
|
+ <a-row>
|
|
|
|
+ <a-col :span="14">
|
|
|
|
+ <br><br>
|
|
|
|
+ <p><span>门店名称:</span>{{nowRecord.name}}</p>
|
|
|
|
+ <p><span>门店编码:</span>{{ nowRecord.code }}</p>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :span="8">
|
|
|
|
+ <a-image width="206" :src="qrCodeUrl.codeUrl">
|
|
|
|
+ <template #default>
|
|
|
|
+ <img src="https://www.antdv.com/assets/logo.1ef800a8.svg" class="icon" alt="Icon" />
|
|
|
|
+ </template>
|
|
|
|
+ </a-image>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <a-button @click="closeQrCode">关闭</a-button>
|
|
|
|
+ <a-button type="primary" @click="downloadFile">下载</a-button>
|
|
|
|
+ </template>
|
|
|
|
+ </a-modal>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup name="bizOrg">
|
|
<script setup name="bizOrg">
|
|
@@ -90,20 +116,34 @@
|
|
import { isEmpty } from 'lodash-es'
|
|
import { isEmpty } from 'lodash-es'
|
|
import bizOrgApi from '@/api/biz/bizOrgApi'
|
|
import bizOrgApi from '@/api/biz/bizOrgApi'
|
|
import Form from './form.vue'
|
|
import Form from './form.vue'
|
|
|
|
+ import QRCode from 'qrcode'
|
|
|
|
+ import html2canvas from 'html2canvas'
|
|
|
|
|
|
const columns = [
|
|
const columns = [
|
|
{
|
|
{
|
|
- title: '机构名称',
|
|
|
|
- dataIndex: 'name'
|
|
|
|
|
|
+ title: '门店名称',
|
|
|
|
+ dataIndex: 'name',
|
|
|
|
+ width:150
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '门店编码',
|
|
|
|
+ dataIndex: 'code',
|
|
|
|
+ width:150
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '门店地址',
|
|
|
|
+ dataIndex: 'address',
|
|
|
|
+ width:200
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '分类',
|
|
title: '分类',
|
|
- dataIndex: 'category'
|
|
|
|
|
|
+ dataIndex: 'category',
|
|
|
|
+ width: 100
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '排序',
|
|
title: '排序',
|
|
dataIndex: 'sortCode',
|
|
dataIndex: 'sortCode',
|
|
- width: 100
|
|
|
|
|
|
+ width: 80
|
|
}
|
|
}
|
|
]
|
|
]
|
|
if (hasPerm(['bizOrgEdit', 'bizOrgDelete'])) {
|
|
if (hasPerm(['bizOrgEdit', 'bizOrgDelete'])) {
|
|
@@ -111,7 +151,7 @@
|
|
title: '操作',
|
|
title: '操作',
|
|
dataIndex: 'action',
|
|
dataIndex: 'action',
|
|
align: 'center',
|
|
align: 'center',
|
|
- width: '150px'
|
|
|
|
|
|
+ width: 150
|
|
})
|
|
})
|
|
}
|
|
}
|
|
const selectedRowKeys = ref([])
|
|
const selectedRowKeys = ref([])
|
|
@@ -209,6 +249,75 @@
|
|
tableRef.value.clearRefreshSelected()
|
|
tableRef.value.clearRefreshSelected()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //二维码
|
|
|
|
+ const open = ref(false);
|
|
|
|
+ const qrCodeUrl = ref({})
|
|
|
|
+ const qrcodeCanvasRef = ref();
|
|
|
|
+ const nowRecord = ref({})
|
|
|
|
+
|
|
|
|
+ const showModal = (record) => {
|
|
|
|
+ nowRecord.value = record
|
|
|
|
+ open.value = true;
|
|
|
|
+ getQrCode(record)
|
|
|
|
+
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const getQrCode = (record) => {
|
|
|
|
+ //QRCode.toDataURL("id:"+record.id+"saleCode:"+record.saleCode, {
|
|
|
|
+ let param = {
|
|
|
|
+ id:record.id,
|
|
|
|
+ code:record.code
|
|
|
|
+ }
|
|
|
|
+ QRCode.toDataURL(JSON.stringify(param), {
|
|
|
|
+ errorCorrectionLevel: 'H',
|
|
|
|
+ margin: 1,
|
|
|
|
+ height: 206,
|
|
|
|
+ width: 206,
|
|
|
|
+ type: '10',
|
|
|
|
+ scal: 177,
|
|
|
|
+ color: {
|
|
|
|
+ dark: '#000' // 二维码背景颜色
|
|
|
|
+ },
|
|
|
|
+ rendererOpts: {
|
|
|
|
+ quality: 0.9
|
|
|
|
+ },
|
|
|
|
+ icon:'/public/img/tanglogo.png'
|
|
|
|
+ })
|
|
|
|
+ .then((url) => {
|
|
|
|
+ qrCodeUrl.value.codeUrl = url
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ console.error(err)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const closeQrCode = () => {
|
|
|
|
+ open.value = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 下载二维码
|
|
|
|
+ const downloadFile = () => {
|
|
|
|
+ html2canvas(qrcode, {
|
|
|
|
+ logging: false,
|
|
|
|
+ allowTaint: true,
|
|
|
|
+ scale: window.devicePixelRatio,
|
|
|
|
+ scrollY: 0,
|
|
|
|
+ scrollX: 0,
|
|
|
|
+ useCORS: true,
|
|
|
|
+ backgroundColor: '#ffffff'
|
|
|
|
+ })
|
|
|
|
+ .then(function (canvas) {
|
|
|
|
+ const a = window.document.createElement('a')
|
|
|
|
+ a.href = canvas.toDataURL('image/png')
|
|
|
|
+ a.download = '二维码'
|
|
|
|
+ a.click()
|
|
|
|
+ this.$message.success('正在进行下载保存')
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ console.log(err)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|