xiongchao il y a 3 ans
Parent
commit
bef1821959

+ 12 - 0
src/api/upms/code.js

@@ -11,3 +11,15 @@ export function saveCode (parameter) {
     data: parameter
   })
 }
+
+export function generateSbCodeAll (parameter) {
+  return axios({
+    url: `/upms/codes/sb/all`,
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}

+ 19 - 0
src/api/upms/config.js

@@ -46,6 +46,7 @@ export function initConfig () {
   })
 }
 
+
 export function configData () {
   return axios({
     url: `/upms/configs/data`,
@@ -70,6 +71,24 @@ export function updateSysConfig (parameter) {
   })
 }
 
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateSysConfigBatch (parameter) {
+  return axios({
+    url: '/upms/configs/update/batch',
+    method: 'PUT',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
+
 /**
  * fetch single func
  * parameter: { }

+ 4 - 0
src/utils/dict.js

@@ -65,6 +65,10 @@ const DictCache = {
 
 }
 DictCache.TYPE = {
+  SB_QR_CODE_LABEL_WIDTH: 'SB_QR_CODE_LABEL_WIDTH', // 设备标签宽度
+  SB_QR_CODE_LABEL_CONTENT_WIDTH: 'SB_QR_CODE_LABEL_CONTENT_WIDTH', // 设备标签表格宽度
+  SB_QR_CODE_LABEL_CONTENT_HEIGHT: 'SB_QR_CODE_LABEL_CONTENT_HEIGHT', // 设备标签表格高度
+  SB_QR_CODE_LABEL_IMG_WIDTH: 'SB_QR_CODE_LABEL_IMG_WIDTH', // 设备标签二维码宽度
   FILE_DOWNLOAD_TEMPLATE: 'FILE_DOWNLOAD_TEMPLATE', // 模板文件
   DELFLAG: 'DELFLAG', // 删除标志
   SBTYPE_TYPE: 'SBTYPE_TYPE', // 设备类型

+ 22 - 10
src/views/sb/info/SbInfo.vue

@@ -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

Fichier diff supprimé car celui-ci est trop grand
+ 2 - 5
src/views/sb/info/modules/PrintInSbInfoBatch.vue


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff