|
@@ -24,10 +24,15 @@
|
|
|
</uni-section>
|
|
|
</view>
|
|
|
<!-- <view class="business-btn uni-row" v-if="showOther" @click="handleRecerptSfprod"><text class="label">半成品接收</text></view> -->
|
|
|
- <view class="business-btn uni-row" v-if="showOther" @click="handeleToReportHistory"><text class="label">我的报工</text></view>
|
|
|
- <view class="business-btn uni-row" v-if="showOther" @click="handleToProductionPlan"><text class="label">报工</text></view>
|
|
|
+ <view class="business-btn uni-row" v-if="showOther" @click="handeleToReportHistory"><text
|
|
|
+ class="label">我的报工</text></view>
|
|
|
+ <view class="business-btn uni-row" v-if="showOther" @click="handleFastToProductionPlan"><text
|
|
|
+ class="label">快速报工</text></view>
|
|
|
+ <view class="business-btn uni-row" v-if="showOther" @click="handleToProductionPlan"><text
|
|
|
+ class="label">报工</text></view>
|
|
|
<!-- v-hasRoles="['porter']" 可通过v-Roles自定义指令进行显隐 -->
|
|
|
- <view class="business-btn uni-row" v-if="showTurn" @click="handleToHandlingList"><text class="label">周转</text></view>
|
|
|
+ <view class="business-btn uni-row" v-if="showTurn" @click="handleToHandlingList"><text class="label">周转</text>
|
|
|
+ </view>
|
|
|
<view class="bottom-btn-container">
|
|
|
<view class="start-batch-btn uni-row" @click="handleToEquiPmentList"><text class="label">绑定设备</text></view>
|
|
|
<view class="start-batch-btn uni-row" @click="handleSwitchOrQuit"><text class="label">切换 / 退出账号</text>
|
|
@@ -73,15 +78,16 @@
|
|
|
onLoad(() => {
|
|
|
userInfo.value = store.userInfo || {
|
|
|
nickName: ""
|
|
|
- };getUserDepts
|
|
|
+ };
|
|
|
+ getUserDepts
|
|
|
store.tenantId = userInfo.value.tenantId;
|
|
|
- if(store.userInfo.roles.some(item => item.roleId == 124) && store.userInfo.roles.length > 1){
|
|
|
+ if (store.userInfo.roles.some(item => item.roleId == 124) && store.userInfo.roles.length > 1) {
|
|
|
showTurn.value = true;
|
|
|
showOther.value = true;
|
|
|
- }else if(store.userInfo.roles.some(item => item.roleId == 124) && store.userInfo.roles.length == 1){
|
|
|
+ } else if (store.userInfo.roles.some(item => item.roleId == 124) && store.userInfo.roles.length == 1) {
|
|
|
showTurn.value = true;
|
|
|
showOther.value = false;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
showTurn.value = false;
|
|
|
showOther.value = true;
|
|
|
}
|
|
@@ -90,35 +96,50 @@
|
|
|
|
|
|
function init() {
|
|
|
getTenant();
|
|
|
- getUserDepts(store.userInfo.userId,store.tenantId);
|
|
|
+ getUserDepts(store.userInfo.userId, store.tenantId);
|
|
|
getDeptsByTenantId(store.tenantId);
|
|
|
}
|
|
|
|
|
|
- function handleRecerptSfprod() {
|
|
|
- if(curSelectedDept.value){
|
|
|
+ function handleRecerptSfprod() {
|
|
|
+ if (curSelectedDept.value) {
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/recerptSfprod/index'
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
uni.showToast({
|
|
|
icon: "none",
|
|
|
title: "请选择工段"
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- function handeleToReportHistory(){
|
|
|
+
|
|
|
+ function handeleToReportHistory() {
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/reportHistory/index'
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ function handleFastToProductionPlan() {
|
|
|
+ if (curSelectedDept.value) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/fastProductionPlaan/index'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "请选择工段"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
function handleToProductionPlan() {
|
|
|
- if(curSelectedDept.value){
|
|
|
+ if (curSelectedDept.value) {
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/productionPlan/index'
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
uni.showToast({
|
|
|
icon: "none",
|
|
|
title: "请选择工段"
|
|
@@ -150,12 +171,12 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- function getUserDepts(userId,tenantId) {
|
|
|
+ function getUserDepts(userId, tenantId) {
|
|
|
getUserDeptList(userId).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
userDeptList.value = res.data;
|
|
|
for (let i = 0; i < res.data.length; i++) {
|
|
|
- if(res.data[i].tenantId == tenantId){
|
|
|
+ if (res.data[i].tenantId == tenantId) {
|
|
|
userDeptsByTenantId.value[i] = {
|
|
|
text: res.data[i].deptName,
|
|
|
value: res.data[i]
|
|
@@ -173,9 +194,9 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- function getDeptsByTenantId(tenantId){
|
|
|
+ function getDeptsByTenantId(tenantId) {
|
|
|
userDeptsByTenantId.value = [];
|
|
|
- let newArr = userDeptList.value.filter((item,index,arrs) => item.tenantId == tenantId);
|
|
|
+ let newArr = userDeptList.value.filter((item, index, arrs) => item.tenantId == tenantId);
|
|
|
// curSelectedDept.value = newArr.length > 0 ? newArr[0].deptId : null;
|
|
|
for (var i = 0; i < newArr.length; i++) {
|
|
|
userDeptsByTenantId.value[i] = {
|
|
@@ -189,7 +210,7 @@
|
|
|
// store.curDeptDetails = userDeptsByTenantId.value[0].value;
|
|
|
// }
|
|
|
console.log(userDeptsByTenantId.value);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
function getTenant() {
|
|
|
getTenantList().then((res) => {
|
|
@@ -208,7 +229,7 @@
|
|
|
|
|
|
function handleTenantChange() {
|
|
|
store.tenantId = curSelectedTenant.value;
|
|
|
- curSelectedDept.value = null;
|
|
|
+ curSelectedDept.value = null;
|
|
|
getDeptsByTenantId(store.tenantId);
|
|
|
}
|
|
|
|
|
@@ -297,7 +318,7 @@
|
|
|
.business-btn {
|
|
|
margin: 0 20rpx 20rpx 20rpx;
|
|
|
background-color: #fff;
|
|
|
- height: 200rpx;
|
|
|
+ height: 100rpx;
|
|
|
width: 94%;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
@@ -305,7 +326,7 @@
|
|
|
border-radius: 8rpx;
|
|
|
|
|
|
.label {
|
|
|
- font-size: 40rpx;
|
|
|
+ font-size: 35rpx;
|
|
|
}
|
|
|
}
|
|
|
|