liuhairui 1 жил өмнө
parent
commit
26fd0efd4e

+ 22 - 24
src/view/performance/houdaoshougong.vue

@@ -179,28 +179,32 @@ const activeButtonValue = ref('')
 const UniqId = ref('')
 //全局获取颜色款式款号
 const _yskskh= ref('')
+const searcs = ref('')
 const add_onSubmit = async ()=>{
   if(add_searchInfo.value === '' || add_searchInfo.value === undefined){
     const WorkListdata = [];
     add_tableData.splice(0,add_tableData.length,...WorkListdata);
       ElMessage({type: 'warning',message: '请扫描小票二维码' })
   }else{
-    const order =add_searchInfo.value;
-	const sys_sbID = add_formData['机台号']
-	const getSpotLists = await getSpotList({order:order,code:'后道',sys_sbID:sys_sbID});
-	activeButtonValue.value = getSpotLists.data.result.wb
-    UniqId.value = getSpotLists.data.result.UniqId
-	add_formData['数量'] = getSpotLists.data.result.sl
-	add_formData['尺码'] = getSpotLists.data.result.cm
-	//获取下面报工历史记录
-	add_tableData.splice(0,add_tableData.length,...getSpotLists.data.records);//表格数据
+	if(searcs.value === ''){
+		 const order =add_searchInfo.value;
+		 const sys_sbID = add_formData['机台号']
+		 const getSpotLists = await getSpotList({order:order,code:'后道',sys_sbID:sys_sbID});
+		 activeButtonValue.value = getSpotLists.data.result.wb
+		 UniqId.value = getSpotLists.data.result.UniqId
+		 add_formData['数量'] = getSpotLists.data.result.sl
+		 add_formData['尺码'] = getSpotLists.data.result.cm
+		 //获取下面报工历史记录
+		 add_tableData.splice(0,add_tableData.length,...getSpotLists.data.records);//表格数据
+		 searcs.value = 1;
+	}else{
+		 add_Dialog();
+	}
+   
   }
 }
 
-  
   const AttendanceVisible=ref(false)
-
-  
   //清空对象的属性值
   const gd_clearFormData = () => {
 	Object.keys(add_formData).forEach(key => {
@@ -225,12 +229,9 @@ const add_Dialog = async ()=>{
   if(add_searchInfo.value === ''){
     ElMessage({type: 'warning',message: '请勾选具体的出库订单后,再操作此功能'})
   }else{
-	console.log(UniqId)
-	// 检查paramsList是否为空  
-	if (add_formData.数量 && add_formData.数量 !== '') {  
-		// 假设search函数可以处理一个包含多个参数的数组  
-		// 注意:如果search函数不支持数组,并且需要单独调用每个params,您可能需要使用Promise.all  
-		const cf_gettab = await search({UniqId:UniqId._value,code:'后道'}); // 调用search函数  
+		console.log(UniqId.value)
+		// return false;
+		const cf_gettab = await search({UniqId:UniqId.value,code:'后道'}); // 调用search函数  
 		if (cf_gettab.code === 0) {
 			const firstPart = add_searchInfo.value.split(',')[0];  
 			const lsjltable = await getTab({order_id:firstPart,sczl_jtbh:add_formData['机台号']}); 
@@ -243,13 +244,10 @@ const add_Dialog = async ()=>{
 					inputElement.focus();		
 				}
 			}, 100); // 延迟100毫秒
+			searcs.value = '';
 			ElMessage({type: 'success', message: '报工成功'});  
-		} else {  
-			ElMessage({type: 'error', message: '报工失败'});  
-		}  
-	} else {  
-		ElMessage({type: 'info', message: '没有选中要报工的数据'});  
-	}
+		}
+
   }
 }
 	//  AttendanceVisible.value = false