<template>
|
<div class="test">
|
<div class="menu">
|
<div class="menu-left">
|
<div class="menu-left-name">测试 \ {{ planName && nodeName ? planName + ' \\ ' + nodeName : '临时任务' }} \ {{ stationName }}</div>
|
<div class="menu-left-triangle"></div>
|
</div>
|
<div class="menu-right">
|
<!-- <div class="menu-right-item link" @click="activeTab = 5">自动化测试</div> -->
|
<div class="menu-right-item link" @click="onFinishWork()">结束工作</div>
|
</div>
|
</div>
|
<div class="content">
|
<div class="tab">
|
<div @click="activeTab = 0" :class="activeTab == 0 ? 'tab-item link tab-item-active' : 'tab-item link'">
|
<i class="iconfont icon-gongzuotai" />
|
<span>工作台</span>
|
</div>
|
<div @click="activeTab = 1" :class="activeTab == 1 ? 'tab-item link tab-item-active' : 'tab-item link'">
|
<i class="iconfont icon-zuoyerenyuan" />
|
<span>作业人员</span>
|
</div>
|
<div @click="activeTab = 2" :class="activeTab == 2 ? 'tab-item link tab-item-active' : 'tab-item link'">
|
<i class="iconfont icon-zuoyezhidaoshu" />
|
<span>作业指导书</span>
|
</div>
|
<div @click="activeTab = 3" :class="activeTab == 3 ? 'tab-item link tab-item-active' : 'tab-item link'">
|
<i class="iconfont icon-jishuwendang" />
|
<span>技术文档</span>
|
</div>
|
<div @click="activeTab = 4" :class="activeTab == 4 ? 'tab-item link tab-item-active' : 'tab-item link'">
|
<i class="iconfont icon-jishucanshu" />
|
<span>技术参数</span>
|
</div>
|
</div>
|
<div class="panel">
|
<!-- 操作台面板 start -->
|
<div class="panel-item console" v-if="activeTab == 0">
|
<div class="title" style="text-align: left; margin-left: 30px;">在产设备</div>
|
<div class="device-item" style="background-color: #10477e;">
|
<span class="sort">序号</span>
|
<span class="code">设备码</span>
|
<span class="name">产品名称</span>
|
<span class="model">产品型号</span>
|
<span class="log">生产日志</span>
|
<span class="life">生命周期</span>
|
<span class="del">操作</span>
|
</div>
|
<div class="device-item device-main" v-if="!deviceInfo">
|
<span class="null red">请扫码添加设备</span>
|
</div>
|
<div class="device-item device-main" v-if="deviceInfo">
|
<span class="sort">1</span>
|
<span class="code">{{ deviceInfo.deviceNo }}</span>
|
<span class="name">{{ deviceInfo.proName }}</span>
|
<span class="model">{{ deviceInfo.proType }}</span>
|
<span class="log link" @click="handleTrack('生产日志', deviceInfo)">查看</span>
|
<span class="life link" @click="handleTrack('生命周期', deviceInfo)">查看</span>
|
<span class="del link" @click="onCancel"><i class="iconfont icon-shanchu" /></span>
|
</div>
|
<div class="title" style="text-align: left; margin-left: 30px;">测试项目</div>
|
<div class="device-item"style="background-color: #10477e;">
|
<span class="sort">序号</span>
|
<span class="code">测试内容</span>
|
<span class="select">是否上报</span>
|
<span class="result">测试结果</span>
|
</div>
|
<div class="device-list">
|
<div class="device-item" v-if="!testList.length">
|
<span class="null">暂无数据</span>
|
</div>
|
<div class="device-item" v-for="item, index in testList" v-bind:key="index" @click="handleListItem(item)">
|
<span class="sort">{{ index + 1 }}</span>
|
<span class="code">{{ item.item }}</span>
|
<span class="select" v-if="item.result == null"></span>
|
<span class="select link" v-if="item.result != null" @click.stop="handleListItemNull(item)"><i class="iconfont icon-duigou" /> 上报</span>
|
<span :class="`result-content ${item.result} link`" v-if="item.result == null">未检测</span>
|
<span :class="`result-content ${item.result} link`" v-if="item.result == true">合格</span>
|
<span :class="`result-content ${item.result} link`" v-if="item.result == false">不合格</span>
|
</div>
|
</div>
|
<div class="button-wrap">
|
<div class="cancle link" @click="handleCancel">取消</div>
|
<div class="unconformity link" @click="handleSubmit('102004')">不合格</div>
|
<div class="conformity link" @click="handleSubmit('102008')">合格</div>
|
</div>
|
</div>
|
<!-- 操作台面板 end -->
|
|
<!-- 作业人员面板 start -->
|
<div class="panel-item people" v-if="activeTab == 1">
|
<div class="title">作业人员</div>
|
<div class="list scrollList">
|
<div class="list-item green">
|
<i class="logo iconfont icon-renyuan" />
|
<div>
|
<div class="name">{{ userName }}</div>
|
<div class="type">作业人员</div>
|
<div class="userId">{{ userId }}</div>
|
</div>
|
</div>
|
<div class="list-item yellow" v-for="(item, index) in assistantsList" :key="index">
|
<i class="logo iconfont icon-renyuan" />
|
<div>
|
<div class="name">{{ item.name }}</div>
|
<div class="type">辅助人员</div>
|
<div class="userId">{{ item.id }}</div>
|
</div>
|
<i class="del iconfont icon-shanchu link" @click="handleDelPeople(item)" />
|
</div>
|
</div>
|
</div>
|
<!-- 作业人员面板 end -->
|
|
<!-- 作业指导书面板 start -->
|
<div class="panel-item" v-if="activeTab == 2">
|
<div class="title">作业指导书</div>
|
<el-image style="width: 100%; height: 100%;" fit="contain" :src="sop" :preview-src-list="sopList">
|
</el-image>
|
</div>
|
<!-- 作业指导书面板 end -->
|
|
<!-- 技术文档 start -->
|
<div class="panel-item documents" v-if="activeTab == 3">
|
<div class="title">技术文档</div>
|
<div class="documents-list">
|
<div class="documents-item" v-if="!documentsList.length">
|
<span class="null">暂无数据</span>
|
</div>
|
<div class="documents-item" v-if="documentsList.length">
|
<span class="sort">序号</span>
|
<span class="name">文件名</span>
|
<span class="type">文件类型</span>
|
<span class="open">操作</span>
|
</div>
|
</div>
|
<div class="list scrollList">
|
<div class="documents-item link" v-for="item, index in documentsList" v-bind:key="index" @click="handleOpenOffice(item)">
|
<span class="sort">{{ index + 1 }}</span>
|
<span class="name">{{ item.orgName }}</span>
|
<span class="type">{{ item.extName }}</span>
|
<span class="open">预览</span>
|
</div>
|
</div>
|
</div>
|
<!-- 技术文档 end -->
|
|
<!-- 技术参数 start -->
|
<div class="panel-item params" v-if="activeTab == 4">
|
<div class="title">技术参数</div>
|
<div class="list scrollList">
|
<div class="device-item" v-if="!paramsList.length">
|
<span class="null">暂无数据</span>
|
</div>
|
<div class="device-item" v-for="item, index in paramsList" v-bind:key="index">
|
<span class="name">{{ item.paramName }}</span>
|
<span class="code">{{ item.paramValue }}</span>
|
</div>
|
</div>
|
</div>
|
<!-- 技术参数 end -->
|
|
</div>
|
</div>
|
|
<!-- 文件预览 start -->
|
<Dialog :visible="showFile">
|
<div class="office">
|
<div class="close link" @click="handleCloseOffice"><i class="close iconfont icon-shanchu" /></div>
|
<div class="none" v-if="(file.extName != 'docx') && (file.extName != 'xlsx') && (file.extName != 'pdf')">不支持在线预览
|
</div>
|
<div class="orgName" v-else>{{ file.orgName }}</div>
|
<vue-office-docx v-if="file.extName == 'docx'" style="width: 1920px; height: 1000px;" :src="file.webUrl" />
|
<vue-office-excel v-if="file.extName == 'xlsx'" style="width: 1920px; height: 1000px;" :src="file.webUrl" />
|
<vue-office-pdf v-if="file.extName == 'pdf'" style="width: 1920px; height: 1000px;" :src="file.webUrl" />
|
</div>
|
</Dialog>
|
<!-- 文件预览 end -->
|
|
<!-- 追踪信息 strat -->
|
<Dialog :visible="showTrack">
|
<div class="track">
|
<div class="close link" @click="handleCloseTrack"><i class="close iconfont icon-shanchu" /></div>
|
<div class="title">{{ trackTitle }}</div>
|
<div class="track-item">
|
<div class="index">序号</div>
|
<div class="content">节点作业内容</div>
|
<!-- <div class="content">设备生命周期内容</div> -->
|
<!-- <div class="content">错误信息</div> -->
|
<div class="result">节点作业结果</div>
|
<div class="status">设备状态</div>
|
<div class="name">作业人员</div>
|
<!-- <div class="names">辅助人员</div> -->
|
<div class="date">进站时间</div>
|
<div class="date">出站时间</div>
|
</div>
|
<div class="track-list scrollList">
|
<div class="track-item link" v-for="item, index in trackList" v-bind:key="index" @click="handleTrackItem(item)">
|
<div class="index">{{ index + 1 }}</div>
|
<div class="content">{{ item.nodeContent }}</div>
|
<!-- <div class="content">{{ item.deviceCycleContent }}</div> -->
|
<!-- <div class="content">{{ item.errorMsg }}</div> -->
|
<div class="result">
|
<span class="green" v-if="item.result == 1">通过</span>
|
<span class="green" v-if="item.result == 2">测试通过</span>
|
<span class="green" v-if="item.result == 3">品检通过</span>
|
<span class="green" v-if="item.result == 4">维修通过</span>
|
<span class="yellow" v-if="item.result == 5">测试不通过</span>
|
<span class="yellow" v-if="item.result == 6">品检不通过</span>
|
<span class="red" v-if="item.result == 7">报废</span>
|
</div>
|
<div class="status">
|
<span class="light" v-if="item.status == 1">组装</span>
|
<span class="green" v-if="item.status == 2">完成</span>
|
<span class="yellow" v-if="item.status == 3">维修</span>
|
<span class="red" v-if="item.status == 4">报废</span>
|
</div>
|
<div class="name">{{ item.updateUserName }}</div>
|
<!-- <div class="names">{{ item.assistantNames }}</div> -->
|
<div class="date">{{ item.inTime }}</div>
|
<div class="date">{{ item.outTime }}</div>
|
</div>
|
</div>
|
</div>
|
</Dialog>
|
<!-- 追踪信息 end -->
|
|
<!-- 追踪信息详情 strat -->
|
<Dialog :visible="showTrackItem">
|
<div class="track-detail">
|
<div class="close link" @click="handleCloseTrackItem"><i class="close iconfont icon-shanchu" /></div>
|
<div class="title">记录详情</div>
|
<div class="track-detail-list scrollList" v-if="trackItem">
|
<div class="track-detail-content">
|
<div class="key">节点作业内容</div>
|
<div class="val">{{ trackItem.nodeContent }}</div>
|
</div>
|
<div class="track-detail-content">
|
<div class="key">设备生命周期内容</div>
|
<div class="val">{{ trackItem.deviceCycleContent }}</div>
|
</div>
|
<div class="track-detail-content">
|
<div class="key">错误信息</div>
|
<div class="val">{{ trackItem.errorMsg }}</div>
|
</div>
|
<div class="track-detail-content">
|
<div class="key">节点作业结果</div>
|
<div class="val">
|
<span class="green" v-if="trackItem.result == 1">通过</span>
|
<span class="green" v-if="trackItem.result == 2">测试通过</span>
|
<span class="green" v-if="trackItem.result == 3">品检通过</span>
|
<span class="yellow" v-if="trackItem.result == 4">维修通过</span>
|
<span class="yellow" v-if="trackItem.result == 5">测试不通过</span>
|
<span class="yellow" v-if="trackItem.result == 6">品检不通过</span>
|
<span class="red" v-if="trackItem.result == 7">报废</span>
|
</div>
|
</div>
|
<div class="track-detail-content">
|
<div class="key">设备状态</div>
|
<div class="val">
|
<span class="light" v-if="trackItem.status == 1">组装</span>
|
<span class="green" v-if="trackItem.status == 2">完成</span>
|
<span class="yellow" v-if="trackItem.status == 3">维修</span>
|
<span class="red" v-if="trackItem.status == 4">报废</span>
|
</div>
|
</div>
|
<div class="track-detail-content">
|
<div class="key">作业人员</div>
|
<div class="val">{{ trackItem.updateUserName }}</div>
|
</div>
|
<div class="track-detail-content">
|
<div class="key">辅助人员</div>
|
<div class="val">{{ trackItem.assistantNames }}</div>
|
</div>
|
<div class="track-detail-content">
|
<div class="key">进站时间</div>
|
<div class="val">{{ trackItem.inTime }}</div>
|
</div>
|
<div class="track-detail-content">
|
<div class="key">出站时间</div>
|
<div class="val">{{ trackItem.outTime }}</div>
|
</div>
|
</div>
|
</div>
|
</Dialog>
|
<!-- 追踪信息详情 end -->
|
</div>
|
</template>
|
|
<script>
|
import Dialog from '../components/Dialog.vue'
|
import VueOfficeDocx from '@vue-office/docx'
|
import '@vue-office/docx/lib/index.css'
|
import VueOfficeExcel from '@vue-office/excel'
|
import '@vue-office/excel/lib/index.css'
|
import VueOfficePdf from '@vue-office/pdf'
|
|
export default {
|
name: "test",
|
components: {
|
Dialog,
|
VueOfficeDocx,
|
VueOfficeExcel,
|
VueOfficePdf
|
},
|
data() {
|
return {
|
isAlert: false, // 确认框状态
|
activeTab: null, // 激活的tab栏
|
workId: null, // 工作任务id
|
nodeId: null, // 节点id
|
nodeName: null, // 节点名称
|
proId: null, // 产品id
|
devicePrefix: null, // 设备前缀
|
deviceInfo: null, // 设备信息
|
materielList: [], // 物料清单
|
assistantsList: [], // 辅助人员列表
|
sop: null, // 作业指导书
|
sopList: [], // 作业指导书列表
|
paramsList: [], // 技术参数列表
|
documentsList: [], // 文件列表
|
showFile: false, // 显示文件预览弹窗
|
file: { // 当前预览文件信息
|
webUrl: null,
|
orgName: null,
|
extName: null
|
},
|
showTrack: false, // 显示追踪信息弹窗
|
trackTitle: null, // 追踪信息标题
|
trackList: [], // 追踪信息列表
|
showTrackItem: false, // 显示追踪信息详情弹窗
|
trackItem: null, // 追踪信息详情
|
testList: [], // 测试数据
|
userName: null, // 登录人
|
stationName: null, // 工位名称
|
planName:null, // 计划名称
|
};
|
},
|
computed: {
|
deviceNo: function () {
|
var arr = []
|
if (this.deviceInfo) {
|
arr.push(this.deviceInfo.deviceNo)
|
}
|
return arr
|
},
|
errorMsg: function () {
|
var errorMsg = []
|
this.testList.forEach(item => {
|
if (item.result != null) {
|
errorMsg.push( item.item+':'+(item.result ? '合格' : '不合格'))
|
}
|
})
|
return errorMsg.join(';')
|
},
|
},
|
watch: {
|
activeTab: function (val) {
|
if (val == 0) {
|
this.onGetTestList()
|
}
|
if (val == 1) {
|
this.onGetAssistantsList()
|
}
|
if (val == 2) {
|
this.onGetSop()
|
}
|
if (val == 3) {
|
this.onGetDocumentsList()
|
}
|
if (val == 4) {
|
this.onGetParamsList()
|
}
|
},
|
deviceNo: function (val) {
|
this.testList.forEach((item) => {
|
item.result = null
|
})
|
},
|
proId: function (val) {
|
this.onGetTestList()
|
}
|
},
|
mounted() {
|
// 初始化工作台
|
this.activeTab = 0
|
// 恢复登录态
|
this.onGetLoginInfo()
|
// 通过事件总线接收扫描结果
|
this.$bus.$off('scanResult')
|
this.$bus.$on('scanResult', (val) => {
|
console.log('[test] 总线接收 =>', val)
|
this.handleScanVal(val)
|
})
|
// 通过事件总线接收弹窗状态
|
this.$bus.$off('isAlert')
|
this.$bus.$on('isAlert', (val) => {
|
this.isAlert = val
|
})
|
},
|
beforeDestroy() {
|
this.$bus.$off('isAlert')
|
this.$bus.$off('scanResult')
|
},
|
methods: {
|
// 获取登录信息
|
onGetLoginInfo() {
|
var that = this;
|
var params = {
|
workId: localStorage.getItem("workId"),
|
};
|
that
|
.$axiosAdmin({
|
method: "get",
|
url: "station/workOrder/getWorkLast",
|
params: params,
|
})
|
.then((res) => {
|
if (res.success && res.content.workType==2) {
|
that.workId = res.content.id
|
that.userId = res.content.userId
|
that.userName = res.content.userName
|
that.nodeId = res.content.nodeId
|
that.proId = res.content.proId
|
that.nodeName = res.content.nodeName
|
that.devicePrefix = res.content.devicePrefix
|
that.userName = res.content.userName
|
that.stationName = res.content.stationName
|
that.planName = res.content.planName
|
that.onGetTestList()
|
} else {
|
localStorage.clear()
|
this.goto('start')
|
}
|
})
|
.catch((err) => {
|
console.log(err);
|
});
|
},
|
// 跳转路由
|
goto: function (path) {
|
if (path != this.$route.name) {
|
this.$router.push({
|
name: path,
|
});
|
}
|
},
|
// 扫码结果处理
|
handleScanVal: function (val) {
|
console.log('[test] 扫码处理 =>', val)
|
if (this.isAlert) {
|
return
|
}
|
// 扫码注销
|
if (val == '102007') {
|
this.$alert.close()
|
this.onFinishWork()
|
return
|
}
|
// 扫码提交
|
if (val == '102004' || val == '102008') {
|
if (this.activeTab == 0) {
|
this.handleSubmit(val)
|
}
|
return
|
}
|
// 扫码取消
|
if (val == '102002') {
|
if (this.activeTab == 0) {
|
this.handleCancel(val)
|
}
|
return
|
}
|
// 进入工作台
|
if (this.activeTab == 0) {
|
if (this.devicePrefix == '') {
|
this.onGetDeviceInfo(0, val)
|
return
|
}
|
if (val.substr(0, 15) == this.devicePrefix) {
|
// 识别为设备码
|
this.onGetDeviceInfo(0, val)
|
} else {
|
// 识别为物料码
|
this.$notify({
|
title: '添加失败',
|
message: '扫描的设备码不属于本次生产任务。',
|
type: 'error'
|
})
|
return
|
// if (val.substr(0, 6) == this.devicePrefix.substr(0, 6)) {
|
// this.$notify({
|
// title: '添加失败',
|
// message: '扫描的设备类型与在产设备相同,不可添加为主要物料。',
|
// type: 'error'
|
// })
|
// return
|
// }
|
// this.onGetDeviceInfo(1, val)
|
}
|
return
|
}
|
// 进入作业人员
|
if (this.activeTab == 1) {
|
if (val.substr(0, 3) == '101') {
|
this.handleAddPeople(val)
|
} else {
|
this.$notify({
|
title: '添加失败',
|
message: '请扫描正确的人员二维码。',
|
type: 'error'
|
})
|
return
|
}
|
return
|
}
|
},
|
// 获取设备信息
|
onGetDeviceInfo: function (codeType, code) {
|
var that = this;
|
var params = {
|
deviceNo: code,
|
};
|
that
|
.$axiosAdmin({
|
method: "get",
|
url: "station/assemblyStep/queryByDeviceNo",
|
params: params,
|
})
|
.then((res) => {
|
if (res.success) {
|
// 设备信息
|
if (codeType == 0) {
|
if (this.deviceInfo) {
|
this.$notify({
|
title: '添加失败',
|
message: '只允许添加一条设备信息,请删除后重新添加。',
|
type: 'error'
|
})
|
} else {
|
this.deviceInfo = res.content
|
this.proId = res.content.proId
|
}
|
}
|
// 物料信息
|
if (codeType == 1) {
|
var isAdded = false
|
this.materielList.forEach(item => {
|
if (item.deviceNo == res.content.deviceNo) {
|
this.$notify({
|
title: '添加失败',
|
message: '请勿重复添加物料',
|
type: 'error'
|
})
|
isAdded = true
|
return
|
}
|
});
|
if (!isAdded) {
|
this.materielList.push(res.content)
|
}
|
}
|
} else {
|
this.$notify({
|
title: '添加失败',
|
message: res.content,
|
type: 'error'
|
})
|
}
|
})
|
.catch((err) => {
|
console.log(err);
|
});
|
},
|
// 获取产品的测试项目
|
onGetTestList: function () {
|
if (!this.proId) {
|
this.testList = []
|
return
|
}
|
var that = this;
|
var params = {
|
proId: this.proId
|
};
|
that
|
.$axiosAdmin({
|
method: "get",
|
url: "station/assemblyStep/getTestItems",
|
|
params: params,
|
})
|
.then((res) => {
|
if (res.success == true) {
|
res.content.forEach(item => {
|
item.result = null
|
})
|
that.testList = JSON.parse(JSON.stringify(res.content))
|
} else {
|
this.$notify({
|
title: '查询失败',
|
message: res.content,
|
type: 'error'
|
})
|
}
|
})
|
.catch((err) => {
|
console.log(err);
|
});
|
},
|
// 控制测试&品检项目条目的结果
|
handleListItem: function (data) {
|
this.testList.forEach(item => {
|
if (item.id == data.id) {
|
item.result = !item.result
|
}
|
})
|
},
|
// 控制测试&品检项目条目的结果勾选
|
handleListItemNull: function (data) {
|
this.testList.forEach(item => {
|
if (item.id == data.id) {
|
item.result = null
|
}
|
})
|
},
|
// 删除物料
|
handleDelMateriel: function (index) {
|
this.materielList.splice(index, 1)
|
},
|
// 添加人员
|
handleAddPeople: function (assistant) {
|
var that = this;
|
var params = {
|
workId: this.workId,
|
assistant: assistant
|
};
|
that
|
.$axiosAdmin({
|
method: "post",
|
url: "station/workOrder/addAssistant",
|
params: params,
|
})
|
.then((res) => {
|
if (res.success) {
|
this.$notify({
|
title: '添加成功',
|
message: `已成功添加辅助人员`,
|
type: 'success'
|
})
|
this.onGetAssistantsList()
|
} else {
|
this.$notify({
|
title: '添加失败',
|
message: res.content,
|
type: 'error'
|
})
|
}
|
})
|
.catch((err) => {
|
console.log(err);
|
});
|
},
|
// 删除人员
|
handleDelPeople: function (item) {
|
var that = this;
|
var params = {
|
workId: this.workId,
|
assistant: item.id
|
};
|
that
|
.$axiosAdmin({
|
method: "post",
|
url: "station/workOrder/removeAssistant",
|
params: params,
|
})
|
.then((res) => {
|
if (res.success) {
|
this.$notify({
|
title: '删除成功',
|
message: `已成功删除辅助人员`,
|
type: 'success'
|
})
|
this.onGetAssistantsList()
|
} else {
|
this.$notify({
|
title: '添加失败',
|
message: res.content,
|
type: 'error'
|
})
|
}
|
})
|
.catch((err) => {
|
console.log(err);
|
});
|
},
|
// 获取辅助人员列表
|
onGetAssistantsList: function () {
|
var that = this;
|
var params = {
|
workId: this.workId
|
};
|
that
|
.$axiosAdmin({
|
method: "get",
|
url: "station/workOrder/getAssistantList",
|
params: params,
|
})
|
.then((res) => {
|
if (res.success == true) {
|
this.assistantsList = res.content
|
}
|
})
|
.catch((err) => {
|
console.log(err);
|
});
|
},
|
// 获取作业指导书
|
onGetSop: function () {
|
var that = this;
|
var params = {
|
nodeId: this.nodeId
|
};
|
that
|
.$axiosAdmin({
|
method: "get",
|
url: "station/assemblyStep/getSopByNodeId",
|
params: params,
|
})
|
.then((res) => {
|
if (res.success == true) {
|
this.sop = res.content.instruction.webUrl
|
this.sopList = []
|
this.sopList.push(res.content.instruction.webUrl)
|
}
|
})
|
},
|
// 获取技术文档
|
onGetDocumentsList: function (val) {
|
var that = this;
|
var params = {
|
proId: this.proId
|
};
|
that
|
.$axiosAdmin({
|
method: "get",
|
url: "station/assemblyStep/getFileByProId",
|
params: params,
|
})
|
.then((res) => {
|
if (res.success == true) {
|
this.documentsList = res.content
|
} else {
|
this.documentsList = []
|
}
|
})
|
.catch((err) => {
|
console.log(err);
|
});
|
},
|
// 获取产品参数列表
|
onGetParamsList: function (val) {
|
var that = this;
|
var params = {
|
proId: this.proId
|
};
|
that
|
.$axiosAdmin({
|
method: "get",
|
url: "station/assemblyStep/getParamsByProId",
|
params: params,
|
})
|
.then((res) => {
|
if (res.success == true) {
|
this.paramsList = res.content
|
} else {
|
this.paramsList = []
|
}
|
})
|
.catch((err) => {
|
console.log(err);
|
});
|
},
|
// 结束工作
|
onFinishWork: function () {
|
var that = this;
|
this.$alert.show({
|
modelTitle: "结束工作",
|
modelContent: '确认后将退出工作状态,是否结束当前工作?',
|
callBack: () => {
|
that
|
.$axiosAdmin({
|
method: "post",
|
url: "station/workOrder/logout",
|
params: {
|
workId: localStorage.getItem('workId'),
|
},
|
})
|
.then((res) => {
|
if (res.success == true) {
|
this.$notify({
|
title: '结束工作成功',
|
message: `已退出工作台,请重新认领工作任务。`,
|
type: 'success'
|
})
|
this.goto('start')
|
localStorage.clear()
|
} else {
|
this.$notify({
|
title: '结束工作失败',
|
message: res.content,
|
type: 'error'
|
})
|
}
|
})
|
.catch((err) => {
|
console.log(err);
|
});
|
},
|
cancleBack: () => {
|
this.$alert.close()
|
this.$bus.$off('scanResult')
|
this.$bus.$on('scanResult', (val) => {
|
console.log('[test] 总线接收 =>', val)
|
this.handleScanVal(val)
|
})
|
}
|
})
|
},
|
// 打开文件
|
handleOpenOffice: function (file) {
|
this.file = file
|
this.showFile = true
|
},
|
// 关闭文件
|
handleCloseOffice: function () {
|
this.showFile = false
|
this.file = {
|
webUrl: null,
|
orgName: null,
|
extName: null
|
}
|
},
|
// 重置测试项
|
onResetTestList: function () {
|
this.testList.forEach(item => {
|
item.result = null
|
})
|
},
|
// 确认提交信息
|
handleSubmit: function (val) {
|
if (val == '102008') {
|
var msg = '为合格'
|
} else if (val == '102004') {
|
var msg = '为不合格'
|
}
|
this.$alert.show({
|
modelTitle: "提交已扫描信息",
|
modelContent: `确认后将提交并记录当前设备测试结果${msg},是否确认?`,
|
callBack: () => {
|
this.$bus.$off('scanResult')
|
this.$bus.$on('scanResult', (val) => {
|
this.handleScanVal(val)
|
})
|
this.onSubmit(val)
|
},
|
cancleBack: () => {
|
this.$bus.$off('scanResult')
|
this.$bus.$on('scanResult', (val) => {
|
this.handleScanVal(val)
|
})
|
this.$notify({
|
title: '用户已取消',
|
message: `取消提交已扫描信息`,
|
type: 'success'
|
})
|
}
|
})
|
},
|
// 执行提交信息
|
onSubmit: function (status) {
|
var that = this;
|
var data = {
|
deviceNo: this.deviceNo,
|
workId: this.workId,
|
status: status,
|
errorMsg: this.errorMsg,
|
};
|
that
|
.$axiosAdmin({
|
method: "post",
|
url: "station/assemblyStep/testing",
|
data: JSON.stringify(data),
|
})
|
.then((res) => {
|
if (res.success == true) {
|
this.$notify({
|
title: '提交成功',
|
message: `提交当前设备测试结果成功`,
|
type: 'success'
|
})
|
this.deviceInfo = null
|
if (!this.nodeId) {this.proId = null}
|
|
} else {
|
this.$notify({
|
title: '提交失败',
|
message: res.content,
|
type: 'error'
|
})
|
}
|
})
|
.catch((err) => {
|
console.log(err);
|
});
|
},
|
// 确认取消
|
handleCancel: function (val) {
|
this.$alert.show({
|
modelTitle: "清空已扫描信息",
|
modelContent: '确认后将清空并重置当前测试内容,是否确认?',
|
callBack: () => {
|
this.$bus.$off('scanResult')
|
this.$bus.$on('scanResult', (val) => {
|
this.handleScanVal(val)
|
})
|
this.onCancel()
|
},
|
cancleBack: () => {
|
this.$bus.$off('scanResult')
|
this.$bus.$on('scanResult', (val) => {
|
this.handleScanVal(val)
|
})
|
this.$notify({
|
title: '用户已取消',
|
message: `取消清空已扫描信息`,
|
type: 'success'
|
})
|
}
|
})
|
},
|
// 执行取消
|
onCancel: function () {
|
this.deviceInfo = null
|
if (!this.nodeId) {this.proId = null}
|
this.testList.forEach((item) => {
|
item.result = null
|
})
|
},
|
// 查看追踪信息
|
handleTrack: function (title, item) {
|
this.showTrack = true
|
this.trackTitle = `${item.proName} ${item.deviceNo} ${title}`
|
var that = this;
|
var params = {
|
deviceNo: item.deviceNo
|
};
|
if (title == '生产日志') {
|
var url = "station/assemblyStep/queryLogByDeviceNo"
|
}
|
if (title == '生命周期') {
|
var url = "station/assemblyStep/queryLifeByDeviceNo"
|
}
|
that
|
.$axiosAdmin({
|
method: "get",
|
url: url,
|
params: params,
|
})
|
.then((res) => {
|
if (res.success == true) {
|
that.trackList = res.content
|
} else {
|
this.$notify({
|
title: '查询失败',
|
message: res.content,
|
type: 'error'
|
})
|
}
|
})
|
.catch((err) => {
|
console.log(err);
|
});
|
},
|
// 关闭追踪信息
|
handleCloseTrack: function () {
|
this.showTrack = false
|
this.trackTitle = null
|
},
|
// 产看追踪信息详情
|
handleTrackItem: function (item) {
|
this.trackItem = item
|
this.showTrackItem = true
|
},
|
// 关闭追踪信息详情
|
handleCloseTrackItem: function () {
|
this.trackItem = null
|
this.showTrackItem = false
|
},
|
|
},
|
};
|
</script>
|
|
<style lang="less" scope>
|
.test {
|
height: 100%;
|
display: flex;
|
flex-direction: column;
|
overflow: hidden;
|
// 主菜单
|
.menu {
|
border-bottom: 1px solid #0089ff;
|
display: flex;
|
justify-content: space-between;
|
margin-bottom: 30px;
|
|
// 主菜单左侧标题栏
|
.menu-left {
|
display: flex;
|
|
.menu-left-name {
|
padding: 0 20px 0 30px;
|
border-radius: 10px 0 0 0;
|
height: 40px;
|
line-height: 40px;
|
background-color: #0089ff;
|
font-size: 20px;
|
}
|
|
.menu-left-triangle {
|
margin-left: -1px;
|
width: 30px;
|
height: 40px;
|
background: linear-gradient(60deg, #0089ff 50%, transparent 50%, transparent 100%);
|
}
|
}
|
|
// 主菜单右侧按钮栏
|
.menu-right {
|
display: flex;
|
|
// 主菜单右侧按钮栏按钮
|
.menu-right-item {
|
margin-left: 15px;
|
padding: 0 15px;
|
border-radius: 10px 10px 0 0;
|
height: 40px;
|
line-height: 40px;
|
background-color: #0089ff;
|
font-size: 20px;
|
}
|
}
|
}
|
// 主内容
|
.content {
|
flex-grow: 1;
|
display: flex;
|
justify-content: space-between;
|
|
// 主内容的tab栏
|
.tab {
|
height: 100%;
|
width: 150.4px;
|
display: flex;
|
flex-direction: column;
|
justify-content: space-between;
|
|
// 主内容的tab栏的tab项
|
.tab-item {
|
height: 150px;
|
border-radius: 10px;
|
background-color: #003366;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
justify-content: center;
|
|
i {
|
font-size: 50px;
|
margin-bottom: 10px;
|
}
|
|
span {
|
font-size: 20px;
|
}
|
}
|
|
// 主内容的tab栏的tab项的激活状态
|
.tab-item-active {
|
background-color: #0089ff;
|
}
|
}
|
|
// 主内容的panel栏
|
.panel {
|
width: 1680px;
|
height: 872px;
|
|
// 主内容的panel栏的panel项
|
.panel-item {
|
width: 100%;
|
height: 100%;
|
background-color: #003366;
|
border-radius: 10px;
|
box-sizing: border-box;
|
overflow: hidden;
|
|
.title {
|
display: block;
|
font-size: 26px;
|
text-align: center;
|
height: 80px;
|
line-height: 80px;
|
border-bottom: 1px solid #002244;
|
box-sizing: border-box;
|
font-weight: 700;
|
}
|
|
.device-item {
|
display: flex;
|
font-size: 22px;
|
height: 80px;
|
line-height: 80px;
|
border-bottom: 1px solid #002244;
|
box-sizing: border-box;
|
|
.null {
|
width: 100%;
|
text-align: center;
|
}
|
|
.sort {
|
margin-left: 30px;
|
width: 100px;
|
}
|
|
.code {
|
flex-grow: 1;
|
}
|
|
.name {
|
width: 200px;
|
}
|
|
.model {
|
width: 200px;
|
}
|
|
.log {
|
width: 200px;
|
text-align: center;
|
}
|
|
.life {
|
width: 200px;
|
text-align: center;
|
}
|
|
.del {
|
width: 150px;
|
margin-right: 30px;
|
text-align: right;
|
}
|
.select {
|
width: 150px;
|
margin-right: 30px;
|
text-align: center;
|
}
|
.result{
|
width: 150px;
|
margin-right: 30px;
|
text-align: center;
|
}
|
.result-content {
|
box-sizing: border-box;
|
margin-top: 10px;
|
height: 60px;
|
line-height: 56px;
|
border-radius: 10px;
|
width: 150px;
|
margin-right: 30px;
|
text-align: center;
|
}
|
.true {
|
font-weight: 700;
|
border: 2px solid #00ff73;
|
color: #00ff73;
|
}
|
.false {
|
font-weight: 700;
|
border: 2px solid #ff2c2c;
|
color: #ff2c2c;
|
}
|
.null {
|
font-weight: 700;
|
border: 2px solid #7e7e7e;
|
color: #7e7e7e;
|
}
|
}
|
|
.device-main {
|
background-color: rgba(102, 206, 60, 0.2);
|
}
|
}
|
|
// 工作台面板
|
.console {
|
display: flex;
|
flex-direction: column;
|
|
.tltle {
|
text-align: left;
|
}
|
|
.device-list {
|
flex-grow: 1;
|
background-color: #10477e;
|
overflow: scroll;
|
scrollbar-width: none;
|
/* Firefox */
|
-ms-overflow-style: none;
|
|
/* IE 10+ */
|
.device-item:nth-child(odd) {
|
background-color: rgba(0, 0, 0, .2);
|
}
|
}
|
|
.device-list::-webkit-scrollbar {
|
display: none;
|
/* Chrome Safari */
|
}
|
|
.button-wrap {
|
display: flex;
|
height: 80px;
|
line-height: 80px;
|
font-size: 22px;
|
text-align: center;
|
border-top: 1px solid #002244;
|
|
.cancle {
|
width: 50%;
|
border-right: 1px solid #002244;
|
box-sizing: border-box;
|
}
|
|
.conformity {
|
width: 50%;
|
color: #00ca6c;
|
font-weight: 700;
|
}
|
.unconformity {
|
width: 50%;
|
border-right: 1px solid #002244;
|
color: #ff2c2c;
|
font-weight: 700;
|
}
|
}
|
}
|
|
// 作业人员面板
|
.people {
|
display: flex;
|
flex-direction: column;
|
|
.list {
|
flex-grow: 1;
|
flex-wrap: wrap;
|
overflow: scroll;
|
|
.list-item {
|
margin: 30px 0 0 30px;
|
background-color: blue;
|
width: calc(25% - 37.5px);
|
height: 200px;
|
border-radius: 10px;
|
float: left;
|
display: flex;
|
justify-content: flex-start;
|
align-items: center;
|
position: relative;
|
|
.logo {
|
font-size: 100px;
|
margin: 0 30px;
|
}
|
|
.name {
|
font-weight: 700;
|
font-size: 30px;
|
}
|
|
.type {
|
font-size: 22px;
|
font-weight: normal;
|
}
|
|
.userId {
|
font-size: 16px;
|
font-weight: normal;
|
}
|
|
.del {
|
display: block;
|
width: 60px;
|
height: 60px;
|
line-height: 60px;
|
text-align: center;
|
// background-color: red;
|
position: absolute;
|
top: 0;
|
right: 0;
|
}
|
}
|
|
.list-item:last-child {
|
margin-bottom: 30px;
|
}
|
}
|
}
|
|
// 技术参数面板
|
.params,
|
.documents {
|
display: flex;
|
flex-direction: column;
|
|
.list {
|
flex-grow: 1;
|
overflow: scroll;
|
|
.name {
|
margin-left: 30px;
|
width: 300px;
|
}
|
}
|
|
.documents-item {
|
display: flex;
|
font-size: 24px;
|
height: 80px;
|
line-height: 80px;
|
border-bottom: 1px solid #002244;
|
|
.sort {
|
width: 100px;
|
margin-left: 30px;
|
}
|
|
.name {
|
flex-grow: 1;
|
margin-left: 0 !important;
|
}
|
|
.type {
|
width: 200px;
|
}
|
|
.open {
|
width: 200px;
|
text-align: right;
|
margin-right: 30px;
|
}
|
|
.null {
|
width: 100%;
|
text-align: center;
|
}
|
}
|
}
|
|
// 预置指令
|
.test {
|
display: flex;
|
flex-direction: row;
|
justify-content: space-between;
|
align-items: center;
|
.command {
|
width: 500px;
|
height: 100%;
|
background-color: red;
|
}
|
.message {
|
background-color: blueviolet;
|
height: 100%;
|
flex-grow: 1;
|
}
|
}
|
}
|
}
|
}
|
.scrollList {
|
overflow: scroll;
|
scrollbar-width: none;
|
/* Firefox */
|
-ms-overflow-style: none;
|
/* IE 10+ */
|
}
|
.scrollList::-webkit-scrollbar {
|
display: none;
|
/* Chrome Safari */
|
}
|
.office {
|
position: relative;
|
.none {
|
width: 800px;
|
height: 450px;
|
line-height: 450px;
|
text-align: center;
|
font-size: 30px;
|
}
|
.orgName {
|
font-size: 30px;
|
height: 80px;
|
line-height: 80px;
|
margin-left: 30px;
|
}
|
.close {
|
position: absolute;
|
display: block;
|
width: 80px;
|
height: 80px;
|
line-height: 80px;
|
text-align: center;
|
font-size: 30px;
|
right: 0;
|
top: 0;
|
color: #fff;
|
}
|
}
|
.track {
|
width: 1920px;
|
height: 1080px;
|
background-color: #003366;
|
position: relative;
|
.none {
|
width: 100%;
|
height: 450px;
|
line-height: 450px;
|
text-align: center;
|
font-size: 30px;
|
}
|
.title {
|
padding-left: 30px;
|
box-sizing: border-box;
|
font-size: 30px;
|
height: 80px;
|
line-height: 80px;
|
border-bottom: 1px solid #002244;
|
}
|
.close {
|
position: absolute;
|
display: block;
|
width: 80px;
|
height: 80px;
|
line-height: 80px;
|
text-align: center;
|
font-size: 30px;
|
right: 0;
|
top: 0;
|
color: #fff;
|
}
|
.track-list {
|
height: 920px;
|
overflow: scroll;
|
}
|
.track-item {
|
font-size: 24px;
|
height: 80px;
|
line-height: 80px;
|
border-bottom: 1px solid #002244;
|
box-sizing: border-box;
|
padding: 0 30px;
|
display: flex;
|
justify-content: space-between;
|
.index {
|
width: 100px;
|
}
|
.content {
|
flex-flow: 1;
|
}
|
.status {
|
width: 150px;
|
text-align: center;
|
span {
|
display: inline-block;
|
padding: 0 20px;
|
height: 40px;
|
line-height: 40px;
|
text-align: center;
|
border-radius: 10px;
|
}
|
}
|
.result {
|
width: 250px;
|
text-align: center;
|
span {
|
padding: 0 20px;
|
display: inline-block;
|
height: 40px;
|
line-height: 40px;
|
text-align: center;
|
border-radius: 10px;
|
}
|
}
|
.name {
|
width: 150px;
|
}
|
.names {
|
width: 200px;
|
}
|
.date {
|
width: 300px;
|
text-align: right;
|
overflow: hidden;
|
}
|
}
|
}
|
.track-detail {
|
width: 1300px;
|
height: 728px;
|
background-color: #003366;
|
position: relative;
|
.title {
|
padding-left: 30px;
|
box-sizing: border-box;
|
font-size: 30px;
|
height: 80px;
|
line-height: 80px;
|
border-bottom: 1px solid #002244;
|
}
|
.close {
|
position: absolute;
|
display: block;
|
width: 80px;
|
height: 80px;
|
line-height: 80px;
|
text-align: center;
|
font-size: 30px;
|
right: 0;
|
top: 0;
|
color: #fff;
|
}
|
.track-detail-list {
|
height: calc(100% - 80px);
|
}
|
.track-detail-content {
|
padding: 0 30px;
|
font-size: 24px;
|
min-height: 80px;
|
line-height: 80px;
|
border-bottom: 1px solid #002244;
|
display: flex;
|
.key {
|
width: 240px;
|
}
|
.val {
|
padding: 15px 0;
|
width: 1000px;
|
word-wrap: break-word;
|
word-break: normal;
|
display: flex;
|
align-items: center;
|
line-height: 1.2;
|
span {
|
display: inline-block;
|
padding: 0 20px;
|
height: 40px;
|
line-height: 40px;
|
text-align: center;
|
border-radius: 10px;
|
}
|
}
|
}
|
}
|
</style>
|
|