Commit 1487a12d authored by linxin's avatar linxin

fixed:input组件

parent c623bff6
......@@ -19,6 +19,10 @@ export default {
type: Boolean,
default: false,
},
content: {
type: String,
default: '',
},
},
data () {
......@@ -36,7 +40,9 @@ export default {
formatValue () {
let currency = this.$options.filters['currency']
if (!this.focused) {
if (this.value !== '0.00' && this.value !== '' && this.value !== null) {
return `¥${currency(this.value)}`
}
} else {
return this.value
}
......@@ -55,14 +61,6 @@ export default {
let value = event.target.value
event.target.value = ''
event.target.value = value
/* if (document.selection) {
var sel = value.createTextRange()
sel.moveStart('character', value.length)
sel.collapse()
sel.select()
} else if (typeof value.selectionStart === 'number' && typeof value.selectionEnd === 'number') {
value.selectionStart = value.selectionEnd = value.length
}*/
setTimeout(function () {
event.target.type = 'number'
event.target.focus()
......
......@@ -43,7 +43,7 @@
</item>
<item>
<div slot="name">产品数量</div>
<input slot="content" v-model="saveInfo.product_num" :readonly="isReadOnly" placeholder="请填写产品数量">
<input slot="content" v-model="saveInfo.product_num" :readonly="isReadOnly" placeholder="请输入产品数量">
</item>
</list-item>
<div class="userInfo">融资信息</div>
......@@ -61,11 +61,11 @@
</item>
<item>
<div slot="name">设备单价</div>
<CurrencyInput slot="content" v-model="saveInfo.equip_price" :readonly="isReadOnly" placeholder="0"/>
<CurrencyInput slot="content" v-model="saveInfo.equip_price" :readonly="isReadOnly" placeholder="请输入设备单价"/>
</item>
<item>
<div slot="name">融资金额</div>
<CurrencyInput slot="content" v-model="finance_amount" :readonly="isReadOnly" placeholder="0"/>
<CurrencyInput slot="content" v-model="finance_amount" :readonly="isReadOnly" placeholder="请输入融资信息"/>
</item>
<item>
<div slot="name">首付比例</div>
......@@ -74,7 +74,7 @@
<item>
<div slot="name">首付款</div>
<CurrencyInput
slot="content" v-model="saveInfo.down_payment" :readonly="isReadOnly" placeholder="0"
slot="content" v-model="saveInfo.down_payment" :readonly="isReadOnly" placeholder="请输入首付款"
@input="changeRatio"/>
</item>
<item>
......@@ -84,7 +84,7 @@
<item>
<div slot="name">保证金</div>
<CurrencyInput
slot="content" v-model="saveInfo.deposit" :readonly="isReadOnly" placeholder="0"
slot="content" v-model="saveInfo.deposit" :readonly="isReadOnly" placeholder="请输入保证金"
@input="changeDeposit"/>
</item>
<item>
......@@ -94,16 +94,16 @@
<item>
<div slot="name">手续费</div>
<CurrencyInput
slot="content" v-model="saveInfo.lease_charge" :readonly="isReadOnly" placeholder="0"
slot="content" v-model="saveInfo.lease_charge" :readonly="isReadOnly" placeholder="请输入手续费"
@input="changeLeaseCharge"/>
</item>
<item>
<div slot="name">GPS费用</div>
<CurrencyInput slot="content" v-model="saveInfo.gps_fee" :readonly="isReadOnly" placeholder="0"/>
<CurrencyInput slot="content" v-model="saveInfo.gps_fee" :readonly="isReadOnly" placeholder="请输入GPS费用"/>
</item>
<item>
<div slot="name">保险押金</div>
<CurrencyInput slot="content" v-model="saveInfo.insurance_fee" :readonly="isReadOnly" placeholder="0"/>
<CurrencyInput slot="content" v-model="saveInfo.insurance_fee" :readonly="isReadOnly" placeholder="请输入保险押金"/>
</item>
<item v-if="!isReadOnly" class="date-check" @click.native="showTime('YYYY-MM-DD')">
<div slot="name">预计付款日</div>
......@@ -123,7 +123,7 @@
</item>
<item>
<div slot="name">租赁期数</div>
<input slot="content" v-model="saveInfo.lease_times" :readonly="isReadOnly" placeholder="请填写租赁期数">
<input slot="content" v-model="saveInfo.lease_times" :readonly="isReadOnly" placeholder="请输入租赁期数">
</item>
<item>
<div slot="name">年利率</div>
......@@ -143,7 +143,7 @@
</item>
<item>
<div slot="name">留购价</div>
<CurrencyInput slot="content" v-model="saveInfo.residual_value" :readonly="isReadOnly" placeholder="请填写留购价"/>
<CurrencyInput slot="content" v-model="saveInfo.residual_value" :readonly="isReadOnly" placeholder="请输入留购价"/>
</item>
<item :showArrow="true" @click.native="goPlan">
<div slot="name">查看还款计划</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment