|
@@ -0,0 +1,543 @@
|
|
|
+<template>
|
|
|
+ <div
|
|
|
+ id="playerMap"
|
|
|
+ ref="playerMap"
|
|
|
+ class="app-container yunMapDiv"
|
|
|
+ style="height: 200%"
|
|
|
+ >
|
|
|
+ <!-- 全屏 -->
|
|
|
+ <el-row :gutter="20" class="rowCls">
|
|
|
+ <div class="headerBg">
|
|
|
+ <h2>现场工控端</h2>
|
|
|
+ <div class="battonDiv">
|
|
|
+ <el-tooltip
|
|
|
+ v-if="!isFullSreen"
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ :content="$t('largeScreen.common.screening')"
|
|
|
+ placement="top-start"
|
|
|
+ >
|
|
|
+ <a @click="fullPing()"><i class="el-icon-full-screen"></i></a>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip
|
|
|
+ v-else
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ :content="$t('largeScreen.common.cancel')"
|
|
|
+ placement="top-start"
|
|
|
+ >
|
|
|
+ <a @click="exitFullPing()"><i class="el-icon-switch-button"></i></a>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- 区域模块 -->
|
|
|
+ <div style="text-align: left; margin-left: 5%">
|
|
|
+ <!-- 搜索-部分 -->
|
|
|
+ <div class="defaultRow noBorder" style="margin-left: 2%;z-index:9999;">
|
|
|
+ <el-select
|
|
|
+ v-model="currentStationId"
|
|
|
+ :span="2"
|
|
|
+ @change="selectChange"
|
|
|
+ :placeholder="$t('common.pleaseSelect')"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in options"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ <span :span="2" style="margin-left: 2%" v-if="false">
|
|
|
+ <el-button
|
|
|
+ plain
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-view"
|
|
|
+ size="medium"
|
|
|
+ @click="readView"
|
|
|
+ >
|
|
|
+ 读RFID
|
|
|
+ </el-button>
|
|
|
+ </span>
|
|
|
+ <span :span="2" style="margin-right: 5%; float: right">
|
|
|
+ <el-button
|
|
|
+ plain
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-view"
|
|
|
+ size="medium"
|
|
|
+ @click="navigator"
|
|
|
+ >
|
|
|
+ 我的班表
|
|
|
+ </el-button>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-tabs style="text-align: left; margin-top: 25px;z-index:10;" @tab-click="tabClick">
|
|
|
+ <el-tab-pane label="未完成">
|
|
|
+ <span class="tabTitle" slot="label"
|
|
|
+ ><el-badge :value="taskCount" class="badge"
|
|
|
+ ><i class="el-icon-date"></i> 未完成</el-badge
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ <el-col
|
|
|
+ :span="11"
|
|
|
+ :gutter="24"
|
|
|
+ v-for="(item, index) in taskData.slice(0, 2)"
|
|
|
+ :key="item.id"
|
|
|
+ :offset="index == 0 ? 0 : 1"
|
|
|
+ v-show="item.status < 3 ? true : false"
|
|
|
+ style="zoom:1;min-width:300px;"
|
|
|
+ >
|
|
|
+ <el-card :gutter="24" class="box-card" style="margin: 5px" >
|
|
|
+ <div class="card_content" >
|
|
|
+ <el-tag effect="dark" style="float:right;" v-if="item.deviceName" >{{ item.deviceName }}</el-tag>
|
|
|
+ <div class="block card_header" @click="view(item)">
|
|
|
+ <el-image
|
|
|
+ style="
|
|
|
+ width: 90px;
|
|
|
+ height: 80px;
|
|
|
+ max-width: 200%;
|
|
|
+ max-height: 200%;
|
|
|
+ "
|
|
|
+ :src="resolveLogo('status' + (index + 1) + '.png')"
|
|
|
+ fit="fill"
|
|
|
+ >
|
|
|
+ </el-image>
|
|
|
+
|
|
|
+ <span style="text-align: center;"><h2>{{ item.name }}</h2></span>
|
|
|
+ <div class="itemNo" style="margin-top: 10px" >编号: {{ item.code }}</div>
|
|
|
+ </div>
|
|
|
+ <el-form style="margin-top: 10px">
|
|
|
+ <el-form-item label="产线名称:">
|
|
|
+ <span>{{ currentStationName }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备在线:">
|
|
|
+ <span>{{ item.onlineStatus=="1"? "在线":"不在线" }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备可用:">
|
|
|
+ <span>{{ item.status=="1"? "可用":"不可用" }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="已完成">
|
|
|
+ <span class="tabTitle" slot="label">
|
|
|
+ <i class="el-icon-date"></i> 已完成
|
|
|
+ </span>
|
|
|
+ <div class="tableTransparent">
|
|
|
+ <el-table
|
|
|
+ style="height:100%;min-height:80px;"
|
|
|
+ :header-cell-style="{ background: '#1890ff', color: '#fff' }"
|
|
|
+ :key="tableKey"
|
|
|
+ ref="table"
|
|
|
+ v-loading="loading"
|
|
|
+ :data="tableData.records"
|
|
|
+ border
|
|
|
+ fit
|
|
|
+ row-key="id"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('common.serialNo')"
|
|
|
+ width="55px"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ {{
|
|
|
+ scope.$index +
|
|
|
+ (queryParams.current - 1) * queryParams.size +
|
|
|
+ 1
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="name" label="零件名称" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="procedureNo" label="工序号" width="80" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="procedureName" label="工序名称" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="ratedWorkHours" label="额定时间" width="100" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="activeTime" label="实际时间" width="100" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="startTime" label="开始时间" width="150" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="endTime" label="结束时间" width="150" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="completeBatchNo" label="零件批次" width="120" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="overTime" label="是否超时" width="100" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ {{ row.overTime>0 ? "是" : "否" }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="preResourceName" label="前序加工设备" width="150" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination
|
|
|
+ v-show="tableData.total > 0"
|
|
|
+ :limit.sync="queryParams.size"
|
|
|
+ :page.sync="queryParams.current"
|
|
|
+ :total="Number(tableData.total)"
|
|
|
+ @pagination="fetch"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 【查看】组件 -->
|
|
|
+ <task-view1
|
|
|
+ ref="view1"
|
|
|
+ :dialog-visible="view1Visible"
|
|
|
+ @close="viewClose"
|
|
|
+ @success="editSuccess"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+
|
|
|
+<script>
|
|
|
+// 【查看】组件
|
|
|
+import TaskView1 from "./components/View1";
|
|
|
+import { fullScreen, exitFullScreen, initQueryParams } from "@/utils/commons";
|
|
|
+import areaMgrApi from "@/api/resourceProductMgr/areaMgr"
|
|
|
+import stationMgrApi from "@/api/machiningClient/stationMgr";
|
|
|
+import taskMgrApi from "@/api/runManageCenter/taskMgr";
|
|
|
+import machiningClientApi from "@/api/machiningClient/machiningClient"
|
|
|
+import Pagination from "@/components/Pagination"
|
|
|
+export default {
|
|
|
+ name: "TouchScreen",
|
|
|
+ components: {Pagination, TaskView1},
|
|
|
+ props: {},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableKey: 0,
|
|
|
+ queryParams: initQueryParams({}),
|
|
|
+ options: [
|
|
|
+ ],
|
|
|
+ currentStationId: "",
|
|
|
+ currentStationName: "舱体类加工单元",
|
|
|
+ currentStationCode: "CT",
|
|
|
+ taskCount: "",
|
|
|
+ taskData: [
|
|
|
+ ],
|
|
|
+ current: 1,
|
|
|
+ timer: null,
|
|
|
+ confirmDisabled: true,
|
|
|
+ tenantViewVisible: false,
|
|
|
+ view1Visible: false,
|
|
|
+ isFullSreen: false, // 默认不全屏
|
|
|
+ loading: false,
|
|
|
+ uniqueCode: "",
|
|
|
+ tableData: {
|
|
|
+ total: 0
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
+ created() {
|
|
|
+ this.getAreaList();
|
|
|
+ this.getStation()
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ 'taskData': {
|
|
|
+ handler(val, oldVal) {
|
|
|
+ // 加载列表数据
|
|
|
+ if(oldVal.length>0 && val.length>0 && val[0].id!=oldVal[0].id){
|
|
|
+ //window.location.reload()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ currentUser() {
|
|
|
+ return this.$store.state.account.user;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ //setInterval(this.getStation, 2000);
|
|
|
+ //this.timerTask()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ tabClick(e){
|
|
|
+ console.log("被选择的tab:", e.index)
|
|
|
+ // 待执行-tab
|
|
|
+ if(e.index == 0){
|
|
|
+ this.getStation()
|
|
|
+ //this.timerTask()
|
|
|
+ }
|
|
|
+ // 已完成-tab
|
|
|
+ if(e.index == 1){
|
|
|
+ //this.clearTimer()
|
|
|
+ this.fetch()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 全屏
|
|
|
+ fullPing() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 显示【退出全屏】
|
|
|
+ this.isFullSreen = true;
|
|
|
+ // 如果是退出全屏
|
|
|
+ let $playerMap = this.$refs.playerMap;
|
|
|
+ if ($playerMap) {
|
|
|
+ fullScreen($playerMap);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //定时器处理
|
|
|
+ timerTask(){
|
|
|
+ let that = this
|
|
|
+ that.timer = setInterval(()=>{
|
|
|
+ this.getStation();
|
|
|
+ }, 10000)
|
|
|
+ },
|
|
|
+ clearTimer(){
|
|
|
+ if(this.timer){
|
|
|
+ clearInterval(this.timer)
|
|
|
+ this.timer = null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 退出全屏
|
|
|
+ exitFullPing() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 显示【全屏】
|
|
|
+ this.isFullSreen = false;
|
|
|
+ // 如果是全屏
|
|
|
+ exitFullScreen(document.getElementById("playerMap"));
|
|
|
+ });
|
|
|
+ },
|
|
|
+ selectChange(value) {
|
|
|
+ this.currentStationId = value
|
|
|
+ let current = this.options.filter(item=>item.id==value)[0]
|
|
|
+ this.currentStationName = current.name
|
|
|
+ this.currentStationCode = current.aka
|
|
|
+ this.getStation()
|
|
|
+ },
|
|
|
+ getStation() {
|
|
|
+ stationMgrApi.getJbwStation({ zoneCode:this.currentStationCode })
|
|
|
+ .then((res) => {
|
|
|
+ res = res.data;
|
|
|
+ if (res.isSuccess) {
|
|
|
+ if (res.data.length > 0) {
|
|
|
+ this.taskData = res.data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(()=>{});
|
|
|
+ },
|
|
|
+
|
|
|
+ readView() {
|
|
|
+ //this.tenantViewVisible = true
|
|
|
+ //this.$refs.view2.read(null)
|
|
|
+ let currentNode = this.taskData[0]
|
|
|
+ this.RFIDParams.taskId = currentNode.id
|
|
|
+ this.RFIDParams.taskNodeId = currentNode.taskNodeId
|
|
|
+ this.RFIDParams.data.positionIndex = this.currentStationName.substr(-1)
|
|
|
+ let that = this
|
|
|
+ machiningClientApi.read(this.RFIDParams).then(res => {
|
|
|
+ if(res.data.result!="false"){
|
|
|
+ this.$message({
|
|
|
+ message: "RFID: "+res.data.result,
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ that.uniqueCode = res.data.result
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: "获取RFID数据失败",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ showRFID(code) {
|
|
|
+ console.log(code);
|
|
|
+ },
|
|
|
+ resolveLogo(logo) {
|
|
|
+ return require(`@/assets/yunMap/${logo}`);
|
|
|
+ },
|
|
|
+ view (item) {
|
|
|
+ item.currentStationName = this.currentStationName
|
|
|
+ item.zoneId = this.currentStationId
|
|
|
+ this.$refs.view1.setTenant(item)
|
|
|
+ this.view1Visible = true
|
|
|
+
|
|
|
+ },
|
|
|
+ viewClose() {
|
|
|
+ this.view1Visible = false
|
|
|
+ },
|
|
|
+ editSuccess(){
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.getStation()
|
|
|
+ });
|
|
|
+ },
|
|
|
+ setPercentage(time, left) {
|
|
|
+ return this.formatGap(time, left)[0] > 100
|
|
|
+ ? 100
|
|
|
+ : this.formatGap(time, left)[0];
|
|
|
+ },
|
|
|
+ // 设置进度文本内容
|
|
|
+ setItemText(time, left) {
|
|
|
+ return () => {
|
|
|
+ return this.formatGap(time, left)[1];
|
|
|
+ };
|
|
|
+ },
|
|
|
+ //时间差转换
|
|
|
+ formatGap(time, left) {
|
|
|
+ return [Number(parseInt((100 * left) / time)), "剩余" + left + "分钟"];
|
|
|
+ },
|
|
|
+ getAreaList(){
|
|
|
+ areaMgrApi.getList().then(res => {
|
|
|
+ res = res.data
|
|
|
+ if(res.isSuccess){
|
|
|
+ this.options = res.data.filter(item=>item.no!='safeguard')
|
|
|
+ this.currentStationId = this.options[0].id
|
|
|
+ this.currentStationCode = this.options[0].aka
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ fetch(params = {}) {
|
|
|
+ this.loading = true
|
|
|
+ if (this.queryParams.timeRange) {
|
|
|
+ this.queryParams.map.deliveryTime_st = this.queryParams.timeRange[0]
|
|
|
+ this.queryParams.map.deliveryTime_ed = this.queryParams.timeRange[1]
|
|
|
+ }
|
|
|
+
|
|
|
+ this.queryParams.current = params.current ? params.current : this.queryParams.current
|
|
|
+ this.queryParams.size = params.size ? params.size : this.queryParams.size
|
|
|
+
|
|
|
+ this.queryParams.model.updateUser = this.$store.state.account.user.id
|
|
|
+ this.queryParams.model.resourceId = this.currentStationId
|
|
|
+
|
|
|
+ taskMgrApi.getFinishList(this.queryParams).then(response => {
|
|
|
+ const res = response.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.tableData = res.data
|
|
|
+ console.log(this.tableData)
|
|
|
+ // 给列表设置条数
|
|
|
+ this.$emit('setTabNums', res.data.total, 'tab2')
|
|
|
+ }
|
|
|
+ // eslint-disable-next-line no-return-assign
|
|
|
+ }).finally(() => this.loading = false)
|
|
|
+ },
|
|
|
+ getFullTime(date) {
|
|
|
+ var yy = date.getFullYear(); //年
|
|
|
+ var mm = date.getMonth() + 1; //月
|
|
|
+ var dd = date.getDate(); //日
|
|
|
+ var hh = date.getHours(); //时
|
|
|
+ var ii = date.getMinutes(); //分
|
|
|
+ var ss = date.getSeconds(); //秒
|
|
|
+ var clock = yy + "-";
|
|
|
+ if (mm < 10) clock += "0";
|
|
|
+ clock += mm + "-";
|
|
|
+ if (dd < 10) clock += "0";
|
|
|
+ clock += dd + " ";
|
|
|
+ if (hh < 10) clock += "0";
|
|
|
+ clock += hh + ":";
|
|
|
+ if (ii < 10) clock += "0";
|
|
|
+ clock += ii + ":";
|
|
|
+ if (ss < 10) clock += "0";
|
|
|
+ clock += ss;
|
|
|
+ return clock;
|
|
|
+ },
|
|
|
+ navigator() {
|
|
|
+ this.$router.push("/classScheduleMgr/classScheduleMgr");
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.tabDiv {
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ .battonDiv {
|
|
|
+ z-index: 9;
|
|
|
+ }
|
|
|
+}
|
|
|
+.tabTitle {
|
|
|
+ font-size: 24px;
|
|
|
+ height: 24px;
|
|
|
+ line-height: 24px;
|
|
|
+}
|
|
|
+.card_content {
|
|
|
+ padding: 8px;
|
|
|
+ width: 100%;
|
|
|
+ text-align: left;
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+.card_header {
|
|
|
+ position: relative;
|
|
|
+ border-bottom: 1px solid #fff;
|
|
|
+ margin: 10px 0;
|
|
|
+}
|
|
|
+.indexNo {
|
|
|
+ position: absolute;
|
|
|
+ top: 25%;
|
|
|
+ left: 9%;
|
|
|
+ font-size: 24px;
|
|
|
+ line-height: 24px;
|
|
|
+ height: 24px;
|
|
|
+ color: #fff;
|
|
|
+ z-index: 999;
|
|
|
+}
|
|
|
+.indexNo2 {
|
|
|
+ position: absolute;
|
|
|
+ top: 25%;
|
|
|
+ left: 6%;
|
|
|
+ font-size: 24px;
|
|
|
+ line-height: 24px;
|
|
|
+ height: 24px;
|
|
|
+ color: #fff;
|
|
|
+ z-index: 999;
|
|
|
+}
|
|
|
+.itemNo {
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 12px;
|
|
|
+ height: 12px;
|
|
|
+ text-align: right;
|
|
|
+ color: #fff;
|
|
|
+ margin-left: 20%;
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+.timeprogress >>> .el-progress-bar__outer {
|
|
|
+ background-color: #1890ff;
|
|
|
+}
|
|
|
+.timeprogress .el-progress-bar__inner {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.el-form-item >>> .el-form-item__label {
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+.el-form-item {
|
|
|
+ margin-bottom: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.tabTitle >>> .el-badge {
|
|
|
+ position: relative;
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: baseline;
|
|
|
+}
|
|
|
+.badge {
|
|
|
+ margin-top: 10px;
|
|
|
+ margin-right: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.tableTransparent >>> .el-table,
|
|
|
+.el-table__expanded-cell {
|
|
|
+ background-color: transparent;
|
|
|
+}
|
|
|
+</style>
|