| | |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | |
| | | this.columns.push({ |
| | | title: "æä½", |
| | | field: "æä½", |
| | | width: 150, |
| | | align: "left", // 'center', |
| | | render: (h, { row, column, index }) => { |
| | | return ( |
| | | <div> |
| | | <el-button |
| | | onClick={($e) => { |
| | | // this.$refs.table.load(); |
| | | // console.log(this.$refs.table); |
| | | this.$refs.gridHeader.open(row); |
| | | }} |
| | | type="primary" |
| | | plain |
| | | style="height:26px; padding: 10px !important;" |
| | | > |
| | | æå° |
| | | </el-button> |
| | | </div> |
| | | ); |
| | | }, |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //æ¡æ¶åå§åé
ç½®åï¼ |
| | | 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.boxOptions.labelWidth = 150 |
| | | |
| | | // this.columns.push({ |
| | | // title: "æä½", |
| | | // field: "æä½", |
| | |
| | | // <div> |
| | | // <el-button |
| | | // onClick={($e) => { |
| | | // this.$refs.gridHeader.openModel1(row); |
| | | // // this.$refs.table.load(); |
| | | // // console.log(this.$refs.table); |
| | | // this.$refs.gridHeader.open(row); |
| | | // }} |
| | | // type="primary" |
| | | // plain |
| | | // style="height:26px; padding: 10px !important;" |
| | | // > |
| | | // æ¥çåºåæç» |
| | | // </el-button> |
| | | // æå° |
| | | // </el-button> |
| | | // </div> |
| | | // ); |
| | | // }, |
| | | // }); |
| | | |
| | | //示ä¾ï¼è®¾ç½®ä¿®æ¹æ°å»ºãç¼è¾å¼¹åºæ¡å段æ ç¾çé¿åº¦ |
| | | this.boxOptions.labelWidth = 150 |
| | | |
| | | |
| | | this.columns.forEach((column) => { |
| | | //ä¿®æ¹é¢è² |
| | | if (column.field == 'roadwayNo') { |
| | | column.formatter = (row) => { |
| | | // return '<span style="color: #2d8cf0;">' + row?.locationInfo?.roadwayNo + '</span>' |
| | | return row?.locationInfo?.roadwayNo |
| | | } |
| | | |
| | | if (column.field == 'floor') { |
| | | |
| | | const floorMap = { |
| | | '1F': '䏿¥¼', |
| | | '2F': 'äºæ¥¼', |
| | | }; |
| | | column.formatter = (row) => { |
| | | return floorMap[row?.locationInfo?.floor] || 'æªç¥æ¥¼å±' |
| | | } |
| | | } |
| | | if (column.field == 'materielCode') { |
| | | column.formatter = (row) => { |
| | | // return '<span style="color: #2d8cf0;">' + row?.locationInfo?.roadwayNo + '</span>' |
| | | return row?.stockInfoDetails[0]?.materielCode |
| | | } |
| | | } |
| | | //æ ¼å¼åæ¥æ |
| | | // æ£æ¥å½ååçåæ®µæ¯å¦ä¸º 'locationStatus' |
| | | if (column.field == 'locationStatus') { |
| | | // 使ç¨å¯¹è±¡åé¢éæ¥æ å° 'locationStatus' çå¼å对åºçææ¬ |
| | | const statusMap = { |
| | | '-1': 'å
¨é¨', |
| | | '0': '空é²', |
| | | '1': 'éå®', |
| | | '2': 'æè´§', |
| | | '3': 'æè´§ç¦ç¨', |
| | | '4': 'æ è´§ç¦ç¨' |
| | | }; |
| | | // å®ä¹ä¸ä¸ªæ ¼å¼å彿°ï¼æ ¹æ® 'locationStatus' çå¼è¿åç¸åºçææ¬ |
| | | column.formatter = (row) => { |
| | | // ä½¿ç¨ statusMap 对象æ¥è·å对åºçææ¬ï¼å¦ææ²¡æå¹é
åè¿å 'æªç¥ç¶æ' |
| | | return statusMap[row?.locationInfo?.locationStatus] || 'æªç¥ç¶æ'; |
| | | } |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | | //妿è¦é
ç½®æç»è¡¨,卿¤æ¹æ³æä½ |
| | | this.detailOptions.columns.forEach(column=>{ |
| | | console.log(column) |
| | | this.detailOptions.columns.forEach(column => { |
| | | |
| | | }); |
| | | }, |
| | | searchBefore(param) { |
| | |
| | | return true |
| | | }, |
| | | searchAfter(result) { |
| | | console.log(result) |
| | | console.log(result) |
| | | return true |
| | | }, |
| | | addBefore(formData) { |
| | |
| | | // this.$refs.table.$refs.table.toggleRowSelection(row) //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | |
| | | |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |