imeik-bizui 0.3.0 → 0.3.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.
@@ -37,7 +37,6 @@ export default {
37
37
  },
38
38
  data() {
39
39
  return {
40
- isView: false,
41
40
  formConfig: {
42
41
  column: 4,
43
42
  gutter: 24,
@@ -53,6 +52,9 @@ export default {
53
52
  }
54
53
  },
55
54
  computed: {
55
+ isView() {
56
+ return !!this.attrs.isView
57
+ },
56
58
  belongCompany() {
57
59
  return this.formProps.applicationApplyCustomer?.invoiceCompanyCode || ''
58
60
  },
@@ -82,6 +84,12 @@ export default {
82
84
  }
83
85
  },
84
86
  watch: {
87
+ value: {
88
+ handler(val) {
89
+ this.formConfig.props = val
90
+ },
91
+ immediate: true
92
+ },
85
93
  formItems: {
86
94
  handler(val) {
87
95
  this.formConfig.formItems = val
@@ -16,21 +16,21 @@
16
16
  <p class="materialSubName">包装规格:{{ row.materialSpecification }}</p>
17
17
  <p class="materialSubName">计量单位:{{ row.materialUnit }}</p>
18
18
  </template>
19
- <template slot="useCount" slot-scope="{ row }">
20
- <p v-if="isView">{{ row.useCount }}</p>
19
+ <template slot="deliveryQuantity" slot-scope="{ row }">
20
+ <p v-if="isView">{{ row.deliveryQuantity }}</p>
21
21
  <div v-else>
22
- <el-input v-model="row.useCount" :class="{ error: row.quantityError }" placeholder="请输入" @input="handleInput(row)"></el-input>
22
+ <el-input v-model="row.deliveryQuantity" :class="{ error: row.quantityError }" placeholder="请输入" @input="handleInput(row)"></el-input>
23
23
  <p v-if="row.quantityError" class="materialSubName" style="margin-top: 10px; color: red">发货数量不能大于剩余发货数量</p>
24
24
  <p class="materialSubName" style="margin-top: 10px">剩余发货数量:{{ row.currentSurplusQuantity }}盒</p>
25
25
  </div>
26
26
  </template>
27
- <template slot="materialQuantityTime" slot-scope="{ row }">
28
- <p v-if="isView">{{ row.materialQuantityTime }}</p>
29
- <el-date-picker v-else v-model="row.materialQuantityTime" value-format="yyyy-MM-dd" type="date" placeholder="选择日期"> </el-date-picker>
27
+ <template slot="planDeliveryTime" slot-scope="{ row }">
28
+ <p v-if="isView">{{ row.planDeliveryTime }}</p>
29
+ <el-date-picker v-else v-model="row.planDeliveryTime" :picker-options="pickerOptionsHandle" value-format="yyyy-MM-dd" type="date" placeholder="选择日期"> </el-date-picker>
30
30
  </template>
31
- <template slot="remarks" slot-scope="{ row }">
32
- <el-input v-if="!isView" v-model="row.remarks" type="textarea" :rows="5" show-word-limit maxlength="100" placeholder="请输入"></el-input>
33
- <div v-else>{{ row.remarks || '-' }}</div>
31
+ <template slot="remark" slot-scope="{ row }">
32
+ <el-input v-if="!isView" v-model="row.remark" type="textarea" :rows="5" show-word-limit maxlength="100" placeholder="请输入"></el-input>
33
+ <div v-else>{{ row.remark || '-' }}</div>
34
34
  </template>
35
35
  </ImTable>
36
36
  </div>
@@ -87,33 +87,38 @@ export default {
87
87
  }
88
88
  },
89
89
  {
90
- prop: 'useCount',
90
+ prop: 'deliveryQuantity',
91
91
  label: '发货数量',
92
92
  type: 'slot',
93
- slot: 'useCount',
93
+ slot: 'deliveryQuantity',
94
94
  attrs: {
95
95
  'min-width': '180'
96
96
  }
97
97
  },
98
98
  {
99
- prop: 'materialQuantityTime',
99
+ prop: 'planDeliveryTime',
100
100
  label: '发货时间',
101
101
  type: 'slot',
102
- slot: 'materialQuantityTime',
102
+ slot: 'planDeliveryTime',
103
103
  attrs: {
104
104
  'min-width': '240'
105
105
  }
106
106
  },
107
107
  {
108
- prop: 'remarks',
108
+ prop: 'remark',
109
109
  label: '备注',
110
110
  type: 'slot',
111
- slot: 'remarks',
111
+ slot: 'remark',
112
112
  attrs: {
113
113
  'min-width': '160'
114
114
  }
115
115
  }
116
- ]
116
+ ],
117
+ pickerOptionsHandle: {
118
+ disabledDate(time) {
119
+ return time.getTime() < Date.now() - 8.64e7
120
+ }
121
+ }
117
122
  }
118
123
  }
119
124
  },
@@ -140,7 +145,7 @@ export default {
140
145
  item.currentSurplusQuantity = Number(item.currentQuantityCount)
141
146
  allSelectData.forEach((item2) => {
142
147
  if (item.productCode === item2.productCode) {
143
- item.currentQuantityCount = (item.currentQuantityCount || Number(item.materialQuantity)) - Number(item2.useCount)
148
+ item.currentQuantityCount = (item.currentQuantityCount || Number(item.materialQuantity)) - Number(item2.deliveryQuantity)
144
149
  item.currentSurplusQuantity = Number(item.currentQuantityCount)
145
150
  }
146
151
  })
@@ -160,7 +165,7 @@ export default {
160
165
  },
161
166
  handleInput(row) {
162
167
  // 过滤掉非数字字符,并确保是正整数
163
- row.useCount = row.useCount.replace(/^(0+)|[^\d]+/g, '')
168
+ row.deliveryQuantity = row.deliveryQuantity.replace(/^(0+)|[^\d]+/g, '')
164
169
  this.setSurplusQuantityNumber(row)
165
170
  },
166
171
  // 设置剩余数量
@@ -168,7 +173,7 @@ export default {
168
173
  // currentQuantityCount 是分批之后当前物料实际剩余量数据
169
174
  const currentCount = row.currentQuantityCount
170
175
  // 再次计算剩余量
171
- const surplusQuantity = currentCount - Number(row.useCount)
176
+ const surplusQuantity = currentCount - Number(row.deliveryQuantity)
172
177
  if (surplusQuantity < 0) {
173
178
  row.currentSurplusQuantity = currentCount
174
179
  row.quantityError = true
@@ -186,11 +191,11 @@ export default {
186
191
  return null
187
192
  }
188
193
  data.forEach((item, index) => {
189
- if (item.useCount && item.materialQuantityTime && !item.quantityError) {
194
+ if (item.deliveryQuantity && item.planDeliveryTime && !item.quantityError) {
190
195
  // 清空已经要入组的数据
191
- this.tableConfig.data[index].useCount = ''
192
- this.tableConfig.data[index].remarks = ''
193
- this.tableConfig.data[index].materialQuantityTime = ''
196
+ this.tableConfig.data[index].deliveryQuantity = ''
197
+ this.tableConfig.data[index].remark = ''
198
+ this.tableConfig.data[index].planDeliveryTime = ''
194
199
  this.tableConfig.data[index].currentQuantityCount = item.currentSurplusQuantity
195
200
  reslut.push(item)
196
201
  }
@@ -207,7 +212,7 @@ export default {
207
212
  this.tableConfig.data.forEach((item, index) => {
208
213
  recordData.forEach((record) => {
209
214
  if (item.productCode === record.productCode) {
210
- item.currentQuantityCount = Number(item.currentQuantityCount) + Number(record.useCount)
215
+ item.currentQuantityCount = Number(item.currentQuantityCount) + Number(record.deliveryQuantity)
211
216
  item.currentSurplusQuantity = item.currentQuantityCount
212
217
  this.$set(this.tableConfig.data, index, { ...item })
213
218
  }
@@ -1,10 +1,12 @@
1
1
  <template>
2
2
  <div class="page-view">
3
3
  <div>
4
- <span>发货时效性:</span>
5
- <el-radio v-model="radio" label="1">整单立即发货</el-radio>
6
- <el-radio v-model="radio" label="2">分批延迟发货</el-radio>
7
- <el-button v-show="showButotn" type="primary" @click="showBatchDialog">分批发货</el-button>
4
+ <p class="page-view-title"><span class="start">*</span>发货时效性:</p>
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>
9
+ </div>
8
10
  </div>
9
11
  <OrderList v-if="showOrderList" :table-data="selectOrderList" :is-view="false" @removeSubOrder="removeSubOrder"></OrderList>
10
12
  <BatchDialog :show.sync="showDialog" :selected-data="selectOrderList" @onConfirm="onConfirm"></BatchDialog>
@@ -27,7 +29,7 @@ export default {
27
29
  },
28
30
  data() {
29
31
  return {
30
- radio: '1',
32
+ materialSendType: '1',
31
33
  showDialog: false,
32
34
  selectOrderList: []
33
35
  }
@@ -35,15 +37,30 @@ export default {
35
37
  computed: {
36
38
  showButotn() {
37
39
  const hasMaterial = this.formProps.applicationApplyMaterial?.length
38
- const hasMaterialQuantity = this.formProps.applicationApplyMaterial?.every(
39
- item => item.materialQuantity
40
- )
41
- return this.radio === '2' && hasMaterial && hasMaterialQuantity
40
+ const hasMaterialQuantity = this.formProps.applicationApplyMaterial?.every((item) => item.materialQuantity)
41
+ return this.materialSendType === '2' && hasMaterial && hasMaterialQuantity
42
42
  },
43
43
  showOrderList() {
44
44
  return this.selectOrderList && this.selectOrderList.length > 0
45
45
  }
46
46
  },
47
+ watch: {
48
+ materialSendType: {
49
+ handler(val) {
50
+ val && this.onUpdate()
51
+ },
52
+ immediate: true
53
+ },
54
+ selectOrderList: {
55
+ handler(val) {
56
+ if (val && val.length) {
57
+ this.onUpdate()
58
+ }
59
+ },
60
+ immediate: true,
61
+ deep: true
62
+ }
63
+ },
47
64
  mounted() {},
48
65
  methods: {
49
66
  showBatchDialog() {
@@ -55,8 +72,29 @@ export default {
55
72
  },
56
73
  removeSubOrder(data, index) {
57
74
  this.selectOrderList.splice(index, 1)
75
+ },
76
+ onUpdate() {
77
+ this.$emit('input', { materialSendType: this.materialSendType, orderList: this.selectOrderList })
58
78
  }
59
79
  }
60
80
  }
61
81
  </script>
62
- <style lang="scss" scoped></style>
82
+ <style lang="scss" scoped>
83
+ .page-view-title {
84
+ font-size: 14px;
85
+ color: #333333;
86
+ line-height: 16px;
87
+ .start {
88
+ font-size: 14px;
89
+ color: #e02020;
90
+ line-height: 16px;
91
+ margin-right: 10px;
92
+ }
93
+ }
94
+ .page-view {
95
+ margin-top: 20px;
96
+ }
97
+ .button-view {
98
+ display: inline-block;
99
+ }
100
+ </style>
@@ -1,7 +1,6 @@
1
1
  <template>
2
2
  <div class="page-view">
3
- <!-- <p class="mb-1">申请内容说明</p> -->
4
- <FieldInput v-model="descript" :attrs="attrs"></FieldInput>
3
+ <FieldInput v-model="descript" :attrs="{ ...myAttrs, isView }"></FieldInput>
5
4
  </div>
6
5
  </template>
7
6
 
@@ -13,46 +12,66 @@ export default {
13
12
  default: () => {}
14
13
  }
15
14
  },
15
+ props: {
16
+ value: {
17
+ type: String,
18
+ default: ''
19
+ },
20
+ attrs: {
21
+ type: Object,
22
+ default() {
23
+ return {}
24
+ }
25
+ }
26
+ },
16
27
  data() {
17
28
  return {
18
29
  descript: '',
19
- attrs: {
30
+ myAttrs: {
20
31
  type: 'textarea',
21
32
  rows: 4,
22
33
  bottomText: ''
23
34
  }
24
35
  }
25
36
  },
37
+ computed: {
38
+ isView() {
39
+ return !!this.attrs.isView
40
+ }
41
+ },
26
42
  watch: {
27
- formProps: {
43
+ 'formProps.applyTypeInfo.applyType': {
28
44
  handler(val) {
29
- this.setBottomText()
45
+ val && this.setBottomText()
30
46
  },
31
47
  immediate: true,
32
48
  deep: true
49
+ },
50
+ value: {
51
+ handler(val) {
52
+ this.descript = val
53
+ },
54
+ immediate: true
33
55
  }
34
56
  },
35
57
  mounted() {
36
- console.log(this.formProps, 'formProps')
58
+ console.log(this.formProps, 'formProps111222')
37
59
  },
38
60
  methods: {
39
61
  setBottomText() {
40
- console.log(this.formProps, 'this.formProps')
41
- if (this.formProps?.applyType?.applyType === 1) {
42
- this.attrs.bottomText = '①术前照片要求与此申请一起提交,术后照片及反馈资料要求注射后一周内发给商务助理;②提供医生签字或者机构盖章的上市后临床研究协议的电子版照片;③纸质版协议寄回给商务助理。'
43
- }
44
- if (this.formProps?.applyType?.applyType === 2) {
45
- this.attrs.bottomText = '①提供医生签字或者机构盖章的合作意向书/技术服务合同,需总经理签字;②若需要机构伦理委员会审批提供审批结果;③研究周期及预期成果需注明资料反馈时间。'
46
- }
47
- if (this.formProps?.applyType?.applyType === 3) {
48
- this.attrs.bottomText = '①提供机构盖章的合作协议或技术服务合同;②若需要机构伦理委员会审批提供审批结果。'
62
+ const applyType = this.formProps?.applyTypeInfo?.applyType
63
+ if (!applyType) {
64
+ return
49
65
  }
50
- if (this.formProps?.applyType?.applyType === 4) {
51
- this.attrs.bottomText = '①提供医生签字或者机构盖章的合作意向书或技术服务合同;②若需要机构伦理委员会审批提供审批结果。'
66
+ const bottomTextMap = {
67
+ 1: '①术前照片要求与此申请一起提交,术后照片及反馈资料要求注射后一周内发给商务助理;②提供医生签字或者机构盖章的上市后临床研究协议的电子版照片;③纸质版协议寄回给商务助理。',
68
+ 2: '①提供医生签字或者机构盖章的合作意向书/技术服务合同,需总经理签字;②若需要机构伦理委员会审批提供审批结果;③研究周期及预期成果需注明资料反馈时间。',
69
+ 3: '①提供机构盖章的合作协议或技术服务合同;②若需要机构伦理委员会审批提供审批结果。',
70
+ 4: '①提供医生签字或者机构盖章的合作意向书或技术服务合同;②若需要机构伦理委员会审批提供审批结果。'
52
71
  }
72
+ this.myAttrs.bottomText = bottomTextMap[applyType] || ''
53
73
  }
54
74
  }
55
75
  }
56
76
  </script>
57
- <style lang="scss" scoped>
58
- </style>
77
+ <style lang="scss" scoped></style>
@@ -79,7 +79,7 @@
79
79
  <p v-if="row.materialReceivingAddressType" class="address-info">收货类型:{{ formatData(row.materialReceivingAddressType, 'materialReceivingAddressType') }}</p>
80
80
  <p class="address-info">地址信息:{{ row.materialReceivingContact }} {{ row.materialReceivingContactNumber }}</p>
81
81
  <p class="address-info">收货地址:{{ row.materialReceivingAddress }}</p>
82
- <p class="address" @click="changeAddressInfo(row, $index)">修改收货地址</p>
82
+ <p v-if="!isView" class="address" @click="changeAddressInfo(row, $index)">修改收货地址</p>
83
83
  </template>
84
84
  <template slot="operate" slot-scope="{ row, $index }">
85
85
  <el-button class="delete-button" type="text" @click="deleteProduct(row, $index)">移除</el-button>
@@ -277,7 +277,6 @@ export default {
277
277
  }
278
278
  },
279
279
  mounted() {
280
- this.tableConfig.data = []
281
280
  },
282
281
  methods: {
283
282
  getMaterialOtherData() {
@@ -5,12 +5,12 @@
5
5
  <div class="title-line"></div>
6
6
  <p class="title">产品信息</p>
7
7
  </div>
8
- <el-button type="primary" class="add-button" @click="showProductListSelect">
8
+ <el-button v-if="!isView" type="primary" class="add-button" @click="showProductListSelect">
9
9
  <i class="el-icon-plus"></i>
10
10
  添加
11
11
  </el-button>
12
12
  </div>
13
- <ProductList :table-data="tableData" :table-item-arr="tableItemArr" @removeItem="onRemoveItem"></ProductList>
13
+ <ProductList :table-data="tableData" :is-view="isView" :table-item-arr="tableItemArr" @removeItem="onRemoveItem"></ProductList>
14
14
  <SelectProductDialog ref="selectProductDialog" @addProduct="addProduct"></SelectProductDialog>
15
15
  </div>
16
16
  </template>
@@ -36,10 +36,6 @@ export default {
36
36
  return []
37
37
  }
38
38
  },
39
- isView: {
40
- type: Boolean,
41
- default: false
42
- },
43
39
  attrs: {
44
40
  type: Object,
45
41
  default() {
@@ -51,7 +47,7 @@ export default {
51
47
  return {
52
48
  tableData: [],
53
49
  tableItemArr: [], // 总列数组
54
- baseInfo: ['materialBasicsInfo', 'materialCountInfo', 'operate'], // 基础列
50
+ baseInfo: ['materialBasicsInfo', 'materialCountInfo'], // 基础列
55
51
  budget: ['materialBudgetInfo'], // 预算列
56
52
  scheme: ['materialSchemeInfo'], // 母方案列
57
53
  batch: ['materialBatchInfo'], // 批次列
@@ -60,7 +56,19 @@ export default {
60
56
  showAddButton: false
61
57
  }
62
58
  },
59
+ computed: {
60
+ isView() {
61
+ return !!this.attrs.isView
62
+ }
63
+ },
63
64
  watch: {
65
+ value: {
66
+ handler(val) {
67
+ this.tableData = val
68
+ },
69
+ deep: true,
70
+ immediate: true
71
+ }
64
72
  },
65
73
  created() {
66
74
  this.handleTableData()
@@ -78,6 +86,10 @@ export default {
78
86
  this.attrs.materialConfig?.forEach(item => {
79
87
  this.tableItemArr = this.tableItemArr.concat(allData[item])
80
88
  })
89
+ // 不是查看就添加操作列
90
+ if (!this.isView) {
91
+ this.tableItemArr.push('operate')
92
+ }
81
93
  },
82
94
  showProductListSelect() {
83
95
  this.$refs.selectProductDialog.show()
@@ -124,7 +124,8 @@ export default {
124
124
  showAllLevels: false,
125
125
  multiple: this.isMultiple,
126
126
  serverUrl: this.tagValueUrl,
127
- optionFilterValues: this.optionFilterValues
127
+ optionFilterValues: this.optionFilterValues,
128
+ isView: this.attrs?.isView
128
129
  }
129
130
  }
130
131
  },
@@ -12,6 +12,12 @@ export function getService(baseUrlMap) {
12
12
  (config) => {
13
13
  // 需要在请求的时候再获取环境变量,因为js加载立即执行会导致$bizui中没有值
14
14
  const $bizui = Vue.prototype.$bizui
15
+ // const $bizui = {
16
+ // env: 'testenv',
17
+ // userTokenFunc: () => {
18
+ // return 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMzEyMTg4OTk1MyIsImF1ZCI6ImFkbWluIiwiY3JlYXRlZCI6MTc0MTYxOTE5MTc5NiwiZW1wbG95ZWVDb2RlIjoxNzQxNjE5MTkxNzk2fQ.4tRoat0n_iVwgylaMqkVcEL_T7LB6BkPUMbEzcRFiivmj2La4rgQMob5jja-NjI4ZFSz6A2YIps36528LbfW2w'
19
+ // }
20
+ // }
15
21
  config.baseURL = config.isTag ? '' : baseUrlMap[$bizui.env]
16
22
  // 将获取token的方法传入,防止初始化的时候token为空
17
23
  if ($bizui.userTokenFunc && typeof $bizui.userTokenFunc === 'function') {