mao 1 年之前
父節點
當前提交
01a516b108
共有 1 個文件被更改,包括 53 次插入11 次删除
  1. 53 11
      components/dialog-lot/dialog-lot.vue

+ 53 - 11
components/dialog-lot/dialog-lot.vue

@@ -3,6 +3,10 @@
 		<view class="prompt">
 		<view class="prompt">
 			<text>请选择批次再确认</text>
 			<text>请选择批次再确认</text>
 		</view>
 		</view>
+		<uni-section title="请选择当前工序" type="square">
+			<uni-data-select v-model="selectedProcess" :localdata="processList" :clear="false"
+				@change="handleProcessChange"></uni-data-select>
+		</uni-section>
 		<view :class="{'list-container':true, 'selected':isSelected(item)}" @click="handleSelection(item,index)"
 		<view :class="{'list-container':true, 'selected':isSelected(item)}" @click="handleSelection(item,index)"
 			v-for="(item, index) in form" :key="item.id">
 			v-for="(item, index) in form" :key="item.id">
 			<view class="list-title"><text class="label">批次号:{{item.lotCode}}</text></view>
 			<view class="list-title"><text class="label">批次号:{{item.lotCode}}</text></view>
@@ -14,14 +18,14 @@
 				<text class="label">关联箱号</text>
 				<text class="label">关联箱号</text>
 				<text class="label value">{{item['carrierName']}}</text>
 				<text class="label value">{{item['carrierName']}}</text>
 			</view>
 			</view>
-<!-- 			<view class="list-container-item uni-row">
-				<text class="label">当前工序</text>
-				<text class="label value">{{item['daywork'].currentProcess.processAlias}}</text>
-			</view> -->
 			<view class="list-container-item uni-row" style="border-bottom: 1px solid #999999;">
 			<view class="list-container-item uni-row" style="border-bottom: 1px solid #999999;">
 				<text class="label">投产数量</text>
 				<text class="label">投产数量</text>
 				<text class="label value">{{item['prodNum']}}</text>
 				<text class="label value">{{item['prodNum']}}</text>
 			</view>
 			</view>
+			<view class="list-container-item uni-row">
+				<text class="label">上道工序</text>
+				<text class="label value">{{item['process'].processAlias}}</text>
+			</view>
 		</view>
 		</view>
 		<view class="add-btn-container uni-row">
 		<view class="add-btn-container uni-row">
 			<button type="primary" class="btn" @click="handleConfirm" :disabled="flag">确认</button>
 			<button type="primary" class="btn" @click="handleConfirm" :disabled="flag">确认</button>
@@ -34,6 +38,9 @@
 		ref,
 		ref,
 		getCurrentInstance
 		getCurrentInstance
 	} from 'vue'
 	} from 'vue'
+	import {
+		getProcessList
+	} from '@/api/business/deptProcess.js'
 
 
 	const baseDialog = ref(null)
 	const baseDialog = ref(null)
 	const selectedButton = ref(null)
 	const selectedButton = ref(null)
@@ -41,11 +48,14 @@
 	const emit = defineEmits(['submit'])
 	const emit = defineEmits(['submit'])
 	const selection = ref([])
 	const selection = ref([])
 	const flag = ref(true)
 	const flag = ref(true)
+	const selectedProcess = ref(null)
+	const processList = ref([])
 
 
 	const open = (data) => {
 	const open = (data) => {
 		// console.log(dialog.value)
 		// console.log(dialog.value)
-		form.value = data
-		baseDialog.value.open()
+		form.value = data;
+		baseDialog.value.open();
+		getProcesses();
 	}
 	}
 
 
 	const close = () => {
 	const close = () => {
@@ -55,12 +65,38 @@
 	defineExpose({
 	defineExpose({
 		open
 		open
 	})
 	})
+
+	function getProcesses() {
+		console.log("11111111111111111111111")
+		getProcessList({
+			deptId: store.curDeptDetails.deptId,
+		}).then(res => {
+			if (res.code == 200) {
+				//过滤出工序交集
+				let filteredData = res.data.filter((item1) =>
+					store.planDetails.processSequence.some((item2) => item2.processCode === item1.processCode)
+				);
+				for (let i = 0; i < filteredData.length; i++) {
+					processList.value[i] = {
+						text: filteredData[i].processAlias,
+						value: filteredData[i].processId
+					}
+				}
+				selectedProcess.value = filteredData[0].processId;
+				console.log(processList.value)
+			}
+		})
+	}
+
+	function handleProcessChange(){
 		
 		
+	}
 
 
 	function handleConfirm() {
 	function handleConfirm() {
-		close();
-		emit('submit', selection.value);
-		uni.$emit('dayworkItemUpdate');
+		console.log(selection.value)
+		// close();
+		// emit('submit', selection.value);
+		// uni.$emit('dayworkItemUpdate');
 	}
 	}
 
 
 	function isSelected(item) {
 	function isSelected(item) {
@@ -86,6 +122,7 @@
 
 
 	.dialog-body {
 	.dialog-body {
 		overflow: auto;
 		overflow: auto;
+
 		.list-title {
 		.list-title {
 			margin: 20rpx 0 20rpx 0;
 			margin: 20rpx 0 20rpx 0;
 
 
@@ -94,8 +131,8 @@
 				font-weight: bold;
 				font-weight: bold;
 			}
 			}
 		}
 		}
-		
-		.prompt{
+
+		.prompt {
 			color: #999;
 			color: #999;
 			margin: 8rpx auto 0;
 			margin: 8rpx auto 0;
 		}
 		}
@@ -138,4 +175,9 @@
 			}
 			}
 		}
 		}
 	}
 	}
+
+	.selectedProcess {
+		width: 88%;
+		margin: 20rpx auto 40rpx;
+	}
 </style>
 </style>