| | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | // import gridHeader from "./demo_Product/Dt_BillGroupStockDetail.vue"; |
| | | import gridHeader from './extend/printView.vue' |
| | | // import gridBody from "./extend/SupplementationData.vue" |
| | | // import gridHeader from './extend/printView.vue' |
| | | // import gridBody from './extend/OtherOutBound.vue' |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: gridHeader, |
| | | gridHeader: '', |
| | | gridBody: '', |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | 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> |
| | | ); |
| | | }, |
| | | this.detailOptions.buttons.unshift({ |
| | | name: 'å
¶ä»åºåº', //æé®åç§° |
| | | icon: '', //æé®å¾æ vue2çæ¬è§iviewææ¡£iconï¼vue3çæ¬è§element uiææ¡£icon(注æä¸æ¯element pulsææ¡£) |
| | | type: 'primary', //æé®æ ·å¼vue2çæ¬è§iviewææ¡£buttonï¼vue3çæ¬è§element uiææ¡£button |
| | | // onClick: function () { |
| | | // // this.$Message.success('ç¹å»äºæé®'); |
| | | // let row = this.$refs.table.getSelected() //è·åéä¸çè¡ |
| | | // if (row <= 0) { |
| | | // //å¦ææ²¡æéä¸è¡ |
| | | // this.$Message.error('è¯·éæ©ä¸è¡æ°æ®') |
| | | // return |
| | | // } |
| | | // let taskNum = row[0].taskNum |
| | | // this.http.get(`/api/Task/CompleteTaskAsync?taskNum=${taskNum}`, {}, "æ£å¨å®æä»»å¡").then((res) => { |
| | | // //示ä¾ï¼è°ç¨åå°æ¥å£ |
| | | // if (res.status) { |
| | | // this.$Message.success('ä»»å¡å®æ') |
| | | // } else { |
| | | // this.$Message.error(res.message) //é误æç¤º |
| | | // } |
| | | // }) |
| | | // } |
| | | onClick: () => { |
| | | let row = this.$refs.table.getSelected() |
| | | console.log(row); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //æ¡æ¶åå§åé
ç½®åï¼ |
| | | let OutBoundBtn = this.buttons.find((x) => x.value == 'OutBound') |
| | | if (OutBoundBtn) { |
| | | OutBoundBtn.onClick = function () { |
| | | // this.$Message.success('ç¹å»äºæé®') |
| | | this.detailOptions.buttons.unshift({ |
| | | name: 'çç¹åºåº', //æé®åç§° |
| | | icon: '', //æé®å¾æ vue2çæ¬è§iviewææ¡£iconï¼vue3çæ¬è§element uiææ¡£icon(注æä¸æ¯element pulsææ¡£) |
| | | type: 'primary', //æé®æ ·å¼vue2çæ¬è§iviewææ¡£buttonï¼vue3çæ¬è§element uiææ¡£button |
| | | onClick: function (e) { |
| | | // this.$Message.success('ç¹å»äºæé®'); |
| | | console.log(e); |
| | | 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) //é误æç¤º |
| | | } |
| | | }) |
| | | let taskNum = row[0].taskNum |
| | | this.http.get(`/api/Task/CompleteTaskAsync?taskNum=${taskNum}`, {}, "æ£å¨å®æä»»å¡").then((res) => { |
| | | //示ä¾ï¼è°ç¨åå°æ¥å£ |
| | | if (res.status) { |
| | | this.$Message.success('ä»»å¡å®æ') |
| | | } 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({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | | width: 90, |
| | | fixed: 'right', |
| | | align: 'center', |
| | | formatter: (row) => { |
| | | return ( |
| | | '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">çç¹åºåº</i>' |
| | | ); |
| | | }, |
| | | click: (row) => { |
| | | console.log(row); |
| | | this.http.post(`/api/Task/OutBoundTaskAsync?palletCode=${row.palletCode}`, {}, "æ£å¨çæä»»å¡").then((res) => { |
| | | //示ä¾ï¼è°ç¨åå°æ¥å£ |
| | | if (res.status) { |
| | | this.$Message.success(row[0].palletCode + "åºåºæå"); |
| | | this.refresh(); |
| | | } else { |
| | | this.$Message.error(res.message) //é误æç¤º |
| | | this.refresh(); |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | // 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') { |
| | | |
| | | 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.detailOptions.columns.forEach(column=>{ |
| | | console.log(column) |
| | | this.detailOptions.columns.forEach(column => { |
| | | |
| | | }); |
| | | }, |
| | | searchBefore(param) { |
| | |
| | | return true |
| | | }, |
| | | searchAfter(result) { |
| | | console.log(result) |
| | | return true |
| | | }, |
| | | addBefore(formData) { |
| | |
| | | }, |
| | | rowClick({ row, column, event }) { |
| | | //æ¥è¯¢çé¢ç¹å»è¡äºä»¶ |
| | | // this.$refs.table.$refs.table.toggleRowSelection(row) //åå»è¡æ¶éä¸å½åè¡; |
| | | this.$refs.table.$refs.table.toggleRowSelection(row) //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | |
| | | const isAdd = this.currentAction == 'Add';//夿æ¯å¦ä¸ºæ°å»ºæä½ |
| | | //éèæç»è¡¨æé® |
| | | this.detailOptions.buttons.forEach((btn) => { |
| | | if (btn.name == 'æ·»å è¡') { |
| | | btn.hidden = true; |
| | | //æè
设置åªè¯» |
| | | //btn.readonly=true; |
| | | } |
| | | }); |
| | | const isDel = this.currentAction == 'Add';//夿æ¯å¦ä¸ºæ°å»ºæä½ |
| | | //éèæç»è¡¨æé® |
| | | this.detailOptions.buttons.forEach((btn) => { |
| | | if (btn.name == 'å é¤è¡') { |
| | | btn.hidden = true; |
| | | //æè
设置åªè¯» |
| | | //btn.readonly=true; |
| | | } |
| | | }); |
| | | this.detailOptions.buttons.forEach((btn) => { |
| | | if (btn.name == '导å
¥') { |
| | | btn.hidden = true; |
| | | //æè
设置åªè¯» |
| | | //btn.readonly=true; |
| | | } |
| | | }); |
| | | this.detailOptions.buttons.forEach((btn) => { |
| | | if (btn.name == '导åº') { |
| | | btn.hidden = true; |
| | | //æè
设置åªè¯» |
| | | //btn.readonly=true; |
| | | } |
| | | }); |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |