| | |
| | | <div class="roadway-section"> |
| | | <h2 class="roadway-title">{{ Area.roadwayNo }} 第1å··é第1æ(ä¸é¢:å>å)</h2> |
| | | <div class="row" v-for="(item, index) in locationData.row1" :key="'row1-' + index"> |
| | | <div class="location-cell" :style="{ 'background-color': GetBgColor(column) }" |
| | | v-for="(column, colIndex) in item.locationObj" :key="'row1-' + item.layer + '-' + colIndex" |
| | | @mouseenter="showTooltip(column, $event)" @mouseleave="hideTooltip"> |
| | | {{ getRoadwayNo(column) }}-{{ column.column }}-{{ column.layer }} |
| | | <div |
| | | class="location-cell" |
| | | :class="{ 'empty-cell': column.location_lock === -1 }" |
| | | :style="{ 'background-color': column.location_lock === -1 ? 'transparent' : GetBgColor(column) }" |
| | | v-for="(column, colIndex) in item.locationObj" |
| | | :key="'row1-' + item.layer + '-' + colIndex" |
| | | @mouseenter="column.location_lock !== -1 && showTooltip(column, $event)" |
| | | @mouseleave="hideTooltip"> |
| | | <span v-if="column.location_lock !== -1">{{ getRoadwayNo(column) }}-{{ column.column }}-{{ column.layer }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="roadway-section"> |
| | | <h2 class="roadway-title">{{ Area.roadwayNo }} 第1å··é第2æ(西é¢:å>å)</h2> |
| | | <div class="row" v-for="(item, index) in locationData.row2" :key="'row2-' + index"> |
| | | <div class="location-cell" :style="{ 'background-color': GetBgColor(column) }" |
| | | v-for="(column, colIndex) in item.locationObj" :key="'row2-' + item.layer + '-' + colIndex" |
| | | @mouseenter="showTooltip(column, $event)" @mouseleave="hideTooltip"> |
| | | {{ getRoadwayNo(column) }}-{{ column.column }}-{{ column.layer }} |
| | | <div |
| | | class="location-cell" |
| | | :class="{ 'empty-cell': column.location_lock === -1 }" |
| | | :style="{ 'background-color': column.location_lock === -1 ? 'transparent' : GetBgColor(column) }" |
| | | v-for="(column, colIndex) in item.locationObj" |
| | | :key="'row2-' + item.layer + '-' + colIndex" |
| | | @mouseenter="column.location_lock !== -1 && showTooltip(column, $event)" |
| | | @mouseleave="hideTooltip"> |
| | | <span v-if="column.location_lock !== -1">{{ getRoadwayNo(column) }}-{{ column.column }}-{{ column.layer }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <!-- åæåºæ¾ç¤ºå
容 --> |
| | | <div v-if="Area.warehouse === 'åæåº'"> |
| | | <p><strong>纸å·:</strong><span>{{ currentLocation.paperRoll || "æ " }}</span></p> |
| | | <p><strong>é¨å¹
:</strong><span>{{ currentLocation.width ? currentLocation.width + "m" : "æ " }}</span></p> |
| | | <p><strong>é¨å¹
:</strong><span>{{ currentLocation.width ? currentLocation.width : "æ " }}</span></p> |
| | | <p><strong>æ¡ç :</strong><span>{{ currentLocation.barcode || "æ " }}</span></p> |
| | | <p><strong>RFID:</strong><span>{{ currentLocation.rfid || "æ " }}</span></p> |
| | | </div> |
| | |
| | | if (x.data) { |
| | | this.locationData = x.data; |
| | | |
| | | // 对第1ææ°æ®è¿è¡æåº |
| | | if (this.locationData.row1) { |
| | | // ç¡®ä¿è´§ä½æåå·æåºå¹¶è®¡ç®æå¤§åæ°ï¼ç¨äºå¯¹é½ |
| | | const ensureColumnsAlignment = (rowData) => { |
| | | if (!rowData || rowData.length === 0) return; |
| | | |
| | | // æå±å·ä»é«å°ä½æåº |
| | | this.locationData.row1.sort((a, b) => parseInt(b.layer) - parseInt(a.layer)); |
| | | |
| | | // 对æ¯å±å
çè´§ä½æåå·ä»åå°åæåºï¼01-64ï¼ |
| | | this.locationData.row1.forEach(layer => { |
| | | rowData.sort((a, b) => parseInt(b.layer) - parseInt(a.layer)); |
| | | |
| | | // ç¡®å®æå¤§åæ°ï¼å设æ¯64åï¼ä»01-64ï¼ |
| | | const maxColumns = 64; |
| | | |
| | | // å¤çæ¯å±æ°æ® |
| | | rowData.forEach(layer => { |
| | | // 对æ¯å±å
çè´§ä½æåå·ä»åå°åæåºï¼01-64ï¼ |
| | | layer.locationObj.sort((a, b) => { |
| | | // ç¡®ä¿åå·ææ°åé¡ºåºæå |
| | | const colA = parseInt(a.column); |
| | | const colB = parseInt(b.column); |
| | | return colA - colB; |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | // 对第2ææ°æ®è¿è¡åæ ·çæåº |
| | | if (this.locationData.row2) { |
| | | // æå±å·ä»é«å°ä½æåº |
| | | this.locationData.row2.sort((a, b) => parseInt(b.layer) - parseInt(a.layer)); |
| | | |
| | | // 对æ¯å±å
çè´§ä½æåå·ä»åå°åæåºï¼01-64ï¼ |
| | | this.locationData.row2.forEach(layer => { |
| | | layer.locationObj.sort((a, b) => { |
| | | // ç¡®ä¿åå·ææ°åé¡ºåºæå |
| | | const colA = parseInt(a.column); |
| | | const colB = parseInt(b.column); |
| | | return colA - colB; |
| | | |
| | | // åå»ºå®æ´çåæ°ç» |
| | | const completeColumns = []; |
| | | |
| | | // å½åå·²æçè´§ä½ï¼æåå·æ å° |
| | | const existingLocations = {}; |
| | | layer.locationObj.forEach(loc => { |
| | | existingLocations[parseInt(loc.column)] = loc; |
| | | }); |
| | | |
| | | // éåææå¯è½çåå·ï¼1-64ï¼ |
| | | for (let col = 1; col <= maxColumns; col++) { |
| | | if (existingLocations[col]) { |
| | | // å¦æè¯¥åæè´§ä½æ°æ®ï¼ç´æ¥ä½¿ç¨ |
| | | completeColumns.push(existingLocations[col]); |
| | | } else { |
| | | // å¦æè¯¥åæ²¡æè´§ä½æ°æ®ï¼æ·»å 空å ä½ç¬¦ |
| | | completeColumns.push({ |
| | | locationCode: `empty-${layer.row}-${String(col).padStart(2, '0')}-${layer.layer}`, |
| | | row: layer.row, |
| | | column: String(col).padStart(2, '0'), |
| | | layer: layer.layer, |
| | | location_lock: -1, // ç¹æ®æ è®°ï¼ç¨äºè¡¨ç¤ºç©ºå ä½ç¬¦ |
| | | paperRoll: '', |
| | | productName: '', |
| | | width: 0, |
| | | quantity: 0, |
| | | barcode: '', |
| | | rfid: '', |
| | | rfidCode: '', |
| | | inDate: null, |
| | | warehouseId: layer.warehouseId || 0 |
| | | }); |
| | | } |
| | | } |
| | | |
| | | // æ´æ°è¯¥å±çè´§ä½æ°æ®ä¸ºå®æ´å |
| | | layer.locationObj = completeColumns; |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // å¤ç第1ææ°æ® |
| | | ensureColumnsAlignment(this.locationData.row1); |
| | | |
| | | // å¤ç第2ææ°æ® |
| | | ensureColumnsAlignment(this.locationData.row2); |
| | | } |
| | | |
| | | // æåææè´§ä½ç¼å· |
| | |
| | | margin-bottom: 8px; |
| | | cursor: pointer; |
| | | flex-wrap: nowrap; |
| | | width: 100%; |
| | | min-width: max-content; |
| | | } |
| | | |
| | | .location-cell { |
| | | width: 120px; |
| | | flex: 0 0 120px; |
| | | height: 50px; |
| | | margin: 5px; |
| | | text-align: center; |
| | | font-size: 16px; |
| | | border-radius: 4px; |
| | |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); |
| | | border: 1px solid #ccc; |
| | | background-color: #f9f9f9; |
| | | margin: 0 5px; |
| | | } |
| | | |
| | | /* 空å ä½ç¬¦æ ·å¼ */ |
| | | .location-cell.empty-cell { |
| | | background-color: transparent; |
| | | border: none; |
| | | box-shadow: none; |
| | | cursor: default; |
| | | } |
| | | |
| | | /* æ·»å è´§ä½ç½æ ¼å®¹å¨æ ·å¼ï¼ç¡®ä¿ææè¡å¯¹é½ */ |
| | | .roadway-section { |
| | | overflow-x: auto; |
| | | overflow-y: hidden; |
| | | } |
| | | |
| | | .location-cell { |
| | | width: 120px; |
| | | height: 50px; |
| | | text-align: center; |
| | | font-size: 16px; |
| | | border-radius: 4px; |
| | | line-height: 50px; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); |
| | | border: 1px solid #ccc; |
| | | background-color: #f9f9f9; |
| | | margin: 0; |
| | | } |
| | | |
| | | /* å··éåºåæ ·å¼ */ |