Browse Source

分配系数优化

zck 1 year ago
parent
commit
2c93892b5c
1 changed files with 10 additions and 5 deletions
  1. 10 5
      src/view/yunyin/shengchanguanli/shebeiyunxing.vue

+ 10 - 5
src/view/yunyin/shengchanguanli/shebeiyunxing.vue

@@ -4759,7 +4759,7 @@ const addBz = async() => {
 	initfordata3()
 	updateTotal()
 	const jt = selectedOption.value.split('|')[0]//获取车间数据
-	//判断车间分配比例【SY、PM、WY
+	//判断车间分配比例【SY、PM】	
 	const shouldCheckLessThanOne = !jt.includes('SY') && !jt.includes('PM');
 	console.log(fpsum.value)
 	const relevantKeys = ['percentage1', 'percentage2', 'percentage3', 'percentage4', 'percentage5', 'percentage6', 'percentage7', 'percentage8'];
@@ -4771,19 +4771,23 @@ const addBz = async() => {
     return acc;
   }, []); // 初始化为空数组
  
-  console.log("数值", values);
- 
+  for(let i=0;i<relevantKeys.length;i++){
+	if(formDatas.code[i] && formDatas.name[i]){
+		console.log('有组员')
+	}
+  }
+  //判断分配系数是否在0-1之间
   const hasInvalidValue = values.some(value => value <= 0 || value > 1);
   console.log(hasInvalidValue);
- 
   if (hasInvalidValue) {
     ElMessage({
       type: "error",
-      message: "某人分配系数有误",
+      message: "组员分配系数有误",
     });
     return;
   }
 	
+  //全部机台组员合计不能大于1
 	if (fpsum.value > 1) {
 		ElMessage({
 		type: "error",
@@ -4800,6 +4804,7 @@ const addBz = async() => {
 		});
 		return;
 	}
+
   const response = await MachineTeamAdd({
     sczl_jtbh:  selectedOption.value.split('|')[0],
     sczl_bzdh:  BZMC.value,