This commit is contained in:
Vinjor 2024-11-15 15:39:21 +08:00
parent e99df47c2e
commit 9b9519176d
4 changed files with 35 additions and 6 deletions

View File

@ -98,6 +98,12 @@ export default {
default: () => {
return {}
}
},
userInfo: {
type: Object,
default: () => {
return {}
}
}
},
computed: {
@ -122,14 +128,11 @@ export default {
roleCanJd:false,
//---
roleCanSg:false,
//
userInfo:{},
ifLeader:false,
}
},
mounted(){
this.ifLeader = getStrData('ifLeader')
this.userInfo = getUserInfo()
if(this.userInfo.roleCodes.includes("service_advisor") || this.userInfo.roleCodes.includes("general_inspection") || (this.userInfo.roleCodes.includes("repair_staff") && getStrData("ifLeader"))){
//,
this.roleCanPg = true

View File

@ -3,13 +3,16 @@
<!--<VNavigationBar style="position: relative;z-index: 99;" leftTitle="true" backgroundColor="rgba(0,0,0,0)" title-color="#fff" title=" "></VNavigationBar>-->
<view class="bodyTopBg"></view>
<view class="body">
<view style="text-align: left;margin: 0 32rpx" >
<text class="company-text">{{ companyInfo.simpleName || companyInfo.corpName }}</text>
</view>
<view class="userInfoBox" >
<image @click="showUserDetail" style="width: 104rpx;height: 104rpx;border-radius: 50%;" v-if="''==userInfo.avatar || null == userInfo.avatar" :src="defaultAvatar" mode="scaleToFill" @error="avatarErr"></image>
<image @click="showUserDetail" style="width: 104rpx;height: 104rpx;border-radius: 50%;" v-else :src="imgUrlPrex+userInfo.avatar" mode="scaleToFill" @error="avatarErr"></image>
<view class="userInfo" @click="showUserDetail">
<text class="userName">{{ userInfo.nickname }}</text>
<text class="userType">{{ userInfo.roleNames }}</text>
<text class="userType" v-if="ifLeader">班组长</text>
<text class="userType" v-if="ifLeader || ifLeader=='true'">班组长</text>
</view>
<view class="msg-box" @click="gotoMsg">
<image mode="aspectFita" src="@/pages-home/static/msg.png" style="width: 48rpx;height: 48rpx"></image>
@ -97,7 +100,7 @@
<view class="todoList">
<scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<order-card v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @doVoid="doVoidReq" @getOrder="openFile" @startWork="startWork" @addProj="addProj"></order-card>
<order-card :userInfo="userInfo" v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @doVoid="doVoidReq" @getOrder="openFile" @startWork="startWork" @addProj="addProj"></order-card>
<view style="text-align: center" v-if="orderList.length==0">
<image class="" src="@/static/images/nothing.png" ></image>
</view>
@ -231,6 +234,8 @@ export default {
//
tellCusText:"",
ifLeader:false,
//
companyInfo:{},
}
},
onLoad(){
@ -239,6 +244,7 @@ export default {
url: '/pages/login/login'
})
}else{
this.companyInfo = getJSONData("companyInfo")
if(!this.$msgSocket){
this.$startMsgSocket(getTenantId(),getStrData("userId"))
}
@ -751,6 +757,12 @@ export default {
overflow: auto;
padding-bottom: 30rpx;
}
.company-text {
font-size: 30rpx;
font-weight: bold;
display: inline-block;
padding: 8rpx 16rpx;
}
.userInfoBox {
margin: 0 32rpx 40rpx;

View File

@ -85,7 +85,7 @@
<view v-if="ticketWares.length==0 && active!=3" style="text-align: center">
<image class="" src="@/static/images/nothing.png"></image>
</view>
<order-card v-if="active==3" v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @doVoid="doVoidReq" @getOrder="openFile" @startWork="startWork" @addProj="addProj"></order-card>
<order-card :userInfo="userInfo" v-if="active==3" v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @doVoid="doVoidReq" @getOrder="openFile" @startWork="startWork" @addProj="addProj"></order-card>
<view style="text-align: center" v-if="orderList.length==0 && active==3">
<image class="" src="@/static/images/nothing.png" ></image>
</view>

View File

@ -163,6 +163,8 @@
setToken(res.data.loginResult.accessToken)
setUserInfo(res.data.userinfo)
setStrData("userId",res.data.userinfo.id)
//
this.getCompanyInfo()
this.getNoReadNum()
if(res.data.userinfo.roleCodes.includes("repair_staff")){
//
@ -320,6 +322,18 @@
}
})
},
async getCompanyInfo(){
await request({
url: "/admin-api/base/company/getCompanyByTenantId",
method: "GET",
params:{tenantId:getTenantId(),systemCode:"weixiu"}
}).then((res) => {
if(res.code==200){
setJSONData("companyInfo",res.data)
console.log(res.data,"企业信息")
}
})
},
dianyidain() {
if(!this.ifPlay){
console.log('执行了dianyidain');