| | |
| | | name: 'SelectTyModel', |
| | | data() { |
| | | return { |
| | | url: '/basicInfo/XhProductModel/page', |
| | | url: '/basicInfo/TyProductModel/page', |
| | | selectList: [], |
| | | data: '', |
| | | pageCode:'', |
| | | dataForm: { |
| | | type: 'noTree', |
| | | nodeType: '', |
| | | shipId:'', |
| | | id: '', |
| | | pid: '', |
| | | name: '', |
| | | namePath: '', |
| | | operationalStatus: '', |
| | | standbyState: '', |
| | | faultState: '', |
| | |
| | | init(id, params) { |
| | | this.dataForm.nodeType = params.type |
| | | this.dataForm.pid = params.id |
| | | this.pageCode = params.pageCode |
| | | if (!this.pageCode) { |
| | | this.url = '/basicInfo/TyProductModel/page' |
| | | } |
| | | this.dataForm.shipId =params.shipId |
| | | this.dataForm.namePath =params.namePath |
| | | console.log(params, 'init()') |
| | | }, |
| | | changeRow(selection) { |
| | | console.log(selection, ' changeRow(selection)') |
| | | let item = {} |
| | | for (item of selection) { |
| | | console.log(item) |
| | | item.pid = this.dataForm.pid |
| | | item.namePath = this.dataForm.namePath |
| | | item.shipId = this.dataForm.shipId |
| | | } |
| | | this.selectList = selection |
| | | this.selectList.forEach( item => { |
| | | item.pageCode = this.pageCode |
| | | }) |
| | | }, |
| | | async formSubmit() { |
| | | let res |
| | | if (this.pageCode) { |
| | | if (this.pageCode === 'expect' || this.pageCode === 'assign') { |
| | | res = await this.$http.post('/basicInfo/ParamData/get', this.selectList) |
| | | } |
| | | } else { |
| | | res = await this.$http.post('/basicInfo/XhProductModel/get', this.selectList) |
| | | } |
| | | let res = await this.$http.post('/basicInfo/XhProductModel/get', this.selectList) |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | this.$refs.dialog.close() |