Compare commits
No commits in common. "db556f469ef31411a3276bca1b1924dd5e238eb6" and "fdd0da6b46bb236a7ea080e81595ad6b3e37e5bd" have entirely different histories.
db556f469e
...
fdd0da6b46
@ -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'
|
||||||
|
|
||||||
|
|||||||
@ -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",
|
||||||
|
|||||||
2211
pnpm-lock.yaml
2211
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -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 {
|
||||||
|
|||||||
@ -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
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@ -17,11 +17,7 @@ export const useUserStore = defineStore('user', () => {
|
|||||||
const isLogin = computed(() => !!token.value)
|
const isLogin = computed(() => !!token.value)
|
||||||
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,
|
||||||
|
|||||||
@ -114,7 +114,7 @@ async function decryptResponseData(data: string): Promise<any> {
|
|||||||
//axios.defaults.headers["Content-Type"] = 'application/json;charset=utf-8' //"application/x-www-form-urlencoded;charset=utf-8"; //"application/json;charset=utf-8";
|
//axios.defaults.headers["Content-Type"] = 'application/json;charset=utf-8' //"application/x-www-form-urlencoded;charset=utf-8"; //"application/json;charset=utf-8";
|
||||||
|
|
||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
// 后端 API 统一使用 /api 前缀
|
// 后端 API 统一使用 /api 前缀
|
||||||
const service: AxiosInstance = axios.create({
|
const service: AxiosInstance = axios.create({
|
||||||
baseURL:'/api',
|
baseURL:'/api',
|
||||||
//baseURL: BASE_API,
|
//baseURL: BASE_API,
|
||||||
|
|||||||
@ -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'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label:'二车间',
|
||||||
|
value:'2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label:'三车间',
|
||||||
|
value:'3'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
//所属工段
|
|
||||||
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 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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user