This commit is contained in:
andy 2026-07-24 14:30:56 +08:00
parent db556f469e
commit c0e683dbca
10 changed files with 1801 additions and 2880 deletions

View File

@ -5,7 +5,7 @@ VITE_APP_TITLE = 伊特机械MES
VITE_APP_ENV = 'development'
# 开发环境
VITE_APP_BASE_API = 'http://192.168.12.4:8888/api'
VITE_APP_BASE_API = 'http://192.168.5.232:8888/api'
#VITE_APP_BASE_API = 'http://192.168.5.14:9100/gateway'
#VITE_APP_BASE_API = '/dev-api'

View File

@ -24,7 +24,8 @@ function createWindow() {
mainWin.loadFile(path.join(__dirname, "../dist/index.html"))
} else {
// 本地 npm run electron:dev 预览
mainWin.loadFile(path.join(__dirname, "../dist/index.html"))
//mainWin.loadFile(path.join(__dirname, "../dist/index.html"))
mainWin.loadURL('http://localhost:3000/')
// 开发时自动打开调试面板
mainWin.webContents.openDevTools()
}

2794
package-lock.json generated

File diff suppressed because it is too large Load Diff

98
src/api/nccode.ts Normal file
View File

@ -0,0 +1,98 @@
import { request } from '@/utils/request'
//新增代码库
export function addnccode(data:any) {
return request({
url: '/biz/ncCode',
method: 'post',
data
})
}
//编辑代码库
export function editccode(data:any) {
return request({
url: '/biz/ncCode',
method: 'put',
data
})
}
//列表
export function nccodelist(params:any) {
return request({
url: `/biz/ncCode/page`,
method: 'get',
params
})
}
//下发
export function batchIssue(data:any) {
return request({
url: '/api/biz/ncCode/issue',
method: 'post',
data
})
}
//删除
export function deleteIssue(ids:any) {
return request({
url: `api/biz/ncCode/${ids}`,
method: 'delete'
})
}
//复制
export function issuecopy(data:any) {
return request({
url: `/biz/ncCode/copy`,
method: 'post',
data
})
}
// //登录工位选择
// 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
// })
// }
// //操作日志列表
// export function operationlist(data:any) {
// return request({
// url: '/terminal/operation/list',
// method: 'post',
// data
// })
// }
// //报工
// export function reportingwork(data:any) {
// return request({
// url: '/terminal/submit',
// method: 'post',
// data
// })
// }

View File

@ -24,4 +24,22 @@ export function taskdetail(data:any) {
method: 'post',
data
})
}
}
//操作日志列表
export function operationlist(data:any) {
return request({
url: '/terminal/operation/list',
method: 'post',
data
})
}
//报工
export function reportingwork(data:any) {
return request({
url: '/terminal/submit',
method: 'post',
data
})
}

768
src/views/NCcode/index.vue Normal file
View File

@ -0,0 +1,768 @@
<template>
<div class="page-container">
<!-- 用户列表 -->
<n-card class="user-list-card" size="small">
<!-- 搜索表单 -->
<div class="search-form">
<n-form
inline
:model="searchForm"
label-placement="left"
>
<n-form-item label="NC代码编号">
<n-input v-model:value="searchForm.ncCode" placeholder="请输入NC代码编号" />
</n-form-item>
<n-form-item label="NC代码名称">
<n-input v-model:value="searchForm.ncName" placeholder="请输入NC代码名称" />
</n-form-item>
<n-space>
<n-button type="primary" @click="search">
<template #icon><n-icon><SearchOutline /></n-icon></template>
搜索
</n-button>
<n-button @click="reset">
<template #icon><n-icon><RefreshOutline /></n-icon></template>
重置
</n-button>
</n-space>
</n-form>
</div>
<n-space style="margin-bottom: 15px;">
<n-button type="primary" @click="addhand(1)" size="small">
<template #icon>
<n-icon>
<AddOutline />
</n-icon>
</template>
新增
</n-button>
<!-- <n-button type="error" @click="delhand" size="small">
<template #icon>
<n-icon>
<ArrowDownCircleOutline />
</n-icon>
</template>
删除
</n-button> -->
<n-button type="success" @click="issuehand" size="small">
<template #icon>
<n-icon>
<ArrowDownCircleOutline />
</n-icon>
</template>
导出
</n-button>
</n-space>
<!-- 表格 -->
<n-data-table
:columns="columns"
size="small"
striped
:data="datalist"
:bordere="false"
:single-line="false"
:loading="loading"
remote
:row-key="rowKey"
@update:checked-row-keys="handleCheck"
/>
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px">
<n-pagination
v-model:page="pagination.page"
v-model:page-size="pagination.pageSize"
:item-count="pagination.itemCount"
:page-sizes="[10, 20, 50, 100]"
show-size-picker
show-quick-jumper
@update:page="handlePageChange"
@update:page-size="handlePageSizeChange"
>
<template #prefix>
{{ pagination.itemCount }}
</template>
</n-pagination>
</div>
</n-card>
<n-modal
v-model:show="addModel"
:title="cztype[isstype]"
preset="card"
style="width: 600px"
:mask-closable="false"
>
<n-form
ref="addformRef"
:model="formData"
:rules="addrules"
label-placement="left"
label-width="100"
>
<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-form-item>
</n-gi>
<n-gi>
<n-form-item path="ncName" label="NC代码名称">
<n-input v-model:value="formData.ncName" placeholder="请输入NC代码名称" />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="状态">
<n-radio-group v-model:value="formData.status" :default-value="1" name="radiogroup">
<n-space>
<n-radio :value="1">
启用
</n-radio>
<n-radio :value="0">
禁用
</n-radio>
</n-space>
</n-radio-group>
</n-form-item>
</n-gi>
<n-gi>
<!--type="textarea"-->
<n-form-item path="ncContent" label="NC代码内容">
<n-input type="textarea" v-model:value="formData.ncContent" placeholder="请输入NC代码内容" />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="备注">
<n-input type="textarea" v-model:value="formData.remark" placeholder="请输入备注" />
</n-form-item>
</n-gi>
<!-- <n-gi>
<n-form-item label="工作中心">
<n-input v-model:value="formData.workCenter" placeholder="请输入工作中心" />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="设备ID">
<n-input v-model:value="formData.deviceId" placeholder="请输入设备ID" />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="设备名称">
<n-input v-model:value="formData.deviceName" placeholder="请输入设备名称" />
</n-form-item>
</n-gi> -->
<!-- <n-gi>
<n-form-item label="下发状态">
<n-radio-group v-model:value="formData.isIssued" name="radiogroup">
<n-space>
<n-radio :value="1">
已下发
</n-radio>
<n-radio :value="0">
未下发
</n-radio>
</n-space>
</n-radio-group>
</n-form-item>
</n-gi> -->
<!-- <template v-if="formData.isIssued == 1">
<n-gi>
<n-form-item label="下发时间">
<n-date-picker
v-model:formatted-value="formData.issueTime"
type="datetime"
style="width: 100%;"
clearable
value-format="yyyy-MM-dd HH:mm:ss"
/>
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="下发人">
<n-input v-model:value="formData.issueBy" placeholder="请选择下发人" />
</n-form-item>
</n-gi>
</template> -->
</n-grid>
</n-form>
<template #footer>
<n-space justify="end">
<n-button @click="addModel = false">取消</n-button>
<n-button
type="primary"
@click="savehand"
>确认</n-button>
</n-space>
</template>
</n-modal>
<!--下发-->
<n-modal
v-model:show="issueModel"
title="下发"
preset="card"
style="width: 500px"
: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-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>
</template>
</n-modal>
</div>
</template>
<script setup lang="ts">
import {
ref,
reactive,
h,
onMounted,
watch,
} from 'vue'
import {
NButton,
NIcon,
NSpace,
NPagination,
NGrid,
// NGi,
NTag,
useMessage,
useDialog,
//type FormInst,
} from 'naive-ui'
import {
SearchOutline,
RefreshOutline,
AddOutline,
ArrowDownCircleOutline
} from '@vicons/ionicons5'
import { useUserStore } from '@/stores/user'
//import { dictDataApi } from '@/api/org'
import {
addnccode,
nccodelist,
batchIssue,
deleteIssue,
editccode,
issuecopy
} from '@/api/nccode'
const dialog = useDialog()
const message = useMessage()
const userStore = useUserStore()
//
const hasPermission = (permission: string) => userStore.hasPermission(permission)
//
//const qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
// ==================== ====================
const searchForm = reactive({
page: 1,
pageSize: 20,
ncCode:'',
ncName:'',
status:1
})
// ==================== ====================
const datalist = ref<any>([])
const loading = ref(false)
//
const pagination = reactive({
page: 1,
pageSize: 20,
itemCount: 0
})
const columns = [
{
type: 'selection',
minWidth:60
},
{
align:"center",
title:"NC代码编号",
key:"ncCode",
minWidth:150
},
{
align:"center",
title:"NC代码名称",
key:"ncName",
minWidth:150
},
{
align:"center",
title:"NC代码内容",
key:"ncContent",
minWidth:150
},
// {
// align:"center",
// title:"",
// key:"workCenter",
// minWidth:150
// },
// {
// align:"center",
// title:"ID",
// key:"deviceId",
// minWidth:150
// },
// {
// align:"center",
// title:"",
// key:"deviceName",
// minWidth:150
// },
{
align:"center",
title:"状态",
key:"status",
minWidth:150,
render(row:any) {
if(row.status == 1){
return '启用'
}
return '禁用'
}
},
{
align:"center",
title:"是否下发",
key:"isIssued",
minWidth:150,
render(row:any) {
if(row.status == 1){
return '已下发'
}
return '未下发'
}
},
{
align:"center",
title:"下发时间",
key:"issueTime",
minWidth:150
},
{
align:"center",
title:"下发人",
key:"issueBy",
minWidth:150
},
{
align:"center",
title:"备注",
key:"remark",
minWidth:150
},
{
align:'center',
title: '操作',
key: 'actions',
width: 260,
fixed: 'right',
render(row:any) {
const buttons:any = []
if(hasPermission('biz:ncCode:issue')){
buttons.push(h(NButton, {
size: 'small',
type:'info',
ghost:true,
onClick: () => {
issuehand()
} },
{ default: () => '下发'}
))
}
if(hasPermission('biz:nccode:add')){
buttons.push(h(NButton, {
size: 'small',
type:'warning',
ghost:true,
onClick: () => {
addhand(3,row)
}},
{ default: () => '复制'}
))
}
if(hasPermission('biz:ncCode:edit')){
buttons.push(h(NButton, {
size: 'small',
type:'primary',
ghost:true,
onClick: () => {
addhand(2,row)
} },
{ 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('操作成功')
})
},
onNegativeClick: () => {
}
})
} },
{ default: () => '删除'}
))
}
return buttons.length > 0 ? h(NSpace, {justify:'center'}, { default: () => buttons }) : '-'
}
}
]
//
function search() {
pagination.page = 1
searchForm.page = 1
searchForm.pageSize = 20
getlist()
}
//
function reset() {
}
//
function getlist() {
nccodelist(searchForm).then((rps:any) => {
datalist.value = rps.list
pagination.itemCount = rps.total
})
}
function handlePageChange(page: number) {
pagination.page = page
searchForm.page = page
getlist()
}
function handlePageSizeChange(pageSize: number) {
pagination.pageSize = pageSize
pagination.page = 1
searchForm.page = 1
searchForm.pageSize = pageSize
getlist()
}
// //
// async function loadDictOptions() {
// //qcCancelLoading = true
// try {
// const data = await dictDataApi.listByType('assing_status')
// qcAssingStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
// }catch {}
// }
//
let addModel = ref(false)
const addformRef = ref()
let formData = reactive<any>({
id:'',
ncCode:'', //NC
ncName:'', //NC
ncContent:'', //NC
workCenter:'', //
deviceId:'', //ID
deviceName:'', //
status:1, //1- 0-
isIssued:1, //1- 0-
issueTime:null, //
issueBy:'', //
remark:'' //
})
const addrules = {
ncCode: [
{ required: true, message: '请输入NC代码编号', trigger: 'blur' },
// {
// validator(rule:any,value: any) {
// if(value > pauseform.qcNum){
// return new Error(`${pauseform.qcNum}`)
// }
// return true
// },
// trigger: ['blur']
// }
],
ncName:[
{ required: true, message: '请输入NC代码名称', trigger: 'blur' }
],
ncContent:[
{ required: true, message: '请输入NC代码内容', trigger: 'blur' }
]
}
let isstype = ref<any>(1)
const cztype = reactive<any>({
1:'新增',
2:'编辑',
3:'复制'
})
function addhand(type:any,row?:any) {
addModel.value = true
formData.value?.restoreValidation()
isstype.value = type
if(row){
formData.id = row.id
formData.ncCode = row.ncCode
formData.ncName = row.ncName
formData.ncContent = row.ncContent
formData.workCenter = row.workCenter
formData.deviceId = row.deviceId
formData.deviceName = row.deviceName
formData.status = row.status
formData.isIssued = row.isIssued
formData.issueTime = row.issueTime
formData.issueBy = row.issueBy
formData.remark = row.remark
}else{
formData.id = ''
formData.ncCode = ''
formData.ncName = ''
formData.ncContent = ''
formData.workCenter = ''
formData.deviceId = ''
formData.deviceName = ''
formData.status = 1
formData.isIssued = ''
formData.issueTime = ''
formData.issueBy = ''
formData.remark = ''
}
}
function addEdi(){
if(isstype.value == 1){
return addnccode(formData)
}
if(isstype.value == 2){
return editccode(formData)
}
formData.id = ''
return issuecopy(formData)
}
function savehand() {
addformRef.value?.validate((e:any) => {
if (!e) {
addEdi().then(() => {
message.success(cztype[isstype.value])
setTimeout(() => {
getlist()
addModel.value = false
},1500)
})
}
})
}
//
function rowKey(row:any) {
return row.id
}
let chearr = ref<any>([])
function handleCheck(v:any) {
chearr.value = v
console.log(v)
}
//
function delhand() {
if(chearr.value.length > 0){
batchIssue(chearr.value).then(() => {
message.success('操作成功')
})
}else{
message.error('请勾选设备')
}
}
//
let isstasklist = 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' }
]
}
function renderlabe() {}
function issuehand() {
issueModel.value = true
// if(chearr.value.length > 0){
// batchIssue(chearr.value).then(() => {
// message.success('')
// })
// }else{
// message.error('')
// }
}
const issformRef = ref()
function isssavehand() {
issformRef.value?.validate((e:any) => {
if (!e) {
message.success('操作成功')
setTimeout(() => {
getlist()
issueModel.value = false
},1500)
}
})
}
getlist()
onMounted(() => {
//loadDictOptions()
})
</script>
<style scoped>
</style>

View File

@ -0,0 +1,311 @@
<template>
<div class="page-container">
<!-- 用户列表 -->
<n-card class="user-list-card" size="small">
<!-- 搜索表单 -->
<div class="search-form">
<n-form
:model="searchForm"
label-placement="left"
>
<n-grid :cols="24" :x-gap="24">
<n-form-item-gi :span="6" label="开始日期">
<n-date-picker v-model:value="searchForm.startdate" type="date" />
</n-form-item-gi>
<n-form-item-gi :span="6" label="结束日期">
<n-date-picker v-model:value="searchForm.enddate" type="date" />
</n-form-item-gi>
<n-form-item-gi :span="6">
<n-space>
<n-button type="primary" @click="search">
<template #icon><n-icon><SearchOutline /></n-icon></template>
搜索
</n-button>
<n-button @click="reset">
<template #icon><n-icon><RefreshOutline /></n-icon></template>
重置
</n-button>
</n-space>
</n-form-item-gi>
</n-grid>
</n-form>
</div>
<!-- 表格 -->
<n-data-table
:columns="columns"
size="small"
striped
:data="datalist"
:bordere="false"
:single-line="false"
:loading="loading"
remote
/>
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px">
<n-pagination
v-model:page="pagination.page"
v-model:page-size="pagination.pageSize"
:item-count="pagination.itemCount"
:page-sizes="[10, 20, 50, 100]"
show-size-picker
show-quick-jumper
@update:page="handlePageChange"
@update:page-size="handlePageSizeChange"
>
<template #prefix>
{{ pagination.itemCount }}
</template>
</n-pagination>
</div>
</n-card>
</div>
</template>
<script setup lang="ts">
import {
ref,
reactive,
h,
onMounted,
watch,
} from 'vue'
import {
NButton,
NIcon,
NSpace,
NPagination,
NGrid,
// NGi,
NTag,
useMessage,
useDialog,
//type FormInst,
} from 'naive-ui'
import {
SearchOutline,
RefreshOutline,
AddOutline
} from '@vicons/ionicons5'
import { useUserStore } from '@/stores/user'
import { dictDataApi } from '@/api/org'
import {
mytasks,
inspectio
} from '@/api/production'
import PlmModelDrawer from '@/components/PlmModelDrawer.vue'
import type { PlmModelOpenContext } from '@/api/plmModel'
import AssingWorkVue from '@/views/biz/flowingAround/assingWork.vue'
import { qualityTestingApi, type QualityTesting } from '@/api/qualityTesting'
import SumbitDetailCard from '@/components/SumbitDetailCard.vue'
import { SubmitLog } from '@/api/submitLog'
const dialog = useDialog()
const message = useMessage()
const userStore = useUserStore()
//
const hasPermission = (permission: string) => userStore.hasPermission(permission)
//
const qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
// ==================== ====================
const searchForm = reactive({
page: 1,
pageSize: 20,
startdate:null,
enddate:null
})
// ==================== ====================
const datalist = ref<any>([])
const loading = ref(false)
//
const pagination = reactive({
page: 1,
pageSize: 10,
itemCount: 0
})
const columns = [
// {
// type: 'selection',
// minWidth:60
// },
{
align:"center",
title:"图纸",
key:"materialName",
minWidth:150,
render(row:any) {
var opt = row.materialName
if(opt) return opt
return '-'
}
},
{
align:"center",
title:"文件",
key:"materialCode",
minWidth:150,
render(row:any) {
var opt = row.materialCode
if(opt) return opt
return '-'
}
},
{
align:"center",
title:"NC文件",
key:"materialCode",
minWidth:150
},
{
align:"center",
title:"下发时间",
key:"assingCode",
minWidth:150
},
// {
// align:'center',
// title: '',
// key: 'actions',
// width: 150,
// fixed: 'right',
// render(row:any) {
// const buttons:any = []
// if(hasPermission('biz:assingWork:edit')){
// buttons.push(h(NButton, {
// size: 'small',
// type:'primary',
// ghost:true,
// onClick: () => { } },
// { default: () => ''}
// ))
// }
// if(hasPermission('biz:assingWork:edit')){
// buttons.push(h(NButton, {
// size: 'small',
// type:'error',
// ghost:true,
// onClick: () => { } },
// { default: () => ''}
// ))
// }
// return buttons.length > 0 ? h(NSpace, {justify:'center'}, { default: () => buttons }) : '-'
// }
// }
]
//
function search() {
pagination.page = 1
searchForm.page = 1
searchForm.pageSize = 20
getlist()
}
//
function reset() {
searchForm.processId =''
searchForm.processName = ''
}
//
function getlist() {
mytasks(searchForm).then((rps:any) => {
datalist.value = rps.records
pagination.itemCount = rps.total
})
}
function handlePageChange(page: number) {
pagination.page = page
searchForm.page = page
getlist()
}
function handlePageSizeChange(pageSize: number) {
pagination.pageSize = pageSize
pagination.page = 1
searchForm.page = 1
searchForm.pageSize = pageSize
getlist()
}
//
async function loadDictOptions() {
//qcCancelLoading = true
try {
const data = await dictDataApi.listByType('assing_status')
qcAssingStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
}catch {}
}
//
let addModel = ref(false)
const addformRef = ref({
gxname:''
})
let formData = reactive<any>({
})
const addrules = {
gxname: [
{ required: true, message: '请输入工序名称', trigger: 'blur' },
// {
// validator(rule:any,value: any) {
// if(value > pauseform.qcNum){
// return new Error(`${pauseform.qcNum}`)
// }
// return true
// },
// trigger: ['blur']
// }
]
}
function addhand() {
addModel.value = true
}
onMounted(() => {
getlist()
loadDictOptions()
})
</script>
<style scoped>
</style>

View File

@ -0,0 +1,297 @@
<template>
<div class="page-container">
<!-- 用户列表 -->
<n-card class="user-list-card" size="small">
<!-- 搜索表单 -->
<div class="search-form">
<n-form
:model="searchForm"
label-placement="left"
>
<n-grid :cols="24" :x-gap="24">
<n-form-item-gi :span="6" label="工艺名称">
<n-input v-model:value="searchForm.processName" placeholder="请输入工艺名称" clearable />
</n-form-item-gi>
<n-form-item-gi :span="6">
<n-space>
<n-button type="primary" @click="search">
<template #icon><n-icon><SearchOutline /></n-icon></template>
搜索
</n-button>
<n-button @click="reset">
<template #icon><n-icon><RefreshOutline /></n-icon></template>
重置
</n-button>
</n-space>
</n-form-item-gi>
</n-grid>
</n-form>
</div>
<!-- 表格 -->
<n-data-table
:columns="columns"
size="small"
striped
:data="datalist"
:bordere="false"
:single-line="false"
:loading="loading"
remote
/>
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px">
<n-pagination
v-model:page="pagination.page"
v-model:page-size="pagination.pageSize"
:item-count="pagination.itemCount"
:page-sizes="[10, 20, 50, 100]"
show-size-picker
show-quick-jumper
@update:page="handlePageChange"
@update:page-size="handlePageSizeChange"
>
<template #prefix>
{{ pagination.itemCount }}
</template>
</n-pagination>
</div>
</n-card>
<PlmModelDrawer ref="plmModelDrawerRef" />
</div>
</template>
<script setup lang="ts">
import {
ref,
reactive,
h,
onMounted,
watch,
} from 'vue'
import {
NButton,
NIcon,
NSpace,
NPagination,
NGrid,
// NGi,
NTag,
useMessage,
useDialog,
//type FormInst,
} from 'naive-ui'
import {
SearchOutline,
RefreshOutline
} from '@vicons/ionicons5'
import { useUserStore } from '@/stores/user'
import { dictDataApi } from '@/api/org'
import {
mytasks,
inspectio
} from '@/api/production'
import PlmModelDrawer from '@/components/PlmModelDrawer.vue'
import type { PlmModelOpenContext } from '@/api/plmModel'
import AssingWorkVue from '@/views/biz/flowingAround/assingWork.vue'
import { qualityTestingApi, type QualityTesting } from '@/api/qualityTesting'
import SumbitDetailCard from '@/components/SumbitDetailCard.vue'
import { SubmitLog } from '@/api/submitLog'
const dialog = useDialog()
const message = useMessage()
const userStore = useUserStore()
//
//const hasPermission = (permission: string) => userStore.hasPermission(permission)
//
const qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
// ==================== ====================
const searchForm = reactive({
page: 1,
pageSize: 20,
processId:'',
processName:'',
})
// ==================== ====================
const datalist = ref<any>([])
const loading = ref(false)
//
const pagination = reactive({
page: 1,
pageSize: 10,
itemCount: 0
})
const columns = [
// {
// type: 'selection',
// minWidth:60
// },
{
align:"center",
title:"立加",
key:"materialName",
minWidth:150,
render(row:any) {
var opt = row.materialName
if(opt) return opt
return '-'
}
},
{
align:"center",
title:"刨铣",
key:"materialCode",
minWidth:150,
render(row:any) {
var opt = row.materialCode
if(opt) return opt
return '-'
}
},
{
align:"center",
title:"圆板",
key:"assingCode",
minWidth:150
},
// {
// align:'center',
// title: '',
// key: 'actions',
// width: 250,
// fixed: 'right',
// render(row:any) {
// const buttons:any = []
// if(hasPermission('biz:assingWork:edit')){
// buttons.push(h(NButton, {
// size: 'small',
// type:'primary',
// ghost:true,
// onClick: () => { handlpause(row) } },
// { default: () => ''}
// ))
// }
// buttons.push(h(NButton, {
// size: 'small',
// type: 'info',
// ghost: true,
// onClick: () => openPlmModel(row),
// }, { default: () => '' }))
// buttons.push(h(NButton, {
// size: 'small',
// type: 'info',
// ghost: true,
// onClick: ()=> cancelQuality(row)
// }, { default: () => '' }))
// return buttons.length > 0 ? h(NSpace, {justify:'center'}, { default: () => buttons }) : '-'
// }
// }
]
//
function search() {
pagination.page = 1
searchForm.page = 1
searchForm.pageSize = 20
getlist()
}
//
function reset() {
searchForm.processId =''
searchForm.processName = ''
}
//
function getlist() {
mytasks(searchForm).then((rps:any) => {
datalist.value = rps.records
pagination.itemCount = rps.total
})
}
function handlePageChange(page: number) {
pagination.page = page
searchForm.page = page
getlist()
}
function handlePageSizeChange(pageSize: number) {
pagination.pageSize = pageSize
pagination.page = 1
searchForm.page = 1
searchForm.pageSize = pageSize
getlist()
}
// watch(()=>pauseform.qcNum,v => {
// pauseform.qcNum = v.replace(/[^\d]/g,'')
// })
//
async function loadDictOptions() {
//qcCancelLoading = true
try {
const data = await dictDataApi.listByType('assing_status')
qcAssingStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
}catch {}
}
onMounted(() => {
getlist()
loadDictOptions()
})
</script>
<style scoped>
</style>

View File

@ -40,7 +40,7 @@
</template>
全屏
</n-button>
<n-button ghost style="margin-right: 20px;color: #fff;">
<n-button @click="refresh" ghost style="margin-right: 20px;color: #fff;">
<template #icon>
<n-icon>
<Sync />
@ -49,14 +49,14 @@
刷新
</n-button>
<n-button ghost style="color: #fff;" @click="switchworks">
<!--switchworks-->
<n-button ghost style="color: #fff;" @click="handover">
<template #icon>
<n-icon>
<SwapHorizontalOutline />
</n-icon>
</template>
切换工位
工位交接
</n-button>
</div>
</div>
@ -149,8 +149,8 @@
</n-grid>
</div>
<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 style="display: flex;align-items: center;justify-content: space-between;font-size: 24px;">
<div v-for="(n,i) in taskdata" @click="getgd(i,n)" class="gditem" :class="{gdactv:gdindex == i}">
<div style="display: flex;align-items: center;justify-content: space-between;font-size: 22px;">
<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>
@ -193,38 +193,47 @@
<div style="padding-left: 4px;">工单操作</div>
</template>
<div style="padding: 15px;border: 2px solid #186170;border-radius: 10px;background: #244962;">
<div style="color: #ccc;">正在执行</div>
<div style="display: flex;align-items: center;padding-bottom: 10px;">
<div style="font-size: 30px;">GB123456789001</div>
<div style="padding: 2px 6px;border-radius: 8px;background: #896024;">内包含页单玻门无底柜 C128(500×600×800)AS</div>
<div style="font-size: 30px;">{{gdinfo.assingCode}}</div>
<!-- <div style="margin-left: 8px;padding: 2px 6px;border-radius: 8px;background: #896024;">{{ticketStatus[gdinfo.assingStatus]}}</div> -->
</div>
<div style="display: flex;align-items: center;overflow-x: auto;">
<div style="display: flex;align-items: center;justify-content: space-between;">
<div style="width: 15%;height: 100px;text-align: center;border: 4px double #ccc;border-radius: 10px;">
<div style="height: 40px;line-height: 40px;font-size: 16px;background: #177a7b;border-radius: 10px 10px 0 0;">生产总数</div>
<div style="height: 80px;line-height: 40px;font-size: 30px;">{{gddetail.processPlanTotalNum}}</div>
</div>
<div style="width: 15%;height: 100px;text-align: center;border: 4px double #ccc;border-radius: 10px;">
<div style="height: 40px;line-height: 40px;font-size: 16px;background: #177a7b;border-radius: 10px 10px 0 0;">转入数量</div>
<div style="height: 80px;line-height: 40px;font-size: 30px;">{{gddetail.processPlanTransferNum}}</div>
</div>
<div style="width: 15%;height: 100px;text-align: center;border: 4px double #ccc;border-radius: 10px;">
<div style="height: 40px;line-height: 40px;font-size: 16px;background: #177a7b;border-radius: 10px 10px 0 0;">转出数量</div>
<div style="height: 80px;line-height: 40px;font-size: 30px;">{{gddetail.processPlanTransferOutNum}}</div>
</div>
<div style="width: 15%;height: 100px;text-align: center;border: 4px double #ccc;border-radius: 10px;">
<div style="height: 40px;line-height: 40px;font-size: 16px;color: #e3e3e3;background: #70560c;border-radius: 10px 10px 0 0;">当前任务生产总数</div>
<div style="height: 80px;line-height: 40px;font-size: 30px;">{{gddetail.assingWorkTotalNum}}</div>
</div>
<div style="width: 15%;height: 100px;text-align: center;border: 4px double #ccc;border-radius: 10px;">
<div style="height: 40px;line-height: 40px;font-size: 16px;color: #e3e3e3;background: #70560c;border-radius: 10px 10px 0 0;">当前任务己生产数</div>
<div style="height: 80px;line-height: 40px;font-size: 30px;">{{ gddetail.assingWorkProductionTotalNum }}</div>
</div>
<div style="width: 15%;height: 100px;text-align: center;border: 4px double #ccc;border-radius: 10px;">
<div style="height: 40px;line-height: 40px;font-size: 16px;color: #e3e3e3;background: #70560c;border-radius: 10px 10px 0 0;">我的生产数量</div>
<div style="height: 80px;line-height: 40px;font-size: 30px;">{{ gddetail.assingWorkPersonTotalNum }}</div>
</div>
</div>
<!-- <div style="display: flex;align-items: center;overflow-x: auto;">
<div @click="gxtab(1)" :class="{gonxactv:gonxindex == 1}" style="box-sizing: border-box;width: 120px;padding: 10px 0;text-align: center;">
<!-- <div style="position: relative;width: 80px;height: 80px;margin: 0 auto;border:4px solid #ccc;border-radius: 50%;">
<div style="position: absolute;width: 80px;height: 80px;border:4px solid #007f5b;border-radius: 50%;">80%</div>
</div> -->
<!-- <div class="progress-container">
<svg viewBox="0 0 120 120">
<circle class="bg" cx="60" cy="60" r="54" fill="none" stroke-width="6" />
<circle class="progress" cx="60" cy="60" r="54" fill="none" stroke-width="6"
stroke-dasharray="339.292" stroke-dashoffset="339.292" />
</svg>
<span class="label" id="label">0%</span>
</div> -->
<circlebom :percent="100" />
<div>饮水机外壳加工</div>
</div>
<div @click="gxtab(2)" :class="{gonxactv:gonxindex == 2}" style="width: 120px;padding: 10px 0;text-align: center;">
<!-- <div style="position: relative;width: 80px;height: 80px;margin: 0 auto;border:4px solid #ccc;border-radius: 50%;">
<div style="position: absolute;width: 80px;height: 80px;border:4px solid #007f5b;border-radius: 50%;">80%</div>
</div> -->
<circlebom :percent="20" />
<div>进检</div>
</div>
<div @click="gxtab(3)" :class="{gonxactv:gonxindex == 3}" style="width: 120px;padding: 10px 0;text-align: center;">
<!-- <div style="position: relative;width: 80px;height: 80px;margin: 0 auto;border:4px solid #ccc;border-radius: 50%;">
<div style="position: absolute;width: 80px;height: 80px;border:4px solid #007f5b;border-radius: 50%;">80%</div>
</div> -->
<div class="progress-container">
<svg viewBox="0 0 120 120">
<circle class="bg" cx="60" cy="60" r="54" fill="none" stroke-width="6" />
@ -235,8 +244,8 @@
</div>
<div>进检</div>
</div>
</div>
<div style="display: flex;align-items: center;justify-content: space-between;margin-top: 15px;padding: 20px;border: 1px solid #ccc;border-radius: 10px;">
</div> -->
<div style="display: flex;align-items: center;justify-content: space-between;margin-top: 20px;padding: 20px;border: 1px solid #ccc;border-radius: 10px;">
<div style="display: flex;align-items: center;">
<!-- <div style="display: flex;align-items: center;">
<div style="padding: 2px 4px;font-size: 18px;color:#b7b7b7;border: 1px solid #ccc;">工序名称</div>
@ -269,14 +278,14 @@
</template>
作业指导书
</n-button>
<n-button ghost style="margin-right: 20px;color: #fff;" size="large">
<!-- <n-button ghost style="margin-right: 20px;color: #fff;" size="large">
<template #icon>
<n-icon>
<PricetagsOutline />
</n-icon>
</template>
报工参数
</n-button>
</n-button> -->
<n-button ghost style="color: #fff;" size="large">
<template #icon>
<n-icon>
@ -287,7 +296,11 @@
</n-button>
</div>
</div>
<div style="display: flex;align-items: center;justify-content: space-between;margin-top: 15px;padding: 20px;border: 1px solid #ccc;border-radius: 10px;">
<div style="margin-top: 20px;padding: 20px;border: 1px solid #ccc;border-radius: 10px;">
<div style="display: flex;font-size: 16px;">
<div style="color:#ccc">可报工数量</div>
<div style="padding-left: 5px;font-weight:bold;">{{gddetail.assingWorkTotalNum - gddetail.assingWorkProductionTotalNum}} </div>
</div>
<n-form
ref="baogformRef"
:model="baogdata"
@ -301,13 +314,13 @@
}"
>
<n-form-item label="合格数" label-style="color:#fff;">
<n-input v-model:value="baogdata.qualified" placeholder="请输入合格数" />
<n-input v-model:value="baogdata.okData.qty" placeholder="请输入合格数" />
</n-form-item>
<n-form-item label="不合格数" label-style="color:#fff;">
<n-input v-model:value="baogdata.unqualified" placeholder="请输入不合格数" />
<n-input v-model:value="baogdata.scrapData.qty" placeholder="请输入不合格数" />
</n-form-item>
<n-form-item label="总数" label-style="color:#fff;">
<n-input v-model:value="baogdata.total" disabled placeholder="" />
<n-input v-model:value="baogdata.qcNum" disabled placeholder="" />
</n-form-item>
<n-button
type="success"
@ -384,7 +397,7 @@
</n-tab-pane>
</n-tabs>
</n-tab-pane>
<n-tab-pane name="zzpgz" tab="在制品跟踪">
<!-- <n-tab-pane name="zzpgz" tab="在制品跟踪">
<template #tab>
<n-icon size="22">
<Planet />
@ -392,7 +405,7 @@
<div style="padding-left: 4px;">在制品跟踪</div>
</template>
在制品跟踪
</n-tab-pane>
</n-tab-pane> -->
</n-tabs>
</n-gi>
<n-gi :span="5" class="mocz">
@ -401,34 +414,51 @@
<n-icon size="22">
<HourglassOutline />
</n-icon>
<div style="padding-left: 8px;">操作记录</div>
<div style="padding-left: 8px;">操作日志</div>
</div>
<!-- <div style="font-size: 14px;color:#b7b7b7;"> 40 </div> -->
</div>
<div style="height: 520px;padding:20px;overflow-y: auto;">
<div v-for="n in 10" 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>2026-06-28 14:50:30</div>
<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.createTime}}</div>
</div>
<div style="font-size: 20px;">{{operationType[n.operationType]}}</div>
</div>
<div style="font-size: 20px;">暂停</div>
</div>
</template>
<template v-else>
<n-empty size="huge" style="margin-top: 80px;" description="暂无记录" />
</template>
</div>
</n-gi>
</n-grid>
<div style="display: flex;align-items: center;justify-content: center;">
<div class="mybtn">
<n-icon size="28">
<Power />
<div class="mybtn" style="background: #797b21;">
<n-icon size="26">
<CompassOutline />
</n-icon>
<div>开始</div>
<div style="padding-left: 2px;">叫料</div>
</div>
<div class="mybtn" style="margin-left: 20px;background:#177a7b">
<n-icon size="26">
<NavigateCircle />
</n-icon>
<div style="padding-left: 2px;">调车</div>
</div>
<div class="mybtn" style="margin-left: 20px;">
<n-icon size="26">
<PlayCircleOutline />
</n-icon>
<div style="padding-left: 2px;">开工</div>
</div>
<div class="mybtn" style="margin-left: 20px;background: #1e2a40;border: 1px solid #afafaf;">
<n-icon size="32">
<n-icon size="26">
<StopCircleOutline />
</n-icon>
<div>暂停</div>
<div style="padding-left: 2px;">暂停</div>
</div>
<!-- <n-button ghost size="large" style="color: #fff;">
<template #icon size="100">
@ -449,9 +479,9 @@
</div>
</div>
<div v-else class="conten">
<div class="head">
<!-- <div class="head">
<div style="box-sizing: border-box;padding: 5px;">
<!-- <n-icon :component="BuildSharp" size="20" color="#ccc" /> -->
<div style="display: flex;align-items: center;padding-left: 10px;">
<n-icon :component="PersonOutline" size="25" color="#ccc" />
@ -477,10 +507,9 @@
全屏
</n-button>
</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> -->
<!-- <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="width: 100%;padding:10px 20px;text-align: center;">
<!-- <img src="../../assets/logo/logo1.png" width="110" height="50" /> -->
<n-icon size="40" color="#00a2ff">
<EarthOutline />
</n-icon>
@ -512,8 +541,6 @@
/>
</n-form-item>
<n-form-item label="所属工段" label-style="color:#fff;" path="section">
<!--:disabled="logindata.workshop?false:true"-->
<n-select
:disabled="logindata.workshopId?false:true"
:render-label="renderlabeltwo"
@ -524,7 +551,6 @@
/>
</n-form-item>
<n-form-item label="所属工位" label-style="color:#fff;" path="workstation">
<!--:disabled="logindata.section?false:true"-->
<n-select
:disabled="logindata.sectionId?false:true"
:render-label="renderlabelthree"
@ -543,9 +569,83 @@
</n-button>
</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="width: 100%;padding:10px 20px;text-align: center;">
<n-icon size="40" color="#00a2ff">
<EarthOutline />
</n-icon>
<div>
<div style="font-size: 21px;">登录终端</div>
<div style="font-size: 12px;color: #b7b7b7;">登录后终端将自动显示该工位的生产任务</div>
</div>
</div>
<n-form
ref="loginformRef"
:model="formData"
:rules="loginrules"
label-placement="top"
label-width="auto"
size="large"
:style="{
marginTop:'20px'
}"
>
<n-form-item path="username" label-style="color:#fff;" label="用户名">
<n-input v-model:value="formData.username" placeholder="请输入用户名" :maxlength="50" @keyup.enter="handleLogin">
<template #prefix><n-icon :component="PersonOutline" /></template>
</n-input>
</n-form-item>
<n-form-item path="password" label-style="color:#fff;" label="密码">
<n-input v-model:value="formData.password" type="password" placeholder="请输入密码" show-password-on="click" :maxlength="50" @keyup.enter="handleLogin">
<template #prefix><n-icon :component="LockClosedOutline" /></template>
</n-input>
</n-form-item>
<n-button
type="info"
style="width: 100%;margin-top: 20px;"
size="large"
@click="handleLogin"
>
</n-button>
</n-form>
</div>
</div>
<!--工位交接-->
<n-modal
v-model:show="handoverpop"
title="工位交接"
preset="card"
style="width: 500px;"
:mask-closable="false"
>
<n-form
ref="loginformRef"
:model="formData"
:rules="loginrules"
label-placement="top"
label-width="auto"
size="large"
>
<n-form-item path="" label="交接人">
<n-input v-model:value="formData.username" placeholder="请输入交接人" />
</n-form-item>
<n-button
type="info"
style="width: 100%;margin-top: 20px;background: #296791;"
size="large"
@click="handleLogin"
>
确定交接
</n-button>
</n-form>
</n-modal>
<!--作业指导书-->
<n-modal
v-model:show="guidanpop"
@ -588,6 +688,13 @@ import {
type FormInst,
} from 'naive-ui'
import {
CompassOutline,
NavigateCircle,
NuclearSharp,
StopOutline,
Navigate,
PlayCircleOutline,
LockClosedOutline,
ArrowRedoOutline,
PersonCircleSharp,
BuildSharp,
@ -621,9 +728,11 @@ import { useUserStore } from '@/stores/user'
import {
tasklist,
workstation,
taskdetail
taskdetail,
operationlist,
reportingwork
} from '@/api/proterminal'
import { label } from 'three/tsl'
import { element, label } from 'three/tsl'
import { Value } from 'three/examples/jsm/inspector/ui/Values.js'
//import { dictDataApi } from '@/api/org'
@ -639,6 +748,10 @@ const message = useMessage()
const userStore = useUserStore()
//
function refresh() {
location.reload()
}
//
let tablet = ref(false)
@ -685,6 +798,14 @@ const ticketStatus :any = {
8:'部分完成'
}
//
const operationType :any = {
1:'开始',
2:'暂停',
3:'报工',
4:'撤回'
}
let queryparam = reactive<any>({
type:1,
@ -709,19 +830,28 @@ const typeopt = reactive<any>([
//
let baogformRef = ref()
let baogdata = reactive<any>({
qualified:'', //
unqualified:'', //
total:'' //
id:'', //id
qcNum:'', //
okData:{
qty:'' //
},
scrapData:{
qty:'' //
}
// qualified:'', //
// unqualified:'', //
// total:'' //
})
let baogrules = {
qualified: [
'okData.qty': [
{
required: true,
trigger: ['blur', 'input'],
message: '请输入合格数'
}
],
unqualified:[
'scrapData.qty':[
{
required: true,
trigger: ['blur', 'input'],
@ -730,31 +860,58 @@ let baogrules = {
]
}
watch(() => baogdata.qualified,(v:any) => {
baogdata.qualified = v.replace(/[^\d]/g,'').replace(/^0+(?=\d)/, '')
baogdata.total = baogdata.qualified*1 + baogdata.unqualified*1
watch(() => baogdata.okData.qty,(v:any) => {
baogdata.okData.qty = v.replace(/[^\d]/g,'').replace(/^0+(?=\d)/, '')
baogdata.qcNum = baogdata.okData.qty*1 + baogdata.scrapData.qty*1
})
watch(() => baogdata.unqualified,(v:any) => {
baogdata.unqualified = v.replace(/[^\d]/g,'').replace(/^0+(?=\d)/, '')
baogdata.total = baogdata.qualified*1 + baogdata.unqualified*1
watch(() => baogdata.scrapData.qty,(v:any) => {
baogdata.scrapData.qty = v.replace(/[^\d]/g,'').replace(/^0+(?=\d)/, '')
baogdata.qcNum = baogdata.okData.qty*1 + baogdata.scrapData.qty*1
})
//
function confireport() {
baogformRef.value?.validate((e:any) => {
if (!e) {
if(baogdata.qcNum == 0){
message.warning('请输入报工数量')
}else if(baogdata.qcNum > (gddetail.value.assingWorkTotalNum - gddetail.value.assingWorkProductionTotalNum)){
message.warning('报工总数大于可报工数量')
}else{
reportingwork(baogdata).then(() => {
message.success('操作成功')
}
})
})
}
// baogformRef.value?.validate((e:any) => {
// if (!e) {
// reportingwork(baogdata)
// message.success('')
// }
// })
}
//
let gdindex = ref<any>(0)
function getgd(i:any){
let gdinfo = ref<any>({})
let gdindex = ref<any>(0)
let gddetail = ref<any>({})
function getgd(i:any,n:any){
baogdata.okData.qty = ''
baogdata.scrapData.qty = ''
gdinfo.value = n
let wsdinfo = JSON.parse(sessionStorage.getItem('gwdata') as string)
baogdata.id = n.id
gdindex.value = i
taskdetail({
userId: userStore.userid,
assingWorkId: n.id,
...wsdinfo
//code: "string"
}).then(rps => {
gddetail.value = rps
})
}
//
@ -763,6 +920,12 @@ function gxtab(i:any) {
gonxindex.value = i
}
//
let handoverpop = ref(false)
function handover() {
handoverpop.value = true
}
//
let guidanpop = ref(false)
@ -770,7 +933,7 @@ function guizds() {
guidanpop.value = true
}
//
//
let islogin = ref<any>(sessionStorage.getItem('gwlogin'))
let logindata = reactive<any>({
@ -822,13 +985,19 @@ let secobj = ref<any>({})
//
let wkstobj = ref<any>({})
//
let loglist = 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
if(rps && rps.length > 0){
taskdata.value = rps
getgd(0,taskdata.value[0])
}
})
}
@ -848,6 +1017,17 @@ function init() {
code:''
})
operationlist({
userId: userStore.userid,
//...logindata,
}).then(rps => {
if(rps && rps){
loglist.value = rps
}
})
}else{
//
workstation(userStore.userid).then((rps:any) => {
@ -874,7 +1054,6 @@ function init() {
}
function wkupdate(v:any,n:any) {
//let arr = secobj.value[n.value]
sectionlist.value = secobj.value[n.value]
@ -947,10 +1126,52 @@ function loginhand() {
...logindata,
code:''
})
}
})
}
//
//
let formData = reactive({
username:'',
password:''
})
function handleLogin() {
formData.username = formData.username.trim()
formData.password = formData.password.trim()
if(formData.username == ''){
message.warning('请输入用户名')
}else if(formData.password == ''){
message.warning('请输入密码')
}else {
userStore.login(formData).then(() => {
message.success('登录成功')
sessionStorage.setItem('gwlogin','1')
islogin.value = '1'
getrwlist({
userId: userStore.userid,
...logindata,
code:''
})
operationlist({
userId: userStore.userid,
//...logindata,
}).then(rps => {
loglist.value = rps
})
})
}
}
//
function switchworks() {
sessionStorage.setItem('gwlogin','0')

View File

@ -20,9 +20,10 @@ export default defineConfig({
port: 3000,
proxy: {
'/api': {
//target:'http://192.168.6.107:8080', //'http://192.168.5.230:8888',
target:'http://192.168.12.4:8888/', //'http://192.168.5.230:8888',
//target:'http://192.168.5.230:8888',
target:'http://localhost:8888',
//target:'http://192.168.5.232:8888/',
//target:'http://localhost:8888',
changeOrigin: true
},
'/druid': {