This commit is contained in:
andy 2026-08-03 13:26:35 +08:00
commit 44e98d2d8b
38 changed files with 2006 additions and 213 deletions

View File

@ -1,6 +1,6 @@
allowBuilds:
'@parcel/watcher': set this to true or false
core-js: set this to true or false
electron-winstaller: set this to true or false
esbuild: set this to true or false
vue-demi: set this to true or false
'@parcel/watcher': true
core-js: true
electron-winstaller: true
esbuild: true
vue-demi: true

View File

@ -20,7 +20,9 @@ export interface Device{
synEquipId?: number | null,
createTime:string,
updateTime:string
abnormalRecordList:[]
abnormalRecordList:[],
deviceManagers:[]
deviceManager:string
}
export interface DeviceRealtimeVO {
@ -103,11 +105,14 @@ export const deviceApi = {
export(
params?:{
ids?:string[],
deviceCode:any
deviceCode:any,
deviceFlag?:string
}){
const p:Record<string,any> = {}
console.log( params)
if(params?.ids?.length) p.ids = params.ids.join(',')
if(params?.deviceCode != undefined && params?.deviceCode !== null) p.sectionCode = params.deviceCode
if(params?.deviceFlag != undefined && params?.deviceFlag !== null) p.deviceFlag = params.deviceFlag
return request({
url:`/biz/device/report`,
method:"get",
@ -122,5 +127,11 @@ export const deviceApi = {
method:"get",
params
})
},
deviceList() {
return request({
url:"/biz/device/list",
method:"get"
})
}
}

View File

@ -16,7 +16,7 @@ export interface DeviceAbnormalRecord {
stationName?: string
abnormalType?: string
abnormalType?: number
abnormalTypeName?: string
@ -53,7 +53,7 @@ export interface DeviceAbnormalRecord {
// 设备异常记录表 API
export const deviceAbnormalRecordApi = {
// 分页查询
page(params: { page: number; pageSize: number; id?: number; status?: string }) {
page(params: { page: number; pageSize: number; deviceId?: number; abnormalCode?: string,abnormalType?:number }) {
return request({ url: '/biz/deviceAbnormalRecord/page', method: 'get', params })
},

View File

@ -0,0 +1,72 @@
import { request } from '@/utils/request'
// 设备操作日志 类型定义
export interface DeviceOperationLog {
id?: number
assingWorkId?: number
userId?: number
deviceId?: number
source?: number
operationType?: number
createTime?: string
}
// 设备操作日志 API
export const deviceOperationLogApi = {
// 分页查询
page(params: { page: number; pageSize: number; deviceId?: number; operationType?: number;userId?: number }) {
return request({ url: '/terminal/operation/page', method: 'get', params })
},
// 获取详情
detail(id: string) {
return request({ url: `/biz/deviceOperationLog/${id}`, method: 'get' })
},
// 新增
create(data: DeviceOperationLog) {
return request({ url: '/biz/deviceOperationLog', method: 'post', data })
},
// 修改
update(data: DeviceOperationLog) {
return request({ url: '/biz/deviceOperationLog', method: 'put', data })
},
// 删除
delete(ids: string[]) {
return request({ url: `/biz/deviceOperationLog/${ids.join(',')}`, method: 'delete' })
},
// 导出
export(params?: { ids?: string[]; id?: number }) {
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
return request({ url: `/biz/deviceOperationLog/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/deviceOperationLog/import`,
method: 'post',
data: formData,
headers: { 'Content-Type': 'multipart/form-data' }
})
},
// 下载导入模板
downloadTemplate() {
return request({ url: `/biz/deviceOperationLog/template`, method: 'get', responseType: 'blob' })
}
}

View File

@ -2,82 +2,82 @@ import { request } from '@/utils/request'
// ErrorNotification 类型定义
export interface ErrorNotification {
id?: number
id?: number
subscriptionKey?: string
subscriptionKey?: string
title?: string
title?: string
subscriptionDeviceIds?: string
subscriptionDeviceIds?: string
subscriptionDiscoverField?: string
subscriptionDiscoverField?: string
sendingMethod?: string
sendingMethod?: string
discoverValue?: string
discoverValue?: string
detectionMethod?: string
detectionMethod?: string
notifier?: string
notifier?: string
createBy?: number
createBy?: number
crateTime?: string
crateTime?: string
notifierContent?: string
notifierContent?: string
abnormalReporting?: number
abnormalReporting?: number
}
// ErrorNotification API
export const errorNotificationApi = {
// 分页查询
page(params: { page: number; pageSize: number }) {
return request({ url: '/biz/errorNotification/page', method: 'get', params })
},
// 分页查询
page(params: { page: number; pageSize: number }) {
return request({ url: '/biz/errorNotification/page', method: 'get', params })
},
// 获取详情
detail(id: string) {
return request({ url: `/biz/errorNotification/${id}`, method: 'get' })
},
// 获取详情
detail(id: number) {
return request({ url: `/biz/errorNotification/${id}`, method: 'get' })
},
// 新增
create(data: ErrorNotification) {
return request({ url: '/biz/errorNotification', method: 'post', data })
},
// 新增
create(data: ErrorNotification) {
return request({ url: '/biz/errorNotification', method: 'post', data })
},
// 修改
update(data: ErrorNotification) {
return request({ url: '/biz/errorNotification', method: 'put', data })
},
// 修改
update(data: ErrorNotification) {
return request({ url: '/biz/errorNotification', method: 'put', data })
},
// 删除
delete(ids: string[]) {
return request({ url: `/biz/errorNotification/${ids.join(',')}`, method: 'delete' })
},
// 删除
delete(ids: string[]) {
return request({ url: `/biz/errorNotification/${ids.join(',')}`, method: 'delete' })
},
// 导出
export(params?: { ids?: string[] }) {
const p: Record<string, any> = {}
if (params?.ids?.length) p.ids = params.ids.join(',')
return request({ url: `/biz/errorNotification/export`, method: 'get', params: p, responseType: 'blob' })
},
// 导出
export(params?: { ids?: string[] }) {
const p: Record<string, any> = {}
if (params?.ids?.length) p.ids = params.ids.join(',')
return request({ url: `/biz/errorNotification/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/errorNotification/import`,
method: 'post',
data: formData,
headers: { 'Content-Type': 'multipart/form-data' }
})
},
// 导入
importData(file: File) {
const formData = new FormData()
formData.append('file', file)
return request<{ success: number; fail: number; errors: string[] }>({
url: `/biz/errorNotification/import`,
method: 'post',
data: formData,
headers: { 'Content-Type': 'multipart/form-data' }
})
},
// 下载导入模板
downloadTemplate() {
return request({ url: `/biz/errorNotification/template`, method: 'get', responseType: 'blob' })
}
}
// 下载导入模板
downloadTemplate() {
return request({ url: `/biz/errorNotification/template`, method: 'get', responseType: 'blob' })
}
}

View File

@ -72,10 +72,18 @@ export function opertree() {
})
}
//查询已上传文件
export function filelist(id:any) {
//查询已上传文件 单文件
export function filelist(fileId:any) {
return request({
url: `sys/file/${id}`,
url: `sys/file/${fileId}`,
method: 'get'
})
}
//查询已上传文件 多文件
export function multifilelist(fileId:any) {
return request({
url: `sys/file/getFile/${fileId}`,
method: 'get'
})
}

102
src/api/issuerecord.ts Normal file
View File

@ -0,0 +1,102 @@
import { request } from '@/utils/request'
// 下发记录表 类型定义
export interface IssueRecord {
id?: number
issueCode?: string
issueType?: string
issueTypeName?: string
sourceId?: number
sourceCode?: string
sourceName?: string
deviceId?: number
status?: number
statusName?: string
issueTime?: string
issueBy?: number
completeTime?: string
result?: string
remark?: string
createTime?: string
createBy?: number
assingId?: number
processId?: number
}
// 下发记录表 API
export const issueRecordApi = {
// 分页查询
page(params: { page: number; pageSize: number; issueCode?: string; status?: number;deviceId?:number }) {
return request({ url: '/biz/issueRecord/page', method: 'get', params })
},
// 获取详情
detail(id: number) {
return request({ url: `/biz/issueRecord/${id}`, method: 'get' })
},
// 新增
create(data: IssueRecord) {
return request({ url: '/biz/issueRecord', method: 'post', data })
},
// 修改
update(data: IssueRecord) {
return request({ url: '/biz/issueRecord', method: 'put', data })
},
// 删除
delete(ids: number[]) {
return request({ url: `/biz/issueRecord/${ids.join(',')}`, method: 'delete' })
},
// 导出
export(params?: { ids?: number[]; id?: number; status?: number }) {
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/issueRecord/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/issueRecord/import`,
method: 'post',
data: formData,
headers: { 'Content-Type': 'multipart/form-data' }
})
},
// 下载导入模板
downloadTemplate() {
return request({ url: `/biz/issueRecord/template`, method: 'get', responseType: 'blob' })
},
//设备下发记录
getDeviceDispatchLogList(deviceId: number) {
return request({ url: `/biz/issueRecord/deviceIssueRecords/${deviceId}`, method: 'get' })
}
}

View File

@ -13,7 +13,12 @@ export interface SysNotice {
status: number
createBy?: number
createName?: string
createTime?: string
createTime?: string,
abnormalReporting?:number,
reportReason?:string,
errorNotificationId?:number,
filler?:number,
filingStatus?:number,
}
export interface NoticeChannelOption {

View File

@ -67,6 +67,15 @@ export function issuecopy(data:any) {
})
}
// 导出
export function exportIssue(params?: { ids?: number[]; id?: number; status?: number }) {
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/ncCode/export`, method: 'get', params: p, responseType: 'blob' })
}
//任务树
export function opertree() {
return request({

View File

@ -126,6 +126,8 @@ export interface ProcessPlanItemVO {
assignWorkList?: AssignWorkItem[]
proWorkshop?: string
}
@ -224,6 +226,8 @@ export function processItemToEntity(
orderItemId?: number,
proWorkshop?:string
): OrderProcessPlan {
return {
@ -256,7 +260,9 @@ export function processItemToEntity(
storageEntry: item.storageEntry,
workCenterName:item.workCenterName
workCenterName:item.workCenterName,
proWorkshop
}

View File

@ -103,5 +103,10 @@ export const qualityTestingApi = {
// 下载导入模板
downloadTemplate() {
return request({ url: `/biz/qualityTesting/template`, method: 'get', responseType: 'blob' })
},
//加载质检单
loadQualityTestingList(assingId:number) {
return request({url:`/mes/qc/loadQualityTestingList/${assingId}`,method:'get'})
}
}

View File

@ -68,7 +68,7 @@ export const sectionApi = {
})
},
list(params:{sectionName:string}) {
list(params:{sectionName:string,workShop:string}) {
return request({
url:"/biz/section/listBySectionName",
method:"get",

View File

@ -87,5 +87,19 @@ export const submitLogApi = {
//按派工单id查询汇报
getByDispatch(dispatchId:number){
return request({url:`/mes/report/bydispatch/${dispatchId}`,method:"get"})
},
//根据工序Id查询汇报
getProcessReportDetail(params?:{page?:number;pageSize?:number;submitStatus?:number;processId?:number;}){
return request({url:`/mes/report/submitLogToProcess`,method:"get",params})
},
//根据订单Id查询汇报
getOrderItemReportDetail(params?:{page?:number;pageSize?:number;submitStatus?:number;orderItemId?:number;}){
return request({url:`/mes/report/allSubmitLogByorderItemId`,method:"get",params})
},
//加载汇报列表
loadSumbitLog(assingId?:number){
return request({url:`/mes/report/loadSumbitLog/${assingId}`,method:'get'})
}
}

View File

@ -136,13 +136,6 @@ export const userApi = {
})
},
//获取设备负责人
getEquipmentManager() {
return request({
url:"/sys/user/getEquipmentManager",
method:"get"
})
}
}

0
src/api/test01.ts Normal file
View File

77
src/api/tool.ts Normal file
View File

@ -0,0 +1,77 @@
import { request } from '@/utils/request'
export interface Tool {
id?: number
toolCode: string
toolName: string
toolType: string
toolTypeId?: number
specModel: string
material: string
manufacturer: string
purchaseDate?: string | number
lifeCycle: number
usedCount?: number
status: number
remark: string
createTime?: string
updateTime?: string
}
export const toolApi = {
page(params: {
page: number
pageSize: number
toolCode?: string
toolName?: string
status?: number
}) {
return request({
url: '/biz/tool/page',
method: 'get',
params
})
},
create(data: Tool) {
return request({
url: '/biz/tool',
method: 'post',
data
})
},
update(data: Tool) {
return request({
url: '/biz/tool',
method: 'put',
data
})
},
delete(ids: number[]) {
return request({
url: `/biz/tool/${ids.join(',')}`,
method: 'delete'
})
},
export(params?: {
ids?: number[]
toolCode?: string
toolName?: string
status?: number
}) {
const p: Record<string, any> = {}
if (params?.ids?.length) p.ids = params.ids.join(',')
if (params?.toolCode) p.toolCode = params.toolCode
if (params?.toolName) p.toolName = params.toolName
if (params?.status != null) p.status = params.status
return request({
url: '/biz/tool/report',
method: 'get',
params: p,
responseType: 'blob'
})
}
}

View File

@ -0,0 +1,9 @@
<template>
</template>
<script>
</script>

View File

@ -0,0 +1,218 @@
<script setup lang="ts">
import {onMounted, ref, watch} from "vue";
import { Notifications } from '@vicons/ionicons5'
import { ErrorNotification } from '@/api/errorNotification.ts'
import {} from '@/api/system.ts'
import {noticeApi, SysNotice} from '@/api/message'
import type {FormInst} from "naive-ui";
const emit = defineEmits<{
(e: 'update:show', value: boolean): void
}>()
const props = defineProps<{
show: boolean
errorNotifiaction:ErrorNotification,
notice:SysNotice,
}>()
const showModal = ref(false)
const formRef = ref<FormInst | null>(null)
const isFili = ref<Boolean>(false)
const isShow = ref<Boolean>(true)
const disabled = ref<Boolean>(false)
const rules = {
fillingPerson:[{required: true, message: '请填写填报原因'}]
}
const formData = ref<SysNotice>({
id:undefined,
reportReason:undefined,
filingStatus:undefined
})
watch(()=>props.show, (val) => {
showModal.value = val
//
if (!val) {
isFili.value = false
formData.value = {
id:undefined,
reportReason:undefined,
filingStatus:undefined,
}
isShow.value = true
disabled.value = false
}
if (props.notice.abnormalReporting) {//
isFili.value = true
formData.value = {...props.notice}
//
if (formData.value.filingStatus == 1) {
isShow.value = false
disabled.value = true
}else {
isShow.value = true
disabled.value = false
}
}else {
isFili.value = false
isShow.value = true
disabled.value = false
}
},{immediate:true})
watch(showModal, (val) => {
emit("update:show",val)
})
async function handleSubmit() {
try {
await formRef.value?.validate()
formData.value.id = props.errorNotifiaction.noticeId
formData.value.filingStatus = 1
//
noticeApi.update({
id:formData.value.id,
reportReason:formData.value.reportReason,
filingStatus:formData.value.filingStatus
})
window.$message?.success('填报成功')
showModal.value= false
}catch ( error:any) {
if (error?.message) {
window.$message?.error(error.message)
}
}
}
</script>
<template>
<n-modal
v-model:show="showModal"
preset="card"
:style="{ width: '1200px', height: '600px'}"
:mask-closable="false"
>
<template #header >
<div style="text-align: center;">
<h2>
<n-icon>
<Notifications />
</n-icon>
异常填报
</h2>
</div>
</template>
<n-split direction="horizontal" :max="0.75" :min="0.25" v-if="isFili">
<template #1>
<n-grid x-gap="12" :cols="1">
<n-gi>
<h2>异常内容</h2>
</n-gi>
</n-grid>
<n-form
label-placement="left"
label-width="100"
style="margin: 10px"
>
<n-form-item label="异常名称" path="title">
<n-input
v-model:value="props.errorNotifiaction.title"
disabled
/>
</n-form-item>
<n-form-item label="异常设备" path="devices">
<n-input
v-model:value="props.errorNotifiaction.devices"
disabled
/>
</n-form-item>
<n-form-item label="通知内容" path="notifierContent">
<n-input
v-model:value="errorNotifiaction.notifierContent"
type="textarea"
disabled
/>
</n-form-item>
</n-form>
</template>
<template #2>
<n-grid x-gap="12" :cols="1">
<n-gi>
<h2>异常填报</h2>
</n-gi>
</n-grid>
<n-form
ref="formRef"
:model="formData"
label-placement="left"
label-width="100"
style="margin: 10px"
:rules="rules"
>
<n-form-item ref="reason" label="填报原因" path="reportReason">
<n-input
v-model:value="formData.reportReason"
type="textarea"
placeholder="请填写填报原因"
:disabled="disabled"
/>
</n-form-item>
</n-form>
</template>
</n-split>
<div v-if="!isFili">
<n-grid x-gap="12" :cols="1">
<n-gi>
<h2>异常内容</h2>
</n-gi>
</n-grid>
<n-form
label-placement="left"
label-width="100"
style="margin: 10px"
>
<n-form-item label="异常名称" path="title">
<n-input
v-model:value="props.errorNotifiaction.title"
disabled
/>
</n-form-item>
<n-form-item label="异常设备" path="devices">
<n-input
v-model:value="props.errorNotifiaction.devices"
disabled
/>
</n-form-item>
<n-form-item label="通知内容" path="notifierContent">
<n-input
v-model:value="errorNotifiaction.notifierContent"
type="textarea"
disabled
/>
</n-form-item>
</n-form>
</div>
<!-- 底部操作按钮 -->
<template #action>
<n-space justify="end">
<n-button @click="showModal = false">关闭</n-button>
<n-button v-if="isFili && isShow" type="primary" @click="handleSubmit">提交</n-button>
</n-space>
</template>
</n-modal>
</template>
<style scoped>
</style>

View File

@ -246,8 +246,8 @@
<template v-if="messageTab === 'notice'">
<div v-for="item in recentNotices" :key="item.id" class="message-item" @click="handleNoticeClick(item)">
<div class="message-item-header">
<n-tag :type="item.noticeType === 1 ? 'info' : 'warning'" size="small">
{{ item.noticeType === 1 ? '通知' : '公告' }}
<n-tag :type="item.noticeType === 1 ? 'info' : item.noticeType === 2 ? 'warning' : 'error' " size="small">
{{ item.noticeType === 1 ? '通知' : item.noticeType === 2 ? '公告' : '异常通知' }}
</n-tag>
<span class="message-time">{{ formatMessageTime(item.createTime) }}</span>
</div>
@ -331,6 +331,13 @@
<!-- 消息通知弹窗 -->
<MessageNotification />
<!--异常填报弹窗-->
<ErrorReportModal
v-model:show="showErrorReportModal"
:errorNotifiaction ="errorNotifiaction"
:notice = "notice"
/>
</n-layout>
</template>
@ -382,6 +389,8 @@ import TabBar from '@/components/TabBar.vue'
import SiteLogoMark from '@/components/SiteLogoMark.vue'
import { noticeApi, chatApi, type SysNotice, type ChatMessage } from '@/api/message'
import { iconMap as externalIconMap } from '@/utils/icons'
import ErrorReportModal from "@/components/ErrorReportModal.vue";
import {errorNotificationApi} from "@/api/errorNotification.ts";
const route = useRoute()
const router = useRouter()
@ -405,6 +414,7 @@ window.$message = message
const collapsed = ref(false)
const showProfileModal = ref(false)
const showPasswordModal = ref(false)
const showErrorReportModal = ref(false)
const messageTab = ref('notice')
//
@ -599,18 +609,40 @@ function stripHtml(html: string | undefined): string {
}
//
//
const errorNotifiaction = ref({
title: '',
devices: '',
sendingMethodName: '',
notifierName: '',
notifierContent: ''
})
//
const notice = ref<SysNotice>( {})
async function handleNoticeClick(item: SysNotice) {
//
if (item.id) {
try {
await noticeApi.markAsRead(item.id)
//
loadUnreadCount()
} catch (error) {
//
}
}
router.push({ path: '/message/notice', query: { id: item.id?.toString() } })
const res = await errorNotificationApi.detail(item.errorNotificationId);
errorNotifiaction.value = {...res}
errorNotifiaction.value.noticeId = item.id
notice.value = item
//
showErrorReportModal.value = true
// if (item.abnormalReporting) {
//
// }else {
// //
// if (item.id) {
// try {
// await noticeApi.markAsRead(item.id)
// //
// loadUnreadCount()
// } catch (error) {
// //
// }
// }
// router.push({ path: '/message/notice', query: { id: item.id?.toString() } })
// }
}
//

View File

@ -289,18 +289,18 @@ const routes: RouteRecordRaw[] = [
component: () => import('@/views/biz/outsourcing/index.vue'),
meta: { title: '工序委外', icon: 'ListOutline' }
},
{
path: 'biz/deviceGather',
name: 'deviceGather',
component: () => import('@/views/biz/deviceGather/index.vue'),
meta: { title: '设备采集', icon: 'ListOutline' }
},
{
path: 'biz/callingMaterials',
name: 'callingMaterials',
component: () => import('@/views/biz/callingMaterials/index.vue'),
meta: { title: '叫料记录', icon: 'ListOutline' }
},
// {
// path: 'biz/tool',
// name: 'tool',
// component: () => import('@/views/biz/tool/index.vue'),
// meta: { title: '刀具管理', icon: 'ToolOutline' }
// },
// {
// path: 'biz/tool/usage',
// name: 'toolUsage',
// component: () => import('@/views/biz/tool/usage.vue'),
// meta: { title: '刀具使用记录', icon: 'ToolOutline', activeMenu: '/biz/tool' }
// },
{
path: 'biz/errorNotification',
name: 'errorNotification',

View File

@ -47,6 +47,7 @@
:loading="loading"
:row-key="(row) => row.id"
:scroll-x="1200"
v-model:checked-row-keys="selectedIds"
/>
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px">

View File

@ -1,21 +1,78 @@
<script setup lang="ts">
import {DeviceAbnormalRecord} from "@/api/deviceAbnormalRecord.ts";
import {DataTableColumns, NDataTable, NTag} from "naive-ui";
import {h, onMounted, ref} from "vue";
import {DataTableColumns, NButton, NDataTable, NIcon, NSpace, NTag} from "naive-ui";
import {h, onMounted, reactive, ref} from "vue";
import {dictDataApi} from "@/api/org.ts";
import {ArrowDown, ArrowUp, RefreshOutline, SearchOutline} from "@vicons/ionicons5";
import {deviceAbnormalRecordApi} from "@/api/deviceAbnormalRecord.ts";
const deviceNormalRecordOptions = ref<{ label: string; value: any;class:any }[]>([])
const props = defineProps<{
deviceAbnormalRecordList: DeviceAbnormalRecord[]
}>()
const props = defineProps({
deviceId:Number
})
const showSearchInput = ref<Boolean>(false)
const searchForm = ref({
abnormalCode: undefined,
abnormalType: undefined
})
const abnormalTypes = [
{
label: '机械异常',
value: '0'
},
{
label: '电气异常',
value: '1'
},
{
label: '软件异常',
value: '2'
},
{
label: '其他异常',
value: '3'
}
]
const pagination = reactive({
page: 1,
pageSize: 10,
itemCount: 0,
showSizePicker: true,
pageSizes: [10, 20, 50]
})
//
const deviceAbnormalTypeOptions = ref<{ label: string; value: any;class:any }[]>( [])
//
const deviceAbnormalLevelOptions = ref<{ label: string; value: any;class:any }[]>( [])
//
const deviceAbnormalRecordColums:DataTableColumns<DeviceAbnormalRecord> = [
const columns:DataTableColumns<DeviceAbnormalRecord> = [
{ title: '异常编号', key: 'abnormalCode',align: 'center' },
{ title: '异常类型', key: 'abnormalType',align: 'center' },
{ title: '异常级别', key: 'abnormalLevel',align: 'center'},
{ title: '报警异常', key: 'abnormalType',align: 'center',
render(row) {
const val = row.abnormalType
const opt = deviceAbnormalTypeOptions.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: 'abnormalLevel',align: 'center',
render(row) {
const val = row.abnormalLevel
const opt = deviceAbnormalLevelOptions.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: 'abnormalDesc',align: 'center' },
{ title: '异常时间', key: 'abnormalTime',align: 'center' },
{ title: '处理状态', key: 'status',align: 'center',
@ -34,23 +91,159 @@
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 {}
try {
const data = await dictDataApi.listByType('abnormal_type')
deviceAbnormalTypeOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class: d.listClass }))
}catch {}
try {
const data = await dictDataApi.listByType('abnormal_level')
deviceAbnormalLevelOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class: d.listClass }))
}catch {}
}
const data = ref([])
const load = async() => {
try {
const res = await deviceAbnormalRecordApi.page({
page: pagination.page,
pageSize: pagination.pageSize,
deviceId: props.deviceId,
abnormalCode: searchForm.value.abnormalCode,
abnormalType: searchForm.value.abnormalType,
})
data.value = res.list
pagination.itemCount = res.total
} catch (e) {}
}
const doShowInner = () => {
if (showSearchInput.value) {
showSearchInput.value = false
}else {
showSearchInput.value = true
}
}
const handleSearch = () => {
load()
}
const handleReset = () => {
searchForm.value.abnormalType = null
searchForm.value.abnormalCode = null
pagination.page = 1
pagination.pageSize = 10
load()
}
//
function handlePageChange(page: number) {
pagination.page = page
load()
}
function handlePageSizeChange(pageSize: number) {
pagination.pageSize = pageSize
pagination.page = 1
load()
}
onMounted(()=>{
load()
loadDictOptions()
})
</script>
<template>
<n-card>
<n-data-table
:columns="deviceAbnormalRecordColums"
size="small"
:data="props.deviceAbnormalRecordList"
remote
:scroll-x="600"
/>
</n-card>
<div>
<n-button @click="doShowInner" v-if="showSearchInput">
<n-icon size="20" :depth="3">
<ArrowDown/>
</n-icon>
展开
</n-button>
<n-card v-if="!showSearchInput">
<n-form inline :model="searchForm" label-placement="left">
<n-grid :x-gap="8" :cols="4">
<n-gi>
<n-form-item label="异常编号">
<n-input v-model:value="searchForm.abnormalCode" placeholder="请输入异常编号" clearable style="width: 200px"/>
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="操作人员">
<n-select
v-model:value="searchForm.abnormalType"
:options="abnormalTypes"
placeholder="请选择异常类型"
clearable
style="width: 200px"
/>
</n-form-item>
</n-gi>
<n-gi>
<n-form-item>
<n-space>
<n-button type="primary" @click="handleSearch">
<template #icon>
<n-icon>
<SearchOutline/>
</n-icon>
</template>
搜索
</n-button>
<n-button @click="handleReset">
<template #icon>
<n-icon>
<RefreshOutline/>
</n-icon>
</template>
重置
</n-button>
</n-space>
</n-form-item>
</n-gi>
</n-grid>
</n-form>
<n-button @click="doShowInner" v-if="!showSearchInput" style="float: right;margin: 10px">
<n-icon size="20" :depth="3">
<ArrowUp/>
</n-icon>
闭合
</n-button>
</n-card>
<n-card style="margin: 20px 0">
<n-data-table
:columns="columns"
:data="data"
:bordered="false"
/>
<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"
>
<template #prefix>
{{ pagination.itemCount }}
</template>
</n-pagination>
</div>
</n-card>
</div>
</template>
<style scoped>

View File

@ -0,0 +1,224 @@
<script setup lang="ts">
import {ArrowDown, ArrowUp, RefreshOutline, SearchOutline} from "@vicons/ionicons5";
import {NButton, NIcon, NSpace} from "naive-ui";
import {onMounted, reactive, ref} from "vue";
import { issueRecordApi,IssueRecord } from '@/api/issuerecord.ts'
const props = defineProps({
deviceId:Number
})
const showSearchInput = ref<Boolean>(false)
const searchForm = ref({
issueCode: undefined,
status: undefined,
})
const pagination = reactive({
page: 1,
pageSize: 10,
itemCount: 0,
showSizePicker: true,
pageSizes: [10, 20, 50]
})
const doShowInner = () => {
if (showSearchInput.value) {
showSearchInput.value = false
}else {
showSearchInput.value = true
}
}
//
const statusList = [
{
label: '下发失败',
value: 0
},
{
label: '下发成功',
value: 1
}
]
//
const data = ref([])
const load = async()=>{
const res = await issueRecordApi.page({
pageSize: pagination.pageSize,
page: pagination.page,
deviceId: props.deviceId,
issueCode: searchForm.value.issueCode,
status: searchForm.value.status
});
data.value = res.list
pagination.itemCount = res.total
}
const columns = [
{
title: '工序名称',
key: 'processName'
},
{
title: '工序名称',
key: 'assingCode'
},
{
title: '下发类型',
key: 'issueType',
render(row) {
var opt = row.issueType
if(opt == 0) return '图纸'
if(opt == 1) return '文件'
if(opt == 2) return '代码'
return '-'
}
},
{
title: '下发状态',
key: 'status',
render(row) {
var opt = row.status
if(opt == 0) return '下发失败'
if(opt == 1) return '下发成功'
}
},
{
title: '下发时间',
key: 'issueTime'
},
// {
// title: '',
// render(row) {
// return row.
// }
// },
{
title: '备注',
key: 'remark'
}
]
const handleSearch = () => {
load()
}
const handleReset = () => {
searchForm.value.issueCode = null
searchForm.value.status = null
pagination.page = 1
pagination.pageSize = 10
handleSearch()
}
//
function handlePageChange(page: number) {
pagination.page = page
load()
}
function handlePageSizeChange(pageSize: number) {
pagination.pageSize = pageSize
pagination.page = 1
load()
}
onMounted(()=>{
load()
})
</script>
<template>
<div>
<n-button @click="doShowInner" v-if="showSearchInput">
<n-icon size="20" :depth="3">
<ArrowDown/>
</n-icon>
展开
</n-button>
<n-card v-if="!showSearchInput">
<n-form inline :model="searchForm" label-placement="left">
<n-grid :x-gap="8" :cols="4">
<n-gi>
<n-form-item label="下发状态">
<n-select
v-model:value="searchForm.status"
:options="statusList"
placeholder="请选择设备类型"
clearable
style="width: 200px"
/>
</n-form-item>
</n-gi>
<n-gi>
<n-form-item>
<n-space>
<n-button type="primary" @click="handleSearch">
<template #icon>
<n-icon>
<SearchOutline/>
</n-icon>
</template>
搜索
</n-button>
<n-button @click="handleReset">
<template #icon>
<n-icon>
<RefreshOutline/>
</n-icon>
</template>
重置
</n-button>
</n-space>
</n-form-item>
</n-gi>
</n-grid>
</n-form>
<n-button @click="doShowInner" v-if="!showSearchInput" style="float: right;margin: 10px">
<n-icon size="20" :depth="3">
<ArrowUp/>
</n-icon>
闭合
</n-button>
</n-card>
<n-card style="margin: 20px 0">
<n-data-table
:columns="columns"
:data="data"
:bordered="false"
/>
<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"
>
<template #prefix>
{{ pagination.itemCount }}
</template>
</n-pagination>
</div>
</n-card>
</div>
</template>
<style scoped>
</style>

View File

@ -0,0 +1,273 @@
<script setup lang="ts">
import {NButton, NIcon, NSpace} from "naive-ui";
import {ArrowDown, ArrowUp, RefreshOutline, SearchOutline} from "@vicons/ionicons5";
import {onMounted, reactive, ref} from "vue";
import { deviceApi, Device} from '@/api/device.ts'
import {dictDataApi} from "@/api/org.ts";
import {userApi,SysUser} from "@/api/system.ts";
import { deviceOperationLogApi,type DeviceOperationLog } from '@/api/deviceOperationLog.ts'
const pagination = reactive({
page: 1,
pageSize: 10,
itemCount: 0,
showSizePicker: true,
pageSizes: [10, 20, 50]
})
const props = defineProps({
deviceId:Number
})
const showSearchInput = ref<Boolean>(false)
const searchForm = ref({
createTime: undefined,
operationType: undefined,
userId: undefined
})
const doShowInner = () => {
if (showSearchInput.value) {
showSearchInput.value = false
}else {
showSearchInput.value = true
}
}
//
const deviceList = ref<Device[]>([])
const getDeviceList = async () => {
try {
const res = await deviceApi.deviceList()
deviceList.value = res.map((n:any)=>{
return {
label:n.deviceName,
value:n.id
}
})
} catch (error) {
//
}
}
//
const optionTypeList = ref([])
const loadDictOptions = async ()=>{
try {
const data = await dictDataApi.listByType("option_type")
optionTypeList.value = data.map(d => ({
label: d.dictLabel,
value: (Number(d.dictValue) || d.dictValue),
class: d.listClass
}))
} catch {
}
}
//
const optionUserList = ref<SysUser[]>([])
const loadUserList = async ()=>{
try {
const data = await userApi.getPathList()
optionUserList.value = data.map(d => ({
label: d.nickname,
value: d.id
}))
} catch {
}
}
//
const data = ref([])
const load = async()=>{
const res = await deviceOperationLogApi.page({
page: pagination.page,
pageSize: pagination.pageSize,
deviceId: props.deviceId,
createTime: searchForm.value.createTime,
operationType: searchForm.value.operationType,
userId: searchForm.value.userId
});
data.value = res.list
pagination.itemCount = res.total
}
//
const columns = [
{
title: '设备名称',
key: 'deviceName'
},
{
title: '操作类型',
key: 'operationTypeName'
},
{
title: '操作人员',
key: 'userName'
},
{
title: '操作时间',
key: 'createTime'
},
{
title: '数据来源',
key: 'source',
render(row) {
var opt = row.source
if(opt == 1) return '终端'
if(opt == 2) return '后台'
return '-'
}
}
]
const handleSearch = () => {
load()
}
const handleReset = () => {
searchForm.value.createTime = null
searchForm.value.operationType = null
searchForm.value.userId = null
pagination.page = 1
pagination.pageSize = 10
load()
}
//
function handlePageChange(page: number) {
pagination.page = page
load()
}
function handlePageSizeChange(pageSize: number) {
pagination.pageSize = pageSize
pagination.page = 1
load()
}
onMounted(()=>{
getDeviceList()
loadDictOptions()
loadUserList()
load()
})
</script>
<template>
<div>
<n-button @click="doShowInner" v-if="showSearchInput">
<n-icon size="20" :depth="3">
<ArrowDown/>
</n-icon>
展开
</n-button>
<n-card v-if="!showSearchInput">
<n-form inline :model="searchForm" label-placement="left">
<n-grid :x-gap="8" :cols="4">
<n-gi>
<n-form-item label="日期">
<n-date-picker
v-model:value="searchForm.createTime"
type="date" />
</n-form-item>
</n-gi>
<!-- <n-gi>-->
<!-- <n-form-item label="操作类型">-->
<!-- <n-select-->
<!-- v-model:value="searchForm.operationType"-->
<!-- :options="optionTypeList"-->
<!-- placeholder="请选择设备类型"-->
<!-- clearable-->
<!-- style="width: 200px"-->
<!-- />-->
<!-- </n-form-item>-->
<!-- </n-gi>-->
<n-gi>
<n-form-item label="操作人员">
<n-select
v-model:value="searchForm.userId"
:options="optionUserList"
placeholder="请选择设备类型"
clearable
style="width: 200px"
/>
</n-form-item>
</n-gi>
<n-gi>
<n-form-item>
<n-space>
<n-button type="primary" @click="handleSearch">
<template #icon>
<n-icon>
<SearchOutline/>
</n-icon>
</template>
搜索
</n-button>
<n-button @click="handleReset">
<template #icon>
<n-icon>
<RefreshOutline/>
</n-icon>
</template>
重置
</n-button>
</n-space>
</n-form-item>
</n-gi>
</n-grid>
</n-form>
<n-button @click="doShowInner" v-if="!showSearchInput" style="float: right;margin: 10px">
<n-icon size="20" :depth="3">
<ArrowUp/>
</n-icon>
闭合
</n-button>
</n-card>
<n-card style="margin: 20px 0">
<n-data-table
:columns="columns"
:data="data"
:bordered="false"
/>
<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"
>
<template #prefix>
{{ pagination.itemCount }}
</template>
</n-pagination>
</div>
</n-card>
</div>
</template>
<style scoped>
</style>

View File

@ -4,7 +4,7 @@
<!-- 搜索表单 -->
<div class="search-form">
<n-form inline :model="searchForm" label-placement="left">
<n-form-item label="主键ID">
<n-form-item label="设备编码">
<n-input v-model:value="searchForm.deviceCode" placeholder="请输入设备编码" clearable/>
</n-form-item>
<n-form-item>
@ -74,6 +74,7 @@
:loading="loading"
:row-key="(row) => row.id"
:scroll-x="1200"
v-model:checked-row-keys="selectedIds"
/>
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px">
<n-pagination
@ -130,10 +131,10 @@
</n-form-item>
<n-form-item label="设备负责人" path="deviceManager">
<n-select
v-model:value="formData.deviceManagerList"
v-model:value="formData.deviceManagers"
:options="deviceManagerList"
multiple
placeholder="请选择设备类型"
placeholder="请选择设备负责人"
clearable
style="width: 200px"
/>
@ -201,10 +202,10 @@
</n-modal>
<!--异常记录抽屉-->
<n-drawer v-model:show="deviceAbnormalRecordDrawerVisible" :title="title" width="800">
<n-drawer v-model:show="deviceAbnormalRecordDrawerVisible" :title="title" width="1800">
<n-drawer-content :title="title">
<DeviceAbnormalRecordPage
:deviceAbnormalRecordList="deviceAbnormalRecordList"
:deviceId="deviceId"
/>
<template #footer>
<n-button @click="doShowInner">
@ -213,6 +214,36 @@
</template>
</n-drawer-content>
</n-drawer>
<!--操作日志抽屉-->
<n-drawer v-model:show="deviceOperationLogDrawerVisible" width="1800">
<n-drawer-content :title="title">
<DeviceOperationLogPage
:deviceId = deviceId
/>
<template #footer>
<n-button @click="doShowInner">
取消
</n-button>
</template>
</n-drawer-content>
</n-drawer>
<!--下发记录抽屉-->
<n-drawer v-model:show="deviceDispatchLogDrawerVisible" width="1800">
<n-drawer-content :title="title">
<DeviceDispatchLogPage
:deviceId = deviceId
/>
<template #footer>
<n-button @click="doShowInner">
取消
</n-button>
</template>
</n-drawer-content>
</n-drawer>
</div>
</template>
@ -239,10 +270,16 @@ 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'
import DeviceOperationLogPage from "@/views/biz/device/DeviceOperationLog.vue";
import DeviceDispatchLogPage from "@/views/biz/device/DeviceDispatchLog.vue";
const message = useMessage()
const dialog = useDialog()
const router = useRouter()
//Id
const deviceId = ref<number>(undefined)
//
const deviceManagerList = ref<{ label: string, value: any }[]>([])
@ -255,9 +292,10 @@ const title = ref('')
//
const deviceIssueRecordList = ref<[]>([])
const deviceDispatchLogDrawerVisible = ref<Boolean>(false)
//
const deviceOperationLogDrawerVisible = ref<Boolean>(false)
//
const searchForm = reactive({
@ -297,7 +335,9 @@ const defaultFormData: Device = {
status: 0,
deviceFlag: 'mes_equipment',
synEquipId: null as number | null,
deviceManagerList: null as any | null
deviceManagerList: null as any | null,
deviceManagers: null as [string] | null,
deviceManager: null as String | null
}
const formData = reactive<Device>({...defaultFormData})
@ -365,12 +405,14 @@ const columns: DataTableColumns<Device> = [
{
label: '设备异常记录',
key: 'deviceErrorLog',
},
{
label: '设备下发记录',
key: 'deviceDispatchLog',
},
{
label: '设备操作日志',
key: 'deviceOperationLog',
}
], onSelect: (key: string) => {
switch (key) {
@ -380,6 +422,9 @@ const columns: DataTableColumns<Device> = [
case "deviceDispatchLog":
handleDeviceDispatchLog(row)
break
case "deviceOperationLog":
deviceOperationLog(row)
break
}
}
}, {
@ -455,16 +500,23 @@ function goRealtimeBoard() {
//
function handleEdit(row: Device) {
Object.assign(formData, defaultFormData)
modalTitle.value = '编辑设备表'
Object.assign(formData, row)
console.log(formData);
const userIdList = []
if (row.deviceManager) {
let manager = row.deviceManager.split(',');
manager.forEach(item => {
userIdList.push(Number(item))
})
}
formData.deviceManagers = userIdList
modalVisible.value = true
}
//
async function handleSubmit() {
await formRef.value?.validate()
try {
const submitData = {...formData} as Device
@ -531,6 +583,7 @@ async function handleExport() {
const params: Record<string, any> = {}
if (selectedIds.value.length > 0) params.ids = selectedIds.value
if (searchForm.deviceCode != null) params.deviceCode = searchForm.deviceCode
params.deviceFlag = "mes_equipment"
const blob = await deviceApi.export(params)
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
@ -620,26 +673,42 @@ async function loadSection() {
//
async function handleUser() {
const res = await userApi.getEquipmentManager()
deviceManagerList.value = res
const res = await userApi.getPathList()
deviceManagerList.value = res.map((n:any)=>{
return {
label:n.username,
value:n.id
}
})
}
//
async function handleDeviceErrorLog(row: Device) {
deviceId.value = row.id
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)
deviceId.value = row.id
deviceDispatchLogDrawerVisible.value = true
title.value = row.deviceName+"设备下发记录"
}
async function deviceOperationLog(row: Device) {
deviceId.value = row.id
deviceOperationLogDrawerVisible.value = true
title.value = row.deviceName + "操作记录";
}
function doShowInner() {
deviceAbnormalRecordDrawerVisible.value = false
deviceOperationLogDrawerVisible.value = false
deviceDispatchLogDrawerVisible.value = false
}
onMounted(() => {

View File

@ -353,6 +353,7 @@
:obj="n"
:index="i"
:section="dispatchform.workCenterName"
:workShop="dispatchform.workShop"
listname="list"
@addhand="addpgnum"
@delehand="deletenum(i)"
@ -531,10 +532,28 @@
<!-- 汇报详情弹窗 -->
<n-modal v-model:show="submitLogModalVisible" preset="card" title="导入工序计划" style="width: 500px">
<n-modal v-model:show="submitLogModalVisible" preset="card" title="工序汇报详情" style="width: 2000px">
<ReportDetailPage
:planId="processId"
/>
<template #footer>
<n-space justify="end">
<n-button size="small" @click="submitLogModalVisible = false">取消</n-button>
</n-space>
</template>
</n-modal>
<n-modal v-model:show="submitModalVisible" preset="card" title="工单汇报详情" style="width: 2000px">
<OrderReportDetailPage
:orderItemId="orderItemId"
/>
<template #footer>
<n-space justify="end">
<n-button size="small" @click="submitLogModalVisible = false">取消</n-button>
</n-space>
</template>
</n-modal>
</div>
</template>
@ -550,7 +569,7 @@ import {
AddOutline, RemoveOutline, SearchOutline, RefreshOutline, CloudUploadOutline,
DownloadOutline, ChevronDownOutline, CheckmarkCircleOutline, CheckmarkCircle,
EllipseOutline, TimeOutline, PrintOutline, SyncOutline, PeopleOutline,
GitBranchOutline, CloseCircleOutline, LockClosedOutline, TrashOutline,
GitBranchOutline, CloseCircleOutline, LockClosedOutline, TrashOutline, EyeSharp,
} from '@vicons/ionicons5'
import {
orderProcessPlanApi,
@ -568,8 +587,8 @@ import ProcessCard from './components/ProcessCard.vue'
import PlmModelDrawer from '@/components/PlmModelDrawer.vue'
import type { PlmModelOpenContext } from '@/api/plmModel'
import Pgitem from './pgitem.vue'
import { submitLogApi } from '@/api/submitLog.ts'
import ReportDetailPage from "@/views/biz/orderProcessPlan/components/ReportDetail.vue";
import OrderReportDetailPage from "@/views/biz/orderProcessPlan/components/OrderReportDetail.vue";
const message = useMessage()
@ -609,7 +628,7 @@ const dispatchmodal = ref(false)
const dispatchLoading = ref(false)
const dispatchformRef = ref()
const dispatchform = reactive<any>({
id: '', name: '', beginTime: '', endTime: '', quantity: '',workCenterName:'',
id: '', name: '', beginTime: '', endTime: '', quantity: '',workCenterName:'',proWorkshop:'',
list: [{ sectionId:'',deviceId:'', quantity: '' }],
})
const dispatchrules = {}
@ -617,6 +636,7 @@ const dispatchrules = {}
const importModalVisible = ref(false)
const plmModelDrawerRef = ref<InstanceType<typeof PlmModelDrawer> | null>(null)
const submitModalVisible = ref<Boolean>(false)
const outsourceModalVisible = ref(false)
const outsourceOptionsLoading = ref(false)
@ -659,13 +679,14 @@ function openPlmModel(order: OrderProcessPlanVO, process?: ProcessPlanItemVO) {
//
const submitLogModalVisible = ref<Boolean>(false)
const processId = ref<number | null>(null)
//
function openDetailModel(order:ProcessPlanItemVO,procces?:OrderProcessPlanVO) {
function openDetailModel(order:ProcessPlanItemVO,process?:OrderProcessPlanVO) {
submitLogModalVisible.value = true
const processId = procces.planId
console.log(process.planId)
processId.value = process.planId
}
@ -704,6 +725,7 @@ const moreOptions = [
{ label: '创建返工单', key: 'createRework', icon: dropdownIcon(SyncOutline) },
{ label: '创建工序委外', key: 'createOutsource', icon: dropdownIcon(PeopleOutline) },
{ label: '拆分工单', key: 'splitWorkOrder', icon: dropdownIcon(GitBranchOutline) },
{ label: '汇报详情', key: 'reportDetailView', icon: dropdownIcon(EyeSharp) },
],
},
{
@ -858,6 +880,11 @@ function onMoreSelect(key: string, order: OrderProcessPlanVO) {
openOutsource(order)
return
}
if (key === 'reportDetailView') {
openReportDetail(order)
return;
}
const labels: Record<string, string> = {
print: '打印',
createRework: '创建返工单',
@ -1034,7 +1061,7 @@ async function handleSubmit() {
}
function disphand(process: ProcessPlanItemVO, order?: OrderProcessPlanVO) {
const entity = processItemToEntity(process, order?.orderItemId)
const entity = processItemToEntity(process, order?.orderItemId,order?.proWorkshop)
dispatchmodal.value = true
dispatchformRef.value?.restoreValidation()
@ -1046,8 +1073,11 @@ function disphand(process: ProcessPlanItemVO, order?: OrderProcessPlanVO) {
dispatchform.orderItemId = entity.orderItemId
dispatchform.sort = entity.sort
dispatchform.workCenterName = entity.workCenterName
dispatchform.workShop = entity.proWorkshop
dispatchform.list = [{ sectionId:'',deviceId:'', quantity: '' }]
console.log(dispatchform)
}
@ -1120,6 +1150,15 @@ async function handleImportUpload({ file }: UploadCustomRequestOptions) {
loadData()
}
const orderItemId = ref<number>(null)
function openReportDetail(order) {
submitModalVisible.value = true
orderItemId.value = order.orderItemId
}
onMounted(loadData)
</script>

View File

@ -0,0 +1,211 @@
<script setup lang="ts">
import {SubmitLog, submitLogApi} from '@/api/submitLog'
import {h, onMounted, reactive, ref} from "vue";
import {NButton, NDataTable, NIcon, NSpace, NTag} from "naive-ui";
import { dictDataApi } from "@/api/org";
import {ArrowDown, ArrowUp, RefreshOutline, SearchOutline} from "@vicons/ionicons5";
const props = defineProps<{
orderItemId: number
}>()
const searchForm = ref({
submitStatus: undefined
})
const submitList = ref<SubmitLog[]>([])
//Id
async function loadReportDetail() {
try {
console.log(props.orderItemId)
const res = await submitLogApi.getOrderItemReportDetail({
page: pagination.page,
pageSize: pagination.pageSize,
submitStatus: searchForm.value.submitStatus,
orderItemId:props.orderItemId
})
submitList.value = res.list
pagination.itemCount = res.total
} catch (error) {
console.error('加载汇报详情失败', error)
}
}
const columns = [
{
title: '提交数量',
key: 'quantity',
width: 120
},
{
title: '提交人',
key: 'userName',
width: 120
},
{
title: '提交时间',
key: 'createTime',
width: 120
},
{
title: '汇报状态',
key: 'submitStatus',
width: 120,
render(row) {
const option = submitStatusOptions.value.find(o => o.value === row.submitStatus)
return h(NTag, { type: option.class, size: 'small' }, { default: () => option.label })
}
}
]
const submitStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
//
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 {}
}
const doShowInner = () => {
if (showSearchInput.value) {
showSearchInput.value = false
}else {
showSearchInput.value = true
}
}
const showSearchInput = ref<Boolean>(false)
const pagination = reactive({
page: 1,
pageSize: 10,
itemCount: 0,
showSizePicker: true,
pageSizes: [10, 20, 50]
})
const handleSearch = () => {
loadReportDetail()
}
const handleReset = () => {
searchForm.value.submitStatus = null
pagination.page = 1
pagination.pageSize = 10
loadReportDetail()
}
//
function handlePageChange(page: number) {
pagination.page = page
loadReportDetail()
}
function handlePageSizeChange(pageSize: number) {
pagination.pageSize = pageSize
pagination.page = 1
loadReportDetail()
}
onMounted(async () => {
loadReportDetail()
loadDictOptions()
})
</script>
<template>
<div>
<n-button @click="doShowInner" v-if="showSearchInput">
<n-icon size="20" :depth="3">
<ArrowDown/>
</n-icon>
展开
</n-button>
<n-card v-if="!showSearchInput">
<n-form inline :model="searchForm" label-placement="left">
<n-grid :x-gap="8" :cols="4">
<n-gi>
<n-form-item label="汇报状态">
<n-select
v-model:value="searchForm.submitStatus"
:options="submitStatusOptions"
placeholder="请选择异常类型"
clearable
style="width: 200px"
/>
</n-form-item>
</n-gi>
<n-gi>
<n-form-item>
<n-space>
<n-button type="primary" @click="handleSearch">
<template #icon>
<n-icon>
<SearchOutline/>
</n-icon>
</template>
搜索
</n-button>
<n-button @click="handleReset">
<template #icon>
<n-icon>
<RefreshOutline/>
</n-icon>
</template>
重置
</n-button>
</n-space>
</n-form-item>
</n-gi>
</n-grid>
</n-form>
<n-button @click="doShowInner" v-if="!showSearchInput" style="float: right;margin: 10px">
<n-icon size="20" :depth="3">
<ArrowUp/>
</n-icon>
闭合
</n-button>
</n-card>
<n-card style="margin: 10px 0">
<n-scrollbar x-scrollable>
<n-data-table
:columns="columns"
:data="submitList"
:bordered="false"
/>
<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"
>
<template #prefix>
{{ pagination.itemCount }}
</template>
</n-pagination>
</div>
</n-scrollbar>
</n-card>
</div>
</template>
<style scoped>
</style>

View File

@ -84,7 +84,7 @@
>委外</n-button>
<n-button
size="tiny"
quaternary
type="info"
ghost
@click="emit('submitDetail', process)"
>汇报</n-button>

View File

@ -0,0 +1,209 @@
<script setup lang="ts">
import {SubmitLog, submitLogApi} from '@/api/submitLog'
import {h, onMounted, reactive, ref} from "vue";
import {NButton, NDataTable, NIcon, NSpace, NTag} from "naive-ui";
import { dictDataApi } from "@/api/org";
import {ArrowDown, ArrowUp, RefreshOutline, SearchOutline} from "@vicons/ionicons5";
const props = defineProps<{
planId: number
}>()
const searchForm = ref({
submitStatus: undefined
})
const submitList = ref<SubmitLog[]>([])
//Id
async function loadReportDetail() {
try {
const res = await submitLogApi.getProcessReportDetail({
page: pagination.page,
pageSize: pagination.pageSize,
submitStatus: searchForm.value.submitStatus,
processId:props.planId
})
submitList.value = res.list
pagination.itemCount = res.total
} catch (error) {
console.error('加载汇报详情失败', error)
}
}
const columns = [
{
title: '提交数量',
key: 'quantity',
width: 120
},
{
title: '提交人',
key: 'userName',
width: 120
},
{
title: '提交时间',
key: 'createTime',
width: 120
},
{
title: '汇报状态',
key: 'submitStatus',
width: 120,
render(row) {
const option = submitStatusOptions.value.find(o => o.value === row.submitStatus)
return h(NTag, { type: option.class, size: 'small' }, { default: () => option.label })
}
}
]
const submitStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
//
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 {}
}
const doShowInner = () => {
if (showSearchInput.value) {
showSearchInput.value = false
}else {
showSearchInput.value = true
}
}
const showSearchInput = ref<Boolean>(false)
const pagination = reactive({
page: 1,
pageSize: 10,
itemCount: 0,
showSizePicker: true,
pageSizes: [10, 20, 50]
})
const handleSearch = () => {
loadReportDetail()
}
const handleReset = () => {
searchForm.value.submitStatus = null
pagination.page = 1
pagination.pageSize = 10
loadReportDetail()
}
//
function handlePageChange(page: number) {
pagination.page = page
loadReportDetail()
}
function handlePageSizeChange(pageSize: number) {
pagination.pageSize = pageSize
pagination.page = 1
loadReportDetail()
}
onMounted(async () => {
loadReportDetail()
loadDictOptions()
})
</script>
<template>
<div>
<n-button @click="doShowInner" v-if="showSearchInput">
<n-icon size="20" :depth="3">
<ArrowDown/>
</n-icon>
展开
</n-button>
<n-card v-if="!showSearchInput">
<n-form inline :model="searchForm" label-placement="left">
<n-grid :x-gap="8" :cols="4">
<n-gi>
<n-form-item label="汇报状态">
<n-select
v-model:value="searchForm.submitStatus"
:options="submitStatusOptions"
placeholder="请选择异常类型"
clearable
style="width: 200px"
/>
</n-form-item>
</n-gi>
<n-gi>
<n-form-item>
<n-space>
<n-button type="primary" @click="handleSearch">
<template #icon>
<n-icon>
<SearchOutline/>
</n-icon>
</template>
搜索
</n-button>
<n-button @click="handleReset">
<template #icon>
<n-icon>
<RefreshOutline/>
</n-icon>
</template>
重置
</n-button>
</n-space>
</n-form-item>
</n-gi>
</n-grid>
</n-form>
<n-button @click="doShowInner" v-if="!showSearchInput" style="float: right;margin: 10px">
<n-icon size="20" :depth="3">
<ArrowUp/>
</n-icon>
闭合
</n-button>
</n-card>
<n-card style="margin: 10px 0">
<n-scrollbar x-scrollable>
<n-data-table
:columns="columns"
:data="submitList"
:bordered="false"
/>
<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"
>
<template #prefix>
{{ pagination.itemCount }}
</template>
</n-pagination>
</div>
</n-scrollbar>
</n-card>
</div>
</template>
<style scoped>
</style>

View File

@ -82,21 +82,20 @@
</template>
<script setup lang="ts">
import { ref,reactive, watch } from 'vue'
import { ref,reactive } from 'vue'
import { userApi } from '@/api/system'
import {deviceApi} from '@/api/device'
import {sectionApi, type Section} from '@/api/section'
import {
AddOutline,
TrashOutline,
} from '@vicons/ionicons5'
import { label } from 'three/tsl'
const props = withDefaults(defineProps<{
listname:any
obj:any,
index:any
section:string
workShop: string
}>(), {
obj:{}
})
@ -157,23 +156,23 @@ import { label } from 'three/tsl'
//
async function loadSection() {
//section
const res = await sectionApi.list({sectionName:props.section})
const res = await sectionApi.list({sectionName:props.section,workShop:props.workShop})
const mesSection = res.MesSection;
const mesDevice = res.MesDevice
console.log(mesSection);
sectionList.push({
label:mesSection.sectionName,
value:mesSection.id
})
props.obj.sectionId = mesSection.id
})
props.obj.sectionId = mesSection.id
deviceList.value = mesDevice.map((n:any)=>{
return {
label:n.deviceName,
value:n.id+''
}
})
})
}
// function searchSection(sectionId?:number){

View File

@ -51,6 +51,7 @@
:loading="loading"
:row-key="(row) => row.id"
:scroll-x="1200"
v-model:checked-row-keys="selectedIds"
/>
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px">

View File

@ -51,6 +51,7 @@
:loading="loading"
:row-key="(row) => row.id"
:scroll-x="1200"
v-model:checked-row-keys="selectedIds"
/>
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px">
<n-pagination
@ -361,6 +362,7 @@ async function handleExport() {
const params: Record<string, any> = {}
if (selectedIds.value.length > 0) params.ids = selectedIds.value
if (searchForm.deviceCode != null) params.deviceCode = searchForm.deviceCode
params.deviceFlag = "mes_station"
const blob = await deviceApi.export(params)
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')

View File

@ -192,6 +192,7 @@
@remove="flchang"-->
<n-upload
directory-dnd
auto-upload="false"
:action="URL"
:headers="{
Authorization:TOKEN
@ -283,7 +284,6 @@ import {
reactive,
h,
onMounted,
watch,
} from 'vue'
@ -299,7 +299,6 @@ import {
NTag,
useMessage,
useDialog,
//type FormInst,
} from 'naive-ui'
import {
@ -321,7 +320,8 @@ import {
generateDFCode,
exportdraFile,
opertree,
filelist
//filelist,
multifilelist
} from '@/api/illustrated'
import {
@ -699,10 +699,9 @@ let flist = ref<any>([])
function flchang(n:any) {
let v = JSON.parse(n.event.target.responseText)
if(v.data && v.data.id){
formData.fileId = v.data.id+''
formData.fileId = formData.fileId + v.data.id+','
}
console.log(flist.value,'flist')
console.log(formData.fileId)
}
@ -718,18 +717,27 @@ function addhand(type:any,row?:any) {
formData.drawingCode = row.drawingCode
formData.processId = row.processId
formData.drawingType = row.drawingType
formData.fileId = row.fileId
formData.fileId = row.fileId+','
selval.value = row.processId
flist.value.splice(0)
filelist(row.fileId).then(rps => {
if(rps){
flist.value.push({
id: rps.id,
name: rps.originalName,
status: 'finished', // 'finished'
url: rps.url, //
multifilelist(row.fileId).then(rps => {
if(rps && rps.length > 0){
// flist.value.push({
// id: rps.id,
// name: rps.originalName,
// status: 'finished', // 'finished'
// url: rps.url, //
// })
flist.value = rps.map((n:any) => {
return {
id: n.id,
name: n.originalName,
status: 'finished', // 'finished'
url: n.url,
}
})
}
@ -788,6 +796,7 @@ function addEdi(){
function savehand() {
addformRef.value?.validate((e:any) => {
if (!e) {
formData.fileId = formData.fileId.replace(/,$/,'')
addEdi().then(() => {
message.success(isstype.value == 1?'新增成功':'修改成功')
setTimeout(() => {

View File

@ -301,7 +301,8 @@ const columns: DataTableColumns<SysNotice> = [
render(row) {
const typeMap: Record<number, { text: string; type: 'info' | 'warning' }> = {
1: { text: '通知', type: 'info' },
2: { text: '公告', type: 'warning' }
2: { text: '公告', type: 'warning' },
3: { text: '异常通知', type: 'error' }
}
const config = typeMap[row.noticeType] || { text: '未知', type: 'info' as const }
return h(NTag, { type: config.type, size: 'small' }, { default: () => config.text })

View File

@ -11,17 +11,20 @@
</n-button>
</n-space>
</div>
<n-data-table
v-model:expanded-row-keys="AssingWorkExpandedKeys"
:columns="AssingWorkColumns"
:data="AssingWorkTableData"
:loading="tableLoading"
:row-key="RowKey"
:scroll-x="600"
:max-height="1000"
size="small"
style="margin-bottom:15px"
/>
<n-scrollbar x-scrollable>
<n-data-table
v-model:expanded-row-keys="AssingWorkExpandedKeys"
:columns="AssingWorkColumns"
:data="AssingWorkTableData"
:loading="tableLoading"
:row-key="RowKey"
:scroll-x="600"
:max-height="1000"
size="small"
style="margin-bottom:15px"
/>
</n-scrollbar>
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px">
<n-pagination
v-model:page="pagination.page"
@ -43,12 +46,12 @@
<div>
<SubmitLogInfoPage
v-if="baseInfo.logOrQuality === 'log'"
:submitLogList="submitLogList"
:assingId="assingId"
:baseInfo="baseInfo"
/>
<QualityInfoPage
v-if="baseInfo.logOrQuality === 'Quality'"
:qualityTestingList="qualityList"
:assingId="assingId"
:baseInfo="baseInfo"
/>
</div>
@ -506,10 +509,11 @@ async function loadDictOptions() {
}
//
const assingId = ref<number>(null)
function handleReportRecords(row:any) {
showQcReport.value = true
reportTitle.value = "汇报信息"
submitLogList.value = row.submitLogList
assingId.value = row.id
baseInfo.value = {...row}
baseInfo.value.logOrQuality = "log"
}
@ -520,8 +524,7 @@ function handleReportRecords(row:any) {
function handleQualityRecords(row:any) {
showQcReport.value = true
reportTitle.value = "质检信息"
qualityList.value = row.qualityTestingList
console.log(qualityList.value)
assingId.value = row.id
baseInfo.value = {...row}
baseInfo.value.logOrQuality = "Quality"
}

View File

@ -27,7 +27,7 @@
<n-data-table
:columns="reportRecordsColums"
size="small"
:data="props.qualityTestingList"
:data="qualityTestingList"
remote
:scroll-x="600"
/>
@ -39,11 +39,11 @@ 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";
import {QualityTesting,qualityTestingApi} from "@/api/qualityTesting.ts";
const props =defineProps(
{
qualityTestingList:Object,
assingId:Object,
baseInfo:Object
}
)
@ -91,9 +91,15 @@ async function loadDictOptions() {
}
const qualityTestingList = ref<QualityTesting[]>([])
async function loadQualityTestingList() {
const res = await qualityTestingApi.loadQualityTestingList(props.assingId)
qualityTestingList.value = res
}
onMounted(()=>{
loadDictOptions()
loadQualityTestingList()
})
</script>
<style scoped>

View File

@ -27,7 +27,7 @@
<n-data-table
:columns="reportRecordsColums"
size="small"
:data="props.submitLogList"
:data="submitLogList"
remote
:scroll-x="600"
/>
@ -38,11 +38,11 @@
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'
import { SubmitLog,submitLogApi} from '@/api/submitLog'
const props =defineProps(
{
submitLogList:Object,
assingId:Number,
baseInfo:Object
}
)
@ -64,7 +64,8 @@ const reportRecordsColums:DataTableColumns<SubmitLog> = [
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
}
},
{ title: '汇报时间', key: 'createTime',align: 'center' },
]
//
@ -75,10 +76,16 @@ async function loadDictOptions() {
}catch {}
}
//
const submitLogList = ref<SubmitLog[]>([])
async function load() {
const res = await submitLogApi.loadSumbitLog(props.assingId)
submitLogList.value = res
}
onMounted(()=>{
loadDictOptions()
load()
})
</script>
<style scoped>

View File

@ -280,19 +280,6 @@ const pagination = reactive({
const plmModelDrawerRef = ref<InstanceType<typeof PlmModelDrawer> | null>(null)
function openPlmModel(row: Record<string, unknown>) {
console.log(row);
const ctx: PlmModelOpenContext = {
orderItemId: row.orderItemId as string | number,
dispatchId: row.id as number | string,
materialCode: row.materialCode as string | undefined,
materialName: row.materialName as string | undefined,
drawingNo: (row.drawingNo as string | undefined) || (row.materialCode as string | undefined),
title: `三维模型 · ${row.processName || row.materialName || ''}`,
}
plmModelDrawerRef.value?.open(ctx)
}
const columns = [
// {
@ -541,9 +528,7 @@ const columns = [
]
function dropdownIcon(icon: Component) {
return () => h(NIcon, null, { default: () => h(icon) })
}
//