af-mobile-client-vue3 1.4.28 → 1.4.30

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "af-mobile-client-vue3",
3
3
  "type": "module",
4
- "version": "1.4.28",
4
+ "version": "1.4.30",
5
5
  "packageManager": "pnpm@10.13.1",
6
6
  "description": "Vue + Vite component lib",
7
7
  "engines": {
@@ -98,6 +98,7 @@ interface OtherChargeConfig {
98
98
  calculatePreByCollection: boolean
99
99
  printLogic: string
100
100
  submitLogic: string
101
+ updatePriceRoles: string[]
101
102
  fileTypes?: {
102
103
  userType: string
103
104
  picMinNum: number
@@ -145,6 +146,35 @@ const config = reactive<Partial<OtherChargeConfig>>({
145
146
  printLogic: '',
146
147
  fileTypes: [],
147
148
  submitLogic: '',
149
+ updatePriceRoles: [],
150
+ })
151
+ // 判断当前用户是否是更新价格角色
152
+ const isUpdatePriceRole = computed(() => {
153
+ // 检查配置是否存在且不为空数组
154
+ if (!Array.isArray(config.updatePriceRoles) || config.updatePriceRoles.length === 0) {
155
+ return false
156
+ }
157
+
158
+ // 检查用户角色信息是否存在
159
+ if (!currUser?.resources?.f_role_name || typeof currUser.resources.f_role_name !== 'string') {
160
+ return false
161
+ }
162
+
163
+ // 如果配置中包含"全部"角色,直接返回true
164
+ if (config.updatePriceRoles.includes('全部')) {
165
+ return true
166
+ }
167
+
168
+ // 分割用户角色字符串并清理空值
169
+ const userRoles = currUser.resources.f_role_name
170
+ .split(' ')
171
+ .map(role => role.trim())
172
+ .filter(role => role.length > 0)
173
+
174
+ // 检查用户角色是否在配置的角色列表中
175
+ return config.updatePriceRoles.some(role =>
176
+ userRoles.includes(role),
177
+ )
148
178
  })
149
179
 
150
180
  const gridFileUploaderRef = ref()
@@ -474,6 +504,7 @@ function onFileRemoved(): void {
474
504
  :index="index"
475
505
  :is-work-order="props.isWorkOrder"
476
506
  :work-order-data="props.workOrderData"
507
+ :is-update-price="isUpdatePriceRole"
477
508
  @remove="removeChargeItem"
478
509
  @update="updateChargeItem"
479
510
  />
@@ -19,6 +19,7 @@ const props = defineProps<{
19
19
  index: number
20
20
  isWorkOrder?: boolean
21
21
  workOrderData?: any
22
+ isUpdatePrice?: boolean
22
23
  }>()
23
24
 
24
25
  const emit = defineEmits<{
@@ -162,6 +163,7 @@ function updateItem() {
162
163
  <VanField
163
164
  :model-value="localUnitPrice"
164
165
  type="number"
166
+ :disabled="!isUpdatePrice"
165
167
  placeholder="限制9位整数2位小数"
166
168
  @update:model-value="handleUnitPriceChange"
167
169
  >