|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<a-card :bordered="false">
|
|
|
<a-row :gutter="8" v-show="visible">
|
|
|
-<!-- <a-col :span="4">
|
|
|
+ <!-- <a-col :span="4">
|
|
|
<a-tree
|
|
|
@expand="onExpand"
|
|
|
:expandedKeys="expandedKeys"
|
|
@@ -82,7 +82,8 @@
|
|
|
<a-icon type="upload"/>
|
|
|
修改导入
|
|
|
</a-button>
|
|
|
- <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="upload" @click="handlePrintBatch()">批量打印</a-button>
|
|
|
+ <a-button style="margin-left: 8px" type="primary" icon="upload" @click="handlePrintBatch()">批量打印</a-button>
|
|
|
+ <a-button style="margin-left: 8px" v-if="$auth('sb-infos-generate-code-all')" :loading="confirmLoading" type="primary" @click="batchGenerate()">重新生成二维码</a-button>
|
|
|
<a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-infos-del')">
|
|
|
<a-menu slot="overlay">
|
|
|
<a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
|
|
@@ -122,23 +123,23 @@
|
|
|
<a @click="handleView(record)">查看</a>
|
|
|
</a-menu-item>
|
|
|
<a-menu-item key="1">
|
|
|
- <a v-if="$auth('sb-infos-edit')" @click="handleEdit(record)">修改</a>
|
|
|
+ <a v-if="$auth('sb-infos-edit')" @click="handleEdit(record)">修改</a>
|
|
|
</a-menu-item>
|
|
|
<a-menu-item v-if="record.status != 2" key="2">
|
|
|
- <a-popconfirm title="是否要启用该设备?" @confirm="handleStart(record)">
|
|
|
+ <a-popconfirm title="是否要启用该设备?" @confirm="handleStart(record)">
|
|
|
<a>启用</a>
|
|
|
</a-popconfirm>
|
|
|
</a-menu-item>
|
|
|
- <a-menu-item v-if="record.status != 7" key="3">
|
|
|
- <a-popconfirm title="是否要停用该设备?" @confirm="handleStop(record)">
|
|
|
+ <a-menu-item v-if="record.status != 7" key="3">
|
|
|
+ <a-popconfirm title="是否要停用该设备?" @confirm="handleStop(record)">
|
|
|
<a>停用</a>
|
|
|
</a-popconfirm>
|
|
|
</a-menu-item>
|
|
|
<a-menu-item key="10">
|
|
|
- <a v-if="$auth('sb-infos-edit')" @click="handleCopy(record)">复制</a>
|
|
|
+ <a v-if="$auth('sb-infos-edit')" @click="handleCopy(record)">复制</a>
|
|
|
</a-menu-item>
|
|
|
- <a-menu-item key="4">
|
|
|
- <a @click="handlePrint(record)">打印</a>
|
|
|
+ <a-menu-item key="4">
|
|
|
+ <a @click="handlePrint(record)">打印</a>
|
|
|
</a-menu-item>
|
|
|
</a-menu>
|
|
|
<a-button> 操作 <a-icon type="down" /> </a-button>
|
|
@@ -175,6 +176,7 @@ import DownloadModal from '@/views/download/DownloadModal'
|
|
|
import PreviewModal from '@/views/preview/PreviewModal'
|
|
|
import { updateSbInfo, getSbInfoPage, deleteSbInfos, fetchSbInfo, fetchSbInfos, exportSbInfo } from '@/api/sb/info'
|
|
|
import { queryDept } from '@/api/upms/dept'
|
|
|
+import { generateSbCodeAll } from '@/api/upms/code'
|
|
|
import { fetchSbTypeTree } from '@/api/sb/type'
|
|
|
import ImportFormAdd from './modules/ImportFormAdd'
|
|
|
import ImportFormUpdate from './modules/ImportFormUpdate'
|
|
@@ -222,6 +224,7 @@ export default {
|
|
|
isChildMap: {},
|
|
|
isShowMap: {},
|
|
|
deptList: {},
|
|
|
+ confirmLoading: false,
|
|
|
useTypeMap: {},
|
|
|
statusMap: {},
|
|
|
expandedKeys: [],
|
|
@@ -229,7 +232,6 @@ export default {
|
|
|
sourceTypeMap: {},
|
|
|
treeData: [],
|
|
|
// 表头
|
|
|
- // 表头
|
|
|
columns: [
|
|
|
{
|
|
|
title: '序号',
|
|
@@ -438,6 +440,16 @@ export default {
|
|
|
this.$refs.table.clearSelected()
|
|
|
})
|
|
|
},
|
|
|
+ batchGenerate () {
|
|
|
+ this.confirmLoading = true
|
|
|
+ this.$message.info('正在生成请稍后')
|
|
|
+ generateSbCodeAll().then(res => {
|
|
|
+ this.confirmLoading = false
|
|
|
+ this.$message.info('生成成功')
|
|
|
+ this.handleOk()
|
|
|
+ this.$refs.table.clearSelected()
|
|
|
+ })
|
|
|
+ },
|
|
|
handleEdit (record) {
|
|
|
fetchSbInfo({ id: record.id }).then(res => {
|
|
|
this.visible = false
|