diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index ea79535..8771c29 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -1,10 +1,34 @@ // 状态管理相关接口api import request from '../index' // 设备申请列表 -export function getApplyList(data: any) { +export function getStatusList(data: any) { return request({ url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) } +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index ea79535..8771c29 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -1,10 +1,34 @@ // 状态管理相关接口api import request from '../index' // 设备申请列表 -export function getApplyList(data: any) { +export function getStatusList(data: any) { return request({ url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) } +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index ea79535..8771c29 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -1,10 +1,34 @@ // 状态管理相关接口api import request from '../index' // 设备申请列表 -export function getApplyList(data: any) { +export function getStatusList(data: any) { return request({ url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) } +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 35f3dec..240fffa 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -165,6 +165,7 @@ title: '详情', name: '设备借用申请', approvalStatus: props.type, + approvalStatusName: row.approvalStatusName, }, }) } @@ -378,7 +379,7 @@ diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index ea79535..8771c29 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -1,10 +1,34 @@ // 状态管理相关接口api import request from '../index' // 设备申请列表 -export function getApplyList(data: any) { +export function getStatusList(data: any) { return request({ url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) } +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 35f3dec..240fffa 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -165,6 +165,7 @@ title: '详情', name: '设备借用申请', approvalStatus: props.type, + approvalStatusName: row.approvalStatusName, }, }) } @@ -378,7 +379,7 @@ diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 755138a..f272ff7 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -8,7 +8,6 @@ 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' @@ -116,41 +115,14 @@ }, ]) // 检定周期 -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', - }, -]) +const mesureCycleList = ref() // 获取下拉框数 const fetchData = () => { -// 获取资产类型 + // 获取检定周期 + getDictByCode('mesureCycle').then((response) => { + mesureCycleList.value = response.data + }) + // 获取资产类型 getDictByCode('assetType').then((response) => { assetTypeList.value = response.data }) diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index ea79535..8771c29 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -1,10 +1,34 @@ // 状态管理相关接口api import request from '../index' // 设备申请列表 -export function getApplyList(data: any) { +export function getStatusList(data: any) { return request({ url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) } +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 35f3dec..240fffa 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -165,6 +165,7 @@ title: '详情', name: '设备借用申请', approvalStatus: props.type, + approvalStatusName: row.approvalStatusName, }, }) } @@ -378,7 +379,7 @@ diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 755138a..f272ff7 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -8,7 +8,6 @@ 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' @@ -116,41 +115,14 @@ }, ]) // 检定周期 -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', - }, -]) +const mesureCycleList = ref() // 获取下拉框数 const fetchData = () => { -// 获取资产类型 + // 获取检定周期 + getDictByCode('mesureCycle').then((response) => { + mesureCycleList.value = response.data + }) + // 获取资产类型 getDictByCode('assetType').then((response) => { assetTypeList.value = response.data }) diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index e220eb5..d0b26b6 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -24,61 +24,51 @@ { text: '固定资产编号', value: 'assetNo', - width: '180', align: 'center', }, { text: '设备名称', value: 'equipmentName', - width: '150', align: 'center', }, { text: '型号', value: 'modelNo', - width: '150', align: 'center', }, { text: '设备规格', value: 'equipmentSpecifications', - width: '150', align: 'center', }, { text: '设备类别', value: 'equipmentCategoryName', - width: '150', align: 'center', }, { text: '设备类型', value: 'equipmentTypeName', - width: '150', align: 'center', }, { text: '用途', value: 'purpose', - width: '150', align: 'center', }, { text: '管理级别', value: 'managerLevelName', - width: '150', align: 'center', }, { text: '使用单位', value: 'useDeptName', - width: '150', align: 'center', }, { text: '创建时间', value: 'createTime', - width: '180', align: 'center', }, ]) // 表格 @@ -103,7 +93,6 @@ extarCss: '', }) const list = ref([]) // 表格数据 -const addRef = ref() // 添加/编辑/详情/组件 const dialogVisible = ref(false) // 添加组件的显示与隐藏 const equipmentCategoryList = ref([]) // 设备类别 // 获取数据列表 diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index ea79535..8771c29 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -1,10 +1,34 @@ // 状态管理相关接口api import request from '../index' // 设备申请列表 -export function getApplyList(data: any) { +export function getStatusList(data: any) { return request({ url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) } +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 35f3dec..240fffa 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -165,6 +165,7 @@ title: '详情', name: '设备借用申请', approvalStatus: props.type, + approvalStatusName: row.approvalStatusName, }, }) } @@ -378,7 +379,7 @@ diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 755138a..f272ff7 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -8,7 +8,6 @@ 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' @@ -116,41 +115,14 @@ }, ]) // 检定周期 -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', - }, -]) +const mesureCycleList = ref() // 获取下拉框数 const fetchData = () => { -// 获取资产类型 + // 获取检定周期 + getDictByCode('mesureCycle').then((response) => { + mesureCycleList.value = response.data + }) + // 获取资产类型 getDictByCode('assetType').then((response) => { assetTypeList.value = response.data }) diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index e220eb5..d0b26b6 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -24,61 +24,51 @@ { text: '固定资产编号', value: 'assetNo', - width: '180', align: 'center', }, { text: '设备名称', value: 'equipmentName', - width: '150', align: 'center', }, { text: '型号', value: 'modelNo', - width: '150', align: 'center', }, { text: '设备规格', value: 'equipmentSpecifications', - width: '150', align: 'center', }, { text: '设备类别', value: 'equipmentCategoryName', - width: '150', align: 'center', }, { text: '设备类型', value: 'equipmentTypeName', - width: '150', align: 'center', }, { text: '用途', value: 'purpose', - width: '150', align: 'center', }, { text: '管理级别', value: 'managerLevelName', - width: '150', align: 'center', }, { text: '使用单位', value: 'useDeptName', - width: '150', align: 'center', }, { text: '创建时间', value: 'createTime', - width: '180', align: 'center', }, ]) // 表格 @@ -103,7 +93,6 @@ extarCss: '', }) const list = ref([]) // 表格数据 -const addRef = ref() // 添加/编辑/详情/组件 const dialogVisible = ref(false) // 添加组件的显示与隐藏 const equipmentCategoryList = ref([]) // 设备类别 // 获取数据列表 diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 7ab7c18..2f7cf28 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -13,6 +13,7 @@ import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { addApply, deleteApply, detailApply, editApply } from '@/api/device/borrow' +import { addStatus } from '@/api/device/stateManage' import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface' import useUserStore from '@/store/modules/user' const userInfo = useUserStore() @@ -24,56 +25,18 @@ const name = ref('') const borrowList = ref([]) const ruleForm1 = ref({ - assetNo: '', // 资产编号 - assetType: '', // 资产类型 - assetSource: '', // 资产来源 + applyDesc: '', // 申请说明 + time: '', // 时间 + fileList: [] as any[], // 说明书 + applyUnit: '', // 申请单位 + applyPerson: '', // 申请人 equipmentNo: '', // 设备编号 equipmentName: '', // 设备名称 - labelBind: '', // 标签绑定 modelNo: '', // 型号 equipmentSpecifications: '', // 设备规格 - equipmentType: '', // 设备类型 - equipmentCategory: '', // 设备类别 - capitalSource: '', // 资本来源 - managerLevel: '', // 管理级别 - purpose: '', // 用途 - technicalLevel: '', // 技术水平 - intactState: '', // 完好状态 - manufacturerCountry: '', // 厂家国别 - manufacturer: '', // 生产厂家 - overallDimension: '', // 外形尺寸 manufacturingNo: '', // 出厂编号 - manufacturingDate: '', // 出厂年月 - cardEstablishmentDate: '', // 立卡年月 - weight: '', // 重量 - enableDate: '', // 启用年月 - singlePrice: '', // 单价 - installIncidentalExpenses: '', // 安装及杂费 - originValue: '', // 原值 - useDept: '', // 使用部门 - installPlace: '', // 安装地点 - createUser: '', // 创建人/负责人 - depreciationPeriod: '', // 折旧年限 - depreciationMethod: '', // 折旧方法 - attribute: '', // 属性 - majorCategory: '', // 专业分类 - presentOriginValue: '', // 目前原值 - managerState: '1', // 管理状态 - fileList: [] as any[], // 说明书 - remark: '', // 备注 - mesureType: '', // 检定方式 - mesureRange: '', // 测量范围 - uncertainty: '', // 不确定度 - usePerson: '', // 使用人 - mesureDept: '', // 检定部门 - mesureCycle: '', // 检定周期 - mesureDate: '', // 检定日期 - validDate: '', // 有效日期 - mesureResult: '', // 检定结果 - abc: '', // ABC - isCalibrationTestEquipment: '', // 是否是技术指标需要校准检定的设备 - isMeasureAccount: '', // 是否是测量工装台账 - isStandardSupportEquipment: '', // 是否标准配套设备 + manufacturer: '', // 生产厂家 + equipmentList: [], id: '', }) // 表单 const ruleForm2 = ref({ @@ -224,62 +187,6 @@ useDeptListNoTree.value = res.data }) } -// 重置 -const resetDATA = () => { - ruleForm1.value = { - assetNo: '', // 资产编号 - assetType: '', // 资产类型 - assetSource: '', // 资产来源 - equipmentNo: '', // 设备编号 - equipmentName: '', // 设备名称 - labelBind: '', // 标签绑定 - modelNo: '', // 型号 - equipmentSpecifications: '', // 设备规格 - equipmentType: '', // 设备类型 - equipmentCategory: '', // 设备类别 - capitalSource: '', // 资本来源 - managerLevel: '', // 管理级别 - purpose: '', // 用途 - technicalLevel: '', // 技术水平 - intactState: '', // 完好状态 - manufacturerCountry: '', // 厂家国别 - manufacturer: '', // 生产厂家 - overallDimension: '', // 外形尺寸 - manufacturingNo: '', // 出厂编号 - manufacturingDate: '', // 出厂年月 - cardEstablishmentDate: '', // 立卡年月 - weight: '', // 重量 - enableDate: '', // 启用年月 - singlePrice: '', // 单价 - installIncidentalExpenses: '', // 安装及杂费 - originValue: '', // 原值 - useDept: '', // 使用部门 - installPlace: '', // 安装地点 - createUser: '', // 创建人/负责人 - depreciationPeriod: '', // 折旧年限 - depreciationMethod: '', // 折旧方法 - attribute: '', // 属性 - majorCategory: '', // 专业分类 - presentOriginValue: '', // 目前原值 - managerState: '1', // 管理状态 - fileList: [] as any[], // 说明书 - remark: '', // 备注 - mesureType: '', // 检定方式 - mesureRange: '', // 测量范围 - uncertainty: '', // 不确定度 - usePerson: '', // 使用人 - mesureDept: '', // 检定部门 - mesureCycle: '', // 检定周期 - mesureDate: '', // 检定日期 - validDate: '', // 有效日期 - mesureResult: '', // 检定结果 - abc: '', // ABC - isCalibrationTestEquipment: '', // 是否是技术指标需要校准检定的设备 - isMeasureAccount: '', // 是否是测量工装台账 - isStandardSupportEquipment: '', // 是否标准配套设备 - id: '', - } -} // 判断是设备借用还是状态管理 const isDevice = computed(() => { if (name.value == '设备借用申请' || name.value == '设备借用处理') { @@ -295,7 +202,7 @@ // ruleFormRef.value?.resetFields() title.value = row.title name.value = row.name - if (isDevice) { + if (isDevice.value) { // 设备借用 if (title.value !== '新建') { console.log(row.id) @@ -307,6 +214,7 @@ } else { // 状态管理 + } } onMounted(() => { @@ -315,12 +223,11 @@ // 关闭弹窗 const close = () => { - resetDATA() $router.go(-1) } // 提交 const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => { - if (isDevice) { + if (isDevice.value) { // 设备借用 if (!formEl2) { return } await formEl2.validate((valid, fields) => { @@ -362,7 +269,25 @@ }) } else { - // 状态管理 + // 状态管理 + if (!formEl1) { return } + await formEl1.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then((res) => { + addStatus(ruleForm1.value).then((res) => { + console.log(res) + }) + }) + } + }) } } // 取消 @@ -520,7 +445,7 @@ // edit: true, // }) // } - addRowRef.value.initDialog({ title: '添加' }) + addRowRef.value.initDialog({ title: '' }) } const SelectionList = ref() // 表格选中 @@ -556,7 +481,20 @@ } // 借用设备列表添加 const addRowMethods = (row) => { - borrowList.value = [...borrowList.value, ...row] + if (isDevice.value) { + // 设备借用 + borrowList.value = [...borrowList.value, ...row] + } + else { + // 设备状态 + if (row.length > 1) { + ElMessage.warning('只能选择一个设备') + } + else { + console.log(row[0], '选中的设备') + const device = row[0] + } + } // row.forEach((element) => { // borrowList.value.push({ // equipmentName: element.equipmentName, // 设备名称 @@ -577,18 +515,20 @@ // 根据状态判断 // 全部 待审批 审批中 可审批 const arr = ['0', '2', '3'] - return arr.includes($route.query?.approvalStatus as string) + const status = ['待审批', '审批中'] + return arr.includes($route.query?.approvalStatus as string) && status.includes($route.query?.approvalStatusName as string) }) // 详情页是否展示打印按钮 const isPrint = computed(() => { // 根据状态判断 // 未通过 已通过 - const arr = ['4', '5'] - return arr.includes($route.query?.approvalStatus as string) + const arr = ['4', '5', '0'] + const status = ['未通过', '已通过'] + return arr.includes($route.query?.approvalStatus as string) && status.includes($route.query?.approvalStatusName as string) }) // 已取消状态 const isCancel = computed(() => { - if ($route.query?.approvalStatus === '6') { + if ($route.query?.approvalStatus === '6' || $route.query?.approvalStatusName === '已取消') { return true } else { @@ -620,16 +560,16 @@ 打印 - + 编辑 - + 编辑 - + 删除 @@ -652,7 +592,13 @@ - + + + @@ -685,17 +631,17 @@ - + - - + + @@ -751,12 +697,12 @@
- + diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index ea79535..8771c29 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -1,10 +1,34 @@ // 状态管理相关接口api import request from '../index' // 设备申请列表 -export function getApplyList(data: any) { +export function getStatusList(data: any) { return request({ url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) } +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 35f3dec..240fffa 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -165,6 +165,7 @@ title: '详情', name: '设备借用申请', approvalStatus: props.type, + approvalStatusName: row.approvalStatusName, }, }) } @@ -378,7 +379,7 @@ diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 755138a..f272ff7 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -8,7 +8,6 @@ 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' @@ -116,41 +115,14 @@ }, ]) // 检定周期 -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', - }, -]) +const mesureCycleList = ref() // 获取下拉框数 const fetchData = () => { -// 获取资产类型 + // 获取检定周期 + getDictByCode('mesureCycle').then((response) => { + mesureCycleList.value = response.data + }) + // 获取资产类型 getDictByCode('assetType').then((response) => { assetTypeList.value = response.data }) diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index e220eb5..d0b26b6 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -24,61 +24,51 @@ { text: '固定资产编号', value: 'assetNo', - width: '180', align: 'center', }, { text: '设备名称', value: 'equipmentName', - width: '150', align: 'center', }, { text: '型号', value: 'modelNo', - width: '150', align: 'center', }, { text: '设备规格', value: 'equipmentSpecifications', - width: '150', align: 'center', }, { text: '设备类别', value: 'equipmentCategoryName', - width: '150', align: 'center', }, { text: '设备类型', value: 'equipmentTypeName', - width: '150', align: 'center', }, { text: '用途', value: 'purpose', - width: '150', align: 'center', }, { text: '管理级别', value: 'managerLevelName', - width: '150', align: 'center', }, { text: '使用单位', value: 'useDeptName', - width: '150', align: 'center', }, { text: '创建时间', value: 'createTime', - width: '180', align: 'center', }, ]) // 表格 @@ -103,7 +93,6 @@ extarCss: '', }) const list = ref([]) // 表格数据 -const addRef = ref() // 添加/编辑/详情/组件 const dialogVisible = ref(false) // 添加组件的显示与隐藏 const equipmentCategoryList = ref([]) // 设备类别 // 获取数据列表 diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 7ab7c18..2f7cf28 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -13,6 +13,7 @@ import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { addApply, deleteApply, detailApply, editApply } from '@/api/device/borrow' +import { addStatus } from '@/api/device/stateManage' import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface' import useUserStore from '@/store/modules/user' const userInfo = useUserStore() @@ -24,56 +25,18 @@ const name = ref('') const borrowList = ref([]) const ruleForm1 = ref({ - assetNo: '', // 资产编号 - assetType: '', // 资产类型 - assetSource: '', // 资产来源 + applyDesc: '', // 申请说明 + time: '', // 时间 + fileList: [] as any[], // 说明书 + applyUnit: '', // 申请单位 + applyPerson: '', // 申请人 equipmentNo: '', // 设备编号 equipmentName: '', // 设备名称 - labelBind: '', // 标签绑定 modelNo: '', // 型号 equipmentSpecifications: '', // 设备规格 - equipmentType: '', // 设备类型 - equipmentCategory: '', // 设备类别 - capitalSource: '', // 资本来源 - managerLevel: '', // 管理级别 - purpose: '', // 用途 - technicalLevel: '', // 技术水平 - intactState: '', // 完好状态 - manufacturerCountry: '', // 厂家国别 - manufacturer: '', // 生产厂家 - overallDimension: '', // 外形尺寸 manufacturingNo: '', // 出厂编号 - manufacturingDate: '', // 出厂年月 - cardEstablishmentDate: '', // 立卡年月 - weight: '', // 重量 - enableDate: '', // 启用年月 - singlePrice: '', // 单价 - installIncidentalExpenses: '', // 安装及杂费 - originValue: '', // 原值 - useDept: '', // 使用部门 - installPlace: '', // 安装地点 - createUser: '', // 创建人/负责人 - depreciationPeriod: '', // 折旧年限 - depreciationMethod: '', // 折旧方法 - attribute: '', // 属性 - majorCategory: '', // 专业分类 - presentOriginValue: '', // 目前原值 - managerState: '1', // 管理状态 - fileList: [] as any[], // 说明书 - remark: '', // 备注 - mesureType: '', // 检定方式 - mesureRange: '', // 测量范围 - uncertainty: '', // 不确定度 - usePerson: '', // 使用人 - mesureDept: '', // 检定部门 - mesureCycle: '', // 检定周期 - mesureDate: '', // 检定日期 - validDate: '', // 有效日期 - mesureResult: '', // 检定结果 - abc: '', // ABC - isCalibrationTestEquipment: '', // 是否是技术指标需要校准检定的设备 - isMeasureAccount: '', // 是否是测量工装台账 - isStandardSupportEquipment: '', // 是否标准配套设备 + manufacturer: '', // 生产厂家 + equipmentList: [], id: '', }) // 表单 const ruleForm2 = ref({ @@ -224,62 +187,6 @@ useDeptListNoTree.value = res.data }) } -// 重置 -const resetDATA = () => { - ruleForm1.value = { - assetNo: '', // 资产编号 - assetType: '', // 资产类型 - assetSource: '', // 资产来源 - equipmentNo: '', // 设备编号 - equipmentName: '', // 设备名称 - labelBind: '', // 标签绑定 - modelNo: '', // 型号 - equipmentSpecifications: '', // 设备规格 - equipmentType: '', // 设备类型 - equipmentCategory: '', // 设备类别 - capitalSource: '', // 资本来源 - managerLevel: '', // 管理级别 - purpose: '', // 用途 - technicalLevel: '', // 技术水平 - intactState: '', // 完好状态 - manufacturerCountry: '', // 厂家国别 - manufacturer: '', // 生产厂家 - overallDimension: '', // 外形尺寸 - manufacturingNo: '', // 出厂编号 - manufacturingDate: '', // 出厂年月 - cardEstablishmentDate: '', // 立卡年月 - weight: '', // 重量 - enableDate: '', // 启用年月 - singlePrice: '', // 单价 - installIncidentalExpenses: '', // 安装及杂费 - originValue: '', // 原值 - useDept: '', // 使用部门 - installPlace: '', // 安装地点 - createUser: '', // 创建人/负责人 - depreciationPeriod: '', // 折旧年限 - depreciationMethod: '', // 折旧方法 - attribute: '', // 属性 - majorCategory: '', // 专业分类 - presentOriginValue: '', // 目前原值 - managerState: '1', // 管理状态 - fileList: [] as any[], // 说明书 - remark: '', // 备注 - mesureType: '', // 检定方式 - mesureRange: '', // 测量范围 - uncertainty: '', // 不确定度 - usePerson: '', // 使用人 - mesureDept: '', // 检定部门 - mesureCycle: '', // 检定周期 - mesureDate: '', // 检定日期 - validDate: '', // 有效日期 - mesureResult: '', // 检定结果 - abc: '', // ABC - isCalibrationTestEquipment: '', // 是否是技术指标需要校准检定的设备 - isMeasureAccount: '', // 是否是测量工装台账 - isStandardSupportEquipment: '', // 是否标准配套设备 - id: '', - } -} // 判断是设备借用还是状态管理 const isDevice = computed(() => { if (name.value == '设备借用申请' || name.value == '设备借用处理') { @@ -295,7 +202,7 @@ // ruleFormRef.value?.resetFields() title.value = row.title name.value = row.name - if (isDevice) { + if (isDevice.value) { // 设备借用 if (title.value !== '新建') { console.log(row.id) @@ -307,6 +214,7 @@ } else { // 状态管理 + } } onMounted(() => { @@ -315,12 +223,11 @@ // 关闭弹窗 const close = () => { - resetDATA() $router.go(-1) } // 提交 const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => { - if (isDevice) { + if (isDevice.value) { // 设备借用 if (!formEl2) { return } await formEl2.validate((valid, fields) => { @@ -362,7 +269,25 @@ }) } else { - // 状态管理 + // 状态管理 + if (!formEl1) { return } + await formEl1.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then((res) => { + addStatus(ruleForm1.value).then((res) => { + console.log(res) + }) + }) + } + }) } } // 取消 @@ -520,7 +445,7 @@ // edit: true, // }) // } - addRowRef.value.initDialog({ title: '添加' }) + addRowRef.value.initDialog({ title: '' }) } const SelectionList = ref() // 表格选中 @@ -556,7 +481,20 @@ } // 借用设备列表添加 const addRowMethods = (row) => { - borrowList.value = [...borrowList.value, ...row] + if (isDevice.value) { + // 设备借用 + borrowList.value = [...borrowList.value, ...row] + } + else { + // 设备状态 + if (row.length > 1) { + ElMessage.warning('只能选择一个设备') + } + else { + console.log(row[0], '选中的设备') + const device = row[0] + } + } // row.forEach((element) => { // borrowList.value.push({ // equipmentName: element.equipmentName, // 设备名称 @@ -577,18 +515,20 @@ // 根据状态判断 // 全部 待审批 审批中 可审批 const arr = ['0', '2', '3'] - return arr.includes($route.query?.approvalStatus as string) + const status = ['待审批', '审批中'] + return arr.includes($route.query?.approvalStatus as string) && status.includes($route.query?.approvalStatusName as string) }) // 详情页是否展示打印按钮 const isPrint = computed(() => { // 根据状态判断 // 未通过 已通过 - const arr = ['4', '5'] - return arr.includes($route.query?.approvalStatus as string) + const arr = ['4', '5', '0'] + const status = ['未通过', '已通过'] + return arr.includes($route.query?.approvalStatus as string) && status.includes($route.query?.approvalStatusName as string) }) // 已取消状态 const isCancel = computed(() => { - if ($route.query?.approvalStatus === '6') { + if ($route.query?.approvalStatus === '6' || $route.query?.approvalStatusName === '已取消') { return true } else { @@ -620,16 +560,16 @@ 打印 - + 编辑 - + 编辑 - + 删除 @@ -652,7 +592,13 @@ - + + + @@ -685,17 +631,17 @@ - + - - + + @@ -751,12 +697,12 @@
- + diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index 131b636..fd576ff 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -2,7 +2,7 @@ - - - - - diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 35f3dec..240fffa 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -165,6 +165,7 @@ title: '详情', name: '设备借用申请', approvalStatus: props.type, + approvalStatusName: row.approvalStatusName, }, }) } @@ -378,7 +379,7 @@ diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 755138a..f272ff7 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -8,7 +8,6 @@ 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' @@ -116,41 +115,14 @@ }, ]) // 检定周期 -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', - }, -]) +const mesureCycleList = ref() // 获取下拉框数 const fetchData = () => { -// 获取资产类型 + // 获取检定周期 + getDictByCode('mesureCycle').then((response) => { + mesureCycleList.value = response.data + }) + // 获取资产类型 getDictByCode('assetType').then((response) => { assetTypeList.value = response.data }) diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index e220eb5..d0b26b6 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -24,61 +24,51 @@ { text: '固定资产编号', value: 'assetNo', - width: '180', align: 'center', }, { text: '设备名称', value: 'equipmentName', - width: '150', align: 'center', }, { text: '型号', value: 'modelNo', - width: '150', align: 'center', }, { text: '设备规格', value: 'equipmentSpecifications', - width: '150', align: 'center', }, { text: '设备类别', value: 'equipmentCategoryName', - width: '150', align: 'center', }, { text: '设备类型', value: 'equipmentTypeName', - width: '150', align: 'center', }, { text: '用途', value: 'purpose', - width: '150', align: 'center', }, { text: '管理级别', value: 'managerLevelName', - width: '150', align: 'center', }, { text: '使用单位', value: 'useDeptName', - width: '150', align: 'center', }, { text: '创建时间', value: 'createTime', - width: '180', align: 'center', }, ]) // 表格 @@ -103,7 +93,6 @@ extarCss: '', }) const list = ref([]) // 表格数据 -const addRef = ref() // 添加/编辑/详情/组件 const dialogVisible = ref(false) // 添加组件的显示与隐藏 const equipmentCategoryList = ref([]) // 设备类别 // 获取数据列表 diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 7ab7c18..2f7cf28 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -13,6 +13,7 @@ import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { addApply, deleteApply, detailApply, editApply } from '@/api/device/borrow' +import { addStatus } from '@/api/device/stateManage' import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface' import useUserStore from '@/store/modules/user' const userInfo = useUserStore() @@ -24,56 +25,18 @@ const name = ref('') const borrowList = ref([]) const ruleForm1 = ref({ - assetNo: '', // 资产编号 - assetType: '', // 资产类型 - assetSource: '', // 资产来源 + applyDesc: '', // 申请说明 + time: '', // 时间 + fileList: [] as any[], // 说明书 + applyUnit: '', // 申请单位 + applyPerson: '', // 申请人 equipmentNo: '', // 设备编号 equipmentName: '', // 设备名称 - labelBind: '', // 标签绑定 modelNo: '', // 型号 equipmentSpecifications: '', // 设备规格 - equipmentType: '', // 设备类型 - equipmentCategory: '', // 设备类别 - capitalSource: '', // 资本来源 - managerLevel: '', // 管理级别 - purpose: '', // 用途 - technicalLevel: '', // 技术水平 - intactState: '', // 完好状态 - manufacturerCountry: '', // 厂家国别 - manufacturer: '', // 生产厂家 - overallDimension: '', // 外形尺寸 manufacturingNo: '', // 出厂编号 - manufacturingDate: '', // 出厂年月 - cardEstablishmentDate: '', // 立卡年月 - weight: '', // 重量 - enableDate: '', // 启用年月 - singlePrice: '', // 单价 - installIncidentalExpenses: '', // 安装及杂费 - originValue: '', // 原值 - useDept: '', // 使用部门 - installPlace: '', // 安装地点 - createUser: '', // 创建人/负责人 - depreciationPeriod: '', // 折旧年限 - depreciationMethod: '', // 折旧方法 - attribute: '', // 属性 - majorCategory: '', // 专业分类 - presentOriginValue: '', // 目前原值 - managerState: '1', // 管理状态 - fileList: [] as any[], // 说明书 - remark: '', // 备注 - mesureType: '', // 检定方式 - mesureRange: '', // 测量范围 - uncertainty: '', // 不确定度 - usePerson: '', // 使用人 - mesureDept: '', // 检定部门 - mesureCycle: '', // 检定周期 - mesureDate: '', // 检定日期 - validDate: '', // 有效日期 - mesureResult: '', // 检定结果 - abc: '', // ABC - isCalibrationTestEquipment: '', // 是否是技术指标需要校准检定的设备 - isMeasureAccount: '', // 是否是测量工装台账 - isStandardSupportEquipment: '', // 是否标准配套设备 + manufacturer: '', // 生产厂家 + equipmentList: [], id: '', }) // 表单 const ruleForm2 = ref({ @@ -224,62 +187,6 @@ useDeptListNoTree.value = res.data }) } -// 重置 -const resetDATA = () => { - ruleForm1.value = { - assetNo: '', // 资产编号 - assetType: '', // 资产类型 - assetSource: '', // 资产来源 - equipmentNo: '', // 设备编号 - equipmentName: '', // 设备名称 - labelBind: '', // 标签绑定 - modelNo: '', // 型号 - equipmentSpecifications: '', // 设备规格 - equipmentType: '', // 设备类型 - equipmentCategory: '', // 设备类别 - capitalSource: '', // 资本来源 - managerLevel: '', // 管理级别 - purpose: '', // 用途 - technicalLevel: '', // 技术水平 - intactState: '', // 完好状态 - manufacturerCountry: '', // 厂家国别 - manufacturer: '', // 生产厂家 - overallDimension: '', // 外形尺寸 - manufacturingNo: '', // 出厂编号 - manufacturingDate: '', // 出厂年月 - cardEstablishmentDate: '', // 立卡年月 - weight: '', // 重量 - enableDate: '', // 启用年月 - singlePrice: '', // 单价 - installIncidentalExpenses: '', // 安装及杂费 - originValue: '', // 原值 - useDept: '', // 使用部门 - installPlace: '', // 安装地点 - createUser: '', // 创建人/负责人 - depreciationPeriod: '', // 折旧年限 - depreciationMethod: '', // 折旧方法 - attribute: '', // 属性 - majorCategory: '', // 专业分类 - presentOriginValue: '', // 目前原值 - managerState: '1', // 管理状态 - fileList: [] as any[], // 说明书 - remark: '', // 备注 - mesureType: '', // 检定方式 - mesureRange: '', // 测量范围 - uncertainty: '', // 不确定度 - usePerson: '', // 使用人 - mesureDept: '', // 检定部门 - mesureCycle: '', // 检定周期 - mesureDate: '', // 检定日期 - validDate: '', // 有效日期 - mesureResult: '', // 检定结果 - abc: '', // ABC - isCalibrationTestEquipment: '', // 是否是技术指标需要校准检定的设备 - isMeasureAccount: '', // 是否是测量工装台账 - isStandardSupportEquipment: '', // 是否标准配套设备 - id: '', - } -} // 判断是设备借用还是状态管理 const isDevice = computed(() => { if (name.value == '设备借用申请' || name.value == '设备借用处理') { @@ -295,7 +202,7 @@ // ruleFormRef.value?.resetFields() title.value = row.title name.value = row.name - if (isDevice) { + if (isDevice.value) { // 设备借用 if (title.value !== '新建') { console.log(row.id) @@ -307,6 +214,7 @@ } else { // 状态管理 + } } onMounted(() => { @@ -315,12 +223,11 @@ // 关闭弹窗 const close = () => { - resetDATA() $router.go(-1) } // 提交 const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => { - if (isDevice) { + if (isDevice.value) { // 设备借用 if (!formEl2) { return } await formEl2.validate((valid, fields) => { @@ -362,7 +269,25 @@ }) } else { - // 状态管理 + // 状态管理 + if (!formEl1) { return } + await formEl1.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then((res) => { + addStatus(ruleForm1.value).then((res) => { + console.log(res) + }) + }) + } + }) } } // 取消 @@ -520,7 +445,7 @@ // edit: true, // }) // } - addRowRef.value.initDialog({ title: '添加' }) + addRowRef.value.initDialog({ title: '' }) } const SelectionList = ref() // 表格选中 @@ -556,7 +481,20 @@ } // 借用设备列表添加 const addRowMethods = (row) => { - borrowList.value = [...borrowList.value, ...row] + if (isDevice.value) { + // 设备借用 + borrowList.value = [...borrowList.value, ...row] + } + else { + // 设备状态 + if (row.length > 1) { + ElMessage.warning('只能选择一个设备') + } + else { + console.log(row[0], '选中的设备') + const device = row[0] + } + } // row.forEach((element) => { // borrowList.value.push({ // equipmentName: element.equipmentName, // 设备名称 @@ -577,18 +515,20 @@ // 根据状态判断 // 全部 待审批 审批中 可审批 const arr = ['0', '2', '3'] - return arr.includes($route.query?.approvalStatus as string) + const status = ['待审批', '审批中'] + return arr.includes($route.query?.approvalStatus as string) && status.includes($route.query?.approvalStatusName as string) }) // 详情页是否展示打印按钮 const isPrint = computed(() => { // 根据状态判断 // 未通过 已通过 - const arr = ['4', '5'] - return arr.includes($route.query?.approvalStatus as string) + const arr = ['4', '5', '0'] + const status = ['未通过', '已通过'] + return arr.includes($route.query?.approvalStatus as string) && status.includes($route.query?.approvalStatusName as string) }) // 已取消状态 const isCancel = computed(() => { - if ($route.query?.approvalStatus === '6') { + if ($route.query?.approvalStatus === '6' || $route.query?.approvalStatusName === '已取消') { return true } else { @@ -620,16 +560,16 @@ 打印 - + 编辑 - + 编辑 - + 删除 @@ -652,7 +592,13 @@ - + + + @@ -685,17 +631,17 @@ - + - - + + @@ -751,12 +697,12 @@
- + diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index 131b636..fd576ff 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -2,7 +2,7 @@ - - - - - diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 35f3dec..240fffa 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -165,6 +165,7 @@ title: '详情', name: '设备借用申请', approvalStatus: props.type, + approvalStatusName: row.approvalStatusName, }, }) } @@ -378,7 +379,7 @@ diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 755138a..f272ff7 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -8,7 +8,6 @@ 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' @@ -116,41 +115,14 @@ }, ]) // 检定周期 -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', - }, -]) +const mesureCycleList = ref() // 获取下拉框数 const fetchData = () => { -// 获取资产类型 + // 获取检定周期 + getDictByCode('mesureCycle').then((response) => { + mesureCycleList.value = response.data + }) + // 获取资产类型 getDictByCode('assetType').then((response) => { assetTypeList.value = response.data }) diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index e220eb5..d0b26b6 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -24,61 +24,51 @@ { text: '固定资产编号', value: 'assetNo', - width: '180', align: 'center', }, { text: '设备名称', value: 'equipmentName', - width: '150', align: 'center', }, { text: '型号', value: 'modelNo', - width: '150', align: 'center', }, { text: '设备规格', value: 'equipmentSpecifications', - width: '150', align: 'center', }, { text: '设备类别', value: 'equipmentCategoryName', - width: '150', align: 'center', }, { text: '设备类型', value: 'equipmentTypeName', - width: '150', align: 'center', }, { text: '用途', value: 'purpose', - width: '150', align: 'center', }, { text: '管理级别', value: 'managerLevelName', - width: '150', align: 'center', }, { text: '使用单位', value: 'useDeptName', - width: '150', align: 'center', }, { text: '创建时间', value: 'createTime', - width: '180', align: 'center', }, ]) // 表格 @@ -103,7 +93,6 @@ extarCss: '', }) const list = ref([]) // 表格数据 -const addRef = ref() // 添加/编辑/详情/组件 const dialogVisible = ref(false) // 添加组件的显示与隐藏 const equipmentCategoryList = ref([]) // 设备类别 // 获取数据列表 diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 7ab7c18..2f7cf28 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -13,6 +13,7 @@ import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { addApply, deleteApply, detailApply, editApply } from '@/api/device/borrow' +import { addStatus } from '@/api/device/stateManage' import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface' import useUserStore from '@/store/modules/user' const userInfo = useUserStore() @@ -24,56 +25,18 @@ const name = ref('') const borrowList = ref([]) const ruleForm1 = ref({ - assetNo: '', // 资产编号 - assetType: '', // 资产类型 - assetSource: '', // 资产来源 + applyDesc: '', // 申请说明 + time: '', // 时间 + fileList: [] as any[], // 说明书 + applyUnit: '', // 申请单位 + applyPerson: '', // 申请人 equipmentNo: '', // 设备编号 equipmentName: '', // 设备名称 - labelBind: '', // 标签绑定 modelNo: '', // 型号 equipmentSpecifications: '', // 设备规格 - equipmentType: '', // 设备类型 - equipmentCategory: '', // 设备类别 - capitalSource: '', // 资本来源 - managerLevel: '', // 管理级别 - purpose: '', // 用途 - technicalLevel: '', // 技术水平 - intactState: '', // 完好状态 - manufacturerCountry: '', // 厂家国别 - manufacturer: '', // 生产厂家 - overallDimension: '', // 外形尺寸 manufacturingNo: '', // 出厂编号 - manufacturingDate: '', // 出厂年月 - cardEstablishmentDate: '', // 立卡年月 - weight: '', // 重量 - enableDate: '', // 启用年月 - singlePrice: '', // 单价 - installIncidentalExpenses: '', // 安装及杂费 - originValue: '', // 原值 - useDept: '', // 使用部门 - installPlace: '', // 安装地点 - createUser: '', // 创建人/负责人 - depreciationPeriod: '', // 折旧年限 - depreciationMethod: '', // 折旧方法 - attribute: '', // 属性 - majorCategory: '', // 专业分类 - presentOriginValue: '', // 目前原值 - managerState: '1', // 管理状态 - fileList: [] as any[], // 说明书 - remark: '', // 备注 - mesureType: '', // 检定方式 - mesureRange: '', // 测量范围 - uncertainty: '', // 不确定度 - usePerson: '', // 使用人 - mesureDept: '', // 检定部门 - mesureCycle: '', // 检定周期 - mesureDate: '', // 检定日期 - validDate: '', // 有效日期 - mesureResult: '', // 检定结果 - abc: '', // ABC - isCalibrationTestEquipment: '', // 是否是技术指标需要校准检定的设备 - isMeasureAccount: '', // 是否是测量工装台账 - isStandardSupportEquipment: '', // 是否标准配套设备 + manufacturer: '', // 生产厂家 + equipmentList: [], id: '', }) // 表单 const ruleForm2 = ref({ @@ -224,62 +187,6 @@ useDeptListNoTree.value = res.data }) } -// 重置 -const resetDATA = () => { - ruleForm1.value = { - assetNo: '', // 资产编号 - assetType: '', // 资产类型 - assetSource: '', // 资产来源 - equipmentNo: '', // 设备编号 - equipmentName: '', // 设备名称 - labelBind: '', // 标签绑定 - modelNo: '', // 型号 - equipmentSpecifications: '', // 设备规格 - equipmentType: '', // 设备类型 - equipmentCategory: '', // 设备类别 - capitalSource: '', // 资本来源 - managerLevel: '', // 管理级别 - purpose: '', // 用途 - technicalLevel: '', // 技术水平 - intactState: '', // 完好状态 - manufacturerCountry: '', // 厂家国别 - manufacturer: '', // 生产厂家 - overallDimension: '', // 外形尺寸 - manufacturingNo: '', // 出厂编号 - manufacturingDate: '', // 出厂年月 - cardEstablishmentDate: '', // 立卡年月 - weight: '', // 重量 - enableDate: '', // 启用年月 - singlePrice: '', // 单价 - installIncidentalExpenses: '', // 安装及杂费 - originValue: '', // 原值 - useDept: '', // 使用部门 - installPlace: '', // 安装地点 - createUser: '', // 创建人/负责人 - depreciationPeriod: '', // 折旧年限 - depreciationMethod: '', // 折旧方法 - attribute: '', // 属性 - majorCategory: '', // 专业分类 - presentOriginValue: '', // 目前原值 - managerState: '1', // 管理状态 - fileList: [] as any[], // 说明书 - remark: '', // 备注 - mesureType: '', // 检定方式 - mesureRange: '', // 测量范围 - uncertainty: '', // 不确定度 - usePerson: '', // 使用人 - mesureDept: '', // 检定部门 - mesureCycle: '', // 检定周期 - mesureDate: '', // 检定日期 - validDate: '', // 有效日期 - mesureResult: '', // 检定结果 - abc: '', // ABC - isCalibrationTestEquipment: '', // 是否是技术指标需要校准检定的设备 - isMeasureAccount: '', // 是否是测量工装台账 - isStandardSupportEquipment: '', // 是否标准配套设备 - id: '', - } -} // 判断是设备借用还是状态管理 const isDevice = computed(() => { if (name.value == '设备借用申请' || name.value == '设备借用处理') { @@ -295,7 +202,7 @@ // ruleFormRef.value?.resetFields() title.value = row.title name.value = row.name - if (isDevice) { + if (isDevice.value) { // 设备借用 if (title.value !== '新建') { console.log(row.id) @@ -307,6 +214,7 @@ } else { // 状态管理 + } } onMounted(() => { @@ -315,12 +223,11 @@ // 关闭弹窗 const close = () => { - resetDATA() $router.go(-1) } // 提交 const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => { - if (isDevice) { + if (isDevice.value) { // 设备借用 if (!formEl2) { return } await formEl2.validate((valid, fields) => { @@ -362,7 +269,25 @@ }) } else { - // 状态管理 + // 状态管理 + if (!formEl1) { return } + await formEl1.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then((res) => { + addStatus(ruleForm1.value).then((res) => { + console.log(res) + }) + }) + } + }) } } // 取消 @@ -520,7 +445,7 @@ // edit: true, // }) // } - addRowRef.value.initDialog({ title: '添加' }) + addRowRef.value.initDialog({ title: '' }) } const SelectionList = ref() // 表格选中 @@ -556,7 +481,20 @@ } // 借用设备列表添加 const addRowMethods = (row) => { - borrowList.value = [...borrowList.value, ...row] + if (isDevice.value) { + // 设备借用 + borrowList.value = [...borrowList.value, ...row] + } + else { + // 设备状态 + if (row.length > 1) { + ElMessage.warning('只能选择一个设备') + } + else { + console.log(row[0], '选中的设备') + const device = row[0] + } + } // row.forEach((element) => { // borrowList.value.push({ // equipmentName: element.equipmentName, // 设备名称 @@ -577,18 +515,20 @@ // 根据状态判断 // 全部 待审批 审批中 可审批 const arr = ['0', '2', '3'] - return arr.includes($route.query?.approvalStatus as string) + const status = ['待审批', '审批中'] + return arr.includes($route.query?.approvalStatus as string) && status.includes($route.query?.approvalStatusName as string) }) // 详情页是否展示打印按钮 const isPrint = computed(() => { // 根据状态判断 // 未通过 已通过 - const arr = ['4', '5'] - return arr.includes($route.query?.approvalStatus as string) + const arr = ['4', '5', '0'] + const status = ['未通过', '已通过'] + return arr.includes($route.query?.approvalStatus as string) && status.includes($route.query?.approvalStatusName as string) }) // 已取消状态 const isCancel = computed(() => { - if ($route.query?.approvalStatus === '6') { + if ($route.query?.approvalStatus === '6' || $route.query?.approvalStatusName === '已取消') { return true } else { @@ -620,16 +560,16 @@ 打印 - + 编辑 - + 编辑 - + 删除 @@ -652,7 +592,13 @@ - + + + @@ -685,17 +631,17 @@ - + - - + + @@ -751,12 +697,12 @@
- + diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index 131b636..fd576ff 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -2,7 +2,7 @@ - - - - - diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 35f3dec..240fffa 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -165,6 +165,7 @@ title: '详情', name: '设备借用申请', approvalStatus: props.type, + approvalStatusName: row.approvalStatusName, }, }) } @@ -378,7 +379,7 @@ diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 755138a..f272ff7 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -8,7 +8,6 @@ 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' @@ -116,41 +115,14 @@ }, ]) // 检定周期 -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', - }, -]) +const mesureCycleList = ref() // 获取下拉框数 const fetchData = () => { -// 获取资产类型 + // 获取检定周期 + getDictByCode('mesureCycle').then((response) => { + mesureCycleList.value = response.data + }) + // 获取资产类型 getDictByCode('assetType').then((response) => { assetTypeList.value = response.data }) diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index e220eb5..d0b26b6 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -24,61 +24,51 @@ { text: '固定资产编号', value: 'assetNo', - width: '180', align: 'center', }, { text: '设备名称', value: 'equipmentName', - width: '150', align: 'center', }, { text: '型号', value: 'modelNo', - width: '150', align: 'center', }, { text: '设备规格', value: 'equipmentSpecifications', - width: '150', align: 'center', }, { text: '设备类别', value: 'equipmentCategoryName', - width: '150', align: 'center', }, { text: '设备类型', value: 'equipmentTypeName', - width: '150', align: 'center', }, { text: '用途', value: 'purpose', - width: '150', align: 'center', }, { text: '管理级别', value: 'managerLevelName', - width: '150', align: 'center', }, { text: '使用单位', value: 'useDeptName', - width: '150', align: 'center', }, { text: '创建时间', value: 'createTime', - width: '180', align: 'center', }, ]) // 表格 @@ -103,7 +93,6 @@ extarCss: '', }) const list = ref([]) // 表格数据 -const addRef = ref() // 添加/编辑/详情/组件 const dialogVisible = ref(false) // 添加组件的显示与隐藏 const equipmentCategoryList = ref([]) // 设备类别 // 获取数据列表 diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 7ab7c18..2f7cf28 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -13,6 +13,7 @@ import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { addApply, deleteApply, detailApply, editApply } from '@/api/device/borrow' +import { addStatus } from '@/api/device/stateManage' import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface' import useUserStore from '@/store/modules/user' const userInfo = useUserStore() @@ -24,56 +25,18 @@ const name = ref('') const borrowList = ref([]) const ruleForm1 = ref({ - assetNo: '', // 资产编号 - assetType: '', // 资产类型 - assetSource: '', // 资产来源 + applyDesc: '', // 申请说明 + time: '', // 时间 + fileList: [] as any[], // 说明书 + applyUnit: '', // 申请单位 + applyPerson: '', // 申请人 equipmentNo: '', // 设备编号 equipmentName: '', // 设备名称 - labelBind: '', // 标签绑定 modelNo: '', // 型号 equipmentSpecifications: '', // 设备规格 - equipmentType: '', // 设备类型 - equipmentCategory: '', // 设备类别 - capitalSource: '', // 资本来源 - managerLevel: '', // 管理级别 - purpose: '', // 用途 - technicalLevel: '', // 技术水平 - intactState: '', // 完好状态 - manufacturerCountry: '', // 厂家国别 - manufacturer: '', // 生产厂家 - overallDimension: '', // 外形尺寸 manufacturingNo: '', // 出厂编号 - manufacturingDate: '', // 出厂年月 - cardEstablishmentDate: '', // 立卡年月 - weight: '', // 重量 - enableDate: '', // 启用年月 - singlePrice: '', // 单价 - installIncidentalExpenses: '', // 安装及杂费 - originValue: '', // 原值 - useDept: '', // 使用部门 - installPlace: '', // 安装地点 - createUser: '', // 创建人/负责人 - depreciationPeriod: '', // 折旧年限 - depreciationMethod: '', // 折旧方法 - attribute: '', // 属性 - majorCategory: '', // 专业分类 - presentOriginValue: '', // 目前原值 - managerState: '1', // 管理状态 - fileList: [] as any[], // 说明书 - remark: '', // 备注 - mesureType: '', // 检定方式 - mesureRange: '', // 测量范围 - uncertainty: '', // 不确定度 - usePerson: '', // 使用人 - mesureDept: '', // 检定部门 - mesureCycle: '', // 检定周期 - mesureDate: '', // 检定日期 - validDate: '', // 有效日期 - mesureResult: '', // 检定结果 - abc: '', // ABC - isCalibrationTestEquipment: '', // 是否是技术指标需要校准检定的设备 - isMeasureAccount: '', // 是否是测量工装台账 - isStandardSupportEquipment: '', // 是否标准配套设备 + manufacturer: '', // 生产厂家 + equipmentList: [], id: '', }) // 表单 const ruleForm2 = ref({ @@ -224,62 +187,6 @@ useDeptListNoTree.value = res.data }) } -// 重置 -const resetDATA = () => { - ruleForm1.value = { - assetNo: '', // 资产编号 - assetType: '', // 资产类型 - assetSource: '', // 资产来源 - equipmentNo: '', // 设备编号 - equipmentName: '', // 设备名称 - labelBind: '', // 标签绑定 - modelNo: '', // 型号 - equipmentSpecifications: '', // 设备规格 - equipmentType: '', // 设备类型 - equipmentCategory: '', // 设备类别 - capitalSource: '', // 资本来源 - managerLevel: '', // 管理级别 - purpose: '', // 用途 - technicalLevel: '', // 技术水平 - intactState: '', // 完好状态 - manufacturerCountry: '', // 厂家国别 - manufacturer: '', // 生产厂家 - overallDimension: '', // 外形尺寸 - manufacturingNo: '', // 出厂编号 - manufacturingDate: '', // 出厂年月 - cardEstablishmentDate: '', // 立卡年月 - weight: '', // 重量 - enableDate: '', // 启用年月 - singlePrice: '', // 单价 - installIncidentalExpenses: '', // 安装及杂费 - originValue: '', // 原值 - useDept: '', // 使用部门 - installPlace: '', // 安装地点 - createUser: '', // 创建人/负责人 - depreciationPeriod: '', // 折旧年限 - depreciationMethod: '', // 折旧方法 - attribute: '', // 属性 - majorCategory: '', // 专业分类 - presentOriginValue: '', // 目前原值 - managerState: '1', // 管理状态 - fileList: [] as any[], // 说明书 - remark: '', // 备注 - mesureType: '', // 检定方式 - mesureRange: '', // 测量范围 - uncertainty: '', // 不确定度 - usePerson: '', // 使用人 - mesureDept: '', // 检定部门 - mesureCycle: '', // 检定周期 - mesureDate: '', // 检定日期 - validDate: '', // 有效日期 - mesureResult: '', // 检定结果 - abc: '', // ABC - isCalibrationTestEquipment: '', // 是否是技术指标需要校准检定的设备 - isMeasureAccount: '', // 是否是测量工装台账 - isStandardSupportEquipment: '', // 是否标准配套设备 - id: '', - } -} // 判断是设备借用还是状态管理 const isDevice = computed(() => { if (name.value == '设备借用申请' || name.value == '设备借用处理') { @@ -295,7 +202,7 @@ // ruleFormRef.value?.resetFields() title.value = row.title name.value = row.name - if (isDevice) { + if (isDevice.value) { // 设备借用 if (title.value !== '新建') { console.log(row.id) @@ -307,6 +214,7 @@ } else { // 状态管理 + } } onMounted(() => { @@ -315,12 +223,11 @@ // 关闭弹窗 const close = () => { - resetDATA() $router.go(-1) } // 提交 const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => { - if (isDevice) { + if (isDevice.value) { // 设备借用 if (!formEl2) { return } await formEl2.validate((valid, fields) => { @@ -362,7 +269,25 @@ }) } else { - // 状态管理 + // 状态管理 + if (!formEl1) { return } + await formEl1.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then((res) => { + addStatus(ruleForm1.value).then((res) => { + console.log(res) + }) + }) + } + }) } } // 取消 @@ -520,7 +445,7 @@ // edit: true, // }) // } - addRowRef.value.initDialog({ title: '添加' }) + addRowRef.value.initDialog({ title: '' }) } const SelectionList = ref() // 表格选中 @@ -556,7 +481,20 @@ } // 借用设备列表添加 const addRowMethods = (row) => { - borrowList.value = [...borrowList.value, ...row] + if (isDevice.value) { + // 设备借用 + borrowList.value = [...borrowList.value, ...row] + } + else { + // 设备状态 + if (row.length > 1) { + ElMessage.warning('只能选择一个设备') + } + else { + console.log(row[0], '选中的设备') + const device = row[0] + } + } // row.forEach((element) => { // borrowList.value.push({ // equipmentName: element.equipmentName, // 设备名称 @@ -577,18 +515,20 @@ // 根据状态判断 // 全部 待审批 审批中 可审批 const arr = ['0', '2', '3'] - return arr.includes($route.query?.approvalStatus as string) + const status = ['待审批', '审批中'] + return arr.includes($route.query?.approvalStatus as string) && status.includes($route.query?.approvalStatusName as string) }) // 详情页是否展示打印按钮 const isPrint = computed(() => { // 根据状态判断 // 未通过 已通过 - const arr = ['4', '5'] - return arr.includes($route.query?.approvalStatus as string) + const arr = ['4', '5', '0'] + const status = ['未通过', '已通过'] + return arr.includes($route.query?.approvalStatus as string) && status.includes($route.query?.approvalStatusName as string) }) // 已取消状态 const isCancel = computed(() => { - if ($route.query?.approvalStatus === '6') { + if ($route.query?.approvalStatus === '6' || $route.query?.approvalStatusName === '已取消') { return true } else { @@ -620,16 +560,16 @@ 打印 - + 编辑 - + 编辑 - + 删除 @@ -652,7 +592,13 @@ - + + + @@ -685,17 +631,17 @@ - + - - + + @@ -751,12 +697,12 @@
- + diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index 131b636..fd576ff 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -2,7 +2,7 @@ - - - - - diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 35f3dec..240fffa 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -165,6 +165,7 @@ title: '详情', name: '设备借用申请', approvalStatus: props.type, + approvalStatusName: row.approvalStatusName, }, }) } @@ -378,7 +379,7 @@ diff --git a/src/views/device/standingBook/components/fixedAssetsAdd.vue b/src/views/device/standingBook/components/fixedAssetsAdd.vue index 755138a..f272ff7 100644 --- a/src/views/device/standingBook/components/fixedAssetsAdd.vue +++ b/src/views/device/standingBook/components/fixedAssetsAdd.vue @@ -8,7 +8,6 @@ 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' @@ -116,41 +115,14 @@ }, ]) // 检定周期 -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', - }, -]) +const mesureCycleList = ref() // 获取下拉框数 const fetchData = () => { -// 获取资产类型 + // 获取检定周期 + getDictByCode('mesureCycle').then((response) => { + mesureCycleList.value = response.data + }) + // 获取资产类型 getDictByCode('assetType').then((response) => { assetTypeList.value = response.data }) diff --git a/src/views/device/standingBook/fixedAssets.vue b/src/views/device/standingBook/fixedAssets.vue index e220eb5..d0b26b6 100644 --- a/src/views/device/standingBook/fixedAssets.vue +++ b/src/views/device/standingBook/fixedAssets.vue @@ -24,61 +24,51 @@ { text: '固定资产编号', value: 'assetNo', - width: '180', align: 'center', }, { text: '设备名称', value: 'equipmentName', - width: '150', align: 'center', }, { text: '型号', value: 'modelNo', - width: '150', align: 'center', }, { text: '设备规格', value: 'equipmentSpecifications', - width: '150', align: 'center', }, { text: '设备类别', value: 'equipmentCategoryName', - width: '150', align: 'center', }, { text: '设备类型', value: 'equipmentTypeName', - width: '150', align: 'center', }, { text: '用途', value: 'purpose', - width: '150', align: 'center', }, { text: '管理级别', value: 'managerLevelName', - width: '150', align: 'center', }, { text: '使用单位', value: 'useDeptName', - width: '150', align: 'center', }, { text: '创建时间', value: 'createTime', - width: '180', align: 'center', }, ]) // 表格 @@ -103,7 +93,6 @@ extarCss: '', }) const list = ref([]) // 表格数据 -const addRef = ref() // 添加/编辑/详情/组件 const dialogVisible = ref(false) // 添加组件的显示与隐藏 const equipmentCategoryList = ref([]) // 设备类别 // 获取数据列表 diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 7ab7c18..2f7cf28 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -13,6 +13,7 @@ import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' import { addApply, deleteApply, detailApply, editApply } from '@/api/device/borrow' +import { addStatus } from '@/api/device/stateManage' import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface' import useUserStore from '@/store/modules/user' const userInfo = useUserStore() @@ -24,56 +25,18 @@ const name = ref('') const borrowList = ref([]) const ruleForm1 = ref({ - assetNo: '', // 资产编号 - assetType: '', // 资产类型 - assetSource: '', // 资产来源 + applyDesc: '', // 申请说明 + time: '', // 时间 + fileList: [] as any[], // 说明书 + applyUnit: '', // 申请单位 + applyPerson: '', // 申请人 equipmentNo: '', // 设备编号 equipmentName: '', // 设备名称 - labelBind: '', // 标签绑定 modelNo: '', // 型号 equipmentSpecifications: '', // 设备规格 - equipmentType: '', // 设备类型 - equipmentCategory: '', // 设备类别 - capitalSource: '', // 资本来源 - managerLevel: '', // 管理级别 - purpose: '', // 用途 - technicalLevel: '', // 技术水平 - intactState: '', // 完好状态 - manufacturerCountry: '', // 厂家国别 - manufacturer: '', // 生产厂家 - overallDimension: '', // 外形尺寸 manufacturingNo: '', // 出厂编号 - manufacturingDate: '', // 出厂年月 - cardEstablishmentDate: '', // 立卡年月 - weight: '', // 重量 - enableDate: '', // 启用年月 - singlePrice: '', // 单价 - installIncidentalExpenses: '', // 安装及杂费 - originValue: '', // 原值 - useDept: '', // 使用部门 - installPlace: '', // 安装地点 - createUser: '', // 创建人/负责人 - depreciationPeriod: '', // 折旧年限 - depreciationMethod: '', // 折旧方法 - attribute: '', // 属性 - majorCategory: '', // 专业分类 - presentOriginValue: '', // 目前原值 - managerState: '1', // 管理状态 - fileList: [] as any[], // 说明书 - remark: '', // 备注 - mesureType: '', // 检定方式 - mesureRange: '', // 测量范围 - uncertainty: '', // 不确定度 - usePerson: '', // 使用人 - mesureDept: '', // 检定部门 - mesureCycle: '', // 检定周期 - mesureDate: '', // 检定日期 - validDate: '', // 有效日期 - mesureResult: '', // 检定结果 - abc: '', // ABC - isCalibrationTestEquipment: '', // 是否是技术指标需要校准检定的设备 - isMeasureAccount: '', // 是否是测量工装台账 - isStandardSupportEquipment: '', // 是否标准配套设备 + manufacturer: '', // 生产厂家 + equipmentList: [], id: '', }) // 表单 const ruleForm2 = ref({ @@ -224,62 +187,6 @@ useDeptListNoTree.value = res.data }) } -// 重置 -const resetDATA = () => { - ruleForm1.value = { - assetNo: '', // 资产编号 - assetType: '', // 资产类型 - assetSource: '', // 资产来源 - equipmentNo: '', // 设备编号 - equipmentName: '', // 设备名称 - labelBind: '', // 标签绑定 - modelNo: '', // 型号 - equipmentSpecifications: '', // 设备规格 - equipmentType: '', // 设备类型 - equipmentCategory: '', // 设备类别 - capitalSource: '', // 资本来源 - managerLevel: '', // 管理级别 - purpose: '', // 用途 - technicalLevel: '', // 技术水平 - intactState: '', // 完好状态 - manufacturerCountry: '', // 厂家国别 - manufacturer: '', // 生产厂家 - overallDimension: '', // 外形尺寸 - manufacturingNo: '', // 出厂编号 - manufacturingDate: '', // 出厂年月 - cardEstablishmentDate: '', // 立卡年月 - weight: '', // 重量 - enableDate: '', // 启用年月 - singlePrice: '', // 单价 - installIncidentalExpenses: '', // 安装及杂费 - originValue: '', // 原值 - useDept: '', // 使用部门 - installPlace: '', // 安装地点 - createUser: '', // 创建人/负责人 - depreciationPeriod: '', // 折旧年限 - depreciationMethod: '', // 折旧方法 - attribute: '', // 属性 - majorCategory: '', // 专业分类 - presentOriginValue: '', // 目前原值 - managerState: '1', // 管理状态 - fileList: [] as any[], // 说明书 - remark: '', // 备注 - mesureType: '', // 检定方式 - mesureRange: '', // 测量范围 - uncertainty: '', // 不确定度 - usePerson: '', // 使用人 - mesureDept: '', // 检定部门 - mesureCycle: '', // 检定周期 - mesureDate: '', // 检定日期 - validDate: '', // 有效日期 - mesureResult: '', // 检定结果 - abc: '', // ABC - isCalibrationTestEquipment: '', // 是否是技术指标需要校准检定的设备 - isMeasureAccount: '', // 是否是测量工装台账 - isStandardSupportEquipment: '', // 是否标准配套设备 - id: '', - } -} // 判断是设备借用还是状态管理 const isDevice = computed(() => { if (name.value == '设备借用申请' || name.value == '设备借用处理') { @@ -295,7 +202,7 @@ // ruleFormRef.value?.resetFields() title.value = row.title name.value = row.name - if (isDevice) { + if (isDevice.value) { // 设备借用 if (title.value !== '新建') { console.log(row.id) @@ -307,6 +214,7 @@ } else { // 状态管理 + } } onMounted(() => { @@ -315,12 +223,11 @@ // 关闭弹窗 const close = () => { - resetDATA() $router.go(-1) } // 提交 const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => { - if (isDevice) { + if (isDevice.value) { // 设备借用 if (!formEl2) { return } await formEl2.validate((valid, fields) => { @@ -362,7 +269,25 @@ }) } else { - // 状态管理 + // 状态管理 + if (!formEl1) { return } + await formEl1.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then((res) => { + addStatus(ruleForm1.value).then((res) => { + console.log(res) + }) + }) + } + }) } } // 取消 @@ -520,7 +445,7 @@ // edit: true, // }) // } - addRowRef.value.initDialog({ title: '添加' }) + addRowRef.value.initDialog({ title: '' }) } const SelectionList = ref() // 表格选中 @@ -556,7 +481,20 @@ } // 借用设备列表添加 const addRowMethods = (row) => { - borrowList.value = [...borrowList.value, ...row] + if (isDevice.value) { + // 设备借用 + borrowList.value = [...borrowList.value, ...row] + } + else { + // 设备状态 + if (row.length > 1) { + ElMessage.warning('只能选择一个设备') + } + else { + console.log(row[0], '选中的设备') + const device = row[0] + } + } // row.forEach((element) => { // borrowList.value.push({ // equipmentName: element.equipmentName, // 设备名称 @@ -577,18 +515,20 @@ // 根据状态判断 // 全部 待审批 审批中 可审批 const arr = ['0', '2', '3'] - return arr.includes($route.query?.approvalStatus as string) + const status = ['待审批', '审批中'] + return arr.includes($route.query?.approvalStatus as string) && status.includes($route.query?.approvalStatusName as string) }) // 详情页是否展示打印按钮 const isPrint = computed(() => { // 根据状态判断 // 未通过 已通过 - const arr = ['4', '5'] - return arr.includes($route.query?.approvalStatus as string) + const arr = ['4', '5', '0'] + const status = ['未通过', '已通过'] + return arr.includes($route.query?.approvalStatus as string) && status.includes($route.query?.approvalStatusName as string) }) // 已取消状态 const isCancel = computed(() => { - if ($route.query?.approvalStatus === '6') { + if ($route.query?.approvalStatus === '6' || $route.query?.approvalStatusName === '已取消') { return true } else { @@ -620,16 +560,16 @@ 打印 - + 编辑 - + 编辑 - + 删除 @@ -652,7 +592,13 @@ - + + + @@ -685,17 +631,17 @@ - + - - + + @@ -751,12 +697,12 @@
- + diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index 131b636..fd576ff 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -2,7 +2,7 @@