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 @@
{ $router.back() }" />
-
+
提交
@@ -124,13 +159,13 @@
>
-
-
+
+
-
-
+
+
@@ -149,15 +184,15 @@
-
-
+
+
-
+
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 @@
{ $router.back() }" />
-
+
提交
@@ -124,13 +159,13 @@
>
-
-
+
+
-
-
+
+
@@ -149,15 +184,15 @@
-
-
+
+
-
+
diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue
index e97de56..4bf8f21 100644
--- a/src/views/tested/MeasurementPlan/early/components/list.vue
+++ b/src/views/tested/MeasurementPlan/early/components/list.vue
@@ -2,7 +2,7 @@
+
+
@@ -174,12 +244,12 @@
-
+
@@ -189,15 +259,45 @@
:is-showmulti-select="true" @change="changePage"
>
-
+
-
+
查看
-
+
编辑
-
+
+ 同意
+
+
+ 拒绝
+
+
+ 提交
+
+
+ 取消
+
+
删除
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 @@
{ $router.back() }" />
-
+
提交
@@ -124,13 +159,13 @@
>
-
-
+
+
-
-
+
+
@@ -149,15 +184,15 @@
-
-
+
+
-
+
diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue
index e97de56..4bf8f21 100644
--- a/src/views/tested/MeasurementPlan/early/components/list.vue
+++ b/src/views/tested/MeasurementPlan/early/components/list.vue
@@ -2,7 +2,7 @@
+
+
@@ -174,12 +244,12 @@
-
+
@@ -189,15 +259,45 @@
:is-showmulti-select="true" @change="changePage"
>
-
+
-
+
查看
-
+
编辑
-
+
+ 同意
+
+
+ 拒绝
+
+
+ 提交
+
+
+ 取消
+
+
删除
diff --git a/src/views/tested/MeasurementPlan/early/components/table.vue b/src/views/tested/MeasurementPlan/early/components/table.vue
index 2ba90fc..2cda7e8 100644
--- a/src/views/tested/MeasurementPlan/early/components/table.vue
+++ b/src/views/tested/MeasurementPlan/early/components/table.vue
@@ -172,7 +172,7 @@
-
+
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 @@
{ $router.back() }" />
-
+
提交
@@ -124,13 +159,13 @@
>
-
-
+
+
-
-
+
+
@@ -149,15 +184,15 @@
-
-
+
+
-
+
diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue
index e97de56..4bf8f21 100644
--- a/src/views/tested/MeasurementPlan/early/components/list.vue
+++ b/src/views/tested/MeasurementPlan/early/components/list.vue
@@ -2,7 +2,7 @@
+
+
@@ -174,12 +244,12 @@
-
+
@@ -189,15 +259,45 @@
:is-showmulti-select="true" @change="changePage"
>
-
+
-
+
查看
-
+
编辑
-
+
+ 同意
+
+
+ 拒绝
+
+
+ 提交
+
+
+ 取消
+
+
删除
diff --git a/src/views/tested/MeasurementPlan/early/components/table.vue b/src/views/tested/MeasurementPlan/early/components/table.vue
index 2ba90fc..2cda7e8 100644
--- a/src/views/tested/MeasurementPlan/early/components/table.vue
+++ b/src/views/tested/MeasurementPlan/early/components/table.vue
@@ -172,7 +172,7 @@
-
+
diff --git a/src/views/tested/MeasurementPlan/plan/components/detail.vue b/src/views/tested/MeasurementPlan/plan/components/detail.vue
index 0f7c544..33cbe41 100644
--- a/src/views/tested/MeasurementPlan/plan/components/detail.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/detail.vue
@@ -59,6 +59,13 @@
})
})
}
+// 追加计划
+const append = () => {
+ $router.push({
+ path: '/plan/update',
+ query: { ...$route.query, append: 'true' },
+ })
+}
@@ -66,6 +73,12 @@
{ $router.back() }" />
+
+ 发送送检通知
+
+
+ 追加计划
+
同意
@@ -81,7 +94,7 @@
-
+
打印
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 @@
{ $router.back() }" />
-
+
提交
@@ -124,13 +159,13 @@
>
-
-
+
+
-
-
+
+
@@ -149,15 +184,15 @@
-
-
+
+
-
+
diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue
index e97de56..4bf8f21 100644
--- a/src/views/tested/MeasurementPlan/early/components/list.vue
+++ b/src/views/tested/MeasurementPlan/early/components/list.vue
@@ -2,7 +2,7 @@
+
+
@@ -174,12 +244,12 @@
-
+
@@ -189,15 +259,45 @@
:is-showmulti-select="true" @change="changePage"
>
-
+
-
+
查看
-
+
编辑
-
+
+ 同意
+
+
+ 拒绝
+
+
+ 提交
+
+
+ 取消
+
+
删除
diff --git a/src/views/tested/MeasurementPlan/early/components/table.vue b/src/views/tested/MeasurementPlan/early/components/table.vue
index 2ba90fc..2cda7e8 100644
--- a/src/views/tested/MeasurementPlan/early/components/table.vue
+++ b/src/views/tested/MeasurementPlan/early/components/table.vue
@@ -172,7 +172,7 @@
-
+
diff --git a/src/views/tested/MeasurementPlan/plan/components/detail.vue b/src/views/tested/MeasurementPlan/plan/components/detail.vue
index 0f7c544..33cbe41 100644
--- a/src/views/tested/MeasurementPlan/plan/components/detail.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/detail.vue
@@ -59,6 +59,13 @@
})
})
}
+// 追加计划
+const append = () => {
+ $router.push({
+ path: '/plan/update',
+ query: { ...$route.query, append: 'true' },
+ })
+}
@@ -66,6 +73,12 @@
{ $router.back() }" />
+
+ 发送送检通知
+
+
+ 追加计划
+
同意
@@ -81,7 +94,7 @@
-
+
打印
diff --git a/src/views/tested/MeasurementPlan/plan/components/edit.vue b/src/views/tested/MeasurementPlan/plan/components/edit.vue
index 5d1f8a8..76b6194 100644
--- a/src/views/tested/MeasurementPlan/plan/components/edit.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/edit.vue
@@ -86,9 +86,13 @@
}
// 获取计划列表
getInfoList(data.id, '').then((res) => {
- console.log(res, '计划列表')
ruleForm.value.equipmentIds = res.data
})
+ // 判断是否追加计划
+ if ($route.query.append) {
+ // 修改计量计划为追加
+ ruleForm.value.planCategory = '1'
+ }
// detailPlan(data.id).then((res) => {
// // ruleForm.value = res.data
// console.log(res.data, '基本信息')
@@ -108,39 +112,47 @@
})
// 关闭弹窗
const close = () => {
- $router.back()
+ // $router.back()
+ $router.push({ path: '/plan' })
}
const tableRef = ref()
// 保存
const submitId = ref('')
const saveForm = async (formEl: FormInstance | undefined) => {
if (!formEl) { return }
- await formEl.validate((valid, fields) => {
+ await formEl.validate((valid, _fields) => {
if (valid && tableRef.value.checkCertificateList()) {
- ElMessageBox.confirm(
- '确认保存吗?',
- '提示',
- {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- },
- ).then((res) => {
- if ($route.query.category as string === 'season') {
- ruleForm.value.planName = `${currentYear.value}年第${ruleForm.value.season}季度计量计划`
- ruleForm.value.planType = '1'
- }
- else if ($route.query.category as string === 'month') {
- ruleForm.value.planName = `${currentYear.value}年${ruleForm.value.month}月月度计量计划`
- ruleForm.value.planType = '2'
- }
- ruleForm.value.equipmentIds = tableRef.value.list
- editPlan(ruleForm.value).then((res) => {
- submitId.value = res.data
- ElMessage.success('保存成功')
+ if (tableRef.value.list.length) {
+ ElMessageBox.confirm(
+ '确认保存吗?',
+ '提示',
+ {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning',
+ },
+ ).then((_res) => {
+ if ($route.query.category as string === 'season') {
+ ruleForm.value.planName = `${currentYear.value}年第${ruleForm.value.season}季度计量计划`
+ ruleForm.value.planType = '1'
+ }
+ else if ($route.query.category as string === 'month') {
+ ruleForm.value.planName = `${currentYear.value}年${ruleForm.value.month}月月度计量计划`
+ ruleForm.value.planType = '2'
+ }
+ ruleForm.value.equipmentIds = tableRef.value.list.map((item: any) => item.equipmentId)
+ editPlan(ruleForm.value).then((res) => {
+ submitId.value = res.data
+ ElMessage.success('保存成功')
// close()
+ }).catch((_err) => {
+ ruleForm.value.equipmentIds = tableRef.value.list
+ })
})
- })
+ }
+ else {
+ ElMessage.warning('请先添加设备')
+ }
}
})
}
@@ -158,10 +170,12 @@
cancelButtonText: '取消',
type: 'warning',
},
- ).then((res) => {
- submitPlan({ id: submitId.value, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => {
+ ).then((_res) => {
+ submitPlan({ id: submitId.value, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((_res) => {
ElMessage.success('已提交')
close()
+ }).catch((_err) => {
+ ruleForm.value.equipmentIds = tableRef.value.list
})
})
}
@@ -248,7 +262,7 @@
-
+
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 @@
{ $router.back() }" />
-
+
提交
@@ -124,13 +159,13 @@
>
-
-
+
+
-
-
+
+
@@ -149,15 +184,15 @@
-
-
+
+
-
+
diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue
index e97de56..4bf8f21 100644
--- a/src/views/tested/MeasurementPlan/early/components/list.vue
+++ b/src/views/tested/MeasurementPlan/early/components/list.vue
@@ -2,7 +2,7 @@
+
+
@@ -174,12 +244,12 @@
-
+
@@ -189,15 +259,45 @@
:is-showmulti-select="true" @change="changePage"
>
-
+
-
+
查看
-
+
编辑
-
+
+ 同意
+
+
+ 拒绝
+
+
+ 提交
+
+
+ 取消
+
+
删除
diff --git a/src/views/tested/MeasurementPlan/early/components/table.vue b/src/views/tested/MeasurementPlan/early/components/table.vue
index 2ba90fc..2cda7e8 100644
--- a/src/views/tested/MeasurementPlan/early/components/table.vue
+++ b/src/views/tested/MeasurementPlan/early/components/table.vue
@@ -172,7 +172,7 @@
-
+
diff --git a/src/views/tested/MeasurementPlan/plan/components/detail.vue b/src/views/tested/MeasurementPlan/plan/components/detail.vue
index 0f7c544..33cbe41 100644
--- a/src/views/tested/MeasurementPlan/plan/components/detail.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/detail.vue
@@ -59,6 +59,13 @@
})
})
}
+// 追加计划
+const append = () => {
+ $router.push({
+ path: '/plan/update',
+ query: { ...$route.query, append: 'true' },
+ })
+}
@@ -66,6 +73,12 @@
{ $router.back() }" />
+
+ 发送送检通知
+
+
+ 追加计划
+
同意
@@ -81,7 +94,7 @@
-
+
打印
diff --git a/src/views/tested/MeasurementPlan/plan/components/edit.vue b/src/views/tested/MeasurementPlan/plan/components/edit.vue
index 5d1f8a8..76b6194 100644
--- a/src/views/tested/MeasurementPlan/plan/components/edit.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/edit.vue
@@ -86,9 +86,13 @@
}
// 获取计划列表
getInfoList(data.id, '').then((res) => {
- console.log(res, '计划列表')
ruleForm.value.equipmentIds = res.data
})
+ // 判断是否追加计划
+ if ($route.query.append) {
+ // 修改计量计划为追加
+ ruleForm.value.planCategory = '1'
+ }
// detailPlan(data.id).then((res) => {
// // ruleForm.value = res.data
// console.log(res.data, '基本信息')
@@ -108,39 +112,47 @@
})
// 关闭弹窗
const close = () => {
- $router.back()
+ // $router.back()
+ $router.push({ path: '/plan' })
}
const tableRef = ref()
// 保存
const submitId = ref('')
const saveForm = async (formEl: FormInstance | undefined) => {
if (!formEl) { return }
- await formEl.validate((valid, fields) => {
+ await formEl.validate((valid, _fields) => {
if (valid && tableRef.value.checkCertificateList()) {
- ElMessageBox.confirm(
- '确认保存吗?',
- '提示',
- {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- },
- ).then((res) => {
- if ($route.query.category as string === 'season') {
- ruleForm.value.planName = `${currentYear.value}年第${ruleForm.value.season}季度计量计划`
- ruleForm.value.planType = '1'
- }
- else if ($route.query.category as string === 'month') {
- ruleForm.value.planName = `${currentYear.value}年${ruleForm.value.month}月月度计量计划`
- ruleForm.value.planType = '2'
- }
- ruleForm.value.equipmentIds = tableRef.value.list
- editPlan(ruleForm.value).then((res) => {
- submitId.value = res.data
- ElMessage.success('保存成功')
+ if (tableRef.value.list.length) {
+ ElMessageBox.confirm(
+ '确认保存吗?',
+ '提示',
+ {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning',
+ },
+ ).then((_res) => {
+ if ($route.query.category as string === 'season') {
+ ruleForm.value.planName = `${currentYear.value}年第${ruleForm.value.season}季度计量计划`
+ ruleForm.value.planType = '1'
+ }
+ else if ($route.query.category as string === 'month') {
+ ruleForm.value.planName = `${currentYear.value}年${ruleForm.value.month}月月度计量计划`
+ ruleForm.value.planType = '2'
+ }
+ ruleForm.value.equipmentIds = tableRef.value.list.map((item: any) => item.equipmentId)
+ editPlan(ruleForm.value).then((res) => {
+ submitId.value = res.data
+ ElMessage.success('保存成功')
// close()
+ }).catch((_err) => {
+ ruleForm.value.equipmentIds = tableRef.value.list
+ })
})
- })
+ }
+ else {
+ ElMessage.warning('请先添加设备')
+ }
}
})
}
@@ -158,10 +170,12 @@
cancelButtonText: '取消',
type: 'warning',
},
- ).then((res) => {
- submitPlan({ id: submitId.value, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => {
+ ).then((_res) => {
+ submitPlan({ id: submitId.value, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((_res) => {
ElMessage.success('已提交')
close()
+ }).catch((_err) => {
+ ruleForm.value.equipmentIds = tableRef.value.list
})
})
}
@@ -248,7 +262,7 @@
-
+
diff --git a/src/views/tested/MeasurementPlan/plan/components/list.vue b/src/views/tested/MeasurementPlan/plan/components/list.vue
index 7408d81..8b5281f 100644
--- a/src/views/tested/MeasurementPlan/plan/components/list.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/list.vue
@@ -55,7 +55,7 @@
},
{
text: '计划分类',
- value: 'planTypeName',
+ value: 'planCategory',
align: 'center',
},
{
@@ -85,6 +85,8 @@
// 获取列表数据
const fetchData = (isNowPage = true) => {
+ list.value = []
+ total.value = 0
listLoading.value = true
if (!isNowPage) {
// 是否显示当前页,否则跳转第一页
@@ -137,7 +139,6 @@
fetchData()
}
-
const $router = useRouter()
// 新建编辑操作
const handler = (row: any, type: string, category: string) => {
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 @@
{ $router.back() }" />
-
+
提交
@@ -124,13 +159,13 @@
>
-
-
+
+
-
-
+
+
@@ -149,15 +184,15 @@
-
-
+
+
-
+
diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue
index e97de56..4bf8f21 100644
--- a/src/views/tested/MeasurementPlan/early/components/list.vue
+++ b/src/views/tested/MeasurementPlan/early/components/list.vue
@@ -2,7 +2,7 @@
+
+
@@ -174,12 +244,12 @@
-
+
@@ -189,15 +259,45 @@
:is-showmulti-select="true" @change="changePage"
>
-
+
-
+
查看
-
+
编辑
-
+
+ 同意
+
+
+ 拒绝
+
+
+ 提交
+
+
+ 取消
+
+
删除
diff --git a/src/views/tested/MeasurementPlan/early/components/table.vue b/src/views/tested/MeasurementPlan/early/components/table.vue
index 2ba90fc..2cda7e8 100644
--- a/src/views/tested/MeasurementPlan/early/components/table.vue
+++ b/src/views/tested/MeasurementPlan/early/components/table.vue
@@ -172,7 +172,7 @@
-
+
diff --git a/src/views/tested/MeasurementPlan/plan/components/detail.vue b/src/views/tested/MeasurementPlan/plan/components/detail.vue
index 0f7c544..33cbe41 100644
--- a/src/views/tested/MeasurementPlan/plan/components/detail.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/detail.vue
@@ -59,6 +59,13 @@
})
})
}
+// 追加计划
+const append = () => {
+ $router.push({
+ path: '/plan/update',
+ query: { ...$route.query, append: 'true' },
+ })
+}
@@ -66,6 +73,12 @@
{ $router.back() }" />
+
+ 发送送检通知
+
+
+ 追加计划
+
同意
@@ -81,7 +94,7 @@
-
+
打印
diff --git a/src/views/tested/MeasurementPlan/plan/components/edit.vue b/src/views/tested/MeasurementPlan/plan/components/edit.vue
index 5d1f8a8..76b6194 100644
--- a/src/views/tested/MeasurementPlan/plan/components/edit.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/edit.vue
@@ -86,9 +86,13 @@
}
// 获取计划列表
getInfoList(data.id, '').then((res) => {
- console.log(res, '计划列表')
ruleForm.value.equipmentIds = res.data
})
+ // 判断是否追加计划
+ if ($route.query.append) {
+ // 修改计量计划为追加
+ ruleForm.value.planCategory = '1'
+ }
// detailPlan(data.id).then((res) => {
// // ruleForm.value = res.data
// console.log(res.data, '基本信息')
@@ -108,39 +112,47 @@
})
// 关闭弹窗
const close = () => {
- $router.back()
+ // $router.back()
+ $router.push({ path: '/plan' })
}
const tableRef = ref()
// 保存
const submitId = ref('')
const saveForm = async (formEl: FormInstance | undefined) => {
if (!formEl) { return }
- await formEl.validate((valid, fields) => {
+ await formEl.validate((valid, _fields) => {
if (valid && tableRef.value.checkCertificateList()) {
- ElMessageBox.confirm(
- '确认保存吗?',
- '提示',
- {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- },
- ).then((res) => {
- if ($route.query.category as string === 'season') {
- ruleForm.value.planName = `${currentYear.value}年第${ruleForm.value.season}季度计量计划`
- ruleForm.value.planType = '1'
- }
- else if ($route.query.category as string === 'month') {
- ruleForm.value.planName = `${currentYear.value}年${ruleForm.value.month}月月度计量计划`
- ruleForm.value.planType = '2'
- }
- ruleForm.value.equipmentIds = tableRef.value.list
- editPlan(ruleForm.value).then((res) => {
- submitId.value = res.data
- ElMessage.success('保存成功')
+ if (tableRef.value.list.length) {
+ ElMessageBox.confirm(
+ '确认保存吗?',
+ '提示',
+ {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning',
+ },
+ ).then((_res) => {
+ if ($route.query.category as string === 'season') {
+ ruleForm.value.planName = `${currentYear.value}年第${ruleForm.value.season}季度计量计划`
+ ruleForm.value.planType = '1'
+ }
+ else if ($route.query.category as string === 'month') {
+ ruleForm.value.planName = `${currentYear.value}年${ruleForm.value.month}月月度计量计划`
+ ruleForm.value.planType = '2'
+ }
+ ruleForm.value.equipmentIds = tableRef.value.list.map((item: any) => item.equipmentId)
+ editPlan(ruleForm.value).then((res) => {
+ submitId.value = res.data
+ ElMessage.success('保存成功')
// close()
+ }).catch((_err) => {
+ ruleForm.value.equipmentIds = tableRef.value.list
+ })
})
- })
+ }
+ else {
+ ElMessage.warning('请先添加设备')
+ }
}
})
}
@@ -158,10 +170,12 @@
cancelButtonText: '取消',
type: 'warning',
},
- ).then((res) => {
- submitPlan({ id: submitId.value, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => {
+ ).then((_res) => {
+ submitPlan({ id: submitId.value, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((_res) => {
ElMessage.success('已提交')
close()
+ }).catch((_err) => {
+ ruleForm.value.equipmentIds = tableRef.value.list
})
})
}
@@ -248,7 +262,7 @@
-
+
diff --git a/src/views/tested/MeasurementPlan/plan/components/list.vue b/src/views/tested/MeasurementPlan/plan/components/list.vue
index 7408d81..8b5281f 100644
--- a/src/views/tested/MeasurementPlan/plan/components/list.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/list.vue
@@ -55,7 +55,7 @@
},
{
text: '计划分类',
- value: 'planTypeName',
+ value: 'planCategory',
align: 'center',
},
{
@@ -85,6 +85,8 @@
// 获取列表数据
const fetchData = (isNowPage = true) => {
+ list.value = []
+ total.value = 0
listLoading.value = true
if (!isNowPage) {
// 是否显示当前页,否则跳转第一页
@@ -137,7 +139,6 @@
fetchData()
}
-
const $router = useRouter()
// 新建编辑操作
const handler = (row: any, type: string, category: string) => {
diff --git a/src/views/tested/MeasurementPlan/plan/components/table.vue b/src/views/tested/MeasurementPlan/plan/components/table.vue
index 2a75cc7..2b8f5a6 100644
--- a/src/views/tested/MeasurementPlan/plan/components/table.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/table.vue
@@ -3,6 +3,7 @@
import { ElMessage, ElMessageBox } from 'element-plus'
import selectDevice from './selectDevice.vue'
import { useCheckList } from '@/utils/useCheckList'
+import type { IlistObjType } from '@/views/tested/device/info/components/interface'
const $props = defineProps({
data: {
type: Array,
@@ -59,19 +60,19 @@
isSelect: false, // 是否下拉框
},
])
-const list = ref([])
+const list = ref([])
// 检查数据列表
function checkCertificateList() {
- return useCheckList(list.value, columns.value, '设备信息')
+ return useCheckList(list.value as any, columns.value as any, '设备信息')
}
// 将列表置为不可编辑状态
function setAllRowReadable() {
- for (const item of list.value) {
+ for (const item of list.value as IlistObjType[]) {
item.editable = false
}
}
// 双击行显示输入框
-const dblclickRow = (row: any) => {
+const dblclickRow = (row: IlistObjType) => {
if ($props.status == 'detail') {
return
}
@@ -80,7 +81,7 @@
}
const SelectionList = ref()
// 表格选中
-const handleSelectionChange = (e: any[]) => {
+const handleSelectionChange = (e: IlistObjType[]) => {
SelectionList.value = e
}
// 添加行
@@ -97,7 +98,7 @@
certificateValid: '',
installLocation: '',
editable: true,
- })
+ } as any)
}
}
// 删除行
@@ -117,7 +118,7 @@
}
}
// 选择设备
-const confirm = (device: any) => {
+const confirm = (device: IlistObjType) => {
// 判断是单选还是多选
if (Array.isArray(device)) {
// 多选
@@ -149,16 +150,15 @@
}
}
const initDialog = () => {
- list.value = $props.data
+ list.value = $props.data as IlistObjType[]
dialogStatus.value = $props.status
}
// 批量增加
const batch = () => {
deviceRef.value.initDialog(true)
}
-watch(() => $props.data, (newVal) => {
+watch(() => $props.data as IlistObjType[], (newVal: IlistObjType[]) => {
if (newVal) {
- console.log(newVal, 'newVal')
list.value = newVal
}
}, {
@@ -192,7 +192,7 @@
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 @@
{ $router.back() }" />
-
+
提交
@@ -124,13 +159,13 @@
>
-
-
+
+
-
-
+
+
@@ -149,15 +184,15 @@
-
-
+
+
-
+
diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue
index e97de56..4bf8f21 100644
--- a/src/views/tested/MeasurementPlan/early/components/list.vue
+++ b/src/views/tested/MeasurementPlan/early/components/list.vue
@@ -2,7 +2,7 @@
+
+
@@ -174,12 +244,12 @@
-
+
@@ -189,15 +259,45 @@
:is-showmulti-select="true" @change="changePage"
>
-
+
-
+
查看
-
+
编辑
-
+
+ 同意
+
+
+ 拒绝
+
+
+ 提交
+
+
+ 取消
+
+
删除
diff --git a/src/views/tested/MeasurementPlan/early/components/table.vue b/src/views/tested/MeasurementPlan/early/components/table.vue
index 2ba90fc..2cda7e8 100644
--- a/src/views/tested/MeasurementPlan/early/components/table.vue
+++ b/src/views/tested/MeasurementPlan/early/components/table.vue
@@ -172,7 +172,7 @@
-
+
diff --git a/src/views/tested/MeasurementPlan/plan/components/detail.vue b/src/views/tested/MeasurementPlan/plan/components/detail.vue
index 0f7c544..33cbe41 100644
--- a/src/views/tested/MeasurementPlan/plan/components/detail.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/detail.vue
@@ -59,6 +59,13 @@
})
})
}
+// 追加计划
+const append = () => {
+ $router.push({
+ path: '/plan/update',
+ query: { ...$route.query, append: 'true' },
+ })
+}
@@ -66,6 +73,12 @@
{ $router.back() }" />
+
+ 发送送检通知
+
+
+ 追加计划
+
同意
@@ -81,7 +94,7 @@
-
+
打印
diff --git a/src/views/tested/MeasurementPlan/plan/components/edit.vue b/src/views/tested/MeasurementPlan/plan/components/edit.vue
index 5d1f8a8..76b6194 100644
--- a/src/views/tested/MeasurementPlan/plan/components/edit.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/edit.vue
@@ -86,9 +86,13 @@
}
// 获取计划列表
getInfoList(data.id, '').then((res) => {
- console.log(res, '计划列表')
ruleForm.value.equipmentIds = res.data
})
+ // 判断是否追加计划
+ if ($route.query.append) {
+ // 修改计量计划为追加
+ ruleForm.value.planCategory = '1'
+ }
// detailPlan(data.id).then((res) => {
// // ruleForm.value = res.data
// console.log(res.data, '基本信息')
@@ -108,39 +112,47 @@
})
// 关闭弹窗
const close = () => {
- $router.back()
+ // $router.back()
+ $router.push({ path: '/plan' })
}
const tableRef = ref()
// 保存
const submitId = ref('')
const saveForm = async (formEl: FormInstance | undefined) => {
if (!formEl) { return }
- await formEl.validate((valid, fields) => {
+ await formEl.validate((valid, _fields) => {
if (valid && tableRef.value.checkCertificateList()) {
- ElMessageBox.confirm(
- '确认保存吗?',
- '提示',
- {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- },
- ).then((res) => {
- if ($route.query.category as string === 'season') {
- ruleForm.value.planName = `${currentYear.value}年第${ruleForm.value.season}季度计量计划`
- ruleForm.value.planType = '1'
- }
- else if ($route.query.category as string === 'month') {
- ruleForm.value.planName = `${currentYear.value}年${ruleForm.value.month}月月度计量计划`
- ruleForm.value.planType = '2'
- }
- ruleForm.value.equipmentIds = tableRef.value.list
- editPlan(ruleForm.value).then((res) => {
- submitId.value = res.data
- ElMessage.success('保存成功')
+ if (tableRef.value.list.length) {
+ ElMessageBox.confirm(
+ '确认保存吗?',
+ '提示',
+ {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning',
+ },
+ ).then((_res) => {
+ if ($route.query.category as string === 'season') {
+ ruleForm.value.planName = `${currentYear.value}年第${ruleForm.value.season}季度计量计划`
+ ruleForm.value.planType = '1'
+ }
+ else if ($route.query.category as string === 'month') {
+ ruleForm.value.planName = `${currentYear.value}年${ruleForm.value.month}月月度计量计划`
+ ruleForm.value.planType = '2'
+ }
+ ruleForm.value.equipmentIds = tableRef.value.list.map((item: any) => item.equipmentId)
+ editPlan(ruleForm.value).then((res) => {
+ submitId.value = res.data
+ ElMessage.success('保存成功')
// close()
+ }).catch((_err) => {
+ ruleForm.value.equipmentIds = tableRef.value.list
+ })
})
- })
+ }
+ else {
+ ElMessage.warning('请先添加设备')
+ }
}
})
}
@@ -158,10 +170,12 @@
cancelButtonText: '取消',
type: 'warning',
},
- ).then((res) => {
- submitPlan({ id: submitId.value, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => {
+ ).then((_res) => {
+ submitPlan({ id: submitId.value, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((_res) => {
ElMessage.success('已提交')
close()
+ }).catch((_err) => {
+ ruleForm.value.equipmentIds = tableRef.value.list
})
})
}
@@ -248,7 +262,7 @@
-
+
diff --git a/src/views/tested/MeasurementPlan/plan/components/list.vue b/src/views/tested/MeasurementPlan/plan/components/list.vue
index 7408d81..8b5281f 100644
--- a/src/views/tested/MeasurementPlan/plan/components/list.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/list.vue
@@ -55,7 +55,7 @@
},
{
text: '计划分类',
- value: 'planTypeName',
+ value: 'planCategory',
align: 'center',
},
{
@@ -85,6 +85,8 @@
// 获取列表数据
const fetchData = (isNowPage = true) => {
+ list.value = []
+ total.value = 0
listLoading.value = true
if (!isNowPage) {
// 是否显示当前页,否则跳转第一页
@@ -137,7 +139,6 @@
fetchData()
}
-
const $router = useRouter()
// 新建编辑操作
const handler = (row: any, type: string, category: string) => {
diff --git a/src/views/tested/MeasurementPlan/plan/components/table.vue b/src/views/tested/MeasurementPlan/plan/components/table.vue
index 2a75cc7..2b8f5a6 100644
--- a/src/views/tested/MeasurementPlan/plan/components/table.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/table.vue
@@ -3,6 +3,7 @@
import { ElMessage, ElMessageBox } from 'element-plus'
import selectDevice from './selectDevice.vue'
import { useCheckList } from '@/utils/useCheckList'
+import type { IlistObjType } from '@/views/tested/device/info/components/interface'
const $props = defineProps({
data: {
type: Array,
@@ -59,19 +60,19 @@
isSelect: false, // 是否下拉框
},
])
-const list = ref([])
+const list = ref([])
// 检查数据列表
function checkCertificateList() {
- return useCheckList(list.value, columns.value, '设备信息')
+ return useCheckList(list.value as any, columns.value as any, '设备信息')
}
// 将列表置为不可编辑状态
function setAllRowReadable() {
- for (const item of list.value) {
+ for (const item of list.value as IlistObjType[]) {
item.editable = false
}
}
// 双击行显示输入框
-const dblclickRow = (row: any) => {
+const dblclickRow = (row: IlistObjType) => {
if ($props.status == 'detail') {
return
}
@@ -80,7 +81,7 @@
}
const SelectionList = ref()
// 表格选中
-const handleSelectionChange = (e: any[]) => {
+const handleSelectionChange = (e: IlistObjType[]) => {
SelectionList.value = e
}
// 添加行
@@ -97,7 +98,7 @@
certificateValid: '',
installLocation: '',
editable: true,
- })
+ } as any)
}
}
// 删除行
@@ -117,7 +118,7 @@
}
}
// 选择设备
-const confirm = (device: any) => {
+const confirm = (device: IlistObjType) => {
// 判断是单选还是多选
if (Array.isArray(device)) {
// 多选
@@ -149,16 +150,15 @@
}
}
const initDialog = () => {
- list.value = $props.data
+ list.value = $props.data as IlistObjType[]
dialogStatus.value = $props.status
}
// 批量增加
const batch = () => {
deviceRef.value.initDialog(true)
}
-watch(() => $props.data, (newVal) => {
+watch(() => $props.data as IlistObjType[], (newVal: IlistObjType[]) => {
if (newVal) {
- console.log(newVal, 'newVal')
list.value = newVal
}
}, {
@@ -192,7 +192,7 @@
diff --git a/src/views/tested/device/info/components/interface.ts b/src/views/tested/device/info/components/interface.ts
index 829e634..e376311 100644
--- a/src/views/tested/device/info/components/interface.ts
+++ b/src/views/tested/device/info/components/interface.ts
@@ -30,7 +30,7 @@
equipmentNo: string
equipmentType: string
groupInfos: string
- id: string
+ id: string | null
installLocation: string
installLocationExt: string
instructionsFile: string
@@ -55,4 +55,5 @@
useSign: string
processId?: string
equipmentId?: string
+ editable?: boolean
}
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 @@
{ $router.back() }" />
-
+
提交
@@ -124,13 +159,13 @@
>
-
-
+
+
-
-
+
+
@@ -149,15 +184,15 @@
-
-
+
+
-
+
diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue
index e97de56..4bf8f21 100644
--- a/src/views/tested/MeasurementPlan/early/components/list.vue
+++ b/src/views/tested/MeasurementPlan/early/components/list.vue
@@ -2,7 +2,7 @@
+
+
@@ -174,12 +244,12 @@
-
+
@@ -189,15 +259,45 @@
:is-showmulti-select="true" @change="changePage"
>
-
+
-
+
查看
-
+
编辑
-
+
+ 同意
+
+
+ 拒绝
+
+
+ 提交
+
+
+ 取消
+
+
删除
diff --git a/src/views/tested/MeasurementPlan/early/components/table.vue b/src/views/tested/MeasurementPlan/early/components/table.vue
index 2ba90fc..2cda7e8 100644
--- a/src/views/tested/MeasurementPlan/early/components/table.vue
+++ b/src/views/tested/MeasurementPlan/early/components/table.vue
@@ -172,7 +172,7 @@
-
+
diff --git a/src/views/tested/MeasurementPlan/plan/components/detail.vue b/src/views/tested/MeasurementPlan/plan/components/detail.vue
index 0f7c544..33cbe41 100644
--- a/src/views/tested/MeasurementPlan/plan/components/detail.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/detail.vue
@@ -59,6 +59,13 @@
})
})
}
+// 追加计划
+const append = () => {
+ $router.push({
+ path: '/plan/update',
+ query: { ...$route.query, append: 'true' },
+ })
+}
@@ -66,6 +73,12 @@
{ $router.back() }" />
+
+ 发送送检通知
+
+
+ 追加计划
+
同意
@@ -81,7 +94,7 @@
-
+
打印
diff --git a/src/views/tested/MeasurementPlan/plan/components/edit.vue b/src/views/tested/MeasurementPlan/plan/components/edit.vue
index 5d1f8a8..76b6194 100644
--- a/src/views/tested/MeasurementPlan/plan/components/edit.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/edit.vue
@@ -86,9 +86,13 @@
}
// 获取计划列表
getInfoList(data.id, '').then((res) => {
- console.log(res, '计划列表')
ruleForm.value.equipmentIds = res.data
})
+ // 判断是否追加计划
+ if ($route.query.append) {
+ // 修改计量计划为追加
+ ruleForm.value.planCategory = '1'
+ }
// detailPlan(data.id).then((res) => {
// // ruleForm.value = res.data
// console.log(res.data, '基本信息')
@@ -108,39 +112,47 @@
})
// 关闭弹窗
const close = () => {
- $router.back()
+ // $router.back()
+ $router.push({ path: '/plan' })
}
const tableRef = ref()
// 保存
const submitId = ref('')
const saveForm = async (formEl: FormInstance | undefined) => {
if (!formEl) { return }
- await formEl.validate((valid, fields) => {
+ await formEl.validate((valid, _fields) => {
if (valid && tableRef.value.checkCertificateList()) {
- ElMessageBox.confirm(
- '确认保存吗?',
- '提示',
- {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- },
- ).then((res) => {
- if ($route.query.category as string === 'season') {
- ruleForm.value.planName = `${currentYear.value}年第${ruleForm.value.season}季度计量计划`
- ruleForm.value.planType = '1'
- }
- else if ($route.query.category as string === 'month') {
- ruleForm.value.planName = `${currentYear.value}年${ruleForm.value.month}月月度计量计划`
- ruleForm.value.planType = '2'
- }
- ruleForm.value.equipmentIds = tableRef.value.list
- editPlan(ruleForm.value).then((res) => {
- submitId.value = res.data
- ElMessage.success('保存成功')
+ if (tableRef.value.list.length) {
+ ElMessageBox.confirm(
+ '确认保存吗?',
+ '提示',
+ {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning',
+ },
+ ).then((_res) => {
+ if ($route.query.category as string === 'season') {
+ ruleForm.value.planName = `${currentYear.value}年第${ruleForm.value.season}季度计量计划`
+ ruleForm.value.planType = '1'
+ }
+ else if ($route.query.category as string === 'month') {
+ ruleForm.value.planName = `${currentYear.value}年${ruleForm.value.month}月月度计量计划`
+ ruleForm.value.planType = '2'
+ }
+ ruleForm.value.equipmentIds = tableRef.value.list.map((item: any) => item.equipmentId)
+ editPlan(ruleForm.value).then((res) => {
+ submitId.value = res.data
+ ElMessage.success('保存成功')
// close()
+ }).catch((_err) => {
+ ruleForm.value.equipmentIds = tableRef.value.list
+ })
})
- })
+ }
+ else {
+ ElMessage.warning('请先添加设备')
+ }
}
})
}
@@ -158,10 +170,12 @@
cancelButtonText: '取消',
type: 'warning',
},
- ).then((res) => {
- submitPlan({ id: submitId.value, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => {
+ ).then((_res) => {
+ submitPlan({ id: submitId.value, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((_res) => {
ElMessage.success('已提交')
close()
+ }).catch((_err) => {
+ ruleForm.value.equipmentIds = tableRef.value.list
})
})
}
@@ -248,7 +262,7 @@
-
+
diff --git a/src/views/tested/MeasurementPlan/plan/components/list.vue b/src/views/tested/MeasurementPlan/plan/components/list.vue
index 7408d81..8b5281f 100644
--- a/src/views/tested/MeasurementPlan/plan/components/list.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/list.vue
@@ -55,7 +55,7 @@
},
{
text: '计划分类',
- value: 'planTypeName',
+ value: 'planCategory',
align: 'center',
},
{
@@ -85,6 +85,8 @@
// 获取列表数据
const fetchData = (isNowPage = true) => {
+ list.value = []
+ total.value = 0
listLoading.value = true
if (!isNowPage) {
// 是否显示当前页,否则跳转第一页
@@ -137,7 +139,6 @@
fetchData()
}
-
const $router = useRouter()
// 新建编辑操作
const handler = (row: any, type: string, category: string) => {
diff --git a/src/views/tested/MeasurementPlan/plan/components/table.vue b/src/views/tested/MeasurementPlan/plan/components/table.vue
index 2a75cc7..2b8f5a6 100644
--- a/src/views/tested/MeasurementPlan/plan/components/table.vue
+++ b/src/views/tested/MeasurementPlan/plan/components/table.vue
@@ -3,6 +3,7 @@
import { ElMessage, ElMessageBox } from 'element-plus'
import selectDevice from './selectDevice.vue'
import { useCheckList } from '@/utils/useCheckList'
+import type { IlistObjType } from '@/views/tested/device/info/components/interface'
const $props = defineProps({
data: {
type: Array,
@@ -59,19 +60,19 @@
isSelect: false, // 是否下拉框
},
])
-const list = ref([])
+const list = ref([])
// 检查数据列表
function checkCertificateList() {
- return useCheckList(list.value, columns.value, '设备信息')
+ return useCheckList(list.value as any, columns.value as any, '设备信息')
}
// 将列表置为不可编辑状态
function setAllRowReadable() {
- for (const item of list.value) {
+ for (const item of list.value as IlistObjType[]) {
item.editable = false
}
}
// 双击行显示输入框
-const dblclickRow = (row: any) => {
+const dblclickRow = (row: IlistObjType) => {
if ($props.status == 'detail') {
return
}
@@ -80,7 +81,7 @@
}
const SelectionList = ref()
// 表格选中
-const handleSelectionChange = (e: any[]) => {
+const handleSelectionChange = (e: IlistObjType[]) => {
SelectionList.value = e
}
// 添加行
@@ -97,7 +98,7 @@
certificateValid: '',
installLocation: '',
editable: true,
- })
+ } as any)
}
}
// 删除行
@@ -117,7 +118,7 @@
}
}
// 选择设备
-const confirm = (device: any) => {
+const confirm = (device: IlistObjType) => {
// 判断是单选还是多选
if (Array.isArray(device)) {
// 多选
@@ -149,16 +150,15 @@
}
}
const initDialog = () => {
- list.value = $props.data
+ list.value = $props.data as IlistObjType[]
dialogStatus.value = $props.status
}
// 批量增加
const batch = () => {
deviceRef.value.initDialog(true)
}
-watch(() => $props.data, (newVal) => {
+watch(() => $props.data as IlistObjType[], (newVal: IlistObjType[]) => {
if (newVal) {
- console.log(newVal, 'newVal')
list.value = newVal
}
}, {
@@ -192,7 +192,7 @@
diff --git a/src/views/tested/device/info/components/interface.ts b/src/views/tested/device/info/components/interface.ts
index 829e634..e376311 100644
--- a/src/views/tested/device/info/components/interface.ts
+++ b/src/views/tested/device/info/components/interface.ts
@@ -30,7 +30,7 @@
equipmentNo: string
equipmentType: string
groupInfos: string
- id: string
+ id: string | null
installLocation: string
installLocationExt: string
instructionsFile: string
@@ -55,4 +55,5 @@
useSign: string
processId?: string
equipmentId?: string
+ editable?: boolean
}
diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue
index f7bcf6e..904f543 100644
--- a/src/views/tested/device/info/components/list.vue
+++ b/src/views/tested/device/info/components/list.vue
@@ -124,6 +124,8 @@
// 获取列表数据
const fetchData = (isNowPage = true) => {
+ list.value = []
+ total.value = 0
listLoading.value = true
if (!isNowPage) {
// 是否显示当前页,否则跳转第一页
@@ -246,7 +248,6 @@
}
// 删除
const valiate = (val: string | any) => {
- console.log(val, 'val')
if (val) {
return true
}
@@ -254,6 +255,7 @@
return false
}
}
+// 删除
const delHandler = (row: IlistObjType) => {
if ($props.statusName === '全部') {
// 删除设备
@@ -264,14 +266,18 @@
inputErrorMessage: '请输入原因',
})
.then(({ value }) => {
+ console.log(row, 'row')
editInfo({
approvalType: '3',
- equipmentId: row.equipmentId,
- id: row.id,
- season: value,
+ equipmentId: row.id,
+ id: null,
}).then((res) => {
- ElMessage.success('操作成功')
- search()
+ // ElMessage.success('操作成功')
+ // search()
+ submitInfo({ id: res.data, formId: SCHEDULE.DEVICE_INFO_APPROVAL, reason: value, processId: row.processId }).then((res) => {
+ ElMessage.success('操作成功')
+ search()
+ })
})
// ElMessage({
// type: 'success',