Compare commits
3 Commits
fdd0da6b46
...
db556f469e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db556f469e | ||
|
|
30bc01d15e | ||
|
|
83c876b88c |
@ -5,7 +5,7 @@ VITE_APP_TITLE = 伊特机械MES
|
||||
VITE_APP_ENV = 'development'
|
||||
|
||||
# 开发环境
|
||||
VITE_APP_BASE_API = 'http://192.168.12.230:8888/api'
|
||||
VITE_APP_BASE_API = 'http://192.168.12.4:8888/api'
|
||||
#VITE_APP_BASE_API = 'http://192.168.5.14:9100/gateway'
|
||||
#VITE_APP_BASE_API = '/dev-api'
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
"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",
|
||||
"three": "^0.184.0",
|
||||
|
||||
2211
pnpm-lock.yaml
2211
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -30,11 +30,13 @@ export interface UserInfo {
|
||||
id: number
|
||||
username: string
|
||||
nickname: string
|
||||
postNames:string
|
||||
avatar: string
|
||||
email: string
|
||||
phone: string
|
||||
gender: number
|
||||
status: number
|
||||
//userId:number|string
|
||||
}
|
||||
|
||||
export interface MenuInfo {
|
||||
|
||||
27
src/api/proterminal.ts
Normal file
27
src/api/proterminal.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import { request } from '@/utils/request'
|
||||
|
||||
//登录工位选择
|
||||
export function workstation(userId:any) {
|
||||
return request({
|
||||
url: `/terminal/workstation/${userId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//任务列表
|
||||
export function tasklist(data:any) {
|
||||
return request({
|
||||
url: '/terminal/task',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//任务详情
|
||||
export function taskdetail(data:any) {
|
||||
return request({
|
||||
url: '/terminal/detail/content',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
@ -18,6 +18,10 @@ export const useUserStore = defineStore('user', () => {
|
||||
const nickname = computed(() => user.value?.nickname || user.value?.username || '')
|
||||
const avatar = computed(() => user.value?.avatar || '')
|
||||
|
||||
const postNames = computed(() => user.value?.postNames || '')
|
||||
|
||||
const userid = computed(() => user.value?.id || '')
|
||||
|
||||
function setinit(v:any) {
|
||||
init.value = v
|
||||
}
|
||||
@ -92,6 +96,8 @@ export const useUserStore = defineStore('user', () => {
|
||||
nickname,
|
||||
avatar,
|
||||
init,
|
||||
postNames,
|
||||
userid,
|
||||
setinit,
|
||||
login,
|
||||
getInfo,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div v-if="islogin" class="conten">
|
||||
<div v-if="islogin == '1'" class="conten">
|
||||
<!-- <template v-if="tablet">
|
||||
平板
|
||||
</template> -->
|
||||
@ -7,18 +7,19 @@
|
||||
<div class="head">
|
||||
<div style="box-sizing: border-box;padding: 5px;">
|
||||
<div class="mbx">
|
||||
<div>钣金车间</div>
|
||||
<div>{{mbxone}}</div>
|
||||
<n-icon :component="ArrowRedoOutline" size="20" />
|
||||
<div>激光切割</div>
|
||||
<div>{{ mbtwo }}</div>
|
||||
<n-icon :component="ArrowRedoOutline" size="20" />
|
||||
<div>激光切割01</div>
|
||||
<div>{{mbthree}}</div>
|
||||
</div>
|
||||
<n-icon :component="BuildSharp" size="20" color="#ccc" />
|
||||
|
||||
<div style="display: flex;align-items: center;padding-left: 10px;">
|
||||
<img src="../../assets/images/qiyelogo.png" width="40" height="40" style="border-radius: 50%;" />
|
||||
<div style="padding: 0 10px;">张三三</div>
|
||||
<div style="padding: 2px 5px;border-radius: 5px;font-size: 12px;background: #bd6d07;">工段长</div>
|
||||
<img v-if="userStore.avatar" :src="userStore.avatar" width="40" height="40" style="border-radius: 50%;" />
|
||||
<n-icon v-else :component="PersonCircleSharp" size="35" color="#ccc" />
|
||||
<div style="padding: 0 10px;font-size: 16px;">{{userStore.nickname}}</div>
|
||||
<div style="padding: 2px 5px;border-radius: 5px;font-size: 12px;background: #bd6d07;">{{userStore.postNames}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -48,7 +49,7 @@
|
||||
|
||||
刷新
|
||||
</n-button>
|
||||
<n-button ghost style="color: #fff;" @click="islogin = false">
|
||||
<n-button ghost style="color: #fff;" @click="switchworks">
|
||||
<template #icon>
|
||||
<n-icon>
|
||||
<SwapHorizontalOutline />
|
||||
@ -59,7 +60,7 @@
|
||||
</n-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="total">
|
||||
<div class="total" style="display: none;">
|
||||
<div>
|
||||
<div style="display: flex;align-items: center;font-size: 18px;color:#dfdfdf;">
|
||||
<n-icon size="20">
|
||||
@ -107,7 +108,7 @@
|
||||
<div style="font-size: 34px;line-height: 45px;color:#f3f3f3;">80%</div>
|
||||
</div>
|
||||
</div>
|
||||
<n-grid x-gap="20" style="padding: 20px;">
|
||||
<n-grid x-gap="20" style="padding:50px 20px 20px;">
|
||||
<n-gi :span="5" class="mocz">
|
||||
<div style="display: flex;align-items: center;justify-content: space-between;padding:8px 12px;">
|
||||
<div style="display: flex;align-items: center;font-size: 18px;color:#dfdfdf;">
|
||||
@ -116,22 +117,27 @@
|
||||
</n-icon>
|
||||
<div style="padding-left: 8px;">工单列表</div>
|
||||
</div>
|
||||
<div style="font-size: 14px;color:#b7b7b7;">共 40 项</div>
|
||||
<div style="font-size: 14px;color:#b7b7b7;">共 {{ taskdata.length }} 项</div>
|
||||
</div>
|
||||
<div style="padding: 20px;border: 2px dashed #afafaf;border-left: none;border-right: none;">
|
||||
<n-grid x-gap="10">
|
||||
<n-gi :span="10">
|
||||
<!-- <n-gi :span="10">
|
||||
<n-select
|
||||
v-model:value="queryparam.type"
|
||||
:options="typeopt"
|
||||
remote
|
||||
@update:value=""
|
||||
/>
|
||||
</n-gi>
|
||||
<n-gi :span="14">
|
||||
</n-gi> -->
|
||||
<n-gi :span="24">
|
||||
<n-input-group>
|
||||
<n-input :style="{ width: '100%' }" placeholder="请输入编号或产品" />
|
||||
<n-button style="color:#dfdfdf;">
|
||||
<n-input
|
||||
:style="{ width: '100%' }"
|
||||
placeholder="请输入编号或产品"
|
||||
v-model:value="pgcode"
|
||||
@keyup.enter="queryhand"
|
||||
/>
|
||||
<n-button style="color:#dfdfdf;" @click="queryhand">
|
||||
<template #icon>
|
||||
<n-icon size="22">
|
||||
<Search />
|
||||
@ -143,19 +149,28 @@
|
||||
</n-grid>
|
||||
</div>
|
||||
<div style="height: 450px;padding: 20px;overflow-y: auto;">
|
||||
<div v-for="n in 20" @click="getgd(n)" class="gditem" :class="{gdactv:gdindex == n}">
|
||||
<div v-for="(n,i) in taskdata" @click="getgd(i)" class="gditem" :class="{gdactv:gdindex == i}">
|
||||
<div style="display: flex;align-items: center;justify-content: space-between;font-size: 24px;">
|
||||
<div>GD123456789100{{ n }}</div>
|
||||
<div style="margin-left: 10px;padding: 4px 10px;border-radius: 10px;font-size: 12px;background: #bd6d07;">生产中</div>
|
||||
<div>{{ n.assingCode }}</div>
|
||||
<div style="margin-left: 10px;padding: 4px 10px;border-radius: 10px;font-size: 12px;background: #bd6d07;">{{ticketStatus[n.assingStatus]}}</div>
|
||||
</div>
|
||||
<div style="font-size: 16px;color: #b7b7b7;">内包含页单玻门无底柜</div>
|
||||
<div style="color: #b7b7b7;">C128(500×600×800)AS</div>
|
||||
<div style="color: #b7b7b7;">07-10 08:00 至 08-25 13:00</div>
|
||||
<div style="font-size: 16px;color: #b7b7b7;">{{n.processName}}</div>
|
||||
<div style="display: flex;color: #b7b7b7;">
|
||||
<div style="padding-right: 30px;">派工数量 : {{n.quantity}}</div>
|
||||
<div>完成数量 : {{n.completedQuantity}}</div>
|
||||
</div>
|
||||
<div style="color: #b7b7b7;">{{n.beginTime}} 至 {{ n.endTime }}</div>
|
||||
<div style="display: flex;width: 100%;align-items: center;">
|
||||
<div style="flex: 1;position: relative;margin-right: 10px;height: 6px;background: #afafaf;">
|
||||
<div style="position: absolute;width: 45%;height: 6px;background: #007f5b;"></div>
|
||||
<div :style="{
|
||||
position:'absolute',
|
||||
width:setw(n.completedQuantity,n.quantity),
|
||||
height:'6px',
|
||||
background:'#007f5b'
|
||||
}"></div>
|
||||
</div>
|
||||
<div>45%</div>
|
||||
<!--completedQuantity 已完成数; quantity 派工总数 Math.floor()-->
|
||||
<div>{{toFixed2(n.completedQuantity,n.quantity)}} %</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -440,7 +455,7 @@
|
||||
|
||||
<div style="display: flex;align-items: center;padding-left: 10px;">
|
||||
<n-icon :component="PersonOutline" size="25" color="#ccc" />
|
||||
<div style="padding: 0 10px;">未登录</div>
|
||||
<div style="padding: 0 10px;">{{userStore.nickname}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -474,7 +489,6 @@
|
||||
<div style="font-size: 12px;color: #b7b7b7;">绑定后,终端将自动显示该工位的生产任务</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<n-form
|
||||
ref="loginformRef"
|
||||
:model="logindata"
|
||||
@ -486,32 +500,41 @@
|
||||
marginTop:'20px'
|
||||
}"
|
||||
>
|
||||
|
||||
<n-form-item label="所属车间" label-style="color:#fff;" path="workshop">
|
||||
<n-select
|
||||
v-model:value="logindata.workshop"
|
||||
v-model:value="logindata.workshopId"
|
||||
:render-label="renderlabel"
|
||||
remote
|
||||
placeholder="请选择车间"
|
||||
@update:value="wkupdate"
|
||||
:options="workshoplist"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="所属工段" label-style="color:#fff;" path="section">
|
||||
<!--:disabled="logindata.workshop?false:true"-->
|
||||
|
||||
<n-select
|
||||
:disabled="logindata.workshop?false:true"
|
||||
v-model:value="logindata.section"
|
||||
:disabled="logindata.workshopId?false:true"
|
||||
:render-label="renderlabeltwo"
|
||||
v-model:value="logindata.sectionId"
|
||||
placeholder="请选择工段"
|
||||
:options="workshoplist"
|
||||
@update:value="secupdate"
|
||||
:options="sectionlist"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="所属工位" label-style="color:#fff;" path="workstation">
|
||||
<!--:disabled="logindata.section?false:true"-->
|
||||
<n-select
|
||||
:disabled="logindata.section?false:true"
|
||||
v-model:value="logindata.workstation"
|
||||
:disabled="logindata.sectionId?false:true"
|
||||
:render-label="renderlabelthree"
|
||||
v-model:value="logindata.deviceId"
|
||||
placeholder="请选择工位"
|
||||
:options="workshoplist"
|
||||
:options="workstationlist"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-button
|
||||
:disabled="logindata.workstation?false:true"
|
||||
:disabled="logindata.deviceId?false:true"
|
||||
type="info"
|
||||
style="width: 100%;margin-top: 20px;"
|
||||
size="large"
|
||||
@ -565,9 +588,8 @@ import {
|
||||
type FormInst,
|
||||
} from 'naive-ui'
|
||||
import {
|
||||
PrismOutline,
|
||||
ArrowRedoSharp,
|
||||
ArrowRedoOutline,
|
||||
PersonCircleSharp,
|
||||
BuildSharp,
|
||||
Contract,
|
||||
Sync,
|
||||
@ -595,21 +617,28 @@ import {
|
||||
import Circlebom from './circle.vue'
|
||||
|
||||
import { useUserStore } from '@/stores/user'
|
||||
import { dictDataApi } from '@/api/org'
|
||||
|
||||
import {
|
||||
disworlist,
|
||||
editdiswor,
|
||||
transfer,
|
||||
pauseresume,
|
||||
//workload
|
||||
} from '@/api/production'
|
||||
|
||||
import { submitLogApi } from '@/api/submitLog'
|
||||
|
||||
import { SysUser, userApi } from '@/api/system'
|
||||
tasklist,
|
||||
workstation,
|
||||
taskdetail
|
||||
} from '@/api/proterminal'
|
||||
import { label } from 'three/tsl'
|
||||
import { Value } from 'three/examples/jsm/inspector/ui/Values.js'
|
||||
|
||||
//import { dictDataApi } from '@/api/org'
|
||||
|
||||
|
||||
// import { submitLogApi } from '@/api/submitLog'
|
||||
|
||||
// import { SysUser, userApi } from '@/api/system'
|
||||
// import { label } from 'three/tsl'
|
||||
|
||||
//const dialog = useDialog()
|
||||
const message = useMessage()
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
|
||||
//是否平板
|
||||
let tablet = ref(false)
|
||||
@ -630,9 +659,31 @@ function exitFullscreen() {
|
||||
isfullscr.value = false
|
||||
}
|
||||
|
||||
const message = useMessage()
|
||||
function toFixed2(m:number,d:number) {
|
||||
if(m == 0){
|
||||
return '0.00'
|
||||
}
|
||||
return ((m/d)*100).toFixed(2)
|
||||
}
|
||||
|
||||
const userStore = useUserStore()
|
||||
function setw(m:number,d:number) {
|
||||
if((m/d*100) < 1 && (m/d*100) > 0){
|
||||
return '1%'
|
||||
}
|
||||
return (m/d*100).toFixed(2)+'%'
|
||||
}
|
||||
|
||||
//工单状态
|
||||
const ticketStatus :any = {
|
||||
1:'待执行',
|
||||
2:'执行中',
|
||||
3:'质检中',
|
||||
4:'流转中',
|
||||
5:'已完成',
|
||||
6:'部分质检中',
|
||||
7:'部分流转中',
|
||||
8:'部分完成'
|
||||
}
|
||||
|
||||
|
||||
let queryparam = reactive<any>({
|
||||
@ -720,12 +771,16 @@ function guizds() {
|
||||
}
|
||||
|
||||
//登录
|
||||
let islogin = ref(false)
|
||||
let islogin = ref<any>(sessionStorage.getItem('gwlogin'))
|
||||
|
||||
let logindata = reactive({
|
||||
workshop:'', //所属车间
|
||||
section:'', //所属工段
|
||||
workstation:'' //所属工位
|
||||
let logindata = reactive<any>({
|
||||
workshopId: null, //所属车间id
|
||||
sectionId: null, //所属工段id
|
||||
deviceId: null, //所属工位id
|
||||
|
||||
// workshop:'', //所属车间
|
||||
// section:'', //所属工段
|
||||
// workstation:'' //所属工位
|
||||
})
|
||||
let loginrules = {
|
||||
// workshop: [
|
||||
@ -752,32 +807,158 @@ let loginrules = {
|
||||
}
|
||||
const loginformRef =ref()
|
||||
|
||||
let workshoplist = [
|
||||
{
|
||||
label:'一车间',
|
||||
value:'1'
|
||||
},
|
||||
{
|
||||
label:'二车间',
|
||||
value:'2'
|
||||
},
|
||||
{
|
||||
label:'三车间',
|
||||
value:'3'
|
||||
//所属车间
|
||||
let workshoplist = ref<any>([])
|
||||
|
||||
//所属工段
|
||||
let sectionlist =ref<any>([])
|
||||
|
||||
//所属工位
|
||||
let workstationlist = ref<any>([])
|
||||
|
||||
//所属工段集合
|
||||
let secobj = ref<any>({})
|
||||
|
||||
//所属工位集合
|
||||
let wkstobj = ref<any>({})
|
||||
|
||||
let wkdata = JSON.parse(sessionStorage.getItem('gwdata') as string)
|
||||
|
||||
let pgcode = ref<any>('')
|
||||
|
||||
function getrwlist(data:any) {
|
||||
tasklist(data).then(rps => {
|
||||
taskdata.value = rps
|
||||
})
|
||||
}
|
||||
|
||||
function queryhand() {
|
||||
getrwlist({
|
||||
userId: userStore.userid,
|
||||
...wkdata,
|
||||
code:pgcode.value
|
||||
})
|
||||
}
|
||||
|
||||
function init() {
|
||||
if(islogin.value == '1'){
|
||||
getrwlist({
|
||||
userId: userStore.userid,
|
||||
...wkdata,
|
||||
code:''
|
||||
})
|
||||
|
||||
}else{
|
||||
//工位选项
|
||||
workstation(userStore.userid).then((rps:any) => {
|
||||
if(rps && rps.length > 0){
|
||||
workshoplist.value = rps.map((n:any) => {
|
||||
return {
|
||||
label: n.value,
|
||||
value:n.key
|
||||
}
|
||||
]
|
||||
})
|
||||
rps.forEach((n:any) => {
|
||||
let list = n.childList.map((m:any) => {
|
||||
return {
|
||||
label:m.value,
|
||||
value:m.key,
|
||||
childList:m.childList
|
||||
}
|
||||
})
|
||||
secobj.value[n.key] = list
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function loginhand() {
|
||||
|
||||
loginformRef.value?.validate((e:any) => {
|
||||
if (!e) {
|
||||
message.success('绑定成功')
|
||||
islogin.value = true
|
||||
|
||||
function wkupdate(v:any,n:any) {
|
||||
//let arr = secobj.value[n.value]
|
||||
sectionlist.value = secobj.value[n.value]
|
||||
sectionlist.value.forEach((j:any) => {
|
||||
let list = j.childList.map((m:any) => {
|
||||
return {
|
||||
label:m.value,
|
||||
value:m.key
|
||||
}
|
||||
})
|
||||
wkstobj.value[j.key] = list
|
||||
// return {
|
||||
// label:j.value,
|
||||
// Value:j.key
|
||||
// }
|
||||
})
|
||||
|
||||
console.log(sectionlist.value)
|
||||
|
||||
}
|
||||
|
||||
function secupdate(v:any,n:any) {
|
||||
workstationlist.value = n.childList.map((n:any) => {
|
||||
return {
|
||||
label:n.value,
|
||||
value:n.key
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
let mbxone = ref(sessionStorage.getItem('mbxone'))
|
||||
let mbtwo = ref(sessionStorage.getItem('mbtwo'))
|
||||
let mbthree = ref(sessionStorage.getItem('mbthree'))
|
||||
|
||||
function renderlabel(n:any) {
|
||||
mbxone.value = n.label
|
||||
sessionStorage.setItem('mbxone',n.label)
|
||||
return n.label
|
||||
}
|
||||
|
||||
function renderlabeltwo(n:any) {
|
||||
mbtwo.value = n.label
|
||||
sessionStorage.setItem('mbtwo',n.label)
|
||||
return n.label
|
||||
}
|
||||
|
||||
function renderlabelthree(n:any) {
|
||||
mbthree.value = n.label
|
||||
sessionStorage.setItem('mbthree',n.label)
|
||||
return n.label
|
||||
}
|
||||
|
||||
//任务列表
|
||||
let taskdata = ref<any>([])
|
||||
|
||||
//登录绑定
|
||||
function loginhand() {
|
||||
loginformRef.value?.validate((e:any) => {
|
||||
if (!e) {
|
||||
message.success('绑定成功')
|
||||
//tasklist()
|
||||
sessionStorage.setItem('gwlogin','1')
|
||||
sessionStorage.setItem('gwdata',JSON.stringify(logindata))
|
||||
|
||||
islogin.value = '1'
|
||||
|
||||
getrwlist({
|
||||
userId: userStore.userid,
|
||||
...logindata,
|
||||
code:''
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//切换工位
|
||||
function switchworks() {
|
||||
sessionStorage.setItem('gwlogin','0')
|
||||
islogin.value = '0'
|
||||
}
|
||||
|
||||
init()
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
// getlist()
|
||||
@ -897,6 +1078,7 @@ window.addEventListener('resize', () => {
|
||||
padding: 10px;
|
||||
background: #2d475c;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.gdactv{
|
||||
background: #0c5207;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user