diff --git a/src/api/detection/records/index.ts b/src/api/detection/records/index.ts index f903aca..7ab4c27 100644 --- a/src/api/detection/records/index.ts +++ b/src/api/detection/records/index.ts @@ -61,8 +61,8 @@ export const importTemplate = (itemType:string) => { } // 提交导入记录 -export const saveRecords = async (id: number) => { - return await request.get({ url: `/detection/records/saveRecords?id=` + id }) +export const saveRecords = async (id: number,itemType:string) => { + return await request.get({ url: `/detection/records/saveRecords?id=` + id +'&itemType='+itemType}) } //每次导入前会传模版id后端会根据模版id和用户id把草稿状态的数据逻辑删除 diff --git a/src/api/detection/unqualified/index.ts b/src/api/detection/unqualified/index.ts new file mode 100644 index 0000000..2014b1d --- /dev/null +++ b/src/api/detection/unqualified/index.ts @@ -0,0 +1,35 @@ +import request from '@/config/axios' + +export interface RecordsDetailsVO { + id: number + templateItemId: number + templateId: number + detectValue: number + result: string + saveStatus: string + remark: string + version: string + contents?:string + methods?:string + upLimit?:string + downLimit?:string + itemCode?:string + ProjectCode?:string + itemType?:string + +} + +// 查询不合格品检测记录列表 +export const getRecordsDetailsPage = async (params) => { + return await request.get({ url: `/detection/recordsdetails/selectUnqualifiedPage`, params }) +} + +// 删除检测记录详细 +export const deleteRecordsDetails = async (id: number) => { + return await request.delete({ url: `/detection/recordsdetails/delete?id=` + id }) +} + +// 删除检测记录详细 +export const batchDeleteRecordDetails = async (ids: Array) => { + return await request.delete({ url: `/detection/recordsdetails/batchDelete?ids=` + ids}) +} diff --git a/src/components/ImportForm/src/DetecImportForm.vue b/src/components/ImportForm/src/DetecImportForm.vue index c8790ff..56fed6a 100644 --- a/src/components/ImportForm/src/DetecImportForm.vue +++ b/src/components/ImportForm/src/DetecImportForm.vue @@ -411,6 +411,7 @@ const submitFormSuccess = (response: any) => { decRecId:decRecId, saveStatus:1, result:"NG", + itemType:queryParams.detectionType }); uploadOpen.value = false; } @@ -422,7 +423,7 @@ const submitFormError = (): void => { //提交数据 const saveSubmit = async () => { - await RecordsApi.saveRecords(decRecId.value); + await RecordsApi.saveRecords(decRecId.value,queryParams.detectionType); dialogVisible.value =false emits('success') diff --git a/src/views/board/Index.vue b/src/views/board/Index.vue index 35bcd2f..2642447 100644 --- a/src/views/board/Index.vue +++ b/src/views/board/Index.vue @@ -8,7 +8,7 @@
{{date}}
- +
    @@ -81,7 +81,7 @@
- +
合格数据
diff --git a/src/views/board/Index1.vue b/src/views/board/Index1.vue index a595169..feba29c 100644 --- a/src/views/board/Index1.vue +++ b/src/views/board/Index1.vue @@ -8,7 +8,7 @@
{{date}}
- +
    @@ -81,7 +81,7 @@
- +
合格数据
diff --git a/src/views/detection/records/records.data.ts b/src/views/detection/records/records.data.ts index 658e22d..fb75dd5 100644 --- a/src/views/detection/records/records.data.ts +++ b/src/views/detection/records/records.data.ts @@ -112,7 +112,6 @@ export const Records = useCrudSchemas(reactive([ { label: '创建时间', field: 'createTime', - sort: 'custom', formatter: dateFormatter, isSearch: true, search: { diff --git a/src/views/detection/unqualified/index.vue b/src/views/detection/unqualified/index.vue new file mode 100644 index 0000000..c5533fa --- /dev/null +++ b/src/views/detection/unqualified/index.vue @@ -0,0 +1,203 @@ + + + diff --git a/src/views/detection/unqualified/unqualified.data.ts b/src/views/detection/unqualified/unqualified.data.ts new file mode 100644 index 0000000..56126ed --- /dev/null +++ b/src/views/detection/unqualified/unqualified.data.ts @@ -0,0 +1,148 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import * as itembasicApi from '@/api/spc/itembasic/index' +import * as ProjectApi from '@/api/spc/project/index' +const itembasicList = await itembasicApi.getList({}); +const projectList = await ProjectApi.getList({}); + + +export const Unqualified = useCrudSchemas(reactive([ + { + label: '模版id', + field: 'templateId', + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '项目编码', + field: 'projectCode', + isSearch: true, + search: { + show: true, + component: 'Select', + api: () => projectList, + componentProps: { + filterable:true, + optionsAlias: { + labelField: 'code', + valueField: 'code' + } + } + }, + }, + { + label: '物料编号', + field: 'itemCode', + isSearch: true, + search: { + show: true, + component: 'Select', + api: () => itembasicList, + componentProps: { + filterable:true, + optionsAlias: { + labelField: 'code', + valueField: 'code' + } + } + }, + }, + { + label: '检测模版类型', + field: 'itemType', + dictType: DICT_TYPE.ITEMBASIC_TYPE, + dictClass: 'string', + isTable: true, + isSearch:true, + search:{ + componentProps: { + filterable:true + + // inactiveValue: 'DISABLE', + // activeValue: 'ENABLE', + } + }, + // table: { + // width: 100 + // } , + form: { + component: 'Select', + componentProps: { + filterable:true + + // inactiveValue: 'DISABLE', + // activeValue: 'ENABLE', + } + }, + }, + + { + label: '检测内容', + field: 'contents', + isSearch: true, + isTable:true, + }, + { + label: '检测值', + field: 'detectValue', + isSearch: false, + isTable:true, + }, + { + label: '检测结果', + field: 'result', + isSearch: false, + isTable:true, + }, + { + label: '上限', + field: 'upLimit', + isSearch: false, + isTable:false, + }, + { + label: '下限', + field: 'downLimit', + isSearch: false, + isTable:false, + }, + { + label: '行号', + field: 'recodeLines', + isSearch: false, + isTable:true, + }, + { + label: '列号', + field: 'recodeColumns', + isSearch: false, + isTable:true, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/spc/itembasic/itembasic.data.ts b/src/views/spc/itembasic/itembasic.data.ts index 2d0c6db..2f3138f 100644 --- a/src/views/spc/itembasic/itembasic.data.ts +++ b/src/views/spc/itembasic/itembasic.data.ts @@ -74,25 +74,12 @@ export const Itembasic = useCrudSchemas(reactive([ isSearch: true, isTable:true, }, - // { - // label: '颜色', - // field: 'color', - // sort: 'custom', - // dictType: DICT_TYPE.ITEM_COLOR, - // dictClass: 'string', - // isTable: true, - // table: { - // width: 100 - // } , - - // // form: { - // // component: 'Select', - // // componentProps: { - // // // inactiveValue: 'DISABLE', - // // // activeValue: 'ENABLE', - // // } - // // }, - // }, + { + label: '色差模版代码', + field: 'detectionField', + isTable: true, + isSearch: false, + }, { label: '创建时间',