|
@@ -2,29 +2,32 @@
|
2
|
2
|
<div>
|
3
|
3
|
<el-dialog :visible="onOpen" v-if="onOpen" @close="onClose" :title="pageType===1?`新增`:`编辑`">
|
4
|
4
|
<el-row :gutter="15">
|
5
|
|
- <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
|
5
|
+ <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px">
|
6
|
6
|
<el-col :span="11">
|
7
|
7
|
<el-form-item label="诊所名称" prop="clinicName">
|
8
|
8
|
<el-input v-model="formData.clinicName" placeholder="请输入诊所名称" clearable
|
9
|
|
- :style="{width: '100%'}" :maxlength="64"></el-input>
|
|
9
|
+ :style="{width: '100%'}" :maxlength="64"
|
|
10
|
+ ></el-input>
|
10
|
11
|
</el-form-item>
|
11
|
12
|
</el-col>
|
12
|
13
|
<el-col :span="11">
|
13
|
|
- <el-form-item label="服务IP" prop="clinicIp">
|
14
|
|
- <el-input v-model="formData.clinicIp" placeholder="请输入服务IP" clearable :style="{width: '100%'}">
|
|
14
|
+ <el-form-item label="IP地址" prop="clinicIp">
|
|
15
|
+ <el-input v-model="formData.clinicIp" placeholder="请输入IP地址" clearable :style="{width: '100%'}">
|
15
|
16
|
</el-input>
|
16
|
17
|
</el-form-item>
|
17
|
18
|
</el-col>
|
18
|
19
|
<el-col :span="11">
|
19
|
|
- <el-form-item label="服务用户" prop="serverUser">
|
20
|
|
- <el-input v-model="formData.serverUser" placeholder="请输入服务用户" clearable
|
21
|
|
- :style="{width: '100%'}"></el-input>
|
|
20
|
+ <el-form-item label="服务器登录名" prop="serverUser">
|
|
21
|
+ <el-input v-model="formData.serverUser" placeholder="请输入服务器登录名" clearable
|
|
22
|
+ :style="{width: '100%'}"
|
|
23
|
+ ></el-input>
|
22
|
24
|
</el-form-item>
|
23
|
25
|
</el-col>
|
24
|
26
|
<el-col :span="11">
|
25
|
|
- <el-form-item label="服务密码" prop="serverPassword">
|
26
|
|
- <el-input v-model="formData.serverPassword" placeholder="请输入服务密码" clearable
|
27
|
|
- :style="{width: '100%'}"></el-input>
|
|
27
|
+ <el-form-item label="服务器密码" prop="serverPassword">
|
|
28
|
+ <el-input v-model="formData.serverPassword" placeholder="请输入服务器密码" clearable
|
|
29
|
+ :style="{width: '100%'}"
|
|
30
|
+ ></el-input>
|
28
|
31
|
</el-form-item>
|
29
|
32
|
</el-col>
|
30
|
33
|
<el-col :span="11">
|
|
@@ -34,21 +37,26 @@
|
34
|
37
|
</el-form-item>
|
35
|
38
|
</el-col>
|
36
|
39
|
<el-col :span="11">
|
37
|
|
- <el-form-item label="创建时间" prop="creatTime">
|
|
40
|
+ <el-form-item label="购买时间" prop="creatTime">
|
38
|
41
|
<el-date-picker v-model="formData.creatTime" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
|
39
|
|
- :style="{width: '100%'}" placeholder="请输入创建时间" clearable></el-date-picker>
|
|
42
|
+ :style="{width: '100%'}" placeholder="请选择购买时间" clearable
|
|
43
|
+ :picker-options="pickerStartOptions"
|
|
44
|
+ ></el-date-picker>
|
40
|
45
|
</el-form-item>
|
41
|
46
|
</el-col>
|
42
|
47
|
<el-col :span="11">
|
43
|
48
|
<el-form-item label="到期时间" prop="expireTime">
|
44
|
49
|
<el-date-picker v-model="formData.expireTime" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
|
45
|
|
- :style="{width: '100%'}" placeholder="请选择时间选择" clearable></el-date-picker>
|
|
50
|
+ :style="{width: '100%'}" placeholder="请选择到期时间" clearable
|
|
51
|
+ :picker-options="pickerEndOptions"
|
|
52
|
+ ></el-date-picker>
|
46
|
53
|
</el-form-item>
|
47
|
54
|
</el-col>
|
48
|
55
|
<el-col :span="11">
|
49
|
|
- <el-form-item label="版本信息" prop="versionInfo">
|
50
|
|
- <el-input v-model="formData.versionInfo" placeholder="请输入版本信息" clearable
|
51
|
|
- :style="{width: '100%'}"></el-input>
|
|
56
|
+ <el-form-item label="版本编号" prop="versionInfo">
|
|
57
|
+ <el-input v-model="formData.versionInfo" placeholder="请输入版本编号" clearable
|
|
58
|
+ :style="{width: '100%'}"
|
|
59
|
+ ></el-input>
|
52
|
60
|
</el-form-item>
|
53
|
61
|
</el-col>
|
54
|
62
|
<el-col :span="11">
|
|
@@ -58,8 +66,8 @@
|
58
|
66
|
</el-form-item>
|
59
|
67
|
</el-col>
|
60
|
68
|
<el-col :span="11">
|
61
|
|
- <el-form-item label="绑定手机" prop="phone">
|
62
|
|
- <el-input v-model="formData.phone" placeholder="请输入绑定手机" clearable :style="{width: '100%'}">
|
|
69
|
+ <el-form-item label="手机号" prop="phone">
|
|
70
|
+ <el-input v-model="formData.phone" placeholder="请输入手机号" clearable :style="{width: '100%'}">
|
63
|
71
|
</el-input>
|
64
|
72
|
</el-form-item>
|
65
|
73
|
</el-col>
|
|
@@ -70,11 +78,13 @@
|
70
|
78
|
</el-form-item>
|
71
|
79
|
</el-col>
|
72
|
80
|
<el-col :span="11">
|
73
|
|
- <el-form-item label="版本描述" prop="versionRefer">
|
74
|
|
- <el-select v-model="formData.versionRefer" placeholder="请选择版本描述" clearable
|
75
|
|
- :style="{width: '100%'}">
|
|
81
|
+ <el-form-item label="购买版本" prop="versionRefer">
|
|
82
|
+ <el-select v-model="formData.versionRefer" placeholder="请选择购买版本" clearable
|
|
83
|
+ :style="{width: '100%'}"
|
|
84
|
+ >
|
76
|
85
|
<el-option v-for="(item, index) in mobileOptions" :key="index" :label="item.label"
|
77
|
|
- :value="item.value" :disabled="item.disabled"></el-option>
|
|
86
|
+ :value="item.value" :disabled="item.disabled"
|
|
87
|
+ ></el-option>
|
78
|
88
|
</el-select>
|
79
|
89
|
</el-form-item>
|
80
|
90
|
</el-col>
|
|
@@ -88,7 +98,7 @@
|
88
|
98
|
</div>
|
89
|
99
|
</template>
|
90
|
100
|
<script>
|
91
|
|
-import {addClinict, editClinict} from '@/api/allApi.js'
|
|
101
|
+import { addClinict, editClinict } from '@/api/allApi.js'
|
92
|
102
|
|
93
|
103
|
export default {
|
94
|
104
|
components: {},
|
|
@@ -116,23 +126,38 @@ export default {
|
116
|
126
|
region: ``,
|
117
|
127
|
phone: ``,
|
118
|
128
|
address: ``,
|
119
|
|
- versionRefer: ``,
|
|
129
|
+ versionRefer: ``
|
|
130
|
+ },
|
|
131
|
+ pickerStartOptions: {
|
|
132
|
+ disabledDate: (time) => {
|
|
133
|
+
|
|
134
|
+ if (this.formData.expireTime !== null) {
|
|
135
|
+ return time.getTime() > new Date(this.formData.expireTime).getTime()
|
|
136
|
+ }
|
|
137
|
+ }
|
|
138
|
+ },
|
|
139
|
+ pickerEndOptions: {
|
|
140
|
+ disabledDate: (time) => {
|
|
141
|
+ if (this.formData.creatTime !== null){
|
|
142
|
+ return time.getTime() < new Date(this.formData.creatTime).getTime()
|
|
143
|
+ }
|
|
144
|
+ }
|
120
|
145
|
},
|
121
|
146
|
mobileOptions: [{
|
122
|
|
- "label": "免费版",
|
123
|
|
- "value": "免费版"
|
124
|
|
- },{
|
125
|
|
- "label": "基础版",
|
126
|
|
- "value": "基础版"
|
|
147
|
+ 'label': '免费版',
|
|
148
|
+ 'value': '免费版'
|
127
|
149
|
}, {
|
128
|
|
- "label": "高级版",
|
129
|
|
- "value": "高级版"
|
|
150
|
+ 'label': '基础版',
|
|
151
|
+ 'value': '基础版'
|
130
|
152
|
}, {
|
131
|
|
- "label": "豪华版",
|
132
|
|
- "value": "豪华版"
|
|
153
|
+ 'label': '高级版',
|
|
154
|
+ 'value': '高级版'
|
133
|
155
|
}, {
|
134
|
|
- "label": "尊贵版",
|
135
|
|
- "value": "尊贵版"
|
|
156
|
+ 'label': '豪华版',
|
|
157
|
+ 'value': '豪华版'
|
|
158
|
+ }, {
|
|
159
|
+ 'label': '尊贵版',
|
|
160
|
+ 'value': '尊贵版'
|
136
|
161
|
}],
|
137
|
162
|
rules: {
|
138
|
163
|
clinicName: [{
|
|
@@ -142,21 +167,21 @@ export default {
|
142
|
167
|
}],
|
143
|
168
|
clinicIp: [{
|
144
|
169
|
required: true,
|
145
|
|
- message: '请输入服务IP',
|
|
170
|
+ message: '请输入IP地址',
|
146
|
171
|
trigger: 'blur'
|
147
|
172
|
}, {
|
148
|
173
|
pattern: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
|
149
|
|
- message: '服务IP格式错误',
|
|
174
|
+ message: 'IP地址格式错误',
|
150
|
175
|
trigger: 'blur'
|
151
|
176
|
}],
|
152
|
177
|
serverUser: [{
|
153
|
178
|
required: true,
|
154
|
|
- message: '请输入服务用户',
|
|
179
|
+ message: '请输入服务器登录名',
|
155
|
180
|
trigger: 'blur'
|
156
|
181
|
}],
|
157
|
182
|
serverPassword: [{
|
158
|
183
|
required: true,
|
159
|
|
- message: '请输入服务密码',
|
|
184
|
+ message: '请输入服务器密码',
|
160
|
185
|
trigger: 'blur'
|
161
|
186
|
}],
|
162
|
187
|
realmName: [{
|
|
@@ -166,17 +191,17 @@ export default {
|
166
|
191
|
}],
|
167
|
192
|
creatTime: [{
|
168
|
193
|
required: true,
|
169
|
|
- message: '请输入创建时间',
|
|
194
|
+ message: '请选择购买时间',
|
170
|
195
|
trigger: 'change'
|
171
|
196
|
}],
|
172
|
197
|
expireTime: [{
|
173
|
198
|
required: true,
|
174
|
|
- message: '请选择时间选择',
|
|
199
|
+ message: '请选择到期时间',
|
175
|
200
|
trigger: 'change'
|
176
|
201
|
}],
|
177
|
202
|
versionInfo: [{
|
178
|
203
|
required: true,
|
179
|
|
- message: '请输入版本信息',
|
|
204
|
+ message: '请输入版本编号',
|
180
|
205
|
trigger: 'blur'
|
181
|
206
|
}],
|
182
|
207
|
region: [{
|
|
@@ -186,7 +211,7 @@ export default {
|
186
|
211
|
}],
|
187
|
212
|
phone: [{
|
188
|
213
|
required: true,
|
189
|
|
- message: '请输入绑定手机',
|
|
214
|
+ message: '请输入手机号',
|
190
|
215
|
trigger: 'blur'
|
191
|
216
|
}, {
|
192
|
217
|
pattern: /^1(3|4|5|7|8|9)\d{9}$/,
|
|
@@ -200,19 +225,24 @@ export default {
|
200
|
225
|
}],
|
201
|
226
|
versionRefer: [{
|
202
|
227
|
required: true,
|
203
|
|
- message: '请输入版本描述',
|
|
228
|
+ message: '请选择购买版本',
|
204
|
229
|
trigger: 'blur'
|
205
|
|
- }],
|
206
|
|
- },
|
|
230
|
+ }]
|
|
231
|
+ }
|
207
|
232
|
}
|
208
|
233
|
},
|
209
|
|
- computed: {},
|
210
|
|
- watch: {},
|
|
234
|
+ computed:
|
|
235
|
+ {}
|
|
236
|
+ ,
|
|
237
|
+ watch: {}
|
|
238
|
+ ,
|
211
|
239
|
created() {
|
212
|
|
- },
|
|
240
|
+ }
|
|
241
|
+ ,
|
213
|
242
|
mounted() {
|
214
|
243
|
|
215
|
|
- },
|
|
244
|
+ }
|
|
245
|
+ ,
|
216
|
246
|
methods: {
|
217
|
247
|
onClose() {
|
218
|
248
|
this.$emit('closeDialog')
|
|
@@ -220,39 +250,50 @@ export default {
|
220
|
250
|
creatTime: null,
|
221
|
251
|
expireTime: null
|
222
|
252
|
}
|
223
|
|
- },
|
224
|
|
- async handleConfirm() {
|
225
|
|
- /**
|
226
|
|
- * 新增
|
227
|
|
- */
|
228
|
|
- if (this.pageType === 1) {
|
229
|
|
- const res = await addClinict(this.formData)
|
230
|
|
- if (res.code === 200) {
|
231
|
|
- this.$emit('closeDialog')
|
232
|
|
- this.$emit('initList')
|
233
|
|
- this.$message.success('保存成功')
|
234
|
|
- } else {
|
235
|
|
- this.$message.error(res.msg)
|
236
|
|
- }
|
237
|
|
- } else {
|
238
|
|
- /**
|
239
|
|
- * 编辑
|
240
|
|
- */
|
241
|
|
- console.log(this.formData)
|
242
|
|
- const res = await editClinict(this.formData)
|
243
|
|
- if (res.code === 200) {
|
244
|
|
- this.$emit('initList')
|
245
|
|
- this.$emit('closeDialog')
|
246
|
|
- this.$message.success('保存成功')
|
247
|
|
- this.formData = {
|
248
|
|
- creatTime: null,
|
249
|
|
- expireTime: null
|
|
253
|
+ }
|
|
254
|
+ ,
|
|
255
|
+ handleConfirm() {
|
|
256
|
+
|
|
257
|
+ this.$refs.elForm.validate(async(valid) => {
|
|
258
|
+ if (valid) {
|
|
259
|
+ /**
|
|
260
|
+ * 新增
|
|
261
|
+ */
|
|
262
|
+ if (this.pageType === 1) {
|
|
263
|
+ const res = await addClinict(this.formData)
|
|
264
|
+ if (res.code === 200) {
|
|
265
|
+ this.$emit('closeDialog')
|
|
266
|
+ this.$emit('initList')
|
|
267
|
+ this.$message.success('保存成功')
|
|
268
|
+ } else {
|
|
269
|
+ this.$message.error(res.msg)
|
|
270
|
+ }
|
|
271
|
+ } else {
|
|
272
|
+ /**
|
|
273
|
+ * 编辑
|
|
274
|
+ */
|
|
275
|
+ console.log(this.formData)
|
|
276
|
+ const res = await editClinict(this.formData)
|
|
277
|
+ if (res.code === 200) {
|
|
278
|
+ this.$emit('initList')
|
|
279
|
+ this.$emit('closeDialog')
|
|
280
|
+ this.$message.success('保存成功')
|
|
281
|
+ this.formData = {
|
|
282
|
+ creatTime: null,
|
|
283
|
+ expireTime: null
|
|
284
|
+ }
|
|
285
|
+ } else {
|
|
286
|
+ this.$message.error(res.msg)
|
|
287
|
+ }
|
250
|
288
|
}
|
251
|
289
|
} else {
|
252
|
|
- this.$message.error(res.msg)
|
|
290
|
+ console.log('error submit!!')
|
|
291
|
+ return false
|
253
|
292
|
}
|
254
|
|
- }
|
255
|
|
- },
|
|
293
|
+ })
|
|
294
|
+
|
|
295
|
+ }
|
|
296
|
+
|
256
|
297
|
}
|
257
|
298
|
}
|
258
|
299
|
|