( {})
async function handleNoticeClick(item: SysNotice) {
-
-
- const res = await errorNotificationApi.detail(item.errorNotificationId);
- errorNotifiaction.value = {...res}
- errorNotifiaction.value.noticeId = item.id
notice.value = item
//异常填报直接弹窗
showErrorReportModal.value = true
diff --git a/mes-ui/src/views/biz/concessionApply/index.vue b/src/views/biz/exceptionFilter/index.vue
similarity index 67%
rename from mes-ui/src/views/biz/concessionApply/index.vue
rename to src/views/biz/exceptionFilter/index.vue
index f6415ae..b27115d 100644
--- a/mes-ui/src/views/biz/concessionApply/index.vue
+++ b/src/views/biz/exceptionFilter/index.vue
@@ -4,8 +4,11 @@
-
-
+
+
+
+
+
@@ -61,29 +64,26 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ 启用
+
+
+ 禁用
+
+
+
@@ -95,7 +95,7 @@
-
+
导入说明
@@ -131,7 +131,7 @@
import { ref, reactive, h, onMounted } from 'vue'
import { NButton, NSpace, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline } from '@vicons/ionicons5'
-import { concessionApplyApi, type ConcessionApply } from '@/api/concessionApply'
+import { exceptionFilterApi, type ExceptionFilter } from '@/api/exceptionFilter'
import { dictDataApi } from '@/api/org'
const message = useMessage()
@@ -140,10 +140,11 @@ const dialog = useDialog()
// 搜索表单
const searchForm = reactive({
id: null as number | null,
+ status: null as number | null,
})
// 表格数据
-const tableData = ref([])
+const tableData = ref([])
const loading = ref(false)
const selectedIds = ref([])
const pagination = reactive({
@@ -159,47 +160,35 @@ const modalVisible = ref(false)
const modalTitle = ref('')
const importModalVisible = ref(false)
const formRef = ref()
-const defaultFormData: ConcessionApply = {
- qcId: undefined,
- concessionQty: undefined,
- applyRemark: '',
- applyContent: '',
- applyFile: '',
- applyUserId: undefined,
- deptId: undefined,
- instanceId: '',
- approveStatus: undefined,
+const defaultFormData: ExceptionFilter = {
+ title: '',
+ filterCondition: '',
+ description: '',
+ status: undefined,
}
-const formData = reactive({ ...defaultFormData })
+const formData = reactive({ ...defaultFormData })
// 字典选项(下拉框/单选框/复选框关联字典时使用)
-const approveStatusOptions = ref<{ label: string; value: any }[]>([])
+const statusOptions = ref<{ label: string; value: any }[]>([])
// 表单校验规则
const formRules = {
}
// 表格列
-const columns: DataTableColumns = [
+const columns: DataTableColumns = [
{ type: 'selection' },
- { title: '主键id', key: 'id' },
- { title: '质检编号', key: 'qcId' },
- { title: '让步接收数量', key: 'concessionQty' },
- { title: '申请原因', key: 'applyRemark' },
- { title: '申请内容', key: 'applyContent' },
- { title: '申请附件', key: 'applyFile' },
- { title: '申请人id(发去人id)', key: 'applyUserId' },
- { title: '部门id', key: 'deptId' },
- { title: '钉钉单据id', key: 'instanceId' },
- { title: '审批状态 1待审批 2审批通过 3 审批驳回', key: 'approveStatus',
+ { title: '主键ID', key: 'id' },
+ { title: '异常过滤标题', key: 'title' },
+ { title: '过滤条件', key: 'filterCondition' },
+ { title: '描述', key: 'description' },
+ { title: '状态', key: 'status',
render(row) {
- const val = row.approveStatus
- const opt = approveStatusOptions.value.find(o => o.value === val || String(o.value) === String(val))
+ const val = row.status
+ const opt = statusOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-')
}
},
- { title: '创建时间', key: 'createTime', width: 180 },
- { title: '更新时间', key: 'updateTime', width: 180 },
{
title: '操作',
key: 'actions',
@@ -222,10 +211,11 @@ const columns: DataTableColumns = [
async function loadData() {
loading.value = true
try {
- const res = await concessionApplyApi.page({
+ const res = await exceptionFilterApi.page({
page: pagination.page,
pageSize: pagination.pageSize,
id: searchForm.id || undefined,
+ status: searchForm.status || undefined,
})
tableData.value = res.list
pagination.itemCount = res.total
@@ -244,6 +234,8 @@ function handleSearch() {
function handleReset() {
searchForm.id = null
+ searchForm.status = null
+
handleSearch()
}
@@ -266,21 +258,15 @@ function handleCheck(keys: Array) {
// 新增
function handleAdd() {
- modalTitle.value = '新增让步接收申请表'
+ modalTitle.value = '新增异常过滤表'
Object.assign(formData, defaultFormData)
modalVisible.value = true
}
// 编辑
-function handleEdit(row: ConcessionApply) {
- modalTitle.value = '编辑让步接收申请表'
+function handleEdit(row: ExceptionFilter) {
+ modalTitle.value = '编辑异常过滤表'
Object.assign(formData, row)
- if (formData.createTime && typeof formData.createTime === 'string') {
- formData.createTime = new Date(formData.createTime.replace(' ', 'T')).getTime()
- }
- if (formData.updateTime && typeof formData.updateTime === 'string') {
- formData.updateTime = new Date(formData.updateTime.replace(' ', 'T')).getTime()
- }
modalVisible.value = true
}
@@ -288,18 +274,12 @@ function handleEdit(row: ConcessionApply) {
async function handleSubmit() {
await formRef.value?.validate()
try {
- const submitData = { ...formData } as ConcessionApply
- if (typeof submitData.createTime === 'number') {
- submitData.createTime = new Date(submitData.createTime).toISOString().slice(0, 19).replace('T', ' ')
- }
- if (typeof submitData.updateTime === 'number') {
- submitData.updateTime = new Date(submitData.updateTime).toISOString().slice(0, 19).replace('T', ' ')
- }
+ const submitData = { ...formData } as ExceptionFilter
if (submitData.id) {
- await concessionApplyApi.update(submitData)
+ await exceptionFilterApi.update(submitData)
message.success('修改成功')
} else {
- await concessionApplyApi.create(submitData)
+ await exceptionFilterApi.create(submitData)
message.success('新增成功')
}
modalVisible.value = false
@@ -310,7 +290,7 @@ async function handleSubmit() {
}
// 删除
-function handleDelete(row: ConcessionApply) {
+function handleDelete(row: ExceptionFilter) {
dialog.warning({
title: '提示',
content: '确定要删除该记录吗?',
@@ -318,7 +298,7 @@ function handleDelete(row: ConcessionApply) {
negativeText: '取消',
onPositiveClick: async () => {
try {
- await concessionApplyApi.delete([row.id!])
+ await exceptionFilterApi.delete([row.id!])
message.success('删除成功')
loadData()
} catch (error) {
@@ -337,7 +317,7 @@ function handleBatchDelete() {
negativeText: '取消',
onPositiveClick: async () => {
try {
- await concessionApplyApi.delete(selectedIds.value)
+ await exceptionFilterApi.delete(selectedIds.value)
message.success('删除成功')
selectedIds.value = []
loadData()
@@ -354,11 +334,12 @@ async function handleExport() {
const params: Record = {}
if (selectedIds.value.length > 0) params.ids = selectedIds.value
if (searchForm.id != null) params.id = searchForm.id
- const blob = await concessionApplyApi.export(params)
+ if (searchForm.status != null) params.status = searchForm.status
+ const blob = await exceptionFilterApi.export(params)
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
- link.download = '让步接收申请表数据.xlsx'
+ link.download = '异常过滤表数据.xlsx'
link.click()
window.URL.revokeObjectURL(url)
} catch (error) {
@@ -369,11 +350,11 @@ async function handleExport() {
// 下载导入模板
async function handleDownloadTemplate() {
try {
- const blob = await concessionApplyApi.downloadTemplate()
+ const blob = await exceptionFilterApi.downloadTemplate()
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
- link.download = '让步接收申请表导入模板.xlsx'
+ link.download = '异常过滤表导入模板.xlsx'
link.click()
window.URL.revokeObjectURL(url)
} catch (error) {
@@ -385,7 +366,7 @@ async function handleDownloadTemplate() {
async function handleImportUpload({ file }: UploadCustomRequestOptions) {
if (!file.file) return
try {
- const result = await concessionApplyApi.importData(file.file)
+ const result = await exceptionFilterApi.importData(file.file)
if (result.fail > 0) {
dialog.warning({
title: '导入结果',
@@ -406,7 +387,7 @@ async function handleImportUpload({ file }: UploadCustomRequestOptions) {
async function loadDictOptions() {
try {
const data = await dictDataApi.listByType('sys_status')
- approveStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
+ statusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
} catch {}
}
diff --git a/src/views/biz/qualityItem/index.vue b/src/views/biz/qualityItem/index.vue
index 7d22e58..99f94f6 100644
--- a/src/views/biz/qualityItem/index.vue
+++ b/src/views/biz/qualityItem/index.vue
@@ -311,7 +311,7 @@ const defaultFormData: QcItem = {
plans: '',
description: '',
createby: undefined,
- status:undefined
+ status:0
}
const formData = reactive({ ...defaultFormData })
@@ -319,6 +319,8 @@ const formData = reactive({ ...defaultFormData })
// 表单校验规则
const formRules = {
+ name: [{ required: true, message: '请输入质检项名称', trigger: 'blur' }],
+ spec: [{ required: true, message: '请输入质检项规格', trigger: 'blur' }],
}
// 表格列
@@ -497,15 +499,16 @@ async function handleSubmit() {
if (typeof submitData.updateTime === 'number') {
submitData.updateTime = new Date(submitData.updateTime).toISOString().slice(0, 19).replace('T', ' ')
}
- if (submitData.id) {
- await qcItemApi.update(submitData)
- message.success('修改成功')
- } else {
- await qcItemApi.create(submitData)
- message.success('新增成功')
- }
- modalVisible.value = false
- loadData()
+ console.log(submitData)
+ // if (submitData.id) {
+ // await qcItemApi.update(submitData)
+ // message.success('修改成功')
+ // } else {
+ // await qcItemApi.create(submitData)
+ // message.success('新增成功')
+ // }
+ // modalVisible.value = false
+ // loadData()
} catch (error) {
// 错误已在拦截器处理
}