| | |
| | | return ''; // é»è®¤æ é¢è² |
| | | }, |
| | | isMaterialShortage(row) { |
| | | // å¤æç©ææ¯å¦ç¼ºæï¼ä¸ä¸»é¡µé¢é»è¾ä¿æä¸è´ |
| | | // æç»ç¶æä¸º3表示缺æï¼æisLackMaterial为true/"æ¯" |
| | | return row.outSGOrderDetailStatus === 3 || |
| | | (row.isLackMaterial && (typeof row.isLackMaterial === 'boolean' ? row.isLackMaterial : row.isLackMaterial === 'æ¯')); |
| | | // 夿å½åè¡ç©ææ¯å¦ç¼ºæï¼åªæ ¹æ®å½åè¡çæç»ç¶æå¤æ |
| | | // æç»ç¶æä¸º3表示缺æï¼æ¯ææ°ååå符串类å |
| | | const status = parseInt(row.outSGOrderDetailStatus); |
| | | return status === 3; |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | class="full-width"> |
| | | <el-option v-for="item in warehouseList" :value="item" :label="item" :key="item"></el-option> |
| | | </el-select> |
| | | <h4>è´§ä½æ</h4> |
| | | <el-select size="mini" @change="SCChange" v-model="Area.row" placeholder="è¯·éæ©æ" class="full-width"> |
| | | <el-option v-for="item in scList" :value="item" :label="'第' + item + 'æ'" :key="item"></el-option> |
| | | <h4>å··é</h4> |
| | | <el-select size="mini" @change="SCChange" v-model="Area.roadwayNo" placeholder="è¯·éæ©å··é" class="full-width"> |
| | | <el-option v-for="item in scList" :value="item" :label="item" :key="item"></el-option> |
| | | </el-select> |
| | | <el-button type="success" class="refresh-btn" @click="GetViewData"> |
| | | å·æ° |
| | |
| | | |
| | | <!-- è´§ä½å±ç¤ºåºå --> |
| | | <div v-if="loading" class="loading-container"> |
| | | <el-icon class="is-loading"> |
| | | <Loading /> |
| | | </el-icon> |
| | | <span>å è½½ä¸...</span> |
| | | </div> |
| | | |
| | | <div v-else-if="locationData.length === 0" class="empty-container"> |
| | | <div |
| | | v-else-if="(!locationData.row1 || locationData.row1.length === 0) && (!locationData.row2 || locationData.row2.length === 0)" |
| | | class="empty-container"> |
| | | <el-empty description="ææ æ°æ®" /> |
| | | </div> |
| | | |
| | | <div v-else> |
| | | <div class="location-view"> |
| | | <div class="layer-container" v-for="(item, index) in locationData" :key="index"> |
| | | <h3 class="layer-title">第{{ item.layer }}å±</h3> |
| | | <div class="row"> |
| | | <!-- 第1æï¼ä¸é¢ï¼ --> |
| | | <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, index) in item.locationObj" :key="index" @mouseenter="showTooltip(column, $event)" |
| | | @mouseleave="hideTooltip"> |
| | | {{ column.row }}-{{ column.column }}-{{ column.layer }} |
| | | 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> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 第2æï¼è¥¿é¢ï¼ --> |
| | | <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> |
| | | </div> |
| | | </div> |
| | |
| | | top: tooltipPosition.y + 'px', |
| | | }"> |
| | | <div v-if="currentLocation"> |
| | | <p><strong>ä»åº:</strong>{{ Area.warehouse || "æªéæ©" }}</p> |
| | | <p><strong>è´§ä½å·:</strong>{{ currentLocation.locationCode }}</p> |
| | | <!-- <p><strong>æç®±å·:</strong>{{ currentLocation.barCode ? currentLocation.barCode : "æ æç®±" }}</p> --> |
| | | <p><strong>ä»åº:</strong><span>{{ Area.warehouse || "æªéæ©" }}</span></p> |
| | | <p><strong>è´§ä½å·:</strong><span>{{ currentLocation.locationCode }}</span></p> |
| | | <!-- æ ¹æ®ä»åºç±»åæ¾ç¤ºä¸åçæ ç¾åå
容 --> |
| | | <p v-if="Area.warehouse === 'åæåº'"> |
| | | <strong>RFID:</strong>{{ this.rfidData[currentLocation.locationCode] || "æ " }} |
| | | </p> |
| | | <p v-else-if="Area.warehouse === 'æååº'"> |
| | | <strong>æçå·:</strong>{{ this.rfidData[currentLocation.locationCode] || "æ " }} |
| | | </p> |
| | | <p v-else> |
| | | <strong>æ è¯:</strong>{{ this.rfidData[currentLocation.locationCode] || "æ " }} |
| | | </p> |
| | | <!-- åæåºæ¾ç¤ºå
容 --> |
| | | <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.barcode || "æ " }}</span></p> |
| | | <p><strong>RFID:</strong><span>{{ currentLocation.rfid || "æ " }}</span></p> |
| | | </div> |
| | | <!-- æååºæ¾ç¤ºå
容 --> |
| | | <div v-else-if="Area.warehouse === 'æååº'"> |
| | | <p><strong>æååç§°:</strong><span>{{ currentLocation.productName || currentLocation.paperRoll || "æ " }}</span></p> |
| | | <p><strong>æåæ°é:</strong><span>{{ currentLocation.quantity || currentLocation.width || "æ " }}</span></p> |
| | | <p><strong>æçå·:</strong><span>{{ currentLocation.rfid || currentLocation.rfidCode || |
| | | this.rfidData[currentLocation.locationCode] || "æ " }}</span></p> |
| | | </div> |
| | | <p> |
| | | <strong>æåå±:</strong> {{ currentLocation.row }}æ{{ |
| | | currentLocation.column |
| | | }}å{{ currentLocation.layer }}å± |
| | | <strong>æåå±:</strong> <span>{{ currentLocation.row }}æ{{ currentLocation.column }}å{{ currentLocation.layer |
| | | }}å±</span> |
| | | </p> |
| | | <p><strong>ç¶æ:</strong> {{ getStatusText(currentLocation) }}</p> |
| | | <!-- <p> |
| | | <strong>ç¦ç¨:</strong> |
| | | {{ currentLocation.location_lock == 3 ? "æ¯" : "å¦" }} |
| | | </p> --> |
| | | <!-- <p v-if="currentLocation.location_state > 0"> |
| | | <strong>ç©æç¼ç :</strong> |
| | | {{ currentLocation.material_code || "æ " }} |
| | | </p> |
| | | <p v-if="currentLocation.location_state > 0"> |
| | | <strong>æ°é:</strong> {{ currentLocation.quantity || "æ " }} |
| | | </p> --> |
| | | <p><strong>ç¶æ:</strong> <span>{{ getStatusText(currentLocation) }}</span></p> |
| | | <p><strong>å
¥åºæ¥æ:</strong><span>{{ currentLocation.inDate ? new Date(currentLocation.inDate).toLocaleString() : |
| | | "æ " }}</span></p> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { ElButton, Loading } from "element-plus"; |
| | | import { ElButton } from "element-plus"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | slectData: [], |
| | | scList: [], |
| | | warehouseList: ["åæåº", "æååº"], |
| | | warehouseMap: { |
| | | "åæåº": 1, |
| | | "æååº": 2 |
| | | }, |
| | | Area: { |
| | | warehouse: "åæåº", |
| | | row: "", |
| | | shelf_code: "" |
| | | }, |
| | | mian_height: "", |
| | | loading: false, |
| | | infoMsg: [ |
| | | { bgcolor: "lightgreen", msg: "空é²", state: 0 }, |
| | | { bgcolor: "orange", msg: "æè´§", state: 100 }, |
| | | { bgcolor: "#2BB3D5", msg: "éå®", state: 1 }, |
| | | { bgcolor: "yellow", msg: "空é²éå®", state: 20 }, |
| | | { bgcolor: "purple", msg: "æè´§éå®", state: 10 }, |
| | | ], |
| | | locationData: [], |
| | | showTooltipFlag: false, |
| | | currentLocation: null, |
| | | tooltipPosition: { x: 0, y: 0 }, |
| | | rfidData: {}, // åå¨è´§ä½ç¼å·ä¸RFIDçæ å°å
³ç³» |
| | | }; |
| | | }, |
| | | return { |
| | | slectData: [], |
| | | scList: [], |
| | | allRoadways: [], // ä¿åææå··éå表 |
| | | warehouseList: ["åæåº", "æååº"], |
| | | warehouseMap: { |
| | | "åæåº": 1, |
| | | "æååº": 2 |
| | | }, |
| | | // å··éç±»åæ å° |
| | | roadwayTypeMap: { |
| | | "åæåº": ["SC01_YL", "SC02_YL", "SC03_YLDual", "SC04_YLDual", "SC05_YLDual"], |
| | | "æååº": ["SC01_CP", "SC02_CP", "SC03_CP", "SC04_CP", "SC05_CP"] |
| | | }, |
| | | Area: { |
| | | warehouse: "åæåº", |
| | | roadwayNo: "", |
| | | shelf_code: "" |
| | | }, |
| | | mian_height: "", |
| | | loading: false, |
| | | infoMsg: [ |
| | | { bgcolor: "#f0f0f0", msg: "空é²", state: 0 }, |
| | | { bgcolor: "#90ee90", msg: "æè´§", state: 100 }, |
| | | { bgcolor: "#a0a0a0", msg: "空é²éå®", state: 20 }, |
| | | { bgcolor: "#228b22", msg: "æè´§éå®", state: 10 }, |
| | | { bgcolor: "#2BB3D5", msg: "ä¸ç¨è´§ä½", state: 3 }, |
| | | ], |
| | | locationData: [], |
| | | showTooltipFlag: false, |
| | | currentLocation: null, |
| | | tooltipPosition: { x: 0, y: 0 }, |
| | | rfidData: {}, // åå¨è´§ä½ç¼å·ä¸RFIDçæ å°å
³ç³» |
| | | }; |
| | | }, |
| | | computed: { |
| | | GetBgColor() { |
| | | return (col) => { |
| | | var bgColor = ""; |
| | | //ä¼å
æ¾ç¤ºç¦ç¨ç¶æ |
| | | if (col.location_lock > 0) { |
| | | this.infoMsg.forEach((el) => { |
| | | if (el.state === col.location_lock) { |
| | | bgColor = el.bgcolor; |
| | | } |
| | | }); |
| | | } |
| | | else { |
| | | return "lightgreen"; |
| | | //æ ¹æ®ç¶æè®¾ç½®é¢è² |
| | | switch (col.location_lock) { |
| | | case 0: //ç©ºé² |
| | | bgColor = "#f0f0f0"; //徿µ
ç° |
| | | break; |
| | | case 20: //空é²éå® |
| | | bgColor = "#a0a0a0"; //æ·±ç° |
| | | break; |
| | | case 100: //æè´§ |
| | | bgColor = "#90ee90"; //æµ
绿 |
| | | break; |
| | | case 10: //æè´§éå® |
| | | bgColor = "#228b22"; //深绿 |
| | | break; |
| | | case 3: //ä¸ç¨åºä½ |
| | | bgColor = "#2BB3D5"; //èè²(ä¸å) |
| | | break; |
| | | default: |
| | | bgColor = "#f0f0f0"; //é»è®¤å¾æµ
ç° |
| | | } |
| | | return bgColor; |
| | | }; |
| | |
| | | console.log("RFIDæ¥è¯¢APIè¿åç»æ:", response); |
| | | if (response.status && response.data) { |
| | | console.log(`æåè·å${response.data.length}æ¡RFIDè®°å½`); |
| | | // æ´æ°rfidDataæ å° |
| | | |
| | | // å°RFIDæ°æ®è½¬æ¢ä¸ºä»¥locationCode为é®çæ å° |
| | | const rfidDataMap = {}; |
| | | response.data.forEach((item, index) => { |
| | | try { |
| | | // æ£æ¥å段åï¼æ¯æå¤§å°åä¸¤ç§æ ¼å¼ |
| | | const locationCode = item.LocationCode || item.locationCode; |
| | | const rfidCode = item.RfidCode || item.rfidCode; |
| | | |
| | | if (item && locationCode !== undefined) { |
| | | console.log(`æ´æ°RFIDæ°æ®: ${locationCode} -> ${rfidCode}`); |
| | | this.rfidData[locationCode] = rfidCode; |
| | | rfidDataMap[locationCode] = { |
| | | paperRoll: item.PaperRoll || item.paperRoll || "", |
| | | productName: item.ProductName || item.productName || item.PaperRoll || item.paperRoll || "", // ä¼å
使ç¨ProductNameåæ®µ |
| | | width: item.Width || item.width || 0, |
| | | quantity: item.Quantity || item.quantity || item.Width || item.width || 0, // ä¼å
使ç¨Quantityåæ®µ |
| | | barcode: item.Barcode || item.barcode || "", |
| | | rfid: item.RfidCode || item.rfidCode || "", |
| | | rfidCode: item.RfidCode || item.rfidCode || "", // ç¡®ä¿rfidCodeåæ®µåå¨ |
| | | status: item.Status || item.status || 0, |
| | | inDate: item.InDate || item.inDate || null |
| | | }; |
| | | } else { |
| | | console.warn(`è·³è¿æ æçRFIDæ°æ®é¡¹(${index}):`, item); |
| | | } |
| | |
| | | console.error(`å¤çRFIDæ°æ®é¡¹(${index})æ¶åºé:`, error, item); |
| | | } |
| | | }); |
| | | console.log("æ´æ°åçrfidData:", this.rfidData); |
| | | |
| | | console.log("RFIDæ°æ®æ å°:", rfidDataMap); |
| | | |
| | | // æ´æ°è´§ä½æ°æ®ï¼å°RFIDä¿¡æ¯åå¹¶å°å¯¹åºçè´§ä½å¯¹è±¡ä¸ |
| | | |
| | | // å¤ç第1ææ°æ® |
| | | if (this.locationData.row1) { |
| | | this.locationData.row1.forEach(layer => { |
| | | layer.locationObj.forEach(location => { |
| | | const rfidInfo = rfidDataMap[location.locationCode]; |
| | | if (rfidInfo) { |
| | | // æ´æ°è´§ä½å¯¹è±¡çåæ®µ |
| | | location.paperRoll = rfidInfo.paperRoll; |
| | | location.productName = rfidInfo.productName; // æ°å¢æååç§°åæ®µ |
| | | location.width = rfidInfo.width; |
| | | location.quantity = rfidInfo.quantity; // æ°å¢æåæ°éåæ®µ |
| | | location.barcode = rfidInfo.barcode; |
| | | location.rfid = rfidInfo.rfid; |
| | | location.rfidCode = rfidInfo.rfidCode; // æ°å¢rfidCodeåæ®µ |
| | | location.status = rfidInfo.status; |
| | | location.inDate = rfidInfo.inDate; |
| | | // æ´æ°rfidDataæ å°ï¼ä¿æååå
¼å®¹ï¼ |
| | | this.rfidData[location.locationCode] = rfidInfo.rfid || rfidInfo.rfidCode; // 使ç¨rfidærfidCodeä½ä¸ºæçå· |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | // å¤ç第2ææ°æ® |
| | | if (this.locationData.row2) { |
| | | this.locationData.row2.forEach(layer => { |
| | | layer.locationObj.forEach(location => { |
| | | const rfidInfo = rfidDataMap[location.locationCode]; |
| | | if (rfidInfo) { |
| | | // æ´æ°è´§ä½å¯¹è±¡çåæ®µ |
| | | location.paperRoll = rfidInfo.paperRoll; |
| | | location.productName = rfidInfo.productName; // æ°å¢æååç§°åæ®µ |
| | | location.width = rfidInfo.width; |
| | | location.quantity = rfidInfo.quantity; // æ°å¢æåæ°éåæ®µ |
| | | location.barcode = rfidInfo.barcode; |
| | | location.rfid = rfidInfo.rfid; |
| | | location.rfidCode = rfidInfo.rfidCode; // æ°å¢rfidCodeåæ®µ |
| | | location.status = rfidInfo.status; |
| | | location.inDate = rfidInfo.inDate; |
| | | // æ´æ°rfidDataæ å°ï¼ä¿æååå
¼å®¹ï¼ |
| | | this.rfidData[location.locationCode] = rfidInfo.rfid || rfidInfo.rfidCode; // 使ç¨rfidærfidCodeä½ä¸ºæçå· |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | console.log("æ´æ°åçè´§ä½æ°æ®:", this.locationData); |
| | | } else { |
| | | console.log("RFIDæ¥è¯¢APIè¿åç¶æå¤±è´¥ææ°æ®ä¸ºç©º"); |
| | | } |
| | |
| | | |
| | | this.loading = true; |
| | | this.rfidData = {}; // æ¸
空ä¹åçRFIDæ°æ® |
| | | this.locationData = { row1: [], row2: [] }; // åå§åæ°çæ°æ®ç»æ |
| | | |
| | | let warehouseId = 0; |
| | | if (this.Area.warehouse) { |
| | |
| | | console.log(`å½åéæ©çä»åº: ${this.Area.warehouse}, 对åºçwarehouseId: ${warehouseId}`); |
| | | } |
| | | |
| | | console.log(`è°ç¨GetLocationStatus API: row=${_this.Area.row}, warehouseId=${warehouseId}`); |
| | | |
| | | console.log(`è°ç¨GetLocationStatus API: roadwayNo=${_this.Area.roadwayNo}, warehouseId=${warehouseId}`); |
| | | |
| | | this.http |
| | | .post(`/api/LocationInfo/GetLocationStatus?row=${_this.Area.row}&warehouseId=${warehouseId}`, {}, "æ¥è¯¢ä¸") |
| | | .post(`/api/LocationInfo/GetLocationStatus?roadwayNo=${_this.Area.roadwayNo}&warehouseId=${warehouseId}`, {}, "æ¥è¯¢ä¸") |
| | | .then((x) => { |
| | | console.log("GetLocationStatus APIè¿åç»æ:", x); |
| | | this.locationData = x.data || []; |
| | | |
| | | if (x.data) { |
| | | this.locationData = x.data; |
| | | |
| | | // 对第1ææ°æ®è¿è¡æåº |
| | | if (this.locationData.row1) { |
| | | // æå±å·ä»é«å°ä½æåº |
| | | this.locationData.row1.sort((a, b) => parseInt(b.layer) - parseInt(a.layer)); |
| | | |
| | | // 对æ¯å±å
çè´§ä½æåå·ä»åå°åæåºï¼01-64ï¼ |
| | | this.locationData.row1.forEach(layer => { |
| | | 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; |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | // æåææè´§ä½ç¼å· |
| | | let locationCodes = []; |
| | | this.locationData.forEach(layer => { |
| | | layer.locationObj.forEach(location => { |
| | | locationCodes.push(location.locationCode); |
| | | |
| | | // æå第1æè´§ä½ç¼å· |
| | | if (this.locationData.row1) { |
| | | this.locationData.row1.forEach(layer => { |
| | | layer.locationObj.forEach(location => { |
| | | locationCodes.push(location.locationCode); |
| | | // åå§åæ¯ä¸ªè´§ä½çRFIDç¸å
³å段 |
| | | if (!location.paperRoll) location.paperRoll = "æ "; |
| | | if (!location.productName) location.productName = "æ "; |
| | | if (!location.width) location.width = 0; |
| | | if (!location.quantity) location.quantity = 0; |
| | | if (!location.barcode) location.barcode = "æ "; |
| | | if (!location.rfid) location.rfid = "æ "; |
| | | if (!location.rfidCode) location.rfidCode = "æ "; |
| | | if (!location.inDate) location.inDate = null; |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | } |
| | | |
| | | // æå第2æè´§ä½ç¼å· |
| | | if (this.locationData.row2) { |
| | | this.locationData.row2.forEach(layer => { |
| | | layer.locationObj.forEach(location => { |
| | | locationCodes.push(location.locationCode); |
| | | // åå§åæ¯ä¸ªè´§ä½çRFIDç¸å
³å段 |
| | | if (!location.paperRoll) location.paperRoll = "æ "; |
| | | if (!location.productName) location.productName = "æ "; |
| | | if (!location.width) location.width = 0; |
| | | if (!location.quantity) location.quantity = 0; |
| | | if (!location.barcode) location.barcode = "æ "; |
| | | if (!location.rfid) location.rfid = "æ "; |
| | | if (!location.rfidCode) location.rfidCode = "æ "; |
| | | if (!location.inDate) location.inDate = null; |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | console.log(`ä»è´§ä½æ°æ®ä¸æåå°${locationCodes.length}个货ä½ç¼å·`); |
| | | console.log("æåçè´§ä½ç¼å·:", locationCodes); |
| | | |
| | | |
| | | // è°ç¨APIè·åRFIDä¿¡æ¯ |
| | | this.getRfidInfo(locationCodes, warehouseId); |
| | | }) |
| | |
| | | SCChange() { |
| | | this.GetViewData(); |
| | | }, |
| | | // æ ¹æ®ä»åºç±»åè¿æ»¤å··éå表 |
| | | filterRoadwaysByWarehouse(warehouse) { |
| | | const allowedRoadways = this.roadwayTypeMap[warehouse] || []; |
| | | this.scList = this.allRoadways.filter(roadway => allowedRoadways.includes(roadway)); |
| | | |
| | | // 妿å½åéä¸çå··éä¸å¨è¿æ»¤åçå表ä¸ï¼éç½®éæ© |
| | | if (this.Area.roadwayNo && !this.scList.includes(this.Area.roadwayNo)) { |
| | | this.Area.roadwayNo = this.scList[0] || ""; |
| | | } else if (!this.Area.roadwayNo && this.scList.length > 0) { |
| | | this.Area.roadwayNo = this.scList[0]; |
| | | } |
| | | }, |
| | | |
| | | // 忢ä»åº |
| | | onWarehouseChange() { |
| | | // 忢ä»åºæ¶éç½®æéæ© |
| | | // æ ¹æ®ä»åºç±»åè¿æ»¤å··éå表 |
| | | this.filterRoadwaysByWarehouse(this.Area.warehouse); |
| | | // éç½®æéæ©åè·åæ°æ® |
| | | this.GetViewData(); |
| | | }, |
| | | showTooltip(location, event) { |
| | |
| | | }, |
| | | |
| | | getStatusText(location) { |
| | | // if (location.location_lock === 3) return "ç¦ç¨"; |
| | | if (location.location_lock === 0) return "空é²"; |
| | | if (location.location_lock === 1) return "éå®"; |
| | | if (location.location_lock === 100) return "æè´§"; |
| | | if (location.location_lock === 20) return "空é²éå®"; |
| | | if (location.location_lock === 10) return "æè´§éå®"; |
| | | // if (location.location_state > 0 && location.location_state < 100) |
| | | // return "éå®"; |
| | | return "å
¶ä»"; |
| | | }, |
| | | getRoadwayNo(column) { |
| | | // æ ¹æ®ç¨æ·è¦æ±çè§åçææ ååå··éå· |
| | | // å··é/æï¼ä»ä¸å°è¥¿ 11ã12ã21ã22ã31ã32ã41ã42ã51ã52 |
| | | // åï¼ä»åå°å 01â64 |
| | | // å±ï¼01â10 |
| | | |
| | | if (column && column.locationCode && column.row) { |
| | | // æååå§å··éå·ï¼å¦SC01_YL |
| | | const locationCode = column.locationCode; |
| | | const row = column.row; |
| | | const originalRoadwayNo = locationCode.split('-')[0]; |
| | | |
| | | // æ ¹æ®åå§å··éå·åè¡å·æ å°å°æ ååå··éå· |
| | | const standardizedRoadwayMap = { |
| | | // åæåºå··éæ å° |
| | | // SC01_YL, 第1æ -> 11ï¼ç¬¬2æ -> 12 |
| | | 'SC01_YL': { |
| | | '01': '11', |
| | | '1': '11', |
| | | '02': '12', |
| | | '2': '12' |
| | | }, |
| | | // SC02_YL, 第1æ -> 21ï¼ç¬¬2æ -> 22 |
| | | 'SC02_YL': { |
| | | '01': '21', |
| | | '1': '21', |
| | | '02': '22', |
| | | '2': '22' |
| | | }, |
| | | // SC03_YLDual, 第1æ -> 31ï¼ç¬¬2æ -> 32 |
| | | 'SC03_YLDual': { |
| | | '01': '31', |
| | | '1': '31', |
| | | '02': '32', |
| | | '2': '32' |
| | | }, |
| | | // SC04_YLDual, 第1æ -> 41ï¼ç¬¬2æ -> 42 |
| | | 'SC04_YLDual': { |
| | | '01': '41', |
| | | '1': '41', |
| | | '02': '42', |
| | | '2': '42' |
| | | }, |
| | | // SC05_YLDual, 第1æ -> 51ï¼ç¬¬2æ -> 52 |
| | | 'SC05_YLDual': { |
| | | '01': '51', |
| | | '1': '51', |
| | | '02': '52', |
| | | '2': '52' |
| | | }, |
| | | // æååºå··éæ å° |
| | | // SC01_CP, 第1æ -> 11ï¼ç¬¬2æ -> 12 |
| | | 'SC01_CP': { |
| | | '01': '11', |
| | | '1': '11', |
| | | '02': '12', |
| | | '2': '12' |
| | | }, |
| | | // SC02_CP, 第1æ -> 21ï¼ç¬¬2æ -> 22 |
| | | 'SC02_CP': { |
| | | '01': '21', |
| | | '1': '21', |
| | | '02': '22', |
| | | '2': '22' |
| | | }, |
| | | // SC03_CP, 第1æ -> 31ï¼ç¬¬2æ -> 32 |
| | | 'SC03_CP': { |
| | | '01': '31', |
| | | '1': '31', |
| | | '02': '32', |
| | | '2': '32' |
| | | }, |
| | | // SC04_CP, 第1æ -> 41ï¼ç¬¬2æ -> 42 |
| | | 'SC04_CP': { |
| | | '01': '41', |
| | | '1': '41', |
| | | '02': '42', |
| | | '2': '42' |
| | | }, |
| | | // SC05_CP, 第1æ -> 51ï¼ç¬¬2æ -> 52 |
| | | 'SC05_CP': { |
| | | '01': '51', |
| | | '1': '51', |
| | | '02': '52', |
| | | '2': '52' |
| | | } |
| | | }; |
| | | |
| | | // ä»column.rowè·åè¡å·ï¼æ³¨æcolumn.rowæ¯å¸¦å导é¶çå符串 |
| | | const rowStr = row; |
| | | |
| | | // æ¥æ¾æ å° |
| | | if (standardizedRoadwayMap[originalRoadwayNo]) { |
| | | const rowMap = standardizedRoadwayMap[originalRoadwayNo]; |
| | | if (rowMap[rowStr]) { |
| | | return rowMap[rowStr]; |
| | | } |
| | | // å°è¯ä¸å¸¦å导é¶çæ
åµ |
| | | const rowStrWithoutZero = rowStr.replace(/^0/, ''); |
| | | if (rowMap[rowStrWithoutZero]) { |
| | | return rowMap[rowStrWithoutZero]; |
| | | } |
| | | } |
| | | |
| | | // å¦ææ²¡æå¹é
çæ å°ï¼è¿ååå§å··éå· |
| | | return originalRoadwayNo; |
| | | } |
| | | return ''; |
| | | }, |
| | | getWarehouseName(location) { |
| | | if (location.warehouseId === 1) return "åæåº"; |
| | | if (location.warehouseId === 2) return "æååº"; |
| | | return "æªç¥ä»åº"; |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | var mainHeight = document.getElementById("vol-main"); |
| | |
| | | var _this = this; |
| | | //å è½½ä¸æé项 |
| | | this.http.post("/api/LocationInfo/GetRow", {}, "æ¥è¯¢ä¸").then((x) => { |
| | | //å 载第ä¸ä¸ªåºåï¼ç¬¬ä¸æ |
| | | // _this.Area.shelf_code = _this.slectData[0].shelf_code; |
| | | _this.scList = x.data; |
| | | //ä¿åææå··é |
| | | _this.allRoadways = x.data; |
| | | //æ ¹æ®å½åä»åºç±»åè¿æ»¤å··é |
| | | _this.filterRoadwaysByWarehouse(_this.Area.warehouse); |
| | | if (_this.scList.length > 0) { |
| | | _this.Area.row = _this.scList[0]; |
| | | _this.Area.roadwayNo = _this.scList[0]; |
| | | } |
| | | _this.GetViewData(); |
| | | }); |
| | | }, |
| | | components: { ElButton, Loading }, |
| | | components: { ElButton } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .container { |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: 100%; |
| | | width: 100%; |
| | | padding: 10px; |
| | | } |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: 100%; |
| | | width: 100%; |
| | | padding: 10px; |
| | | } |
| | | |
| | | .header { |
| | | text-align: center; |
| | |
| | | } |
| | | |
| | | .location-view { |
| | | flex: 1; |
| | | width: 100%; |
| | | max-width: 100%; |
| | | overflow: auto; |
| | | padding: 10px; |
| | | background-color: white; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .layer-container { |
| | | margin-bottom: 25px; |
| | | } |
| | | |
| | | .layer-title { |
| | | margin: 0 0 10px 0; |
| | | font-size: 16px; |
| | | color: #333; |
| | | flex: 1; |
| | | width: 470%; |
| | | max-width: 470%; |
| | | overflow: auto; |
| | | padding: 20px; |
| | | background-color: #f5f7fa; |
| | | border-radius: 8px; |
| | | } |
| | | |
| | | .row { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | margin-bottom: 8px; |
| | | cursor: pointer; |
| | | flex-wrap: nowrap; |
| | | } |
| | | |
| | | .location-cell { |
| | | width: 85px; |
| | | height: 38px; |
| | | margin: 3px; |
| | | width: 120px; |
| | | height: 50px; |
| | | margin: 5px; |
| | | text-align: center; |
| | | font-size: 14px; |
| | | border-radius: 3px; |
| | | line-height: 38px; |
| | | box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); |
| | | 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; |
| | | } |
| | | |
| | | /* å··éåºåæ ·å¼ */ |
| | | .roadway-section { |
| | | margin-bottom: 40px; |
| | | padding: 20px; |
| | | background-color: white; |
| | | border-radius: 6px; |
| | | border: 1px solid #eaeaea; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); |
| | | } |
| | | |
| | | .roadway-title { |
| | | margin: 0 0 20px 0; |
| | | font-size: 24px; |
| | | font-weight: bold; |
| | | color: #2c3e50; |
| | | text-align: left; |
| | | padding-bottom: 15px; |
| | | border-bottom: 3px solid #409EFF; |
| | | } |
| | | |
| | | .location-tooltip { |
| | |
| | | background-color: white; |
| | | border: 1px solid #ddd; |
| | | border-radius: 4px; |
| | | padding: 10px; |
| | | padding: 12px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); |
| | | pointer-events: none; |
| | | max-width: 250px; |
| | | min-width: 280px; |
| | | max-width: 320px; |
| | | } |
| | | |
| | | .location-tooltip p { |
| | | margin: 5px 0; |
| | | font-size: 13px; |
| | | line-height: 1.4; |
| | | margin: 6px 0; |
| | | font-size: 14px; |
| | | line-height: 1.5; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .location-tooltip strong { |
| | | display: inline-block; |
| | | width: 70px; |
| | | color: #666; |
| | | width: 80px; |
| | | color: #555; |
| | | font-weight: 600; |
| | | text-align: right; |
| | | margin-right: 12px; |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .location-tooltip span { |
| | | display: inline-block; |
| | | color: #333; |
| | | font-weight: 500; |
| | | flex: 1; |
| | | text-align: left; |
| | | } |
| | | |
| | | .form-group { |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materialNos", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | formatter: (row) => { |
| | | const materialNos = row.materialNos; |
| | | if (!materialNos) return materialNos; |
| | | |
| | | // æå»ºç©æç¼ºæç¶ææ å° |
| | | const lackStatusMap = new Map(); |
| | | |
| | | // 注æï¼å段åå·²ç»è¢«è½¬æ¢ä¸ºé©¼å³°å½åæ³ |
| | | const statusField = row.materialLackStatus; |
| | | if (statusField) { |
| | | const statusPairs = statusField.split(','); |
| | | statusPairs.forEach(pair => { |
| | | const [materialNo, isLack] = pair.split(':'); |
| | | lackStatusMap.set(materialNo.trim(), isLack.trim() === 'true'); |
| | | }); |
| | | } |
| | | |
| | | // å¤çç©æç¼å·ï¼æ ¹æ®ç¶æè®¾ç½®é¢è² |
| | | const materialList = materialNos.split('/'); |
| | | const formattedMaterials = materialList.map(materialNo => { |
| | | field: "materialNos", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | formatter: (row) => { |
| | | const materialNos = row.materialNos; |
| | | if (!materialNos) return materialNos; |
| | | |
| | | // å¤çç©æç¼å·ï¼æ ¹æ®æ¯ä¸ªç©æçå®é
ç¶ææ¾ç¤ºé¢è² |
| | | const materialList = materialNos.split('/'); |
| | | let formattedMaterials = []; |
| | | |
| | | // 妿æç©æç¼ºæç¶æåç¬¦ä¸²ï¼æ ¹æ®æ¯ä¸ªç©æçç¶ææ¾ç¤ºé¢è² |
| | | if (row.materialLackStatus) { |
| | | // è§£æç©æç¼ºæç¶æå符串ï¼ç©æç¼å·:ç¶æ,ç©æç¼å·:ç¶æ |
| | | const statusPairs = row.materialLackStatus.split(','); |
| | | // è·åææç©æç缺æç¶æå表ï¼ä¿æåå§é¡ºåº |
| | | const lackStatusList = statusPairs.map(pair => { |
| | | const [, isLack] = pair.split(':'); |
| | | return isLack.trim() === 'true'; |
| | | }); |
| | | |
| | | // 为æ¯ä¸ªç©æç¼å·è®¾ç½®é¢è²ï¼ä¿æåå§é¡ºåº |
| | | formattedMaterials = materialList.map((materialNo, index) => { |
| | | const trimmedMaterialNo = materialNo.trim(); |
| | | const isLack = lackStatusMap.get(trimmedMaterialNo) || false; |
| | | const isLack = lackStatusList[index] || false; |
| | | if (isLack) { |
| | | return `<span style="color: red;">${trimmedMaterialNo}</span>`; |
| | | } |
| | | return trimmedMaterialNo; |
| | | }); |
| | | |
| | | return formattedMaterials.join('/'); |
| | | } |
| | | }, |
| | | { |
| | | field: "materialWides", |
| | | title: "å¹
宽", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | formatter: (row) => { |
| | | const value = row.materialWides; |
| | | if (value && typeof value === 'string') { |
| | | return value.replace(/\.\d+$/, ''); |
| | | } |
| | | return value; |
| | | } |
| | | }, |
| | | { |
| | | field: "isLackMaterial", |
| | | title: "æ¯å¦ç¼ºæ", |
| | | type: "string", |
| | | width: 100, |
| | | align: "center", |
| | | formatter: (row) => { |
| | | } else { |
| | | // å¦ææ²¡æç©æç¼ºæç¶æä¿¡æ¯ï¼ä½¿ç¨è®¢å级å«ç缺æç¶æ |
| | | const isLack = Boolean(row.isLackMaterial); |
| | | const text = isLack ? "æ¯" : "å¦"; |
| | | const bgColor = isLack ? '#ff4d4f' : '#52c41a'; |
| | | return `<div style="background-color: ${bgColor}; color: #ffffff; text-align: center; font-weight: bold; width: 100%; height: 100%; padding: 10px 0; display: flex; justify-content: center; align-items: center;">${text}</div>`; |
| | | if (isLack) { |
| | | return `<span style="color: red;">${materialNos}</span>`; |
| | | } |
| | | formattedMaterials = materialList; |
| | | } |
| | | }, |
| | | |
| | | return formattedMaterials.join('/'); |
| | | } |
| | | }, |
| | | { |
| | | field: "materialWides", |
| | | title: "å¹
宽", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | formatter: (row) => { |
| | | const value = row.materialWides; |
| | | if (value && typeof value === 'string') { |
| | | return value.replace(/\.\d+$/, ''); |
| | | } |
| | | return value; |
| | | } |
| | | }, |
| | | { |
| | | field: "boardFluteNos", |
| | | title: "æ¥å«", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left" |
| | | }, |
| | | { |
| | | field: "isLackMaterial", |
| | | title: "æ¯å¦ç¼ºæ", |
| | | type: "string", |
| | | width: 100, |
| | | align: "center", |
| | | formatter: (row) => { |
| | | const isLack = Boolean(row.isLackMaterial); |
| | | const text = isLack ? "æ¯" : "å¦"; |
| | | const bgColor = isLack ? '#ff4d4f' : '#52c41a'; |
| | | return `<div style="background-color: ${bgColor}; color: #ffffff; text-align: center; font-weight: bold; width: 100%; height: 100%; padding: 10px 0; display: flex; justify-content: center; align-items: center;">${text}</div>`; |
| | | } |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "åºåºæç»å", |
| | |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | required: true, |
| | | |
| | | |
| | | }, |
| | | { |
| | | field: "xqLen", |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/outbound/outSGOrderDetail.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "åºåºåæç»", |
| | | name: "outSGOrderDetail", |
| | | url: "/OutSGOrderDetail/", |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({ |
| | | deviceCode: "", |
| | | deviceName: "", |
| | | deviceType: "", |
| | | deviceStatus: "", |
| | | deviceIp: "", |
| | | devicePort: "", |
| | | devicePlcType: "", |
| | | deviceRemark: "", |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "设å¤ç¼å·", |
| | | required: true, |
| | | field: "deviceCode", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "设å¤åç§°", |
| | | required: true, |
| | | field: "deviceName", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "设å¤ç±»å", |
| | | required: true, |
| | | field: "deviceType", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "设å¤ç¶æ", |
| | | required: true, |
| | | field: "deviceStatus", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | [ |
| | | { title: "设å¤IP", required: true, field: "deviceIp", type: "string" }, |
| | | { |
| | | title: "设å¤ç«¯å£", |
| | | required: true, |
| | | field: "devicePort", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "PLCç±»å", |
| | | required: true, |
| | | field: "devicePlcType", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "夿³¨", |
| | | field: "deviceRemark", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | deviceCode: "", |
| | | deviceType: "", |
| | | deviceStatus: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "设å¤ç¼å·", field: "deviceCode" }, |
| | | { title: "设å¤ç±»å", field: "deviceType" }, |
| | | { title: "设å¤ç¶æ", field: "deviceStatus" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | align: "left", |
| | | }, |
| | | <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions" |
| | | :table="table" :extend="extend"> |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/outbound/outSGOrderDetail.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "åºåºåæç»", |
| | | name: "outSGOrderDetail", |
| | | url: "/OutSGOrderDetail/", |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({ |
| | | deviceCode: "", |
| | | deviceName: "", |
| | | deviceType: "", |
| | | deviceStatus: "", |
| | | deviceIp: "", |
| | | devicePort: "", |
| | | devicePlcType: "", |
| | | deviceRemark: "", |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | field: "outSGOrderId", |
| | | title: "åºåºå主é®", |
| | | title: "设å¤ç¼å·", |
| | | required: true, |
| | | field: "deviceCode", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "MaterialNo", |
| | | title: "ç©æç¼å·", |
| | | title: "设å¤åç§°", |
| | | required: true, |
| | | field: "deviceName", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielName", |
| | | title: "ç©æåç§°", |
| | | title: "设å¤ç±»å", |
| | | required: true, |
| | | field: "deviceType", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderQuantity", |
| | | title: "åæ®æ°é", |
| | | title: "设å¤ç¶æ", |
| | | required: true, |
| | | field: "deviceStatus", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | ], |
| | | [ |
| | | { title: "设å¤IP", required: true, field: "deviceIp", type: "string" }, |
| | | { |
| | | field: "lockQuantity", |
| | | title: "é宿°é", |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "overOutQuantity", |
| | | title: "å·²åºæ°é", |
| | | title: "设å¤ç«¯å£", |
| | | required: true, |
| | | field: "devicePort", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderDetailStatus", |
| | | title: "订åæç»ç¶æ", |
| | | title: "PLCç±»å", |
| | | required: true, |
| | | field: "devicePlcType", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | field: "deviceRemark", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "", |
| | | columns: [], |
| | | sortName: "", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | ], |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | deviceCode: "", |
| | | deviceType: "", |
| | | deviceStatus: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "设å¤ç¼å·", field: "deviceCode" }, |
| | | { title: "设å¤ç±»å", field: "deviceType" }, |
| | | { title: "设å¤ç¶æ", field: "deviceStatus" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "outSGOrderId", |
| | | title: "åºåºå主é®", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "MaterialNo", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielName", |
| | | title: "ç©æåç§°", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderQuantity", |
| | | title: "åæ®æ°é", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "lockQuantity", |
| | | title: "é宿°é", |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "overOutQuantity", |
| | | title: "å·²åºæ°é", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderDetailStatus", |
| | | title: "订åæç»ç¶æ", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "", |
| | | columns: [], |
| | | sortName: "", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | |
| | | using HslCommunication.WebSocket; |
| | | using HslCommunication.WebSocket; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using SqlSugar; |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢è´§ä½å¯¹åºçRFID |
| | | /// æ¥è¯¢è´§ä½å¯¹åºçRFIDååºåä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="locationCodes"></param> |
| | | /// <returns></returns> |
| | |
| | | |
| | | if (warehouseId == 1) |
| | | { |
| | | // æ¥è¯¢åæåºDt_StockInfo表ï¼è·åRFIDä¿¡æ¯ |
| | | // æ¥è¯¢åæåºDt_StockInfo表ï¼è·åRFIDååºåä¿¡æ¯ |
| | | var rawMaterialRfidList = _stockInfoRepository.QueryData() |
| | | .Where(x => locationCodes.Contains(x.LocationCode)) |
| | | .Select(x => new { x.LocationCode, x.RfidCode }) |
| | | .Select(x => new { |
| | | locationCode = x.LocationCode, |
| | | rfidCode = x.RfidCode, |
| | | paperRoll = x.MaterielName, // 纸å·åç§° |
| | | width = x.MaterielWide, // é¨å¹
ï¼å¹
å®½ï¼ |
| | | barcode = x.PalletCode, // çº¸å·æ¡ç |
| | | status = x.StockStatus, // ç¶æ |
| | | inDate = x.CreateDate // å
¥åºæ¶é´ï¼å建æ¶é´ï¼ |
| | | }) |
| | | .ToList(); |
| | | |
| | | var rfidList = rawMaterialRfidList.ToList(); |
| | | // è¿åç»æ |
| | | return WebResponseContent.Instance.OK(data: rfidList); |
| | | return WebResponseContent.Instance.OK(data: rawMaterialRfidList); |
| | | } |
| | | |
| | | if (warehouseId == 2) |
| | | { |
| | | // æ¥è¯¢æååºDt_ProStockInfo表ï¼è·åPalletCodeä¿¡æ¯ |
| | | var finishedProductRfidList =_proStockInfoRepository.QueryData() |
| | | // æ¿æ¢åæç .Select(x => new { ... Detail = x.proStockInfoDetails?.FirstOrDefault() ... }) 代ç å |
| | | var finishedProductRfidList = _proStockInfoRepository.Db.Queryable<Dt_ProStockInfo>() |
| | | .Includes(x => x.proStockInfoDetails) |
| | | .Where(x => locationCodes.Contains(x.LocationCode)) |
| | | .Select(x => new { x.LocationCode, RfidCode = x.PalletCode }) |
| | | .ToList() |
| | | .Select(x => new |
| | | { |
| | | locationCode = x.LocationCode, |
| | | rfidCode = x.PalletCode, |
| | | paperRoll = (x.proStockInfoDetails != null && x.proStockInfoDetails.Count > 0) ? x.proStockInfoDetails[0].ProductName : string.Empty, |
| | | productName = (x.proStockInfoDetails != null && x.proStockInfoDetails.Count > 0) ? x.proStockInfoDetails[0].ProductName : string.Empty, |
| | | width = (x.proStockInfoDetails != null && x.proStockInfoDetails.Count > 0) ? x.proStockInfoDetails[0].StockQty : 0, |
| | | quantity = (x.proStockInfoDetails != null && x.proStockInfoDetails.Count > 0) ? x.proStockInfoDetails[0].StockQty : 0, |
| | | barcode = x.PalletCode, |
| | | status = x.StockStatus, |
| | | inDate = x.CreateDate |
| | | }) |
| | | .ToList(); |
| | | |
| | | var rfidList = finishedProductRfidList.ToList(); |
| | | // è¿åç»æ |
| | | return WebResponseContent.Instance.OK(data: rfidList); |
| | | return WebResponseContent.Instance.OK(data: finishedProductRfidList); |
| | | } |
| | | // å¦ææ²¡æå¹é
çä»åºIDï¼è¿å空å表 |
| | | return WebResponseContent.Instance.OK(data: new List<object>()); |
| | |
| | | public string MaterialWides { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥å« |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true, ColumnDescription = "æ¥å«")] |
| | | public string BoardFluteNos { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¼ºæ |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true, ColumnDescription = "æ¯å¦ç¼ºæ")] |
| | |
| | | |
| | | } |
| | | |
| | | // åé
宿åï¼æ£æ¥æ¯ä¸ªè®¢åæç»çåé
æ
åµï¼è®¾ç½®æ£ç¡®çç¶æ |
| | | foreach (var detail in details) |
| | | { |
| | | decimal assignedQuantity = outStockLockInfos.Where(x => x.OrderDetailId == detail.Id).Sum(x => x.AssignQuantity); |
| | | if (assignedQuantity > 0) |
| | | { |
| | | // å·²ç»åé
å°åºåï¼æ 记为é缺æç¶æï¼æªå¼å§ï¼ |
| | | detail.OutSGOrderDetailStatus = OutOrderStatusEnum.æªå¼å§.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | // æªåé
å°åºåï¼æ 记为缺æ |
| | | detail.OutSGOrderDetailStatus = OutOrderStatusEnum.缺æ.ObjToInt(); |
| | | } |
| | | } |
| | | |
| | | locationInfos.AddRange(_basicRepository.LocationInfoRepository.GetLocationInfos(outStocks.Where(x=>!x.LocationCode.IsNullOrEmpty() && !locationInfos.Select(x=>x.LocationCode).Contains(x.LocationCode)).Select(x => x.LocationCode).ToList())); |
| | | |
| | | } |
| | | |
| | | return (outStocks, outboundOrderDetails, outStockLockInfos, locationInfos, message); |
| | |
| | | // è·åææè®¢åID |
| | | var orderIds = pageData.Rows.Select(o => o.Id).ToList(); |
| | | |
| | | // æ¹éæ¥è¯¢ææå
³èçæç»ï¼è¿æ»¤æç©æç¼å·ä¸ºç©ºçæ°æ® |
| | | // æ¹éæ¥è¯¢ææå
³èçæç»ï¼æOutSGOrderIdååºãIdéåºæåºï¼ä¸è®¢åæç»é¡µé¢ä¿æä¸è´ |
| | | var allDetails = BaseDal.Db.Queryable<Dt_OutSGOrderDetail>() |
| | | .Where(d => orderIds.Contains(d.OutSGOrderId)) |
| | | .OrderBy(d => d.OutSGOrderId) |
| | | .OrderByDescending(d => d.Id) |
| | | .ToList(); |
| | | |
| | | // æè®¢åIDåç» |
| | | var detailsByOrderId = allDetails.GroupBy(d => d.OutSGOrderId).ToDictionary(g => g.Key, g => g.ToList()); |
| | | // æè®¢åIDåç»ï¼æ¯ç»æç»æIdéåºæåºï¼ä¸è®¢åæç»é¡µé¢ä¿æä¸è´ |
| | | var detailsByOrderId = allDetails.GroupBy(d => d.OutSGOrderId) |
| | | .ToDictionary(g => g.Key, g => g.OrderByDescending(d => d.Id).ToList()); |
| | | |
| | | // å¤çæ¯ä¸ªè®¢å |
| | | foreach (var order in pageData.Rows) |
| | |
| | | ? uniqueWidths[0] |
| | | : string.Join("/", uniqueWidths); |
| | | |
| | | // 设置æ¥å«ï¼åªæ¾ç¤ºä¸ä¸ªï¼å ä¸ºæææ¥å«ç¸åï¼ |
| | | order.BoardFluteNos = details.FirstOrDefault()?.BoardFluteNo ?? ""; |
| | | |
| | | // 设置æ¯å¦ç¼ºæï¼å¦ææä»»ä½ä¸ä¸ªæç»æ¯ç¼ºæç¶æï¼å°±è®¾ç½®ä¸ºtrue |
| | | // å¼ç¨WIDESEA_Common.OrderEnumå½åç©ºé´æ¥ä½¿ç¨OutOrderStatusEnumæä¸¾ |
| | | order.IsLackMaterial = details.Any(d => d.OutSGOrderDetailStatus == 3); // 3æ¯ç¼ºæç¶æçæä¸¾å¼ |
| | |
| | | return ((char)Convert.ToInt32(match.Groups[1].Value, 16)).ToString(); |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// MESæå¨å«ææ¥å£ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent ReceiveManualIssue(MESManualIssueDTO manualIssueDTO) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | |
| | |  |
| | | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | taskType = outStockLockInfo.MachineName.ObjToInt() switch |
| | | { |
| | | (int)StationAreaEnum.äºæ¥¼çº¸è¢ => TaskTypeEnum.PaperYLOutZDGL, |
| | | (int)StationAreaEnum.äºæ¥¼æ 纺å¸è¢ => TaskTypeEnum.OutWFBGL, |
| | | (int)StationAreaEnum.䏿¥¼æ 纺æ·è => TaskTypeEnum.OutWFBLM, |
| | | (int)StationAreaEnum.䏿¥¼å°å· => TaskTypeEnum.PrintYLOutbound, |
| | | (int)StationAreaEnum.䏿¥¼åå => TaskTypeEnum.OutFenQie, |
| | | (int)StationAreaEnum.䏿¥¼çº¸å¼ æ·è => TaskTypeEnum.OutPaperLM, |
| | | _ => throw new Exception($"æªæ¾å°å å·¥ä¸å¿ä»»å¡ç±»ååé
") |
| | | }; |
| | | Dt_Task task = new() |
| | |
| | | } |
| | | content.Message = result.Item6; |
| | | //å¤çåºåºæ°æ® |
| | | return GenerateOutboundTaskDataUpdate(tasks, stockInfos, outSGOrderDetails, outStockLockInfos, locationInfos); |
| | | return GenerateOutboundTaskDataUpdate(tasks, stockInfos, outSGOrderDetails, outStockLockInfos, locationInfos, result.Item6); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | |
| | | //åé
åºå |
| | | (List<Dt_StockInfo>, List<Dt_OutSGOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>,string) result = _outboundService.OutSGOrderDetailService.AssignStockOutbound(outSGOrderDetails); |
| | | |
| | | //ä¿å缺æç¶æï¼æ 论æ¯å¦çæäºä»»å¡ |
| | | var shortageDetails = result.Item2.Where(x => x.OutSGOrderDetailStatus == OutOrderStatusEnum.缺æ.ObjToInt()).ToList(); |
| | | if (shortageDetails.Any()) |
| | | { |
| | | _outboundRepository.OutSGOrderDetailRepository.UpdateData(shortageDetails); |
| | | } |
| | | |
| | | if (result.Item1 != null && result.Item1.Count > 0) |
| | | { |
| | | //è·åä»»å¡ |
| | |
| | | } |
| | | else |
| | | { |
| | | throw new Exception("æ åºå"); |
| | | //没æåºåï¼ä½å·²ç»å¨AssignStockOutboundæ¹æ³ä¸æ è®°äºç¼ºæç¶æï¼å¹¶ä¸å·²ç»ä¿å |
| | | orderDetails = result.Item2; |
| | | } |
| | | |
| | | return (tasks, stockInfos, orderDetails, outStockLockInfos, locationInfos, result.Item5); |
| | |
| | | /// å¤çåºåºæ°æ® |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent GenerateOutboundTaskDataUpdate(List<Dt_Task> tasks, List<Dt_StockInfo>? stockInfos = null, List<Dt_OutSGOrderDetail>? outboundOrderDetails = null, List<Dt_OutStockLockInfo>? outStockLockInfos = null, List<Dt_LocationInfo>? locationInfos = null) |
| | | public WebResponseContent GenerateOutboundTaskDataUpdate(List<Dt_Task> tasks, List<Dt_StockInfo>? stockInfos = null, List<Dt_OutSGOrderDetail>? outboundOrderDetails = null, List<Dt_OutStockLockInfo>? outStockLockInfos = null, List<Dt_LocationInfo>? locationInfos = null, string message = "") |
| | | { |
| | | try |
| | | { |
| | |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | PushTasksToWCS(tasks); |
| | | return WebResponseContent.Instance.OK(); |
| | | return WebResponseContent.Instance.OK(message); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | _unitOfWorkManage.BeginTran(); |
| | | //æä½æ°æ®ï¼å¹¶åé
éæ±åºå |
| | | _outboundRepository.OutMESOrderRepository.AddData(AddoutMESOrders); |
| | | //List<Dt_OutMESOrder> mESOrders = _outboundRepository.OutMESOrderRepository.QueryData(x => AddoutMESOrders.Select(x => x.OutDetailId).Contains(x.OutDetailId)); |
| | | //{ |
| | | // List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | // List<Dt_ProStockInfo>? stockInfos = null; |
| | | // List<Dt_OutMESOrder>? Orders = null; |
| | | // List<Dt_OutStockLockInfo>? outStockLockInfos = null; |
| | | // List<Dt_LocationInfo>? locationInfos = null; |
| | | // { |
| | | // if (mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDFL.ObjToInt()).ToList().Count>0) |
| | | // { |
| | | // //åé
åºå |
| | | // (List<Dt_ProStockInfo>, List<Dt_OutMESOrder>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutMESOrderService.AssignProStockOutbound(mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDFL.ObjToInt()).ToList()); |
| | | // if (result.Item1 != null && result.Item1.Count > 0) |
| | | // { |
| | | // //åå»ºä»»å¡ |
| | | // tasks = GetTasks(result.Item1, result.Item3); |
| | | // result.Item3.ForEach(x => |
| | | // { |
| | | // x.Status = OutLockStockStatusEnum.åºåºä¸.ObjToInt(); |
| | | // }); |
| | | // stockInfos = result.Item1; |
| | | // Orders = result.Item2; |
| | | // outStockLockInfos = result.Item3; |
| | | // locationInfos = result.Item4; |
| | | // } |
| | | // } |
| | | // } |
| | | // if (stockInfos != null && stockInfos.Count > 0 && outStockLockInfos != null && outStockLockInfos.Count > 0 && locationInfos != null && locationInfos.Count > 0 && tasks.Count>0) |
| | | // { |
| | | // BaseDal.AddData(tasks); |
| | | // stockInfos.ForEach(x => |
| | | // { |
| | | // x.StockStatus = StockStatusEmun.åºåºéå®.ObjToInt(); |
| | | // }); |
| | | // WebResponseContent contentResponse = _outboundService.OutMESOrderService.LockOutboundStockDataUpdate(stockInfos, Orders, outStockLockInfos, locationInfos, tasks: tasks); |
| | | List<Dt_OutMESOrder> mESOrders = _outboundRepository.OutMESOrderRepository.QueryData(x => AddoutMESOrders.Select(x => x.OutDetailId).Contains(x.OutDetailId)); |
| | | { |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | List<Dt_ProStockInfo>? stockInfos = null; |
| | | List<Dt_OutMESOrder>? Orders = null; |
| | | List<Dt_OutStockLockInfo>? outStockLockInfos = null; |
| | | List<Dt_LocationInfo>? locationInfos = null; |
| | | { |
| | | if (mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDFL.ObjToInt()).ToList().Count > 0) |
| | | { |
| | | //åé
åºå |
| | | (List<Dt_ProStockInfo>, List<Dt_OutMESOrder>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutMESOrderService.AssignProStockOutbound(mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDFL.ObjToInt()).ToList()); |
| | | if (result.Item1 != null && result.Item1.Count > 0) |
| | | { |
| | | //åå»ºä»»å¡ |
| | | tasks = GetTasks(result.Item1, result.Item3); |
| | | result.Item3.ForEach(x => |
| | | { |
| | | x.Status = OutLockStockStatusEnum.åºåºä¸.ObjToInt(); |
| | | }); |
| | | stockInfos = result.Item1; |
| | | Orders = result.Item2; |
| | | outStockLockInfos = result.Item3; |
| | | locationInfos = result.Item4; |
| | | } |
| | | } |
| | | } |
| | | if (stockInfos != null && stockInfos.Count > 0 && outStockLockInfos != null && outStockLockInfos.Count > 0 && locationInfos != null && locationInfos.Count > 0 && tasks.Count > 0) |
| | | { |
| | | BaseDal.AddData(tasks); |
| | | stockInfos.ForEach(x => |
| | | { |
| | | x.StockStatus = StockStatusEmun.åºåºéå®.ObjToInt(); |
| | | }); |
| | | WebResponseContent contentResponse = _outboundService.OutMESOrderService.LockOutboundStockDataUpdate(stockInfos, Orders, outStockLockInfos, locationInfos, tasks: tasks); |
| | | |
| | | // if (!contentResponse.Status) |
| | | // { |
| | | // _unitOfWorkManage.RollbackTran(); |
| | | // return content.Error(contentResponse.Message); |
| | | // } |
| | | // } |
| | | //} |
| | | //{ |
| | | // List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | // List<Dt_StockInfo>? stockInfos = null; |
| | | // List<Dt_OutMESOrder>? Orders = null; |
| | | // List<Dt_OutStockLockInfo>? outStockLockInfos = null; |
| | | // List<Dt_LocationInfo>? locationInfos = null; |
| | | // { |
| | | // if (mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDYL.ObjToInt()).ToList().Count > 0) |
| | | // { |
| | | // //åé
åºå |
| | | // (List<Dt_StockInfo>, List<Dt_OutMESOrder>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutMESOrderService.AssignStockOutbound(mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDYL.ObjToInt()).ToList()); |
| | | // if (result.Item1 != null && result.Item1.Count > 0) |
| | | // { |
| | | // //åå»ºä»»å¡ |
| | | // tasks = GetTasks(result.Item1, result.Item3); |
| | | // result.Item3.ForEach(x => |
| | | // { |
| | | // x.Status = OutLockStockStatusEnum.åºåºä¸.ObjToInt(); |
| | | // }); |
| | | // stockInfos = result.Item1; |
| | | // Orders = result.Item2; |
| | | // outStockLockInfos = result.Item3; |
| | | // locationInfos = result.Item4; |
| | | // } |
| | | // } |
| | | // } |
| | | // if (stockInfos != null && stockInfos.Count > 0 && outStockLockInfos != null && outStockLockInfos.Count > 0 && locationInfos != null && locationInfos.Count > 0 && tasks.Count>0) |
| | | // { |
| | | // BaseDal.AddData(tasks); |
| | | // stockInfos.ForEach(x => |
| | | // { |
| | | // x.StockStatus = StockStatusEmun.åºåºéå®.ObjToInt(); |
| | | // }); |
| | | // WebResponseContent contentResponse = _outboundService.OutMESOrderService.LockOutboundStockDataUpdate(stockInfos, Orders, outStockLockInfos, locationInfos, tasks: tasks); |
| | | // if (!contentResponse.Status) |
| | | // { |
| | | // _unitOfWorkManage.RollbackTran(); |
| | | // return content.Error(contentResponse.Message); |
| | | // } |
| | | // } |
| | | //} |
| | | if (!contentResponse.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content.Error(contentResponse.Message); |
| | | } |
| | | } |
| | | } |
| | | { |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | List<Dt_StockInfo>? stockInfos = null; |
| | | List<Dt_OutMESOrder>? Orders = null; |
| | | List<Dt_OutStockLockInfo>? outStockLockInfos = null; |
| | | List<Dt_LocationInfo>? locationInfos = null; |
| | | { |
| | | if (mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDYL.ObjToInt()).ToList().Count > 0) |
| | | { |
| | | //åé
åºå |
| | | (List<Dt_StockInfo>, List<Dt_OutMESOrder>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutMESOrderService.AssignStockOutbound(mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDYL.ObjToInt()).ToList()); |
| | | if (result.Item1 != null && result.Item1.Count > 0) |
| | | { |
| | | //åå»ºä»»å¡ |
| | | tasks = GetTasks(result.Item1, result.Item3); |
| | | result.Item3.ForEach(x => |
| | | { |
| | | x.Status = OutLockStockStatusEnum.åºåºä¸.ObjToInt(); |
| | | }); |
| | | stockInfos = result.Item1; |
| | | Orders = result.Item2; |
| | | outStockLockInfos = result.Item3; |
| | | locationInfos = result.Item4; |
| | | } |
| | | } |
| | | } |
| | | if (stockInfos != null && stockInfos.Count > 0 && outStockLockInfos != null && outStockLockInfos.Count > 0 && locationInfos != null && locationInfos.Count > 0 && tasks.Count > 0) |
| | | { |
| | | BaseDal.AddData(tasks); |
| | | stockInfos.ForEach(x => |
| | | { |
| | | x.StockStatus = StockStatusEmun.åºåºéå®.ObjToInt(); |
| | | }); |
| | | WebResponseContent contentResponse = _outboundService.OutMESOrderService.LockOutboundStockDataUpdate(stockInfos, Orders, outStockLockInfos, locationInfos, tasks: tasks); |
| | | if (!contentResponse.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content.Error(contentResponse.Message); |
| | | } |
| | | } |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK(ErrorMsg.IsNullOrEmpty()? "æ¥æ¶æå" : $"ä¿¡æ¯ï¼{ErrorMsg}"); |
| | | } |
| | |
| | | using HslCommunication.WebSocket; |
| | | using HslCommunication.WebSocket; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | |
| | | /// <summary> |
| | | /// æ¥è¯¢æ¡ä»¶è´§ä½ |
| | | /// </summary> |
| | | /// <param name="row"></param> |
| | | /// <param name="roadwayNo"></param> |
| | | /// <param name="warehouseId"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("GetLocationStatus")] |
| | | public WebResponseContent GetLocationStatus(int row, int warehouseId = 0) |
| | | public WebResponseContent GetLocationStatus(string roadwayNo, int warehouseId = 0) |
| | | { |
| | | List<int> layers; |
| | | if (warehouseId == 0) |
| | | // å®ä¹è¿åæ°æ®ç»æ |
| | | var result = new |
| | | { |
| | | layers = _repository.QueryData(x => x.Row == row).Select(x => x.Layer).Distinct().ToList(); |
| | | } |
| | | else |
| | | row1 = new List<object>(), // å··é第1æï¼ä¸é¢ï¼ |
| | | row2 = new List<object>() // å··é第2æï¼è¥¿é¢ï¼ |
| | | }; |
| | | |
| | | // æ¥è¯¢å··é䏿æè´§ä½ |
| | | var locations = _repository.QueryData(x => x.RoadwayNo == roadwayNo); |
| | | |
| | | // è·åææå±ï¼æä»é«å°ä½æåº |
| | | var layers = locations.Select(x => x.Layer).Distinct().OrderByDescending(x => x).ToList(); |
| | | |
| | | // å¤çæ¯ä¸å± |
| | | foreach (var layer in layers) |
| | | { |
| | | layers = _repository.QueryData(x => x.Row == row && x.WarehouseId == warehouseId).Select(x => x.Layer).Distinct().ToList(); |
| | | } |
| | | |
| | | List<object> listObj = new List<object>(); |
| | | foreach (var item in layers) |
| | | { |
| | | object locationObj; |
| | | if (warehouseId == 0) |
| | | { |
| | | locationObj = _repository.QueryData(x => x.Row == row && x.Layer == item) |
| | | .OrderBy(x => x.Columns) |
| | | .Select(x => new |
| | | { |
| | | layer = x.Layer.ToString().PadLeft(2, '0'), |
| | | row = x.Row.ToString().PadLeft(2, '0'), |
| | | column = x.Columns.ToString().PadLeft(2, '0'), |
| | | locationCode = x.LocationCode, |
| | | location_lock = x.LocationStatus |
| | | }).ToList(); |
| | | } |
| | | else |
| | | { |
| | | locationObj = _repository.QueryData(x => x.Row == row && x.Layer == item && x.WarehouseId == warehouseId) |
| | | .OrderBy(x => x.Columns) |
| | | .Select(x => new |
| | | { |
| | | layer = x.Layer.ToString().PadLeft(2, '0'), |
| | | row = x.Row.ToString().PadLeft(2, '0'), |
| | | column = x.Columns.ToString().PadLeft(2, '0'), |
| | | locationCode = x.LocationCode, |
| | | location_lock = x.LocationStatus |
| | | }).ToList(); |
| | | } |
| | | |
| | | object obj = new { layer = item, locationObj }; |
| | | listObj.Add(obj); |
| | | // è·åå½åå±çè´§ä½ |
| | | var layerLocations = locations.Where(x => x.Layer == layer); |
| | | |
| | | // 第1ææ°æ®ï¼ä¸é¢ï¼ |
| | | var row1Locations = layerLocations.Where(x => x.Row == 1) |
| | | .OrderBy(x => x.Columns) |
| | | .Select(x => new |
| | | { |
| | | layer = x.Layer.ToString().PadLeft(2, '0'), |
| | | row = x.Row.ToString().PadLeft(2, '0'), |
| | | column = x.Columns.ToString().PadLeft(2, '0'), |
| | | locationCode = x.LocationCode, |
| | | location_lock = x.LocationStatus |
| | | }).ToList(); |
| | | |
| | | // 第2ææ°æ®ï¼è¥¿é¢ï¼ |
| | | var row2Locations = layerLocations.Where(x => x.Row == 2) |
| | | .OrderBy(x => x.Columns) |
| | | .Select(x => new |
| | | { |
| | | layer = x.Layer.ToString().PadLeft(2, '0'), |
| | | row = x.Row.ToString().PadLeft(2, '0'), |
| | | column = x.Columns.ToString().PadLeft(2, '0'), |
| | | locationCode = x.LocationCode, |
| | | location_lock = x.LocationStatus |
| | | }).ToList(); |
| | | |
| | | // æ·»å å°ç»æä¸ |
| | | result.row1.Add(new { layer, locationObj = row1Locations }); |
| | | result.row2.Add(new { layer, locationObj = row2Locations }); |
| | | } |
| | | |
| | | return WebResponseContent.Instance.OK("æå", listObj); |
| | | return WebResponseContent.Instance.OK("æå", result); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢å
¨é¨è´§ä½ |
| | | /// æ¥è¯¢å
¨é¨å··é |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("GetRow")] |
| | | public WebResponseContent GetRow() |
| | | { |
| | | List<int> listRow = _repository.QueryData().Select(x => x.Row).Distinct().ToList(); |
| | | return WebResponseContent.Instance.OK("æå", listRow); |
| | | // ä¿æå
¼å®¹æ§æ¥å£ï¼è¿åå··éå表 |
| | | List<string> roadwayList = _repository.QueryData().Select(x => x.RoadwayNo).Distinct().ToList(); |
| | | return WebResponseContent.Instance.OK("æå", roadwayList); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢å
¨é¨å··é |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("GetRoadway")] |
| | | public WebResponseContent GetRoadway() |
| | | { |
| | | List<string> roadwayList = _repository.QueryData().Select(x => x.RoadwayNo).Distinct().ToList(); |
| | | return WebResponseContent.Instance.OK("æå", roadwayList); |
| | | } |
| | | |
| | | /// <summary> |