diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 81c6b47..3748056 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -9,7 +9,7 @@ import ButtonBox from '@/components/buttonBox/buttonBox.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' +import { borrowApply, deleteApply, exportApply, getApplyList, returnApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' import { toTreeList } from '@/utils/structure' @@ -71,12 +71,12 @@ }, { text: '申请部门', - value: 'applyUnit', + value: 'applyUnitName', align: 'center', }, { text: '申请人', - value: 'applyPerson', + value: 'applyPersonName', align: 'center', }, { @@ -173,7 +173,7 @@ // 获取使用部门 const fetchDeptTreeList = () => { - getDeptTreeList().then((res: any) => { + getDeptTreeList().then((res) => { if (res.data) { // 将列表转树结构 useDeptList.value = toTreeList(res.data, '0', true) } @@ -285,7 +285,7 @@ type: 'warning', }, ).then(() => { - submitApply({ id: row.id as string }).then((res) => { + borrowApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 81c6b47..3748056 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -9,7 +9,7 @@ import ButtonBox from '@/components/buttonBox/buttonBox.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' +import { borrowApply, deleteApply, exportApply, getApplyList, returnApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' import { toTreeList } from '@/utils/structure' @@ -71,12 +71,12 @@ }, { text: '申请部门', - value: 'applyUnit', + value: 'applyUnitName', align: 'center', }, { text: '申请人', - value: 'applyPerson', + value: 'applyPersonName', align: 'center', }, { @@ -173,7 +173,7 @@ // 获取使用部门 const fetchDeptTreeList = () => { - getDeptTreeList().then((res: any) => { + getDeptTreeList().then((res) => { if (res.data) { // 将列表转树结构 useDeptList.value = toTreeList(res.data, '0', true) } @@ -285,7 +285,7 @@ type: 'warning', }, ).then(() => { - submitApply({ id: row.id as string }).then((res) => { + borrowApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/stateManage/components/addRow.vue b/src/views/device/stateManage/components/addRow.vue index 3ba82d6..83a85a6 100644 --- a/src/views/device/stateManage/components/addRow.vue +++ b/src/views/device/stateManage/components/addRow.vue @@ -129,7 +129,7 @@
diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 81c6b47..3748056 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -9,7 +9,7 @@ import ButtonBox from '@/components/buttonBox/buttonBox.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' +import { borrowApply, deleteApply, exportApply, getApplyList, returnApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' import { toTreeList } from '@/utils/structure' @@ -71,12 +71,12 @@ }, { text: '申请部门', - value: 'applyUnit', + value: 'applyUnitName', align: 'center', }, { text: '申请人', - value: 'applyPerson', + value: 'applyPersonName', align: 'center', }, { @@ -173,7 +173,7 @@ // 获取使用部门 const fetchDeptTreeList = () => { - getDeptTreeList().then((res: any) => { + getDeptTreeList().then((res) => { if (res.data) { // 将列表转树结构 useDeptList.value = toTreeList(res.data, '0', true) } @@ -285,7 +285,7 @@ type: 'warning', }, ).then(() => { - submitApply({ id: row.id as string }).then((res) => { + borrowApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/stateManage/components/addRow.vue b/src/views/device/stateManage/components/addRow.vue index 3ba82d6..83a85a6 100644 --- a/src/views/device/stateManage/components/addRow.vue +++ b/src/views/device/stateManage/components/addRow.vue @@ -129,7 +129,7 @@
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 94caf8d..e11a9cd 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -3,7 +3,7 @@ import { ElMessage, ElMessageBox, dayjs } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { EquipmentListRow, IdeviceList, IdeviceListQuery } from './status-interface' -import addRow from './addRow.vue' +// import addRow from './addRow.vue' import SelectDeviceDialog from './selectDeviceDialog.vue' import approveAction from './approvalActionDialog.vue' import type { deptType, selectType } from '@/views/device/standingBook/standingBook-interface' @@ -33,6 +33,7 @@ const selectIndex = ref() // 点击选择的index--点击第几行 const borrowList = ref([]) +// 状态管理 const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 remark: '', // 申请说明 @@ -49,7 +50,8 @@ equipmentId: '', equipmentList: [] as EquipmentListRow[], id: '', -}) // 表单 +}) +// 设备借用表单 const ruleForm2 = ref({ applyUnit: '', // 申请单位 applyPerson: '', // 申请人 @@ -200,8 +202,8 @@ fetchData() title.value = row.title name.value = row.name + // 设备借用 if (isDevice.value) { - // 设备借用 if (title.value !== '新建') { console.log(row.id) detailApply({ id: row.id }).then((res) => { @@ -325,8 +327,6 @@ }, ).then((res) => { if (title.value == '编辑') { - ruleForm1.value.applyPerson = ruleForm1.value.id - ruleForm1.value.applyUnit = ruleForm1.value.id if (ruleForm1.value.equipmentList && ruleForm1.value.equipmentList[0]) { ruleForm1.value.equipmentId = ruleForm1.value.equipmentList[0].equipmentId // delete ruleForm1.value.equipmentList diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 81c6b47..3748056 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -9,7 +9,7 @@ import ButtonBox from '@/components/buttonBox/buttonBox.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' +import { borrowApply, deleteApply, exportApply, getApplyList, returnApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' import { toTreeList } from '@/utils/structure' @@ -71,12 +71,12 @@ }, { text: '申请部门', - value: 'applyUnit', + value: 'applyUnitName', align: 'center', }, { text: '申请人', - value: 'applyPerson', + value: 'applyPersonName', align: 'center', }, { @@ -173,7 +173,7 @@ // 获取使用部门 const fetchDeptTreeList = () => { - getDeptTreeList().then((res: any) => { + getDeptTreeList().then((res) => { if (res.data) { // 将列表转树结构 useDeptList.value = toTreeList(res.data, '0', true) } @@ -285,7 +285,7 @@ type: 'warning', }, ).then(() => { - submitApply({ id: row.id as string }).then((res) => { + borrowApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/stateManage/components/addRow.vue b/src/views/device/stateManage/components/addRow.vue index 3ba82d6..83a85a6 100644 --- a/src/views/device/stateManage/components/addRow.vue +++ b/src/views/device/stateManage/components/addRow.vue @@ -129,7 +129,7 @@
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 94caf8d..e11a9cd 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -3,7 +3,7 @@ import { ElMessage, ElMessageBox, dayjs } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { EquipmentListRow, IdeviceList, IdeviceListQuery } from './status-interface' -import addRow from './addRow.vue' +// import addRow from './addRow.vue' import SelectDeviceDialog from './selectDeviceDialog.vue' import approveAction from './approvalActionDialog.vue' import type { deptType, selectType } from '@/views/device/standingBook/standingBook-interface' @@ -33,6 +33,7 @@ const selectIndex = ref() // 点击选择的index--点击第几行 const borrowList = ref([]) +// 状态管理 const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 remark: '', // 申请说明 @@ -49,7 +50,8 @@ equipmentId: '', equipmentList: [] as EquipmentListRow[], id: '', -}) // 表单 +}) +// 设备借用表单 const ruleForm2 = ref({ applyUnit: '', // 申请单位 applyPerson: '', // 申请人 @@ -200,8 +202,8 @@ fetchData() title.value = row.title name.value = row.name + // 设备借用 if (isDevice.value) { - // 设备借用 if (title.value !== '新建') { console.log(row.id) detailApply({ id: row.id }).then((res) => { @@ -325,8 +327,6 @@ }, ).then((res) => { if (title.value == '编辑') { - ruleForm1.value.applyPerson = ruleForm1.value.id - ruleForm1.value.applyUnit = ruleForm1.value.id if (ruleForm1.value.equipmentList && ruleForm1.value.equipmentList[0]) { ruleForm1.value.equipmentId = ruleForm1.value.equipmentList[0].equipmentId // delete ruleForm1.value.equipmentList diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index 6a4a013..eac27b0 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -93,12 +93,12 @@ }, { text: '申请单位', - value: 'applyUnit', + value: 'applyUnitName', align: 'center', }, { text: '申请人', - value: 'applyPerson', + value: 'applyPersonName', align: 'center', }, { @@ -559,9 +559,9 @@ type="primary" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 3" @click="agree(row)" > 同意 @@ -572,9 +572,9 @@ type="primary" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 3" @click="reject(row)" > 驳回 @@ -585,9 +585,9 @@ type="danger" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 1 || row.decisionItem === 2" @click="refuse(row)" > 拒绝