diff --git a/src/components.d.ts b/src/components.d.ts index 60aa0e7..f202da8 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,13 +14,11 @@ Auth: typeof import('./components/Auth/index.vue')['default'] AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] - Benchcol: typeof import('./components/benchcol/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] - Echart: typeof import('./components/Echart/index.vue')['default'] Echarts: typeof import('./components/echarts/index.vue')['default'] Editor: typeof import('./components/Editor/index.vue')['default'] EmployeesDialog: typeof import('./components/dialog/employeesDialog.vue')['default'] diff --git a/src/components.d.ts b/src/components.d.ts index 60aa0e7..f202da8 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,13 +14,11 @@ Auth: typeof import('./components/Auth/index.vue')['default'] AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] - Benchcol: typeof import('./components/benchcol/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] - Echart: typeof import('./components/Echart/index.vue')['default'] Echarts: typeof import('./components/echarts/index.vue')['default'] Editor: typeof import('./components/Editor/index.vue')['default'] EmployeesDialog: typeof import('./components/dialog/employeesDialog.vue')['default'] diff --git a/src/views/device/standingBook/adjustDevice.vue b/src/views/device/standingBook/adjustDevice.vue index a6e1b54..a1a38bc 100644 --- a/src/views/device/standingBook/adjustDevice.vue +++ b/src/views/device/standingBook/adjustDevice.vue @@ -1,11 +1,11 @@ + - - 校准检定设备 - + diff --git a/src/components.d.ts b/src/components.d.ts index 60aa0e7..f202da8 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,13 +14,11 @@ Auth: typeof import('./components/Auth/index.vue')['default'] AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] - Benchcol: typeof import('./components/benchcol/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] - Echart: typeof import('./components/Echart/index.vue')['default'] Echarts: typeof import('./components/echarts/index.vue')['default'] Editor: typeof import('./components/Editor/index.vue')['default'] EmployeesDialog: typeof import('./components/dialog/employeesDialog.vue')['default'] diff --git a/src/views/device/standingBook/adjustDevice.vue b/src/views/device/standingBook/adjustDevice.vue index a6e1b54..a1a38bc 100644 --- a/src/views/device/standingBook/adjustDevice.vue +++ b/src/views/device/standingBook/adjustDevice.vue @@ -1,11 +1,11 @@ + - - 校准检定设备 - + diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 7a41e7c..f46553a 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -3,17 +3,17 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { deptType, selectType } from '../standingBook-interface' -import useUserStore from '@/store/modules/user' import showPhoto from '@/views/system/tool/showPhoto.vue' import { UploadFile } from '@/api/measure/file' import { getDictByCode } from '@/api/system/dict' import { getUserList } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' +import comTreeSelect from '@/views/system/user/selecTree.vue' +import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { assetsAddApi, assetsDetailApi, assetsUpdateApi } from '@/api/device/standingBook' const emits = defineEmits(['resetData']) const ruleFormRef = ref() // from组件 -const userInfo = useUserStore() // 当前用户信息 const dialogVisible = ref(true) const title = ref('') const ruleForm = ref({ @@ -70,7 +70,17 @@ id: '', }) // 表单 const rules = ref({ - // fileName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], + assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], + equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], + manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], + manufacturingNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }], + manufacturingDate: [{ required: true, message: '出厂日期不能为空', trigger: 'blur' }], + modelNo: [{ required: true, message: '型号不能为空', trigger: 'blur' }], + abc: [{ required: true, message: 'ABC不能为空', trigger: 'blur' }], + cardEstablishmentDate: [{ required: true, message: '立卡年月不能为空', trigger: 'blur' }], + enableDate: [{ required: true, message: '启用日期不能为空', trigger: 'blur' }], + mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], + validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC @@ -82,18 +92,55 @@ const managerLevelList = ref([]) // 管理级别 const depreciationMethodList = ref([]) // 折旧方法 const managerStateList = ref([]) // 管理状态 +const capitalSourceList = ref([]) // 资本来源 const usePersonList = ref([]) // 使用人列表 const useDeptList = ref([]) // 使用部门列表 const isWhether = ref([ { name: '是', id: 'shi', - value: '0', + value: '1', }, { name: '否', id: 'fou', - value: '1', + value: '0', + }, +]) +const deptProps = reactive({ + parent: 'pid', value: 'id', label: 'name', children: 'children', +}) +// 检定周期 +const mesureCycleList = ref([ + { + name: '半年一检', + id: '1', + value: '6', + }, + { + name: '一年一检', + id: '2', + value: '12', + }, + { + name: '两年一检', + id: '3', + value: '24', + }, + { + name: '三年一检', + id: '4', + value: '36', + }, + { + name: '四年一检', + id: '5', + value: '48', + }, + { + name: '五年一检', + id: '6', + value: '60', }, ]) // 获取下拉框数 @@ -138,6 +185,10 @@ getDictByCode('managerState').then((response) => { managerStateList.value = response.data }) + // 获取资本来源 + getDictByCode('capitalSource').then((response) => { + capitalSourceList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 99999 }).then((res) => { usePersonList.value = res.data.rows @@ -145,7 +196,7 @@ // 获取部门列表 getDeptTreeList().then((res) => { // 转成树结构 - useDeptList.value = res.data + useDeptList.value = toTreeList(res.data, '0', true) }) } // 重置 @@ -212,6 +263,11 @@ // 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 }) } @@ -237,9 +293,13 @@ }, ).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('操作成功') dialogVisible.value = false close() emits('resetData') @@ -274,7 +334,7 @@ assetId: '', fileName: res.data[0], minioFileName: res.data[0], - id: '', + // id: '', }) ruleFormRef.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') @@ -323,7 +383,7 @@ - + @@ -335,33 +395,33 @@ - + - + - + - + - + @@ -370,26 +430,26 @@ - + - + - + - + 扫描 @@ -404,7 +464,7 @@ @@ -413,22 +473,22 @@ - + - - + + @@ -436,33 +496,38 @@ - + - + - + + - + - + @@ -471,8 +536,16 @@ - + + + + @@ -480,7 +553,7 @@ @@ -489,14 +562,14 @@ - + @@ -505,21 +578,21 @@ - + - + - + @@ -529,24 +602,24 @@ - + - + - + - + @@ -556,77 +629,77 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,6 +738,7 @@ {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + 暂无 diff --git a/src/components.d.ts b/src/components.d.ts index 60aa0e7..f202da8 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,13 +14,11 @@ Auth: typeof import('./components/Auth/index.vue')['default'] AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] - Benchcol: typeof import('./components/benchcol/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] - Echart: typeof import('./components/Echart/index.vue')['default'] Echarts: typeof import('./components/echarts/index.vue')['default'] Editor: typeof import('./components/Editor/index.vue')['default'] EmployeesDialog: typeof import('./components/dialog/employeesDialog.vue')['default'] diff --git a/src/views/device/standingBook/adjustDevice.vue b/src/views/device/standingBook/adjustDevice.vue index a6e1b54..a1a38bc 100644 --- a/src/views/device/standingBook/adjustDevice.vue +++ b/src/views/device/standingBook/adjustDevice.vue @@ -1,11 +1,11 @@ + - - 校准检定设备 - + diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 7a41e7c..f46553a 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -3,17 +3,17 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { deptType, selectType } from '../standingBook-interface' -import useUserStore from '@/store/modules/user' import showPhoto from '@/views/system/tool/showPhoto.vue' import { UploadFile } from '@/api/measure/file' import { getDictByCode } from '@/api/system/dict' import { getUserList } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' +import comTreeSelect from '@/views/system/user/selecTree.vue' +import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { assetsAddApi, assetsDetailApi, assetsUpdateApi } from '@/api/device/standingBook' const emits = defineEmits(['resetData']) const ruleFormRef = ref() // from组件 -const userInfo = useUserStore() // 当前用户信息 const dialogVisible = ref(true) const title = ref('') const ruleForm = ref({ @@ -70,7 +70,17 @@ id: '', }) // 表单 const rules = ref({ - // fileName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], + assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], + equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], + manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], + manufacturingNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }], + manufacturingDate: [{ required: true, message: '出厂日期不能为空', trigger: 'blur' }], + modelNo: [{ required: true, message: '型号不能为空', trigger: 'blur' }], + abc: [{ required: true, message: 'ABC不能为空', trigger: 'blur' }], + cardEstablishmentDate: [{ required: true, message: '立卡年月不能为空', trigger: 'blur' }], + enableDate: [{ required: true, message: '启用日期不能为空', trigger: 'blur' }], + mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], + validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC @@ -82,18 +92,55 @@ const managerLevelList = ref([]) // 管理级别 const depreciationMethodList = ref([]) // 折旧方法 const managerStateList = ref([]) // 管理状态 +const capitalSourceList = ref([]) // 资本来源 const usePersonList = ref([]) // 使用人列表 const useDeptList = ref([]) // 使用部门列表 const isWhether = ref([ { name: '是', id: 'shi', - value: '0', + value: '1', }, { name: '否', id: 'fou', - value: '1', + value: '0', + }, +]) +const deptProps = reactive({ + parent: 'pid', value: 'id', label: 'name', children: 'children', +}) +// 检定周期 +const mesureCycleList = ref([ + { + name: '半年一检', + id: '1', + value: '6', + }, + { + name: '一年一检', + id: '2', + value: '12', + }, + { + name: '两年一检', + id: '3', + value: '24', + }, + { + name: '三年一检', + id: '4', + value: '36', + }, + { + name: '四年一检', + id: '5', + value: '48', + }, + { + name: '五年一检', + id: '6', + value: '60', }, ]) // 获取下拉框数 @@ -138,6 +185,10 @@ getDictByCode('managerState').then((response) => { managerStateList.value = response.data }) + // 获取资本来源 + getDictByCode('capitalSource').then((response) => { + capitalSourceList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 99999 }).then((res) => { usePersonList.value = res.data.rows @@ -145,7 +196,7 @@ // 获取部门列表 getDeptTreeList().then((res) => { // 转成树结构 - useDeptList.value = res.data + useDeptList.value = toTreeList(res.data, '0', true) }) } // 重置 @@ -212,6 +263,11 @@ // 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 }) } @@ -237,9 +293,13 @@ }, ).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('操作成功') dialogVisible.value = false close() emits('resetData') @@ -274,7 +334,7 @@ assetId: '', fileName: res.data[0], minioFileName: res.data[0], - id: '', + // id: '', }) ruleFormRef.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') @@ -323,7 +383,7 @@ - + @@ -335,33 +395,33 @@ - + - + - + - + - + @@ -370,26 +430,26 @@ - + - + - + - + 扫描 @@ -404,7 +464,7 @@ @@ -413,22 +473,22 @@ - + - - + + @@ -436,33 +496,38 @@ - + - + - + + - + - + @@ -471,8 +536,16 @@ - + + + + @@ -480,7 +553,7 @@ @@ -489,14 +562,14 @@ - + @@ -505,21 +578,21 @@ - + - + - + @@ -529,24 +602,24 @@ - + - + - + - + @@ -556,77 +629,77 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,6 +738,7 @@ {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + 暂无 diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue new file mode 100644 index 0000000..a04dd5f --- /dev/null +++ b/src/views/device/standingBook/components/templateAdd.vue @@ -0,0 +1,133 @@ + + + + + + + + + {{ name }} -{{ title }} + + + + 保存 + + + 关闭 + + + + + + + + {{ item.name }} + + + + + + + + + + diff --git a/src/components.d.ts b/src/components.d.ts index 60aa0e7..f202da8 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,13 +14,11 @@ Auth: typeof import('./components/Auth/index.vue')['default'] AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] - Benchcol: typeof import('./components/benchcol/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] - Echart: typeof import('./components/Echart/index.vue')['default'] Echarts: typeof import('./components/echarts/index.vue')['default'] Editor: typeof import('./components/Editor/index.vue')['default'] EmployeesDialog: typeof import('./components/dialog/employeesDialog.vue')['default'] diff --git a/src/views/device/standingBook/adjustDevice.vue b/src/views/device/standingBook/adjustDevice.vue index a6e1b54..a1a38bc 100644 --- a/src/views/device/standingBook/adjustDevice.vue +++ b/src/views/device/standingBook/adjustDevice.vue @@ -1,11 +1,11 @@ + - - 校准检定设备 - + diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 7a41e7c..f46553a 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -3,17 +3,17 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { deptType, selectType } from '../standingBook-interface' -import useUserStore from '@/store/modules/user' import showPhoto from '@/views/system/tool/showPhoto.vue' import { UploadFile } from '@/api/measure/file' import { getDictByCode } from '@/api/system/dict' import { getUserList } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' +import comTreeSelect from '@/views/system/user/selecTree.vue' +import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { assetsAddApi, assetsDetailApi, assetsUpdateApi } from '@/api/device/standingBook' const emits = defineEmits(['resetData']) const ruleFormRef = ref() // from组件 -const userInfo = useUserStore() // 当前用户信息 const dialogVisible = ref(true) const title = ref('') const ruleForm = ref({ @@ -70,7 +70,17 @@ id: '', }) // 表单 const rules = ref({ - // fileName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], + assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], + equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], + manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], + manufacturingNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }], + manufacturingDate: [{ required: true, message: '出厂日期不能为空', trigger: 'blur' }], + modelNo: [{ required: true, message: '型号不能为空', trigger: 'blur' }], + abc: [{ required: true, message: 'ABC不能为空', trigger: 'blur' }], + cardEstablishmentDate: [{ required: true, message: '立卡年月不能为空', trigger: 'blur' }], + enableDate: [{ required: true, message: '启用日期不能为空', trigger: 'blur' }], + mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], + validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC @@ -82,18 +92,55 @@ const managerLevelList = ref([]) // 管理级别 const depreciationMethodList = ref([]) // 折旧方法 const managerStateList = ref([]) // 管理状态 +const capitalSourceList = ref([]) // 资本来源 const usePersonList = ref([]) // 使用人列表 const useDeptList = ref([]) // 使用部门列表 const isWhether = ref([ { name: '是', id: 'shi', - value: '0', + value: '1', }, { name: '否', id: 'fou', - value: '1', + value: '0', + }, +]) +const deptProps = reactive({ + parent: 'pid', value: 'id', label: 'name', children: 'children', +}) +// 检定周期 +const mesureCycleList = ref([ + { + name: '半年一检', + id: '1', + value: '6', + }, + { + name: '一年一检', + id: '2', + value: '12', + }, + { + name: '两年一检', + id: '3', + value: '24', + }, + { + name: '三年一检', + id: '4', + value: '36', + }, + { + name: '四年一检', + id: '5', + value: '48', + }, + { + name: '五年一检', + id: '6', + value: '60', }, ]) // 获取下拉框数 @@ -138,6 +185,10 @@ getDictByCode('managerState').then((response) => { managerStateList.value = response.data }) + // 获取资本来源 + getDictByCode('capitalSource').then((response) => { + capitalSourceList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 99999 }).then((res) => { usePersonList.value = res.data.rows @@ -145,7 +196,7 @@ // 获取部门列表 getDeptTreeList().then((res) => { // 转成树结构 - useDeptList.value = res.data + useDeptList.value = toTreeList(res.data, '0', true) }) } // 重置 @@ -212,6 +263,11 @@ // 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 }) } @@ -237,9 +293,13 @@ }, ).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('操作成功') dialogVisible.value = false close() emits('resetData') @@ -274,7 +334,7 @@ assetId: '', fileName: res.data[0], minioFileName: res.data[0], - id: '', + // id: '', }) ruleFormRef.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') @@ -323,7 +383,7 @@ - + @@ -335,33 +395,33 @@ - + - + - + - + - + @@ -370,26 +430,26 @@ - + - + - + - + 扫描 @@ -404,7 +464,7 @@ @@ -413,22 +473,22 @@ - + - - + + @@ -436,33 +496,38 @@ - + - + - + + - + - + @@ -471,8 +536,16 @@ - + + + + @@ -480,7 +553,7 @@ @@ -489,14 +562,14 @@ - + @@ -505,21 +578,21 @@ - + - + - + @@ -529,24 +602,24 @@ - + - + - + - + @@ -556,77 +629,77 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,6 +738,7 @@ {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + 暂无 diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue new file mode 100644 index 0000000..a04dd5f --- /dev/null +++ b/src/views/device/standingBook/components/templateAdd.vue @@ -0,0 +1,133 @@ + + + + + + + + + {{ name }} -{{ title }} + + + + 保存 + + + 关闭 + + + + + + + + {{ item.name }} + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue new file mode 100644 index 0000000..604026c --- /dev/null +++ b/src/views/device/standingBook/components/templatePage.vue @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 标签识别 + + + 批量导入 + + + 模板下载 + + + 新建 + + + 导出 + + + 打印 + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + 编辑 + + + 详情 + + + 删除 + + + + + + + + + + + diff --git a/src/components.d.ts b/src/components.d.ts index 60aa0e7..f202da8 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,13 +14,11 @@ Auth: typeof import('./components/Auth/index.vue')['default'] AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] - Benchcol: typeof import('./components/benchcol/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] - Echart: typeof import('./components/Echart/index.vue')['default'] Echarts: typeof import('./components/echarts/index.vue')['default'] Editor: typeof import('./components/Editor/index.vue')['default'] EmployeesDialog: typeof import('./components/dialog/employeesDialog.vue')['default'] diff --git a/src/views/device/standingBook/adjustDevice.vue b/src/views/device/standingBook/adjustDevice.vue index a6e1b54..a1a38bc 100644 --- a/src/views/device/standingBook/adjustDevice.vue +++ b/src/views/device/standingBook/adjustDevice.vue @@ -1,11 +1,11 @@ + - - 校准检定设备 - + diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 7a41e7c..f46553a 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -3,17 +3,17 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { deptType, selectType } from '../standingBook-interface' -import useUserStore from '@/store/modules/user' import showPhoto from '@/views/system/tool/showPhoto.vue' import { UploadFile } from '@/api/measure/file' import { getDictByCode } from '@/api/system/dict' import { getUserList } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' +import comTreeSelect from '@/views/system/user/selecTree.vue' +import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { assetsAddApi, assetsDetailApi, assetsUpdateApi } from '@/api/device/standingBook' const emits = defineEmits(['resetData']) const ruleFormRef = ref() // from组件 -const userInfo = useUserStore() // 当前用户信息 const dialogVisible = ref(true) const title = ref('') const ruleForm = ref({ @@ -70,7 +70,17 @@ id: '', }) // 表单 const rules = ref({ - // fileName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], + assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], + equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], + manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], + manufacturingNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }], + manufacturingDate: [{ required: true, message: '出厂日期不能为空', trigger: 'blur' }], + modelNo: [{ required: true, message: '型号不能为空', trigger: 'blur' }], + abc: [{ required: true, message: 'ABC不能为空', trigger: 'blur' }], + cardEstablishmentDate: [{ required: true, message: '立卡年月不能为空', trigger: 'blur' }], + enableDate: [{ required: true, message: '启用日期不能为空', trigger: 'blur' }], + mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], + validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC @@ -82,18 +92,55 @@ const managerLevelList = ref([]) // 管理级别 const depreciationMethodList = ref([]) // 折旧方法 const managerStateList = ref([]) // 管理状态 +const capitalSourceList = ref([]) // 资本来源 const usePersonList = ref([]) // 使用人列表 const useDeptList = ref([]) // 使用部门列表 const isWhether = ref([ { name: '是', id: 'shi', - value: '0', + value: '1', }, { name: '否', id: 'fou', - value: '1', + value: '0', + }, +]) +const deptProps = reactive({ + parent: 'pid', value: 'id', label: 'name', children: 'children', +}) +// 检定周期 +const mesureCycleList = ref([ + { + name: '半年一检', + id: '1', + value: '6', + }, + { + name: '一年一检', + id: '2', + value: '12', + }, + { + name: '两年一检', + id: '3', + value: '24', + }, + { + name: '三年一检', + id: '4', + value: '36', + }, + { + name: '四年一检', + id: '5', + value: '48', + }, + { + name: '五年一检', + id: '6', + value: '60', }, ]) // 获取下拉框数 @@ -138,6 +185,10 @@ getDictByCode('managerState').then((response) => { managerStateList.value = response.data }) + // 获取资本来源 + getDictByCode('capitalSource').then((response) => { + capitalSourceList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 99999 }).then((res) => { usePersonList.value = res.data.rows @@ -145,7 +196,7 @@ // 获取部门列表 getDeptTreeList().then((res) => { // 转成树结构 - useDeptList.value = res.data + useDeptList.value = toTreeList(res.data, '0', true) }) } // 重置 @@ -212,6 +263,11 @@ // 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 }) } @@ -237,9 +293,13 @@ }, ).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('操作成功') dialogVisible.value = false close() emits('resetData') @@ -274,7 +334,7 @@ assetId: '', fileName: res.data[0], minioFileName: res.data[0], - id: '', + // id: '', }) ruleFormRef.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') @@ -323,7 +383,7 @@ - + @@ -335,33 +395,33 @@ - + - + - + - + - + @@ -370,26 +430,26 @@ - + - + - + - + 扫描 @@ -404,7 +464,7 @@ @@ -413,22 +473,22 @@ - + - - + + @@ -436,33 +496,38 @@ - + - + - + + - + - + @@ -471,8 +536,16 @@ - + + + + @@ -480,7 +553,7 @@ @@ -489,14 +562,14 @@ - + @@ -505,21 +578,21 @@ - + - + - + @@ -529,24 +602,24 @@ - + - + - + - + @@ -556,77 +629,77 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,6 +738,7 @@ {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + 暂无 diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue new file mode 100644 index 0000000..a04dd5f --- /dev/null +++ b/src/views/device/standingBook/components/templateAdd.vue @@ -0,0 +1,133 @@ + + + + + + + + + {{ name }} -{{ title }} + + + + 保存 + + + 关闭 + + + + + + + + {{ item.name }} + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue new file mode 100644 index 0000000..604026c --- /dev/null +++ b/src/views/device/standingBook/components/templatePage.vue @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 标签识别 + + + 批量导入 + + + 模板下载 + + + 新建 + + + 导出 + + + 打印 + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + 编辑 + + + 详情 + + + 删除 + + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templateTable.vue b/src/views/device/standingBook/components/templateTable.vue new file mode 100644 index 0000000..faf4da1 --- /dev/null +++ b/src/views/device/standingBook/components/templateTable.vue @@ -0,0 +1,208 @@ + + + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + diff --git a/src/components.d.ts b/src/components.d.ts index 60aa0e7..f202da8 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,13 +14,11 @@ Auth: typeof import('./components/Auth/index.vue')['default'] AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] - Benchcol: typeof import('./components/benchcol/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] - Echart: typeof import('./components/Echart/index.vue')['default'] Echarts: typeof import('./components/echarts/index.vue')['default'] Editor: typeof import('./components/Editor/index.vue')['default'] EmployeesDialog: typeof import('./components/dialog/employeesDialog.vue')['default'] diff --git a/src/views/device/standingBook/adjustDevice.vue b/src/views/device/standingBook/adjustDevice.vue index a6e1b54..a1a38bc 100644 --- a/src/views/device/standingBook/adjustDevice.vue +++ b/src/views/device/standingBook/adjustDevice.vue @@ -1,11 +1,11 @@ + - - 校准检定设备 - + diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 7a41e7c..f46553a 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -3,17 +3,17 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { deptType, selectType } from '../standingBook-interface' -import useUserStore from '@/store/modules/user' import showPhoto from '@/views/system/tool/showPhoto.vue' import { UploadFile } from '@/api/measure/file' import { getDictByCode } from '@/api/system/dict' import { getUserList } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' +import comTreeSelect from '@/views/system/user/selecTree.vue' +import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { assetsAddApi, assetsDetailApi, assetsUpdateApi } from '@/api/device/standingBook' const emits = defineEmits(['resetData']) const ruleFormRef = ref() // from组件 -const userInfo = useUserStore() // 当前用户信息 const dialogVisible = ref(true) const title = ref('') const ruleForm = ref({ @@ -70,7 +70,17 @@ id: '', }) // 表单 const rules = ref({ - // fileName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], + assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], + equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], + manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], + manufacturingNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }], + manufacturingDate: [{ required: true, message: '出厂日期不能为空', trigger: 'blur' }], + modelNo: [{ required: true, message: '型号不能为空', trigger: 'blur' }], + abc: [{ required: true, message: 'ABC不能为空', trigger: 'blur' }], + cardEstablishmentDate: [{ required: true, message: '立卡年月不能为空', trigger: 'blur' }], + enableDate: [{ required: true, message: '启用日期不能为空', trigger: 'blur' }], + mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], + validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC @@ -82,18 +92,55 @@ const managerLevelList = ref([]) // 管理级别 const depreciationMethodList = ref([]) // 折旧方法 const managerStateList = ref([]) // 管理状态 +const capitalSourceList = ref([]) // 资本来源 const usePersonList = ref([]) // 使用人列表 const useDeptList = ref([]) // 使用部门列表 const isWhether = ref([ { name: '是', id: 'shi', - value: '0', + value: '1', }, { name: '否', id: 'fou', - value: '1', + value: '0', + }, +]) +const deptProps = reactive({ + parent: 'pid', value: 'id', label: 'name', children: 'children', +}) +// 检定周期 +const mesureCycleList = ref([ + { + name: '半年一检', + id: '1', + value: '6', + }, + { + name: '一年一检', + id: '2', + value: '12', + }, + { + name: '两年一检', + id: '3', + value: '24', + }, + { + name: '三年一检', + id: '4', + value: '36', + }, + { + name: '四年一检', + id: '5', + value: '48', + }, + { + name: '五年一检', + id: '6', + value: '60', }, ]) // 获取下拉框数 @@ -138,6 +185,10 @@ getDictByCode('managerState').then((response) => { managerStateList.value = response.data }) + // 获取资本来源 + getDictByCode('capitalSource').then((response) => { + capitalSourceList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 99999 }).then((res) => { usePersonList.value = res.data.rows @@ -145,7 +196,7 @@ // 获取部门列表 getDeptTreeList().then((res) => { // 转成树结构 - useDeptList.value = res.data + useDeptList.value = toTreeList(res.data, '0', true) }) } // 重置 @@ -212,6 +263,11 @@ // 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 }) } @@ -237,9 +293,13 @@ }, ).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('操作成功') dialogVisible.value = false close() emits('resetData') @@ -274,7 +334,7 @@ assetId: '', fileName: res.data[0], minioFileName: res.data[0], - id: '', + // id: '', }) ruleFormRef.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') @@ -323,7 +383,7 @@ - + @@ -335,33 +395,33 @@ - + - + - + - + - + @@ -370,26 +430,26 @@ - + - + - + - + 扫描 @@ -404,7 +464,7 @@ @@ -413,22 +473,22 @@ - + - - + + @@ -436,33 +496,38 @@ - + - + - + + - + - + @@ -471,8 +536,16 @@ - + + + + @@ -480,7 +553,7 @@ @@ -489,14 +562,14 @@ - + @@ -505,21 +578,21 @@ - + - + - + @@ -529,24 +602,24 @@ - + - + - + - + @@ -556,77 +629,77 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,6 +738,7 @@ {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + 暂无 diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue new file mode 100644 index 0000000..a04dd5f --- /dev/null +++ b/src/views/device/standingBook/components/templateAdd.vue @@ -0,0 +1,133 @@ + + + + + + + + + {{ name }} -{{ title }} + + + + 保存 + + + 关闭 + + + + + + + + {{ item.name }} + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue new file mode 100644 index 0000000..604026c --- /dev/null +++ b/src/views/device/standingBook/components/templatePage.vue @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 标签识别 + + + 批量导入 + + + 模板下载 + + + 新建 + + + 导出 + + + 打印 + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + 编辑 + + + 详情 + + + 删除 + + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templateTable.vue b/src/views/device/standingBook/components/templateTable.vue new file mode 100644 index 0000000..faf4da1 --- /dev/null +++ b/src/views/device/standingBook/components/templateTable.vue @@ -0,0 +1,208 @@ + + + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index 9f871d8..7538bc8 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -2,6 +2,7 @@ - - 校准检定设备 - + diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 7a41e7c..f46553a 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -3,17 +3,17 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { deptType, selectType } from '../standingBook-interface' -import useUserStore from '@/store/modules/user' import showPhoto from '@/views/system/tool/showPhoto.vue' import { UploadFile } from '@/api/measure/file' import { getDictByCode } from '@/api/system/dict' import { getUserList } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' +import comTreeSelect from '@/views/system/user/selecTree.vue' +import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { assetsAddApi, assetsDetailApi, assetsUpdateApi } from '@/api/device/standingBook' const emits = defineEmits(['resetData']) const ruleFormRef = ref() // from组件 -const userInfo = useUserStore() // 当前用户信息 const dialogVisible = ref(true) const title = ref('') const ruleForm = ref({ @@ -70,7 +70,17 @@ id: '', }) // 表单 const rules = ref({ - // fileName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], + assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], + equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], + manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], + manufacturingNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }], + manufacturingDate: [{ required: true, message: '出厂日期不能为空', trigger: 'blur' }], + modelNo: [{ required: true, message: '型号不能为空', trigger: 'blur' }], + abc: [{ required: true, message: 'ABC不能为空', trigger: 'blur' }], + cardEstablishmentDate: [{ required: true, message: '立卡年月不能为空', trigger: 'blur' }], + enableDate: [{ required: true, message: '启用日期不能为空', trigger: 'blur' }], + mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], + validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC @@ -82,18 +92,55 @@ const managerLevelList = ref([]) // 管理级别 const depreciationMethodList = ref([]) // 折旧方法 const managerStateList = ref([]) // 管理状态 +const capitalSourceList = ref([]) // 资本来源 const usePersonList = ref([]) // 使用人列表 const useDeptList = ref([]) // 使用部门列表 const isWhether = ref([ { name: '是', id: 'shi', - value: '0', + value: '1', }, { name: '否', id: 'fou', - value: '1', + value: '0', + }, +]) +const deptProps = reactive({ + parent: 'pid', value: 'id', label: 'name', children: 'children', +}) +// 检定周期 +const mesureCycleList = ref([ + { + name: '半年一检', + id: '1', + value: '6', + }, + { + name: '一年一检', + id: '2', + value: '12', + }, + { + name: '两年一检', + id: '3', + value: '24', + }, + { + name: '三年一检', + id: '4', + value: '36', + }, + { + name: '四年一检', + id: '5', + value: '48', + }, + { + name: '五年一检', + id: '6', + value: '60', }, ]) // 获取下拉框数 @@ -138,6 +185,10 @@ getDictByCode('managerState').then((response) => { managerStateList.value = response.data }) + // 获取资本来源 + getDictByCode('capitalSource').then((response) => { + capitalSourceList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 99999 }).then((res) => { usePersonList.value = res.data.rows @@ -145,7 +196,7 @@ // 获取部门列表 getDeptTreeList().then((res) => { // 转成树结构 - useDeptList.value = res.data + useDeptList.value = toTreeList(res.data, '0', true) }) } // 重置 @@ -212,6 +263,11 @@ // 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 }) } @@ -237,9 +293,13 @@ }, ).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('操作成功') dialogVisible.value = false close() emits('resetData') @@ -274,7 +334,7 @@ assetId: '', fileName: res.data[0], minioFileName: res.data[0], - id: '', + // id: '', }) ruleFormRef.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') @@ -323,7 +383,7 @@ - + @@ -335,33 +395,33 @@ - + - + - + - + - + @@ -370,26 +430,26 @@ - + - + - + - + 扫描 @@ -404,7 +464,7 @@ @@ -413,22 +473,22 @@ - + - - + + @@ -436,33 +496,38 @@ - + - + - + + - + - + @@ -471,8 +536,16 @@ - + + + + @@ -480,7 +553,7 @@ @@ -489,14 +562,14 @@ - + @@ -505,21 +578,21 @@ - + - + - + @@ -529,24 +602,24 @@ - + - + - + - + @@ -556,77 +629,77 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,6 +738,7 @@ {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + 暂无 diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue new file mode 100644 index 0000000..a04dd5f --- /dev/null +++ b/src/views/device/standingBook/components/templateAdd.vue @@ -0,0 +1,133 @@ + + + + + + + + + {{ name }} -{{ title }} + + + + 保存 + + + 关闭 + + + + + + + + {{ item.name }} + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue new file mode 100644 index 0000000..604026c --- /dev/null +++ b/src/views/device/standingBook/components/templatePage.vue @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 标签识别 + + + 批量导入 + + + 模板下载 + + + 新建 + + + 导出 + + + 打印 + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + 编辑 + + + 详情 + + + 删除 + + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templateTable.vue b/src/views/device/standingBook/components/templateTable.vue new file mode 100644 index 0000000..faf4da1 --- /dev/null +++ b/src/views/device/standingBook/components/templateTable.vue @@ -0,0 +1,208 @@ + + + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index 9f871d8..7538bc8 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -2,6 +2,7 @@ - - 测量设备 - + diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 7a41e7c..f46553a 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -3,17 +3,17 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { deptType, selectType } from '../standingBook-interface' -import useUserStore from '@/store/modules/user' import showPhoto from '@/views/system/tool/showPhoto.vue' import { UploadFile } from '@/api/measure/file' import { getDictByCode } from '@/api/system/dict' import { getUserList } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' +import comTreeSelect from '@/views/system/user/selecTree.vue' +import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { assetsAddApi, assetsDetailApi, assetsUpdateApi } from '@/api/device/standingBook' const emits = defineEmits(['resetData']) const ruleFormRef = ref() // from组件 -const userInfo = useUserStore() // 当前用户信息 const dialogVisible = ref(true) const title = ref('') const ruleForm = ref({ @@ -70,7 +70,17 @@ id: '', }) // 表单 const rules = ref({ - // fileName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], + assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], + equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], + manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], + manufacturingNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }], + manufacturingDate: [{ required: true, message: '出厂日期不能为空', trigger: 'blur' }], + modelNo: [{ required: true, message: '型号不能为空', trigger: 'blur' }], + abc: [{ required: true, message: 'ABC不能为空', trigger: 'blur' }], + cardEstablishmentDate: [{ required: true, message: '立卡年月不能为空', trigger: 'blur' }], + enableDate: [{ required: true, message: '启用日期不能为空', trigger: 'blur' }], + mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], + validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC @@ -82,18 +92,55 @@ const managerLevelList = ref([]) // 管理级别 const depreciationMethodList = ref([]) // 折旧方法 const managerStateList = ref([]) // 管理状态 +const capitalSourceList = ref([]) // 资本来源 const usePersonList = ref([]) // 使用人列表 const useDeptList = ref([]) // 使用部门列表 const isWhether = ref([ { name: '是', id: 'shi', - value: '0', + value: '1', }, { name: '否', id: 'fou', - value: '1', + value: '0', + }, +]) +const deptProps = reactive({ + parent: 'pid', value: 'id', label: 'name', children: 'children', +}) +// 检定周期 +const mesureCycleList = ref([ + { + name: '半年一检', + id: '1', + value: '6', + }, + { + name: '一年一检', + id: '2', + value: '12', + }, + { + name: '两年一检', + id: '3', + value: '24', + }, + { + name: '三年一检', + id: '4', + value: '36', + }, + { + name: '四年一检', + id: '5', + value: '48', + }, + { + name: '五年一检', + id: '6', + value: '60', }, ]) // 获取下拉框数 @@ -138,6 +185,10 @@ getDictByCode('managerState').then((response) => { managerStateList.value = response.data }) + // 获取资本来源 + getDictByCode('capitalSource').then((response) => { + capitalSourceList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 99999 }).then((res) => { usePersonList.value = res.data.rows @@ -145,7 +196,7 @@ // 获取部门列表 getDeptTreeList().then((res) => { // 转成树结构 - useDeptList.value = res.data + useDeptList.value = toTreeList(res.data, '0', true) }) } // 重置 @@ -212,6 +263,11 @@ // 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 }) } @@ -237,9 +293,13 @@ }, ).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('操作成功') dialogVisible.value = false close() emits('resetData') @@ -274,7 +334,7 @@ assetId: '', fileName: res.data[0], minioFileName: res.data[0], - id: '', + // id: '', }) ruleFormRef.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') @@ -323,7 +383,7 @@ - + @@ -335,33 +395,33 @@ - + - + - + - + - + @@ -370,26 +430,26 @@ - + - + - + - + 扫描 @@ -404,7 +464,7 @@ @@ -413,22 +473,22 @@ - + - - + + @@ -436,33 +496,38 @@ - + - + - + + - + - + @@ -471,8 +536,16 @@ - + + + + @@ -480,7 +553,7 @@ @@ -489,14 +562,14 @@ - + @@ -505,21 +578,21 @@ - + - + - + @@ -529,24 +602,24 @@ - + - + - + - + @@ -556,77 +629,77 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,6 +738,7 @@ {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + 暂无 diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue new file mode 100644 index 0000000..a04dd5f --- /dev/null +++ b/src/views/device/standingBook/components/templateAdd.vue @@ -0,0 +1,133 @@ + + + + + + + + + {{ name }} -{{ title }} + + + + 保存 + + + 关闭 + + + + + + + + {{ item.name }} + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue new file mode 100644 index 0000000..604026c --- /dev/null +++ b/src/views/device/standingBook/components/templatePage.vue @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 标签识别 + + + 批量导入 + + + 模板下载 + + + 新建 + + + 导出 + + + 打印 + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + 编辑 + + + 详情 + + + 删除 + + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templateTable.vue b/src/views/device/standingBook/components/templateTable.vue new file mode 100644 index 0000000..faf4da1 --- /dev/null +++ b/src/views/device/standingBook/components/templateTable.vue @@ -0,0 +1,208 @@ + + + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index 9f871d8..7538bc8 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -2,6 +2,7 @@ - - 测量设备 - + diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 7a41e7c..f46553a 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -3,17 +3,17 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { deptType, selectType } from '../standingBook-interface' -import useUserStore from '@/store/modules/user' import showPhoto from '@/views/system/tool/showPhoto.vue' import { UploadFile } from '@/api/measure/file' import { getDictByCode } from '@/api/system/dict' import { getUserList } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' +import comTreeSelect from '@/views/system/user/selecTree.vue' +import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { assetsAddApi, assetsDetailApi, assetsUpdateApi } from '@/api/device/standingBook' const emits = defineEmits(['resetData']) const ruleFormRef = ref() // from组件 -const userInfo = useUserStore() // 当前用户信息 const dialogVisible = ref(true) const title = ref('') const ruleForm = ref({ @@ -70,7 +70,17 @@ id: '', }) // 表单 const rules = ref({ - // fileName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], + assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], + equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], + manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], + manufacturingNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }], + manufacturingDate: [{ required: true, message: '出厂日期不能为空', trigger: 'blur' }], + modelNo: [{ required: true, message: '型号不能为空', trigger: 'blur' }], + abc: [{ required: true, message: 'ABC不能为空', trigger: 'blur' }], + cardEstablishmentDate: [{ required: true, message: '立卡年月不能为空', trigger: 'blur' }], + enableDate: [{ required: true, message: '启用日期不能为空', trigger: 'blur' }], + mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], + validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC @@ -82,18 +92,55 @@ const managerLevelList = ref([]) // 管理级别 const depreciationMethodList = ref([]) // 折旧方法 const managerStateList = ref([]) // 管理状态 +const capitalSourceList = ref([]) // 资本来源 const usePersonList = ref([]) // 使用人列表 const useDeptList = ref([]) // 使用部门列表 const isWhether = ref([ { name: '是', id: 'shi', - value: '0', + value: '1', }, { name: '否', id: 'fou', - value: '1', + value: '0', + }, +]) +const deptProps = reactive({ + parent: 'pid', value: 'id', label: 'name', children: 'children', +}) +// 检定周期 +const mesureCycleList = ref([ + { + name: '半年一检', + id: '1', + value: '6', + }, + { + name: '一年一检', + id: '2', + value: '12', + }, + { + name: '两年一检', + id: '3', + value: '24', + }, + { + name: '三年一检', + id: '4', + value: '36', + }, + { + name: '四年一检', + id: '5', + value: '48', + }, + { + name: '五年一检', + id: '6', + value: '60', }, ]) // 获取下拉框数 @@ -138,6 +185,10 @@ getDictByCode('managerState').then((response) => { managerStateList.value = response.data }) + // 获取资本来源 + getDictByCode('capitalSource').then((response) => { + capitalSourceList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 99999 }).then((res) => { usePersonList.value = res.data.rows @@ -145,7 +196,7 @@ // 获取部门列表 getDeptTreeList().then((res) => { // 转成树结构 - useDeptList.value = res.data + useDeptList.value = toTreeList(res.data, '0', true) }) } // 重置 @@ -212,6 +263,11 @@ // 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 }) } @@ -237,9 +293,13 @@ }, ).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('操作成功') dialogVisible.value = false close() emits('resetData') @@ -274,7 +334,7 @@ assetId: '', fileName: res.data[0], minioFileName: res.data[0], - id: '', + // id: '', }) ruleFormRef.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') @@ -323,7 +383,7 @@ - + @@ -335,33 +395,33 @@ - + - + - + - + - + @@ -370,26 +430,26 @@ - + - + - + - + 扫描 @@ -404,7 +464,7 @@ @@ -413,22 +473,22 @@ - + - - + + @@ -436,33 +496,38 @@ - + - + - + + - + - + @@ -471,8 +536,16 @@ - + + + + @@ -480,7 +553,7 @@ @@ -489,14 +562,14 @@ - + @@ -505,21 +578,21 @@ - + - + - + @@ -529,24 +602,24 @@ - + - + - + - + @@ -556,77 +629,77 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,6 +738,7 @@ {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + 暂无 diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue new file mode 100644 index 0000000..a04dd5f --- /dev/null +++ b/src/views/device/standingBook/components/templateAdd.vue @@ -0,0 +1,133 @@ + + + + + + + + + {{ name }} -{{ title }} + + + + 保存 + + + 关闭 + + + + + + + + {{ item.name }} + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue new file mode 100644 index 0000000..604026c --- /dev/null +++ b/src/views/device/standingBook/components/templatePage.vue @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 标签识别 + + + 批量导入 + + + 模板下载 + + + 新建 + + + 导出 + + + 打印 + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + 编辑 + + + 详情 + + + 删除 + + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templateTable.vue b/src/views/device/standingBook/components/templateTable.vue new file mode 100644 index 0000000..faf4da1 --- /dev/null +++ b/src/views/device/standingBook/components/templateTable.vue @@ -0,0 +1,208 @@ + + + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index 9f871d8..7538bc8 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -2,6 +2,7 @@ - - 测量设备 - + diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 7a41e7c..f46553a 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -3,17 +3,17 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { deptType, selectType } from '../standingBook-interface' -import useUserStore from '@/store/modules/user' import showPhoto from '@/views/system/tool/showPhoto.vue' import { UploadFile } from '@/api/measure/file' import { getDictByCode } from '@/api/system/dict' import { getUserList } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' +import comTreeSelect from '@/views/system/user/selecTree.vue' +import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { assetsAddApi, assetsDetailApi, assetsUpdateApi } from '@/api/device/standingBook' const emits = defineEmits(['resetData']) const ruleFormRef = ref() // from组件 -const userInfo = useUserStore() // 当前用户信息 const dialogVisible = ref(true) const title = ref('') const ruleForm = ref({ @@ -70,7 +70,17 @@ id: '', }) // 表单 const rules = ref({ - // fileName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], + assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], + equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], + manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], + manufacturingNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }], + manufacturingDate: [{ required: true, message: '出厂日期不能为空', trigger: 'blur' }], + modelNo: [{ required: true, message: '型号不能为空', trigger: 'blur' }], + abc: [{ required: true, message: 'ABC不能为空', trigger: 'blur' }], + cardEstablishmentDate: [{ required: true, message: '立卡年月不能为空', trigger: 'blur' }], + enableDate: [{ required: true, message: '启用日期不能为空', trigger: 'blur' }], + mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], + validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC @@ -82,18 +92,55 @@ const managerLevelList = ref([]) // 管理级别 const depreciationMethodList = ref([]) // 折旧方法 const managerStateList = ref([]) // 管理状态 +const capitalSourceList = ref([]) // 资本来源 const usePersonList = ref([]) // 使用人列表 const useDeptList = ref([]) // 使用部门列表 const isWhether = ref([ { name: '是', id: 'shi', - value: '0', + value: '1', }, { name: '否', id: 'fou', - value: '1', + value: '0', + }, +]) +const deptProps = reactive({ + parent: 'pid', value: 'id', label: 'name', children: 'children', +}) +// 检定周期 +const mesureCycleList = ref([ + { + name: '半年一检', + id: '1', + value: '6', + }, + { + name: '一年一检', + id: '2', + value: '12', + }, + { + name: '两年一检', + id: '3', + value: '24', + }, + { + name: '三年一检', + id: '4', + value: '36', + }, + { + name: '四年一检', + id: '5', + value: '48', + }, + { + name: '五年一检', + id: '6', + value: '60', }, ]) // 获取下拉框数 @@ -138,6 +185,10 @@ getDictByCode('managerState').then((response) => { managerStateList.value = response.data }) + // 获取资本来源 + getDictByCode('capitalSource').then((response) => { + capitalSourceList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 99999 }).then((res) => { usePersonList.value = res.data.rows @@ -145,7 +196,7 @@ // 获取部门列表 getDeptTreeList().then((res) => { // 转成树结构 - useDeptList.value = res.data + useDeptList.value = toTreeList(res.data, '0', true) }) } // 重置 @@ -212,6 +263,11 @@ // 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 }) } @@ -237,9 +293,13 @@ }, ).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('操作成功') dialogVisible.value = false close() emits('resetData') @@ -274,7 +334,7 @@ assetId: '', fileName: res.data[0], minioFileName: res.data[0], - id: '', + // id: '', }) ruleFormRef.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') @@ -323,7 +383,7 @@ - + @@ -335,33 +395,33 @@ - + - + - + - + - + @@ -370,26 +430,26 @@ - + - + - + - + 扫描 @@ -404,7 +464,7 @@ @@ -413,22 +473,22 @@ - + - - + + @@ -436,33 +496,38 @@ - + - + - + + - + - + @@ -471,8 +536,16 @@ - + + + + @@ -480,7 +553,7 @@ @@ -489,14 +562,14 @@ - + @@ -505,21 +578,21 @@ - + - + - + @@ -529,24 +602,24 @@ - + - + - + - + @@ -556,77 +629,77 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,6 +738,7 @@ {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + 暂无 diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue new file mode 100644 index 0000000..a04dd5f --- /dev/null +++ b/src/views/device/standingBook/components/templateAdd.vue @@ -0,0 +1,133 @@ + + + + + + + + + {{ name }} -{{ title }} + + + + 保存 + + + 关闭 + + + + + + + + {{ item.name }} + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue new file mode 100644 index 0000000..604026c --- /dev/null +++ b/src/views/device/standingBook/components/templatePage.vue @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 标签识别 + + + 批量导入 + + + 模板下载 + + + 新建 + + + 导出 + + + 打印 + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + 编辑 + + + 详情 + + + 删除 + + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templateTable.vue b/src/views/device/standingBook/components/templateTable.vue new file mode 100644 index 0000000..faf4da1 --- /dev/null +++ b/src/views/device/standingBook/components/templateTable.vue @@ -0,0 +1,208 @@ + + + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index 9f871d8..7538bc8 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -2,6 +2,7 @@ - - 测量设备 - + diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 7a41e7c..f46553a 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -3,17 +3,17 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { deptType, selectType } from '../standingBook-interface' -import useUserStore from '@/store/modules/user' import showPhoto from '@/views/system/tool/showPhoto.vue' import { UploadFile } from '@/api/measure/file' import { getDictByCode } from '@/api/system/dict' import { getUserList } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' +import comTreeSelect from '@/views/system/user/selecTree.vue' +import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { assetsAddApi, assetsDetailApi, assetsUpdateApi } from '@/api/device/standingBook' const emits = defineEmits(['resetData']) const ruleFormRef = ref() // from组件 -const userInfo = useUserStore() // 当前用户信息 const dialogVisible = ref(true) const title = ref('') const ruleForm = ref({ @@ -70,7 +70,17 @@ id: '', }) // 表单 const rules = ref({ - // fileName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], + assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], + equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], + manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], + manufacturingNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }], + manufacturingDate: [{ required: true, message: '出厂日期不能为空', trigger: 'blur' }], + modelNo: [{ required: true, message: '型号不能为空', trigger: 'blur' }], + abc: [{ required: true, message: 'ABC不能为空', trigger: 'blur' }], + cardEstablishmentDate: [{ required: true, message: '立卡年月不能为空', trigger: 'blur' }], + enableDate: [{ required: true, message: '启用日期不能为空', trigger: 'blur' }], + mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], + validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC @@ -82,18 +92,55 @@ const managerLevelList = ref([]) // 管理级别 const depreciationMethodList = ref([]) // 折旧方法 const managerStateList = ref([]) // 管理状态 +const capitalSourceList = ref([]) // 资本来源 const usePersonList = ref([]) // 使用人列表 const useDeptList = ref([]) // 使用部门列表 const isWhether = ref([ { name: '是', id: 'shi', - value: '0', + value: '1', }, { name: '否', id: 'fou', - value: '1', + value: '0', + }, +]) +const deptProps = reactive({ + parent: 'pid', value: 'id', label: 'name', children: 'children', +}) +// 检定周期 +const mesureCycleList = ref([ + { + name: '半年一检', + id: '1', + value: '6', + }, + { + name: '一年一检', + id: '2', + value: '12', + }, + { + name: '两年一检', + id: '3', + value: '24', + }, + { + name: '三年一检', + id: '4', + value: '36', + }, + { + name: '四年一检', + id: '5', + value: '48', + }, + { + name: '五年一检', + id: '6', + value: '60', }, ]) // 获取下拉框数 @@ -138,6 +185,10 @@ getDictByCode('managerState').then((response) => { managerStateList.value = response.data }) + // 获取资本来源 + getDictByCode('capitalSource').then((response) => { + capitalSourceList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 99999 }).then((res) => { usePersonList.value = res.data.rows @@ -145,7 +196,7 @@ // 获取部门列表 getDeptTreeList().then((res) => { // 转成树结构 - useDeptList.value = res.data + useDeptList.value = toTreeList(res.data, '0', true) }) } // 重置 @@ -212,6 +263,11 @@ // 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 }) } @@ -237,9 +293,13 @@ }, ).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('操作成功') dialogVisible.value = false close() emits('resetData') @@ -274,7 +334,7 @@ assetId: '', fileName: res.data[0], minioFileName: res.data[0], - id: '', + // id: '', }) ruleFormRef.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') @@ -323,7 +383,7 @@ - + @@ -335,33 +395,33 @@ - + - + - + - + - + @@ -370,26 +430,26 @@ - + - + - + - + 扫描 @@ -404,7 +464,7 @@ @@ -413,22 +473,22 @@ - + - - + + @@ -436,33 +496,38 @@ - + - + - + + - + - + @@ -471,8 +536,16 @@ - + + + + @@ -480,7 +553,7 @@ @@ -489,14 +562,14 @@ - + @@ -505,21 +578,21 @@ - + - + - + @@ -529,24 +602,24 @@ - + - + - + - + @@ -556,77 +629,77 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,6 +738,7 @@ {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + 暂无 diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue new file mode 100644 index 0000000..a04dd5f --- /dev/null +++ b/src/views/device/standingBook/components/templateAdd.vue @@ -0,0 +1,133 @@ + + + + + + + + + {{ name }} -{{ title }} + + + + 保存 + + + 关闭 + + + + + + + + {{ item.name }} + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue new file mode 100644 index 0000000..604026c --- /dev/null +++ b/src/views/device/standingBook/components/templatePage.vue @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 标签识别 + + + 批量导入 + + + 模板下载 + + + 新建 + + + 导出 + + + 打印 + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + 编辑 + + + 详情 + + + 删除 + + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templateTable.vue b/src/views/device/standingBook/components/templateTable.vue new file mode 100644 index 0000000..faf4da1 --- /dev/null +++ b/src/views/device/standingBook/components/templateTable.vue @@ -0,0 +1,208 @@ + + + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index 9f871d8..7538bc8 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -2,6 +2,7 @@ - - 测量设备 - + diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 7a41e7c..f46553a 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -3,17 +3,17 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { deptType, selectType } from '../standingBook-interface' -import useUserStore from '@/store/modules/user' import showPhoto from '@/views/system/tool/showPhoto.vue' import { UploadFile } from '@/api/measure/file' import { getDictByCode } from '@/api/system/dict' import { getUserList } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' +import comTreeSelect from '@/views/system/user/selecTree.vue' +import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { assetsAddApi, assetsDetailApi, assetsUpdateApi } from '@/api/device/standingBook' const emits = defineEmits(['resetData']) const ruleFormRef = ref() // from组件 -const userInfo = useUserStore() // 当前用户信息 const dialogVisible = ref(true) const title = ref('') const ruleForm = ref({ @@ -70,7 +70,17 @@ id: '', }) // 表单 const rules = ref({ - // fileName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], + assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], + equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], + manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], + manufacturingNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }], + manufacturingDate: [{ required: true, message: '出厂日期不能为空', trigger: 'blur' }], + modelNo: [{ required: true, message: '型号不能为空', trigger: 'blur' }], + abc: [{ required: true, message: 'ABC不能为空', trigger: 'blur' }], + cardEstablishmentDate: [{ required: true, message: '立卡年月不能为空', trigger: 'blur' }], + enableDate: [{ required: true, message: '启用日期不能为空', trigger: 'blur' }], + mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], + validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC @@ -82,18 +92,55 @@ const managerLevelList = ref([]) // 管理级别 const depreciationMethodList = ref([]) // 折旧方法 const managerStateList = ref([]) // 管理状态 +const capitalSourceList = ref([]) // 资本来源 const usePersonList = ref([]) // 使用人列表 const useDeptList = ref([]) // 使用部门列表 const isWhether = ref([ { name: '是', id: 'shi', - value: '0', + value: '1', }, { name: '否', id: 'fou', - value: '1', + value: '0', + }, +]) +const deptProps = reactive({ + parent: 'pid', value: 'id', label: 'name', children: 'children', +}) +// 检定周期 +const mesureCycleList = ref([ + { + name: '半年一检', + id: '1', + value: '6', + }, + { + name: '一年一检', + id: '2', + value: '12', + }, + { + name: '两年一检', + id: '3', + value: '24', + }, + { + name: '三年一检', + id: '4', + value: '36', + }, + { + name: '四年一检', + id: '5', + value: '48', + }, + { + name: '五年一检', + id: '6', + value: '60', }, ]) // 获取下拉框数 @@ -138,6 +185,10 @@ getDictByCode('managerState').then((response) => { managerStateList.value = response.data }) + // 获取资本来源 + getDictByCode('capitalSource').then((response) => { + capitalSourceList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 99999 }).then((res) => { usePersonList.value = res.data.rows @@ -145,7 +196,7 @@ // 获取部门列表 getDeptTreeList().then((res) => { // 转成树结构 - useDeptList.value = res.data + useDeptList.value = toTreeList(res.data, '0', true) }) } // 重置 @@ -212,6 +263,11 @@ // 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 }) } @@ -237,9 +293,13 @@ }, ).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('操作成功') dialogVisible.value = false close() emits('resetData') @@ -274,7 +334,7 @@ assetId: '', fileName: res.data[0], minioFileName: res.data[0], - id: '', + // id: '', }) ruleFormRef.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') @@ -323,7 +383,7 @@ - + @@ -335,33 +395,33 @@ - + - + - + - + - + @@ -370,26 +430,26 @@ - + - + - + - + 扫描 @@ -404,7 +464,7 @@ @@ -413,22 +473,22 @@ - + - - + + @@ -436,33 +496,38 @@ - + - + - + + - + - + @@ -471,8 +536,16 @@ - + + + + @@ -480,7 +553,7 @@ @@ -489,14 +562,14 @@ - + @@ -505,21 +578,21 @@ - + - + - + @@ -529,24 +602,24 @@ - + - + - + - + @@ -556,77 +629,77 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,6 +738,7 @@ {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + 暂无 diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue new file mode 100644 index 0000000..a04dd5f --- /dev/null +++ b/src/views/device/standingBook/components/templateAdd.vue @@ -0,0 +1,133 @@ + + + + + + + + + {{ name }} -{{ title }} + + + + 保存 + + + 关闭 + + + + + + + + {{ item.name }} + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue new file mode 100644 index 0000000..604026c --- /dev/null +++ b/src/views/device/standingBook/components/templatePage.vue @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 标签识别 + + + 批量导入 + + + 模板下载 + + + 新建 + + + 导出 + + + 打印 + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + 编辑 + + + 详情 + + + 删除 + + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templateTable.vue b/src/views/device/standingBook/components/templateTable.vue new file mode 100644 index 0000000..faf4da1 --- /dev/null +++ b/src/views/device/standingBook/components/templateTable.vue @@ -0,0 +1,208 @@ + + + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index 9f871d8..7538bc8 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -2,6 +2,7 @@ - - 测量设备 - + diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 7a41e7c..f46553a 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -3,17 +3,17 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { deptType, selectType } from '../standingBook-interface' -import useUserStore from '@/store/modules/user' import showPhoto from '@/views/system/tool/showPhoto.vue' import { UploadFile } from '@/api/measure/file' import { getDictByCode } from '@/api/system/dict' import { getUserList } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' +import comTreeSelect from '@/views/system/user/selecTree.vue' +import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { assetsAddApi, assetsDetailApi, assetsUpdateApi } from '@/api/device/standingBook' const emits = defineEmits(['resetData']) const ruleFormRef = ref() // from组件 -const userInfo = useUserStore() // 当前用户信息 const dialogVisible = ref(true) const title = ref('') const ruleForm = ref({ @@ -70,7 +70,17 @@ id: '', }) // 表单 const rules = ref({ - // fileName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], + assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], + equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], + manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], + manufacturingNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }], + manufacturingDate: [{ required: true, message: '出厂日期不能为空', trigger: 'blur' }], + modelNo: [{ required: true, message: '型号不能为空', trigger: 'blur' }], + abc: [{ required: true, message: 'ABC不能为空', trigger: 'blur' }], + cardEstablishmentDate: [{ required: true, message: '立卡年月不能为空', trigger: 'blur' }], + enableDate: [{ required: true, message: '启用日期不能为空', trigger: 'blur' }], + mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], + validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC @@ -82,18 +92,55 @@ const managerLevelList = ref([]) // 管理级别 const depreciationMethodList = ref([]) // 折旧方法 const managerStateList = ref([]) // 管理状态 +const capitalSourceList = ref([]) // 资本来源 const usePersonList = ref([]) // 使用人列表 const useDeptList = ref([]) // 使用部门列表 const isWhether = ref([ { name: '是', id: 'shi', - value: '0', + value: '1', }, { name: '否', id: 'fou', - value: '1', + value: '0', + }, +]) +const deptProps = reactive({ + parent: 'pid', value: 'id', label: 'name', children: 'children', +}) +// 检定周期 +const mesureCycleList = ref([ + { + name: '半年一检', + id: '1', + value: '6', + }, + { + name: '一年一检', + id: '2', + value: '12', + }, + { + name: '两年一检', + id: '3', + value: '24', + }, + { + name: '三年一检', + id: '4', + value: '36', + }, + { + name: '四年一检', + id: '5', + value: '48', + }, + { + name: '五年一检', + id: '6', + value: '60', }, ]) // 获取下拉框数 @@ -138,6 +185,10 @@ getDictByCode('managerState').then((response) => { managerStateList.value = response.data }) + // 获取资本来源 + getDictByCode('capitalSource').then((response) => { + capitalSourceList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 99999 }).then((res) => { usePersonList.value = res.data.rows @@ -145,7 +196,7 @@ // 获取部门列表 getDeptTreeList().then((res) => { // 转成树结构 - useDeptList.value = res.data + useDeptList.value = toTreeList(res.data, '0', true) }) } // 重置 @@ -212,6 +263,11 @@ // 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 }) } @@ -237,9 +293,13 @@ }, ).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('操作成功') dialogVisible.value = false close() emits('resetData') @@ -274,7 +334,7 @@ assetId: '', fileName: res.data[0], minioFileName: res.data[0], - id: '', + // id: '', }) ruleFormRef.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') @@ -323,7 +383,7 @@ - + @@ -335,33 +395,33 @@ - + - + - + - + - + @@ -370,26 +430,26 @@ - + - + - + - + 扫描 @@ -404,7 +464,7 @@ @@ -413,22 +473,22 @@ - + - - + + @@ -436,33 +496,38 @@ - + - + - + + - + - + @@ -471,8 +536,16 @@ - + + + + @@ -480,7 +553,7 @@ @@ -489,14 +562,14 @@ - + @@ -505,21 +578,21 @@ - + - + - + @@ -529,24 +602,24 @@ - + - + - + - + @@ -556,77 +629,77 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,6 +738,7 @@ {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + 暂无 diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue new file mode 100644 index 0000000..a04dd5f --- /dev/null +++ b/src/views/device/standingBook/components/templateAdd.vue @@ -0,0 +1,133 @@ + + + + + + + + + {{ name }} -{{ title }} + + + + 保存 + + + 关闭 + + + + + + + + {{ item.name }} + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue new file mode 100644 index 0000000..604026c --- /dev/null +++ b/src/views/device/standingBook/components/templatePage.vue @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 标签识别 + + + 批量导入 + + + 模板下载 + + + 新建 + + + 导出 + + + 打印 + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + 编辑 + + + 详情 + + + 删除 + + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templateTable.vue b/src/views/device/standingBook/components/templateTable.vue new file mode 100644 index 0000000..faf4da1 --- /dev/null +++ b/src/views/device/standingBook/components/templateTable.vue @@ -0,0 +1,208 @@ + + + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index 9f871d8..7538bc8 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -2,6 +2,7 @@ - - 测量设备 - + diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 7a41e7c..f46553a 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -3,17 +3,17 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { deptType, selectType } from '../standingBook-interface' -import useUserStore from '@/store/modules/user' import showPhoto from '@/views/system/tool/showPhoto.vue' import { UploadFile } from '@/api/measure/file' import { getDictByCode } from '@/api/system/dict' import { getUserList } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' +import comTreeSelect from '@/views/system/user/selecTree.vue' +import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { assetsAddApi, assetsDetailApi, assetsUpdateApi } from '@/api/device/standingBook' const emits = defineEmits(['resetData']) const ruleFormRef = ref() // from组件 -const userInfo = useUserStore() // 当前用户信息 const dialogVisible = ref(true) const title = ref('') const ruleForm = ref({ @@ -70,7 +70,17 @@ id: '', }) // 表单 const rules = ref({ - // fileName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], + assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], + equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], + manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], + manufacturingNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }], + manufacturingDate: [{ required: true, message: '出厂日期不能为空', trigger: 'blur' }], + modelNo: [{ required: true, message: '型号不能为空', trigger: 'blur' }], + abc: [{ required: true, message: 'ABC不能为空', trigger: 'blur' }], + cardEstablishmentDate: [{ required: true, message: '立卡年月不能为空', trigger: 'blur' }], + enableDate: [{ required: true, message: '启用日期不能为空', trigger: 'blur' }], + mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], + validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC @@ -82,18 +92,55 @@ const managerLevelList = ref([]) // 管理级别 const depreciationMethodList = ref([]) // 折旧方法 const managerStateList = ref([]) // 管理状态 +const capitalSourceList = ref([]) // 资本来源 const usePersonList = ref([]) // 使用人列表 const useDeptList = ref([]) // 使用部门列表 const isWhether = ref([ { name: '是', id: 'shi', - value: '0', + value: '1', }, { name: '否', id: 'fou', - value: '1', + value: '0', + }, +]) +const deptProps = reactive({ + parent: 'pid', value: 'id', label: 'name', children: 'children', +}) +// 检定周期 +const mesureCycleList = ref([ + { + name: '半年一检', + id: '1', + value: '6', + }, + { + name: '一年一检', + id: '2', + value: '12', + }, + { + name: '两年一检', + id: '3', + value: '24', + }, + { + name: '三年一检', + id: '4', + value: '36', + }, + { + name: '四年一检', + id: '5', + value: '48', + }, + { + name: '五年一检', + id: '6', + value: '60', }, ]) // 获取下拉框数 @@ -138,6 +185,10 @@ getDictByCode('managerState').then((response) => { managerStateList.value = response.data }) + // 获取资本来源 + getDictByCode('capitalSource').then((response) => { + capitalSourceList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 99999 }).then((res) => { usePersonList.value = res.data.rows @@ -145,7 +196,7 @@ // 获取部门列表 getDeptTreeList().then((res) => { // 转成树结构 - useDeptList.value = res.data + useDeptList.value = toTreeList(res.data, '0', true) }) } // 重置 @@ -212,6 +263,11 @@ // 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 }) } @@ -237,9 +293,13 @@ }, ).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('操作成功') dialogVisible.value = false close() emits('resetData') @@ -274,7 +334,7 @@ assetId: '', fileName: res.data[0], minioFileName: res.data[0], - id: '', + // id: '', }) ruleFormRef.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') @@ -323,7 +383,7 @@ - + @@ -335,33 +395,33 @@ - + - + - + - + - + @@ -370,26 +430,26 @@ - + - + - + - + 扫描 @@ -404,7 +464,7 @@ @@ -413,22 +473,22 @@ - + - - + + @@ -436,33 +496,38 @@ - + - + - + + - + - + @@ -471,8 +536,16 @@ - + + + + @@ -480,7 +553,7 @@ @@ -489,14 +562,14 @@ - + @@ -505,21 +578,21 @@ - + - + - + @@ -529,24 +602,24 @@ - + - + - + - + @@ -556,77 +629,77 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,6 +738,7 @@ {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + 暂无 diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue new file mode 100644 index 0000000..a04dd5f --- /dev/null +++ b/src/views/device/standingBook/components/templateAdd.vue @@ -0,0 +1,133 @@ + + + + + + + + + {{ name }} -{{ title }} + + + + 保存 + + + 关闭 + + + + + + + + {{ item.name }} + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue new file mode 100644 index 0000000..604026c --- /dev/null +++ b/src/views/device/standingBook/components/templatePage.vue @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 标签识别 + + + 批量导入 + + + 模板下载 + + + 新建 + + + 导出 + + + 打印 + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + 编辑 + + + 详情 + + + 删除 + + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templateTable.vue b/src/views/device/standingBook/components/templateTable.vue new file mode 100644 index 0000000..faf4da1 --- /dev/null +++ b/src/views/device/standingBook/components/templateTable.vue @@ -0,0 +1,208 @@ + + + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index 9f871d8..7538bc8 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -2,6 +2,7 @@ - - 测量设备 - + diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 7a41e7c..f46553a 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -3,17 +3,17 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { deptType, selectType } from '../standingBook-interface' -import useUserStore from '@/store/modules/user' import showPhoto from '@/views/system/tool/showPhoto.vue' import { UploadFile } from '@/api/measure/file' import { getDictByCode } from '@/api/system/dict' import { getUserList } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' +import comTreeSelect from '@/views/system/user/selecTree.vue' +import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { assetsAddApi, assetsDetailApi, assetsUpdateApi } from '@/api/device/standingBook' const emits = defineEmits(['resetData']) const ruleFormRef = ref() // from组件 -const userInfo = useUserStore() // 当前用户信息 const dialogVisible = ref(true) const title = ref('') const ruleForm = ref({ @@ -70,7 +70,17 @@ id: '', }) // 表单 const rules = ref({ - // fileName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], + assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], + equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], + manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], + manufacturingNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }], + manufacturingDate: [{ required: true, message: '出厂日期不能为空', trigger: 'blur' }], + modelNo: [{ required: true, message: '型号不能为空', trigger: 'blur' }], + abc: [{ required: true, message: 'ABC不能为空', trigger: 'blur' }], + cardEstablishmentDate: [{ required: true, message: '立卡年月不能为空', trigger: 'blur' }], + enableDate: [{ required: true, message: '启用日期不能为空', trigger: 'blur' }], + mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], + validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC @@ -82,18 +92,55 @@ const managerLevelList = ref([]) // 管理级别 const depreciationMethodList = ref([]) // 折旧方法 const managerStateList = ref([]) // 管理状态 +const capitalSourceList = ref([]) // 资本来源 const usePersonList = ref([]) // 使用人列表 const useDeptList = ref([]) // 使用部门列表 const isWhether = ref([ { name: '是', id: 'shi', - value: '0', + value: '1', }, { name: '否', id: 'fou', - value: '1', + value: '0', + }, +]) +const deptProps = reactive({ + parent: 'pid', value: 'id', label: 'name', children: 'children', +}) +// 检定周期 +const mesureCycleList = ref([ + { + name: '半年一检', + id: '1', + value: '6', + }, + { + name: '一年一检', + id: '2', + value: '12', + }, + { + name: '两年一检', + id: '3', + value: '24', + }, + { + name: '三年一检', + id: '4', + value: '36', + }, + { + name: '四年一检', + id: '5', + value: '48', + }, + { + name: '五年一检', + id: '6', + value: '60', }, ]) // 获取下拉框数 @@ -138,6 +185,10 @@ getDictByCode('managerState').then((response) => { managerStateList.value = response.data }) + // 获取资本来源 + getDictByCode('capitalSource').then((response) => { + capitalSourceList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 99999 }).then((res) => { usePersonList.value = res.data.rows @@ -145,7 +196,7 @@ // 获取部门列表 getDeptTreeList().then((res) => { // 转成树结构 - useDeptList.value = res.data + useDeptList.value = toTreeList(res.data, '0', true) }) } // 重置 @@ -212,6 +263,11 @@ // 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 }) } @@ -237,9 +293,13 @@ }, ).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('操作成功') dialogVisible.value = false close() emits('resetData') @@ -274,7 +334,7 @@ assetId: '', fileName: res.data[0], minioFileName: res.data[0], - id: '', + // id: '', }) ruleFormRef.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') @@ -323,7 +383,7 @@ - + @@ -335,33 +395,33 @@ - + - + - + - + - + @@ -370,26 +430,26 @@ - + - + - + - + 扫描 @@ -404,7 +464,7 @@ @@ -413,22 +473,22 @@ - + - - + + @@ -436,33 +496,38 @@ - + - + - + + - + - + @@ -471,8 +536,16 @@ - + + + + @@ -480,7 +553,7 @@ @@ -489,14 +562,14 @@ - + @@ -505,21 +578,21 @@ - + - + - + @@ -529,24 +602,24 @@ - + - + - + - + @@ -556,77 +629,77 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,6 +738,7 @@ {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + 暂无 diff --git a/src/views/device/standingBook/components/templateAdd.vue b/src/views/device/standingBook/components/templateAdd.vue new file mode 100644 index 0000000..a04dd5f --- /dev/null +++ b/src/views/device/standingBook/components/templateAdd.vue @@ -0,0 +1,133 @@ + + + + + + + + + {{ name }} -{{ title }} + + + + 保存 + + + 关闭 + + + + + + + + {{ item.name }} + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templatePage.vue b/src/views/device/standingBook/components/templatePage.vue new file mode 100644 index 0000000..604026c --- /dev/null +++ b/src/views/device/standingBook/components/templatePage.vue @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 标签识别 + + + 批量导入 + + + 模板下载 + + + 新建 + + + 导出 + + + 打印 + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + 编辑 + + + 详情 + + + 删除 + + + + + + + + + + + diff --git a/src/views/device/standingBook/components/templateTable.vue b/src/views/device/standingBook/components/templateTable.vue new file mode 100644 index 0000000..faf4da1 --- /dev/null +++ b/src/views/device/standingBook/components/templateTable.vue @@ -0,0 +1,208 @@ + + + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + + + + diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index 9f871d8..7538bc8 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -2,6 +2,7 @@ - - 测量设备 - +