diff --git a/.env.development b/.env.development index 05bed78..3a717ae 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ # 页面标题 VITE_APP_TITLE = 计量信息系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://139.198.29.133:8089 -# VITE_APP_API_BASEURL = http://192.168.8.107:5909 +# VITE_APP_API_BASEURL = http://139.198.29.133:8089 +VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21609 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 diff --git a/.env.development b/.env.development index 05bed78..3a717ae 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ # 页面标题 VITE_APP_TITLE = 计量信息系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://139.198.29.133:8089 -# VITE_APP_API_BASEURL = http://192.168.8.107:5909 +# VITE_APP_API_BASEURL = http://139.198.29.133:8089 +VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21609 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 diff --git a/public/config/config.json b/public/config/config.json index de81915..0127d2f 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://139.198.29.133:8089" + "baseUrl": "http://192.168.8.107:5909" } diff --git a/.env.development b/.env.development index 05bed78..3a717ae 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ # 页面标题 VITE_APP_TITLE = 计量信息系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://139.198.29.133:8089 -# VITE_APP_API_BASEURL = http://192.168.8.107:5909 +# VITE_APP_API_BASEURL = http://139.198.29.133:8089 +VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21609 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 diff --git a/public/config/config.json b/public/config/config.json index de81915..0127d2f 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://139.198.29.133:8089" + "baseUrl": "http://192.168.8.107:5909" } diff --git a/src/api/eqpt/measurementPlan/early.ts b/src/api/eqpt/measurementPlan/early.ts index 05bd836..4e00d72 100644 --- a/src/api/eqpt/measurementPlan/early.ts +++ b/src/api/eqpt/measurementPlan/early.ts @@ -42,3 +42,50 @@ }) } } +// 保存编辑 +export function editApply(data: object) { + return request({ + url: '/inspection/approval/saveOrUpdate', + method: 'post', + data, + }) +} +// 提交 +export function submitApply(data: object) { + return request({ + url: '/inspection/approval/submit', + method: 'post', + data, + }) +} +// 审批操作 +export function handlerApproval(type: string, data: { processId?: string; taskId?: string; comments: string }) { + return request({ + url: `/inspection/approval/${type}`, + method: 'post', + data, + }) +} +// 取消 +export function cancelApply(data: object) { + return request({ + url: '/inspection/approval/cancel', + method: 'post', + data, + }) +} +// 详情信息 +export function detailApply(id: string) { + return request({ + url: `/inspection/detail?id=${id}`, + method: 'get', + }) +} +// 删除 +export function delApply(data: object) { + return request({ + url: '/inspection/approval/delete', + method: 'post', + data, + }) +} diff --git a/.env.development b/.env.development index 05bed78..3a717ae 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ # 页面标题 VITE_APP_TITLE = 计量信息系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://139.198.29.133:8089 -# VITE_APP_API_BASEURL = http://192.168.8.107:5909 +# VITE_APP_API_BASEURL = http://139.198.29.133:8089 +VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21609 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 diff --git a/public/config/config.json b/public/config/config.json index de81915..0127d2f 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://139.198.29.133:8089" + "baseUrl": "http://192.168.8.107:5909" } diff --git a/src/api/eqpt/measurementPlan/early.ts b/src/api/eqpt/measurementPlan/early.ts index 05bd836..4e00d72 100644 --- a/src/api/eqpt/measurementPlan/early.ts +++ b/src/api/eqpt/measurementPlan/early.ts @@ -42,3 +42,50 @@ }) } } +// 保存编辑 +export function editApply(data: object) { + return request({ + url: '/inspection/approval/saveOrUpdate', + method: 'post', + data, + }) +} +// 提交 +export function submitApply(data: object) { + return request({ + url: '/inspection/approval/submit', + method: 'post', + data, + }) +} +// 审批操作 +export function handlerApproval(type: string, data: { processId?: string; taskId?: string; comments: string }) { + return request({ + url: `/inspection/approval/${type}`, + method: 'post', + data, + }) +} +// 取消 +export function cancelApply(data: object) { + return request({ + url: '/inspection/approval/cancel', + method: 'post', + data, + }) +} +// 详情信息 +export function detailApply(id: string) { + return request({ + url: `/inspection/detail?id=${id}`, + method: 'get', + }) +} +// 删除 +export function delApply(data: object) { + return request({ + url: '/inspection/approval/delete', + method: 'post', + data, + }) +} diff --git a/src/api/eqpt/measurementPlan/paln.ts b/src/api/eqpt/measurementPlan/paln.ts index e985d10..255946f 100644 --- a/src/api/eqpt/measurementPlan/paln.ts +++ b/src/api/eqpt/measurementPlan/paln.ts @@ -49,7 +49,8 @@ method: 'post', data, }) -}// 提交 +} +// 提交 export function submitPlan(data: object) { return request({ url: '/plan/approval/submit', @@ -101,7 +102,7 @@ // 获取展开数据 export function getInfoList(id: string, name: string) { return request({ - url: '/plan/equipmentAggr', + url: '/plan/relationList', params: { planId: id, equipmentName: name, diff --git a/.env.development b/.env.development index 05bed78..3a717ae 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ # 页面标题 VITE_APP_TITLE = 计量信息系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://139.198.29.133:8089 -# VITE_APP_API_BASEURL = http://192.168.8.107:5909 +# VITE_APP_API_BASEURL = http://139.198.29.133:8089 +VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21609 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 diff --git a/public/config/config.json b/public/config/config.json index de81915..0127d2f 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://139.198.29.133:8089" + "baseUrl": "http://192.168.8.107:5909" } diff --git a/src/api/eqpt/measurementPlan/early.ts b/src/api/eqpt/measurementPlan/early.ts index 05bd836..4e00d72 100644 --- a/src/api/eqpt/measurementPlan/early.ts +++ b/src/api/eqpt/measurementPlan/early.ts @@ -42,3 +42,50 @@ }) } } +// 保存编辑 +export function editApply(data: object) { + return request({ + url: '/inspection/approval/saveOrUpdate', + method: 'post', + data, + }) +} +// 提交 +export function submitApply(data: object) { + return request({ + url: '/inspection/approval/submit', + method: 'post', + data, + }) +} +// 审批操作 +export function handlerApproval(type: string, data: { processId?: string; taskId?: string; comments: string }) { + return request({ + url: `/inspection/approval/${type}`, + method: 'post', + data, + }) +} +// 取消 +export function cancelApply(data: object) { + return request({ + url: '/inspection/approval/cancel', + method: 'post', + data, + }) +} +// 详情信息 +export function detailApply(id: string) { + return request({ + url: `/inspection/detail?id=${id}`, + method: 'get', + }) +} +// 删除 +export function delApply(data: object) { + return request({ + url: '/inspection/approval/delete', + method: 'post', + data, + }) +} diff --git a/src/api/eqpt/measurementPlan/paln.ts b/src/api/eqpt/measurementPlan/paln.ts index e985d10..255946f 100644 --- a/src/api/eqpt/measurementPlan/paln.ts +++ b/src/api/eqpt/measurementPlan/paln.ts @@ -49,7 +49,8 @@ method: 'post', data, }) -}// 提交 +} +// 提交 export function submitPlan(data: object) { return request({ url: '/plan/approval/submit', @@ -101,7 +102,7 @@ // 获取展开数据 export function getInfoList(id: string, name: string) { return request({ - url: '/plan/equipmentAggr', + url: '/plan/relationList', params: { planId: id, equipmentName: name, diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 57ea4bf..4494732 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -177,6 +177,18 @@ activeMenu: '/meteringdelay', }, }, + { + path: '/delay/:type', + name: 'DealyEdit', + component: () => import('@/views/tested/MeasurementPlan/early/components/edit.vue'), + meta: { + title: '延迟送检编辑', + auth: '/tested/metering/delay', + sidebar: false, + breadcrumb: false, + activeMenu: '/meteringdelay', + }, + }, ], }, { diff --git a/.env.development b/.env.development index 05bed78..3a717ae 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ # 页面标题 VITE_APP_TITLE = 计量信息系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://139.198.29.133:8089 -# VITE_APP_API_BASEURL = http://192.168.8.107:5909 +# VITE_APP_API_BASEURL = http://139.198.29.133:8089 +VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21609 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 diff --git a/public/config/config.json b/public/config/config.json index de81915..0127d2f 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://139.198.29.133:8089" + "baseUrl": "http://192.168.8.107:5909" } diff --git a/src/api/eqpt/measurementPlan/early.ts b/src/api/eqpt/measurementPlan/early.ts index 05bd836..4e00d72 100644 --- a/src/api/eqpt/measurementPlan/early.ts +++ b/src/api/eqpt/measurementPlan/early.ts @@ -42,3 +42,50 @@ }) } } +// 保存编辑 +export function editApply(data: object) { + return request({ + url: '/inspection/approval/saveOrUpdate', + method: 'post', + data, + }) +} +// 提交 +export function submitApply(data: object) { + return request({ + url: '/inspection/approval/submit', + method: 'post', + data, + }) +} +// 审批操作 +export function handlerApproval(type: string, data: { processId?: string; taskId?: string; comments: string }) { + return request({ + url: `/inspection/approval/${type}`, + method: 'post', + data, + }) +} +// 取消 +export function cancelApply(data: object) { + return request({ + url: '/inspection/approval/cancel', + method: 'post', + data, + }) +} +// 详情信息 +export function detailApply(id: string) { + return request({ + url: `/inspection/detail?id=${id}`, + method: 'get', + }) +} +// 删除 +export function delApply(data: object) { + return request({ + url: '/inspection/approval/delete', + method: 'post', + data, + }) +} diff --git a/src/api/eqpt/measurementPlan/paln.ts b/src/api/eqpt/measurementPlan/paln.ts index e985d10..255946f 100644 --- a/src/api/eqpt/measurementPlan/paln.ts +++ b/src/api/eqpt/measurementPlan/paln.ts @@ -49,7 +49,8 @@ method: 'post', data, }) -}// 提交 +} +// 提交 export function submitPlan(data: object) { return request({ url: '/plan/approval/submit', @@ -101,7 +102,7 @@ // 获取展开数据 export function getInfoList(id: string, name: string) { return request({ - url: '/plan/equipmentAggr', + url: '/plan/relationList', params: { planId: id, equipmentName: name, diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 57ea4bf..4494732 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -177,6 +177,18 @@ activeMenu: '/meteringdelay', }, }, + { + path: '/delay/:type', + name: 'DealyEdit', + component: () => import('@/views/tested/MeasurementPlan/early/components/edit.vue'), + meta: { + title: '延迟送检编辑', + auth: '/tested/metering/delay', + sidebar: false, + breadcrumb: false, + activeMenu: '/meteringdelay', + }, + }, ], }, { diff --git a/src/views/tested/MeasurementPlan/early/components/ApprovalDialog.vue b/src/views/tested/MeasurementPlan/early/components/ApprovalDialog.vue new file mode 100644 index 0000000..7dfad76 --- /dev/null +++ b/src/views/tested/MeasurementPlan/early/components/ApprovalDialog.vue @@ -0,0 +1,172 @@ + + + + + diff --git a/.env.development b/.env.development index 05bed78..3a717ae 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ # 页面标题 VITE_APP_TITLE = 计量信息系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://139.198.29.133:8089 -# VITE_APP_API_BASEURL = http://192.168.8.107:5909 +# VITE_APP_API_BASEURL = http://139.198.29.133:8089 +VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21609 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 diff --git a/public/config/config.json b/public/config/config.json index de81915..0127d2f 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://139.198.29.133:8089" + "baseUrl": "http://192.168.8.107:5909" } diff --git a/src/api/eqpt/measurementPlan/early.ts b/src/api/eqpt/measurementPlan/early.ts index 05bd836..4e00d72 100644 --- a/src/api/eqpt/measurementPlan/early.ts +++ b/src/api/eqpt/measurementPlan/early.ts @@ -42,3 +42,50 @@ }) } } +// 保存编辑 +export function editApply(data: object) { + return request({ + url: '/inspection/approval/saveOrUpdate', + method: 'post', + data, + }) +} +// 提交 +export function submitApply(data: object) { + return request({ + url: '/inspection/approval/submit', + method: 'post', + data, + }) +} +// 审批操作 +export function handlerApproval(type: string, data: { processId?: string; taskId?: string; comments: string }) { + return request({ + url: `/inspection/approval/${type}`, + method: 'post', + data, + }) +} +// 取消 +export function cancelApply(data: object) { + return request({ + url: '/inspection/approval/cancel', + method: 'post', + data, + }) +} +// 详情信息 +export function detailApply(id: string) { + return request({ + url: `/inspection/detail?id=${id}`, + method: 'get', + }) +} +// 删除 +export function delApply(data: object) { + return request({ + url: '/inspection/approval/delete', + method: 'post', + data, + }) +} diff --git a/src/api/eqpt/measurementPlan/paln.ts b/src/api/eqpt/measurementPlan/paln.ts index e985d10..255946f 100644 --- a/src/api/eqpt/measurementPlan/paln.ts +++ b/src/api/eqpt/measurementPlan/paln.ts @@ -49,7 +49,8 @@ method: 'post', data, }) -}// 提交 +} +// 提交 export function submitPlan(data: object) { return request({ url: '/plan/approval/submit', @@ -101,7 +102,7 @@ // 获取展开数据 export function getInfoList(id: string, name: string) { return request({ - url: '/plan/equipmentAggr', + url: '/plan/relationList', params: { planId: id, equipmentName: name, diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 57ea4bf..4494732 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -177,6 +177,18 @@ activeMenu: '/meteringdelay', }, }, + { + path: '/delay/:type', + name: 'DealyEdit', + component: () => import('@/views/tested/MeasurementPlan/early/components/edit.vue'), + meta: { + title: '延迟送检编辑', + auth: '/tested/metering/delay', + sidebar: false, + breadcrumb: false, + activeMenu: '/meteringdelay', + }, + }, ], }, { diff --git a/src/views/tested/MeasurementPlan/early/components/ApprovalDialog.vue b/src/views/tested/MeasurementPlan/early/components/ApprovalDialog.vue new file mode 100644 index 0000000..7dfad76 --- /dev/null +++ b/src/views/tested/MeasurementPlan/early/components/ApprovalDialog.vue @@ -0,0 +1,172 @@ + + + + + diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 30cf31c..6b23a1e 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -8,6 +8,7 @@ import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' import { editBtn, submitBtn } from '@/utils/applyBtns' +import { detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() const userStore = useUserStore() @@ -20,24 +21,49 @@ create: '新增', detail: '详情', } +// const params = $route.query.approvalType === '0' ? 'ealy' : 'delay' // 对话框类型:create,update const dialogStatus = ref('create') const ruleForm = ref({ + approvalNo: '', // 申请编号 + approvalName: '', // 申请名称 + createDeptId: '', + createDeptName: '', + createTime: '', + createUserId: '', + createUserName: '', + approvalType: $route.query.approvalType, + reason: '', + equipmentList: [], }) // 表单 const rules = ref({ - // planCategory: [{ required: true, message: '计划分类必选', trigger: ['blur', 'change'] }], - // season: [{ required: true, message: '季度必填', trigger: ['blur', 'change'] }], - // month: [{ required: true, message: '月份称必填', trigger: ['blur', 'change'] }], + reason: [{ required: true, message: '送检原因必填', trigger: ['blur', 'change'] }], }) // 表单验证规则 // 弹窗初始化 const initDialog = () => { dialogStatus.value = $route.params.type as string ruleFormRef.value?.resetFields() if ($route.params.type === 'create') { - + ruleForm.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') // 创建时间 + ruleForm.value.createUserId = userStore.id + ruleForm.value.createUserName = userStore.name + ruleForm.value.createDeptId = userStore.deptId + ruleForm.value.createDeptName = userStore.deptName + if ($route.query.approvalType === '0') { + // 提前送检 + ruleForm.value.approvalName = '提前送检申请' + } + else { + // 延迟送检 + ruleForm.value.approvalName = '延迟送检申请' + } } else { - + const data = JSON.parse($route.query.row as string) + detailApply(data.id).then((res) => { + console.log(res.data, '详情') + ruleForm.value = res.data + }) } } onMounted(() => { @@ -45,7 +71,11 @@ }) // 关闭弹窗 const close = () => { - $router.back() + // $router.back() + const params = $route.query.approvalType === '0' ? 'ealypage' : 'meteringdelay' + $router.push({ + path: `/${params}`, + }) } const tableRef = ref() // 保存 @@ -54,22 +84,27 @@ if (!formEl) { return } await formEl.validate((valid, fields) => { if (valid && tableRef.value.checkCertificateList()) { - ElMessageBox.confirm( - '确认保存吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - // ruleForm.value.equipmentIds = tableRef.value.list - // editPlan(ruleForm.value).then((res) => { - // submitId.value = res.data - // ElMessage.success('保存成功') - // // close() - // }) - }) + if (tableRef.value.list.length) { + ElMessageBox.confirm( + '确认保存吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then((res) => { + ruleForm.value.equipmentList = tableRef.value.list + editApply(ruleForm.value).then((res) => { + submitId.value = res.data + ElMessage.success('保存成功') + // close() + }) + }) + } + else { + ElMessage.warning('请先添加设备') + } } }) } @@ -88,10 +123,10 @@ type: 'warning', }, ).then((res) => { - // submitPlan({ id: submitId.value, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => { - // ElMessage.success('已提交') - // close() - // }) + submitApply({ id: submitId.value, formId: $route.query.approvalType === '0' ? SCHEDULE.METERING_PLAN_EARLY : SCHEDULE.METERING_PLAN_DEALY }).then((res) => { + ElMessage.success('已提交') + close() + }) }) } // 取消 @@ -104,7 +139,7 @@