| | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | // import gridHeader from "./demo_Product/Dt_BillGroupStockDetail.vue"; |
| | | import gridBody from "./extend/SupplementationData.vue" |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: gridBody, |
| | | gridBody: '', |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | //æ¡æ¶åå§åé
ç½®åï¼ |
| | | let OutBoundBtn = this.buttons.find((x) => x.value == 'OutBound') |
| | | if (OutBoundBtn) { |
| | | OutBoundBtn.onClick = function () { |
| | | // this.$Message.success('ç¹å»äºæé®') |
| | | let row = this.$refs.table.getSelected() //è·åéä¸çè¡ |
| | | if (row <= 0) { |
| | | //å¦ææ²¡æéä¸è¡ |
| | | this.$Message.error('è¯·éæ©ä¸è¡æ°æ®') |
| | | return |
| | | } |
| | | let locationCode = row[0].locationCode |
| | | let palletCode = row[0].palletCode |
| | | this.http |
| | | .get( |
| | | `/api/Task/CreateAndSendOutboundTask?locationCode=${locationCode}&palletCode=${palletCode}`, |
| | | {}, |
| | | 'æ£å¨å建任å¡' |
| | | ) |
| | | .then((res) => { |
| | | //示ä¾ï¼è°ç¨åå°æ¥å£ |
| | | if (res.status) { |
| | | this.$Message.success('åå»ºä»»å¡æå') |
| | | console.log(res) |
| | | this.refresh() //å·æ°è¡¨æ ¼ |
| | | } else { |
| | | this.$Message.error(res.message) //é误æç¤º |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | |
| | | var btnSupplementationData = this.buttons.find(x => x.value == "SupplementationData"); |
| | | if (btnSupplementationData != null) { |
| | | btnSupplementationData.onClick = () => { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) { |
| | | return this.$error("è¯·éæ©æ°æ®!"); |
| | | } else if (rows.length > 1) { |
| | | return this.$error("åªè½éæ©åæ¡æ°æ®"); |
| | | } |
| | | this.$refs.gridBody.open(rows[0].palletCode); |
| | | this.refresh(); |
| | | } |
| | | |
| | | } |
| | | //示ä¾ï¼å¨æé®çæå颿·»å ä¸ä¸ªæé® |
| | | // this.buttons.unshift({ |
| | | // //ä¹å¯ä»¥ç¨pushæè
spliceæ¹æ³æ¥ä¿®æ¹buttonsæ°ç» |
| | |
| | | //示ä¾ï¼è®¾ç½®ä¿®æ¹æ°å»ºãç¼è¾å¼¹åºæ¡å段æ ç¾çé¿åº¦ |
| | | this.boxOptions.labelWidth = 150 |
| | | |
| | | // this.columns.push({ |
| | | // title: "æä½", |
| | | // field: "æä½", |
| | | // width: 150, |
| | | // align: "left", // 'center', |
| | | // render: (h, { row, column, index }) => { |
| | | // return ( |
| | | // <div> |
| | | // <el-button |
| | | // onClick={($e) => { |
| | | // this.$refs.gridHeader.openModel1(row); |
| | | // }} |
| | | // type="primary" |
| | | // plain |
| | | // style="height:26px; padding: 10px !important;" |
| | | // > |
| | | // æ¥çåºåæç» |
| | | // </el-button> |
| | | // </div> |
| | | // ); |
| | | // }, |
| | | // }); |
| | | |
| | | this.columns.forEach((column) => { |
| | | //ä¿®æ¹é¢è² |
| | | if (column.field == 'roadwayNo') { |
| | | |
| | | if (column.field == 'floor') { |
| | | |
| | | const floorMap = { |
| | | '1F': '䏿¥¼', |
| | | '2F': 'äºæ¥¼', |
| | | }; |
| | | column.formatter = (row) => { |
| | | // return '<span style="color: #2d8cf0;">' + row?.locationInfo?.roadwayNo + '</span>' |
| | | return row?.locationInfo?.roadwayNo |
| | | return floorMap[row?.locationInfo?.floor] || '' |
| | | } |
| | | } |
| | | if (column.field == 'materielCode') { |
| | | if (column.field == 'areaId') { |
| | | |
| | | const floorMap = { |
| | | '1': '䏿¥¼å åæºåºå', |
| | | '2': '䏿¥¼AGVåºåºç¼ååº', |
| | | '3': '䏿¥¼AGVç«åºç¼ååº', |
| | | '4': '䏿¥¼AGVå
¥åºç¼ååº', |
| | | '5': 'äºæ¥¼B4-G4ç¼ååº', |
| | | '6': 'äºæ¥¼B5-G5ç¼ååº', |
| | | }; |
| | | column.formatter = (row) => { |
| | | // return '<span style="color: #2d8cf0;">' + row?.locationInfo?.roadwayNo + '</span>' |
| | | return row?.stockInfoDetails[0]?.materielCode |
| | | return floorMap[row?.locationInfo?.areaId] || '' |
| | | } |
| | | } |
| | | //æ ¼å¼åæ¥æ |
| | | // æ£æ¥å½ååçåæ®µæ¯å¦ä¸º 'locationStatus' |
| | | if (column.field == 'locationStatus') { |
| | | // 使ç¨å¯¹è±¡åé¢éæ¥æ å° 'locationStatus' çå¼å对åºçææ¬ |
| | | const statusMap = { |
| | | '-1': 'å
¨é¨', |
| | | '0': '空é²', |
| | | '1': 'éå®', |
| | | '2': 'æè´§', |
| | | '3': 'æè´§ç¦ç¨', |
| | | '4': 'æ è´§ç¦ç¨' |
| | | }; |
| | | // å®ä¹ä¸ä¸ªæ ¼å¼å彿°ï¼æ ¹æ® 'locationStatus' çå¼è¿åç¸åºçææ¬ |
| | | column.formatter = (row) => { |
| | | // ä½¿ç¨ statusMap 对象æ¥è·å对åºçææ¬ï¼å¦ææ²¡æå¹é
åè¿å 'æªç¥ç¶æ' |
| | | return statusMap[row?.locationInfo?.locationStatus] || 'æªç¥ç¶æ'; |
| | | return statusMap[row?.locationInfo?.locationStatus] || ''; |
| | | } |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | onInited() { |
| | |
| | | // this.$refs.table.$refs.table.toggleRowSelection(row) //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |