|
@@ -30,18 +30,23 @@
|
|
|
<div class="filter-control">
|
|
|
<permission-button type="primary" @click="getList">查询</permission-button>
|
|
|
<permission-button type="primary" @click="navigationTo('club-add?type=edit')">添加</permission-button>
|
|
|
- <permission-button type="primary" @click="improtDialogVisible = true">导入</permission-button>
|
|
|
- <permission-button type="primary" @click="onHandleExport()">导出</permission-button>
|
|
|
+ <permission-button type="primary" @click="downLoadTemplate">机构导入模板</permission-button>
|
|
|
</div>
|
|
|
+ <!-- 机构设备信息导出 -->
|
|
|
<div class="filter-control">
|
|
|
- <permission-button type="primary" @click="downLoadExportExcel">获取导入模板</permission-button>
|
|
|
- <permission-button type="primary" @click="onHandleExport(1)">一键下载授权牌</permission-button>
|
|
|
+ <permission-button type="primary" @click="improtDialogVisible = true">导入机构信息</permission-button>
|
|
|
+ <permission-button type="primary" @click="onHandleExport(5)">导出机构信息</permission-button>
|
|
|
+ <permission-button type="primary" @click="onHandleExport(6)">导出设备信息</permission-button>
|
|
|
</div>
|
|
|
+ <!-- 机构设备授权牌导出 -->
|
|
|
<div class="filter-control">
|
|
|
- <permission-button type="primary" @click="onHandleExport(3)">一键下载机构二维码</permission-button>
|
|
|
+ <permission-button type="primary" @click="onHandleExport(1)">下载机构授权牌</permission-button>
|
|
|
+ <permission-button type="primary" @click="onHandleExport(2)">下载设备授权牌</permission-button>
|
|
|
</div>
|
|
|
+ <!-- 机构设备二维码下载 -->
|
|
|
<div class="filter-control">
|
|
|
- <permission-button type="primary" @click="onHandleExport(2)">一键下载设备二维码</permission-button>
|
|
|
+ <permission-button type="primary" @click="onHandleExport(3)">一键下载机构二维码</permission-button>
|
|
|
+ <permission-button type="primary" @click="onHandleExport(4)">一键下载设备二维码</permission-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 表格区域 -->
|
|
@@ -274,6 +279,7 @@ export default {
|
|
|
this.handleSave()
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
// 监听上传文件的状态变化
|
|
|
async fileUploadChange(fileList) {
|
|
|
this.uploadFileList = fileList
|
|
@@ -295,33 +301,28 @@ export default {
|
|
|
// 选择确认机构
|
|
|
onSelectorConfirm(list) {
|
|
|
this.exportClubList = list
|
|
|
- console.log(this.exportType)
|
|
|
- if (this.exportType) {
|
|
|
- this.handleExport(this.exportType) // 导出文件 授权牌 || 二维码
|
|
|
- } else {
|
|
|
- this.handleExportExcel() // 导出机构数据 Excel
|
|
|
- }
|
|
|
+ this.onExport(this.exportType)
|
|
|
this.exportDialogVisible = false
|
|
|
},
|
|
|
|
|
|
- // 导出下载授权牌 || 二维码 操作
|
|
|
+ // 导出下载机构信息
|
|
|
onHandleExport(type) {
|
|
|
this.exportDialogVisible = true
|
|
|
this.exportType = type
|
|
|
},
|
|
|
|
|
|
- // 导出下载授权牌 || 二维码
|
|
|
- async handleExport(type) {
|
|
|
- let confirmText = ''
|
|
|
- if (type === 1) {
|
|
|
- confirmText = '设备授权牌'
|
|
|
- } else if (type === 2) {
|
|
|
- confirmText = '设备二维码'
|
|
|
- } else {
|
|
|
- confirmText = '机构二维码'
|
|
|
+ // 导出
|
|
|
+ async onExport(type) {
|
|
|
+ const confirmText = ['', '机构授权牌', '设备授权牌', '机构二维码', '设备二维码', '机构信息', '设备信息'][type]
|
|
|
+ const downloadLinkMap = {
|
|
|
+ 1: '/shop/image?type=1&',
|
|
|
+ 2: '/shop/image?type=2&',
|
|
|
+ 3: '/shop/image?type=3&',
|
|
|
+ 4: '/shop/image?type=4&',
|
|
|
+ 5: '/auth/excel?',
|
|
|
+ 6: '/product/excel?'
|
|
|
}
|
|
|
-
|
|
|
- const text = await this.$confirm(`确认下载所选${confirmText}?`, '提示', {
|
|
|
+ const text = await this.$confirm(`确认下载所选${confirmText}?`, '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
@@ -330,16 +331,15 @@ export default {
|
|
|
this.$message.info('已取消操作')
|
|
|
})
|
|
|
if (text !== 'confirm') return
|
|
|
-
|
|
|
let notification = null
|
|
|
notification = this.$notify({
|
|
|
title: '提示',
|
|
|
message: `正在下载${confirmText},请勿重复操作!`,
|
|
|
duration: 0
|
|
|
})
|
|
|
-
|
|
|
+ const authIds = this.exportClubList.map((item) => item.authId)
|
|
|
// 使用a链接下载
|
|
|
- const downUrl = `${process.env.VUE_APP_BASE_API}/download/shop/image?authUserId=${this.authUserId}&type=${type}`
|
|
|
+ const downUrl = `${process.env.VUE_APP_BASE_API}/download${downloadLinkMap[type]}authIds=${authIds}`
|
|
|
downloadWithUrl(downUrl, confirmText)
|
|
|
.catch((err) => {
|
|
|
console.log(err)
|
|
@@ -351,9 +351,9 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- // 下载模板
|
|
|
- downLoadExportExcel() {
|
|
|
- const downUrl = `${process.env.VUE_APP_BASE_API}/download/file?ossName=%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F%E6%9C%BA%E6%9E%84%E3%80%81%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx&fileName=%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F%E6%9C%BA%E6%9E%84%E3%80%81%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`
|
|
|
+ // 下载机构导入模板
|
|
|
+ downLoadTemplate() {
|
|
|
+ const downUrl = `${process.env.VUE_APP_BASE_API}/download/auth/template`
|
|
|
let notification = null
|
|
|
notification = this.$notify({
|
|
|
title: '提示',
|
|
@@ -370,35 +370,6 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- // 导出为Excel
|
|
|
- async handleExportExcel() {
|
|
|
- const text = await this.$confirm('确认导出所有授权机构的数据吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).catch(() => {
|
|
|
- this.$message.info('已取消操作')
|
|
|
- })
|
|
|
- if (text !== 'confirm') return
|
|
|
- let notification = null
|
|
|
- notification = this.$notify({
|
|
|
- title: '提示',
|
|
|
- message: '正在导出机构信息,请勿重复操作!',
|
|
|
- duration: 0
|
|
|
- })
|
|
|
- // 使用a链接下载
|
|
|
- const downUrl = `${process.env.VUE_APP_BASE_API}/auth/export/excel?authUserId=${this.authUserId}`
|
|
|
- downloadWithUrl(downUrl, '机构数据.xlsx')
|
|
|
- .catch((err) => {
|
|
|
- console.log(err)
|
|
|
- this.$message.error(`导出机构数据失败`)
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- notification.close()
|
|
|
- this.onSelectorCancel()
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
// 导入Excel 并提交
|
|
|
handleSave: debounce(function() {
|
|
|
console.log('保存')
|
|
@@ -445,12 +416,14 @@ export default {
|
|
|
return Promise.resolve('success')
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
improtDialogClose() {
|
|
|
console.log(123)
|
|
|
// this.uploadFileList = []
|
|
|
this.$refs.fileUpload.clearAllFiles()
|
|
|
this.$refs.dialogForm.resetFields()
|
|
|
},
|
|
|
+
|
|
|
// 获取授权列表
|
|
|
getList() {
|
|
|
console.log(this.listQuery)
|
|
@@ -504,12 +477,14 @@ export default {
|
|
|
this.getList()
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
// 格式化列表数据
|
|
|
formatList(list = []) {
|
|
|
list.forEach((i) => {
|
|
|
i.status = i.status === 1
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
// 供应商状态改变
|
|
|
handleChangeStatus(item) {
|
|
|
this.listLoading = true
|
|
@@ -534,6 +509,7 @@ export default {
|
|
|
this.listLoading = false
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
// 过滤列表
|
|
|
handleFilter() {
|
|
|
this.listQuery.page = 1
|