setPriceDialog.vue
1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<template>
<GLDialog title="批量改价" mode="small" :visible.sync="visible" :show-close="true" :before-close="handleClose" @onOk="confirmPriceChange" @onCancel="handleClose" okText="提交" cancelText="取消">
<div class="dialog-wrap">
<span>销售价 = 供货价 +</span>
<el-input size="small" type="text" onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" v-model="batchPrice" placeholder="请输入金额">
<span slot="append">元</span>
</el-input>
</div>
</GLDialog>
</template>
<script>
export default {
name: 'setPriceDialog',
props: {
visible:{
type: Boolean,
default: false
}
},
data() {
return {
batchPrice: ''
}
},
methods: {
confirmPriceChange(){
this.$emit('confirm', this.batchPrice)
},
handleClose(){
this.$emit('handleClose')
}
}
}
</script>
<style lang="scss" scoped>
.dialog-wrap{
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
span{
white-space: nowrap;
margin-right: 8px;
}
/deep/ .el-input{
&, .el-input__inner{
width: 222px;
}
.el-input-group__append{
box-sizing: border-box;
padding: 0 11px;
span{
margin: 0;
}
}
}
}
</style>