修改质检项管理 工序管理 工位交接页面问题 编写派工工单 汇报信息 质检信息
This commit is contained in:
parent
3e2518d151
commit
4c974947af
@ -28,6 +28,8 @@ export interface BasicProcessPlan {
|
||||
|
||||
createTime?: string
|
||||
|
||||
status?:number
|
||||
|
||||
}
|
||||
|
||||
// 基础主数据--工序表 API
|
||||
|
||||
@ -20,6 +20,7 @@ export interface Device{
|
||||
synEquipId?: number | null,
|
||||
createTime:string,
|
||||
updateTime:string
|
||||
abnormalRecordList:[]
|
||||
}
|
||||
|
||||
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'
|
||||
|
||||
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({
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -8,6 +8,9 @@ export interface QcitemProcess {
|
||||
|
||||
processId?: number
|
||||
|
||||
page?:number
|
||||
|
||||
pageSize?:number
|
||||
}
|
||||
|
||||
// 质检项和工序关联表 API
|
||||
|
||||
@ -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"
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@ -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()
|
||||
|
||||
@ -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: () => ['关联质检项']
|
||||
})
|
||||
|
||||
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>
|
||||
@ -5,16 +5,24 @@
|
||||
<div class="search-form">
|
||||
<n-form inline :model="searchForm" label-placement="left">
|
||||
<n-form-item label="主键ID">
|
||||
<n-input v-model:value="searchForm.deviceCode" placeholder="请输入设备编码" clearable />
|
||||
<n-input v-model:value="searchForm.deviceCode" placeholder="请输入设备编码" clearable/>
|
||||
</n-form-item>
|
||||
<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>
|
||||
@ -49,23 +69,23 @@
|
||||
|
||||
<!-- 表格 -->
|
||||
<n-data-table
|
||||
:columns="columns"
|
||||
:data="tableData"
|
||||
:loading="loading"
|
||||
:row-key="(row) => row.id"
|
||||
:scroll-x="1200"
|
||||
:columns="columns"
|
||||
:data="tableData"
|
||||
:loading="loading"
|
||||
:row-key="(row) => row.id"
|
||||
:scroll-x="1200"
|
||||
/>
|
||||
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px">
|
||||
<n-pagination
|
||||
v-model:page="pagination.page"
|
||||
v-model:page-size="pagination.pageSize"
|
||||
:item-count="pagination.itemCount"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
show-size-picker
|
||||
show-quick-jumper
|
||||
@update:page="handlePageChange"
|
||||
@update:page-size="handlePageSizeChange"
|
||||
@update:checked-row-keys="handleCheck"
|
||||
v-model:page="pagination.page"
|
||||
v-model:page-size="pagination.pageSize"
|
||||
:item-count="pagination.itemCount"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
show-size-picker
|
||||
show-quick-jumper
|
||||
@update:page="handlePageChange"
|
||||
@update:page-size="handlePageSizeChange"
|
||||
@update:checked-row-keys="handleCheck"
|
||||
>
|
||||
<template #prefix>
|
||||
共 {{ pagination.itemCount }} 条
|
||||
@ -78,55 +98,55 @@
|
||||
<n-modal v-model:show="modalVisible" preset="card" :title="modalTitle" style="width: 600px">
|
||||
<n-form ref="formRef" :model="formData" :rules="formRules" label-placement="left" label-width="100px">
|
||||
<n-form-item label="设备名称" path="deviceName">
|
||||
<n-input v-model:value="formData.deviceName" placeholder="请输入设备名称" />
|
||||
<n-input v-model:value="formData.deviceName" placeholder="请输入设备名称"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="新代设备ID" path="synEquipId">
|
||||
<n-input-number
|
||||
v-model:value="formData.synEquipId"
|
||||
placeholder="SynFactory equipID,如 1、2、3"
|
||||
:min="1"
|
||||
:show-button="false"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
v-model:value="formData.synEquipId"
|
||||
placeholder="SynFactory equipID,如 1、2、3"
|
||||
:min="1"
|
||||
:show-button="false"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="所属工段" path="sectionId">
|
||||
<n-select
|
||||
v-model:value="formData.sectionId"
|
||||
:options="sectionList"
|
||||
placeholder="请选择所属工段"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
<n-form-item label="所属工段" path="sectionId">
|
||||
<n-select
|
||||
v-model:value="formData.sectionId"
|
||||
:options="sectionList"
|
||||
placeholder="请选择所属工段"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="设备类型" path="deviceTypeId">
|
||||
<n-select
|
||||
v-model:value="formData.deviceTypeId"
|
||||
:options="deviceTypeList"
|
||||
placeholder="请选择设备类型"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
<n-select
|
||||
v-model:value="formData.deviceTypeId"
|
||||
:options="deviceTypeList"
|
||||
placeholder="请选择设备类型"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="设备负责人" path="deviceManager">
|
||||
<n-select
|
||||
v-model:value="formData.deviceManagerList"
|
||||
:options="deviceManagerList"
|
||||
multiple
|
||||
placeholder="请选择设备类型"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
<n-select
|
||||
v-model:value="formData.deviceManagerList"
|
||||
:options="deviceManagerList"
|
||||
multiple
|
||||
placeholder="请选择设备类型"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="生产厂家" path="manufacturer">
|
||||
<n-input v-model:value="formData.manufacturer" placeholder="请输入生产厂家" />
|
||||
<n-input v-model:value="formData.manufacturer" placeholder="请输入生产厂家"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="出厂日期" path="manufactureDate">
|
||||
<n-date-picker v-model:value="formData.manufactureDate" type="datetime" clearable style="width: 100%" />
|
||||
<n-date-picker v-model:value="formData.manufactureDate" type="datetime" clearable style="width: 100%"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="备注" path="remark">
|
||||
<n-input v-model:value="formData.remark" type="textarea" placeholder="请输入备注" />
|
||||
<n-input v-model:value="formData.remark" 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">
|
||||
@ -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,32 +199,69 @@
|
||||
<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 { deviceApi, type Device } from '@/api/device'
|
||||
|
||||
import { dictDataApi } from '@/api/org'
|
||||
import {sectionApi, type Section} from '@/api/section'
|
||||
import { SysUser, userApi } from '@/api/system'
|
||||
import {ref, reactive, h, onMounted} from 'vue'
|
||||
import {useRouter} from 'vue-router'
|
||||
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} 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()
|
||||
|
||||
//设备负责人列表
|
||||
const deviceManagerList = ref<{label:string,value:any}[]>([])
|
||||
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<[]>([])
|
||||
|
||||
|
||||
|
||||
let sectionList = reactive<{label:string,value:any}[]>([])
|
||||
|
||||
// 搜索表单
|
||||
const searchForm = reactive({
|
||||
deviceCode: null as number | null,
|
||||
deviceCode: null as number | null,
|
||||
})
|
||||
|
||||
// 表格数据
|
||||
@ -219,82 +282,115 @@ const modalTitle = ref('')
|
||||
const importModalVisible = ref(false)
|
||||
const formRef = ref()
|
||||
const defaultFormData: Device = {
|
||||
id:"",
|
||||
id: "",
|
||||
deviceCode: '',
|
||||
deviceName: '',
|
||||
deviceTypeId: undefined,
|
||||
deviceType:"",
|
||||
deviceType: "",
|
||||
sectionId: "",
|
||||
sectionName:"",
|
||||
sectionName: "",
|
||||
spec: '',
|
||||
manufacturer: '',
|
||||
manufactureDate: undefined,
|
||||
manufactureDate: undefined,
|
||||
workshopId: '',
|
||||
remark: '',
|
||||
status:0,
|
||||
deviceFlag:'mes_equipment',
|
||||
status: 0,
|
||||
deviceFlag: 'mes_equipment',
|
||||
synEquipId: null as number | null,
|
||||
deviceManagerList: null as any | null
|
||||
}
|
||||
const formData = reactive<Device>({ ...defaultFormData })
|
||||
const formData = reactive<Device>({...defaultFormData})
|
||||
|
||||
// 字典选项(下拉框/单选框/复选框关联字典时使用)
|
||||
const deviceTypeList = ref<{ label: string; value: any ;class:any}[]>([])
|
||||
const statusList = ref<{ label: string; value: any ;class:any}[]>([])
|
||||
const deviceTypeList = ref<{ label: string; value: any; class: any }[]>([])
|
||||
const statusList = ref<{ label: string; value: any; class: any }[]>([])
|
||||
|
||||
const deviceFlagList = ref<{ label: string; value: any ;class:any}[]>([])
|
||||
const deviceFlagList = ref<{ label: string; value: any; class: any }[]>([])
|
||||
|
||||
// 表单校验规则
|
||||
const formRules = {
|
||||
deviceName:[{ required: true, message: '请输入设备名称', trigger: 'blur' },],
|
||||
sectionId:[{
|
||||
deviceName: [{required: true, message: '请输入设备名称', trigger: 'blur'},],
|
||||
sectionId: [{
|
||||
required: true,
|
||||
validator(rule:any,value: any) {
|
||||
if(!value){
|
||||
return new Error(`请选择所属工段`)
|
||||
}
|
||||
return true
|
||||
},
|
||||
trigger: ['blur']
|
||||
}]
|
||||
validator(rule: any, value: any) {
|
||||
if (!value) {
|
||||
return new Error(`请选择所属工段`)
|
||||
}
|
||||
return true
|
||||
},
|
||||
trigger: ['blur']
|
||||
}]
|
||||
}
|
||||
|
||||
// 表格列
|
||||
const columns: DataTableColumns<Device> = [
|
||||
{ type: 'selection' },
|
||||
{ title: '设备编码', key: 'deviceCode' },
|
||||
{ title: '设备名称', key: 'deviceName' },
|
||||
{ title: '新代ID', key: 'synEquipId', width: 90,
|
||||
{type: 'selection'},
|
||||
{title: '设备编码', key: 'deviceCode'},
|
||||
{title: '设备名称', key: 'deviceName'},
|
||||
{
|
||||
title: '新代ID', key: 'synEquipId', width: 90,
|
||||
render: (row) => row.synEquipId ?? '-'
|
||||
},
|
||||
{ title: '设备类型', key: 'deviceType' },
|
||||
{ title: '设备负责人', key: 'deviceManagerName' },
|
||||
{ title: '所属工段', key: 'sectionName' },
|
||||
{ title: '设备型号', key: 'spec' },
|
||||
{ title: '生产厂家', key: 'manufacturer' },
|
||||
{ title: '出厂日期', key: 'manufactureDate' },
|
||||
{ title: '状态', key: 'status',
|
||||
render:(row) =>{
|
||||
{title: '设备类型', key: 'deviceType'},
|
||||
{title: '设备负责人', key: 'deviceManagerName'},
|
||||
{title: '所属工段', key: 'sectionName'},
|
||||
{title: '设备型号', key: 'spec'},
|
||||
{title: '生产厂家', key: 'manufacturer'},
|
||||
{title: '出厂日期', key: 'manufactureDate'},
|
||||
{
|
||||
title: '状态', key: 'status',
|
||||
render: (row) => {
|
||||
const val = row.status
|
||||
const opt = statusList.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 })
|
||||
return h(NTag, {type: opt.class, size: 'small'}, {default: () => opt.label})
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'actions',
|
||||
width: 140,
|
||||
fixed: 'right',
|
||||
render(row) {
|
||||
return h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'nowrap' } }, [
|
||||
h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
|
||||
default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
|
||||
return h('div', {style: {display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'nowrap'}}, [
|
||||
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(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)})]
|
||||
})
|
||||
})
|
||||
])
|
||||
|
||||
]
|
||||
)
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -306,8 +402,8 @@ async function loadData() {
|
||||
const res = await deviceApi.page({
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize,
|
||||
deviceCode:searchForm.deviceCode,
|
||||
deviceFlag:"mes_equipment"
|
||||
deviceCode: searchForm.deviceCode,
|
||||
deviceFlag: "mes_equipment"
|
||||
})
|
||||
tableData.value = res.list
|
||||
pagination.itemCount = res.total
|
||||
@ -324,7 +420,7 @@ function handleSearch() {
|
||||
|
||||
// 重置
|
||||
function handleReset() {
|
||||
searchForm.deviceCode = null
|
||||
searchForm.deviceCode = null
|
||||
|
||||
handleSearch()
|
||||
}
|
||||
@ -360,18 +456,18 @@ function goRealtimeBoard() {
|
||||
// 编辑
|
||||
function handleEdit(row: Device) {
|
||||
|
||||
modalTitle.value = '编辑设备表'
|
||||
Object.assign(formData, row)
|
||||
console.log(formData);
|
||||
modalTitle.value = '编辑设备表'
|
||||
Object.assign(formData, row)
|
||||
console.log(formData);
|
||||
|
||||
modalVisible.value = true
|
||||
modalVisible.value = true
|
||||
}
|
||||
|
||||
// 提交
|
||||
async function handleSubmit() {
|
||||
await formRef.value?.validate()
|
||||
try {
|
||||
const submitData = { ...formData } as Device
|
||||
const submitData = {...formData} as Device
|
||||
|
||||
if (typeof submitData.manufactureDate === 'number') {
|
||||
submitData.manufactureDate = new Date(submitData.manufactureDate).toISOString().slice(0, 19).replace('T', ' ')
|
||||
@ -463,7 +559,7 @@ async function handleDownloadTemplate() {
|
||||
}
|
||||
|
||||
// 导入上传
|
||||
async function handleImportUpload({ file }: UploadCustomRequestOptions) {
|
||||
async function handleImportUpload({file}: UploadCustomRequestOptions) {
|
||||
if (!file.file) return
|
||||
try {
|
||||
const result = await deviceApi.importData(file.file)
|
||||
@ -485,32 +581,65 @@ 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 {}
|
||||
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 {
|
||||
}
|
||||
|
||||
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 {}
|
||||
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 {}
|
||||
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 {
|
||||
}
|
||||
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 {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//加载工段
|
||||
async function loadSection() {
|
||||
const data = await sectionApi.listNoParam()
|
||||
sectionList = data.map((d:any)=> ({ label: d.sectionName, value: (Number(d.id) || d.id) }))
|
||||
const data = await sectionApi.listNoParam()
|
||||
sectionList = data.map((d: any) => ({label: d.sectionName, value: (Number(d.id) || d.id)}))
|
||||
}
|
||||
|
||||
//加载人员
|
||||
async function handleUser() {
|
||||
const res = await userApi.getEquipmentManager()
|
||||
deviceManagerList.value = res
|
||||
const res = await userApi.getEquipmentManager()
|
||||
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(() => {
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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) }))
|
||||
}
|
||||
|
||||
|
||||
@ -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,7 +372,13 @@ const AssingWorkDetailColums:DataTableColumns<AssingWorkDetail> = [
|
||||
return '-'
|
||||
}
|
||||
},
|
||||
{
|
||||
{
|
||||
align:"center",
|
||||
title:"操作人",
|
||||
key:"userName",
|
||||
width:150
|
||||
},
|
||||
{
|
||||
align:"center",
|
||||
title:"创建时间",
|
||||
key:"createTime",
|
||||
@ -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>
|
||||
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,
|
||||
h,
|
||||
onMounted,
|
||||
watch,
|
||||
watch, Component,
|
||||
} from 'vue'
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user