Compare commits
4 Commits
e1e4f251e8
...
77aae7a280
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77aae7a280 | ||
|
|
99ea384470 | ||
|
|
fa6c4eeb53 | ||
|
|
67d39e23b3 |
@ -5,12 +5,8 @@ VITE_APP_TITLE = 伊特机械MES
|
||||
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'
|
||||
>>>>>>> f1e25f58a96a8b7737687ce50afef4b34cda2541
|
||||
#VITE_APP_BASE_API = 'http://192.168.5.14:9100/gateway'
|
||||
|
||||
VITE_APP_BASE_API = 'http://localhost/api'
|
||||
|
||||
@ -24,9 +24,10 @@
|
||||
"html2canvas": "^1.4.1",
|
||||
"jsencrypt": "^3.3.2",
|
||||
"jspdf": "^4.2.1",
|
||||
"naive-ui":"^2.37.3",
|
||||
"naive-ui": "^2.37.3",
|
||||
"pinia": "^2.1.7",
|
||||
"pinia-plugin-persistedstate": "^3.2.1",
|
||||
"seemly": "^0.3.10",
|
||||
"three": "^0.184.0",
|
||||
"vue": "^3.4.15",
|
||||
"vue-draggable-plus": "^0.6.1",
|
||||
|
||||
@ -50,6 +50,9 @@ importers:
|
||||
pinia-plugin-persistedstate:
|
||||
specifier: ^3.2.1
|
||||
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:
|
||||
specifier: ^0.184.0
|
||||
version: 0.184.0
|
||||
|
||||
@ -44,7 +44,7 @@ export function nccodelist(params:any) {
|
||||
//下发
|
||||
export function batchIssue(data:any) {
|
||||
return request({
|
||||
url: '/api/biz/ncCode/issue',
|
||||
url: '/biz/ncCode/issue',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
@ -53,7 +53,7 @@ export function batchIssue(data:any) {
|
||||
//删除
|
||||
export function deleteIssue(ids:any) {
|
||||
return request({
|
||||
url: `api/biz/ncCode/${ids}`,
|
||||
url: `/biz/ncCode/${ids}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -66,3 +66,28 @@ export function issuecopy(data:any) {
|
||||
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
|
||||
})
|
||||
}
|
||||
|
||||
@ -43,3 +43,13 @@ export function reportingwork(data:any) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//登出设备
|
||||
export function terlogout(data:any) {
|
||||
return request({
|
||||
url: '/terminal/logout',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
@ -35,7 +35,7 @@
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<n-icon>
|
||||
<AddOutline />
|
||||
@ -51,7 +51,7 @@
|
||||
</template>
|
||||
删除
|
||||
</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>
|
||||
<n-icon>
|
||||
<ArrowDownCircleOutline />
|
||||
@ -111,7 +111,7 @@
|
||||
<n-grid :cols="1" :x-gap="24">
|
||||
<n-gi>
|
||||
<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-gi>
|
||||
<n-gi>
|
||||
@ -214,51 +214,22 @@
|
||||
v-model:show="issueModel"
|
||||
title="下发"
|
||||
preset="card"
|
||||
style="width: 500px"
|
||||
style="width: 600px"
|
||||
:mask-closable="false"
|
||||
>
|
||||
|
||||
<n-form
|
||||
ref="issformRef"
|
||||
:model="issformData"
|
||||
:rules="issaddrules"
|
||||
label-placement="top"
|
||||
label-width="100"
|
||||
>
|
||||
<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-transfer
|
||||
v-model:value="value"
|
||||
style="height:500px;"
|
||||
:options="options"
|
||||
:render-source-list="renderSourceList"
|
||||
source-filterable
|
||||
@update:value="tranupdate"
|
||||
/>
|
||||
</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>
|
||||
<n-space justify="end">
|
||||
<n-button @click="issueModel = false">取消</n-button>
|
||||
<n-button
|
||||
type="primary"
|
||||
|
||||
@click="isssavehand"
|
||||
>确认</n-button>
|
||||
</n-space>
|
||||
@ -280,6 +251,7 @@ import {
|
||||
|
||||
|
||||
import {
|
||||
NTree,
|
||||
NButton,
|
||||
NIcon,
|
||||
NSpace,
|
||||
@ -306,12 +278,11 @@ import {
|
||||
batchIssue,
|
||||
editccode,
|
||||
issuecopy,
|
||||
ncCode
|
||||
generateNccode,
|
||||
opertree,
|
||||
exportNccode
|
||||
} from '@/api/nccode'
|
||||
|
||||
|
||||
|
||||
|
||||
const dialog = useDialog()
|
||||
|
||||
const message = useMessage()
|
||||
@ -321,7 +292,7 @@ const userStore = useUserStore()
|
||||
// 权限检查
|
||||
const hasPermission = (permission: string) => userStore.hasPermission(permission)
|
||||
|
||||
const ncDispatchRecords = ref<ncCode[]>([])
|
||||
//const ncDispatchRecords = ref<ncCode[]>([])
|
||||
|
||||
//派工状态字典
|
||||
//const qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
|
||||
@ -408,6 +379,31 @@ const columns = [
|
||||
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",
|
||||
title:"备注",
|
||||
@ -458,29 +454,36 @@ 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('操作成功')
|
||||
setTimeout(() => {
|
||||
search()
|
||||
},1000)
|
||||
})
|
||||
|
||||
buttons.push(
|
||||
h(NDropdown,{
|
||||
trigger:'click',
|
||||
options:[
|
||||
{label:"下发记录",key:"dispatchRecord"},
|
||||
{type: 'divider' },
|
||||
],
|
||||
onSelect:(key:string)=>{
|
||||
switch(key) {
|
||||
case "dispatchRecord":
|
||||
handleDispatchRecord(row)
|
||||
break
|
||||
},
|
||||
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 }) : '-'
|
||||
@ -593,9 +596,14 @@ function addhand(type:any,row?:any) {
|
||||
addModel.value = true
|
||||
formData.value?.restoreValidation()
|
||||
isstype.value = type
|
||||
if(type == 1 || type == 3){
|
||||
generateNccode().then(rps => {
|
||||
formData.ncCode = rps
|
||||
})
|
||||
}
|
||||
|
||||
if(row){
|
||||
formData.id = row.id
|
||||
formData.ncCode = row.ncCode
|
||||
formData.ncName = row.ncName
|
||||
formData.ncContent = row.ncContent
|
||||
formData.workCenter = row.workCenter
|
||||
@ -606,6 +614,11 @@ function addhand(type:any,row?:any) {
|
||||
// formData.issueTime = row.issueTime
|
||||
// formData.issueBy = row.issueBy
|
||||
formData.remark = row.remark
|
||||
if(type == 2){
|
||||
formData.ncCode = row.ncCode
|
||||
}else{
|
||||
formData.ncCode = ''
|
||||
}
|
||||
}else{
|
||||
formData.id = ''
|
||||
formData.ncCode = ''
|
||||
@ -639,7 +652,7 @@ function savehand() {
|
||||
if (!e) {
|
||||
|
||||
addEdi().then(() => {
|
||||
message.success(cztype[isstype.value])
|
||||
message.success(`${cztype[isstype.value]}成功`)
|
||||
setTimeout(() => {
|
||||
getlist()
|
||||
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 issueModel = ref(false)
|
||||
let issformData = reactive<any>({
|
||||
taskid:'',
|
||||
equis:''
|
||||
})
|
||||
const issaddrules = {
|
||||
taskid:[
|
||||
{ required: true, message: '请选择下发任务', trigger: 'blur' }
|
||||
],
|
||||
equis:[
|
||||
{ required: true, message: '请选择下发设备', trigger: 'blur' }
|
||||
]
|
||||
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 issformData = reactive<any>({
|
||||
// taskid:'',
|
||||
// equis:''
|
||||
// })
|
||||
// const issaddrules = {
|
||||
// taskid:[
|
||||
// { required: true, message: '请选择下发任务', trigger: 'blur' }
|
||||
// ],
|
||||
// equis:[
|
||||
// { required: true, message: '请选择下发设备', trigger: 'blur' }
|
||||
// ]
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
function renderlabe() {}
|
||||
|
||||
function issuehand() {
|
||||
|
||||
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() {
|
||||
issformRef.value?.validate((e:any) => {
|
||||
if (!e) {
|
||||
batchIssue('').then(() => {
|
||||
message.success('操作成功')
|
||||
setTimeout(() => {
|
||||
getlist()
|
||||
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()
|
||||
|
||||
@ -735,6 +791,33 @@ async function handleDispatchRecord(row:ncCode){
|
||||
|
||||
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()
|
||||
|
||||
})
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
</template>
|
||||
全屏
|
||||
</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>
|
||||
<n-icon>
|
||||
<Sync />
|
||||
@ -48,9 +48,9 @@
|
||||
</template>
|
||||
|
||||
刷新
|
||||
</n-button> -->
|
||||
</n-button>
|
||||
<!--switchworks-->
|
||||
<n-button ghost style="color: #fff;" @click="handover">
|
||||
<n-button ghost style="margin-right: 20px;color: #fff;" @click="handover">
|
||||
<template #icon>
|
||||
<n-icon>
|
||||
<SwapHorizontalOutline />
|
||||
@ -58,6 +58,14 @@
|
||||
</template>
|
||||
工位交接
|
||||
</n-button>
|
||||
<n-button ghost style="color: #fff;" @click="handover">
|
||||
<template #icon>
|
||||
<n-icon>
|
||||
<LogOutOutline />
|
||||
</n-icon>
|
||||
</template>
|
||||
退出登录
|
||||
</n-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="total" style="display: none;">
|
||||
@ -422,10 +430,10 @@
|
||||
<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 style="display: flex;align-items: center;justify-content: space-between;font-size: 16px;">
|
||||
<div>张三三</div>
|
||||
<div>{{n.userName}}</div>
|
||||
<div>{{n.createTime}}</div>
|
||||
</div>
|
||||
<div style="font-size: 20px;">{{operationType[n.operationType]}}</div>
|
||||
<div style="font-size: 20px;">{{operationType[n.operationType+'']}}</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
@ -571,7 +579,7 @@
|
||||
</n-form>
|
||||
</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;">
|
||||
<n-icon size="40" color="#00a2ff">
|
||||
<EarthOutline />
|
||||
@ -718,7 +726,8 @@ import {
|
||||
StopCircleOutline,
|
||||
ShapesOutline,
|
||||
LogoWebComponent,
|
||||
TimerSharp
|
||||
TimerSharp,
|
||||
LogOutOutline
|
||||
} from '@vicons/ionicons5'
|
||||
|
||||
import Circlebom from './circle.vue'
|
||||
@ -730,10 +739,10 @@ import {
|
||||
workstation,
|
||||
taskdetail,
|
||||
operationlist,
|
||||
reportingwork
|
||||
reportingwork,
|
||||
terlogout
|
||||
} from '@/api/proterminal'
|
||||
import { element, label } from 'three/tsl'
|
||||
import { Value } from 'three/examples/jsm/inspector/ui/Values.js'
|
||||
|
||||
|
||||
//import { dictDataApi } from '@/api/org'
|
||||
|
||||
@ -800,10 +809,16 @@ const ticketStatus :any = {
|
||||
|
||||
//日志类型
|
||||
const operationType :any = {
|
||||
1:'开始',
|
||||
2:'暂停',
|
||||
3:'报工',
|
||||
4:'撤回'
|
||||
'-1':'登出',
|
||||
'0':'登入',
|
||||
'1':'开始',
|
||||
'2':'暂停',
|
||||
'3':'报工',
|
||||
'4':'撤回',
|
||||
'5':'叫料',
|
||||
'6':'调车',
|
||||
'7':'工位交接',
|
||||
'8':'工位交接确认'
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -20,7 +20,8 @@ export default defineConfig({
|
||||
port: 3000,
|
||||
proxy: {
|
||||
'/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.232:8888/',
|
||||
//target:'http://localhost:8888',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user