Compare commits

..

No commits in common. "db556f469ef31411a3276bca1b1924dd5e238eb6" and "fdd0da6b46bb236a7ea080e81595ad6b3e37e5bd" have entirely different histories.

8 changed files with 75 additions and 2499 deletions

View File

@ -5,7 +5,7 @@ VITE_APP_TITLE = 伊特机械MES
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'
# 开发环境 # 开发环境
VITE_APP_BASE_API = 'http://192.168.12.4:8888/api' VITE_APP_BASE_API = 'http://192.168.12.230:8888/api'
#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 = '/dev-api' #VITE_APP_BASE_API = '/dev-api'

View File

@ -24,7 +24,7 @@
"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",
"three": "^0.184.0", "three": "^0.184.0",

File diff suppressed because it is too large Load Diff

View File

@ -30,13 +30,11 @@ export interface UserInfo {
id: number id: number
username: string username: string
nickname: string nickname: string
postNames:string
avatar: string avatar: string
email: string email: string
phone: string phone: string
gender: number gender: number
status: number status: number
//userId:number|string
} }
export interface MenuInfo { export interface MenuInfo {

View File

@ -1,27 +0,0 @@
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
})
}

View File

@ -18,10 +18,6 @@ export const useUserStore = defineStore('user', () => {
const nickname = computed(() => user.value?.nickname || user.value?.username || '') const nickname = computed(() => user.value?.nickname || user.value?.username || '')
const avatar = computed(() => user.value?.avatar || '') const avatar = computed(() => user.value?.avatar || '')
const postNames = computed(() => user.value?.postNames || '')
const userid = computed(() => user.value?.id || '')
function setinit(v:any) { function setinit(v:any) {
init.value = v init.value = v
} }
@ -96,8 +92,6 @@ export const useUserStore = defineStore('user', () => {
nickname, nickname,
avatar, avatar,
init, init,
postNames,
userid,
setinit, setinit,
login, login,
getInfo, getInfo,

View File

@ -1,5 +1,5 @@
<template> <template>
<div v-if="islogin == '1'" class="conten"> <div v-if="islogin" class="conten">
<!-- <template v-if="tablet"> <!-- <template v-if="tablet">
平板 平板
</template> --> </template> -->
@ -7,19 +7,18 @@
<div class="head"> <div class="head">
<div style="box-sizing: border-box;padding: 5px;"> <div style="box-sizing: border-box;padding: 5px;">
<div class="mbx"> <div class="mbx">
<div>{{mbxone}}</div> <div>钣金车间</div>
<n-icon :component="ArrowRedoOutline" size="20" /> <n-icon :component="ArrowRedoOutline" size="20" />
<div>{{ mbtwo }}</div> <div>激光切割</div>
<n-icon :component="ArrowRedoOutline" size="20" /> <n-icon :component="ArrowRedoOutline" size="20" />
<div>{{mbthree}}</div> <div>激光切割01</div>
</div> </div>
<n-icon :component="BuildSharp" size="20" color="#ccc" /> <n-icon :component="BuildSharp" size="20" color="#ccc" />
<div style="display: flex;align-items: center;padding-left: 10px;"> <div style="display: flex;align-items: center;padding-left: 10px;">
<img v-if="userStore.avatar" :src="userStore.avatar" width="40" height="40" style="border-radius: 50%;" /> <img src="../../assets/images/qiyelogo.png" width="40" height="40" style="border-radius: 50%;" />
<n-icon v-else :component="PersonCircleSharp" size="35" color="#ccc" /> <div style="padding: 0 10px;">张三三</div>
<div style="padding: 0 10px;font-size: 16px;">{{userStore.nickname}}</div> <div style="padding: 2px 5px;border-radius: 5px;font-size: 12px;background: #bd6d07;">工段长</div>
<div style="padding: 2px 5px;border-radius: 5px;font-size: 12px;background: #bd6d07;">{{userStore.postNames}}</div>
</div> </div>
</div> </div>
@ -49,7 +48,7 @@
刷新 刷新
</n-button> </n-button>
<n-button ghost style="color: #fff;" @click="switchworks"> <n-button ghost style="color: #fff;" @click="islogin = false">
<template #icon> <template #icon>
<n-icon> <n-icon>
<SwapHorizontalOutline /> <SwapHorizontalOutline />
@ -60,7 +59,7 @@
</n-button> </n-button>
</div> </div>
</div> </div>
<div class="total" style="display: none;"> <div class="total">
<div> <div>
<div style="display: flex;align-items: center;font-size: 18px;color:#dfdfdf;"> <div style="display: flex;align-items: center;font-size: 18px;color:#dfdfdf;">
<n-icon size="20"> <n-icon size="20">
@ -108,7 +107,7 @@
<div style="font-size: 34px;line-height: 45px;color:#f3f3f3;">80%</div> <div style="font-size: 34px;line-height: 45px;color:#f3f3f3;">80%</div>
</div> </div>
</div> </div>
<n-grid x-gap="20" style="padding:50px 20px 20px;"> <n-grid x-gap="20" style="padding: 20px;">
<n-gi :span="5" class="mocz"> <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;justify-content: space-between;padding:8px 12px;">
<div style="display: flex;align-items: center;font-size: 18px;color:#dfdfdf;"> <div style="display: flex;align-items: center;font-size: 18px;color:#dfdfdf;">
@ -117,27 +116,22 @@
</n-icon> </n-icon>
<div style="padding-left: 8px;">工单列表</div> <div style="padding-left: 8px;">工单列表</div>
</div> </div>
<div style="font-size: 14px;color:#b7b7b7;"> {{ taskdata.length }} </div> <div style="font-size: 14px;color:#b7b7b7;"> 40 </div>
</div> </div>
<div style="padding: 20px;border: 2px dashed #afafaf;border-left: none;border-right: none;"> <div style="padding: 20px;border: 2px dashed #afafaf;border-left: none;border-right: none;">
<n-grid x-gap="10"> <n-grid x-gap="10">
<!-- <n-gi :span="10"> <n-gi :span="10">
<n-select <n-select
v-model:value="queryparam.type" v-model:value="queryparam.type"
:options="typeopt" :options="typeopt"
remote remote
@update:value="" @update:value=""
/> />
</n-gi> --> </n-gi>
<n-gi :span="24"> <n-gi :span="14">
<n-input-group> <n-input-group>
<n-input <n-input :style="{ width: '100%' }" placeholder="请输入编号或产品" />
:style="{ width: '100%' }" <n-button style="color:#dfdfdf;">
placeholder="请输入编号或产品"
v-model:value="pgcode"
@keyup.enter="queryhand"
/>
<n-button style="color:#dfdfdf;" @click="queryhand">
<template #icon> <template #icon>
<n-icon size="22"> <n-icon size="22">
<Search /> <Search />
@ -149,28 +143,19 @@
</n-grid> </n-grid>
</div> </div>
<div style="height: 450px;padding: 20px;overflow-y: auto;"> <div style="height: 450px;padding: 20px;overflow-y: auto;">
<div v-for="(n,i) in taskdata" @click="getgd(i)" class="gditem" :class="{gdactv:gdindex == i}"> <div v-for="n in 20" @click="getgd(n)" class="gditem" :class="{gdactv:gdindex == n}">
<div style="display: flex;align-items: center;justify-content: space-between;font-size: 24px;"> <div style="display: flex;align-items: center;justify-content: space-between;font-size: 24px;">
<div>{{ n.assingCode }}</div> <div>GD123456789100{{ n }}</div>
<div style="margin-left: 10px;padding: 4px 10px;border-radius: 10px;font-size: 12px;background: #bd6d07;">{{ticketStatus[n.assingStatus]}}</div> <div style="margin-left: 10px;padding: 4px 10px;border-radius: 10px;font-size: 12px;background: #bd6d07;">生产中</div>
</div> </div>
<div style="font-size: 16px;color: #b7b7b7;">{{n.processName}}</div> <div style="font-size: 16px;color: #b7b7b7;">内包含页单玻门无底柜</div>
<div style="display: flex;color: #b7b7b7;"> <div style="color: #b7b7b7;">C128(500×600×800)AS</div>
<div style="padding-right: 30px;">派工数量 : {{n.quantity}}</div> <div style="color: #b7b7b7;">07-10 08:00 08-25 13:00</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="display: flex;width: 100%;align-items: center;">
<div style="flex: 1;position: relative;margin-right: 10px;height: 6px;background: #afafaf;"> <div style="flex: 1;position: relative;margin-right: 10px;height: 6px;background: #afafaf;">
<div :style="{ <div style="position: absolute;width: 45%;height: 6px;background: #007f5b;"></div>
position:'absolute',
width:setw(n.completedQuantity,n.quantity),
height:'6px',
background:'#007f5b'
}"></div>
</div> </div>
<!--completedQuantity 已完成数; quantity 派工总数 Math.floor()--> <div>45%</div>
<div>{{toFixed2(n.completedQuantity,n.quantity)}} %</div>
</div> </div>
</div> </div>
</div> </div>
@ -455,7 +440,7 @@
<div style="display: flex;align-items: center;padding-left: 10px;"> <div style="display: flex;align-items: center;padding-left: 10px;">
<n-icon :component="PersonOutline" size="25" color="#ccc" /> <n-icon :component="PersonOutline" size="25" color="#ccc" />
<div style="padding: 0 10px;">{{userStore.nickname}}</div> <div style="padding: 0 10px;">未登录</div>
</div> </div>
</div> </div>
@ -489,6 +474,7 @@
<div style="font-size: 12px;color: #b7b7b7;">绑定后终端将自动显示该工位的生产任务</div> <div style="font-size: 12px;color: #b7b7b7;">绑定后终端将自动显示该工位的生产任务</div>
</div> </div>
</div> </div>
<n-form <n-form
ref="loginformRef" ref="loginformRef"
:model="logindata" :model="logindata"
@ -500,41 +486,32 @@
marginTop:'20px' marginTop:'20px'
}" }"
> >
<n-form-item label="所属车间" label-style="color:#fff;" path="workshop"> <n-form-item label="所属车间" label-style="color:#fff;" path="workshop">
<n-select <n-select
v-model:value="logindata.workshopId" v-model:value="logindata.workshop"
:render-label="renderlabel"
remote remote
placeholder="请选择车间" placeholder="请选择车间"
@update:value="wkupdate"
:options="workshoplist" :options="workshoplist"
/> />
</n-form-item> </n-form-item>
<n-form-item label="所属工段" label-style="color:#fff;" path="section"> <n-form-item label="所属工段" label-style="color:#fff;" path="section">
<!--:disabled="logindata.workshop?false:true"-->
<n-select <n-select
:disabled="logindata.workshopId?false:true" :disabled="logindata.workshop?false:true"
:render-label="renderlabeltwo" v-model:value="logindata.section"
v-model:value="logindata.sectionId"
placeholder="请选择工段" placeholder="请选择工段"
@update:value="secupdate" :options="workshoplist"
:options="sectionlist"
/> />
</n-form-item> </n-form-item>
<n-form-item label="所属工位" label-style="color:#fff;" path="workstation"> <n-form-item label="所属工位" label-style="color:#fff;" path="workstation">
<!--:disabled="logindata.section?false:true"-->
<n-select <n-select
:disabled="logindata.sectionId?false:true" :disabled="logindata.section?false:true"
:render-label="renderlabelthree" v-model:value="logindata.workstation"
v-model:value="logindata.deviceId"
placeholder="请选择工位" placeholder="请选择工位"
:options="workstationlist" :options="workshoplist"
/> />
</n-form-item> </n-form-item>
<n-button <n-button
:disabled="logindata.deviceId?false:true" :disabled="logindata.workstation?false:true"
type="info" type="info"
style="width: 100%;margin-top: 20px;" style="width: 100%;margin-top: 20px;"
size="large" size="large"
@ -588,8 +565,9 @@ import {
type FormInst, type FormInst,
} from 'naive-ui' } from 'naive-ui'
import { import {
PrismOutline,
ArrowRedoSharp,
ArrowRedoOutline, ArrowRedoOutline,
PersonCircleSharp,
BuildSharp, BuildSharp,
Contract, Contract,
Sync, Sync,
@ -617,28 +595,21 @@ import {
import Circlebom from './circle.vue' import Circlebom from './circle.vue'
import { useUserStore } from '@/stores/user' import { useUserStore } from '@/stores/user'
import { dictDataApi } from '@/api/org'
import { import {
tasklist, disworlist,
workstation, editdiswor,
taskdetail transfer,
} from '@/api/proterminal' pauseresume,
//workload
} from '@/api/production'
import { submitLogApi } from '@/api/submitLog'
import { SysUser, userApi } from '@/api/system'
import { label } from 'three/tsl' 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 dialog = useDialog()
const message = useMessage()
const userStore = useUserStore()
// //
let tablet = ref(false) let tablet = ref(false)
@ -659,31 +630,9 @@ function exitFullscreen() {
isfullscr.value = false isfullscr.value = false
} }
function toFixed2(m:number,d:number) { const message = useMessage()
if(m == 0){
return '0.00'
}
return ((m/d)*100).toFixed(2)
}
function setw(m:number,d:number) { const userStore = useUserStore()
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>({ let queryparam = reactive<any>({
@ -771,16 +720,12 @@ function guizds() {
} }
// //
let islogin = ref<any>(sessionStorage.getItem('gwlogin')) let islogin = ref(false)
let logindata = reactive<any>({ let logindata = reactive({
workshopId: null, //id workshop:'', //
sectionId: null, //id section:'', //
deviceId: null, //id workstation:'' //
// workshop:'', //
// section:'', //
// workstation:'' //
}) })
let loginrules = { let loginrules = {
// workshop: [ // workshop: [
@ -807,157 +752,31 @@ let loginrules = {
} }
const loginformRef =ref() const loginformRef =ref()
// let workshoplist = [
let workshoplist = ref<any>([]) {
label:'一车间',
// value:'1'
let sectionlist =ref<any>([]) },
{
// label:'二车间',
let workstationlist = ref<any>([]) value:'2'
},
// {
let secobj = ref<any>({}) label:'三车间',
value:'3'
//
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 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() { function loginhand() {
loginformRef.value?.validate((e:any) => { loginformRef.value?.validate((e:any) => {
if (!e) { if (!e) {
message.success('绑定成功') message.success('绑定成功')
//tasklist() islogin.value = true
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(() => { onMounted(() => {
@ -1078,7 +897,6 @@ window.addEventListener('resize', () => {
padding: 10px; padding: 10px;
background: #2d475c; background: #2d475c;
border-radius: 10px; border-radius: 10px;
cursor: pointer;
} }
.gdactv{ .gdactv{
background: #0c5207; background: #0c5207;