| | |
| | | <div style="width: 100%;">输送监控</div> |
| | | <div style="width: 100%;text-align: right;display: flex;"><el-input size="mini" v-model="searchStationId" placeholder="请输入站号"></el-input><el-button @click="getDevpStateInfo" size="mini">查询</el-button></div> |
| | | </div> |
| | | <div style="margin-bottom: 10px;"> |
| | | <div style="margin-bottom: 10px;" v-if="!readOnly"> |
| | | <div style="margin-bottom: 5px;"> |
| | | <el-button v-if="showControl" @click="openControl" size="mini">关闭控制中心</el-button> |
| | | <el-button v-else @click="openControl" size="mini">打开控制中心</el-button> |
| | |
| | | <el-descriptions-item label="可出">{{ item.outEnable ? 'Y' : 'N' }}</el-descriptions-item> |
| | | <el-descriptions-item label="空板信号">{{ item.emptyMk ? 'Y' : 'N' }}</el-descriptions-item> |
| | | <el-descriptions-item label="满板信号">{{ item.fullPlt ? 'Y' : 'N' }}</el-descriptions-item> |
| | | <el-descriptions-item label="运行阻塞">{{ item.runBlock ? 'Y' : 'N' }}</el-descriptions-item> |
| | | <el-descriptions-item label="启动入库">{{ item.enableIn ? 'Y' : 'N' }}</el-descriptions-item> |
| | | <el-descriptions-item label="托盘高度">{{ item.palletHeight }}</el-descriptions-item> |
| | | <el-descriptions-item label="条码">{{ item.barcode }}</el-descriptions-item> |
| | | <el-descriptions-item label="重量">{{ item.weight }}</el-descriptions-item> |
| | | <el-descriptions-item label="故障代码">{{ item.error }}</el-descriptions-item> |
| | | <el-descriptions-item label="故障信息">{{ item.errorMsg }}</el-descriptions-item> |
| | | <el-descriptions-item label="扩展数据">{{ item.extend }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | </el-collapse-item> |
| | | </el-collapse-item> |
| | | </el-collapse> |
| | | </div> |
| | | <div style="display:flex; justify-content:flex-end; margin-top:8px;"> |
| | |
| | | </div> |
| | | </div> |
| | | `, |
| | | props: ["param"], |
| | | props: { |
| | | param: { |
| | | type: Object, |
| | | default: () => ({}) |
| | | }, |
| | | autoRefresh: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | readOnly: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | stationList: [], |
| | | fullStationList: [], |
| | | activeNames: "", |
| | | searchStationId: "", |
| | | showControl: false, |
| | |
| | | }, |
| | | pageSize: 25, |
| | | currentPage: 1, |
| | | timer: null |
| | | }; |
| | | }, |
| | | created() { |
| | | setInterval(() => { |
| | | this.getDevpStateInfo(); |
| | | }, 1000); |
| | | if (this.autoRefresh) { |
| | | this.timer = setInterval(() => { |
| | | this.getDevpStateInfo(); |
| | | }, 1000); |
| | | } |
| | | }, |
| | | beforeDestroy() { |
| | | if (this.timer) { |
| | | clearInterval(this.timer); |
| | | } |
| | | }, |
| | | computed: { |
| | | displayStationList() { |
| | |
| | | watch: { |
| | | param: { |
| | | handler(newVal, oldVal) { |
| | | if (newVal.stationId != 0) { |
| | | if (newVal && newVal.stationId && newVal.stationId != 0) { |
| | | this.activeNames = newVal.stationId; |
| | | this.searchStationId = newVal.stationId; |
| | | } |
| | |
| | | this.currentPage = 1; |
| | | }, |
| | | getDevpStateInfo() { |
| | | let that = this; |
| | | $.ajax({ |
| | | url: baseUrl + "/console/latest/data/station", |
| | | headers: { |
| | | token: localStorage.getItem("token"), |
| | | }, |
| | | method: "post", |
| | | success: (res) => { |
| | | // 堆垛机信息表获取 |
| | | if (res.code == 200) { |
| | | let list = res.data; |
| | | |
| | | if (that.searchStationId == "") { |
| | | that.stationList = list; |
| | | } else { |
| | | let tmp = []; |
| | | list.forEach((item) => { |
| | | if (item.stationId == that.searchStationId) { |
| | | tmp.push(item); |
| | | } |
| | | }); |
| | | that.stationList = tmp; |
| | | that.currentPage = 1; |
| | | } |
| | | if (this.readOnly) { |
| | | // Frontend filtering for readOnly mode |
| | | if (this.searchStationId == "") { |
| | | this.stationList = this.fullStationList; |
| | | } else { |
| | | this.stationList = this.fullStationList.filter(item => item.stationId == this.searchStationId); |
| | | this.currentPage = 1; |
| | | } |
| | | }, |
| | | }); |
| | | } else if (this.$root.sendWs) { |
| | | this.$root.sendWs(JSON.stringify({ |
| | | "url": "/console/latest/data/station", |
| | | "data": {} |
| | | })); |
| | | } |
| | | }, |
| | | setStationList(res) { |
| | | let that = this; |
| | | if (res.code == 200) { |
| | | let list = res.data; |
| | | that.fullStationList = list; |
| | | if (that.searchStationId == "") { |
| | | that.stationList = list; |
| | | } else { |
| | | let tmp = []; |
| | | list.forEach((item) => { |
| | | if (item.stationId == that.searchStationId) { |
| | | tmp.push(item); |
| | | } |
| | | }); |
| | | that.stationList = tmp; |
| | | that.currentPage = 1; |
| | | } |
| | | } |
| | | }, |
| | | openControl() { |
| | | this.showControl = !this.showControl; |