imeik-bizui 1.8.0 → 1.8.2

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.
@@ -3,7 +3,14 @@
3
3
  <ImTable :table="tableConfig" style="margin-bottom: 20px">
4
4
  <!-- 专家 -->
5
5
  <template slot="doctorName" slot-scope="{ row }">
6
- <ImSelect v-if="!isView" v-model="row.doctorNumber" :class="{ 'is-error': row.valid === false && !row.doctorNumber }" :attrs="doctorAttrs" :listeners="{ focus: onDoctorFocus}" @input="changedoctorName(row)"></ImSelect>
6
+ <ImSelect
7
+ v-if="!isView"
8
+ v-model="row.doctorNumber"
9
+ :class="{ 'is-error': row.valid === false && !row.doctorNumber }"
10
+ :attrs="doctorAttrs"
11
+ :listeners="{ focus: onDoctorFocus }"
12
+ @input="changedoctorName(row)"
13
+ ></ImSelect>
7
14
  <div v-else>
8
15
  <!-- <div v-if="showDiff">
9
16
  <p class="text-button" @click="viewdoctorDetailItem(row)">{{ row.doctorName }}</p>
@@ -34,6 +41,7 @@
34
41
  <ImOneLineDot :text="formatPhone(row.doctorPhone)">手机号:{{ formatPhone(row.doctorPhone) }}</ImOneLineDot>
35
42
  <ImOneLineDot :text="row.doctorType">类型:{{ row.doctorType }}</ImOneLineDot>
36
43
  <ImOneLineDot :text="row.doctorPost">职称:{{ row.doctorPost }}</ImOneLineDot>
44
+ <ImOneLineDot :text="row.doctorExpertType">医生类专家类别:{{ row.doctorExpertType }}</ImOneLineDot>
37
45
  </div>
38
46
  </div>
39
47
  </template>
@@ -68,17 +76,31 @@
68
76
  <p v-if="row.describe" class="tips-text">{{ row.describe }}</p>
69
77
  </div>
70
78
  </template>
79
+ <!-- 活动身份 -->
80
+ <template slot="identity" slot-scope="{ row }">
81
+ <div v-if="!isView">
82
+ <ImSelect
83
+ v-model="row.identity"
84
+ :class="{ 'is-error': row.valid === false && !row.identity }"
85
+ :attrs="{ options: row.shenfenList_new }"
86
+ @input="(val) => handleChangeIdentity(val, row)"
87
+ ></ImSelect>
88
+ </div>
89
+ <div v-else>
90
+ <ImDiffText v-if="showDiff" :show-diff="showDiff" :old-value="row.identity" :no-absolute="true" :new-value="row._newData?.identity" />
91
+ </div>
92
+ </template>
71
93
  <!-- 授课名称 -->
72
94
  <template slot="className" slot-scope="{ row }">
73
95
  <div v-if="!isView">
74
- <el-input v-if="checkHasCourse(row)" v-model="row.courseName" placeholder="请输入" maxlength="100"></el-input>
75
- <div v-else>-</div>
96
+ <ImInput v-model="row.className" :class="{ 'is-error': row.valid === false && checkHasCourse(row) }" placeholder="请输入" maxlength="100"></ImInput>
76
97
  </div>
77
98
  <div v-else>
78
99
  <ImDiffText v-if="showDiff" :show-diff="showDiff" :old-value="row.courseName" :no-absolute="true" :new-value="row._newData?.courseName" />
79
100
  <div v-else>{{ row.courseName }}</div>
80
101
  </div>
81
102
  </template>
103
+
82
104
  <!-- 费用金额 -->
83
105
  <template slot="costAmount" slot-scope="{ row }">
84
106
  <p v-if="checkStandardAmountsIsBeyond(row)" class="standardAmount">费用标准:{{ row.standardAmount }}</p>
@@ -228,6 +250,15 @@ export default {
228
250
  'min-width': '150'
229
251
  }
230
252
  },
253
+ {
254
+ label: '活动身份',
255
+ prop: 'identity',
256
+ type: 'slot',
257
+ slot: 'identity',
258
+ attrs: {
259
+ 'min-width': '150'
260
+ }
261
+ },
231
262
  {
232
263
  label: '授课名称',
233
264
  prop: 'className',
@@ -335,6 +366,9 @@ export default {
335
366
  } else if (!item.doctorServiceSceneCode) {
336
367
  res && showMessage && this.$message.warning('请检查服务场景')
337
368
  res = false
369
+ } else if (this.checkHasCourse(item) && !item.className) {
370
+ res && showMessage && this.$message.warning('请填写授课名称')
371
+ res = false
338
372
  } else if (!item.costAmount) {
339
373
  res && showMessage && this.$message.warning('请检查费用金额')
340
374
  res = false
@@ -397,17 +431,30 @@ export default {
397
431
  },
398
432
  // 获取场景列表
399
433
  getSceneList(data) {
434
+ console.log('getSceneList', data.doctorExpertType)
400
435
  if (data.doctorLevel) {
401
436
  this.scenarioLoading = true
402
- getExpertServiceFee({ expertRoleCode: data.doctorLevel }).then((res) => {
437
+ getExpertServiceFee({ expertRoleCode: data.doctorLevel, doctorExpertType: data.doctorExpertType }).then((res) => {
403
438
  this.scenarioLoading = false
404
439
  if (res.code === 200) {
405
- const list = JSON.parse(res.data)
440
+ const list = JSON.parse(res.data).sceneList
441
+
442
+ const shenfenList = JSON.parse(res.data).standardAmountList.map((item) => ({
443
+ label: item.sceneAndIdentity,
444
+ value: item.sceneAndIdentity,
445
+ standardAmount: item.standardAmount
446
+ }))
447
+
406
448
  this.$set(data, 'scenarioList', list)
449
+ this.$set(data, 'shenfenList', shenfenList)
407
450
  }
408
451
  })
409
452
  }
410
453
  },
454
+ handleChangeIdentity(val, row) {
455
+ const sceneInfo = row.shenfenList_new.find((item) => item.value === val)
456
+ this.$set(row, 'standardAmount', sceneInfo.standardAmount)
457
+ },
411
458
  // 修改专家回调
412
459
  changedoctorName(row, type) {
413
460
  // 写入专家信息
@@ -442,11 +489,22 @@ export default {
442
489
  // 修改场景回调
443
490
  changeScenario(val, row) {
444
491
  const sceneInfo = row.scenarioList.find((item) => item.value === val)
492
+ console.log(sceneInfo.label)
445
493
  if (sceneInfo) {
446
- this.$set(row, 'standardAmount', sceneInfo.standardAmount)
447
494
  this.$set(row, 'doctorServiceSceneName', sceneInfo.label)
448
495
  this.$set(row, 'describe', sceneInfo.describe)
449
496
  this.$set(row, 'courseName', '')
497
+ // 修改:在过滤后,对每个项处理label,取_之后的部分
498
+ const shenfenList_new =
499
+ row.shenfenList
500
+ ?.filter((item) => item.label?.split('_')[0].includes(sceneInfo.label) ?? false)
501
+ ?.map((item) => ({
502
+ ...item,
503
+ // 修改:截取_后的文字,没有下划线时返回原label
504
+ label: item.label?.split('_')[1] ?? item.label ?? '',
505
+ value: item.value?.split('_')[1] ?? item.value ?? ''
506
+ })) ?? []
507
+ this.$set(row, 'shenfenList_new', shenfenList_new)
450
508
  }
451
509
  this.checkStandardAmountsIsBeyond(row)
452
510
  },
@@ -501,12 +559,15 @@ export default {
501
559
  checkStandardAmountsIsBeyond(data) {
502
560
  return Number(data.costAmount) > Number(data.standardAmount)
503
561
  },
504
- // 检查场景有没有授课
562
+ // 优化后方法:检查场景是否有活动身份
505
563
  checkHasCourse(data) {
506
- if (!data.doctorServiceSceneName) {
507
- return
564
+ if (!data.identity || !Array.isArray(data.shenfenList_new)) {
565
+ return false
508
566
  }
509
- return data.doctorServiceSceneName.includes('授课')
567
+ // 使用some替代find,直接返回布尔值
568
+ return data.shenfenList_new.some(
569
+ (item) => item.value === data.identity && item.label?.includes('授课') // 安全访问label属性
570
+ )
510
571
  },
511
572
  formatChangeType(val) {
512
573
  switch (val) {
@@ -528,7 +589,7 @@ export default {
528
589
  sums[index] = '合计'
529
590
  return
530
591
  }
531
- if (index === 6) {
592
+ if (index === 7) {
532
593
  const values = data.map((item) => {
533
594
  if (item._newData) {
534
595
  return item?._newData[column.property]