diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + - - - - - - + + + + + + + + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index 107637b..c630f58 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -6,6 +6,7 @@ import { exportExcel } from '@/utils/exportXlsx' import { exportPlanList, getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' import { printJSON } from '@/utils/printUtils' +import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' const listQuery: Ref = ref({ createEndTime: '', @@ -15,6 +16,7 @@ effectiveCompany: '', ids: [], trainEndTime: '', + formId: SCHEDULE.TRAIN_APPROVAL, trainStartTime: '', offset: 1, limit: 20, diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index 107637b..c630f58 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -6,6 +6,7 @@ import { exportExcel } from '@/utils/exportXlsx' import { exportPlanList, getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' import { printJSON } from '@/utils/printUtils' +import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' const listQuery: Ref = ref({ createEndTime: '', @@ -15,6 +16,7 @@ effectiveCompany: '', ids: [], trainEndTime: '', + formId: SCHEDULE.TRAIN_APPROVAL, trainStartTime: '', offset: 1, limit: 20, diff --git a/src/views/measure/train/plan_interface.ts b/src/views/measure/train/plan_interface.ts index a41a274..4869328 100644 --- a/src/views/measure/train/plan_interface.ts +++ b/src/views/measure/train/plan_interface.ts @@ -31,6 +31,7 @@ createEndTime: string createStartTime: string ids: [] + formId: string logNo: string trainEndTime: string trainName: string diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index 107637b..c630f58 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -6,6 +6,7 @@ import { exportExcel } from '@/utils/exportXlsx' import { exportPlanList, getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' import { printJSON } from '@/utils/printUtils' +import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' const listQuery: Ref = ref({ createEndTime: '', @@ -15,6 +16,7 @@ effectiveCompany: '', ids: [], trainEndTime: '', + formId: SCHEDULE.TRAIN_APPROVAL, trainStartTime: '', offset: 1, limit: 20, diff --git a/src/views/measure/train/plan_interface.ts b/src/views/measure/train/plan_interface.ts index a41a274..4869328 100644 --- a/src/views/measure/train/plan_interface.ts +++ b/src/views/measure/train/plan_interface.ts @@ -31,6 +31,7 @@ createEndTime: string createStartTime: string ids: [] + formId: string logNo: string trainEndTime: string trainName: string diff --git a/src/views/measure/train/trainPlanApprove.vue b/src/views/measure/train/trainPlanApprove.vue index a20249f..4c0d635 100644 --- a/src/views/measure/train/trainPlanApprove.vue +++ b/src/views/measure/train/trainPlanApprove.vue @@ -1,53 +1,121 @@