Browse Source

first commit

liuhairui 9 months ago
parent
commit
4b86cb750b

+ 18 - 1
src/view/inventory/ruku.vue

@@ -593,7 +593,24 @@ const danjutableData = ref([]); // 使用 ref 定义响应式数组
 
 //添加面料按钮
 const dj_Dialog = () => {
-	console.log(mianliaotabData.value);
+	console.log(mianliaotabData.value.入库数量);
+	
+	const value = mianliaotabData.value.入库数量;
+	if (typeof value === 'string' || typeof value === 'number') {
+	  const str = String(value).trim();
+	  const isValid = /^\d+(\.\d+)?$/.test(str);
+	
+	  if (isValid) {
+	    // console.log("✔️ 合法的数字或小数:", str);
+	  } else {
+		ElMessage({ type: 'warning', message: '必须是数字且最多一个小数点' });
+		return;
+	  }
+	} else {
+	  ElMessage({ type: 'warning', message: '必须是数字且最多一个小数点' });
+	  return;
+	}
+	
 	//判断数据必填规则
 	if (
 		mianliaotabData.value.入库数量 === '' ||

+ 17 - 0
src/view/inventory/tuihuan.vue

@@ -647,6 +647,23 @@ const danjutableData = ref([]); // 使用 ref 定义响应式数组
   
 //添加按钮
 const dj_Dialog = () => {
+	
+	const value = mianliaotabData.value.退还数量;
+		if (typeof value === 'string' || typeof value === 'number') {
+		  const str = String(value).trim();
+		  const isValid = /^\d+(\.\d+)?$/.test(str);
+		
+		  if (isValid) {
+		    // console.log("✔️ 合法的数字或小数:", str);
+		  } else {
+			ElMessage({ type: 'warning', message: '必须是数字且最多一个小数点' });
+			return;
+		  }
+		} else {
+		  ElMessage({ type: 'warning', message: '必须是数字且最多一个小数点' });
+		  return;
+		}
+		
   // 确保 mianliaotabData 和 mianliaotabData.value 存在
   if (!mianliaotabData || !mianliaotabData.value) {
     console.error('mianliaotabData 为空,无法添加到 danjutableData');

+ 1 - 1
src/view/performance/Suborderdetailspage.vue

@@ -239,7 +239,7 @@ const open = async (ddzbh,gongxu) => {
 	gx.value = gongxu
 	
 	SubWorkOrderStatusListlog.value = true
-	const order = await SubWorkOrderStatusList({order:orderid.value});
+	const order = await SubWorkOrderStatusList({order:orderform.value.子订单编号});
 	console.log(order)
 	arr.length = 0
 	baoshulist(gx.value);

+ 17 - 0
src/view/performance/chukubaogong.vue

@@ -581,6 +581,23 @@ const search_onSubmit = async ()  => {
 //添加面料按钮
 const dj_Dialog = () => {
 	console.log(mianliaotabData.value);
+	
+	const value = mianliaotabData.value.出库数量;
+		if (typeof value === 'string' || typeof value === 'number') {
+		  const str = String(value).trim();
+		  const isValid = /^\d+(\.\d+)?$/.test(str);
+		
+		  if (isValid) {
+		    // console.log("✔️ 合法的数字或小数:", str);
+		  } else {
+			ElMessage({ type: 'warning', message: '必须是数字且最多一个小数点' });
+			return;
+		  }
+		} else {
+		  ElMessage({ type: 'warning', message: '必须是数字且最多一个小数点' });
+		  return;
+		}
+		
 	//判断数据必填规则
 	if (
 		mianliaotabData.value.出库数量 === '' ||