|
@@ -263,7 +263,7 @@ import { useAppStore } from '~src/store'
|
|
|
import { HcIsButton } from '~src/plugins/IsButtons'
|
|
|
import HcDragUpload from './components/HcDragUpload.vue'
|
|
|
import approachApi from '~api/tentative/device/approach'
|
|
|
-import { arrToId, formValidate, getArrValue } from 'js-fast-way'
|
|
|
+import { arrToId, downloadBlob, formValidate, getArrValue } from 'js-fast-way'
|
|
|
import { getContractUserList } from '~api/other'
|
|
|
import { deviceClassListInit, getClassList } from '~api/tentative'
|
|
|
import { HcDelMsg } from 'hc-vue3-ui'
|
|
@@ -577,6 +577,10 @@ const printerClick = async () => {
|
|
|
const importModal = ref(false)
|
|
|
const uploadData = ref({})
|
|
|
const importModalClick = () => {
|
|
|
+ if(!searchForm.value?.deviceClassId){
|
|
|
+ window?.$message?.warning('请选择左边的数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
tableImportData.value = []
|
|
|
uploadData.value = { classNameId: menuKey.value }
|
|
|
importModal.value = true
|
|
@@ -636,6 +640,7 @@ const tableImportData = ref([])
|
|
|
//多选
|
|
|
const tableImportKeys = ref([])
|
|
|
const tableImportSelection = (rows) => {
|
|
|
+ rows.deviceClassName = menuItem.value.deviceClassName;
|
|
|
tableImportKeys.value = rows
|
|
|
}
|
|
|
|
|
@@ -717,8 +722,19 @@ const addEditFormClick = async () => {
|
|
|
}
|
|
|
|
|
|
//下载导入模板
|
|
|
+const getdownloadExcel = async ()=>{
|
|
|
+ const { error, disposition, res } = await approachApi.downloadExcel()
|
|
|
+ if (!error) {
|
|
|
+ if (disposition) {
|
|
|
+ downloadBlob(res, disposition)
|
|
|
+ } else {
|
|
|
+ window.$message?.error('数据异常')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const downloadImportClick = () => {
|
|
|
- window.open('https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20221109/2be4f32d07f9dd3e43479038b0c4aa2d.xlsx', '_blank')
|
|
|
+ getdownloadExcel()
|
|
|
}
|
|
|
|
|
|
//左右拖动,改变树形结构宽度
|