diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts
new file mode 100644
index 0000000..28ca2ed
--- /dev/null
+++ b/src/api/device/borrow.ts
@@ -0,0 +1,27 @@
+// 设备借用相关接口api
+import request from '../index'
+import type{ searchType } from '@/views/device/borrow/borrow-interface'
+// 设备借用申请列表
+export function getApplyList(data: searchType) {
+ return request({
+ url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请新建
+export function addApply(data: object) {
+ return request({
+ url: '/equipmentApply/addEquipmentApply',
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请详情
+export function detailApply(data: object) {
+ return request({
+ url: '/equipmentApply/equipmentApplyInfo',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts
new file mode 100644
index 0000000..28ca2ed
--- /dev/null
+++ b/src/api/device/borrow.ts
@@ -0,0 +1,27 @@
+// 设备借用相关接口api
+import request from '../index'
+import type{ searchType } from '@/views/device/borrow/borrow-interface'
+// 设备借用申请列表
+export function getApplyList(data: searchType) {
+ return request({
+ url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请新建
+export function addApply(data: object) {
+ return request({
+ url: '/equipmentApply/addEquipmentApply',
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请详情
+export function detailApply(data: object) {
+ return request({
+ url: '/equipmentApply/equipmentApplyInfo',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts
new file mode 100644
index 0000000..0cd02d3
--- /dev/null
+++ b/src/views/device/borrow/borrow-interface.ts
@@ -0,0 +1,26 @@
+// 设备借用申请查询参数类型
+export interface searchType {
+ applyName: string // 申请名称
+ applyNo: string // 申请编号
+ applyPerson: string // 申请人
+ applyUnit: string // 申请单位
+ approvalStatus?: string // 审批状态
+ createUser: string // 创建人
+ processResult: string // 处置结果
+ time: string // 申请日期
+ limit?: number
+ offset?: number
+}
+// 借用设备类型
+export interface borrowDeviceType {
+ createUser?: string // 当前用户id
+ equipmentId: string // 设备id
+ equipmentNo: string // 设备编号
+ modelNo: string // 型号
+ measureRange: string // 测量范围
+ useDept: string // 使用部门
+ usePerson: string // 使用人
+ validDate: string // 有效日期
+ edit?: boolean
+ equipmentName?: string
+}
diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts
new file mode 100644
index 0000000..28ca2ed
--- /dev/null
+++ b/src/api/device/borrow.ts
@@ -0,0 +1,27 @@
+// 设备借用相关接口api
+import request from '../index'
+import type{ searchType } from '@/views/device/borrow/borrow-interface'
+// 设备借用申请列表
+export function getApplyList(data: searchType) {
+ return request({
+ url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请新建
+export function addApply(data: object) {
+ return request({
+ url: '/equipmentApply/addEquipmentApply',
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请详情
+export function detailApply(data: object) {
+ return request({
+ url: '/equipmentApply/equipmentApplyInfo',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts
new file mode 100644
index 0000000..0cd02d3
--- /dev/null
+++ b/src/views/device/borrow/borrow-interface.ts
@@ -0,0 +1,26 @@
+// 设备借用申请查询参数类型
+export interface searchType {
+ applyName: string // 申请名称
+ applyNo: string // 申请编号
+ applyPerson: string // 申请人
+ applyUnit: string // 申请单位
+ approvalStatus?: string // 审批状态
+ createUser: string // 创建人
+ processResult: string // 处置结果
+ time: string // 申请日期
+ limit?: number
+ offset?: number
+}
+// 借用设备类型
+export interface borrowDeviceType {
+ createUser?: string // 当前用户id
+ equipmentId: string // 设备id
+ equipmentNo: string // 设备编号
+ modelNo: string // 型号
+ measureRange: string // 测量范围
+ useDept: string // 使用部门
+ usePerson: string // 使用人
+ validDate: string // 有效日期
+ edit?: boolean
+ equipmentName?: string
+}
diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue
index c5771f7..6667663 100644
--- a/src/views/device/borrow/borrwoApply.vue
+++ b/src/views/device/borrow/borrwoApply.vue
@@ -1,9 +1,12 @@
@@ -32,7 +55,7 @@
-
+
diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts
new file mode 100644
index 0000000..28ca2ed
--- /dev/null
+++ b/src/api/device/borrow.ts
@@ -0,0 +1,27 @@
+// 设备借用相关接口api
+import request from '../index'
+import type{ searchType } from '@/views/device/borrow/borrow-interface'
+// 设备借用申请列表
+export function getApplyList(data: searchType) {
+ return request({
+ url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请新建
+export function addApply(data: object) {
+ return request({
+ url: '/equipmentApply/addEquipmentApply',
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请详情
+export function detailApply(data: object) {
+ return request({
+ url: '/equipmentApply/equipmentApplyInfo',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts
new file mode 100644
index 0000000..0cd02d3
--- /dev/null
+++ b/src/views/device/borrow/borrow-interface.ts
@@ -0,0 +1,26 @@
+// 设备借用申请查询参数类型
+export interface searchType {
+ applyName: string // 申请名称
+ applyNo: string // 申请编号
+ applyPerson: string // 申请人
+ applyUnit: string // 申请单位
+ approvalStatus?: string // 审批状态
+ createUser: string // 创建人
+ processResult: string // 处置结果
+ time: string // 申请日期
+ limit?: number
+ offset?: number
+}
+// 借用设备类型
+export interface borrowDeviceType {
+ createUser?: string // 当前用户id
+ equipmentId: string // 设备id
+ equipmentNo: string // 设备编号
+ modelNo: string // 型号
+ measureRange: string // 测量范围
+ useDept: string // 使用部门
+ usePerson: string // 使用人
+ validDate: string // 有效日期
+ edit?: boolean
+ equipmentName?: string
+}
diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue
index c5771f7..6667663 100644
--- a/src/views/device/borrow/borrwoApply.vue
+++ b/src/views/device/borrow/borrwoApply.vue
@@ -1,9 +1,12 @@
@@ -32,7 +55,7 @@
-
+
diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue
index 9520aca..d420d62 100644
--- a/src/views/device/borrow/components/applyList.vue
+++ b/src/views/device/borrow/components/applyList.vue
@@ -1,25 +1,41 @@
@@ -269,20 +324,20 @@
-
+
-
+
-
+
-
+
-
+
@@ -309,18 +364,19 @@
-
+
+
查看
-
+
同意
-
+
驳回
-
+
拒绝
@@ -331,6 +387,31 @@
+
+
+
+
+ 查看
+
+
+ 编辑
+
+
+ 提交
+
+
+ 删除
+
+
+
+
+
+
+
+ 查看
+
+
+
diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts
new file mode 100644
index 0000000..28ca2ed
--- /dev/null
+++ b/src/api/device/borrow.ts
@@ -0,0 +1,27 @@
+// 设备借用相关接口api
+import request from '../index'
+import type{ searchType } from '@/views/device/borrow/borrow-interface'
+// 设备借用申请列表
+export function getApplyList(data: searchType) {
+ return request({
+ url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请新建
+export function addApply(data: object) {
+ return request({
+ url: '/equipmentApply/addEquipmentApply',
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请详情
+export function detailApply(data: object) {
+ return request({
+ url: '/equipmentApply/equipmentApplyInfo',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts
new file mode 100644
index 0000000..0cd02d3
--- /dev/null
+++ b/src/views/device/borrow/borrow-interface.ts
@@ -0,0 +1,26 @@
+// 设备借用申请查询参数类型
+export interface searchType {
+ applyName: string // 申请名称
+ applyNo: string // 申请编号
+ applyPerson: string // 申请人
+ applyUnit: string // 申请单位
+ approvalStatus?: string // 审批状态
+ createUser: string // 创建人
+ processResult: string // 处置结果
+ time: string // 申请日期
+ limit?: number
+ offset?: number
+}
+// 借用设备类型
+export interface borrowDeviceType {
+ createUser?: string // 当前用户id
+ equipmentId: string // 设备id
+ equipmentNo: string // 设备编号
+ modelNo: string // 型号
+ measureRange: string // 测量范围
+ useDept: string // 使用部门
+ usePerson: string // 使用人
+ validDate: string // 有效日期
+ edit?: boolean
+ equipmentName?: string
+}
diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue
index c5771f7..6667663 100644
--- a/src/views/device/borrow/borrwoApply.vue
+++ b/src/views/device/borrow/borrwoApply.vue
@@ -1,9 +1,12 @@
@@ -32,7 +55,7 @@
-
+
diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue
index 9520aca..d420d62 100644
--- a/src/views/device/borrow/components/applyList.vue
+++ b/src/views/device/borrow/components/applyList.vue
@@ -1,25 +1,41 @@
@@ -269,20 +324,20 @@
-
+
-
+
-
+
-
+
-
+
@@ -309,18 +364,19 @@
-
+
+
查看
-
+
同意
-
+
驳回
-
+
拒绝
@@ -331,6 +387,31 @@
+
+
+
+
+ 查看
+
+
+ 编辑
+
+
+ 提交
+
+
+ 删除
+
+
+
+
+
+
+
+ 查看
+
+
+
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue
index 6ae1a30..856c2ff 100644
--- a/src/views/device/stateManage/components/templateAdd.vue
+++ b/src/views/device/stateManage/components/templateAdd.vue
@@ -12,13 +12,16 @@
import comTreeSelect from '@/views/system/user/selecTree.vue'
import { toTreeList } from '@/utils/structure'
import type { userType } from '@/views/system/user/user-interface'
+import { addApply, detailApply } from '@/api/device/borrow'
+import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface'
const $router = useRouter()
const $route = useRoute()
-const ruleFormRef = ref() // from组件
+const ruleFormRef1 = ref() // from组件
+const ruleFormRef2 = ref() // from组件
const title = ref('')
const name = ref('')
-const borrowList = ref([])
-const ruleForm = ref({
+const borrowList = ref([])
+const ruleForm1 = ref({
assetNo: '', // 资产编号
assetType: '', // 资产类型
assetSource: '', // 资产来源
@@ -71,7 +74,13 @@
isStandardSupportEquipment: '', // 是否标准配套设备
id: '',
}) // 表单
-const rules = ref({
+const ruleForm2 = ref({
+ applyUnit: '', // 申请单位
+ applyPerson: '', // 申请人
+ time: '', // 借用时间
+ applyDesc: '', // 申请说明
+})
+const rules1 = ref({
assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }],
equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }],
manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }],
@@ -84,6 +93,11 @@
mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }],
validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }],
}) // 表单验证规则
+const rules2 = ref({
+ applyUnit: [{ required: true, message: '申请单位不能为空', trigger: 'blur' }],
+ applyPerson: [{ required: true, message: '申请人不能为空', trigger: 'blur' }],
+ time: [{ required: true, message: '借用时间不能为空', trigger: 'blur' }],
+})
const assetTypeList = ref([]) // 资产类型
const ABCList = ref([]) // ABC
const mesureTypeList = ref([]) // 检定方式
@@ -203,7 +217,7 @@
}
// 重置
const resetDATA = () => {
- ruleForm.value = {
+ ruleForm1.value = {
assetNo: '', // 资产编号
assetType: '', // 资产类型
assetSource: '', // 资产来源
@@ -257,61 +271,86 @@
id: '',
}
}
+// 判断是设备借用还是状态管理
+const isDevice = computed(() => {
+ if (name.value == '设备借用申请' || name.value == '设备借用处理') {
+ return true
+ }
+ else {
+ return false
+ }
+})
// 弹窗初始化
const initDialog = (row: any) => {
fetchData()
- ruleFormRef.value?.resetFields()
+ // ruleFormRef.value?.resetFields()
title.value = row.title
name.value = row.name
- // dialogVisible.value = true
- // if (row.title !== '新建') {
- // assetsDetailApi({ id: row.id }).then((res) => {
- // for (const key in res.data) {
- // if (typeof res.data[key] == 'number') {
- // res.data[key] = String(res.data[key])
- // }
- // }
- // ruleForm.value = res.data
- // })
- // }
+ if (isDevice) {
+ // 设备借用
+ if (title.value !== '新建') {
+ detailApply({ id: row.id }).then((res) => {
+ ruleForm2.value = res.data
+ borrowList.value = res.data.equipmentList
+ })
+ }
+ }
+ else {
+ // 状态管理
+ }
}
onMounted(() => {
initDialog($route.query)
})
+
// 关闭弹窗
const close = () => {
resetDATA()
$router.go(-1)
}
// 提交
-const submitForm = async (formEl: FormInstance | undefined, flag: string) => {
- if (!formEl) { return }
- await formEl.validate((valid, fields) => {
- if (valid) {
- ElMessageBox.confirm(
- `确认${flag}吗?`,
- '提示',
- {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- },
- ).then((res) => {
- // 提交
- if (title.value === '编辑' && ruleForm.value.fileList.length) {
- ruleForm.value.fileList[0].id = undefined
- }
- (title.value === '新建' ? assetsAddApi : assetsUpdateApi) (ruleForm.value).then((res) => {
- if (res.code == 200) {
- formEl?.resetFields()
- ElMessage.success('操作成功')
- close()
+const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => {
+ if (isDevice) {
+ // 设备借用
+ if (!formEl2) { return }
+ await formEl2.validate((valid, fields) => {
+ if (valid) {
+ ElMessageBox.confirm(
+ '确认提交吗?',
+ '提示',
+ {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning',
+ },
+ ).then(() => {
+ if (borrowList.value.length) {
+ // 新建/编辑
+ if (title.value === '新建') {
+ // 整理数据
+ const params = {
+ ...ruleForm2.value,
+ equipmentList: borrowList.value,
+ applyType: '1',
+ }
+ addApply(params).then((res) => {
+ console.log('设备借用申请新建', res)
+ })
+ }
+ else {
+ // 编辑
+ }
+ }
+ else {
+ ElMessage.warning('请先添加借用设备')
}
})
- // dialogVisible.value = false
- })
- }
- })
+ }
+ })
+ }
+ else {
+ // 状态管理
+ }
}
// 取消
const resetForm = (formEl: FormInstance | undefined) => {
@@ -330,14 +369,14 @@
if (res.code === 200) {
console.log(res.data[0])
// 重置当前验证
- ruleForm.value.fileList = []
- ruleForm.value.fileList.push({
+ ruleForm1.value.fileList = []
+ ruleForm1.value.fileList.push({
assetId: '',
fileName: res.data[0],
minioFileName: res.data[0],
// id: '',
})
- ruleFormRef.value?.clearValidate('minioFileName')
+ ruleFormRef1.value?.clearValidate('minioFileName')
ElMessage.success('文件上传成功')
}
else {
@@ -349,54 +388,54 @@
const upload = () => {
fileRef.value.click()
}
-// 展示鉴定内容
-const isShowCalibration = ref(false)
-// 若固定资产为测量设备,还需填写检定内容
-watch(() => ruleForm.value.assetType, (newVal) => {
- if (newVal === '1') {
- isShowCalibration.value = true
- }
-})
const columns = ref([
{
text: '设备名称',
value: 'equipmentName',
align: 'center',
+ required: true,
},
{
text: '设备编号',
value: 'equipmentNo',
align: 'center',
+ required: true,
},
{
text: '型号',
value: 'modelNo',
align: 'center',
+ required: false,
},
{
text: '测量范围',
value: 'mesureRange',
align: 'center',
+ required: true,
},
{
text: '使用部门',
- value: 'useDeptName',
+ value: 'useDept',
align: 'center',
+ required: true,
},
{
text: '使用人',
- value: 'usePersonName',
+ value: 'usePerson',
align: 'center',
+ required: true,
},
{
text: '管理状态',
- value: 'managerLevelName',
+ value: 'managerStateName',
align: 'center',
+ required: false,
},
{
text: '有效日期',
value: 'validDate',
align: 'center',
+ required: false,
},
])
const addRowRef = ref()
@@ -404,6 +443,37 @@
const addRowBtn = () => {
addRowRef.value.initDialog({ title: '添加' })
}
+
+// 检查证书列表
+function checkPersonList() {
+ for (let index = 0; index < currentShow.value.data.length; index++) {
+ const item = currentShow.value.data[index]
+ for (const prop of currentShow.value.column) {
+ // 检查必填
+ if (prop.required && !item[prop.value]) {
+ ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`)
+ return false
+ }
+ }
+ }
+ return true
+}
+// 将证书列表置为不可编辑状态
+function setAllRowReadable() {
+ // for (const item of borrowList.value) {
+ // item.editable = false
+ // }
+}
+const SelectionList = ref()
+// 表格选中
+const handleSelectionChange = (e) => {
+ SelectionList.value = e
+}
+// 双击行显示输入框
+const dblclickRow = (row) => {
+ // setAllRowReadable()
+ // row.editable = true
+}
// 删除行
const removeRowBtn = () => {
const removeArr = borrowList.value.filter(item => item.remove !== '')
@@ -425,10 +495,27 @@
ElMessage.warning('请先选择需要删除的数据')
}
}
+// 删除行
+// const removeRow = () => {
+// currentShow.value.data = currentShow.value.data.filter((item) => {
+// return !SelectionList.value.includes(item)
+// })
+// }
// 借用设备列表添加
const addRowMethods = (row) => {
row.forEach((element) => {
- borrowList.value.push({ ...element, remove: '' })
+ borrowList.value.push({
+ equipmentName: element.equipmentName, // 设备名称
+ createUser: '', // 当前用户id 1
+ equipmentId: element.id, // 设备id 1
+ equipmentNo: element.equipmentNo, // 设备编号
+ modelNo: element.modelNo, // 型号
+ measureRange: '', // 测量范围 1
+ useDept: '', // 使用部门 1
+ usePerson: '', // 使用人 1
+ validDate: element.validDate, // 有效日期
+ edit: true,
+ })
})
}
@@ -439,65 +526,65 @@
-
- 保存
+
+ 提交
-
+
关闭
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -505,7 +592,7 @@
@@ -513,19 +600,59 @@
-
+
-
+
-
- {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }}
+
+ {{ ruleForm1.fileList[0]?.minioFileName ? '更换' : '上传' }}
- 暂无
+ 暂无
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -541,7 +668,7 @@
删除行
-
@@ -556,9 +683,29 @@
-
+ -->
+
+
+
+
+
+ *{{ item.text }}
+
+
+ {{ scope.row[item.value] }}
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts
new file mode 100644
index 0000000..28ca2ed
--- /dev/null
+++ b/src/api/device/borrow.ts
@@ -0,0 +1,27 @@
+// 设备借用相关接口api
+import request from '../index'
+import type{ searchType } from '@/views/device/borrow/borrow-interface'
+// 设备借用申请列表
+export function getApplyList(data: searchType) {
+ return request({
+ url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请新建
+export function addApply(data: object) {
+ return request({
+ url: '/equipmentApply/addEquipmentApply',
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请详情
+export function detailApply(data: object) {
+ return request({
+ url: '/equipmentApply/equipmentApplyInfo',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts
new file mode 100644
index 0000000..0cd02d3
--- /dev/null
+++ b/src/views/device/borrow/borrow-interface.ts
@@ -0,0 +1,26 @@
+// 设备借用申请查询参数类型
+export interface searchType {
+ applyName: string // 申请名称
+ applyNo: string // 申请编号
+ applyPerson: string // 申请人
+ applyUnit: string // 申请单位
+ approvalStatus?: string // 审批状态
+ createUser: string // 创建人
+ processResult: string // 处置结果
+ time: string // 申请日期
+ limit?: number
+ offset?: number
+}
+// 借用设备类型
+export interface borrowDeviceType {
+ createUser?: string // 当前用户id
+ equipmentId: string // 设备id
+ equipmentNo: string // 设备编号
+ modelNo: string // 型号
+ measureRange: string // 测量范围
+ useDept: string // 使用部门
+ usePerson: string // 使用人
+ validDate: string // 有效日期
+ edit?: boolean
+ equipmentName?: string
+}
diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue
index c5771f7..6667663 100644
--- a/src/views/device/borrow/borrwoApply.vue
+++ b/src/views/device/borrow/borrwoApply.vue
@@ -1,9 +1,12 @@
@@ -32,7 +55,7 @@
-
+
diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue
index 9520aca..d420d62 100644
--- a/src/views/device/borrow/components/applyList.vue
+++ b/src/views/device/borrow/components/applyList.vue
@@ -1,25 +1,41 @@
@@ -269,20 +324,20 @@
-
+
-
+
-
+
-
+
-
+
@@ -309,18 +364,19 @@
-
+
+
查看
-
+
同意
-
+
驳回
-
+
拒绝
@@ -331,6 +387,31 @@
+
+
+
+
+ 查看
+
+
+ 编辑
+
+
+ 提交
+
+
+ 删除
+
+
+
+
+
+
+
+ 查看
+
+
+
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue
index 6ae1a30..856c2ff 100644
--- a/src/views/device/stateManage/components/templateAdd.vue
+++ b/src/views/device/stateManage/components/templateAdd.vue
@@ -12,13 +12,16 @@
import comTreeSelect from '@/views/system/user/selecTree.vue'
import { toTreeList } from '@/utils/structure'
import type { userType } from '@/views/system/user/user-interface'
+import { addApply, detailApply } from '@/api/device/borrow'
+import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface'
const $router = useRouter()
const $route = useRoute()
-const ruleFormRef = ref() // from组件
+const ruleFormRef1 = ref() // from组件
+const ruleFormRef2 = ref() // from组件
const title = ref('')
const name = ref('')
-const borrowList = ref([])
-const ruleForm = ref({
+const borrowList = ref([])
+const ruleForm1 = ref({
assetNo: '', // 资产编号
assetType: '', // 资产类型
assetSource: '', // 资产来源
@@ -71,7 +74,13 @@
isStandardSupportEquipment: '', // 是否标准配套设备
id: '',
}) // 表单
-const rules = ref({
+const ruleForm2 = ref({
+ applyUnit: '', // 申请单位
+ applyPerson: '', // 申请人
+ time: '', // 借用时间
+ applyDesc: '', // 申请说明
+})
+const rules1 = ref({
assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }],
equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }],
manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }],
@@ -84,6 +93,11 @@
mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }],
validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }],
}) // 表单验证规则
+const rules2 = ref({
+ applyUnit: [{ required: true, message: '申请单位不能为空', trigger: 'blur' }],
+ applyPerson: [{ required: true, message: '申请人不能为空', trigger: 'blur' }],
+ time: [{ required: true, message: '借用时间不能为空', trigger: 'blur' }],
+})
const assetTypeList = ref([]) // 资产类型
const ABCList = ref([]) // ABC
const mesureTypeList = ref([]) // 检定方式
@@ -203,7 +217,7 @@
}
// 重置
const resetDATA = () => {
- ruleForm.value = {
+ ruleForm1.value = {
assetNo: '', // 资产编号
assetType: '', // 资产类型
assetSource: '', // 资产来源
@@ -257,61 +271,86 @@
id: '',
}
}
+// 判断是设备借用还是状态管理
+const isDevice = computed(() => {
+ if (name.value == '设备借用申请' || name.value == '设备借用处理') {
+ return true
+ }
+ else {
+ return false
+ }
+})
// 弹窗初始化
const initDialog = (row: any) => {
fetchData()
- ruleFormRef.value?.resetFields()
+ // ruleFormRef.value?.resetFields()
title.value = row.title
name.value = row.name
- // dialogVisible.value = true
- // if (row.title !== '新建') {
- // assetsDetailApi({ id: row.id }).then((res) => {
- // for (const key in res.data) {
- // if (typeof res.data[key] == 'number') {
- // res.data[key] = String(res.data[key])
- // }
- // }
- // ruleForm.value = res.data
- // })
- // }
+ if (isDevice) {
+ // 设备借用
+ if (title.value !== '新建') {
+ detailApply({ id: row.id }).then((res) => {
+ ruleForm2.value = res.data
+ borrowList.value = res.data.equipmentList
+ })
+ }
+ }
+ else {
+ // 状态管理
+ }
}
onMounted(() => {
initDialog($route.query)
})
+
// 关闭弹窗
const close = () => {
resetDATA()
$router.go(-1)
}
// 提交
-const submitForm = async (formEl: FormInstance | undefined, flag: string) => {
- if (!formEl) { return }
- await formEl.validate((valid, fields) => {
- if (valid) {
- ElMessageBox.confirm(
- `确认${flag}吗?`,
- '提示',
- {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- },
- ).then((res) => {
- // 提交
- if (title.value === '编辑' && ruleForm.value.fileList.length) {
- ruleForm.value.fileList[0].id = undefined
- }
- (title.value === '新建' ? assetsAddApi : assetsUpdateApi) (ruleForm.value).then((res) => {
- if (res.code == 200) {
- formEl?.resetFields()
- ElMessage.success('操作成功')
- close()
+const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => {
+ if (isDevice) {
+ // 设备借用
+ if (!formEl2) { return }
+ await formEl2.validate((valid, fields) => {
+ if (valid) {
+ ElMessageBox.confirm(
+ '确认提交吗?',
+ '提示',
+ {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning',
+ },
+ ).then(() => {
+ if (borrowList.value.length) {
+ // 新建/编辑
+ if (title.value === '新建') {
+ // 整理数据
+ const params = {
+ ...ruleForm2.value,
+ equipmentList: borrowList.value,
+ applyType: '1',
+ }
+ addApply(params).then((res) => {
+ console.log('设备借用申请新建', res)
+ })
+ }
+ else {
+ // 编辑
+ }
+ }
+ else {
+ ElMessage.warning('请先添加借用设备')
}
})
- // dialogVisible.value = false
- })
- }
- })
+ }
+ })
+ }
+ else {
+ // 状态管理
+ }
}
// 取消
const resetForm = (formEl: FormInstance | undefined) => {
@@ -330,14 +369,14 @@
if (res.code === 200) {
console.log(res.data[0])
// 重置当前验证
- ruleForm.value.fileList = []
- ruleForm.value.fileList.push({
+ ruleForm1.value.fileList = []
+ ruleForm1.value.fileList.push({
assetId: '',
fileName: res.data[0],
minioFileName: res.data[0],
// id: '',
})
- ruleFormRef.value?.clearValidate('minioFileName')
+ ruleFormRef1.value?.clearValidate('minioFileName')
ElMessage.success('文件上传成功')
}
else {
@@ -349,54 +388,54 @@
const upload = () => {
fileRef.value.click()
}
-// 展示鉴定内容
-const isShowCalibration = ref(false)
-// 若固定资产为测量设备,还需填写检定内容
-watch(() => ruleForm.value.assetType, (newVal) => {
- if (newVal === '1') {
- isShowCalibration.value = true
- }
-})
const columns = ref([
{
text: '设备名称',
value: 'equipmentName',
align: 'center',
+ required: true,
},
{
text: '设备编号',
value: 'equipmentNo',
align: 'center',
+ required: true,
},
{
text: '型号',
value: 'modelNo',
align: 'center',
+ required: false,
},
{
text: '测量范围',
value: 'mesureRange',
align: 'center',
+ required: true,
},
{
text: '使用部门',
- value: 'useDeptName',
+ value: 'useDept',
align: 'center',
+ required: true,
},
{
text: '使用人',
- value: 'usePersonName',
+ value: 'usePerson',
align: 'center',
+ required: true,
},
{
text: '管理状态',
- value: 'managerLevelName',
+ value: 'managerStateName',
align: 'center',
+ required: false,
},
{
text: '有效日期',
value: 'validDate',
align: 'center',
+ required: false,
},
])
const addRowRef = ref()
@@ -404,6 +443,37 @@
const addRowBtn = () => {
addRowRef.value.initDialog({ title: '添加' })
}
+
+// 检查证书列表
+function checkPersonList() {
+ for (let index = 0; index < currentShow.value.data.length; index++) {
+ const item = currentShow.value.data[index]
+ for (const prop of currentShow.value.column) {
+ // 检查必填
+ if (prop.required && !item[prop.value]) {
+ ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`)
+ return false
+ }
+ }
+ }
+ return true
+}
+// 将证书列表置为不可编辑状态
+function setAllRowReadable() {
+ // for (const item of borrowList.value) {
+ // item.editable = false
+ // }
+}
+const SelectionList = ref()
+// 表格选中
+const handleSelectionChange = (e) => {
+ SelectionList.value = e
+}
+// 双击行显示输入框
+const dblclickRow = (row) => {
+ // setAllRowReadable()
+ // row.editable = true
+}
// 删除行
const removeRowBtn = () => {
const removeArr = borrowList.value.filter(item => item.remove !== '')
@@ -425,10 +495,27 @@
ElMessage.warning('请先选择需要删除的数据')
}
}
+// 删除行
+// const removeRow = () => {
+// currentShow.value.data = currentShow.value.data.filter((item) => {
+// return !SelectionList.value.includes(item)
+// })
+// }
// 借用设备列表添加
const addRowMethods = (row) => {
row.forEach((element) => {
- borrowList.value.push({ ...element, remove: '' })
+ borrowList.value.push({
+ equipmentName: element.equipmentName, // 设备名称
+ createUser: '', // 当前用户id 1
+ equipmentId: element.id, // 设备id 1
+ equipmentNo: element.equipmentNo, // 设备编号
+ modelNo: element.modelNo, // 型号
+ measureRange: '', // 测量范围 1
+ useDept: '', // 使用部门 1
+ usePerson: '', // 使用人 1
+ validDate: element.validDate, // 有效日期
+ edit: true,
+ })
})
}
@@ -439,65 +526,65 @@
-
- 保存
+
+ 提交
-
+
关闭
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -505,7 +592,7 @@
@@ -513,19 +600,59 @@
-
+
-
+
-
- {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }}
+
+ {{ ruleForm1.fileList[0]?.minioFileName ? '更换' : '上传' }}
- 暂无
+ 暂无
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -541,7 +668,7 @@
删除行
-
@@ -556,9 +683,29 @@
-
+ -->
+
+
+
+
+
+ *{{ item.text }}
+
+
+ {{ scope.row[item.value] }}
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/src/views/measure/file/approve.vue b/src/views/measure/file/approve.vue
index a9d8827..d7e722c 100644
--- a/src/views/measure/file/approve.vue
+++ b/src/views/measure/file/approve.vue
@@ -23,8 +23,16 @@
const current = ref('全部')
const currentComp = shallowRef(all)
watch(current, (newValue) => {
+ console.log(newValue)
currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp
})
+onUnmounted(() => {
+ sessionStorage.setItem('approveFileMenu', current.value)
+})
+onMounted(() => {
+ current.value = sessionStorage.getItem('approveFileMenu') || '全部'
+ sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : ''
+})
diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts
new file mode 100644
index 0000000..28ca2ed
--- /dev/null
+++ b/src/api/device/borrow.ts
@@ -0,0 +1,27 @@
+// 设备借用相关接口api
+import request from '../index'
+import type{ searchType } from '@/views/device/borrow/borrow-interface'
+// 设备借用申请列表
+export function getApplyList(data: searchType) {
+ return request({
+ url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请新建
+export function addApply(data: object) {
+ return request({
+ url: '/equipmentApply/addEquipmentApply',
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请详情
+export function detailApply(data: object) {
+ return request({
+ url: '/equipmentApply/equipmentApplyInfo',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts
new file mode 100644
index 0000000..0cd02d3
--- /dev/null
+++ b/src/views/device/borrow/borrow-interface.ts
@@ -0,0 +1,26 @@
+// 设备借用申请查询参数类型
+export interface searchType {
+ applyName: string // 申请名称
+ applyNo: string // 申请编号
+ applyPerson: string // 申请人
+ applyUnit: string // 申请单位
+ approvalStatus?: string // 审批状态
+ createUser: string // 创建人
+ processResult: string // 处置结果
+ time: string // 申请日期
+ limit?: number
+ offset?: number
+}
+// 借用设备类型
+export interface borrowDeviceType {
+ createUser?: string // 当前用户id
+ equipmentId: string // 设备id
+ equipmentNo: string // 设备编号
+ modelNo: string // 型号
+ measureRange: string // 测量范围
+ useDept: string // 使用部门
+ usePerson: string // 使用人
+ validDate: string // 有效日期
+ edit?: boolean
+ equipmentName?: string
+}
diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue
index c5771f7..6667663 100644
--- a/src/views/device/borrow/borrwoApply.vue
+++ b/src/views/device/borrow/borrwoApply.vue
@@ -1,9 +1,12 @@
@@ -32,7 +55,7 @@
-
+
diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue
index 9520aca..d420d62 100644
--- a/src/views/device/borrow/components/applyList.vue
+++ b/src/views/device/borrow/components/applyList.vue
@@ -1,25 +1,41 @@
@@ -269,20 +324,20 @@
-
+
-
+
-
+
-
+
-
+
@@ -309,18 +364,19 @@
-
+
+
查看
-
+
同意
-
+
驳回
-
+
拒绝
@@ -331,6 +387,31 @@
+
+
+
+
+ 查看
+
+
+ 编辑
+
+
+ 提交
+
+
+ 删除
+
+
+
+
+
+
+
+ 查看
+
+
+
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue
index 6ae1a30..856c2ff 100644
--- a/src/views/device/stateManage/components/templateAdd.vue
+++ b/src/views/device/stateManage/components/templateAdd.vue
@@ -12,13 +12,16 @@
import comTreeSelect from '@/views/system/user/selecTree.vue'
import { toTreeList } from '@/utils/structure'
import type { userType } from '@/views/system/user/user-interface'
+import { addApply, detailApply } from '@/api/device/borrow'
+import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface'
const $router = useRouter()
const $route = useRoute()
-const ruleFormRef = ref() // from组件
+const ruleFormRef1 = ref() // from组件
+const ruleFormRef2 = ref() // from组件
const title = ref('')
const name = ref('')
-const borrowList = ref([])
-const ruleForm = ref({
+const borrowList = ref([])
+const ruleForm1 = ref({
assetNo: '', // 资产编号
assetType: '', // 资产类型
assetSource: '', // 资产来源
@@ -71,7 +74,13 @@
isStandardSupportEquipment: '', // 是否标准配套设备
id: '',
}) // 表单
-const rules = ref({
+const ruleForm2 = ref({
+ applyUnit: '', // 申请单位
+ applyPerson: '', // 申请人
+ time: '', // 借用时间
+ applyDesc: '', // 申请说明
+})
+const rules1 = ref({
assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }],
equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }],
manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }],
@@ -84,6 +93,11 @@
mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }],
validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }],
}) // 表单验证规则
+const rules2 = ref({
+ applyUnit: [{ required: true, message: '申请单位不能为空', trigger: 'blur' }],
+ applyPerson: [{ required: true, message: '申请人不能为空', trigger: 'blur' }],
+ time: [{ required: true, message: '借用时间不能为空', trigger: 'blur' }],
+})
const assetTypeList = ref([]) // 资产类型
const ABCList = ref([]) // ABC
const mesureTypeList = ref([]) // 检定方式
@@ -203,7 +217,7 @@
}
// 重置
const resetDATA = () => {
- ruleForm.value = {
+ ruleForm1.value = {
assetNo: '', // 资产编号
assetType: '', // 资产类型
assetSource: '', // 资产来源
@@ -257,61 +271,86 @@
id: '',
}
}
+// 判断是设备借用还是状态管理
+const isDevice = computed(() => {
+ if (name.value == '设备借用申请' || name.value == '设备借用处理') {
+ return true
+ }
+ else {
+ return false
+ }
+})
// 弹窗初始化
const initDialog = (row: any) => {
fetchData()
- ruleFormRef.value?.resetFields()
+ // ruleFormRef.value?.resetFields()
title.value = row.title
name.value = row.name
- // dialogVisible.value = true
- // if (row.title !== '新建') {
- // assetsDetailApi({ id: row.id }).then((res) => {
- // for (const key in res.data) {
- // if (typeof res.data[key] == 'number') {
- // res.data[key] = String(res.data[key])
- // }
- // }
- // ruleForm.value = res.data
- // })
- // }
+ if (isDevice) {
+ // 设备借用
+ if (title.value !== '新建') {
+ detailApply({ id: row.id }).then((res) => {
+ ruleForm2.value = res.data
+ borrowList.value = res.data.equipmentList
+ })
+ }
+ }
+ else {
+ // 状态管理
+ }
}
onMounted(() => {
initDialog($route.query)
})
+
// 关闭弹窗
const close = () => {
resetDATA()
$router.go(-1)
}
// 提交
-const submitForm = async (formEl: FormInstance | undefined, flag: string) => {
- if (!formEl) { return }
- await formEl.validate((valid, fields) => {
- if (valid) {
- ElMessageBox.confirm(
- `确认${flag}吗?`,
- '提示',
- {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- },
- ).then((res) => {
- // 提交
- if (title.value === '编辑' && ruleForm.value.fileList.length) {
- ruleForm.value.fileList[0].id = undefined
- }
- (title.value === '新建' ? assetsAddApi : assetsUpdateApi) (ruleForm.value).then((res) => {
- if (res.code == 200) {
- formEl?.resetFields()
- ElMessage.success('操作成功')
- close()
+const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => {
+ if (isDevice) {
+ // 设备借用
+ if (!formEl2) { return }
+ await formEl2.validate((valid, fields) => {
+ if (valid) {
+ ElMessageBox.confirm(
+ '确认提交吗?',
+ '提示',
+ {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning',
+ },
+ ).then(() => {
+ if (borrowList.value.length) {
+ // 新建/编辑
+ if (title.value === '新建') {
+ // 整理数据
+ const params = {
+ ...ruleForm2.value,
+ equipmentList: borrowList.value,
+ applyType: '1',
+ }
+ addApply(params).then((res) => {
+ console.log('设备借用申请新建', res)
+ })
+ }
+ else {
+ // 编辑
+ }
+ }
+ else {
+ ElMessage.warning('请先添加借用设备')
}
})
- // dialogVisible.value = false
- })
- }
- })
+ }
+ })
+ }
+ else {
+ // 状态管理
+ }
}
// 取消
const resetForm = (formEl: FormInstance | undefined) => {
@@ -330,14 +369,14 @@
if (res.code === 200) {
console.log(res.data[0])
// 重置当前验证
- ruleForm.value.fileList = []
- ruleForm.value.fileList.push({
+ ruleForm1.value.fileList = []
+ ruleForm1.value.fileList.push({
assetId: '',
fileName: res.data[0],
minioFileName: res.data[0],
// id: '',
})
- ruleFormRef.value?.clearValidate('minioFileName')
+ ruleFormRef1.value?.clearValidate('minioFileName')
ElMessage.success('文件上传成功')
}
else {
@@ -349,54 +388,54 @@
const upload = () => {
fileRef.value.click()
}
-// 展示鉴定内容
-const isShowCalibration = ref(false)
-// 若固定资产为测量设备,还需填写检定内容
-watch(() => ruleForm.value.assetType, (newVal) => {
- if (newVal === '1') {
- isShowCalibration.value = true
- }
-})
const columns = ref([
{
text: '设备名称',
value: 'equipmentName',
align: 'center',
+ required: true,
},
{
text: '设备编号',
value: 'equipmentNo',
align: 'center',
+ required: true,
},
{
text: '型号',
value: 'modelNo',
align: 'center',
+ required: false,
},
{
text: '测量范围',
value: 'mesureRange',
align: 'center',
+ required: true,
},
{
text: '使用部门',
- value: 'useDeptName',
+ value: 'useDept',
align: 'center',
+ required: true,
},
{
text: '使用人',
- value: 'usePersonName',
+ value: 'usePerson',
align: 'center',
+ required: true,
},
{
text: '管理状态',
- value: 'managerLevelName',
+ value: 'managerStateName',
align: 'center',
+ required: false,
},
{
text: '有效日期',
value: 'validDate',
align: 'center',
+ required: false,
},
])
const addRowRef = ref()
@@ -404,6 +443,37 @@
const addRowBtn = () => {
addRowRef.value.initDialog({ title: '添加' })
}
+
+// 检查证书列表
+function checkPersonList() {
+ for (let index = 0; index < currentShow.value.data.length; index++) {
+ const item = currentShow.value.data[index]
+ for (const prop of currentShow.value.column) {
+ // 检查必填
+ if (prop.required && !item[prop.value]) {
+ ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`)
+ return false
+ }
+ }
+ }
+ return true
+}
+// 将证书列表置为不可编辑状态
+function setAllRowReadable() {
+ // for (const item of borrowList.value) {
+ // item.editable = false
+ // }
+}
+const SelectionList = ref()
+// 表格选中
+const handleSelectionChange = (e) => {
+ SelectionList.value = e
+}
+// 双击行显示输入框
+const dblclickRow = (row) => {
+ // setAllRowReadable()
+ // row.editable = true
+}
// 删除行
const removeRowBtn = () => {
const removeArr = borrowList.value.filter(item => item.remove !== '')
@@ -425,10 +495,27 @@
ElMessage.warning('请先选择需要删除的数据')
}
}
+// 删除行
+// const removeRow = () => {
+// currentShow.value.data = currentShow.value.data.filter((item) => {
+// return !SelectionList.value.includes(item)
+// })
+// }
// 借用设备列表添加
const addRowMethods = (row) => {
row.forEach((element) => {
- borrowList.value.push({ ...element, remove: '' })
+ borrowList.value.push({
+ equipmentName: element.equipmentName, // 设备名称
+ createUser: '', // 当前用户id 1
+ equipmentId: element.id, // 设备id 1
+ equipmentNo: element.equipmentNo, // 设备编号
+ modelNo: element.modelNo, // 型号
+ measureRange: '', // 测量范围 1
+ useDept: '', // 使用部门 1
+ usePerson: '', // 使用人 1
+ validDate: element.validDate, // 有效日期
+ edit: true,
+ })
})
}
@@ -439,65 +526,65 @@
-
- 保存
+
+ 提交
-
+
关闭
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -505,7 +592,7 @@
@@ -513,19 +600,59 @@
-
+
-
+
-
- {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }}
+
+ {{ ruleForm1.fileList[0]?.minioFileName ? '更换' : '上传' }}
- 暂无
+ 暂无
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -541,7 +668,7 @@
删除行
-
@@ -556,9 +683,29 @@
-
+ -->
+
+
+
+
+
+ *{{ item.text }}
+
+
+ {{ scope.row[item.value] }}
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/src/views/measure/file/approve.vue b/src/views/measure/file/approve.vue
index a9d8827..d7e722c 100644
--- a/src/views/measure/file/approve.vue
+++ b/src/views/measure/file/approve.vue
@@ -23,8 +23,16 @@
const current = ref('全部')
const currentComp = shallowRef(all)
watch(current, (newValue) => {
+ console.log(newValue)
currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp
})
+onUnmounted(() => {
+ sessionStorage.setItem('approveFileMenu', current.value)
+})
+onMounted(() => {
+ current.value = sessionStorage.getItem('approveFileMenu') || '全部'
+ sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : ''
+})
diff --git a/src/views/measure/file/quality.vue b/src/views/measure/file/quality.vue
index 3fa57dc..f8f7528 100644
--- a/src/views/measure/file/quality.vue
+++ b/src/views/measure/file/quality.vue
@@ -20,8 +20,16 @@
const current = ref('计量法规')
const currentComp = shallowRef(statute)
watch(current, (newValue) => {
+ console.log(newValue, 'newValue')
currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp
})
+onUnmounted(() => {
+ sessionStorage.setItem('fileMenu', current.value)
+})
+onMounted(() => {
+ current.value = sessionStorage.getItem('fileMenu') || '计量法规'
+ sessionStorage.getItem('fileMenu') ? sessionStorage.removeItem('fileMenu') : ''
+})
diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts
new file mode 100644
index 0000000..28ca2ed
--- /dev/null
+++ b/src/api/device/borrow.ts
@@ -0,0 +1,27 @@
+// 设备借用相关接口api
+import request from '../index'
+import type{ searchType } from '@/views/device/borrow/borrow-interface'
+// 设备借用申请列表
+export function getApplyList(data: searchType) {
+ return request({
+ url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请新建
+export function addApply(data: object) {
+ return request({
+ url: '/equipmentApply/addEquipmentApply',
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请详情
+export function detailApply(data: object) {
+ return request({
+ url: '/equipmentApply/equipmentApplyInfo',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts
new file mode 100644
index 0000000..0cd02d3
--- /dev/null
+++ b/src/views/device/borrow/borrow-interface.ts
@@ -0,0 +1,26 @@
+// 设备借用申请查询参数类型
+export interface searchType {
+ applyName: string // 申请名称
+ applyNo: string // 申请编号
+ applyPerson: string // 申请人
+ applyUnit: string // 申请单位
+ approvalStatus?: string // 审批状态
+ createUser: string // 创建人
+ processResult: string // 处置结果
+ time: string // 申请日期
+ limit?: number
+ offset?: number
+}
+// 借用设备类型
+export interface borrowDeviceType {
+ createUser?: string // 当前用户id
+ equipmentId: string // 设备id
+ equipmentNo: string // 设备编号
+ modelNo: string // 型号
+ measureRange: string // 测量范围
+ useDept: string // 使用部门
+ usePerson: string // 使用人
+ validDate: string // 有效日期
+ edit?: boolean
+ equipmentName?: string
+}
diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue
index c5771f7..6667663 100644
--- a/src/views/device/borrow/borrwoApply.vue
+++ b/src/views/device/borrow/borrwoApply.vue
@@ -1,9 +1,12 @@
@@ -32,7 +55,7 @@
-
+
diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue
index 9520aca..d420d62 100644
--- a/src/views/device/borrow/components/applyList.vue
+++ b/src/views/device/borrow/components/applyList.vue
@@ -1,25 +1,41 @@
@@ -269,20 +324,20 @@
-
+
-
+
-
+
-
+
-
+
@@ -309,18 +364,19 @@
-
+
+
查看
-
+
同意
-
+
驳回
-
+
拒绝
@@ -331,6 +387,31 @@
+
+
+
+
+ 查看
+
+
+ 编辑
+
+
+ 提交
+
+
+ 删除
+
+
+
+
+
+
+
+ 查看
+
+
+
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue
index 6ae1a30..856c2ff 100644
--- a/src/views/device/stateManage/components/templateAdd.vue
+++ b/src/views/device/stateManage/components/templateAdd.vue
@@ -12,13 +12,16 @@
import comTreeSelect from '@/views/system/user/selecTree.vue'
import { toTreeList } from '@/utils/structure'
import type { userType } from '@/views/system/user/user-interface'
+import { addApply, detailApply } from '@/api/device/borrow'
+import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface'
const $router = useRouter()
const $route = useRoute()
-const ruleFormRef = ref() // from组件
+const ruleFormRef1 = ref() // from组件
+const ruleFormRef2 = ref() // from组件
const title = ref('')
const name = ref('')
-const borrowList = ref([])
-const ruleForm = ref({
+const borrowList = ref([])
+const ruleForm1 = ref({
assetNo: '', // 资产编号
assetType: '', // 资产类型
assetSource: '', // 资产来源
@@ -71,7 +74,13 @@
isStandardSupportEquipment: '', // 是否标准配套设备
id: '',
}) // 表单
-const rules = ref({
+const ruleForm2 = ref({
+ applyUnit: '', // 申请单位
+ applyPerson: '', // 申请人
+ time: '', // 借用时间
+ applyDesc: '', // 申请说明
+})
+const rules1 = ref({
assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }],
equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }],
manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }],
@@ -84,6 +93,11 @@
mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }],
validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }],
}) // 表单验证规则
+const rules2 = ref({
+ applyUnit: [{ required: true, message: '申请单位不能为空', trigger: 'blur' }],
+ applyPerson: [{ required: true, message: '申请人不能为空', trigger: 'blur' }],
+ time: [{ required: true, message: '借用时间不能为空', trigger: 'blur' }],
+})
const assetTypeList = ref([]) // 资产类型
const ABCList = ref([]) // ABC
const mesureTypeList = ref([]) // 检定方式
@@ -203,7 +217,7 @@
}
// 重置
const resetDATA = () => {
- ruleForm.value = {
+ ruleForm1.value = {
assetNo: '', // 资产编号
assetType: '', // 资产类型
assetSource: '', // 资产来源
@@ -257,61 +271,86 @@
id: '',
}
}
+// 判断是设备借用还是状态管理
+const isDevice = computed(() => {
+ if (name.value == '设备借用申请' || name.value == '设备借用处理') {
+ return true
+ }
+ else {
+ return false
+ }
+})
// 弹窗初始化
const initDialog = (row: any) => {
fetchData()
- ruleFormRef.value?.resetFields()
+ // ruleFormRef.value?.resetFields()
title.value = row.title
name.value = row.name
- // dialogVisible.value = true
- // if (row.title !== '新建') {
- // assetsDetailApi({ id: row.id }).then((res) => {
- // for (const key in res.data) {
- // if (typeof res.data[key] == 'number') {
- // res.data[key] = String(res.data[key])
- // }
- // }
- // ruleForm.value = res.data
- // })
- // }
+ if (isDevice) {
+ // 设备借用
+ if (title.value !== '新建') {
+ detailApply({ id: row.id }).then((res) => {
+ ruleForm2.value = res.data
+ borrowList.value = res.data.equipmentList
+ })
+ }
+ }
+ else {
+ // 状态管理
+ }
}
onMounted(() => {
initDialog($route.query)
})
+
// 关闭弹窗
const close = () => {
resetDATA()
$router.go(-1)
}
// 提交
-const submitForm = async (formEl: FormInstance | undefined, flag: string) => {
- if (!formEl) { return }
- await formEl.validate((valid, fields) => {
- if (valid) {
- ElMessageBox.confirm(
- `确认${flag}吗?`,
- '提示',
- {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- },
- ).then((res) => {
- // 提交
- if (title.value === '编辑' && ruleForm.value.fileList.length) {
- ruleForm.value.fileList[0].id = undefined
- }
- (title.value === '新建' ? assetsAddApi : assetsUpdateApi) (ruleForm.value).then((res) => {
- if (res.code == 200) {
- formEl?.resetFields()
- ElMessage.success('操作成功')
- close()
+const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => {
+ if (isDevice) {
+ // 设备借用
+ if (!formEl2) { return }
+ await formEl2.validate((valid, fields) => {
+ if (valid) {
+ ElMessageBox.confirm(
+ '确认提交吗?',
+ '提示',
+ {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning',
+ },
+ ).then(() => {
+ if (borrowList.value.length) {
+ // 新建/编辑
+ if (title.value === '新建') {
+ // 整理数据
+ const params = {
+ ...ruleForm2.value,
+ equipmentList: borrowList.value,
+ applyType: '1',
+ }
+ addApply(params).then((res) => {
+ console.log('设备借用申请新建', res)
+ })
+ }
+ else {
+ // 编辑
+ }
+ }
+ else {
+ ElMessage.warning('请先添加借用设备')
}
})
- // dialogVisible.value = false
- })
- }
- })
+ }
+ })
+ }
+ else {
+ // 状态管理
+ }
}
// 取消
const resetForm = (formEl: FormInstance | undefined) => {
@@ -330,14 +369,14 @@
if (res.code === 200) {
console.log(res.data[0])
// 重置当前验证
- ruleForm.value.fileList = []
- ruleForm.value.fileList.push({
+ ruleForm1.value.fileList = []
+ ruleForm1.value.fileList.push({
assetId: '',
fileName: res.data[0],
minioFileName: res.data[0],
// id: '',
})
- ruleFormRef.value?.clearValidate('minioFileName')
+ ruleFormRef1.value?.clearValidate('minioFileName')
ElMessage.success('文件上传成功')
}
else {
@@ -349,54 +388,54 @@
const upload = () => {
fileRef.value.click()
}
-// 展示鉴定内容
-const isShowCalibration = ref(false)
-// 若固定资产为测量设备,还需填写检定内容
-watch(() => ruleForm.value.assetType, (newVal) => {
- if (newVal === '1') {
- isShowCalibration.value = true
- }
-})
const columns = ref([
{
text: '设备名称',
value: 'equipmentName',
align: 'center',
+ required: true,
},
{
text: '设备编号',
value: 'equipmentNo',
align: 'center',
+ required: true,
},
{
text: '型号',
value: 'modelNo',
align: 'center',
+ required: false,
},
{
text: '测量范围',
value: 'mesureRange',
align: 'center',
+ required: true,
},
{
text: '使用部门',
- value: 'useDeptName',
+ value: 'useDept',
align: 'center',
+ required: true,
},
{
text: '使用人',
- value: 'usePersonName',
+ value: 'usePerson',
align: 'center',
+ required: true,
},
{
text: '管理状态',
- value: 'managerLevelName',
+ value: 'managerStateName',
align: 'center',
+ required: false,
},
{
text: '有效日期',
value: 'validDate',
align: 'center',
+ required: false,
},
])
const addRowRef = ref()
@@ -404,6 +443,37 @@
const addRowBtn = () => {
addRowRef.value.initDialog({ title: '添加' })
}
+
+// 检查证书列表
+function checkPersonList() {
+ for (let index = 0; index < currentShow.value.data.length; index++) {
+ const item = currentShow.value.data[index]
+ for (const prop of currentShow.value.column) {
+ // 检查必填
+ if (prop.required && !item[prop.value]) {
+ ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`)
+ return false
+ }
+ }
+ }
+ return true
+}
+// 将证书列表置为不可编辑状态
+function setAllRowReadable() {
+ // for (const item of borrowList.value) {
+ // item.editable = false
+ // }
+}
+const SelectionList = ref()
+// 表格选中
+const handleSelectionChange = (e) => {
+ SelectionList.value = e
+}
+// 双击行显示输入框
+const dblclickRow = (row) => {
+ // setAllRowReadable()
+ // row.editable = true
+}
// 删除行
const removeRowBtn = () => {
const removeArr = borrowList.value.filter(item => item.remove !== '')
@@ -425,10 +495,27 @@
ElMessage.warning('请先选择需要删除的数据')
}
}
+// 删除行
+// const removeRow = () => {
+// currentShow.value.data = currentShow.value.data.filter((item) => {
+// return !SelectionList.value.includes(item)
+// })
+// }
// 借用设备列表添加
const addRowMethods = (row) => {
row.forEach((element) => {
- borrowList.value.push({ ...element, remove: '' })
+ borrowList.value.push({
+ equipmentName: element.equipmentName, // 设备名称
+ createUser: '', // 当前用户id 1
+ equipmentId: element.id, // 设备id 1
+ equipmentNo: element.equipmentNo, // 设备编号
+ modelNo: element.modelNo, // 型号
+ measureRange: '', // 测量范围 1
+ useDept: '', // 使用部门 1
+ usePerson: '', // 使用人 1
+ validDate: element.validDate, // 有效日期
+ edit: true,
+ })
})
}
@@ -439,65 +526,65 @@
-
- 保存
+
+ 提交
-
+
关闭
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -505,7 +592,7 @@
@@ -513,19 +600,59 @@
-
+
-
+
-
- {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }}
+
+ {{ ruleForm1.fileList[0]?.minioFileName ? '更换' : '上传' }}
- 暂无
+ 暂无
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -541,7 +668,7 @@
删除行
-
@@ -556,9 +683,29 @@
-
+ -->
+
+
+
+
+
+ *{{ item.text }}
+
+
+ {{ scope.row[item.value] }}
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/src/views/measure/file/approve.vue b/src/views/measure/file/approve.vue
index a9d8827..d7e722c 100644
--- a/src/views/measure/file/approve.vue
+++ b/src/views/measure/file/approve.vue
@@ -23,8 +23,16 @@
const current = ref('全部')
const currentComp = shallowRef(all)
watch(current, (newValue) => {
+ console.log(newValue)
currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp
})
+onUnmounted(() => {
+ sessionStorage.setItem('approveFileMenu', current.value)
+})
+onMounted(() => {
+ current.value = sessionStorage.getItem('approveFileMenu') || '全部'
+ sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : ''
+})
diff --git a/src/views/measure/file/quality.vue b/src/views/measure/file/quality.vue
index 3fa57dc..f8f7528 100644
--- a/src/views/measure/file/quality.vue
+++ b/src/views/measure/file/quality.vue
@@ -20,8 +20,16 @@
const current = ref('计量法规')
const currentComp = shallowRef(statute)
watch(current, (newValue) => {
+ console.log(newValue, 'newValue')
currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp
})
+onUnmounted(() => {
+ sessionStorage.setItem('fileMenu', current.value)
+})
+onMounted(() => {
+ current.value = sessionStorage.getItem('fileMenu') || '计量法规'
+ sessionStorage.getItem('fileMenu') ? sessionStorage.removeItem('fileMenu') : ''
+})
diff --git a/src/views/measure/person/certificateLog.vue b/src/views/measure/person/certificateLog.vue
index 11eeb7b..16a8c9d 100644
--- a/src/views/measure/person/certificateLog.vue
+++ b/src/views/measure/person/certificateLog.vue
@@ -29,7 +29,8 @@
// major: '', // 计量专业
verifierCertificateNo: '', // 证书号
certificateStatus: '', // 证书状态
- limit: 10,
+ remindType: '',
+ limit: 20,
offset: 1,
}) // 查询参数
const loadingTable = ref(false) // 表格loading
@@ -92,6 +93,9 @@
// 获取数据列表
const getList = () => {
loadingTable.value = true
+ if (props.isRemind) {
+ searchQuery.remindType = 'remind'
+ }
getCertificateList(searchQuery).then((res) => {
if (res.code === 200) {
res.data.records = res.data.records.map(item => ({ ...item, sex: item.sex == '1' ? '男' : '女', certificateStatus: item.certificateStatus == '0' ? '正常' : '已失效', validDate: item.validDate.split(' ')[0], certificateDate: item.certificateDate.split(' ')[0] }))
diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts
new file mode 100644
index 0000000..28ca2ed
--- /dev/null
+++ b/src/api/device/borrow.ts
@@ -0,0 +1,27 @@
+// 设备借用相关接口api
+import request from '../index'
+import type{ searchType } from '@/views/device/borrow/borrow-interface'
+// 设备借用申请列表
+export function getApplyList(data: searchType) {
+ return request({
+ url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请新建
+export function addApply(data: object) {
+ return request({
+ url: '/equipmentApply/addEquipmentApply',
+ method: 'post',
+ data,
+ })
+}
+// 设备借用申请详情
+export function detailApply(data: object) {
+ return request({
+ url: '/equipmentApply/equipmentApplyInfo',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts
new file mode 100644
index 0000000..0cd02d3
--- /dev/null
+++ b/src/views/device/borrow/borrow-interface.ts
@@ -0,0 +1,26 @@
+// 设备借用申请查询参数类型
+export interface searchType {
+ applyName: string // 申请名称
+ applyNo: string // 申请编号
+ applyPerson: string // 申请人
+ applyUnit: string // 申请单位
+ approvalStatus?: string // 审批状态
+ createUser: string // 创建人
+ processResult: string // 处置结果
+ time: string // 申请日期
+ limit?: number
+ offset?: number
+}
+// 借用设备类型
+export interface borrowDeviceType {
+ createUser?: string // 当前用户id
+ equipmentId: string // 设备id
+ equipmentNo: string // 设备编号
+ modelNo: string // 型号
+ measureRange: string // 测量范围
+ useDept: string // 使用部门
+ usePerson: string // 使用人
+ validDate: string // 有效日期
+ edit?: boolean
+ equipmentName?: string
+}
diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue
index c5771f7..6667663 100644
--- a/src/views/device/borrow/borrwoApply.vue
+++ b/src/views/device/borrow/borrwoApply.vue
@@ -1,9 +1,12 @@
@@ -32,7 +55,7 @@
-
+
diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue
index 9520aca..d420d62 100644
--- a/src/views/device/borrow/components/applyList.vue
+++ b/src/views/device/borrow/components/applyList.vue
@@ -1,25 +1,41 @@
@@ -269,20 +324,20 @@
-
+
-
+
-
+
-
+
-
+
@@ -309,18 +364,19 @@
-
+
+
查看
-
+
同意
-
+
驳回
-
+
拒绝
@@ -331,6 +387,31 @@
+
+
+
+
+ 查看
+
+
+ 编辑
+
+
+ 提交
+
+
+ 删除
+
+
+
+
+
+
+
+ 查看
+
+
+
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue
index 6ae1a30..856c2ff 100644
--- a/src/views/device/stateManage/components/templateAdd.vue
+++ b/src/views/device/stateManage/components/templateAdd.vue
@@ -12,13 +12,16 @@
import comTreeSelect from '@/views/system/user/selecTree.vue'
import { toTreeList } from '@/utils/structure'
import type { userType } from '@/views/system/user/user-interface'
+import { addApply, detailApply } from '@/api/device/borrow'
+import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface'
const $router = useRouter()
const $route = useRoute()
-const ruleFormRef = ref() // from组件
+const ruleFormRef1 = ref() // from组件
+const ruleFormRef2 = ref() // from组件
const title = ref('')
const name = ref('')
-const borrowList = ref([])
-const ruleForm = ref({
+const borrowList = ref([])
+const ruleForm1 = ref({
assetNo: '', // 资产编号
assetType: '', // 资产类型
assetSource: '', // 资产来源
@@ -71,7 +74,13 @@
isStandardSupportEquipment: '', // 是否标准配套设备
id: '',
}) // 表单
-const rules = ref({
+const ruleForm2 = ref({
+ applyUnit: '', // 申请单位
+ applyPerson: '', // 申请人
+ time: '', // 借用时间
+ applyDesc: '', // 申请说明
+})
+const rules1 = ref({
assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }],
equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }],
manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }],
@@ -84,6 +93,11 @@
mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }],
validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }],
}) // 表单验证规则
+const rules2 = ref({
+ applyUnit: [{ required: true, message: '申请单位不能为空', trigger: 'blur' }],
+ applyPerson: [{ required: true, message: '申请人不能为空', trigger: 'blur' }],
+ time: [{ required: true, message: '借用时间不能为空', trigger: 'blur' }],
+})
const assetTypeList = ref([]) // 资产类型
const ABCList = ref([]) // ABC
const mesureTypeList = ref([]) // 检定方式
@@ -203,7 +217,7 @@
}
// 重置
const resetDATA = () => {
- ruleForm.value = {
+ ruleForm1.value = {
assetNo: '', // 资产编号
assetType: '', // 资产类型
assetSource: '', // 资产来源
@@ -257,61 +271,86 @@
id: '',
}
}
+// 判断是设备借用还是状态管理
+const isDevice = computed(() => {
+ if (name.value == '设备借用申请' || name.value == '设备借用处理') {
+ return true
+ }
+ else {
+ return false
+ }
+})
// 弹窗初始化
const initDialog = (row: any) => {
fetchData()
- ruleFormRef.value?.resetFields()
+ // ruleFormRef.value?.resetFields()
title.value = row.title
name.value = row.name
- // dialogVisible.value = true
- // if (row.title !== '新建') {
- // assetsDetailApi({ id: row.id }).then((res) => {
- // for (const key in res.data) {
- // if (typeof res.data[key] == 'number') {
- // res.data[key] = String(res.data[key])
- // }
- // }
- // ruleForm.value = res.data
- // })
- // }
+ if (isDevice) {
+ // 设备借用
+ if (title.value !== '新建') {
+ detailApply({ id: row.id }).then((res) => {
+ ruleForm2.value = res.data
+ borrowList.value = res.data.equipmentList
+ })
+ }
+ }
+ else {
+ // 状态管理
+ }
}
onMounted(() => {
initDialog($route.query)
})
+
// 关闭弹窗
const close = () => {
resetDATA()
$router.go(-1)
}
// 提交
-const submitForm = async (formEl: FormInstance | undefined, flag: string) => {
- if (!formEl) { return }
- await formEl.validate((valid, fields) => {
- if (valid) {
- ElMessageBox.confirm(
- `确认${flag}吗?`,
- '提示',
- {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- },
- ).then((res) => {
- // 提交
- if (title.value === '编辑' && ruleForm.value.fileList.length) {
- ruleForm.value.fileList[0].id = undefined
- }
- (title.value === '新建' ? assetsAddApi : assetsUpdateApi) (ruleForm.value).then((res) => {
- if (res.code == 200) {
- formEl?.resetFields()
- ElMessage.success('操作成功')
- close()
+const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => {
+ if (isDevice) {
+ // 设备借用
+ if (!formEl2) { return }
+ await formEl2.validate((valid, fields) => {
+ if (valid) {
+ ElMessageBox.confirm(
+ '确认提交吗?',
+ '提示',
+ {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning',
+ },
+ ).then(() => {
+ if (borrowList.value.length) {
+ // 新建/编辑
+ if (title.value === '新建') {
+ // 整理数据
+ const params = {
+ ...ruleForm2.value,
+ equipmentList: borrowList.value,
+ applyType: '1',
+ }
+ addApply(params).then((res) => {
+ console.log('设备借用申请新建', res)
+ })
+ }
+ else {
+ // 编辑
+ }
+ }
+ else {
+ ElMessage.warning('请先添加借用设备')
}
})
- // dialogVisible.value = false
- })
- }
- })
+ }
+ })
+ }
+ else {
+ // 状态管理
+ }
}
// 取消
const resetForm = (formEl: FormInstance | undefined) => {
@@ -330,14 +369,14 @@
if (res.code === 200) {
console.log(res.data[0])
// 重置当前验证
- ruleForm.value.fileList = []
- ruleForm.value.fileList.push({
+ ruleForm1.value.fileList = []
+ ruleForm1.value.fileList.push({
assetId: '',
fileName: res.data[0],
minioFileName: res.data[0],
// id: '',
})
- ruleFormRef.value?.clearValidate('minioFileName')
+ ruleFormRef1.value?.clearValidate('minioFileName')
ElMessage.success('文件上传成功')
}
else {
@@ -349,54 +388,54 @@
const upload = () => {
fileRef.value.click()
}
-// 展示鉴定内容
-const isShowCalibration = ref(false)
-// 若固定资产为测量设备,还需填写检定内容
-watch(() => ruleForm.value.assetType, (newVal) => {
- if (newVal === '1') {
- isShowCalibration.value = true
- }
-})
const columns = ref([
{
text: '设备名称',
value: 'equipmentName',
align: 'center',
+ required: true,
},
{
text: '设备编号',
value: 'equipmentNo',
align: 'center',
+ required: true,
},
{
text: '型号',
value: 'modelNo',
align: 'center',
+ required: false,
},
{
text: '测量范围',
value: 'mesureRange',
align: 'center',
+ required: true,
},
{
text: '使用部门',
- value: 'useDeptName',
+ value: 'useDept',
align: 'center',
+ required: true,
},
{
text: '使用人',
- value: 'usePersonName',
+ value: 'usePerson',
align: 'center',
+ required: true,
},
{
text: '管理状态',
- value: 'managerLevelName',
+ value: 'managerStateName',
align: 'center',
+ required: false,
},
{
text: '有效日期',
value: 'validDate',
align: 'center',
+ required: false,
},
])
const addRowRef = ref()
@@ -404,6 +443,37 @@
const addRowBtn = () => {
addRowRef.value.initDialog({ title: '添加' })
}
+
+// 检查证书列表
+function checkPersonList() {
+ for (let index = 0; index < currentShow.value.data.length; index++) {
+ const item = currentShow.value.data[index]
+ for (const prop of currentShow.value.column) {
+ // 检查必填
+ if (prop.required && !item[prop.value]) {
+ ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`)
+ return false
+ }
+ }
+ }
+ return true
+}
+// 将证书列表置为不可编辑状态
+function setAllRowReadable() {
+ // for (const item of borrowList.value) {
+ // item.editable = false
+ // }
+}
+const SelectionList = ref()
+// 表格选中
+const handleSelectionChange = (e) => {
+ SelectionList.value = e
+}
+// 双击行显示输入框
+const dblclickRow = (row) => {
+ // setAllRowReadable()
+ // row.editable = true
+}
// 删除行
const removeRowBtn = () => {
const removeArr = borrowList.value.filter(item => item.remove !== '')
@@ -425,10 +495,27 @@
ElMessage.warning('请先选择需要删除的数据')
}
}
+// 删除行
+// const removeRow = () => {
+// currentShow.value.data = currentShow.value.data.filter((item) => {
+// return !SelectionList.value.includes(item)
+// })
+// }
// 借用设备列表添加
const addRowMethods = (row) => {
row.forEach((element) => {
- borrowList.value.push({ ...element, remove: '' })
+ borrowList.value.push({
+ equipmentName: element.equipmentName, // 设备名称
+ createUser: '', // 当前用户id 1
+ equipmentId: element.id, // 设备id 1
+ equipmentNo: element.equipmentNo, // 设备编号
+ modelNo: element.modelNo, // 型号
+ measureRange: '', // 测量范围 1
+ useDept: '', // 使用部门 1
+ usePerson: '', // 使用人 1
+ validDate: element.validDate, // 有效日期
+ edit: true,
+ })
})
}
@@ -439,65 +526,65 @@
-
- 保存
+
+ 提交
-
+
关闭
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -505,7 +592,7 @@
@@ -513,19 +600,59 @@
-
+
-
+
-
- {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }}
+
+ {{ ruleForm1.fileList[0]?.minioFileName ? '更换' : '上传' }}
- 暂无
+ 暂无
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -541,7 +668,7 @@
删除行
-
@@ -556,9 +683,29 @@
-
+ -->
+
+
+
+
+
+ *{{ item.text }}
+
+
+ {{ scope.row[item.value] }}
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/src/views/measure/file/approve.vue b/src/views/measure/file/approve.vue
index a9d8827..d7e722c 100644
--- a/src/views/measure/file/approve.vue
+++ b/src/views/measure/file/approve.vue
@@ -23,8 +23,16 @@
const current = ref('全部')
const currentComp = shallowRef(all)
watch(current, (newValue) => {
+ console.log(newValue)
currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp
})
+onUnmounted(() => {
+ sessionStorage.setItem('approveFileMenu', current.value)
+})
+onMounted(() => {
+ current.value = sessionStorage.getItem('approveFileMenu') || '全部'
+ sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : ''
+})
diff --git a/src/views/measure/file/quality.vue b/src/views/measure/file/quality.vue
index 3fa57dc..f8f7528 100644
--- a/src/views/measure/file/quality.vue
+++ b/src/views/measure/file/quality.vue
@@ -20,8 +20,16 @@
const current = ref('计量法规')
const currentComp = shallowRef(statute)
watch(current, (newValue) => {
+ console.log(newValue, 'newValue')
currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp
})
+onUnmounted(() => {
+ sessionStorage.setItem('fileMenu', current.value)
+})
+onMounted(() => {
+ current.value = sessionStorage.getItem('fileMenu') || '计量法规'
+ sessionStorage.getItem('fileMenu') ? sessionStorage.removeItem('fileMenu') : ''
+})
diff --git a/src/views/measure/person/certificateLog.vue b/src/views/measure/person/certificateLog.vue
index 11eeb7b..16a8c9d 100644
--- a/src/views/measure/person/certificateLog.vue
+++ b/src/views/measure/person/certificateLog.vue
@@ -29,7 +29,8 @@
// major: '', // 计量专业
verifierCertificateNo: '', // 证书号
certificateStatus: '', // 证书状态
- limit: 10,
+ remindType: '',
+ limit: 20,
offset: 1,
}) // 查询参数
const loadingTable = ref(false) // 表格loading
@@ -92,6 +93,9 @@
// 获取数据列表
const getList = () => {
loadingTable.value = true
+ if (props.isRemind) {
+ searchQuery.remindType = 'remind'
+ }
getCertificateList(searchQuery).then((res) => {
if (res.code === 200) {
res.data.records = res.data.records.map(item => ({ ...item, sex: item.sex == '1' ? '男' : '女', certificateStatus: item.certificateStatus == '0' ? '正常' : '已失效', validDate: item.validDate.split(' ')[0], certificateDate: item.certificateDate.split(' ')[0] }))
diff --git a/src/views/measure/person/person-interface.ts b/src/views/measure/person/person-interface.ts
index 9dd5d33..d116841 100644
--- a/src/views/measure/person/person-interface.ts
+++ b/src/views/measure/person/person-interface.ts
@@ -6,6 +6,7 @@
major?: string // 计量专业
verifierCertificateNo?: string // 证书号
certificateStatus?: string // 证书状态
+ remindType?: string
limit: number
offset: number
}