| | |
| | | size="small" |
| | | clearable |
| | | ></el-input>--> |
| | | <el-button v-if="isShow" type="primary" @click="add()" |
| | | style="margin: 10px 0 0 10px;padding: 9px 18px !important;">新增型号 |
| | | <el-button v-if="isShow" type="primary" size="mini" @click="add()" |
| | | style="margin: 10px 0 0 7px;padding: 8px 17px !important;">新增型号 |
| | | </el-button> |
| | | <el-button v-if="isShow" type="primary" size="mini" @click="updateXh()" |
| | | style="margin: 10px 0 0 7px;padding: 8px 17px !important;">修改型号 |
| | | </el-button> |
| | | <el-button v-if="isShow" type="primary" size="mini" @click="deleteXh()" |
| | | style="margin: 10px 0 0 7px;padding: 8px 17px !important;">删除型号 |
| | | </el-button> |
| | | <el-divider></el-divider> |
| | | <el-tree |
| | |
| | | filterText: '', |
| | | productList: [], |
| | | defaultId: '', |
| | | id: '', |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'name' |
| | |
| | | add() { |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, type: 'xh'}) |
| | | }, |
| | | updateXh() { |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(this.id, {id: null, type: 'xh'}) |
| | | }, |
| | | async deleteXh() { |
| | | if (this.id) { |
| | | this.$tip.alert(this.$t('prompt.deleteBatch')) |
| | | if (await this.$tip.confirm(this.$t('', {'handle': this.$t('delete')}))) { |
| | | let res = await this.$http.delete( |
| | | '/basicInfo/XhProductModel/', |
| | | { |
| | | 'data': [this.id] |
| | | } |
| | | ) |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | await this.getProductList() |
| | | } |
| | | } |
| | | } else { |
| | | this.$tip.alert('未选择型号') |
| | | } |
| | | }, |
| | | filterNode(value, data) { |
| | | if (!value) return true |
| | | return data.name.indexOf(value) !== -1 |
| | | }, |
| | | handleNodeClick(data) { |
| | | this.id = data.id |
| | | this.$emit('on-selected', data) |
| | | }, |
| | | } |