|
|
@@ -595,12 +595,18 @@
|
|
|
? res.value.relatedUnits.split(',')
|
|
|
: [],
|
|
|
relatedItems: result.relatedItems,
|
|
|
- // 构建区域级联数据
|
|
|
- areaCode: [
|
|
|
+ }
|
|
|
+ // 构建区域级联数据
|
|
|
+ if (res.value.areaLevel == 0) {
|
|
|
+ this.formData.areaCode = [res.value.province]
|
|
|
+ } else if (res.value.areaLevel == 1) {
|
|
|
+ this.formData.areaCode = [res.value.province, res.value.city]
|
|
|
+ } else if (res.value.areaLevel == 2) {
|
|
|
+ this.formData.areaCode = [
|
|
|
res.value.province,
|
|
|
- ...(res.value.areaLevel >= 1 ? [res.value.city] : []),
|
|
|
- ...(res.value.areaLevel === 2 ? [res.value.county] : []),
|
|
|
- ].filter(Boolean),
|
|
|
+ res.value.city,
|
|
|
+ res.value.county,
|
|
|
+ ]
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -765,6 +771,22 @@
|
|
|
? this.formData.areaCode[this.formData.areaCode.length - 1]
|
|
|
: '',
|
|
|
}
|
|
|
+ let user = this.$permission.getUserInfo()
|
|
|
+ const areaCodeLength = this.formData.areaCode.length
|
|
|
+ if (user.dataScope === 0) {
|
|
|
+ submitData.areaLevel = areaCodeLength - 1
|
|
|
+ console.log('user.dataScope', user.dataScope)
|
|
|
+ console.log('areaCodeLength', areaCodeLength)
|
|
|
+ console.log('submitData.areaLevel', submitData.areaLevel)
|
|
|
+ } else if (user.dataScope === 1 || user.dataScope === 2) {
|
|
|
+ submitData.areaLevel = areaCodeLength
|
|
|
+ console.log('user.dataScope', user.dataScope)
|
|
|
+ console.log('areaCodeLength', areaCodeLength)
|
|
|
+ console.log('submitData.areaLevel', submitData.areaLevel)
|
|
|
+ } else {
|
|
|
+ // 处理其他可能的数据范围值,提供默认值
|
|
|
+ submitData.areaLevel = 0
|
|
|
+ }
|
|
|
|
|
|
// 根据是否有unitId判断是添加还是修改操作
|
|
|
let result
|