imeik-bizui 0.3.2 → 0.3.3

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.
@@ -35,11 +35,17 @@ const typeItems = {
35
35
  }
36
36
  },
37
37
  {
38
- type: 'ImInput',
39
- prop: 'projectName',
38
+ type: 'ImSelect',
39
+ prop: 'projectCode',
40
40
  label: '上市后临床研究项目编号',
41
41
  attrs: {
42
- disabled: true
42
+ disabled: false,
43
+ filterable: true,
44
+ label: 'dicName',
45
+ value: 'dicValue',
46
+ style: {
47
+ width: '100%'
48
+ }
43
49
  }
44
50
  },
45
51
  {
@@ -164,11 +170,17 @@ const typeItems = {
164
170
  }
165
171
  },
166
172
  {
167
- type: 'ImInput',
173
+ type: 'ImSelect',
168
174
  prop: 'projectCode',
169
175
  label: '上市后临床研究项目编号',
170
176
  attrs: {
171
- disabled: true
177
+ disabled: false,
178
+ filterable: true,
179
+ label: 'dicName',
180
+ value: 'dicValue',
181
+ style: {
182
+ width: '100%'
183
+ }
172
184
  }
173
185
  },
174
186
  {
@@ -328,11 +340,17 @@ const typeItems = {
328
340
  }
329
341
  },
330
342
  {
331
- type: 'ImInput',
343
+ type: 'ImSelect',
332
344
  prop: 'projectCode',
333
345
  label: '上市后临床研究项目编号',
334
346
  attrs: {
335
- disabled: true
347
+ disabled: false,
348
+ filterable: true,
349
+ label: 'dicName',
350
+ value: 'dicValue',
351
+ style: {
352
+ width: '100%'
353
+ }
336
354
  }
337
355
  },
338
356
  {
@@ -492,11 +510,17 @@ const typeItems = {
492
510
  }
493
511
  },
494
512
  {
495
- type: 'ImInput',
513
+ type: 'ImSelect',
496
514
  prop: 'projectCode',
497
515
  label: '上市后临床研究项目编号',
498
516
  attrs: {
499
- disabled: true
517
+ disabled: false,
518
+ filterable: true,
519
+ label: 'dicName',
520
+ value: 'dicValue',
521
+ style: {
522
+ width: '100%'
523
+ }
500
524
  }
501
525
  },
502
526
  {
@@ -9,7 +9,7 @@
9
9
  <script>
10
10
  import { getTypeItems } from './data'
11
11
  import FieldSeleceDoctor from '../FieldSeleceDoctor/index.vue'
12
- import { getTagManageList, getProjectNo, getEcsErpCode } from '../../api/applycenter'
12
+ import { getTagManageList, getEcsErpCode } from '../../api/applycenter'
13
13
  import Axios from 'axios'
14
14
  export default {
15
15
  name: 'applyTypeView',
@@ -48,16 +48,14 @@ export default {
48
48
  valid: undefined
49
49
  },
50
50
  formItems: []
51
- }
51
+ },
52
+ belongCompany: ''
52
53
  }
53
54
  },
54
55
  computed: {
55
56
  isView() {
56
57
  return !!this.attrs.isView
57
58
  },
58
- belongCompany() {
59
- return this.formProps.applicationApplyCustomer?.invoiceCompanyCode || ''
60
- },
61
59
  doctorAttrs() {
62
60
  return { isView: this.isView }
63
61
  },
@@ -96,12 +94,6 @@ export default {
96
94
  },
97
95
  immediate: true
98
96
  },
99
- 'formConfig.props.applyType': {
100
- handler(val) {
101
- this.changeShowItems()
102
- },
103
- immediate: true
104
- },
105
97
  'formConfig.props.promiseTargetDate': {
106
98
  handler(val) {
107
99
  this.formatData(val)
@@ -114,6 +106,14 @@ export default {
114
106
  this.setPropsData()
115
107
  },
116
108
  deep: true
109
+ },
110
+ 'formProps.belongCompany': {
111
+ handler(val) {
112
+ this.belongCompany = val
113
+ this.setTypeDataOnChange()
114
+ },
115
+ immediate: true,
116
+ deep: true
117
117
  }
118
118
  },
119
119
  mounted() {
@@ -139,7 +139,7 @@ export default {
139
139
  })
140
140
  },
141
141
  handleValidate() {
142
- this.$refs.ImForm.validate((valid) => {
142
+ this.$refs.ImForm?.validate((valid) => {
143
143
  this.formConfig.props.valid = valid
144
144
  this.setPropsData()
145
145
  })
@@ -165,6 +165,7 @@ export default {
165
165
  this.formConfig.formItems[0].attrs.options = resData
166
166
  if (this.attrs.applyTypeOptions.default) {
167
167
  this.formConfig.props.applyType = this.attrs.applyTypeOptions.default
168
+ this.onApplyTypechange()
168
169
  }
169
170
  },
170
171
  changeShowItems() {
@@ -177,6 +178,7 @@ export default {
177
178
  applyType: this.formConfig.props.applyType,
178
179
  applyTypeName: this.getTypeName()
179
180
  }
181
+ this.changeShowItems()
180
182
  this.setTypeDataOnChange()
181
183
  },
182
184
  // 与大表单同步数据,更新数据
@@ -185,13 +187,7 @@ export default {
185
187
  this.$emit('change', this.formConfig.props)
186
188
  },
187
189
  setTypeDataOnChange() {
188
- getProjectNo().then((res) => {
189
- if (res.code === 200) {
190
- this.formConfig.props.projectCode = res.data.projectNo
191
- } else {
192
- this.$message.error(res.msg)
193
- }
194
- })
190
+ this.setProjectCode()
195
191
  getEcsErpCode({ applyType: this.formConfig.props.applyType, belongCompany: this.belongCompany }).then((res) => {
196
192
  if (res.code === 200) {
197
193
  this.formConfig.props.budgetSubjectCode = res.data.budgetSubjectCode
@@ -203,6 +199,41 @@ export default {
203
199
  }
204
200
  })
205
201
  },
202
+ // 设置上市后临床研究项目编号
203
+ setProjectCode() {
204
+ if (this.belongCompany === '201') {
205
+ this.formConfig.props.projectCode = 'Q202003-01_CH'
206
+ const index = this.getFormItemIndex('projectCode')
207
+ this.$set(this.formConfig.formItems[index].attrs, 'disabled', true)
208
+ return
209
+ }
210
+ this.formConfig.props.projectCode = undefined
211
+ getTagManageList({ tagModel: 'APPLY', tagName: '非销售申请项目编号' }).then((res) => {
212
+ if (res.code === 200) {
213
+ Axios.get(res.data[0].tagValueUrl).then((subRes) => {
214
+ if (subRes.data.code === 200) {
215
+ const index = this.getFormItemIndex('projectCode')
216
+ if (index) {
217
+ const fiterData = []
218
+ subRes.data.data.forEach(item => {
219
+ if (this.belongCompany === item.dicExt) {
220
+ fiterData.push(item)
221
+ }
222
+ })
223
+ const options = fiterData
224
+ const newData = JSON.parse(JSON.stringify(this.formConfig.formItems[index]))
225
+ newData.attrs.options = options
226
+ this.$set(this.formConfig.formItems, index, newData)
227
+ }
228
+ }
229
+ })
230
+ // this.formConfig.props.projectCode = res.data.projectNo
231
+ } else {
232
+ this.$message.error(res.msg)
233
+ }
234
+ })
235
+ },
236
+ // 格式化时间
206
237
  formatData() {
207
238
  const date = this.formConfig.props.promiseTargetDate
208
239
  if (date && date[0]) {
@@ -218,6 +249,15 @@ export default {
218
249
  } catch (error) {
219
250
  return ''
220
251
  }
252
+ },
253
+ getFormItemIndex(name = '') {
254
+ let index
255
+ this.formConfig.formItems.forEach((item, i) => {
256
+ if (item.prop === name) {
257
+ index = i
258
+ }
259
+ })
260
+ return index
221
261
  }
222
262
  }
223
263
  }
@@ -1,11 +1,16 @@
1
1
  <template>
2
2
  <div class="page-view">
3
3
  <div>
4
- <p class="page-view-title"><span class="start">*</span>发货时效性:</p>
4
+ <p class="page-view-title"><span v-if="!isView" class="start">*</span>发货时效性</p>
5
5
  <div style="margin-top: 17px">
6
- <el-radio v-model="materialSendType" label="1">整单立即发货</el-radio>
7
- <el-radio v-model="materialSendType" label="2">分批延迟发货</el-radio>
8
- <el-button v-show="showButotn" class="button-view" type="primary" @click="showBatchDialog">分批发货</el-button>
6
+ <div v-if="isView">
7
+ <p class="res-view">{{ deliveryTimeEffectiveness === '1' ? '整单立即发货' : '分批延迟发货' }}</p>
8
+ </div>
9
+ <div v-else>
10
+ <el-radio v-model="deliveryTimeEffectiveness" label="1">整单立即发货</el-radio>
11
+ <el-radio v-model="deliveryTimeEffectiveness" label="2">分批延迟发货</el-radio>
12
+ <el-button v-show="showButotn" class="button-view" type="primary" @click="showBatchDialog">分批发货</el-button>
13
+ </div>
9
14
  </div>
10
15
  </div>
11
16
  <OrderList v-if="showOrderList" :table-data="selectOrderList" :is-view="false" @removeSubOrder="removeSubOrder"></OrderList>
@@ -27,25 +32,42 @@ export default {
27
32
  default: () => {}
28
33
  }
29
34
  },
35
+ props: {
36
+ value: {
37
+ type: Object,
38
+ default() {
39
+ return {}
40
+ }
41
+ },
42
+ attrs: {
43
+ type: Object,
44
+ default() {
45
+ return {}
46
+ }
47
+ }
48
+ },
30
49
  data() {
31
50
  return {
32
- materialSendType: '1',
51
+ deliveryTimeEffectiveness: '1',
33
52
  showDialog: false,
34
53
  selectOrderList: []
35
54
  }
36
55
  },
37
56
  computed: {
57
+ isView() {
58
+ return this.attrs.isView
59
+ },
38
60
  showButotn() {
39
61
  const hasMaterial = this.formProps.applicationApplyMaterial?.length
40
62
  const hasMaterialQuantity = this.formProps.applicationApplyMaterial?.every((item) => item.materialQuantity)
41
- return this.materialSendType === '2' && hasMaterial && hasMaterialQuantity
63
+ return this.deliveryTimeEffectiveness === '2' && hasMaterial && hasMaterialQuantity
42
64
  },
43
65
  showOrderList() {
44
66
  return this.selectOrderList && this.selectOrderList.length > 0
45
67
  }
46
68
  },
47
69
  watch: {
48
- materialSendType: {
70
+ deliveryTimeEffectiveness: {
49
71
  handler(val) {
50
72
  val && this.onUpdate()
51
73
  },
@@ -59,6 +81,13 @@ export default {
59
81
  },
60
82
  immediate: true,
61
83
  deep: true
84
+ },
85
+ value: {
86
+ handler(val) {
87
+ this.deliveryTimeEffectiveness = val.deliveryTimeEffectiveness
88
+ this.selectOrderList = val.subOrderMaterialsPlans || []
89
+ },
90
+ immediate: true
62
91
  }
63
92
  },
64
93
  mounted() {},
@@ -74,7 +103,7 @@ export default {
74
103
  this.selectOrderList.splice(index, 1)
75
104
  },
76
105
  onUpdate() {
77
- this.$emit('input', { materialSendType: this.materialSendType, orderList: this.selectOrderList })
106
+ this.$emit('input', { deliveryTimeEffectiveness: this.deliveryTimeEffectiveness, subOrderMaterialsPlans: this.selectOrderList })
78
107
  }
79
108
  }
80
109
  }
@@ -97,4 +126,8 @@ export default {
97
126
  .button-view {
98
127
  display: inline-block;
99
128
  }
129
+ .res-view {
130
+ font-size: 14px;
131
+ margin-top: 20px;
132
+ }
100
133
  </style>
@@ -28,6 +28,11 @@ export default {
28
28
  components: {
29
29
  CustomShow
30
30
  },
31
+ inject: {
32
+ formProps: {
33
+ default: () => {}
34
+ }
35
+ },
31
36
  props: {
32
37
  value: {
33
38
  type: [Number, String, Array],
@@ -39,12 +44,6 @@ export default {
39
44
  return []
40
45
  }
41
46
  },
42
- extra: {
43
- type: Object,
44
- default() {
45
- return {}
46
- }
47
- },
48
47
  selectedText: {
49
48
  type: String,
50
49
  default: undefined
@@ -117,7 +116,7 @@ export default {
117
116
  customerName: this.selectName || '',
118
117
  page: 1,
119
118
  limit: 10,
120
- ...this.extra
119
+ belongCompany: this.formProps.belongCompany
121
120
  }
122
121
  this.loading = true
123
122
  getCustomerList(params)
@@ -21,6 +21,11 @@ export default {
21
21
  CustomerSelect,
22
22
  CustomShow
23
23
  },
24
+ inject: {
25
+ formProps: {
26
+ default: () => {}
27
+ }
28
+ },
24
29
  props: {
25
30
  value: {
26
31
  type: Object,
@@ -28,10 +33,6 @@ export default {
28
33
  return {}
29
34
  }
30
35
  },
31
- isView: {
32
- type: Boolean,
33
- default: false
34
- },
35
36
  attrs: {
36
37
  type: Object,
37
38
  default() {
@@ -46,6 +47,9 @@ export default {
46
47
  }
47
48
  },
48
49
  computed: {
50
+ isView() {
51
+ return this.attrs.isView
52
+ },
49
53
  showSelect() {
50
54
  return !this.myValue && !this.isView
51
55
  },
@@ -63,6 +67,13 @@ export default {
63
67
  handler() {
64
68
  this.setMyValue()
65
69
  }
70
+ },
71
+ 'formProps.belongCompany': {
72
+ handler(val) {
73
+ this.selectedItem = []
74
+ },
75
+ immediate: true,
76
+ deep: true
66
77
  }
67
78
  },
68
79
  methods: {
@@ -82,6 +82,7 @@ export default {
82
82
  : ''
83
83
  } else {
84
84
  // 如果是单选 就获取全部路径的值
85
+ console.log(this.myValue, 'this.myValuethis.myValuethis.myValue');
85
86
  return this.myValue ? this.getAllLabel(this.options, this.myValue) : ''
86
87
  }
87
88
  },
@@ -131,21 +132,21 @@ export default {
131
132
  this.getOptions()
132
133
  }
133
134
  },
134
- 'attrs.default': {
135
- immediate: true,
136
- handler(newVal, oldVal) {
137
- if (newVal) {
138
- if ((newVal !== oldVal && newVal === '2' && !this.value)) {
139
- this.myValue = this.dicValue
140
- } else {
141
- this.myValue = undefined
142
- }
143
- this.getOptions(() => {
144
- this.onChange()
145
- })
146
- }
147
- }
148
- },
135
+ // 'attrs.default': {
136
+ // immediate: true,
137
+ // handler(newVal, oldVal) {
138
+ // if (newVal) {
139
+ // if ((newVal !== oldVal && newVal === '2' && !this.value)) {
140
+ // this.myValue = this.dicValue
141
+ // } else {
142
+ // this.myValue = undefined
143
+ // }
144
+ // this.getOptions(() => {
145
+ // this.onChange()
146
+ // })
147
+ // }
148
+ // }
149
+ // },
149
150
  'attrs.defaultValue': {
150
151
  immediate: true,
151
152
  handler(newVal, oldVal) {
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page-view">
3
- <div class="text-left pb-2 mb-2 flex">
3
+ <div class="text-left pb-2 flex" style="margin-bottom: 12px; margin-top: 10px">
4
4
  <div class="flex">
5
5
  <div class="title-line"></div>
6
6
  <p class="title">产品信息</p>
@@ -68,12 +68,46 @@ export default {
68
68
  },
69
69
  deep: true,
70
70
  immediate: true
71
+ },
72
+ 'formProps.belongCompany': {
73
+ handler(val) {
74
+ this.tableData = []
75
+ },
76
+ immediate: true,
77
+ deep: true
78
+ },
79
+ 'formProps.applicationApplyCustomer': {
80
+ handler(val) {
81
+ this.tableData = []
82
+ },
83
+ immediate: true,
84
+ deep: true
71
85
  }
72
86
  },
73
87
  created() {
88
+ if (this.$bizui.bus) {
89
+ this.$bizui.bus.$on('applySubmit', (val) => {
90
+ this.handleValidate()
91
+ })
92
+ }
74
93
  this.handleTableData()
75
94
  },
76
95
  methods: {
96
+ handleValidate() {
97
+ this.tableData.forEach(item => {
98
+ if (!item.materialQuantity) {
99
+ this.$message.error('请检查物料数量')
100
+ item.valid = false
101
+ } else if (this.tableItemArr.includes('materialSchemeInfo') && !item.materialAssociatedMotherScheme) {
102
+ this.$message.error('请检查母方案信息')
103
+ item.valid = false
104
+ } else if (this.tableItemArr.includes('materialBatchInfo') && item.materialIsSpecifiedBatch === '1' && !item.materialBatch) {
105
+ this.$message.error('请检查批次号信息')
106
+ item.valid = false
107
+ }
108
+ })
109
+ this.onUpdate()
110
+ },
77
111
  handleTableData() {
78
112
  const allData = {
79
113
  baseInfo: this.baseInfo,
@@ -106,8 +140,15 @@ export default {
106
140
  * 更新数据
107
141
  */
108
142
  onUpdate() {
109
- this.$emit('input', this.tableData)
110
- this.$emit('change', this.tableData)
143
+ const data = JSON.parse(JSON.stringify(this.tableData))
144
+ // 删掉木方案选择列表
145
+ data.forEach(item => {
146
+ if (item.motherSchemeList) {
147
+ delete item.motherSchemeList
148
+ }
149
+ })
150
+ this.$emit('input', data)
151
+ this.$emit('change', data)
111
152
  }
112
153
  }
113
154
  }