Compare commits

...

4 Commits

Author SHA1 Message Date
andy
77aae7a280 修改 2026-07-27 16:42:20 +08:00
andy
99ea384470 修改 2026-07-27 16:38:51 +08:00
andy
fa6c4eeb53 修改 2026-07-27 16:37:38 +08:00
andy
67d39e23b3 修改 2026-07-27 11:53:00 +08:00
9 changed files with 255 additions and 121 deletions

View File

@ -5,12 +5,8 @@ VITE_APP_TITLE = 伊特机械MES
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'
# 开发环境 # 开发环境
<<<<<<< HEAD
VITE_APP_BASE_API = 'http://192.168.5.232:8888/api'
=======
#VITE_APP_BASE_API = 'http://192.168.12.4:8888/api' #VITE_APP_BASE_API = 'http://192.168.12.4:8888/api'
>>>>>>> f1e25f58a96a8b7737687ce50afef4b34cda2541
#VITE_APP_BASE_API = 'http://192.168.5.14:9100/gateway' #VITE_APP_BASE_API = 'http://192.168.5.14:9100/gateway'
VITE_APP_BASE_API = 'http://localhost/api' VITE_APP_BASE_API = 'http://localhost/api'

View File

@ -24,9 +24,10 @@
"html2canvas": "^1.4.1", "html2canvas": "^1.4.1",
"jsencrypt": "^3.3.2", "jsencrypt": "^3.3.2",
"jspdf": "^4.2.1", "jspdf": "^4.2.1",
"naive-ui":"^2.37.3", "naive-ui": "^2.37.3",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.1", "pinia-plugin-persistedstate": "^3.2.1",
"seemly": "^0.3.10",
"three": "^0.184.0", "three": "^0.184.0",
"vue": "^3.4.15", "vue": "^3.4.15",
"vue-draggable-plus": "^0.6.1", "vue-draggable-plus": "^0.6.1",

View File

@ -50,6 +50,9 @@ importers:
pinia-plugin-persistedstate: pinia-plugin-persistedstate:
specifier: ^3.2.1 specifier: ^3.2.1
version: 3.2.3(pinia@2.3.1(typescript@5.9.3)(vue@3.5.31(typescript@5.9.3))) version: 3.2.3(pinia@2.3.1(typescript@5.9.3)(vue@3.5.31(typescript@5.9.3)))
seemly:
specifier: ^0.3.10
version: 0.3.10
three: three:
specifier: ^0.184.0 specifier: ^0.184.0
version: 0.184.0 version: 0.184.0

View File

@ -44,7 +44,7 @@ export function nccodelist(params:any) {
//下发 //下发
export function batchIssue(data:any) { export function batchIssue(data:any) {
return request({ return request({
url: '/api/biz/ncCode/issue', url: '/biz/ncCode/issue',
method: 'post', method: 'post',
data data
}) })
@ -53,7 +53,7 @@ export function batchIssue(data:any) {
//删除 //删除
export function deleteIssue(ids:any) { export function deleteIssue(ids:any) {
return request({ return request({
url: `api/biz/ncCode/${ids}`, url: `/biz/ncCode/${ids}`,
method: 'delete' method: 'delete'
}) })
} }
@ -66,3 +66,28 @@ export function issuecopy(data:any) {
data data
}) })
} }
//任务树
export function opertree() {
return request({
url: `biz/ncCode/operationTree`,
method: 'get'
})
}
//生产NC编码
export function generateNccode() {
return request({
url: `biz/ncCode/generateNcCode`,
method: 'get'
})
}
//导出
export function exportNccode(params:any) {
return request({
url: `biz/ncCode/export`,
method: 'get',
params
})
}

View File

@ -43,3 +43,13 @@ export function reportingwork(data:any) {
data data
}) })
} }
//登出设备
export function terlogout(data:any) {
return request({
url: '/terminal/logout',
method: 'post',
data
})
}

View File

@ -35,7 +35,7 @@
</div> </div>
<n-space style="margin-bottom: 15px;"> <n-space style="margin-bottom: 15px;">
<n-button type="primary" @click="addhand(1)" size="small"> <n-button v-if="hasPermission('biz:ncCode:add')" type="primary" @click="addhand(1)" size="small">
<template #icon> <template #icon>
<n-icon> <n-icon>
<AddOutline /> <AddOutline />
@ -51,7 +51,7 @@
</template> </template>
删除 删除
</n-button> --> </n-button> -->
<n-button type="success" @click="issuehand" size="small"> <n-button v-if="hasPermission('biz:ncCode:export')" type="success" @click="handleExport" size="small">
<template #icon> <template #icon>
<n-icon> <n-icon>
<ArrowDownCircleOutline /> <ArrowDownCircleOutline />
@ -111,7 +111,7 @@
<n-grid :cols="1" :x-gap="24"> <n-grid :cols="1" :x-gap="24">
<n-gi> <n-gi>
<n-form-item path="ncCode" label="NC代码编号"> <n-form-item path="ncCode" label="NC代码编号">
<n-input v-model:value="formData.ncCode" placeholder="请输入NC代码编号" /> <n-input v-model:value="formData.ncCode" placeholder="自动生成" disabled />
</n-form-item> </n-form-item>
</n-gi> </n-gi>
<n-gi> <n-gi>
@ -214,51 +214,22 @@
v-model:show="issueModel" v-model:show="issueModel"
title="下发" title="下发"
preset="card" preset="card"
style="width: 500px" style="width: 600px"
:mask-closable="false" :mask-closable="false"
> >
<n-transfer
<n-form v-model:value="value"
ref="issformRef" style="height:500px;"
:model="issformData" :options="options"
:rules="issaddrules" :render-source-list="renderSourceList"
label-placement="top" source-filterable
label-width="100" @update:value="tranupdate"
> />
<n-grid :cols="1" :x-gap="24">
<n-gi>
<n-form-item path="taskid" label="下发任务">
<n-select
:disabled="false"
:render-label="renderlabe"
v-model:value="issformData.taskid"
placeholder="请选择下发任务"
:options="isstasklist"
/>
</n-form-item>
<n-form-item path="equis" label="下发设备">
<n-select
:disabled="false"
:render-label="renderlabe"
v-model:value="issformData.equis"
placeholder="请选择下发设备"
:options="issequiplist"
/>
</n-form-item>
</n-gi>
<!-- <n-gi>
<n-form-item path="ncName" label="下发代码">
<n-input v-model:value="formData.ncName" placeholder="请输入NC代码名称" />
</n-form-item>
</n-gi> -->
</n-grid>
</n-form>
<template #footer> <template #footer>
<n-space justify="end"> <n-space justify="end">
<n-button @click="issueModel = false">取消</n-button> <n-button @click="issueModel = false">取消</n-button>
<n-button <n-button
type="primary" type="primary"
@click="isssavehand" @click="isssavehand"
>确认</n-button> >确认</n-button>
</n-space> </n-space>
@ -280,6 +251,7 @@ import {
import { import {
NTree,
NButton, NButton,
NIcon, NIcon,
NSpace, NSpace,
@ -306,12 +278,11 @@ import {
batchIssue, batchIssue,
editccode, editccode,
issuecopy, issuecopy,
ncCode generateNccode,
opertree,
exportNccode
} from '@/api/nccode' } from '@/api/nccode'
const dialog = useDialog() const dialog = useDialog()
const message = useMessage() const message = useMessage()
@ -321,7 +292,7 @@ const userStore = useUserStore()
// //
const hasPermission = (permission: string) => userStore.hasPermission(permission) const hasPermission = (permission: string) => userStore.hasPermission(permission)
const ncDispatchRecords = ref<ncCode[]>([]) //const ncDispatchRecords = ref<ncCode[]>([])
// //
//const qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([]) //const qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
@ -408,6 +379,31 @@ const columns = [
return '禁用' return '禁用'
} }
}, },
{
align:"center",
title:"是否下发",
key:"isIssued",
minWidth:150,
render(row:any) {
if(row.isIssued == 1){
return '已下发'
}
return '未下发'
}
},
{
align:"center",
title:"下发时间",
key:"issueTime",
minWidth:150
},
{
align:"center",
title:"下发人",
key:"issueBy",
minWidth:150
},
{ {
align:"center", align:"center",
title:"备注", title:"备注",
@ -458,29 +454,36 @@ const columns = [
{ default: () => '编辑'} { default: () => '编辑'}
)) ))
} }
if(hasPermission('biz:ncCode:remove')){
buttons.push( buttons.push(h(NButton, {
h(NDropdown,{ size: 'small',
trigger:'click', type:'error',
options:[ ghost:true,
{label:"下发记录",key:"dispatchRecord"}, onClick: () => {
{type: 'divider' }, dialog.warning({
], title: '警告',
onSelect:(key:string)=>{ content: `你确定删除NC代码编号为:${row.ncCode}的数据`,
switch(key) { positiveText: '确定',
case "dispatchRecord": negativeText: '取消',
handleDispatchRecord(row) //draggable: true,
break onPositiveClick: () => {
deleteIssue(row.id).then(() => {
message.success('操作成功')
setTimeout(() => {
search()
},1000)
})
},
onNegativeClick: () => {
}
})
} } },
} { default: () => '删除'}
},{ ))
// / }
default: () => h(NButton, { size: 'small', quaternary: true }, {
default: () => [h(NIcon, null, { default: () => h(EllipsisHorizontalOutline) })]
})
})
)
return buttons.length > 0 ? h(NSpace, {justify:'center'}, { default: () => buttons }) : '-' return buttons.length > 0 ? h(NSpace, {justify:'center'}, { default: () => buttons }) : '-'
@ -593,9 +596,14 @@ function addhand(type:any,row?:any) {
addModel.value = true addModel.value = true
formData.value?.restoreValidation() formData.value?.restoreValidation()
isstype.value = type isstype.value = type
if(type == 1 || type == 3){
generateNccode().then(rps => {
formData.ncCode = rps
})
}
if(row){ if(row){
formData.id = row.id formData.id = row.id
formData.ncCode = row.ncCode
formData.ncName = row.ncName formData.ncName = row.ncName
formData.ncContent = row.ncContent formData.ncContent = row.ncContent
formData.workCenter = row.workCenter formData.workCenter = row.workCenter
@ -605,7 +613,12 @@ function addhand(type:any,row?:any) {
// formData.isIssued = row.isIssued // formData.isIssued = row.isIssued
// formData.issueTime = row.issueTime // formData.issueTime = row.issueTime
// formData.issueBy = row.issueBy // formData.issueBy = row.issueBy
formData.remark = row.remark formData.remark = row.remark
if(type == 2){
formData.ncCode = row.ncCode
}else{
formData.ncCode = ''
}
}else{ }else{
formData.id = '' formData.id = ''
formData.ncCode = '' formData.ncCode = ''
@ -639,7 +652,7 @@ function savehand() {
if (!e) { if (!e) {
addEdi().then(() => { addEdi().then(() => {
message.success(cztype[isstype.value]) message.success(`${cztype[isstype.value]}成功`)
setTimeout(() => { setTimeout(() => {
getlist() getlist()
addModel.value = false addModel.value = false
@ -675,38 +688,63 @@ function delhand() {
} }
// //
let isstasklist = ref<any>([]) //let isstasklist = ref<any>([])
// //
let issequiplist = ref<any>([]) //let issequiplist = ref<any>([])
let treeData:any = []
let value = ref<Array<string | number>>([])
let renderSourceList:any = ''
let options = ref<any>([]) //flattenTree(createData())
function flattenTree(list: undefined | any[]) {
const result: any[] = []
function flatten(_list: any[] = []) {
_list.forEach((item) => {
//result.push(item)
if(item.childList){
flatten(item.childList)
}else{
result.push(item)
}
})
}
flatten(list)
return result
}
function tranupdate(v:any) {
console.log(v)
}
// //
let issueModel = ref(false) let issueModel = ref(false)
let issformData = reactive<any>({ // let issformData = reactive<any>({
taskid:'', // taskid:'',
equis:'' // equis:''
}) // })
const issaddrules = { // const issaddrules = {
taskid:[ // taskid:[
{ required: true, message: '请选择下发任务', trigger: 'blur' } // { required: true, message: '', trigger: 'blur' }
], // ],
equis:[ // equis:[
{ required: true, message: '请选择下发设备', trigger: 'blur' } // { required: true, message: '', trigger: 'blur' }
] // ]
} // }
function renderlabe() {} function renderlabe() {}
function issuehand() { function issuehand() {
issueModel.value = true issueModel.value = true
// if(chearr.value.length > 0){
// batchIssue(chearr.value).then(() => {
// message.success('')
// })
// }else{
// message.error('')
// }
} }
@ -715,14 +753,32 @@ const issformRef = ref()
function isssavehand() { function isssavehand() {
issformRef.value?.validate((e:any) => { issformRef.value?.validate((e:any) => {
if (!e) { if (!e) {
message.success('操作成功') batchIssue('').then(() => {
setTimeout(() => { message.success('操作成功')
getlist() setTimeout(() => {
issueModel.value = false getlist()
},1500) issueModel.value = false
},1500)
})
} }
}) })
} }
//
//let selectedIds = ref<any>([])
function handleExport() {
exportNccode({}).then(rps => {
const url = window.URL.createObjectURL(rps)
const link = document.createElement('a')
link.href = url
link.download = 'NC代码数据.xlsx'
link.click()
window.URL.revokeObjectURL(url)
})
}
getlist() getlist()
@ -735,6 +791,33 @@ async function handleDispatchRecord(row:ncCode){
onMounted(() => { onMounted(() => {
//
opertree().then(rps => {
treeData = rps
options.value = flattenTree(treeData)
console.log(rps,'112')
renderSourceList = function (obj:any) {
return h(NTree, {
style: 'margin: 0 4px;',
keyField: 'value',
checkable: true,
selectable: false,
blockLine: true,
checkOnClick: true,
childrenField:'childList',
data: treeData,
cascade:true,
defaultExpandAll:true,
pattern:obj.pattern,
checkedKeys: value.value,
onUpdateCheckedKeys: (checkedKeys: Array<string | number>) => {
obj.onCheck(checkedKeys)
console.log(value.value,'tree')
}
})
}
})
//loadDictOptions() //loadDictOptions()
}) })

View File

@ -40,7 +40,7 @@
</template> </template>
全屏 全屏
</n-button> --> </n-button> -->
<!-- <n-button @click="refresh" ghost style="margin-right: 20px;color: #fff;"> <n-button @click="refresh" ghost style="margin-right: 20px;color: #fff;">
<template #icon> <template #icon>
<n-icon> <n-icon>
<Sync /> <Sync />
@ -48,9 +48,9 @@
</template> </template>
刷新 刷新
</n-button> --> </n-button>
<!--switchworks--> <!--switchworks-->
<n-button ghost style="color: #fff;" @click="handover"> <n-button ghost style="margin-right: 20px;color: #fff;" @click="handover">
<template #icon> <template #icon>
<n-icon> <n-icon>
<SwapHorizontalOutline /> <SwapHorizontalOutline />
@ -58,6 +58,14 @@
</template> </template>
工位交接 工位交接
</n-button> </n-button>
<n-button ghost style="color: #fff;" @click="handover">
<template #icon>
<n-icon>
<LogOutOutline />
</n-icon>
</template>
退出登录
</n-button>
</div> </div>
</div> </div>
<div class="total" style="display: none;"> <div class="total" style="display: none;">
@ -422,10 +430,10 @@
<template v-if="loglist.length > 0"> <template v-if="loglist.length > 0">
<div v-for="n in loglist" style="margin-bottom: 18px;padding: 12px;border:1px solid #afafaf;border-radius:10px;background:#2d475c;"> <div v-for="n in loglist" style="margin-bottom: 18px;padding: 12px;border:1px solid #afafaf;border-radius:10px;background:#2d475c;">
<div style="display: flex;align-items: center;justify-content: space-between;font-size: 16px;"> <div style="display: flex;align-items: center;justify-content: space-between;font-size: 16px;">
<div>张三三</div> <div>{{n.userName}}</div>
<div>{{n.createTime}}</div> <div>{{n.createTime}}</div>
</div> </div>
<div style="font-size: 20px;">{{operationType[n.operationType]}}</div> <div style="font-size: 20px;">{{operationType[n.operationType+'']}}</div>
</div> </div>
</template> </template>
<template v-else> <template v-else>
@ -571,7 +579,7 @@
</n-form> </n-form>
</div> --> </div> -->
<div style="position: absolute;top: 50%;left: 50%;width: 400px;height: 580px;padding: 20px;transform: translate(-50%,-50%);border-radius: 20px;border: 1px #b7b7b7 solid;background: #1e2a40;"> <div style="position: absolute;top: 50%;left: 50%;width: 400px;height: 500px;padding: 20px;transform: translate(-50%,-50%);border-radius: 20px;border: 1px #b7b7b7 solid;background: #1e2a40;">
<div style="width: 100%;padding:10px 20px;text-align: center;"> <div style="width: 100%;padding:10px 20px;text-align: center;">
<n-icon size="40" color="#00a2ff"> <n-icon size="40" color="#00a2ff">
<EarthOutline /> <EarthOutline />
@ -718,7 +726,8 @@ import {
StopCircleOutline, StopCircleOutline,
ShapesOutline, ShapesOutline,
LogoWebComponent, LogoWebComponent,
TimerSharp TimerSharp,
LogOutOutline
} from '@vicons/ionicons5' } from '@vicons/ionicons5'
import Circlebom from './circle.vue' import Circlebom from './circle.vue'
@ -730,10 +739,10 @@ import {
workstation, workstation,
taskdetail, taskdetail,
operationlist, operationlist,
reportingwork reportingwork,
terlogout
} from '@/api/proterminal' } from '@/api/proterminal'
import { element, label } from 'three/tsl'
import { Value } from 'three/examples/jsm/inspector/ui/Values.js'
//import { dictDataApi } from '@/api/org' //import { dictDataApi } from '@/api/org'
@ -800,10 +809,16 @@ const ticketStatus :any = {
// //
const operationType :any = { const operationType :any = {
1:'开始', '-1':'登出',
2:'暂停', '0':'登入',
3:'报工', '1':'开始',
4:'撤回' '2':'暂停',
'3':'报工',
'4':'撤回',
'5':'叫料',
'6':'调车',
'7':'工位交接',
'8':'工位交接确认'
} }

2
src/vite-env.d.ts vendored
View File

@ -10,4 +10,4 @@ interface Window {
$message: import('naive-ui').MessageApi $message: import('naive-ui').MessageApi
$dialog: import('naive-ui').DialogApi $dialog: import('naive-ui').DialogApi
$loadingBar: import('naive-ui').LoadingBarApi $loadingBar: import('naive-ui').LoadingBarApi
} }

View File

@ -20,7 +20,8 @@ export default defineConfig({
port: 3000, port: 3000,
proxy: { proxy: {
'/api': { '/api': {
target:'http://192.168.12.4:8888/', //'http://192.168.5.230:8888', target:'http://192.168.12.4:8888/',
//target:'http://192.168.12.230:8888',
//target:'http://192.168.5.230:8888', //target:'http://192.168.5.230:8888',
//target:'http://192.168.5.232:8888/', //target:'http://192.168.5.232:8888/',
//target:'http://localhost:8888', //target:'http://localhost:8888',