mao il y a 1 an
Parent
commit
599d176bec

+ 3 - 1
components/dialog-end-work/dialog-end-work.vue

@@ -76,7 +76,9 @@
 	}
 
 	function open(data) {
-		workInfo.value = data;
+		workInfo.value = {
+			...data
+		};
 		workInfo.value.qualifiedNum = null;
 		console.log(data)
 		wasteInfo.value = []

+ 15 - 16
components/dialog-turnoverApplication/dialog-turnoverApplication.vue

@@ -4,7 +4,7 @@
 			<view class="list-title"><text class="label">请选择周转类型</text></view>
 			<view class="btn uni-row">
 				<view v-for="(item,index) in turnoverType"
-					:class="{ 'middle-btn': true, 'active': item == turnoverTypeChecked }"
+					:class="{ 'middle-btn': true, 'active': item.dictValue == curDayworkItem.turnoverType }"
 					@click="selectTurnoverType(item)"><text class="label">{{item.dictLabel}}</text></view>
 			</view>
 			<view class="" style="margin: 0 20rpx 20rpx 0;width: 88%;">
@@ -14,7 +14,7 @@
 						style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
 				</uni-section>
 			</view>
-			<view class="list-title" v-if="curDayworkItem.turnoverType == '1'">
+			<view class="list-title">
 				<text class="label">请选择您摆放位置</text>
 			</view>
 			<view class="turnArea uni-row" v-if="curDayworkItem.turnoverType == '1'">
@@ -23,9 +23,6 @@
 						@click="selectTurnoverDoor(item)"><text class="label">{{item.code}}</text></view>
 				</view>
 			</view>
-			<view class="list-title" v-if="curDayworkItem.turnoverType == '2'">
-				<text class="label">请选择您摆放位置</text>
-			</view>
 			<view class="turnArea uni-row" v-if="curDayworkItem.turnoverType == '2'">
 				<view v-for="(item,index) in turnoverArea" class="btn">
 					<view :class="{ 'middle-btn': true, 'active': item == turnoverDoorChecked }"
@@ -42,8 +39,7 @@
 <script setup>
 	import {
 		ref,
-		getCurrentInstance,
-		onMounted
+		getCurrentInstance
 	} from 'vue'
 	import {
 		onLoad
@@ -68,12 +64,13 @@
 		timestampToTime
 	} from '@/utils/common.js'
 
-	const baseDialog = ref(null)
-	const turnoverTypeChecked = ref({})
+	const baseDialog = ref(null) 
 	const turnoverDoorChecked = ref({})
 	const turnoverType = ref([])
 	const turnoverArea = ref([])
-	const curDayworkItem = ref({})
+	const curDayworkItem = ref({
+		turnoverType: 1
+	})
 	const dayworkInfo = ref(null)
 	const deptList = ref([]) // 工段列表
 	const turnAreaList = ref([]) // 周转区列表
@@ -84,8 +81,10 @@
 	})
 
 	function open(data) {
+		deptList.value = [];
+		turnAreaList.value = [];
 		dayworkInfo.value = data;
-		baseDialog.value.open()
+		baseDialog.value.open();
 		init();
 	}
 
@@ -110,7 +109,10 @@
 			userId: store.userInfo.userId
 		}).then(res => {
 			console.log(res.rows[0])
-			curDayworkItem.value = res.rows[0];
+			curDayworkItem.value = {
+				...res.rows[0],
+				turnoverType: 1
+			};
 		})
 		getDeptList({
 			isWorkSection: 1,
@@ -128,7 +130,6 @@
 	}
 
 	function selectTurnoverType(item) {
-		turnoverTypeChecked.value = item;
 		curDayworkItem.value.turnoverType = item.dictValue;
 	}
 
@@ -194,18 +195,16 @@
 	}
 
 	function handleChange() {
-		// curDayworkItem.deptId
+		turnAreaList.value = [];
 		getTurnoverListByDeptId({
 			deptId: curDayworkItem.value.deptId,
 		}).then(res => {
-			console.log(res)
 			for (var i = 0; i < res.data.length; i++) {
 				if(res.data[i].status == 0){
 					turnAreaList.value[i] = res.data[i];
 				}
 			}
 		})
-		console.log(curDayworkItem.value)
 	}
 </script>
 

+ 1 - 12
pages/reportingForWork/index.vue

@@ -41,14 +41,6 @@
 					<text class="label">设备</text>
 					<text class="label right">{{ item['equipmentDetailCode']}}</text>
 				</view>
-				<!-- 		<view class="item-info uni-row">
-					<text class="label">废品原因</text>
-					<text class="label right">{{ (item['reason'] != "")?item['reason']:'-'}}</text>
-				</view> -->
-
-				<!-- 		<view v-if="item['userId'] == userInfo['userId'] ? item['status'] == 0 : false" class="status-btn uni-row ">
-					<button class="finished-turnover-tag" size="mini">开始加工</button>
-				</view> -->
 				<view v-if="item['userId'] == userInfo['userId'] ? item['status'] == 1 : false"
 					class="status-btn uni-row ">
 					<button class="finished-turnover-tag" size="mini"
@@ -136,9 +128,7 @@
 					let timeStamp = listData.value[i].workingHours;
 					listData.value[i].taskTime = toHHmmss(timeStamp);
 				}
-				flag.value = listData.value[0].status == 2 ? false : true;
-
-				console.log(flag.value)
+				// flag.value = listData.value[0].status == 2 ? false : true;
 				uni.hideLoading();
 			} else {
 				uni.showToast({
@@ -246,7 +236,6 @@
 					duration: 2000
 				});
 				reqParam.value = [];
-				init();
 				uni.$emit('dayworkItemUpdate');
 			} else {
 				uni.showToast({