Browse Source

角色编码修改

master
孙家正 2 years ago
parent
commit
db4c5c51ab
  1. 2
      pages/home/index.vue
  2. 4
      pages/home/login.vue
  3. 4
      pages/home/personalInfo.vue
  4. 4
      pages/massif/info.vue
  5. 4
      pages/massif/plant_plan.vue
  6. 2
      pages/warehouse/info.vue

2
pages/home/index.vue

@ -351,7 +351,7 @@ import request,{host} from '@/common/request'
}, },
computed:{ computed:{
isAdmin(){ isAdmin(){
return this.$store.getters.userInfo.roleCode=='companyAdmin' return this.$store.getters.userInfo.roleCode=='company_admin'
}, },
isEmpty(){ isEmpty(){
if(!this.baseIndex)return (this.baseInfo.farmWork||[]).length+(this.baseInfo.farmingInput||[]).length<=0 if(!this.baseIndex)return (this.baseInfo.farmWork||[]).length+(this.baseInfo.farmingInput||[]).length<=0

4
pages/home/login.vue

@ -49,9 +49,9 @@
<view class="item"> <view class="item">
<text class="plant-icon2"/> <input placeholder="请输入密码" type="password" v-model="formData.password"/> <text class="plant-icon2"/> <input placeholder="请输入密码" type="password" v-model="formData.password"/>
</view> </view>
<u-checkbox-group v-model="demo" shape="circle"> <!-- <u-checkbox-group v-model="demo" shape="circle">
<u-checkbox label="使用溯源系统账号登录并同步企业信息"/> <u-checkbox label="使用溯源系统账号登录并同步企业信息"/>
</u-checkbox-group> </u-checkbox-group> -->
<button class="cu-btn round bg-green shadow submit" @click="login">登录</button> <button class="cu-btn round bg-green shadow submit" @click="login">登录</button>

4
pages/home/personalInfo.vue

@ -53,8 +53,8 @@ import request,{host} from '@/common/request'
host:host('imgUrl'), host:host('imgUrl'),
identity:{ identity:{
admin:"管理员", admin:"管理员",
baseAdmin:"基地管理员", base_admin:"基地管理员",
companyAdmin:"企业管理员", company_admin:"企业管理员",
majingfu:"第三方登录", majingfu:"第三方登录",
third_role:"第三方登录角色", third_role:"第三方登录角色",
} }

4
pages/massif/info.vue

@ -31,7 +31,7 @@ import request from '@/common/request'
data(){ data(){
return{ return{
fields:{ fields:{
plantBaseInfoId:{label:"基地名称",type:"select",columns:[[]],value:[],disabled:this.$store.getters['userInfo'].roleCode=="baseAdmin"}, plantBaseInfoId:{label:"基地名称",type:"select",columns:[[]],value:[],disabled:this.$store.getters['userInfo'].roleCode=="base_admin"},
plotNumber:{label:"地块编号"}, plotNumber:{label:"地块编号"},
plotName:{label:"地块名称"}, plotName:{label:"地块名称"},
drawArea:{label:"地块面积(亩)",type:'digit'}, drawArea:{label:"地块面积(亩)",type:'digit'},
@ -78,7 +78,7 @@ import request from '@/common/request'
await this.init() await this.init()
if(options.id){ if(options.id){
this.getDetail(options.id) this.getDetail(options.id)
}else if(this.$store.getters['userInfo'].roleCode=="baseAdmin"){ }else if(this.$store.getters['userInfo'].roleCode=="base_admin"){
var baseVal=this.fields.plantBaseInfoId.columns[0].find(v=>v.value==this.$store.state.baseInfo.id) var baseVal=this.fields.plantBaseInfoId.columns[0].find(v=>v.value==this.$store.state.baseInfo.id)
if(baseVal){ if(baseVal){
this.formData.plantBaseInfoId=baseVal.value this.formData.plantBaseInfoId=baseVal.value

4
pages/massif/plant_plan.vue

@ -47,7 +47,7 @@ export default {
{label:"普通",value:'4'}, {label:"普通",value:'4'},
]}, ]},
plantBatch:{label:"种植批次号",btnText:"生成",btnFun:()=>this.formData.plantBatch=`ZZ${new Date().format('yyyyMMdd')}${new Date().getTime()}`}, plantBatch:{label:"种植批次号",btnText:"生成",btnFun:()=>this.formData.plantBatch=`ZZ${new Date().format('yyyyMMdd')}${new Date().getTime()}`},
principal:{label:"负责人",disabled:/^baseAdmin$|^companyAdmin$/.test(this.$store.getters.userInfo.roleCode)}, principal:{label:"负责人",disabled:/^base_admin|^company_admin/.test(this.$store.getters.userInfo.roleCode)},
principalId:{label:"负责人身份证"}, principalId:{label:"负责人身份证"},
productIntroduce:{label:"产品介绍",type:"textarea"}, productIntroduce:{label:"产品介绍",type:"textarea"},
}, },
@ -98,7 +98,7 @@ export default {
options.plotId && (this.formData.plotId=options.plotId) options.plotId && (this.formData.plotId=options.plotId)
if(options.id){ if(options.id){
this.getDetail(options.id) this.getDetail(options.id)
}else if(/^baseAdmin$|^companyAdmin$/.test(this.$store.getters.userInfo.roleCode)){ }else if(/^base_admin|^company_admin/.test(this.$store.getters.userInfo.roleCode)){
this.formData.principal=this.$store.getters.userInfo.realname this.formData.principal=this.$store.getters.userInfo.realname
} }
}, },

2
pages/warehouse/info.vue

@ -79,7 +79,7 @@ import request from '@/common/request.js'
this.fields.warehousePic.value=e.warehousePic.join(',') this.fields.warehousePic.value=e.warehousePic.join(',')
this.fields.warehouseType.value=[e.warehouseType] this.fields.warehouseType.value=[e.warehouseType]
this.fields.goodsType.value=[e.goodsType] this.fields.goodsType.value=[e.goodsType]
}else if(this.$store.getters['userInfo'].roleCode=="baseAdmin"){ }else if(this.$store.getters['userInfo'].roleCode=="base_admin"){
// this.formData.contactPeople=this.$store.getters['userInfo'].realname // this.formData.contactPeople=this.$store.getters['userInfo'].realname
// this.formData.contactNumber=this.$store.getters['userInfo'].phone // this.formData.contactNumber=this.$store.getters['userInfo'].phone
} }

Loading…
Cancel
Save