修改质检项管理 工序管理 工位交接页面问题 编写派工工单 汇报信息 质检信息
This commit is contained in:
parent
3e2518d151
commit
4c974947af
@ -28,6 +28,8 @@ export interface BasicProcessPlan {
|
|||||||
|
|
||||||
createTime?: string
|
createTime?: string
|
||||||
|
|
||||||
|
status?:number
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 基础主数据--工序表 API
|
// 基础主数据--工序表 API
|
||||||
|
|||||||
@ -20,6 +20,7 @@ export interface Device{
|
|||||||
synEquipId?: number | null,
|
synEquipId?: number | null,
|
||||||
createTime:string,
|
createTime:string,
|
||||||
updateTime:string
|
updateTime:string
|
||||||
|
abnormalRecordList:[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeviceRealtimeVO {
|
export interface DeviceRealtimeVO {
|
||||||
|
|||||||
112
src/api/deviceAbnormalRecord.ts
Normal file
112
src/api/deviceAbnormalRecord.ts
Normal 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'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,19 @@
|
|||||||
import { request } from '@/utils/request'
|
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) {
|
export function addnccode(data:any) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { request } from '@/utils/request'
|
import { request } from '@/utils/request'
|
||||||
import { any } from 'three/tsl'
|
|
||||||
|
|
||||||
// 质检项表 类型定义
|
// 质检项表 类型定义
|
||||||
export interface QcItem {
|
export interface QcItem {
|
||||||
@ -11,7 +11,9 @@ export interface QcItem {
|
|||||||
|
|
||||||
plans?: string
|
plans?: string
|
||||||
|
|
||||||
desc?: string
|
description?: string
|
||||||
|
|
||||||
|
status?: number
|
||||||
|
|
||||||
createby?: number
|
createby?: number
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,9 @@ export interface QcitemProcess {
|
|||||||
|
|
||||||
processId?: number
|
processId?: number
|
||||||
|
|
||||||
|
page?:number
|
||||||
|
|
||||||
|
pageSize?:number
|
||||||
}
|
}
|
||||||
|
|
||||||
// 质检项和工序关联表 API
|
// 质检项和工序关联表 API
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { request } from '@/utils/request'
|
import { request } from '@/utils/request'
|
||||||
import { st } from 'vue-router/dist/router-CWoNjPRp.mjs'
|
|
||||||
|
|
||||||
export interface Section{
|
export interface Section{
|
||||||
id?: number,
|
id?: number,
|
||||||
@ -70,10 +70,16 @@ export const sectionApi = {
|
|||||||
|
|
||||||
list(params:{sectionName:string}) {
|
list(params:{sectionName:string}) {
|
||||||
return request({
|
return request({
|
||||||
url:"/biz/section/list",
|
url:"/biz/section/listBySectionName",
|
||||||
method:"get",
|
method:"get",
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
listNoParam(){
|
||||||
|
return request({
|
||||||
|
url:"/biz/section/list",
|
||||||
|
method:"get"
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -276,7 +276,6 @@ import {
|
|||||||
reactive,
|
reactive,
|
||||||
h,
|
h,
|
||||||
onMounted,
|
onMounted,
|
||||||
watch,
|
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
|
|
||||||
|
|
||||||
@ -286,29 +285,28 @@ import {
|
|||||||
NSpace,
|
NSpace,
|
||||||
NPagination,
|
NPagination,
|
||||||
NGrid,
|
NGrid,
|
||||||
// NGi,
|
|
||||||
NTag,
|
|
||||||
useMessage,
|
useMessage,
|
||||||
useDialog,
|
useDialog,
|
||||||
//type FormInst,
|
NDropdown,
|
||||||
} from 'naive-ui'
|
} from 'naive-ui'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
SearchOutline,
|
SearchOutline,
|
||||||
RefreshOutline,
|
RefreshOutline,
|
||||||
AddOutline,
|
AddOutline,
|
||||||
ArrowDownCircleOutline
|
ArrowDownCircleOutline,
|
||||||
|
EllipsisHorizontalOutline
|
||||||
} from '@vicons/ionicons5'
|
} from '@vicons/ionicons5'
|
||||||
|
|
||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
//import { dictDataApi } from '@/api/org'
|
|
||||||
import {
|
import {
|
||||||
addnccode,
|
addnccode,
|
||||||
nccodelist,
|
nccodelist,
|
||||||
batchIssue,
|
batchIssue,
|
||||||
deleteIssue,
|
|
||||||
editccode,
|
editccode,
|
||||||
issuecopy
|
issuecopy,
|
||||||
|
ncCode
|
||||||
} from '@/api/nccode'
|
} from '@/api/nccode'
|
||||||
|
|
||||||
|
|
||||||
@ -323,6 +321,7 @@ const userStore = useUserStore()
|
|||||||
// 权限检查
|
// 权限检查
|
||||||
const hasPermission = (permission: string) => userStore.hasPermission(permission)
|
const hasPermission = (permission: string) => userStore.hasPermission(permission)
|
||||||
|
|
||||||
|
const ncDispatchRecords = ref<ncCode[]>([])
|
||||||
|
|
||||||
//派工状态字典
|
//派工状态字典
|
||||||
//const qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
|
//const qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
|
||||||
@ -409,31 +408,6 @@ const columns = [
|
|||||||
return '禁用'
|
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",
|
align:"center",
|
||||||
title:"备注",
|
title:"备注",
|
||||||
@ -484,33 +458,29 @@ const columns = [
|
|||||||
{ default: () => '编辑'}
|
{ 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('操作成功')
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
buttons.push(
|
||||||
onNegativeClick: () => {
|
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 }) : '-'
|
return buttons.length > 0 ? h(NSpace, {justify:'center'}, { default: () => buttons }) : '-'
|
||||||
@ -756,6 +726,13 @@ function isssavehand() {
|
|||||||
|
|
||||||
getlist()
|
getlist()
|
||||||
|
|
||||||
|
//查看下发记录
|
||||||
|
async function handleDispatchRecord(row:ncCode){
|
||||||
|
const ncId = row.id
|
||||||
|
// ncDispatchRecords.value = await
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
||||||
//loadDictOptions()
|
//loadDictOptions()
|
||||||
|
|||||||
@ -33,10 +33,10 @@
|
|||||||
<template #icon><n-icon><DownloadOutline /></n-icon></template>
|
<template #icon><n-icon><DownloadOutline /></n-icon></template>
|
||||||
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
|
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
|
||||||
</n-button>
|
</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>
|
<template #icon><n-icon><TrashOutline /></n-icon></template>
|
||||||
删除
|
删除
|
||||||
</n-button>
|
</n-button> -->
|
||||||
</n-space>
|
</n-space>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -287,6 +287,7 @@ const defaultFormData: BasicProcessPlan = {
|
|||||||
workCenterName: '',
|
workCenterName: '',
|
||||||
departmentName: '',
|
departmentName: '',
|
||||||
operDescription: '',
|
operDescription: '',
|
||||||
|
status:undefined
|
||||||
}
|
}
|
||||||
const formData = reactive<BasicProcessPlan>({ ...defaultFormData })
|
const formData = reactive<BasicProcessPlan>({ ...defaultFormData })
|
||||||
|
|
||||||
@ -328,6 +329,30 @@ const columns: DataTableColumns<BasicProcessPlan> = [
|
|||||||
{ title: '工作中心', key: 'workCenterName' },
|
{ title: '工作中心', key: 'workCenterName' },
|
||||||
{ title: '生产车间', key: 'departmentName' },
|
{ title: '生产车间', key: 'departmentName' },
|
||||||
{ title: '工序说明', key: 'operDescription' },
|
{ 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: 'createBy' },
|
||||||
{ title: '创建时间', key: 'createTime', width: 180 },
|
{ title: '创建时间', key: 'createTime', width: 180 },
|
||||||
{
|
{
|
||||||
@ -340,9 +365,9 @@ const columns: DataTableColumns<BasicProcessPlan> = [
|
|||||||
h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
|
h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
|
||||||
default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
|
default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
|
||||||
}),
|
}),
|
||||||
h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
|
// h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
|
||||||
default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' 删除']
|
// default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' 删除']
|
||||||
}),
|
// }),
|
||||||
h(NButton, { size: 'small', quaternary: true, onClick: () => handleOpenRelateModel(row) }, {
|
h(NButton, { size: 'small', quaternary: true, onClick: () => handleOpenRelateModel(row) }, {
|
||||||
default: () => ['关联质检项']
|
default: () => ['关联质检项']
|
||||||
})
|
})
|
||||||
|
|||||||
58
src/views/biz/device/DeviceAbnomarlRecord.vue
Normal file
58
src/views/biz/device/DeviceAbnomarlRecord.vue
Normal 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>
|
||||||
@ -10,11 +10,19 @@
|
|||||||
<n-form-item>
|
<n-form-item>
|
||||||
<n-space>
|
<n-space>
|
||||||
<n-button type="primary" @click="handleSearch">
|
<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>
|
||||||
<n-button @click="handleReset">
|
<n-button @click="handleReset">
|
||||||
<template #icon><n-icon><RefreshOutline /></n-icon></template>
|
<template #icon>
|
||||||
|
<n-icon>
|
||||||
|
<RefreshOutline/>
|
||||||
|
</n-icon>
|
||||||
|
</template>
|
||||||
重置
|
重置
|
||||||
</n-button>
|
</n-button>
|
||||||
</n-space>
|
</n-space>
|
||||||
@ -26,7 +34,11 @@
|
|||||||
<div class="table-toolbar">
|
<div class="table-toolbar">
|
||||||
<n-space>
|
<n-space>
|
||||||
<n-button type="primary" @click="handleAdd">
|
<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>
|
||||||
<n-button @click="goRealtimeBoard">
|
<n-button @click="goRealtimeBoard">
|
||||||
@ -37,11 +49,19 @@
|
|||||||
导入
|
导入
|
||||||
</n-button> -->
|
</n-button> -->
|
||||||
<n-button @click="handleExport">
|
<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})` : '' }}
|
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
|
||||||
</n-button>
|
</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>
|
<template #icon>
|
||||||
|
<n-icon>
|
||||||
|
<TrashOutline/>
|
||||||
|
</n-icon>
|
||||||
|
</template>
|
||||||
删除
|
删除
|
||||||
</n-button>
|
</n-button>
|
||||||
</n-space>
|
</n-space>
|
||||||
@ -155,14 +175,20 @@
|
|||||||
</n-alert>
|
</n-alert>
|
||||||
<n-space>
|
<n-space>
|
||||||
<n-button type="primary" @click="handleDownloadTemplate">
|
<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-button>
|
||||||
</n-space>
|
</n-space>
|
||||||
<n-upload :max="1" accept=".xlsx,.xls" :show-file-list="true" :custom-request="handleImportUpload">
|
<n-upload :max="1" accept=".xlsx,.xls" :show-file-list="true" :custom-request="handleImportUpload">
|
||||||
<n-upload-dragger>
|
<n-upload-dragger>
|
||||||
<div style="margin-bottom: 12px">
|
<div style="margin-bottom: 12px">
|
||||||
<n-icon size="48" :depth="3"><CloudUploadOutline /></n-icon>
|
<n-icon size="48" :depth="3">
|
||||||
|
<CloudUploadOutline/>
|
||||||
|
</n-icon>
|
||||||
</div>
|
</div>
|
||||||
<n-text style="font-size: 16px">点击或拖拽文件到此处上传</n-text>
|
<n-text style="font-size: 16px">点击或拖拽文件到此处上传</n-text>
|
||||||
<n-p depth="3" style="margin: 8px 0 0 0">支持 .xlsx 或 .xls 格式</n-p>
|
<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>
|
<n-button @click="importModalVisible = false">关闭</n-button>
|
||||||
</template>
|
</template>
|
||||||
</n-modal>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref, reactive, h, onMounted} from 'vue'
|
import {ref, reactive, h, onMounted} from 'vue'
|
||||||
import {useRouter} from 'vue-router'
|
import {useRouter} from 'vue-router'
|
||||||
import { NButton, NSpace,NTag, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
|
import {
|
||||||
import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline } from '@vicons/ionicons5'
|
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 {deviceApi, type Device} from '@/api/device'
|
||||||
|
|
||||||
import {dictDataApi} from '@/api/org'
|
import {dictDataApi} from '@/api/org'
|
||||||
import {sectionApi, type Section} from '@/api/section'
|
import {sectionApi} from '@/api/section'
|
||||||
import {SysUser, userApi} from '@/api/system'
|
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 message = useMessage()
|
||||||
const dialog = useDialog()
|
const dialog = useDialog()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@ -196,6 +248,17 @@ const deviceManagerList = ref<{label:string,value:any}[]>([])
|
|||||||
|
|
||||||
let sectionList = reactive<{ 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({
|
const searchForm = reactive({
|
||||||
deviceCode: null as number | null,
|
deviceCode: null as number | null,
|
||||||
@ -264,7 +327,8 @@ const columns: DataTableColumns<Device> = [
|
|||||||
{type: 'selection'},
|
{type: 'selection'},
|
||||||
{title: '设备编码', key: 'deviceCode'},
|
{title: '设备编码', key: 'deviceCode'},
|
||||||
{title: '设备名称', key: 'deviceName'},
|
{title: '设备名称', key: 'deviceName'},
|
||||||
{ title: '新代ID', key: 'synEquipId', width: 90,
|
{
|
||||||
|
title: '新代ID', key: 'synEquipId', width: 90,
|
||||||
render: (row) => row.synEquipId ?? '-'
|
render: (row) => row.synEquipId ?? '-'
|
||||||
},
|
},
|
||||||
{title: '设备类型', key: 'deviceType'},
|
{title: '设备类型', key: 'deviceType'},
|
||||||
@ -273,7 +337,8 @@ const columns: DataTableColumns<Device> = [
|
|||||||
{title: '设备型号', key: 'spec'},
|
{title: '设备型号', key: 'spec'},
|
||||||
{title: '生产厂家', key: 'manufacturer'},
|
{title: '生产厂家', key: 'manufacturer'},
|
||||||
{title: '出厂日期', key: 'manufactureDate'},
|
{title: '出厂日期', key: 'manufactureDate'},
|
||||||
{ title: '状态', key: 'status',
|
{
|
||||||
|
title: '状态', key: 'status',
|
||||||
render: (row) => {
|
render: (row) => {
|
||||||
const val = row.status
|
const val = row.status
|
||||||
const opt = statusList.value.find(o => o.value === val || String(o.value) === String(val))
|
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)}, {
|
h(NButton, {size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row)}, {
|
||||||
default: () => [h(NIcon, null, {default: () => h(TrashOutline)}), ' 删除']
|
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() {
|
async function loadDictOptions() {
|
||||||
try {
|
try {
|
||||||
const data = await dictDataApi.listByType("device_type")
|
const data = await dictDataApi.listByType("device_type")
|
||||||
deviceTypeList.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
|
deviceTypeList.value = data.map(d => ({
|
||||||
}catch {}
|
label: d.dictLabel,
|
||||||
|
value: (Number(d.dictValue) || d.dictValue),
|
||||||
|
class: d.listClass
|
||||||
|
}))
|
||||||
|
} catch {
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = await dictDataApi.listByType("sys_status")
|
const data = await dictDataApi.listByType("sys_status")
|
||||||
statusList.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
|
statusList.value = data.map(d => ({
|
||||||
}catch {}
|
label: d.dictLabel,
|
||||||
|
value: (Number(d.dictValue) || d.dictValue),
|
||||||
|
class: d.listClass
|
||||||
|
}))
|
||||||
|
} catch {
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const data = await dictDataApi.listByType("mes_device_flag")
|
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 }))
|
deviceFlagList.value = data.map(d => ({
|
||||||
}catch {}
|
label: d.dictLabel,
|
||||||
|
value: (Number(d.dictValue) || d.dictValue),
|
||||||
|
class: d.listClass
|
||||||
|
}))
|
||||||
|
} catch {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -513,6 +624,24 @@ async function handleUser() {
|
|||||||
deviceManagerList.value = res
|
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(() => {
|
onMounted(() => {
|
||||||
loadData()
|
loadData()
|
||||||
handleUser()
|
handleUser()
|
||||||
|
|||||||
@ -37,10 +37,10 @@
|
|||||||
<template #icon><n-icon><DownloadOutline /></n-icon></template>
|
<template #icon><n-icon><DownloadOutline /></n-icon></template>
|
||||||
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
|
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
|
||||||
</n-button>
|
</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>
|
<template #icon><n-icon><TrashOutline /></n-icon></template>
|
||||||
删除
|
删除
|
||||||
</n-button>
|
</n-button> -->
|
||||||
</n-space>
|
</n-space>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -110,6 +110,12 @@
|
|||||||
<n-form-item label="质检描述" path="description">
|
<n-form-item label="质检描述" path="description">
|
||||||
<n-input v-model:value="formData.description" type="textarea" placeholder="请输入质检描述" />
|
<n-input v-model:value="formData.description" type="textarea" placeholder="请输入质检描述" />
|
||||||
</n-form-item>
|
</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>
|
</n-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<n-space justify="end">
|
<n-space justify="end">
|
||||||
@ -232,16 +238,16 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, h, onMounted,computed } from 'vue'
|
import { ref, reactive, h, onMounted,computed } from 'vue'
|
||||||
import { NButton, NSpace, NIcon, NUpload, useMessage, useDialog, type DataTableColumns,
|
import { NButton, NSpace, NIcon, NUpload, useMessage, useDialog, type DataTableColumns,
|
||||||
type UploadCustomRequestOptions,UploadFileInfo, DataTableRowKey, NTag } from 'naive-ui'
|
type UploadCustomRequestOptions,UploadFileInfo, NTag } from 'naive-ui'
|
||||||
import { SearchOutline, RefreshOutline, AddOutline,
|
import { SearchOutline, RefreshOutline, AddOutline
|
||||||
TrashOutline, CreateOutline, CloudUploadOutline,NewspaperOutline,DocumentOutline,
|
, CreateOutline, CloudUploadOutline,NewspaperOutline,DocumentOutline,
|
||||||
DownloadOutline,ArchiveOutline as ArchiveIcon } from '@vicons/ionicons5'
|
DownloadOutline,ArchiveOutline as ArchiveIcon } from '@vicons/ionicons5'
|
||||||
import { qcItemApi, type QcItem } from '@/api/qcItem'
|
import { qcItemApi, type QcItem } from '@/api/qcItem'
|
||||||
import { fileApi,SysFile } from '@/api/system'
|
import { fileApi,SysFile } from '@/api/system'
|
||||||
import Button from 'naive-ui/es/button/src/Button'
|
import Button from 'naive-ui/es/button/src/Button'
|
||||||
import { basicProcessPlanApi,BasicProcessPlan } from '@/api/basicProcessPlan'
|
import { basicProcessPlanApi,BasicProcessPlan } from '@/api/basicProcessPlan'
|
||||||
import {qcitemProcessApi,QcitemProcess} from '@/api/qcitemProcess'
|
import {qcitemProcessApi,QcitemProcess} from '@/api/qcitemProcess'
|
||||||
import { number } from 'echarts'
|
|
||||||
|
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
const dialog = useDialog()
|
const dialog = useDialog()
|
||||||
@ -298,11 +304,13 @@ const modalTitle = ref('')
|
|||||||
const importModalVisible = ref(false)
|
const importModalVisible = ref(false)
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
const defaultFormData: QcItem = {
|
const defaultFormData: QcItem = {
|
||||||
|
id:undefined,
|
||||||
name: '',
|
name: '',
|
||||||
spec: '',
|
spec: '',
|
||||||
plans: '',
|
plans: '',
|
||||||
desc: '',
|
description: '',
|
||||||
createby: undefined,
|
createby: undefined,
|
||||||
|
status:undefined
|
||||||
}
|
}
|
||||||
const formData = reactive<QcItem>({ ...defaultFormData })
|
const formData = reactive<QcItem>({ ...defaultFormData })
|
||||||
|
|
||||||
@ -325,6 +333,30 @@ const columns: DataTableColumns<QcItem> = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '质检描述', key: 'description' },
|
{ 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: 'userName' },
|
||||||
{ title: '创建时间', key: 'createTime', width: 180 },
|
{ title: '创建时间', key: 'createTime', width: 180 },
|
||||||
{ title: '修改时间', key: 'updateTime', width: 180 },
|
{ title: '修改时间', key: 'updateTime', width: 180 },
|
||||||
@ -338,9 +370,9 @@ const columns: DataTableColumns<QcItem> = [
|
|||||||
h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
|
h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
|
||||||
default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
|
default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
|
||||||
}),
|
}),
|
||||||
h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
|
// h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
|
||||||
default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' 删除']
|
// default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' 删除']
|
||||||
}),
|
// }),
|
||||||
h(NButton, { size: 'small', quaternary: true, onClick: () => handleProccess(row) }, {
|
h(NButton, { size: 'small', quaternary: true, onClick: () => handleProccess(row) }, {
|
||||||
default: () => [' 关联工序']
|
default: () => [' 关联工序']
|
||||||
})
|
})
|
||||||
@ -397,6 +429,7 @@ function handleCheck(keys: Array<string | number>) {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
|
fileList.value = []
|
||||||
modalTitle.value = '新增质检项表'
|
modalTitle.value = '新增质检项表'
|
||||||
Object.assign(formData, defaultFormData)
|
Object.assign(formData, defaultFormData)
|
||||||
modalVisible.value = true
|
modalVisible.value = true
|
||||||
@ -404,7 +437,7 @@ function handleAdd() {
|
|||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
async function handleEdit(row: QcItem) {
|
async function handleEdit(row: QcItem) {
|
||||||
|
fileList.value = []
|
||||||
modalTitle.value = '编辑质检项表'
|
modalTitle.value = '编辑质检项表'
|
||||||
const res = await qcItemApi.getPlansFiles({ plans: row.plans })
|
const res = await qcItemApi.getPlansFiles({ plans: row.plans })
|
||||||
|
|
||||||
@ -427,6 +460,7 @@ async function handleEdit(row: QcItem) {
|
|||||||
|
|
||||||
|
|
||||||
Object.assign(formData, row)
|
Object.assign(formData, row)
|
||||||
|
formData.status = Number(row.status)
|
||||||
if (formData.createTime && typeof formData.createTime === 'string') {
|
if (formData.createTime && typeof formData.createTime === 'string') {
|
||||||
formData.createTime = new Date(formData.createTime.replace(' ', 'T')).getTime()
|
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() {
|
async function handleExport() {
|
||||||
|
|||||||
@ -429,7 +429,7 @@ async function loadDictOptions() {
|
|||||||
|
|
||||||
//加载工段
|
//加载工段
|
||||||
async function loadSection() {
|
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) }))
|
sectionList = data.map((d:any)=> ({ label: d.sectionName, value: (Number(d.id) || d.id) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,29 @@
|
|||||||
</template>
|
</template>
|
||||||
</n-pagination>
|
</n-pagination>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -48,22 +71,43 @@ import {
|
|||||||
h,
|
h,
|
||||||
reactive,
|
reactive,
|
||||||
onMounted,
|
onMounted,
|
||||||
watch,
|
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
|
|
||||||
import { mytasks,type AssingWork } from '@/api/production';
|
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 { dictDataApi } from '@/api/org'
|
||||||
import { assingWorkDetailApi,AssingWorkDetail } from '@/api/AssingWorkDetail'
|
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 qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
|
||||||
|
|
||||||
|
//汇报信息
|
||||||
const tableLoading = ref<Boolean>(false)
|
const tableLoading = ref<Boolean>(false)
|
||||||
const AssingWorkTableData = ref<AssingWork[]>([])
|
const AssingWorkTableData = ref<AssingWork[]>([])
|
||||||
const AssingWorkExpandedKeys = ref<Array<string |number>>([])
|
const AssingWorkExpandedKeys = ref<Array<string |number>>([])
|
||||||
|
|
||||||
const processName = ref<string>()
|
const processName = ref<string>()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const AssingWorkColumns :DataTableColumns<AssingWork> = [
|
const AssingWorkColumns :DataTableColumns<AssingWork> = [
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -108,7 +152,7 @@ const AssingWorkColumns :DataTableColumns<AssingWork> = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
align:'center',
|
align:'center',
|
||||||
title: '工序名称',
|
title: '工序编号',
|
||||||
key: 'processCode',
|
key: 'processCode',
|
||||||
minWidth: 200
|
minWidth: 200
|
||||||
},
|
},
|
||||||
@ -145,12 +189,6 @@ const AssingWorkColumns :DataTableColumns<AssingWork> = [
|
|||||||
key: 'deviceName',
|
key: 'deviceName',
|
||||||
minWidth: 200
|
minWidth: 200
|
||||||
},
|
},
|
||||||
{
|
|
||||||
align:'center',
|
|
||||||
title: '工人名称',
|
|
||||||
key: 'userName',
|
|
||||||
minWidth: 200
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
align:'center',
|
align:'center',
|
||||||
title: '数量',
|
title: '数量',
|
||||||
@ -185,12 +223,6 @@ const AssingWorkColumns :DataTableColumns<AssingWork> = [
|
|||||||
key: 'completedTime',
|
key: 'completedTime',
|
||||||
minWidth: 180
|
minWidth: 180
|
||||||
},
|
},
|
||||||
{
|
|
||||||
align:'center',
|
|
||||||
title: '创建人',
|
|
||||||
key: 'createBy',
|
|
||||||
minWidth: 150
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
align:'center',
|
align:'center',
|
||||||
title: '是否质检打回',
|
title: '是否质检打回',
|
||||||
@ -258,9 +290,54 @@ const AssingWorkColumns :DataTableColumns<AssingWork> = [
|
|||||||
key: 'reason',
|
key: 'reason',
|
||||||
minWidth: 150
|
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())
|
const loadingRowIds = ref<Set<number>>(new Set())
|
||||||
|
|
||||||
@ -276,12 +353,6 @@ const AssingWorkDetailColums:DataTableColumns<AssingWorkDetail> = [
|
|||||||
return '-'
|
return '-'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
align:"center",
|
|
||||||
title:"操作人",
|
|
||||||
key:"userName",
|
|
||||||
width:150
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
align:"center",
|
align:"center",
|
||||||
title:"数量",
|
title:"数量",
|
||||||
@ -301,6 +372,12 @@ const AssingWorkDetailColums:DataTableColumns<AssingWorkDetail> = [
|
|||||||
return '-'
|
return '-'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align:"center",
|
||||||
|
title:"操作人",
|
||||||
|
key:"userName",
|
||||||
|
width:150
|
||||||
|
},
|
||||||
{
|
{
|
||||||
align:"center",
|
align:"center",
|
||||||
title:"创建时间",
|
title:"创建时间",
|
||||||
@ -425,8 +502,33 @@ async function loadDictOptions() {
|
|||||||
const data = await dictDataApi.listByType('assing_status')
|
const data = await dictDataApi.listByType('assing_status')
|
||||||
qcAssingStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
|
qcAssingStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
|
||||||
}catch {}
|
}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(()=>{
|
onMounted(()=>{
|
||||||
getlist()
|
getlist()
|
||||||
loadDictOptions()
|
loadDictOptions()
|
||||||
@ -444,5 +546,7 @@ defineExpose({
|
|||||||
.toolbar {
|
.toolbar {
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
.pgClass {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
101
src/views/production/componets/QualityInfoPage.vue
Normal file
101
src/views/production/componets/QualityInfoPage.vue
Normal 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>
|
||||||
86
src/views/production/componets/SubmitLogInfoPage.vue
Normal file
86
src/views/production/componets/SubmitLogInfoPage.vue
Normal 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>
|
||||||
@ -198,7 +198,7 @@ import {
|
|||||||
reactive,
|
reactive,
|
||||||
h,
|
h,
|
||||||
onMounted,
|
onMounted,
|
||||||
watch,
|
watch, Component,
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user