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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
| <template>
| <div ref="container">
| <a-modal
| :title="title"
| :width="500"
| :visible="visible"
| :confirm-loading="confirmLoading"
| :getContainer="() => $refs.container"
| :maskStyle="{'top':'93px','left':'154px'}"
| :wrapClassName="wrapClassNameInfo()"
| :mask="isDesktop()"
| :maskClosable="false"
| @ok="handleOk"
| @cancel="handleCancel"
| cancelText="取消"
| okText="保存"
| style="top:30%;height: 30%;">
| <template slot="footer">
| <a-button key="back" v-if="isReadOnly" @click="handleCancel">
| 取消
| </a-button>
| </template>
| <a-spin :spinning="confirmLoading">
| <a-form :form="form">
| <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="请输入价格">
| <a-input placeholder="请输入价格" v-decorator.trim="[ 'price', validatorRules.price]" />
| </a-form-item>
| </a-form>
| </a-spin>
| </a-modal>
| </div>
| </template>
|
| <script>
| import {mixinDevice} from '@/utils/mixin'
| export default {
| name: 'BatchSetPriceModal',
| mixins: [mixinDevice],
| data () {
| return {
| title:"批量设置",
| visible: false,
| isReadOnly: false,
| batchType: '',
| model: {},
| labelCol: {
| xs: { span: 24 },
| sm: { span: 5 },
| },
| wrapperCol: {
| xs: { span: 24 },
| sm: { span: 16 },
| },
| confirmLoading: false,
| form: this.$form.createForm(this),
| validatorRules:{
| price:{
| rules: [
| { required: true, message: '请输入价格!' }
| ]}
| }
| }
| },
| created () {
| },
| methods: {
| add (type) {
| this.batchType = type
| if(type === 'purchase') {
| this.title = '采购价-批量设置'
| } else if(type === 'commodity') {
| this.title = '零售价-批量设置'
| } else if(type === 'wholesale') {
| this.title = '销售价-批量设置'
| } else if(type === 'low') {
| this.title = '最低售价-批量设置'
| }
| this.edit({});
| },
| edit (record) {
| this.form.resetFields();
| this.model = Object.assign({}, record);
| this.visible = true;
| },
| close () {
| this.$emit('close');
| this.visible = false;
| },
| handleOk () {
| let price = this.form.getFieldValue('price')
| this.$emit('ok', price, this.batchType);
| this.visible = false
| },
| handleCancel () {
| this.close()
| }
| }
| }
| </script>
|
| <style scoped>
|
| </style>
|
|