wangxin 1 سال پیش
والد
کامیت
efd245d6d5
3فایلهای تغییر یافته به همراه30 افزوده شده و 11 حذف شده
  1. 13 6
      pages/dashboard/index.vue
  2. 15 3
      pages/processInspection/form.vue
  3. 2 2
      pages/processInspection/index.vue

+ 13 - 6
pages/dashboard/index.vue

@@ -15,10 +15,12 @@
 		</view>
 		<view class="user-info uni-column" style="margin: 0 20rpx 20rpx 20rpx;width: 94%;">
 			<uni-section title="当前厂别" type="square">
-				<uni-data-select v-model="curSelectedTenantId" :localdata="tenantList" :clear="false" @change="handleTenantChange"></uni-data-select>
+				<uni-data-select v-model="curSelectedTenantId" :localdata="tenantList" :clear="false"
+					@change="handleTenantChange"></uni-data-select>
 			</uni-section>
 			<uni-section title="当前工段" type="square">
-				<uni-data-select v-model="curSelectedDeptId" :localdata="userDeptsByTenantId" :clear="false" @change="handleDeptChange"></uni-data-select>
+				<uni-data-select v-model="curSelectedDeptId" :localdata="userDeptsByTenantId" :clear="false"
+					@change="handleDeptChange"></uni-data-select>
 			</uni-section>
 		</view>
 		<!-- <view class="business-btn uni-row" v-if="showOther" @click="handleRecerptSfprod"><text class="label">半成品接收</text></view> -->
@@ -34,7 +36,7 @@
 		<view class="business-btn uni-row" v-if="showSizing" @click="handleToSorting">
 			<text class="label">分选报工</text>
 		</view>
-		<view class="business-btn uni-row" v-if="showOther" @click="handleToProcessInspection">
+		<view class="business-btn uni-row" v-if="showInspector" @click="handleToProcessInspection">
 			<text class="label">序检</text>
 		</view>
 		<!-- v-hasRoles="['porter']" 可通过v-Roles自定义指令进行显隐 -->
@@ -83,10 +85,12 @@
 	const confirm = ref(null) // 确认组件
 	const showTurn = ref(false)
 	const showOther = ref(false)
+	const showInspector = ref(false);
 	const showQuick = ref(false)
 	const showSizing = ref(false)
 
 	onLoad(() => {
+		console.log("gabwlhjkdb lakjwhdnkj;lawnbd;kjlawbjd", store);
 		userInfo.value = store.userInfo || {
 			nickName: ""
 		};
@@ -97,6 +101,9 @@
 		} else if (store.userInfo.roles.some(item => item.roleId == 124) && store.userInfo.roles.length == 1) {
 			showTurn.value = true;
 			showOther.value = false;
+		} else if (store.userInfo.roles.some(item => item.roleId == 128) && store.userInfo.roles.length == 1) {
+			showInspector.value = true
+			showOther.value = true;
 		} else {
 			showTurn.value = false;
 			showOther.value = true;
@@ -204,7 +211,7 @@
 			})
 		}
 	}
-	
+
 	// 分选
 	function handleToSorting() {
 		if (curSelectedDeptId.value) {
@@ -218,7 +225,7 @@
 			})
 		}
 	}
-	
+
 	// 工序检查
 	function handleToProcessInspection() {
 		uni.navigateTo({
@@ -264,7 +271,7 @@
 		let curDept = userDeptList.value.find(item => item.deptId === curSelectedDeptId.value)
 		store.curDeptDetails = curDept
 		if (curDept.deptName === '分选') {
-			showSizing.value = true			
+			showSizing.value = true
 		} else {
 			showSizing.value = false
 		}

+ 15 - 3
pages/processInspection/form.vue

@@ -261,15 +261,27 @@
 
 
 	function save() {
+
+		let pages = getCurrentPages();
 		processInspecion.value.dayworkItemConsults = consultations.value;
 		processInspecion.value.dayworkItemRejects = unfitInfos.value;
 		processInspecion.value.user = store.userInfo;
 
 		saveProcessInspecion(processInspecion.value).then(res => {
 			if (res.code == 200) {
-				uni.navigateTo({
-					url: '/pages/processInspection/index'
-				})
+				let index = 0;
+
+				for (let i = 0; i < pages.length; i++) {
+
+					if (pages[i].$page.fullPath == "/pages/processInspection/index") {
+
+						index = pages.length - i - 1;
+					}
+				}
+				console.log("index", index);
+				uni.navigateBack({
+					delta: index
+				});
 			} else {
 				uni.showToast({
 					icon: 'none',

+ 2 - 2
pages/processInspection/index.vue

@@ -5,7 +5,7 @@
 			<view class="btn uni-row" @click="getList">搜索</view>
 			<!-- <uni-icons type="scan" size="24" /> -->
 		</view>
-		<view class="scan-btn uni-row" @click.stop="handleAddProcessInspection">新增序检</view>
+		<view class="scan-btn uni-row" style="min-height: 80rpx;" @click.stop="handleAddProcessInspection">新增序检</view>
 		<view class="daywork-item uni-column" v-for="(item, index) in inspecionList" :key="index"
 			@click="handleSelection(item)">
 			<view class="lot-code uni-row">
@@ -18,7 +18,7 @@
 					<view class="label">序检箱号:</view>
 					<view class="value">{{ item.carrierCode }}</view>
 					<view class="label">检察员:</view>
-					<view class="value">{{ item.userName }}</view>
+					<view class="value">{{ item.nickName }}</view>
 				</view>
 				<view class="info-row uni-row">
 					<view class="label">检查数量:</view>