diff --git a/src/api/device/standingBook.ts b/src/api/device/standingBook.ts
index 0f47a88..fe3c99e 100644
--- a/src/api/device/standingBook.ts
+++ b/src/api/device/standingBook.ts
@@ -35,7 +35,7 @@
})
}
// 批量导入测量设备信息
-export function listImporttApi(data: FormData) {
+export function listImportApi(data: FormData) {
return request({
url: '/meter/assets/importMeterEquipment',
method: 'post',
diff --git a/src/api/device/standingBook.ts b/src/api/device/standingBook.ts
index 0f47a88..fe3c99e 100644
--- a/src/api/device/standingBook.ts
+++ b/src/api/device/standingBook.ts
@@ -35,7 +35,7 @@
})
}
// 批量导入测量设备信息
-export function listImporttApi(data: FormData) {
+export function listImportApi(data: FormData) {
return request({
url: '/meter/assets/importMeterEquipment',
method: 'post',
diff --git a/src/views/device/standingBook/components/baseInfo.vue b/src/views/device/standingBook/components/baseInfo.vue
index 3452009..5ec3c4d 100644
--- a/src/views/device/standingBook/components/baseInfo.vue
+++ b/src/views/device/standingBook/components/baseInfo.vue
@@ -418,7 +418,7 @@
-
+
@@ -457,17 +457,17 @@
-
-
+
+
-
+
diff --git a/src/api/device/standingBook.ts b/src/api/device/standingBook.ts
index 0f47a88..fe3c99e 100644
--- a/src/api/device/standingBook.ts
+++ b/src/api/device/standingBook.ts
@@ -35,7 +35,7 @@
})
}
// 批量导入测量设备信息
-export function listImporttApi(data: FormData) {
+export function listImportApi(data: FormData) {
return request({
url: '/meter/assets/importMeterEquipment',
method: 'post',
diff --git a/src/views/device/standingBook/components/baseInfo.vue b/src/views/device/standingBook/components/baseInfo.vue
index 3452009..5ec3c4d 100644
--- a/src/views/device/standingBook/components/baseInfo.vue
+++ b/src/views/device/standingBook/components/baseInfo.vue
@@ -418,7 +418,7 @@
-
+
@@ -457,17 +457,17 @@
-
-
+
+
-
+
diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue
index 9cd3c83..988ba08 100644
--- a/src/views/device/standingBook/components/templateAdd.vue
+++ b/src/views/device/standingBook/components/templateAdd.vue
@@ -166,7 +166,7 @@
-
+
diff --git a/src/api/device/standingBook.ts b/src/api/device/standingBook.ts
index 0f47a88..fe3c99e 100644
--- a/src/api/device/standingBook.ts
+++ b/src/api/device/standingBook.ts
@@ -35,7 +35,7 @@
})
}
// 批量导入测量设备信息
-export function listImporttApi(data: FormData) {
+export function listImportApi(data: FormData) {
return request({
url: '/meter/assets/importMeterEquipment',
method: 'post',
diff --git a/src/views/device/standingBook/components/baseInfo.vue b/src/views/device/standingBook/components/baseInfo.vue
index 3452009..5ec3c4d 100644
--- a/src/views/device/standingBook/components/baseInfo.vue
+++ b/src/views/device/standingBook/components/baseInfo.vue
@@ -418,7 +418,7 @@
-
+
@@ -457,17 +457,17 @@
-
-
+
+
-
+
diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue
index 9cd3c83..988ba08 100644
--- a/src/views/device/standingBook/components/templateAdd.vue
+++ b/src/views/device/standingBook/components/templateAdd.vue
@@ -166,7 +166,7 @@
-
+
diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue
index 65ec9ca..608d07c 100644
--- a/src/views/device/standingBook/components/templatePage.vue
+++ b/src/views/device/standingBook/components/templatePage.vue
@@ -8,7 +8,7 @@
import { getDeptTreeList } from '@/api/system/dept'
import { toTreeList } from '@/utils/structure'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { assetsDeleteApi, listExportApi, listPageApi } from '@/api/device/standingBook'
+import { assetsDeleteApi, listExportApi, listImportApi, listPageApi } from '@/api/device/standingBook'
import { exportFile } from '@/utils/exportUtils'
const props = defineProps({
/**
@@ -291,9 +291,9 @@
// 创建formdata对象
const fd = new FormData()
fd.append('multipartFile', event.target.files[0])
- uploadApi(fd).then((res) => {
+ listImportApi(fd).then((res) => {
if (res.code === 200) {
- ElMessage.success('上传成功')
+ ElMessage.success('批量导入成功')
}
else {
ElMessage.error(res.message)
diff --git a/src/api/device/standingBook.ts b/src/api/device/standingBook.ts
index 0f47a88..fe3c99e 100644
--- a/src/api/device/standingBook.ts
+++ b/src/api/device/standingBook.ts
@@ -35,7 +35,7 @@
})
}
// 批量导入测量设备信息
-export function listImporttApi(data: FormData) {
+export function listImportApi(data: FormData) {
return request({
url: '/meter/assets/importMeterEquipment',
method: 'post',
diff --git a/src/views/device/standingBook/components/baseInfo.vue b/src/views/device/standingBook/components/baseInfo.vue
index 3452009..5ec3c4d 100644
--- a/src/views/device/standingBook/components/baseInfo.vue
+++ b/src/views/device/standingBook/components/baseInfo.vue
@@ -418,7 +418,7 @@
-
+
@@ -457,17 +457,17 @@
-
-
+
+
-
+
diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue
index 9cd3c83..988ba08 100644
--- a/src/views/device/standingBook/components/templateAdd.vue
+++ b/src/views/device/standingBook/components/templateAdd.vue
@@ -166,7 +166,7 @@
-
+
diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue
index 65ec9ca..608d07c 100644
--- a/src/views/device/standingBook/components/templatePage.vue
+++ b/src/views/device/standingBook/components/templatePage.vue
@@ -8,7 +8,7 @@
import { getDeptTreeList } from '@/api/system/dept'
import { toTreeList } from '@/utils/structure'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { assetsDeleteApi, listExportApi, listPageApi } from '@/api/device/standingBook'
+import { assetsDeleteApi, listExportApi, listImportApi, listPageApi } from '@/api/device/standingBook'
import { exportFile } from '@/utils/exportUtils'
const props = defineProps({
/**
@@ -291,9 +291,9 @@
// 创建formdata对象
const fd = new FormData()
fd.append('multipartFile', event.target.files[0])
- uploadApi(fd).then((res) => {
+ listImportApi(fd).then((res) => {
if (res.code === 200) {
- ElMessage.success('上传成功')
+ ElMessage.success('批量导入成功')
}
else {
ElMessage.error(res.message)
diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue
index be8a578..4bdb187 100644
--- a/src/views/device/standingBook/fixedAssets.vue
+++ b/src/views/device/standingBook/fixedAssets.vue
@@ -5,7 +5,7 @@
import type { fixedAssetsType, selectType } from './standingBook-interface'
import { exportFile } from '@/utils/exportUtils'
import { printJSON } from '@/utils/printUtils'
-import { assetsDeleteApi, listExportApi, listImporttApi, listPageApi } from '@/api/device/standingBook'
+import { assetsDeleteApi, listExportApi, listImportApi, listPageApi } from '@/api/device/standingBook'
import { getDictByCode } from '@/api/system/dict'
const { proxy } = getCurrentInstance() as any
const $router = useRouter()
@@ -213,7 +213,7 @@
// 创建formdata对象
const fd = new FormData()
fd.append('multipartFile', event.target.files[0])
- listImporttApi(fd).then((res) => {
+ listImportApi(fd).then((res) => {
if (res.code === 200) {
ElMessage.success('上传成功')
}
diff --git a/src/api/device/standingBook.ts b/src/api/device/standingBook.ts
index 0f47a88..fe3c99e 100644
--- a/src/api/device/standingBook.ts
+++ b/src/api/device/standingBook.ts
@@ -35,7 +35,7 @@
})
}
// 批量导入测量设备信息
-export function listImporttApi(data: FormData) {
+export function listImportApi(data: FormData) {
return request({
url: '/meter/assets/importMeterEquipment',
method: 'post',
diff --git a/src/views/device/standingBook/components/baseInfo.vue b/src/views/device/standingBook/components/baseInfo.vue
index 3452009..5ec3c4d 100644
--- a/src/views/device/standingBook/components/baseInfo.vue
+++ b/src/views/device/standingBook/components/baseInfo.vue
@@ -418,7 +418,7 @@
-
+
@@ -457,17 +457,17 @@
-
-
+
+
-
+
diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue
index 9cd3c83..988ba08 100644
--- a/src/views/device/standingBook/components/templateAdd.vue
+++ b/src/views/device/standingBook/components/templateAdd.vue
@@ -166,7 +166,7 @@
-
+
diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue
index 65ec9ca..608d07c 100644
--- a/src/views/device/standingBook/components/templatePage.vue
+++ b/src/views/device/standingBook/components/templatePage.vue
@@ -8,7 +8,7 @@
import { getDeptTreeList } from '@/api/system/dept'
import { toTreeList } from '@/utils/structure'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { assetsDeleteApi, listExportApi, listPageApi } from '@/api/device/standingBook'
+import { assetsDeleteApi, listExportApi, listImportApi, listPageApi } from '@/api/device/standingBook'
import { exportFile } from '@/utils/exportUtils'
const props = defineProps({
/**
@@ -291,9 +291,9 @@
// 创建formdata对象
const fd = new FormData()
fd.append('multipartFile', event.target.files[0])
- uploadApi(fd).then((res) => {
+ listImportApi(fd).then((res) => {
if (res.code === 200) {
- ElMessage.success('上传成功')
+ ElMessage.success('批量导入成功')
}
else {
ElMessage.error(res.message)
diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue
index be8a578..4bdb187 100644
--- a/src/views/device/standingBook/fixedAssets.vue
+++ b/src/views/device/standingBook/fixedAssets.vue
@@ -5,7 +5,7 @@
import type { fixedAssetsType, selectType } from './standingBook-interface'
import { exportFile } from '@/utils/exportUtils'
import { printJSON } from '@/utils/printUtils'
-import { assetsDeleteApi, listExportApi, listImporttApi, listPageApi } from '@/api/device/standingBook'
+import { assetsDeleteApi, listExportApi, listImportApi, listPageApi } from '@/api/device/standingBook'
import { getDictByCode } from '@/api/system/dict'
const { proxy } = getCurrentInstance() as any
const $router = useRouter()
@@ -213,7 +213,7 @@
// 创建formdata对象
const fd = new FormData()
fd.append('multipartFile', event.target.files[0])
- listImporttApi(fd).then((res) => {
+ listImportApi(fd).then((res) => {
if (res.code === 200) {
ElMessage.success('上传成功')
}
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue
index 42d0040..e6bb9a1 100644
--- a/src/views/device/stateManage/components/templateAdd.vue
+++ b/src/views/device/stateManage/components/templateAdd.vue
@@ -249,7 +249,7 @@
// 关闭弹窗
const close = () => {
- $router.go(-1)
+ $router.back()
}
// 保存
@@ -281,7 +281,7 @@
// 成功
ruleForm2.value.id = res.data
ElMessage.success('操作成功')
- $router.go(-1)
+ $router.back()
}
})
}
@@ -324,7 +324,7 @@
// }
failUpdate({ ...ruleForm2.value }).then(() => {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
})
})
}
@@ -348,7 +348,7 @@
}
submitApply(params).then(() => {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
})
})
}
@@ -371,7 +371,7 @@
updateStatus(ruleForm1.value).then((res) => {
if (res.code === 200) {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
}
else {
ElMessage.warning(res.message)
@@ -390,7 +390,7 @@
updateRejectStatus(ruleForm1.value).then((res) => {
if (res.code === 200) {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
}
else {
ElMessage.warning(res.message)
@@ -451,7 +451,7 @@
}).then((res) => {
if (res.code === 200) {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
}
else {
ElMessage.warning(res.message)
@@ -764,33 +764,33 @@
-
-
-
- 提交
-
-
- 保存
-
-
-
- 保存
-
-
-
- 保存
-
-
-
- 同意
-
-
- 驳回
-
-
- 拒绝
-
-
+
+
+
+ 提交
+
+
+ 保存
+
+
+
+ 保存
+
+
+
+ 保存
+
+
+
+ 同意
+
+
+ 驳回
+
+
+ 拒绝
+
+
编辑
@@ -820,7 +820,7 @@
-
+
选择
diff --git a/src/api/device/standingBook.ts b/src/api/device/standingBook.ts
index 0f47a88..fe3c99e 100644
--- a/src/api/device/standingBook.ts
+++ b/src/api/device/standingBook.ts
@@ -35,7 +35,7 @@
})
}
// 批量导入测量设备信息
-export function listImporttApi(data: FormData) {
+export function listImportApi(data: FormData) {
return request({
url: '/meter/assets/importMeterEquipment',
method: 'post',
diff --git a/src/views/device/standingBook/components/baseInfo.vue b/src/views/device/standingBook/components/baseInfo.vue
index 3452009..5ec3c4d 100644
--- a/src/views/device/standingBook/components/baseInfo.vue
+++ b/src/views/device/standingBook/components/baseInfo.vue
@@ -418,7 +418,7 @@
-
+
@@ -457,17 +457,17 @@
-
-
+
+
-
+
diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue
index 9cd3c83..988ba08 100644
--- a/src/views/device/standingBook/components/templateAdd.vue
+++ b/src/views/device/standingBook/components/templateAdd.vue
@@ -166,7 +166,7 @@
-
+
diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue
index 65ec9ca..608d07c 100644
--- a/src/views/device/standingBook/components/templatePage.vue
+++ b/src/views/device/standingBook/components/templatePage.vue
@@ -8,7 +8,7 @@
import { getDeptTreeList } from '@/api/system/dept'
import { toTreeList } from '@/utils/structure'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { assetsDeleteApi, listExportApi, listPageApi } from '@/api/device/standingBook'
+import { assetsDeleteApi, listExportApi, listImportApi, listPageApi } from '@/api/device/standingBook'
import { exportFile } from '@/utils/exportUtils'
const props = defineProps({
/**
@@ -291,9 +291,9 @@
// 创建formdata对象
const fd = new FormData()
fd.append('multipartFile', event.target.files[0])
- uploadApi(fd).then((res) => {
+ listImportApi(fd).then((res) => {
if (res.code === 200) {
- ElMessage.success('上传成功')
+ ElMessage.success('批量导入成功')
}
else {
ElMessage.error(res.message)
diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue
index be8a578..4bdb187 100644
--- a/src/views/device/standingBook/fixedAssets.vue
+++ b/src/views/device/standingBook/fixedAssets.vue
@@ -5,7 +5,7 @@
import type { fixedAssetsType, selectType } from './standingBook-interface'
import { exportFile } from '@/utils/exportUtils'
import { printJSON } from '@/utils/printUtils'
-import { assetsDeleteApi, listExportApi, listImporttApi, listPageApi } from '@/api/device/standingBook'
+import { assetsDeleteApi, listExportApi, listImportApi, listPageApi } from '@/api/device/standingBook'
import { getDictByCode } from '@/api/system/dict'
const { proxy } = getCurrentInstance() as any
const $router = useRouter()
@@ -213,7 +213,7 @@
// 创建formdata对象
const fd = new FormData()
fd.append('multipartFile', event.target.files[0])
- listImporttApi(fd).then((res) => {
+ listImportApi(fd).then((res) => {
if (res.code === 200) {
ElMessage.success('上传成功')
}
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue
index 42d0040..e6bb9a1 100644
--- a/src/views/device/stateManage/components/templateAdd.vue
+++ b/src/views/device/stateManage/components/templateAdd.vue
@@ -249,7 +249,7 @@
// 关闭弹窗
const close = () => {
- $router.go(-1)
+ $router.back()
}
// 保存
@@ -281,7 +281,7 @@
// 成功
ruleForm2.value.id = res.data
ElMessage.success('操作成功')
- $router.go(-1)
+ $router.back()
}
})
}
@@ -324,7 +324,7 @@
// }
failUpdate({ ...ruleForm2.value }).then(() => {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
})
})
}
@@ -348,7 +348,7 @@
}
submitApply(params).then(() => {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
})
})
}
@@ -371,7 +371,7 @@
updateStatus(ruleForm1.value).then((res) => {
if (res.code === 200) {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
}
else {
ElMessage.warning(res.message)
@@ -390,7 +390,7 @@
updateRejectStatus(ruleForm1.value).then((res) => {
if (res.code === 200) {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
}
else {
ElMessage.warning(res.message)
@@ -451,7 +451,7 @@
}).then((res) => {
if (res.code === 200) {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
}
else {
ElMessage.warning(res.message)
@@ -764,33 +764,33 @@
-
-
-
- 提交
-
-
- 保存
-
-
-
- 保存
-
-
-
- 保存
-
-
-
- 同意
-
-
- 驳回
-
-
- 拒绝
-
-
+
+
+
+ 提交
+
+
+ 保存
+
+
+
+ 保存
+
+
+
+ 保存
+
+
+
+ 同意
+
+
+ 驳回
+
+
+ 拒绝
+
+
编辑
@@ -820,7 +820,7 @@
-
+
选择
diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue
index f31b654..3a7deae 100644
--- a/src/views/device/stateManage/components/templateList.vue
+++ b/src/views/device/stateManage/components/templateList.vue
@@ -10,11 +10,9 @@
getStatusList,
submitStatus,
} from '@/api/device/stateManage'
-import { getDictByCode } from '@/api/system/dict'
import { printJSON } from '@/utils/printUtils'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import { SCHEDULE } from '@/utils/scheduleDict'
-import type { dictType } from '@/views/device/receive/receive'
import { exportFile } from '@/utils/exportUtils'
// 选中的按钮
@@ -49,15 +47,19 @@
delete: '/device/unusedApply/delete', // 删除
}
const activeTitle = ref(props.title) // 状态按钮选中
-const approvalStatusMap = ref({}) as any// 审批状态字典{1:草稿箱}
-const approvalStatusReserveMap = ref({}) as any// 审批状态字典{草稿箱: 1}
+const approvalStatusVal = ref(props.type)
+if (props.type == '0') {
+ approvalStatusVal.value = ''
+}
+// const approvalStatusMap = ref({}) as any// 审批状态字典{1:草稿箱}
+// const approvalStatusReserveMap = ref({}) as any// 审批状态字典{草稿箱: 1}
const $router = useRouter()
// 查询参数
const searchQuery = reactive({
applyNo: '', // 申请编号
applyStatus: '', // 申请状态
applyUnit: '', // 申请单位
- approvalStatus: '0', // 审批状态
+ approvalStatus: approvalStatusVal.value, // 审批状态
createUser: '', // 创建人
equipmentName: '', // 设备名称
equipmentNo: '', // 设备编号
@@ -142,48 +144,12 @@
searchQuery.formId = SCHEDULE[props.formCode as keyof typeof SCHEDULE]
}
-// 获取字典值
-async function getDict() {
- managerStateList.value = []
- // 审批状态
- const res = await getDictByCode('approvalStatus')
- // 审批状态字典 {1:草稿箱}
- res.data.forEach((item: any) => {
- approvalStatusMap.value[`${item.value}`] = item.name
- })
-
- // 审批状态字典 {草稿箱: 1}
- res.data.forEach((item: any) => {
- approvalStatusReserveMap.value[item.name] = `${item.value}`
- })
-
- // 制作右上角的菜单
- res.data.forEach((item: dictType) => {
- if (item.name === '全部' || item.name === '草稿箱'
- || item.name === '待审批' || item.name === '审批中'
- || item.name === '已通过' || item.name === '未通过'
- || item.name === '已取消') {
- managerStateList.value.push({
- name: item.name,
- value: item.name,
- id: `${item.value}`,
- })
- }
- })
-}
-
// 获取数据列表
const getList = () => {
- getDict()
loadingTable.value = true
getStatusList(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows.map((item: ITableRow) => {
- return {
- ...item,
- approvalStatus: approvalStatusMap[item.approvalStatus],
- }
- })
+ list.value = res.data.rows
total.value = res.data.total
}
loadingTable.value = false
@@ -192,6 +158,7 @@
loadingTable.value = false
})
}
+
// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写
const changePage = (val: { size?: number; page?: number }) => {
if (val && val.size) {
@@ -423,31 +390,9 @@
dialogVisible.value = false
}
-watch(() => searchQuery.applyStatus, (newValue) => {
- if (newValue == '') {
- searchQuery.approvalStatus = '0'
- }
- else {
- searchQuery.approvalStatus = approvalStatusReserveMap.value[newValue]
- }
+onMounted(() => {
+ getList()
})
-
-watch(
- () => props.type,
- (newValue) => {
- if (newValue === '0') {
- searchQuery.approvalStatus = '0'
- }
- else {
- searchQuery.approvalStatus = newValue
- }
- getList()
- },
- {
- immediate: true,
- deep: true,
- },
-)
@@ -615,7 +560,7 @@
-
+
@@ -457,17 +457,17 @@
-
-
+
+
-
+
diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue
index 9cd3c83..988ba08 100644
--- a/src/views/device/standingBook/components/templateAdd.vue
+++ b/src/views/device/standingBook/components/templateAdd.vue
@@ -166,7 +166,7 @@
-
+
diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue
index 65ec9ca..608d07c 100644
--- a/src/views/device/standingBook/components/templatePage.vue
+++ b/src/views/device/standingBook/components/templatePage.vue
@@ -8,7 +8,7 @@
import { getDeptTreeList } from '@/api/system/dept'
import { toTreeList } from '@/utils/structure'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { assetsDeleteApi, listExportApi, listPageApi } from '@/api/device/standingBook'
+import { assetsDeleteApi, listExportApi, listImportApi, listPageApi } from '@/api/device/standingBook'
import { exportFile } from '@/utils/exportUtils'
const props = defineProps({
/**
@@ -291,9 +291,9 @@
// 创建formdata对象
const fd = new FormData()
fd.append('multipartFile', event.target.files[0])
- uploadApi(fd).then((res) => {
+ listImportApi(fd).then((res) => {
if (res.code === 200) {
- ElMessage.success('上传成功')
+ ElMessage.success('批量导入成功')
}
else {
ElMessage.error(res.message)
diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue
index be8a578..4bdb187 100644
--- a/src/views/device/standingBook/fixedAssets.vue
+++ b/src/views/device/standingBook/fixedAssets.vue
@@ -5,7 +5,7 @@
import type { fixedAssetsType, selectType } from './standingBook-interface'
import { exportFile } from '@/utils/exportUtils'
import { printJSON } from '@/utils/printUtils'
-import { assetsDeleteApi, listExportApi, listImporttApi, listPageApi } from '@/api/device/standingBook'
+import { assetsDeleteApi, listExportApi, listImportApi, listPageApi } from '@/api/device/standingBook'
import { getDictByCode } from '@/api/system/dict'
const { proxy } = getCurrentInstance() as any
const $router = useRouter()
@@ -213,7 +213,7 @@
// 创建formdata对象
const fd = new FormData()
fd.append('multipartFile', event.target.files[0])
- listImporttApi(fd).then((res) => {
+ listImportApi(fd).then((res) => {
if (res.code === 200) {
ElMessage.success('上传成功')
}
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue
index 42d0040..e6bb9a1 100644
--- a/src/views/device/stateManage/components/templateAdd.vue
+++ b/src/views/device/stateManage/components/templateAdd.vue
@@ -249,7 +249,7 @@
// 关闭弹窗
const close = () => {
- $router.go(-1)
+ $router.back()
}
// 保存
@@ -281,7 +281,7 @@
// 成功
ruleForm2.value.id = res.data
ElMessage.success('操作成功')
- $router.go(-1)
+ $router.back()
}
})
}
@@ -324,7 +324,7 @@
// }
failUpdate({ ...ruleForm2.value }).then(() => {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
})
})
}
@@ -348,7 +348,7 @@
}
submitApply(params).then(() => {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
})
})
}
@@ -371,7 +371,7 @@
updateStatus(ruleForm1.value).then((res) => {
if (res.code === 200) {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
}
else {
ElMessage.warning(res.message)
@@ -390,7 +390,7 @@
updateRejectStatus(ruleForm1.value).then((res) => {
if (res.code === 200) {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
}
else {
ElMessage.warning(res.message)
@@ -451,7 +451,7 @@
}).then((res) => {
if (res.code === 200) {
ElMessage.success('操作成功!')
- $router.go(-1)
+ $router.back()
}
else {
ElMessage.warning(res.message)
@@ -764,33 +764,33 @@
-
-
-
- 提交
-
-
- 保存
-
-
-
- 保存
-
-
-
- 保存
-
-
-
- 同意
-
-
- 驳回
-
-
- 拒绝
-
-
+
+
+
+ 提交
+
+
+ 保存
+
+
+
+ 保存
+
+
+
+ 保存
+
+
+
+ 同意
+
+
+ 驳回
+
+
+ 拒绝
+
+
编辑
@@ -820,7 +820,7 @@
-
+
选择
diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue
index f31b654..3a7deae 100644
--- a/src/views/device/stateManage/components/templateList.vue
+++ b/src/views/device/stateManage/components/templateList.vue
@@ -10,11 +10,9 @@
getStatusList,
submitStatus,
} from '@/api/device/stateManage'
-import { getDictByCode } from '@/api/system/dict'
import { printJSON } from '@/utils/printUtils'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import { SCHEDULE } from '@/utils/scheduleDict'
-import type { dictType } from '@/views/device/receive/receive'
import { exportFile } from '@/utils/exportUtils'
// 选中的按钮
@@ -49,15 +47,19 @@
delete: '/device/unusedApply/delete', // 删除
}
const activeTitle = ref(props.title) // 状态按钮选中
-const approvalStatusMap = ref({}) as any// 审批状态字典{1:草稿箱}
-const approvalStatusReserveMap = ref({}) as any// 审批状态字典{草稿箱: 1}
+const approvalStatusVal = ref(props.type)
+if (props.type == '0') {
+ approvalStatusVal.value = ''
+}
+// const approvalStatusMap = ref({}) as any// 审批状态字典{1:草稿箱}
+// const approvalStatusReserveMap = ref({}) as any// 审批状态字典{草稿箱: 1}
const $router = useRouter()
// 查询参数
const searchQuery = reactive({
applyNo: '', // 申请编号
applyStatus: '', // 申请状态
applyUnit: '', // 申请单位
- approvalStatus: '0', // 审批状态
+ approvalStatus: approvalStatusVal.value, // 审批状态
createUser: '', // 创建人
equipmentName: '', // 设备名称
equipmentNo: '', // 设备编号
@@ -142,48 +144,12 @@
searchQuery.formId = SCHEDULE[props.formCode as keyof typeof SCHEDULE]
}
-// 获取字典值
-async function getDict() {
- managerStateList.value = []
- // 审批状态
- const res = await getDictByCode('approvalStatus')
- // 审批状态字典 {1:草稿箱}
- res.data.forEach((item: any) => {
- approvalStatusMap.value[`${item.value}`] = item.name
- })
-
- // 审批状态字典 {草稿箱: 1}
- res.data.forEach((item: any) => {
- approvalStatusReserveMap.value[item.name] = `${item.value}`
- })
-
- // 制作右上角的菜单
- res.data.forEach((item: dictType) => {
- if (item.name === '全部' || item.name === '草稿箱'
- || item.name === '待审批' || item.name === '审批中'
- || item.name === '已通过' || item.name === '未通过'
- || item.name === '已取消') {
- managerStateList.value.push({
- name: item.name,
- value: item.name,
- id: `${item.value}`,
- })
- }
- })
-}
-
// 获取数据列表
const getList = () => {
- getDict()
loadingTable.value = true
getStatusList(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows.map((item: ITableRow) => {
- return {
- ...item,
- approvalStatus: approvalStatusMap[item.approvalStatus],
- }
- })
+ list.value = res.data.rows
total.value = res.data.total
}
loadingTable.value = false
@@ -192,6 +158,7 @@
loadingTable.value = false
})
}
+
// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写
const changePage = (val: { size?: number; page?: number }) => {
if (val && val.size) {
@@ -423,31 +390,9 @@
dialogVisible.value = false
}
-watch(() => searchQuery.applyStatus, (newValue) => {
- if (newValue == '') {
- searchQuery.approvalStatus = '0'
- }
- else {
- searchQuery.approvalStatus = approvalStatusReserveMap.value[newValue]
- }
+onMounted(() => {
+ getList()
})
-
-watch(
- () => props.type,
- (newValue) => {
- if (newValue === '0') {
- searchQuery.approvalStatus = '0'
- }
- else {
- searchQuery.approvalStatus = newValue
- }
- getList()
- },
- {
- immediate: true,
- deep: true,
- },
-)
@@ -615,7 +560,7 @@
([])
const type = ref('') // 当前状态的value
-const current = ref('全部')
+const current = ref('')
const currentComp = shallowRef(all)
watch(current, async (newValue) => {
currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp
@@ -63,8 +63,14 @@
onUnmounted(() => {
sessionStorage.setItem(`${props.authority}Menu`, current.value)
})
-onMounted(() => {
+onMounted(async () => {
+ await getDictByCode('approvalStatus').then((res) => {
+ statusList.value = (res.data as menuType[])
+ })
current.value = sessionStorage.getItem(`${props.authority}Menu`) || '全部'
+ if (statusList.value.length > 0) {
+ type.value = statusList.value.filter(item => item.name === current.value)[0].value || ''
+ }
sessionStorage.getItem(`${props.authority}Menu`) ? sessionStorage.removeItem(`${props.authority}Menu`) : ''
})