Files
laws-sinotruk-client/src/components/selection/EnterprisePlanSelection.vue
T

81 lines
1.9 KiB
Vue

<template>
<div class="selection-wrapper">
<div class="box-title-text">
<a-input class="box-input" :value="standardNumber" :title="standardNumber" @click="standardClick"
disabled readonly :placeholder="placeholder"/>
<a-button v-if="!isDisabled" type="primary" class="button-box" @click="standardClick">
{{this.$t('enterprisePlanSelect.title')}}
</a-button>
</div>
<enterprise-plan-selection-modal ref="enterprisePlanSelectionModal" v-bind="$attrs" :value="value" @change="modalChange" @standardNumberChange="standardNumberChange" @listChange="modalListChange"></enterprise-plan-selection-modal>
</div>
</template>
<script>
import EnterprisePlanSelectionModal from './EnterprisePlanSelectionModal'
export default {
name: 'EnterprisePlanSelection',
components: { EnterprisePlanSelectionModal },
props: {
value: {
type: String,
default: ''
},
placeholder: {
type: String,
default: ''
},
isDisabled: {
type: Boolean,
default: false
},
standardNumber: {
type: String,
default: ''
}
},
methods: {
// 点击选择标准按钮
standardClick () {
this.$refs.enterprisePlanSelectionModal.open()
},
modalChange (value) {
this.$emit('change', value)
},
standardNumberChange (value) {
this.$emit('standardNumberChange', value)
},
modalListChange (value) {
this.$emit('listChange', value)
}
},
model: {
prop: 'value',
event: 'change'
}
}
</script>
<style scoped lang="less">
.selection-wrapper {
height: 40px;
line-height: 40px;
}
.box-title-text {
height: 100%;
display: flex;
align-items: center;
.box-input {
width: 100%;
}
/deep/ .ant-input-disabled {
background: #fff;
color: rgba(0, 0, 0, 0.65);
cursor: default;
}
.button-box {
margin-left: 10px;
}
}
</style>