diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index fd3d518..ffd9e95 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -58,9 +58,26 @@ // 获取申请列表 export function getstandardEquipmentApplyList(data: object) { return request({ - url: '/standard/standardEquipmentApplyList', + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', data, }) } +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: `${prefix}/standard/deleteStandardEquipmentApply`, + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: `${prefix}/standard/addStandardEquipmentApply`, + method: 'post', + data, + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index fd3d518..ffd9e95 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -58,9 +58,26 @@ // 获取申请列表 export function getstandardEquipmentApplyList(data: object) { return request({ - url: '/standard/standardEquipmentApplyList', + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', data, }) } +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: `${prefix}/standard/deleteStandardEquipmentApply`, + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: `${prefix}/standard/addStandardEquipmentApply`, + method: 'post', + data, + }) +} diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 82157b8..8000909 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -2,10 +2,9 @@ import { reactive, ref } from 'vue' import type { Ref } from 'vue' import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { IlistTypes } from '../../standard_interface' +import type { IOptions, IlistQuery, IlistTypes } from '../../standard_interface' import ListSourceAdd from './listPageAdd.vue' -import { getSoucreList, getSoucreListDelete } from '@/api/system/source' -import { getstandardEquipmentApplyList } from '@/api/device/standard' +import { getStandardLisdelete, getUsersDept, getstandardEquipmentApplyList } from '@/api/device/standard' import { uploadApi } from '@/api/system/notice' import { exportExcel } from '@/utils/exportXlsx' const props = defineProps({ @@ -28,7 +27,7 @@ }) const emit = defineEmits(['setData']) // 关闭 // 查询条件 -const listQuery: Ref = ref({ +const listQuery: Ref = ref({ applyNo: '', applyStatus: '', applyType: props.applyType, @@ -38,13 +37,13 @@ organizeNo: '', standardName: '', standardNo: '', + limit: 10, + offset: 1, }) // 控制是否显示新增页面 const show = ref(true) // 表格数据 -const list = ref([ - { name: '张飒' }, -]) +const list = ref([]) // 总数 const total = ref(0) // 表头 @@ -117,6 +116,8 @@ approvalTime: '', }) const buttonArray = ref([]) +// 部门下拉框 +const standardUsersDeptList = ref([]) // 选中的内容 const checkoutList = ref([]) // 文件上传input @@ -129,13 +130,21 @@ const infoId = ref('0') // 点击按钮 const buttonType = ref('') -const standardManagerStateList = ref([ - { name: '张三', id: '1', value: '1' }, - { name: '李四', id: '2', value: '5' }, - { name: '王五', id: '3', value: '7' }, - { name: '赵六', id: '4', value: '2' }, -]) const loadingTable = ref(false) +// 获取部门信息 +getUsersDept({ + createTime: '', + director: '', + meterMajor: '', + organizeName: '', + organizeNo: '', + organizeType: '2', + pdeptId: null, + offset: 1, + limit: 999999, +}).then((res) => { + standardUsersDeptList.value = res.data.rows +}) const fetchData = (isNowPage: boolean) => { loadingTable.value = true if (!isNowPage) { @@ -156,14 +165,14 @@ // 点击删除和编辑的参数类型 interface rowReturn { id: string - name: string + standardName: string standardOwner: string createTime: string } // 点击删除 const handleDelete = (row: rowReturn, type: string) => { ElMessageBox.confirm( - `确认${type}${row.name}吗?`, + `确认${type}${row.standardName}吗?`, '提示', { confirmButtonText: '确认', @@ -172,15 +181,17 @@ }, ) .then(() => { - // getSoucreListDelete({ id: row.id as string }).then((res) => { - // if (res.code === 200) { - // ElMessage({ - // type: 'success', - // message: '删除成功', - // }) - // fetchData(true) - // } - // }) + if (type === '删除') { + getStandardLisdelete({ id: row.id as string }).then((res) => { + if (res.code === 200) { + ElMessage({ + type: 'success', + message: '删除成功', + }) + fetchData(true) + } + }) + } }) } // 点击编辑/详情 @@ -216,6 +227,7 @@ } // 点击搜索 const searchList = () => { + fetchData(true) } const cancelEvent = () => { console.log('cancel!') @@ -223,11 +235,17 @@ // 点击重置 const clearList = () => { listQuery.value = { - supplierNo: '', // 业务内容 - supplierName: '', // 溯源供方名称 - businessContent: '', // 溯源供方编号 + applyNo: '', + applyStatus: '', + applyType: props.applyType, + approvalStatus: props.approvalStatus, + createUser: '', + equipmentNo: '', + organizeNo: '', + standardName: '', + standardNo: '', + limit: 10, offset: 1, - limit: 20, } } // 关闭编辑 @@ -243,17 +261,17 @@ }) if (checkoutList.value.length <= 0) { exportExcel({ - json: list.value.map((item: IlistType, index: number) => ({ index: index + 1, supplierNo: item.supplierNo, supplierName: item.supplierName, businessContent: item.businessContent, briefName: item.briefName, director: item.director, mobile: item.mobile, companyCity: item.companyCity, createTime: item.createTime, remark: item.remark })), - name: '溯源供方', - titleArr: ['序号', '溯源供方编号', '溯源供方名称', '业务内容', '业务资质', '负责人', '联系方式', '地址', '创建时间', '备注'], + json: list.value.map((item: IlistTypes, index: number) => ({ index: index + 1, applyNo: item.applyNo, applyTypeName: item.applyTypeName, standardNo: item.standardNo, standardName: item.standardName, constructionStandardUnitName: item.constructionStandardUnitName, standardOwner: item.standardOwner, applyDept: item.applyDept, createUser: item.createUser, createTime: item.createTime, approvalStatusName: item.approvalStatusName })), + name: '标准装置申请', + titleArr: ['序号', '申请编号', '申请类型', '标准代码', '标准名称', '标准所在部门', '负责人', '申请部门', '申请人', '申请时间', '审批状态'], sheetName: 'sheet1', }) } else { exportExcel({ - json: checkoutList.value.map((item: IlistType, index: number) => ({ index: index + 1, supplierNo: item.supplierNo, supplierName: item.supplierName, businessContent: item.businessContent, briefName: item.briefName, director: item.director, mobile: item.mobile, companyCity: item.companyCity, createTime: item.createTime, remark: item.remark })), - name: '溯源供方', - titleArr: ['序号', '溯源供方编号', '溯源供方名称', '业务内容', '业务资质', '负责人', '联系方式', '地址', '创建时间', '备注'], + json: checkoutList.value.map((item: IlistTypes, index: number) => ({ index: index + 1, applyNo: item.applyNo, applyTypeName: item.applyTypeName, standardNo: item.standardNo, standardName: item.standardName, constructionStandardUnitName: item.constructionStandardUnitName, standardOwner: item.standardOwner, applyDept: item.applyDept, createUser: item.createUser, createTime: item.createTime, approvalStatusName: item.approvalStatusName })), + name: '标准装置申请', + titleArr: ['序号', '申请编号', '申请类型', '标准代码', '标准名称', '标准所在部门', '负责人', '申请部门', '申请人', '申请时间', '审批状态'], sheetName: 'sheet1', }) } @@ -371,28 +389,13 @@ size="default" > -