doctor-admin-components 1.0.13-beta.9 → 1.0.13-pro.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,35 +6,23 @@
6
6
  <el-row>
7
7
  <el-col :span="12">
8
8
  <el-form-item :label="$t('contract.companyName')" prop="companyEnglishName">
9
- <el-input
10
- v-model="form.companyEnglishName"
11
- :placeholder="
12
- $t('placeholder.enter') + $t('contract.companyName')
13
- "
14
- />
9
+ <el-input v-model="form.companyEnglishName" :placeholder="$t('placeholder.enter') + $t('contract.companyName')" />
15
10
  </el-form-item>
16
11
  </el-col>
17
12
  <el-col :span="12">
18
- <el-form-item
19
- :label="$t('contract.taxId')"
20
- prop="taxNumber"
21
- v-if="this.companyType !== 'contract'"
22
- >
23
- <el-input
24
- v-model="form.taxNumber"
25
- :placeholder="$t('placeholder.enter') + $t('contract.taxId')"
26
- />
13
+ <el-form-item :label="$t('contract.taxId')" prop="taxNumber" v-if="this.companyType !== 'contract'">
14
+ <el-input v-model="form.taxNumber" :placeholder="$t('placeholder.enter') + $t('contract.taxId')" />
27
15
  </el-form-item>
28
16
  </el-col>
29
17
  </el-row>
30
18
  <el-row>
31
- <el-col :span="20">
19
+ <el-col :span="24">
32
20
  <el-form-item :label="$t('contract.companyAddress')" prop="address">
33
21
  <el-input
22
+ type="textarea"
23
+ :autosize="{ minRows: 1, maxRows: 4 }"
34
24
  v-model="form.address"
35
- :placeholder="
36
- $t('placeholder.enter') + $t('contract.companyAddress')
37
- "
25
+ :placeholder="$t('placeholder.enter') + $t('contract.companyAddress')"
38
26
  />
39
27
  </el-form-item>
40
28
  </el-col>
@@ -43,46 +31,31 @@
43
31
  <el-row>
44
32
  <el-col :span="12">
45
33
  <el-form-item label="PAN NO." prop="panNo">
46
- <el-input
47
- v-model="form.panNo"
48
- :placeholder="
49
- $t('placeholder.enter') + 'PAN NO.'
50
- "
51
- />
34
+ <el-input v-model="form.panNo" :placeholder="$t('placeholder.enter') + 'PAN NO.'" />
52
35
  </el-form-item>
53
36
  </el-col>
54
37
  <el-col :span="12">
55
38
  <el-form-item label="IEC CODE" prop="iecCode">
56
- <el-input
57
- v-model="form.iecCode"
58
- :placeholder="
59
- $t('placeholder.enter') + 'IEC CODE'
60
- "
61
- />
39
+ <el-input v-model="form.iecCode" :placeholder="$t('placeholder.enter') + 'IEC CODE'" />
62
40
  </el-form-item>
63
41
  </el-col>
64
42
  </el-row>
65
43
  <el-row>
66
44
  <el-col :span="12">
67
45
  <el-form-item label="GST NUMBER" prop="gstNumber">
68
- <el-input
69
- v-model="form.gstNumber"
70
- :placeholder="
71
- $t('placeholder.enter') + 'GST NUMBER'
72
- "
73
- />
46
+ <el-input v-model="form.gstNumber" :placeholder="$t('placeholder.enter') + 'GST NUMBER'" />
74
47
  </el-form-item>
75
48
  </el-col>
76
49
  <el-col :span="12"></el-col>
77
50
  </el-row>
78
51
  <el-row v-if="companyType == 'delivery' && channel !== 'official-website'">
79
- <el-col :span="20">
52
+ <el-col :span="24">
80
53
  <el-form-item :label="$t('contract.bliRemark')" prop="bliRemark">
81
54
  <el-input
55
+ type="textarea"
56
+ :autosize="{ minRows: 3, maxRows: 4 }"
82
57
  v-model="form.bliRemark"
83
- :placeholder="
84
- $t('placeholder.enter') + $t('contract.bliRemark')
85
- "
58
+ :placeholder="$t('placeholder.enter') + $t('contract.bliRemark')"
86
59
  />
87
60
  </el-form-item>
88
61
  </el-col>
@@ -90,30 +63,18 @@
90
63
 
91
64
  <el-divider></el-divider>
92
65
  <el-row type="flex" justify="space-between">
93
- <h4>{{ $t("contract.contactInfo") }}</h4>
66
+ <h4>{{ $t('contract.contactInfo') }}</h4>
94
67
  </el-row>
95
68
 
96
69
  <el-row>
97
70
  <el-col :span="12">
98
71
  <el-form-item :label="$t('contract.contact')" prop="contact">
99
- <el-input
100
- v-model="form.contact"
101
- :placeholder="$t('placeholder.enter') + $t('contract.contact')"
102
- style="width: 75%"
103
- />
72
+ <el-input v-model="form.contact" :placeholder="$t('placeholder.enter') + $t('contract.contact')" style="width: 75%" />
104
73
  </el-form-item>
105
74
  </el-col>
106
75
  <el-col :span="12">
107
- <el-form-item
108
- :label="$t('contract.landline')"
109
- prop="landline"
110
- v-if="this.companyType == 'contract'"
111
- >
112
- <el-input
113
- v-model="form.landline"
114
- :placeholder="$t('placeholder.enter') + $t('contract.landline')"
115
- style="width: 75%"
116
- />
76
+ <el-form-item :label="$t('contract.landline')" prop="landline" v-if="this.companyType == 'contract'">
77
+ <el-input v-model="form.landline" :placeholder="$t('placeholder.enter') + $t('contract.landline')" style="width: 75%" />
117
78
  </el-form-item>
118
79
  </el-col>
119
80
  </el-row>
@@ -123,37 +84,14 @@
123
84
  <el-row v-for="(item, index) in form.phoneNumber" :key="index">
124
85
  <el-col :span="20">
125
86
  <el-form-item :label="$t('contract.phoneNumber')" prop="phoneNumber">
126
- <el-input
127
- v-model="form.phoneNumber[index]"
128
- :placeholder="
129
- $t('placeholder.enter') + $t('contract.phoneNumber')
130
- "
131
- ></el-input>
87
+ <el-input v-model="form.phoneNumber[index]" :placeholder="$t('placeholder.enter') + $t('contract.phoneNumber')"></el-input>
132
88
  </el-form-item>
133
89
  </el-col>
134
90
  <el-col :span="2" style="padding-top: 5px" v-if="companyType !== 'contract'">
135
- <el-button
136
- icon="el-icon-plus"
137
- size="mini"
138
- circle
139
- class="ml5"
140
- v-if="index === form.phoneNumber.length - 1"
141
- @click="addArr('phoneNumber')"
142
- ></el-button>
91
+ <el-button icon="el-icon-plus" size="mini" circle class="ml5" v-if="index === form.phoneNumber.length - 1" @click="addArr('phoneNumber')"></el-button>
143
92
  </el-col>
144
- <el-col
145
- :span="2"
146
- style="padding-top: 5px"
147
- :push="1"
148
- v-if="companyType !== 'contract'"
149
- >
150
- <el-button
151
- v-if="index > 0"
152
- size="mini"
153
- icon="el-icon-minus"
154
- circle
155
- @click="deleteArr('phoneNumber', index)"
156
- ></el-button>
93
+ <el-col :span="2" style="padding-top: 5px" :push="1" v-if="companyType !== 'contract'">
94
+ <el-button v-if="index > 0" size="mini" icon="el-icon-minus" circle @click="deleteArr('phoneNumber', index)"></el-button>
157
95
  </el-col>
158
96
  </el-row>
159
97
  </el-col>
@@ -161,37 +99,15 @@
161
99
  <!-- 循环 -->
162
100
  <el-row v-for="(item, index) in form.email" :key="index">
163
101
  <el-col :span="20">
164
- <el-form-item
165
- :label="$t('contract.email')"
166
- :prop="'email.' + index"
167
- :rules="rules.email"
168
- >
169
- <el-input
170
- v-model="form.email[index]"
171
- :placeholder="
172
- $t('placeholder.enter') + $t('contract.email')
173
- "
174
- />
102
+ <el-form-item :label="$t('contract.email')" :prop="'email.' + index" :rules="rules.email">
103
+ <el-input v-model="form.email[index]" :placeholder="$t('placeholder.enter') + $t('contract.email')" />
175
104
  </el-form-item>
176
105
  </el-col>
177
106
  <el-col :span="2" style="padding-top: 5px">
178
- <el-button
179
- icon="el-icon-plus"
180
- size="mini"
181
- circle
182
- class="ml5"
183
- v-if="index === form.email.length - 1"
184
- @click="addArr('email')"
185
- ></el-button>
107
+ <el-button icon="el-icon-plus" size="mini" circle class="ml5" v-if="index === form.email.length - 1" @click="addArr('email')"></el-button>
186
108
  </el-col>
187
109
  <el-col :span="2" style="padding-top: 5px" :push="1">
188
- <el-button
189
- v-if="index > 0"
190
- size="mini"
191
- icon="el-icon-minus"
192
- circle
193
- @click="deleteArr('email', index)"
194
- ></el-button>
110
+ <el-button v-if="index > 0" size="mini" icon="el-icon-minus" circle @click="deleteArr('email', index)"></el-button>
195
111
  </el-col>
196
112
  </el-row>
197
113
  </el-col>
@@ -202,19 +118,18 @@
202
118
  </el-form-item>
203
119
  </el-form>
204
120
  <div slot="footer" class="dialog-footer">
205
- <el-button type="primary" @click="submitForm">{{ $t("button.confirm") }}</el-button>
206
- <el-button @click="cancel">{{ $t("button.cancel") }}</el-button>
121
+ <el-button v-if="(companyType == 'delivery' || companyType == 'notifier') && form.contractCompanyId == null" type="primary" @click="submitAndGenerate">
122
+ {{ '确认并生成' + (companyType == 'delivery' ? '通知人' : companyType == 'notifier' ? '收货人' : '') }}
123
+ </el-button>
124
+ <el-button type="primary" @click="submitForm">{{ $t('button.confirm') }}</el-button>
125
+ <el-button @click="cancel">{{ $t('button.cancel') }}</el-button>
207
126
  </div>
208
127
  </el-dialog>
209
128
  </div>
210
129
  </template>
211
130
 
212
131
  <script>
213
- import {
214
- getBizContractCompany,
215
- addBizContractCompany,
216
- updateBizContractCompany,
217
- } from '../../../api/biz/bizContractCompany';
132
+ import { getBizContractCompany, addBizContractCompany, updateBizContractCompany } from '../../../api/biz/bizContractCompany'
218
133
 
219
134
  export default {
220
135
  name: 'AddSubCompanyDialog',
@@ -238,50 +153,50 @@ export default {
238
153
  {
239
154
  required: true,
240
155
  message: this.$t('contract.tip7'),
241
- trigger: 'blur',
242
- },
156
+ trigger: 'blur'
157
+ }
243
158
  ],
244
159
  address: [
245
160
  {
246
161
  required: true,
247
162
  message: this.$t('contract.tip8'),
248
- trigger: 'blur',
249
- },
163
+ trigger: 'blur'
164
+ }
250
165
  ],
251
166
  email: [
252
167
  {
253
168
  required: true,
254
169
  message: this.$t('contract.tip9'),
255
- trigger: 'blur',
256
- },
170
+ trigger: 'blur'
171
+ }
257
172
  ],
258
173
  taxNumber: [
259
174
  {
260
175
  required: true,
261
176
  message: this.$t('contract.tip10'),
262
- trigger: 'blur',
263
- },
264
- ],
265
- },
266
- };
177
+ trigger: 'blur'
178
+ }
179
+ ]
180
+ }
181
+ }
267
182
  },
268
183
  props: {
269
- channel: '',
184
+ channel: ''
270
185
  },
271
186
  created() {},
272
187
  methods: {
273
188
  //增加手机号
274
189
  addArr(type) {
275
- this.form[type].push('');
190
+ this.form[type].push('')
276
191
  },
277
192
  //增加邮箱
278
193
  deleteArr(type, index) {
279
- this.form[type].splice(index, 1);
194
+ this.form[type].splice(index, 1)
280
195
  },
281
196
  // 取消按钮
282
197
  cancel() {
283
- this.open = false;
284
- this.reset();
198
+ this.open = false
199
+ this.reset()
285
200
  },
286
201
  // 表单重置
287
202
  reset() {
@@ -299,23 +214,23 @@ export default {
299
214
  companyType: null,
300
215
  defaultFlag: false,
301
216
  landline: null,
302
- taxNumber: null,
303
- };
304
- this.resetForm('form');
217
+ taxNumber: null
218
+ }
219
+ this.resetForm('form')
305
220
  },
306
221
  /** 修改按钮操作 */
307
222
  handleUpdate(row) {
308
- this.reset();
309
- const contractCompanyId = row.contractCompanyId;
223
+ this.reset()
224
+ const contractCompanyId = row.contractCompanyId
310
225
  getBizContractCompany(contractCompanyId).then((response) => {
311
- this.form = response.data;
312
- this.companyId = row.companyId;
313
- this.companyType = response.data.companyType;
226
+ this.form = response.data
227
+ this.companyId = row.companyId
228
+ this.companyType = response.data.companyType
314
229
  if (this.form.phoneNumber.length <= 0) {
315
- this.addArr('phoneNumber');
230
+ this.addArr('phoneNumber')
316
231
  }
317
232
 
318
- console.log(this.companyType);
233
+ console.log(this.companyType)
319
234
  const title =
320
235
  this.companyType == 'contract'
321
236
  ? this.$t('button.edit') + this.$t('contract.contract')
@@ -323,17 +238,17 @@ export default {
323
238
  ? this.$t('button.edit') + this.$t('contract.consignee')
324
239
  : this.companyType == 'notifier'
325
240
  ? this.$t('button.edit') + this.$t('contract.notifier')
326
- : this.$t('button.edit');
327
- this.title = title;
328
- this.open = true;
329
- });
241
+ : this.$t('button.edit')
242
+ this.title = title
243
+ this.open = true
244
+ })
330
245
  },
331
246
  /** 新增按钮操作 */
332
247
  handleAdd(companyId, companyType) {
333
- this.reset();
334
- this.open = true;
335
- this.companyType = companyType;
336
- this.companyId = companyId;
248
+ this.reset()
249
+ this.open = true
250
+ this.companyType = companyType
251
+ this.companyId = companyId
337
252
  const title =
338
253
  companyType == 'contract'
339
254
  ? this.$t('button.add') + this.$t('contract.contract')
@@ -341,33 +256,55 @@ export default {
341
256
  ? this.$t('button.add') + this.$t('contract.consignee')
342
257
  : companyType == 'notifier'
343
258
  ? this.$t('button.add') + this.$t('contract.notifier')
344
- : this.$t('button.add');
345
- this.addArr('phoneNumber');
346
- this.addArr('email');
347
- this.title = title;
259
+ : this.$t('button.add')
260
+ this.addArr('phoneNumber')
261
+ this.addArr('email')
262
+ this.title = title
263
+ },
264
+ //提交并生成
265
+ submitAndGenerate() {
266
+ this.$refs['form'].validate((valid) => {
267
+ if (valid) {
268
+ this.form.companyType = this.companyType
269
+ this.form.companyId = this.companyId
270
+ addBizContractCompany(this.form).then((response) => {
271
+ if (this.companyType == 'delivery') {
272
+ this.form.companyType = 'notifier'
273
+ }
274
+ if (this.companyType == 'notifier') {
275
+ this.form.companyType = 'delivery'
276
+ }
277
+ addBizContractCompany(this.form).then((response) => {
278
+ this.$modal.msgSuccess('新增成功')
279
+ this.open = false
280
+ this.$emit('submit')
281
+ })
282
+ })
283
+ }
284
+ })
348
285
  },
349
286
  /** 提交按钮 */
350
287
  submitForm() {
351
288
  this.$refs['form'].validate((valid) => {
352
289
  if (valid) {
353
- this.form.companyType = this.companyType;
354
- this.form.companyId = this.companyId;
290
+ this.form.companyType = this.companyType
291
+ this.form.companyId = this.companyId
355
292
  if (this.form.contractCompanyId != null) {
356
293
  updateBizContractCompany(this.form).then((response) => {
357
- this.$modal.msgSuccess(this.$t('button.editTip'));
358
- this.open = false;
359
- this.$emit('submit');
360
- });
294
+ this.$modal.msgSuccess(this.$t('button.editTip'))
295
+ this.open = false
296
+ this.$emit('submit')
297
+ })
361
298
  } else {
362
299
  addBizContractCompany(this.form).then((response) => {
363
- this.$modal.msgSuccess(this.$t('button.addTip'));
364
- this.open = false;
365
- this.$emit('submit');
366
- });
300
+ this.$modal.msgSuccess(this.$t('button.addTip'))
301
+ this.open = false
302
+ this.$emit('submit')
303
+ })
367
304
  }
368
305
  }
369
- });
370
- },
371
- },
372
- };
306
+ })
307
+ }
308
+ }
309
+ }
373
310
  </script>