Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

guoyujia 1 vuosi sitten
vanhempi
commit
fde2aba6ac

+ 4 - 2
components/dialog-end-work/dialog-end-work.vue

@@ -134,7 +134,8 @@
 					workInfo.value.qualifiedNum = store.dayworkInfo.processQualifiedNum > 0 ?
 						Math.max(0, store.dayworkInfo.processQualifiedNum - lotPreSumQualifiedNum.value -
 							lotPreSumReject.value) :
-						Math.max(0, store.dayworkInfo.productionQuantity - lotPreSumQualifiedNum.value - lotPreSumReject
+						Math.max(0, store.dayworkInfo.productionQuantity - lotPreSumQualifiedNum.value -
+							lotPreSumReject
 							.value);
 					// temp.value = workInfo.value.qualifiedNum;
 				} else {
@@ -267,6 +268,7 @@
 		workInfo.value.prodNum = number
 		console.log("合格量", (parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value))
 		let percent = (((parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value) / number) * 100).toFixed(2);
+		percent = Math.ceil(percent * 100) / 100;
 		console.log("percent", lotPreSumQualifiedNum.value);
 		let num = 103;
 		// 填入数大于剩余量情况
@@ -274,7 +276,6 @@
 			// 判断当前是否为首序
 			if (isFirstOrder.value) {
 				percent = ((parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value - number) / number) * 100;
-				percent = Math.ceil(percent * 100) / 100;
 				uni.showModal({
 					title: '提示',
 
@@ -335,6 +336,7 @@
 					}
 				})
 			} else {
+				percent = Math.ceil(percent * 100) / 100;
 				if (percent > num) {
 					uni.showToast({
 						icon: 'none',

+ 1 - 2
pages/batchReporting/index.vue

@@ -20,7 +20,7 @@
 			<switch class="switch" @change="switchChange" color="rgba(255,85,85,1)" />
 			<text>否</text> -->
 		</view>
-		<view class="scroll-container">
+		<view class="scroll-container" style="padding-bottom:  150rpx">
 			<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
 				<text>暂无批次</text>
 			</view>
@@ -343,7 +343,6 @@
 			listData.value = tempList.value.filter(item => {
 				return item.isWasteRecycling == 1 || item.isAmend == 1;
 			});
-			console.log("批次信息", listData.value)
 			normalStatus.value = false
 		} else {
 			listData.value = tempList.value.filter(item => {

+ 6 - 5
pages/changeBox/index.vue

@@ -88,7 +88,7 @@
 		const eventChannel = instance.getOpenerEventChannel();
 
 		eventChannel.on('acceptDataFromOpenerPage', function(data) {
-			console.log('acceptDataFromOpenerPage', data)
+			// console.log('acceptDataFromOpenerPage', data)
 			if (data && data.data) {
 				dayWorkInfo = data.data.daywork
 				init({
@@ -124,9 +124,9 @@
 	// })
 
 	function init(data) {
-		console.log(data)
+		// console.log(data)
 		getDayworkCarrierList(data).then(res => {
-			console.log(res)
+			// console.log(res)
 			if (res.code == 200) {
 				bindList.value = [...res.rows];
 				newBindList.value = res.rows;
@@ -163,7 +163,7 @@
 	// }
 	function handleDelVehicleNo(item, index) {
 		if (bindList.value.some(carrier => carrier.carrierCode == item.carrierCode)) {
-			console.log(bindList.value)
+			// console.log(bindList.value)
 			newBindList.value.splice(index, 1);
 			let discardVehicleInfo = {
 				carrierCode: item.carrierCode,
@@ -220,7 +220,7 @@
 					newCarrierId: vehicleObj.carrierId
 				}
 				checkCarrierNew(checkData).then(response => {
-					console.log(response)
+					// console.log(response)
 					// uni.showToast({
 					// 	icon: 'none',
 					// 	title: response.msg
@@ -292,6 +292,7 @@
 					icon: 'success',
 					title: '添加成功',
 				});
+				uni.$emit('refreshQuickReport')
 				uni.navigateBack({
 					delta: 1
 				});

+ 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
 		}

+ 10 - 12
pages/fastProductionPlan/index.vue

@@ -7,7 +7,6 @@
 						<button :class="[ checkAll ? 'active' : 'select' ]" @click="handleAll"
 							style="margin-left: 0px;display: flex; align-items: center; justify-content: center;">全选</button>
 					</view>
-
 					<button @click="handleSearch" style="margin-right: 20rpx ;">搜索</button>
 					<uni-data-select v-model="workshopId" :localdata="workshopList" @change="handleChangeWorkshop"
 						:clear="false" class="label right"
@@ -52,12 +51,9 @@
 				</view>
 			</view>
 		</view>
-
-
 		<view v-if="allData.length==0" style="color: #999;">
 			<image style="width: 420rpx; height: 420rpx; padding-top: 30% ; margin: auto;"
 				src="../../static/images/fastProductionPlan.png" />
-
 		</view>
 		<view v-if="allData.length==0" class='bottom-btn-container'>
 			<text style="margin: auto; padding-bottom: 10%;">扫箱码开始快速报工</text>
@@ -116,7 +112,7 @@
 	})
 	//初始化
 	function init() {
-		console.log(store.curDeptDetails)
+		// console.log(store.curDeptDetails)
 		uni.showLoading({
 			title: '加载中'
 		});
@@ -124,7 +120,7 @@
 		getQuickDayworkList({
 			deptId: store.curDeptDetails.deptId,
 		}).then(res => {
-			console.log(res)
+			// console.log(res)
 			if (res.code == 200) {
 				allData.value = res.rows
 				if (allData.value.length == 0) {
@@ -138,7 +134,7 @@
 					text: v.name,
 					depts: v.depts
 				}))
-				if (workshopId.value == null && workshopList.value.length > 0) {
+				if ((workshopId.value == null || !workshopList.value.some(e => e.value === workshopId.value)) && workshopList.value.length > 0) {
 					workshopId.value = workshopList.value[0].value
 					handleChangeWorkshop(workshopId.value)
 				} else {
@@ -158,7 +154,7 @@
 	}
 	
 	function refreshSearch(input) {
-		console.log(input)
+		// console.log(input)
 		keyword.value = input
 		handleChangeWorkshop(workshopId.value)
 	}
@@ -263,8 +259,8 @@
 
 	function handleChangeWorkshop(arg) {
 		const workshop = workshopList.value.find(v => v.value === arg)
-		console.log(allData.value)
-		console.log(workshop)
+		// console.log(allData.value)
+		// console.log(workshop)
 		// console.log()
 		listData.value = allData.value.filter(v => workshop.depts.some(e => e.deptId === v.quickInfo.deptId) && (v.lotCode.includes(keyword.value) || v.productDescription.includes(keyword.value)))
 	}
@@ -290,6 +286,9 @@
 	}
 
 	function handleChangeCarrier(item) {
+		uni.$once('refreshQuickReport', () => {
+			init()
+		})
 		store.dayworkInfo = null
 		uni.navigateTo({
 			url: "/pages/changeBox/index",
@@ -311,7 +310,7 @@
 			return
 		}
 		finishQuick(selection.value).then(res => {
-			console.log(res)
+			// console.log(res)
 			if (res.code === 200) {
 				init()
 			}
@@ -323,7 +322,6 @@
 
 <style lang="scss">
 	$nav-height: 60rpx;
-
 	.bottom-btn-container {
 		position: fixed;
 		top: 80%;

+ 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>