修改质检项管理 工序管理 工位交接页面问题 编写派工工单 汇报信息 质检信息

This commit is contained in:
shaoleiliu-netizen123 2026-07-25 20:52:44 +08:00
parent 3e2518d151
commit 4c974947af
17 changed files with 969 additions and 352 deletions

View File

@ -28,6 +28,8 @@ export interface BasicProcessPlan {
createTime?: string
status?:number
}
// 基础主数据--工序表 API

View File

@ -20,6 +20,7 @@ export interface Device{
synEquipId?: number | null,
createTime:string,
updateTime:string
abnormalRecordList:[]
}
export interface DeviceRealtimeVO {

View File

@ -0,0 +1,112 @@
import { request } from '@/utils/request'
// 设备异常记录表 类型定义
export interface DeviceAbnormalRecord {
id?: number
abnormalCode?: string
deviceId?: number
deviceCode?: string
deviceName?: string
stationId?: number
stationName?: string
abnormalType?: string
abnormalTypeName?: string
abnormalLevel?: string
abnormalLevelName?: string
abnormalDesc?: string
abnormalTime?: string
status?: string
statusName?: string
handler?: string
handleTime?: string
handleResult?: string
affectDuration?: number
abnormalFrequency?: string
remark?: string
createTime?: string
createBy?: string
}
// 设备异常记录表 API
export const deviceAbnormalRecordApi = {
// 分页查询
page(params: { page: number; pageSize: number; id?: number; status?: string }) {
return request({ url: '/biz/deviceAbnormalRecord/page', method: 'get', params })
},
// 获取详情
detail(id: number) {
return request({ url: `/biz/deviceAbnormalRecord/${id}`, method: 'get' })
},
// 新增
create(data: DeviceAbnormalRecord) {
return request({ url: '/biz/deviceAbnormalRecord', method: 'post', data })
},
// 修改
update(data: DeviceAbnormalRecord) {
return request({ url: '/biz/deviceAbnormalRecord', method: 'put', data })
},
// 删除
delete(ids: number[]) {
return request({ url: `/biz/deviceAbnormalRecord/${ids.join(',')}`, method: 'delete' })
},
// 导出
export(params?: { ids?: number[]; id?: number; status?: string }) {
const p: Record<string, any> = {}
if (params?.ids?.length) p.ids = params.ids.join(',')
if (params?.id !== undefined && params?.id !== null) p.id = params.id
if (params?.status !== undefined && params?.status !== null) p.status = params.status
return request({ url: `/biz/deviceAbnormalRecord/export`, method: 'get', params: p, responseType: 'blob' })
},
// 导入
importData(file: File) {
const formData = new FormData()
formData.append('file', file)
return request<{ success: number; fail: number; errors: string[] }>({
url: `/biz/deviceAbnormalRecord/import`,
method: 'post',
data: formData,
headers: { 'Content-Type': 'multipart/form-data' }
})
},
// 下载导入模板
downloadTemplate() {
return request({ url: `/biz/deviceAbnormalRecord/template`, method: 'get', responseType: 'blob' })
},
//根据设备Id获取异常记录列表
getDeviceErrorLogList(deviceId: number) {
return request({
url: `/biz/deviceAbnormalRecord/getDeviceErrorLogList/${deviceId}`,
method: 'get'
})
}
}

View File

@ -1,5 +1,19 @@
import { request } from '@/utils/request'
export interface ncCode {
id?: number,
ncCode?: string,
ncName?: string,
ncContent?: string,
ncDesc?: string,
status?: number,
createTime?: string,
updateTime?: string,
remark?: string,
createBy?: string,
}
//新增代码库
export function addnccode(data:any) {
return request({

View File

@ -1,5 +1,5 @@
import { request } from '@/utils/request'
import { any } from 'three/tsl'
// 质检项表 类型定义
export interface QcItem {
@ -11,7 +11,9 @@ export interface QcItem {
plans?: string
desc?: string
description?: string
status?: number
createby?: number

View File

@ -8,6 +8,9 @@ export interface QcitemProcess {
processId?: number
page?:number
pageSize?:number
}
// 质检项和工序关联表 API

View File

@ -1,5 +1,5 @@
import { request } from '@/utils/request'
import { st } from 'vue-router/dist/router-CWoNjPRp.mjs'
export interface Section{
id?: number,
@ -70,10 +70,16 @@ export const sectionApi = {
list(params:{sectionName:string}) {
return request({
url:"/biz/section/list",
url:"/biz/section/listBySectionName",
method:"get",
params
})
},
listNoParam(){
return request({
url:"/biz/section/list",
method:"get"
})
}
}

View File

@ -276,7 +276,6 @@ import {
reactive,
h,
onMounted,
watch,
} from 'vue'
@ -286,29 +285,28 @@ import {
NSpace,
NPagination,
NGrid,
// NGi,
NTag,
useMessage,
useDialog,
//type FormInst,
NDropdown,
} from 'naive-ui'
import {
SearchOutline,
RefreshOutline,
AddOutline,
ArrowDownCircleOutline
ArrowDownCircleOutline,
EllipsisHorizontalOutline
} from '@vicons/ionicons5'
import { useUserStore } from '@/stores/user'
//import { dictDataApi } from '@/api/org'
import {
addnccode,
nccodelist,
batchIssue,
deleteIssue,
editccode,
issuecopy
issuecopy,
ncCode
} from '@/api/nccode'
@ -323,6 +321,7 @@ const userStore = useUserStore()
//
const hasPermission = (permission: string) => userStore.hasPermission(permission)
const ncDispatchRecords = ref<ncCode[]>([])
//
//const qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
@ -409,31 +408,6 @@ const columns = [
return '禁用'
}
},
{
align:"center",
title:"是否下发",
key:"isIssued",
minWidth:150,
render(row:any) {
if(row.status == 1){
return '已下发'
}
return '未下发'
}
},
{
align:"center",
title:"下发时间",
key:"issueTime",
minWidth:150
},
{
align:"center",
title:"下发人",
key:"issueBy",
minWidth:150
},
{
align:"center",
title:"备注",
@ -484,33 +458,29 @@ const columns = [
{ default: () => '编辑'}
))
}
if(hasPermission('biz:ncCode:remove')){
buttons.push(h(NButton, {
size: 'small',
type:'error',
ghost:true,
onClick: () => {
dialog.warning({
title: '警告',
content: `你确定删除NC代码编号为:${row.ncCode}的数据`,
positiveText: '确定',
negativeText: '取消',
//draggable: true,
onPositiveClick: () => {
deleteIssue(row.id).then(() => {
message.success('操作成功')
})
},
onNegativeClick: () => {
buttons.push(
h(NDropdown,{
trigger:'click',
options:[
{label:"下发记录",key:"dispatchRecord"},
{type: 'divider' },
],
onSelect:(key:string)=>{
switch(key) {
case "dispatchRecord":
handleDispatchRecord(row)
break
}
})
} },
{ default: () => '删除'}
))
}
},{
// /
default: () => h(NButton, { size: 'small', quaternary: true }, {
default: () => [h(NIcon, null, { default: () => h(EllipsisHorizontalOutline) })]
})
})
)
return buttons.length > 0 ? h(NSpace, {justify:'center'}, { default: () => buttons }) : '-'
@ -756,6 +726,13 @@ function isssavehand() {
getlist()
//
async function handleDispatchRecord(row:ncCode){
const ncId = row.id
// ncDispatchRecords.value = await
}
onMounted(() => {
//loadDictOptions()

View File

@ -33,10 +33,10 @@
<template #icon><n-icon><DownloadOutline /></n-icon></template>
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
</n-button>
<n-button type="error" :disabled="selectedIds.length === 0" @click="handleBatchDelete">
<!-- <n-button type="error" :disabled="selectedIds.length === 0" @click="handleBatchDelete">
<template #icon><n-icon><TrashOutline /></n-icon></template>
删除
</n-button>
</n-button> -->
</n-space>
</div>
@ -287,6 +287,7 @@ const defaultFormData: BasicProcessPlan = {
workCenterName: '',
departmentName: '',
operDescription: '',
status:undefined
}
const formData = reactive<BasicProcessPlan>({ ...defaultFormData })
@ -328,6 +329,30 @@ const columns: DataTableColumns<BasicProcessPlan> = [
{ title: '工作中心', key: 'workCenterName' },
{ title: '生产车间', key: 'departmentName' },
{ title: '工序说明', key: 'operDescription' },
{ title: '状态', key: 'status',
render(row){
if(row.status == 0){
return h(NTag, {
type:'error',
size: 'small'
},
{
default: () => '禁用'
}
)
}
if(row.status == 1){
return h(NTag, {
type:'success',
size: 'small'
},
{
default: () => '启用'
}
)
}
}
},
{ title: '创建人', key: 'createBy' },
{ title: '创建时间', key: 'createTime', width: 180 },
{
@ -340,9 +365,9 @@ const columns: DataTableColumns<BasicProcessPlan> = [
h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
}),
h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' 删除']
}),
// h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
// default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' ']
// }),
h(NButton, { size: 'small', quaternary: true, onClick: () => handleOpenRelateModel(row) }, {
default: () => ['关联质检项']
})

View File

@ -0,0 +1,58 @@
<script setup lang="ts">
import {DeviceAbnormalRecord} from "@/api/deviceAbnormalRecord.ts";
import {DataTableColumns, NDataTable, NTag} from "naive-ui";
import {h, onMounted, ref} from "vue";
import {dictDataApi} from "@/api/org.ts";
const deviceNormalRecordOptions = ref<{ label: string; value: any;class:any }[]>([])
const props = defineProps<{
deviceAbnormalRecordList: DeviceAbnormalRecord[]
}>()
//
const deviceAbnormalRecordColums:DataTableColumns<DeviceAbnormalRecord> = [
{ title: '异常编号', key: 'abnormalCode',align: 'center' },
{ title: '异常类型', key: 'abnormalType',align: 'center' },
{ title: '异常级别', key: 'abnormalLevel',align: 'center'},
{ title: '异常描述', key: 'abnormalDesc',align: 'center' },
{ title: '异常时间', key: 'abnormalTime',align: 'center' },
{ title: '处理状态', key: 'status',align: 'center',
render(row) {
const val = row.status
const opt = deviceNormalRecordOptions.value.find(o => o.value === val || String(o.value) === String(val))
if (!opt) return val ?? '-'
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
},
{ title: '检验完成时间', key: 'inspectTime',align: 'center' },
]
async function loadDictOptions() {
try {
const data = await dictDataApi.listByType('device_abnormal_status')
deviceNormalRecordOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class: d.listClass }))
}catch {}
}
onMounted(()=>{
loadDictOptions()
})
</script>
<template>
<n-card>
<n-data-table
:columns="deviceAbnormalRecordColums"
size="small"
:data="props.deviceAbnormalRecordList"
remote
:scroll-x="600"
/>
</n-card>
</template>
<style scoped>
</style>

View File

@ -10,11 +10,19 @@
<n-form-item>
<n-space>
<n-button type="primary" @click="handleSearch">
<template #icon><n-icon><SearchOutline /></n-icon></template>
<template #icon>
<n-icon>
<SearchOutline/>
</n-icon>
</template>
搜索
</n-button>
<n-button @click="handleReset">
<template #icon><n-icon><RefreshOutline /></n-icon></template>
<template #icon>
<n-icon>
<RefreshOutline/>
</n-icon>
</template>
重置
</n-button>
</n-space>
@ -26,7 +34,11 @@
<div class="table-toolbar">
<n-space>
<n-button type="primary" @click="handleAdd">
<template #icon><n-icon><AddOutline /></n-icon></template>
<template #icon>
<n-icon>
<AddOutline/>
</n-icon>
</template>
新增设备
</n-button>
<n-button @click="goRealtimeBoard">
@ -37,11 +49,19 @@
导入
</n-button> -->
<n-button @click="handleExport">
<template #icon><n-icon><DownloadOutline /></n-icon></template>
<template #icon>
<n-icon>
<DownloadOutline/>
</n-icon>
</template>
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
</n-button>
<n-button type="error" :disabled="selectedIds.length === 0" @click="handleBatchDelete">
<template #icon><n-icon><TrashOutline /></n-icon></template>
<template #icon>
<n-icon>
<TrashOutline/>
</n-icon>
</template>
删除
</n-button>
</n-space>
@ -155,14 +175,20 @@
</n-alert>
<n-space>
<n-button type="primary" @click="handleDownloadTemplate">
<template #icon><n-icon><DownloadOutline /></n-icon></template>
<template #icon>
<n-icon>
<DownloadOutline/>
</n-icon>
</template>
下载模板
</n-button>
</n-space>
<n-upload :max="1" accept=".xlsx,.xls" :show-file-list="true" :custom-request="handleImportUpload">
<n-upload-dragger>
<div style="margin-bottom: 12px">
<n-icon size="48" :depth="3"><CloudUploadOutline /></n-icon>
<n-icon size="48" :depth="3">
<CloudUploadOutline/>
</n-icon>
</div>
<n-text style="font-size: 16px">点击或拖拽文件到此处上传</n-text>
<n-p depth="3" style="margin: 8px 0 0 0">支持 .xlsx .xls 格式</n-p>
@ -173,20 +199,46 @@
<n-button @click="importModalVisible = false">关闭</n-button>
</template>
</n-modal>
<!--异常记录抽屉-->
<n-drawer v-model:show="deviceAbnormalRecordDrawerVisible" :title="title" width="800">
<n-drawer-content :title="title">
<DeviceAbnormalRecordPage
:deviceAbnormalRecordList="deviceAbnormalRecordList"
/>
<template #footer>
<n-button @click="doShowInner">
取消
</n-button>
</template>
</n-drawer-content>
</n-drawer>
</div>
</template>
<script setup lang="ts">
import {ref, reactive, h, onMounted} from 'vue'
import {useRouter} from 'vue-router'
import { NButton, NSpace,NTag, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline } from '@vicons/ionicons5'
import {
NButton, NSpace, NTag, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions,
NDropdown
} from 'naive-ui'
import {
SearchOutline,
RefreshOutline,
AddOutline,
TrashOutline,
CreateOutline,
CloudUploadOutline,
DownloadOutline, EllipsisHorizontalOutline
} from '@vicons/ionicons5'
import {deviceApi, type Device} from '@/api/device'
import {dictDataApi} from '@/api/org'
import {sectionApi, type Section} from '@/api/section'
import {sectionApi} from '@/api/section'
import {SysUser, userApi} from '@/api/system'
import {DeviceAbnormalRecord, deviceAbnormalRecordApi} from "@/api/deviceAbnormalRecord.ts";
import DeviceAbnormalRecordPage from '@/views/biz/device/DeviceAbnomarlRecord.vue'
const message = useMessage()
const dialog = useDialog()
const router = useRouter()
@ -196,6 +248,17 @@ const deviceManagerList = ref<{label:string,value:any}[]>([])
let sectionList = reactive<{ label: string, value: any }[]>([])
//
const deviceErrorLogList = ref<DeviceAbnormalRecord[]>([])
const deviceAbnormalRecordDrawerVisible = ref<Boolean>(false) //
const title = ref('')
//
const deviceIssueRecordList = ref<[]>([])
//
const searchForm = reactive({
deviceCode: null as number | null,
@ -264,7 +327,8 @@ const columns: DataTableColumns<Device> = [
{type: 'selection'},
{title: '设备编码', key: 'deviceCode'},
{title: '设备名称', key: 'deviceName'},
{ title: '新代ID', key: 'synEquipId', width: 90,
{
title: '新代ID', key: 'synEquipId', width: 90,
render: (row) => row.synEquipId ?? '-'
},
{title: '设备类型', key: 'deviceType'},
@ -273,7 +337,8 @@ const columns: DataTableColumns<Device> = [
{title: '设备型号', key: 'spec'},
{title: '生产厂家', key: 'manufacturer'},
{title: '出厂日期', key: 'manufactureDate'},
{ title: '状态', key: 'status',
{
title: '状态', key: 'status',
render: (row) => {
const val = row.status
const opt = statusList.value.find(o => o.value === val || String(o.value) === String(val))
@ -293,8 +358,39 @@ const columns: DataTableColumns<Device> = [
}),
h(NButton, {size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row)}, {
default: () => [h(NIcon, null, {default: () => h(TrashOutline)}), ' 删除']
}),
h(NDropdown, {
trigger: 'hover',
options: [
{
label: '设备异常记录',
key: 'deviceErrorLog',
},
{
label: '设备下发记录',
key: 'deviceDispatchLog',
}
], onSelect: (key: string) => {
switch (key) {
case "deviceErrorLog":
handleDeviceErrorLog(row)
break
case "deviceDispatchLog":
handleDeviceDispatchLog(row)
break
}
}
}, {
// /
default: () => h(NButton, {size: 'small', quaternary: true}, {
default: () => [h(NIcon, null, {default: () => h(EllipsisHorizontalOutline)})]
})
])
})
]
)
}
}
]
@ -487,17 +583,32 @@ async function handleImportUpload({ file }: UploadCustomRequestOptions) {
async function loadDictOptions() {
try {
const data = await dictDataApi.listByType("device_type")
deviceTypeList.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
}catch {}
deviceTypeList.value = data.map(d => ({
label: d.dictLabel,
value: (Number(d.dictValue) || d.dictValue),
class: d.listClass
}))
} catch {
}
try {
const data = await dictDataApi.listByType("sys_status")
statusList.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
}catch {}
statusList.value = data.map(d => ({
label: d.dictLabel,
value: (Number(d.dictValue) || d.dictValue),
class: d.listClass
}))
} catch {
}
try {
const data = await dictDataApi.listByType("mes_device_flag")
deviceFlagList.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
}catch {}
deviceFlagList.value = data.map(d => ({
label: d.dictLabel,
value: (Number(d.dictValue) || d.dictValue),
class: d.listClass
}))
} catch {
}
}
@ -513,6 +624,24 @@ async function handleUser() {
deviceManagerList.value = res
}
//
async function handleDeviceErrorLog(row: Device) {
deviceAbnormalRecordDrawerVisible.value = true
title.value = row.deviceName+"异常记录"
deviceErrorLogList.value = row.abnormalRecordList
}
async function handleDeviceDispatchLog(row: Device) {
const deviceId = row.id
//deviceIssueRecordList.value = await deviceIssueRecordApi.getDeviceDispatchLogList(deviceId)
}
function doShowInner() {
deviceAbnormalRecordDrawerVisible.value = false
}
onMounted(() => {
loadData()
handleUser()

View File

@ -37,10 +37,10 @@
<template #icon><n-icon><DownloadOutline /></n-icon></template>
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
</n-button>
<n-button type="error" :disabled="selectedIds.length === 0" @click="handleBatchDelete">
<!-- <n-button type="error" :disabled="selectedIds.length === 0" @click="handleBatchDelete">
<template #icon><n-icon><TrashOutline /></n-icon></template>
删除
</n-button>
</n-button> -->
</n-space>
</div>
@ -110,6 +110,12 @@
<n-form-item label="质检描述" path="description">
<n-input v-model:value="formData.description" type="textarea" placeholder="请输入质检描述" />
</n-form-item>
<n-form-item label="状态" path="status">
<n-switch v-model:value="formData.status" :checked-value="1" :unchecked-value="0">
<template #checked>检查</template>
<template #unchecked>不检查</template>
</n-switch>
</n-form-item>
</n-form>
<template #footer>
<n-space justify="end">
@ -232,16 +238,16 @@
<script setup lang="ts">
import { ref, reactive, h, onMounted,computed } from 'vue'
import { NButton, NSpace, NIcon, NUpload, useMessage, useDialog, type DataTableColumns,
type UploadCustomRequestOptions,UploadFileInfo, DataTableRowKey, NTag } from 'naive-ui'
import { SearchOutline, RefreshOutline, AddOutline,
TrashOutline, CreateOutline, CloudUploadOutline,NewspaperOutline,DocumentOutline,
type UploadCustomRequestOptions,UploadFileInfo, NTag } from 'naive-ui'
import { SearchOutline, RefreshOutline, AddOutline
, CreateOutline, CloudUploadOutline,NewspaperOutline,DocumentOutline,
DownloadOutline,ArchiveOutline as ArchiveIcon } from '@vicons/ionicons5'
import { qcItemApi, type QcItem } from '@/api/qcItem'
import { fileApi,SysFile } from '@/api/system'
import Button from 'naive-ui/es/button/src/Button'
import { basicProcessPlanApi,BasicProcessPlan } from '@/api/basicProcessPlan'
import {qcitemProcessApi,QcitemProcess} from '@/api/qcitemProcess'
import { number } from 'echarts'
const message = useMessage()
const dialog = useDialog()
@ -298,11 +304,13 @@ const modalTitle = ref('')
const importModalVisible = ref(false)
const formRef = ref()
const defaultFormData: QcItem = {
id:undefined,
name: '',
spec: '',
plans: '',
desc: '',
description: '',
createby: undefined,
status:undefined
}
const formData = reactive<QcItem>({ ...defaultFormData })
@ -325,6 +333,30 @@ const columns: DataTableColumns<QcItem> = [
}
},
{ title: '质检描述', key: 'description' },
{ title: '状态', key: 'status',
render(row){
if(row.status == 0){
return h(NTag, {
type:'error',
size: 'small'
},
{
default: () => '不检查'
}
)
}
if(row.status == 1){
return h(NTag, {
type:'success',
size: 'small'
},
{
default: () => '检查'
}
)
}
}
},
{ title: '创建人', key: 'userName' },
{ title: '创建时间', key: 'createTime', width: 180 },
{ title: '修改时间', key: 'updateTime', width: 180 },
@ -338,9 +370,9 @@ const columns: DataTableColumns<QcItem> = [
h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
}),
h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' 删除']
}),
// h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
// default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' ']
// }),
h(NButton, { size: 'small', quaternary: true, onClick: () => handleProccess(row) }, {
default: () => [' 关联工序']
})
@ -397,6 +429,7 @@ function handleCheck(keys: Array<string | number>) {
//
function handleAdd() {
fileList.value = []
modalTitle.value = '新增质检项表'
Object.assign(formData, defaultFormData)
modalVisible.value = true
@ -404,7 +437,7 @@ function handleAdd() {
//
async function handleEdit(row: QcItem) {
fileList.value = []
modalTitle.value = '编辑质检项表'
const res = await qcItemApi.getPlansFiles({ plans: row.plans })
@ -427,6 +460,7 @@ async function handleEdit(row: QcItem) {
Object.assign(formData, row)
formData.status = Number(row.status)
if (formData.createTime && typeof formData.createTime === 'string') {
formData.createTime = new Date(formData.createTime.replace(' ', 'T')).getTime()
}
@ -476,44 +510,7 @@ async function handleSubmit() {
}
}
//
function handleDelete(row: QcItem) {
dialog.warning({
title: '提示',
content: '确定要删除该记录吗?',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: async () => {
try {
await qcItemApi.delete([row.id!])
message.success('删除成功')
loadData()
} catch (error) {
//
}
}
})
}
//
function handleBatchDelete() {
dialog.warning({
title: '提示',
content: `确定要删除选中的 ${selectedIds.value.length} 条记录吗?`,
positiveText: '确定',
negativeText: '取消',
onPositiveClick: async () => {
try {
await qcItemApi.delete(selectedIds.value)
message.success('删除成功')
selectedIds.value = []
loadData()
} catch (error) {
//
}
}
})
}
//
async function handleExport() {

View File

@ -429,7 +429,7 @@ async function loadDictOptions() {
//
async function loadSection() {
const data = await sectionApi.list()
const data = await sectionApi.listNoParam()
sectionList = data.map((d:any)=> ({ label: d.sectionName, value: (Number(d.id) || d.id) }))
}

View File

@ -38,6 +38,29 @@
</template>
</n-pagination>
</div>
<!--完工汇报弹窗-->
<n-modal v-model:show="showQcReport" :title="reportTitle" style="width: 1000px" >
<div>
<SubmitLogInfoPage
v-if="baseInfo.logOrQuality === 'log'"
:submitLogList="submitLogList"
:baseInfo="baseInfo"
/>
<QualityInfoPage
v-if="baseInfo.logOrQuality === 'Quality'"
:qualityTestingList="qualityList"
:baseInfo="baseInfo"
/>
</div>
<template #footer>
<n-space justify="end">
<n-button @click="showQcReport = false">取消</n-button>
</n-space>
</template>
</n-modal>
</div>
</template>
@ -48,22 +71,43 @@ import {
h,
reactive,
onMounted,
watch,
} from 'vue'
import { mytasks,type AssingWork } from '@/api/production';
import { NButton, NSpace, NIcon, NTag, NDatePicker, NDataTable, useMessage, useDialog, DataTableColumn, DataTableColumns } from 'naive-ui'
import {
NButton, NSpace, NTag, NDataTable, DataTableColumns
} from 'naive-ui'
import { dictDataApi } from '@/api/org'
import { assingWorkDetailApi,AssingWorkDetail } from '@/api/AssingWorkDetail'
import { SubmitLog } from '@/api/submitLog'
import SubmitLogInfoPage from "@/views/production/componets/SubmitLogInfoPage.vue";
import {QualityTesting} from "@/api/qualityTesting.ts";
import QualityInfoPage from "@/views/production/componets/QualityInfoPage.vue";
const defaultBaseInfo = ref({
materialName:undefined,
materialCode:undefined,
processName:undefined,
processCode:undefined,
assingCode:undefined,
logOrQuality:undefined
})
const baseInfo = ref({...defaultBaseInfo})
const qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
//
const tableLoading = ref<Boolean>(false)
const AssingWorkTableData = ref<AssingWork[]>([])
const AssingWorkExpandedKeys = ref<Array<string |number>>([])
const processName = ref<string>()
const AssingWorkColumns :DataTableColumns<AssingWork> = [
{
@ -108,7 +152,7 @@ const AssingWorkColumns :DataTableColumns<AssingWork> = [
},
{
align:'center',
title: '工序名称',
title: '工序编号',
key: 'processCode',
minWidth: 200
},
@ -145,12 +189,6 @@ const AssingWorkColumns :DataTableColumns<AssingWork> = [
key: 'deviceName',
minWidth: 200
},
{
align:'center',
title: '工人名称',
key: 'userName',
minWidth: 200
},
{
align:'center',
title: '数量',
@ -185,12 +223,6 @@ const AssingWorkColumns :DataTableColumns<AssingWork> = [
key: 'completedTime',
minWidth: 180
},
{
align:'center',
title: '创建人',
key: 'createBy',
minWidth: 150
},
{
align:'center',
title: '是否质检打回',
@ -258,9 +290,54 @@ const AssingWorkColumns :DataTableColumns<AssingWork> = [
key: 'reason',
minWidth: 150
},
{
align:'center',
title: '操作',
key: 'action',
width: 250,
fixed: 'right',
render(row:any) {
const buttons:any = []
buttons.push(
h(
NButton,
{
size: 'small',
type: 'primary',
ghost:true,
onClick: () => {
handleReportRecords(row)
}
},
{ default: () => '汇报信息' }
)
)
buttons.push(
h(
NButton,
{
size: 'small',
type: 'primary',
ghost:true,
onClick: () => {
handleQualityRecords(row)
}
},
{ default: () => '质检信息' }
)
)
return buttons.length > 0 ? h(NSpace, {justify:'center'}, { default: () => buttons }) : '-'
}
}
]
const showQcReport = ref<boolean>(false)
const reportTitle = ref<string>()
const submitLogList = ref<SubmitLog[]>([])
const qualityList = ref<QualityTesting[]>([])
//
const loadingRowIds = ref<Set<number>>(new Set())
@ -276,12 +353,6 @@ const AssingWorkDetailColums:DataTableColumns<AssingWorkDetail> = [
return '-'
}
},
{
align:"center",
title:"操作人",
key:"userName",
width:150
},
{
align:"center",
title:"数量",
@ -301,6 +372,12 @@ const AssingWorkDetailColums:DataTableColumns<AssingWorkDetail> = [
return '-'
}
},
{
align:"center",
title:"操作人",
key:"userName",
width:150
},
{
align:"center",
title:"创建时间",
@ -425,8 +502,33 @@ async function loadDictOptions() {
const data = await dictDataApi.listByType('assing_status')
qcAssingStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
}catch {}
}
//
function handleReportRecords(row:any) {
showQcReport.value = true
reportTitle.value = "汇报信息"
submitLogList.value = row.submitLogList
baseInfo.value = {...row}
baseInfo.value.logOrQuality = "log"
}
//
function handleQualityRecords(row:any) {
showQcReport.value = true
reportTitle.value = "质检信息"
qualityList.value = row.qualityTestingList
console.log(qualityList.value)
baseInfo.value = {...row}
baseInfo.value.logOrQuality = "Quality"
}
onMounted(()=>{
getlist()
loadDictOptions()
@ -444,5 +546,7 @@ defineExpose({
.toolbar {
margin-bottom: 12px;
}
.pgClass {
font-weight: bold;
}
</style>

View File

@ -0,0 +1,101 @@
<template>
<n-card>
<n-card style="margin: 12px 0px">
<n-grid :cols="2" style="margin: 10px">
<n-gi>
<span class="pgClass">物料名称</span>
<span>{{props.baseInfo.materialName}}</span>
</n-gi>
<n-gi>
<span class="pgClass">物料编号</span>
<span>{{props.baseInfo.materialCode}}</span>
</n-gi>
</n-grid>
<n-grid :cols="2" style="margin: 10px">
<n-gi>
<span class="pgClass">工序名称</span>
<span>{{props.baseInfo.processName}}</span>
</n-gi>
<n-gi>
<span class="pgClass">派工编号</span>
<span>{{props.baseInfo.assingCode}}</span>
</n-gi>
</n-grid>
</n-card>
<n-data-table
:columns="reportRecordsColums"
size="small"
:data="props.qualityTestingList"
remote
:scroll-x="600"
/>
</n-card>
</template>
<script setup lang="ts">
import { NCard, NDataTable, NGi,NTag, NGrid,DataTableColumns} from "naive-ui";
import {onMounted, ref,h} from "vue";
import { dictDataApi } from '@/api/org'
import {QualityTesting} from "@/api/qualityTesting.ts";
const props =defineProps(
{
qualityTestingList:Object,
baseInfo:Object
}
)
//
const qcSourceTypeOptions = ref<{ label: string; value: any;class:any }[]>([])
const qcStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
//
const reportRecordsColums:DataTableColumns<QualityTesting> = [
{ title: '质检编号', key: 'qcNo',align: 'center' },
{ title: '来源类型', key: 'sourceType',align: 'center',
render(row) {
const val = row.sourceType
const opt = qcSourceTypeOptions.value.find(o => o.value === val || String(o.value) === String(val))
if (!opt) return val ?? '-'
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
},
{ title: '报检总数', key: 'totalQty',align: 'center' },
{ title: '已检验数量', key: 'inspectQty',align: 'center' },
{ title: '质检状态', key: 'status',align: 'center',
render(row) {
const val = row.status
const opt = qcStatusOptions.value.find(o => o.value === val || String(o.value) === String(val))
if (!opt) return val ?? '-'
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
},
{ title: '检验完成时间', key: 'inspectTime',align: 'center' },
]
//
async function loadDictOptions() {
try {
const data = await dictDataApi.listByType('source_type')
qcSourceTypeOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class: d.listClass }))
}catch {}
try {
const data = await dictDataApi.listByType('qc_status')
qcStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class: d.listClass }))
}catch {}
}
onMounted(()=>{
loadDictOptions()
})
</script>
<style scoped>
</style>

View File

@ -0,0 +1,86 @@
<template>
<n-card>
<n-card style="margin: 12px 0px">
<n-grid :cols="2" style="margin: 10px">
<n-gi>
<span class="pgClass">物料名称</span>
<span>{{props.baseInfo.materialName}}</span>
</n-gi>
<n-gi>
<span class="pgClass">物料编号</span>
<span>{{props.baseInfo.materialCode}}</span>
</n-gi>
</n-grid>
<n-grid :cols="2" style="margin: 10px">
<n-gi>
<span class="pgClass">工序名称</span>
<span>{{props.baseInfo.processName}}</span>
</n-gi>
<n-gi>
<span class="pgClass">派工编号</span>
<span>{{props.baseInfo.assingCode}}</span>
</n-gi>
</n-grid>
</n-card>
<n-data-table
:columns="reportRecordsColums"
size="small"
:data="props.submitLogList"
remote
:scroll-x="600"
/>
</n-card>
</template>
<script setup lang="ts">
import { NCard, NDataTable, NGi,NTag, NGrid,DataTableColumns} from "naive-ui";
import {onMounted, ref,h} from "vue";
import { dictDataApi } from '@/api/org'
import { SubmitLog } from '@/api/submitLog'
const props =defineProps(
{
submitLogList:Object,
baseInfo:Object
}
)
//
const submitStatusOptions = ref<{ label: string; value: any ;class:any}[]>([])
//
const reportRecordsColums:DataTableColumns<SubmitLog> = [
{ title: '汇报数量', key: 'quantity',align: 'center'},
{ title: '汇报人', key: 'userName',align: 'center' },
{ title: '派工状态', key: 'submitStatus',align: 'center',
render: (row) => {
const val = row.submitStatus
const opt = submitStatusOptions.value.find(o => o.value === val || String(o.value) === String(val))
if (!opt) return val ?? '-'
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
}
]
//
async function loadDictOptions() {
try {
const data = await dictDataApi.listByType('submit_status')
submitStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
}catch {}
}
onMounted(()=>{
loadDictOptions()
})
</script>
<style scoped>
</style>

View File

@ -198,7 +198,7 @@ import {
reactive,
h,
onMounted,
watch,
watch, Component,
} from 'vue'