zck 1 год назад
Родитель
Сommit
2955dd706e

+ 25 - 19
src/view/performance/06-packingDocuments/index.vue

@@ -124,20 +124,14 @@
 										</template>
 									</el-table-column>
 									
-									<el-table-column label="核算标准" width="90">
-									<template #default="{ row, rowIndex }">
-									<div class="dropdown-wrapper" @mouseenter="hoveredIndex = rowIndex" >
-										<select
-										v-model="row.hsbz"
-										class="custom-select"
-										>
-										<option value="1000" >1000</option>
-										<option value="2500" >2500</option>
-										<!-- 可以添加更多选项 -->
-										</select>
-									</div>
-									</template>
-								</el-table-column>
+									<el-table-column label="核算标准">
+										<template #default="{ row }">
+											<el-select v-model="row.hsbz"  placeholder="请选择" popper-class="dropdown" >
+												<el-option label="1000" value="1000" ></el-option>
+												<el-option label="2500" value="2500"></el-option>
+											</el-select>
+										</template>
+									</el-table-column>
 
 									<el-table-column label="包装产量" width="100">
 										<template #default="{ row }">
@@ -758,7 +752,8 @@ const SelectClickBz = (row, column, event) => {
 		}
 		detailData.table.forEach((item, index, array) => {
 			const num = index + 1
-			restoredData[`sczl_gdbh${num}`] = item.sczl_gdbh
+			if (item.sczl_cl != null && item.sczl_cl.trim() !== '' && item.sczl_cl != '0.00') {
+				restoredData[`sczl_gdbh${num}`] = item.sczl_gdbh
 			restoredData[`sczl_yjGx${num}`] = item.sczl_yjGx
 			restoredData[`sczl_gxmc${num}`] = item.sczl_gxmc
 			restoredData[`sczl_type${num}`] = item.hsbz === undefined ? '' : item.hsbz;
@@ -769,9 +764,10 @@ const SelectClickBz = (row, column, event) => {
 			restoredData[`sczl_计产系数${num}`] = item.sczl_计产系数
 			restoredData[`sczl_Jtbh${num}`] = item.sczl_Jtbh1
 			restoredData[`sczl_dedh${num}`] = item.sczl_dedh
+			}
 		})
 		console.log(restoredData)
-		// return false;
+		// return;
 		const res = await updatePackingTable(restoredData)
 		if (res.code === 0) {
 			ElMessage({
@@ -827,6 +823,7 @@ const SelectClickBz = (row, column, event) => {
 			sczl_desc: detailData.sczl_desc,
 		}
 		detailData.table.forEach((item, index, array) => {
+			if (item.sczl_cl != null && item.sczl_cl.trim() !== '' && item.sczl_cl != '0.00') {
 			const num = index + 1
 			restoredData[`sczl_gdbh${num}`] = item.sczl_gdbh
 			restoredData[`sczl_yjGx${num}`] = item.sczl_yjGx
@@ -839,6 +836,7 @@ const SelectClickBz = (row, column, event) => {
 			restoredData[`sczl_计产系数${num}`] = item.sczl_计产系数
 			restoredData[`sczl_Jtbh${num}`] = item.sczl_Jtbh1
 			restoredData[`sczl_dedh${num}`] = item.sczl_dedh
+			}
 		})
 	
 		const res = await addPackingTable(restoredData)
@@ -1011,6 +1009,7 @@ const SelectClickBz = (row, column, event) => {
 	// 处理选择框回车操作
 	const handleEnter = (index, row) => {
 		detailData.table[index].sczl_dedh = '030002002'
+		detailData.table[index].sczl_计产系数 = '1.000'
 		if (row.sczl_gdbh === '') {
 			detailData.table[index].sczl_yjGx = ''
 			detailData.table[index].sczl_gxmc = ''
@@ -1074,7 +1073,12 @@ const SelectClickBz = (row, column, event) => {
 	}
 	// 弹窗确定
 	const enterDialog = () => {
-		if (type.value === '查改') {
+		ElMessageBox.confirm('数据存盘?', '提示', {
+			confirmButtonText: '确定',
+			cancelButtonText: '取消',
+			type: 'warning'
+		}).then(() => {
+			if (type.value === '查改') {
 			for(let i = 0; i < detailData.table.length; i++) {
 				if (detailData.table[i].sczl_gdbh ) {
 					if(detailData.table[i].sczl_yjGx === '' || detailData.table[i].sczl_gxmc === '' || detailData.table[i].Gd_cpmc === ''){
@@ -1087,11 +1091,12 @@ const SelectClickBz = (row, column, event) => {
 				}
 			}
 			console.log(detailData.table[0].sczl_gdbh)
-			return;
 			updateDetailData()
 		} else if (type.value === '新增') {
 			addDetailData()
 		}
+		})
+		
 	}
 
 
@@ -1224,6 +1229,7 @@ const SelectClickBz = (row, column, event) => {
             } else if (key === 'Enter') {
                 formElements[0].focus();
                 formElements[0].select();
+				enterDialog()
             }
             break;
 
@@ -1268,8 +1274,8 @@ const SelectClickBz = (row, column, event) => {
 			row.hsbz = ""
 			row.sczl_cl = ""
 			row.sczl_返工产量 = ""
-			row.sczl_PgCl = ""
 			row.sczl_计产系数 = ""
+			row.sczl_PgCl = ""
 			row.sczl_Jtbh1 = ""
 			row.sczl_dedh = ""
 		}

+ 5 - 1
src/view/performance/Dayreports.vue

@@ -1298,7 +1298,7 @@ const formData = ref({
   sczl_打样总工时: "",
   sczl_打样工时: "0.00",
   sczl_设备运行工时: "0.00",
-  拆片联拼系数: "1",
+  拆片联拼系数: "",
   拆片条小盒系数: "",
   sczl_dedh: "",
   sczl_工价系数: "",
@@ -1779,6 +1779,9 @@ const selectYjh = (event) => {
 			console.log(response)
 			console.log(666)
 	      formData.value.yj_yjmc = response.data.yj_yjmc;
+        formData.value.sczl_ls = response.data.gxmc.sczl_ls;
+        formData.value.拆片联拼系数 = response.data.gxmc.拆片联拼系数;
+        formData.value.拆片条小盒系数 = response.data.gxmc.拆片条小盒系数;
 		  if(formData.value.sczl_gxmc === ''){
 			  gxmc.value = response.data.gxmc;
 			  formData.value.sczl_gxmc = gxmc.value.sczl_gxmc;
@@ -1849,6 +1852,7 @@ const getYJMCsubmit = async () => {
       yjno: formData.value.sczl_yjno,
     }).then((response) => {
       if (response.code === 0) {
+        console.log(response.data.gxmc.拆片条小盒系数)
         formData.value.yj_yjmc = response.data.yj_yjmc;
         // gxmc.value = response.data.gxmc;
         // formData.value.sczl_gxmc = gxmc.value.sczl_gxmc;

+ 161 - 143
src/view/performance/Manualdocuments.vue

@@ -643,6 +643,7 @@
 	//员工列表接口
 	const getyglist = async ()=>{
 		if(formData.value.sczl_bh0 === ''){
+			ElMessage.warning('请输入员工编号')
 			return;
 		}
 		const response = await getYg({sczl_bh: formData.value.sczl_bh0});
@@ -720,19 +721,19 @@
 		const currentIndex = Array.from(inputs).indexOf(event.target);
 		console.log(id3)
 		
-	if (event.keyCode === 13 && id3 === '流程单号') {
-		 console.log(id3);
+	if (event.keyCode === 13 && id3 === '流程单号') {
+		 console.log(id3);
 			// 获取所有相关的输入框值
 		  const allValues = [
-			  formData.value.流程单号1,
-			  formData.value.流程单号2,
-			  formData.value.流程单号3,
-			  formData.value.流程单号4,
-			  formData.value.流程单号5,
-			  formData.value.流程单号6,
-			  formData.value.流程单号7,
-			  formData.value.流程单号8,
-			  formData.value.流程单号9,
+			  formData.value.流程单号1,
+			  formData.value.流程单号2,
+			  formData.value.流程单号3,
+			  formData.value.流程单号4,
+			  formData.value.流程单号5,
+			  formData.value.流程单号6,
+			  formData.value.流程单号7,
+			  formData.value.流程单号8,
+			  formData.value.流程单号9,
 			  formData.value.流程单号10,
 		  ];
 		  // 获取当前输入框的值
@@ -801,7 +802,7 @@
 			if (!foundNext) {
 			  console.log("没有更多可用的输入框");
 			}
-		  }
+		  }
 	}else if (event.keyCode === 13 && id3 === '定额代号') { 
 		console.log("定额代号");
 		GetDedh()
@@ -887,6 +888,13 @@
 	// 如果没有找到下一个可用输入框,提示用户
 	if (!foundNext) {
 		console.log("已经是最后一个输入框");
+		ElMessageBox.confirm('数据存盘?', '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				enterDialog()
+			})
 	}
    }else if (event.keyCode === 13 || event.keyCode === 40) { 
 		if (event.target.id == '其他备注') {
@@ -1413,137 +1421,137 @@
 	}
 
 
-
-// 定义状态
-let GetDedhtreeData = reactive([]); // 树形数据
-const GetDedhVisible = ref(false); // 弹窗显隐状态
+
+// 定义状态
+let GetDedhtreeData = reactive([]); // 树形数据
+const GetDedhVisible = ref(false); // 弹窗显隐状态
 const activeNodeKey = ref(null); // 当前选中节点的 key
 const table_fplb = ref(null); // el-tree 的 ref
 	const defaultExpandedKey = ref(null); // 默认展开的节点 key
-	const selectIndex = ref(0); // 当前选中的索引
-
-// 获取定额代号并构建树形结构
-const GetDedh = async () => {
-  const response = await shougonggetDedh();
-  if (response.code === 0) {
-    // 封装数据为数组,便于递归处理根节点
-    const data = [];
-    data[0] = response.data;
-
-    // 递归构建树形结构
-    const buildTree = (node) => {
-      return {
-        label: `${node.sys_bh}【${node.sys_mc}】`,
-        id: node.sys_bh,
-        children: Array.isArray(node.bh_mc) ? node.bh_mc.map(buildTree) : []
-      };
-    };
-
-    // 构建树形结构并赋值给响应变量
-    GetDedhtreeData = data.map(buildTree);
-    GetDedhVisible.value = true; // 显示弹窗
-  }
-};
-
-// 节点点击事件
-const GetDedhhandleNodeClick = (nodeData) => {
-  console.log("单击节点:", nodeData);
-  if (!nodeData.children || nodeData.children.length === 0) {
-    // 如果点击的是子节点,则关闭弹窗并更新数据
-    formData.value.sczl_dedh = nodeData.label.split("【")[0]; // 提取定额代号
-    GetDedhVisible.value = false; // 关闭弹窗
-  }
-};
-
-// 树组件键盘事件
-const handleTreeKeydown = (event) => {
-  const tree = table_fplb.value; // 获取树实例
-  if (!tree) {
-    console.error("树组件未加载");
-    return;
-  }
-
-  const focusedElement = document.activeElement;
-  const focusedNodeId = focusedElement?.getAttribute("data-key"); // 获取 DOM 的 data-key 属性
-
-  // 回车键
-  if (event.keyCode === 13 && focusedNodeId) {
-    tree.setCurrentKey(focusedNodeId); // 设置当前节点为选中
-    tree.$nextTick(() => {
-      const currentNode = tree.getCurrentNode(); // 获取当前选中的节点
-      if (!currentNode) {
-        console.warn("没有选中的节点");
-        return;
-      }
-
-      // 展开当前节点并收起其他节点
-      Object.keys(tree.store.nodesMap).forEach((key) => {
-        tree.store.nodesMap[key].expanded = false; // 收起所有节点
-      });
-      tree.store.nodesMap[currentNode.id].expanded = true; // 展开当前节点
-
-      // 如果有子节点,选中第一个子节点
-      if (currentNode.children && currentNode.children.length > 0) {
-        const firstChild = currentNode.children[0];
-        const firstChildKey = firstChild.id.toString();
-        tree.setCurrentKey(firstChildKey); // 选中第一个子节点
-        setTimeout(() => {
-          const firstChildDom = tree.$el.querySelector(`[data-key="${firstChildKey}"]`);
-          if (firstChildDom) {
-            firstChildDom.focus();
-            firstChildDom.scrollIntoView({ block: "nearest" });
-          }
-        });
-      } else {
-        // 如果没有子节点,执行确认操作
+	const selectIndex = ref(0); // 当前选中的索引
+
+// 获取定额代号并构建树形结构
+const GetDedh = async () => {
+  const response = await shougonggetDedh();
+  if (response.code === 0) {
+    // 封装数据为数组,便于递归处理根节点
+    const data = [];
+    data[0] = response.data;
+
+    // 递归构建树形结构
+    const buildTree = (node) => {
+      return {
+        label: `${node.sys_bh}【${node.sys_mc}】`,
+        id: node.sys_bh,
+        children: Array.isArray(node.bh_mc) ? node.bh_mc.map(buildTree) : []
+      };
+    };
+
+    // 构建树形结构并赋值给响应变量
+    GetDedhtreeData = data.map(buildTree);
+    GetDedhVisible.value = true; // 显示弹窗
+  }
+};
+
+// 节点点击事件
+const GetDedhhandleNodeClick = (nodeData) => {
+  console.log("单击节点:", nodeData);
+  if (!nodeData.children || nodeData.children.length === 0) {
+    // 如果点击的是子节点,则关闭弹窗并更新数据
+    formData.value.sczl_dedh = nodeData.label.split("【")[0]; // 提取定额代号
+    GetDedhVisible.value = false; // 关闭弹窗
+  }
+};
+
+// 树组件键盘事件
+const handleTreeKeydown = (event) => {
+  const tree = table_fplb.value; // 获取树实例
+  if (!tree) {
+    console.error("树组件未加载");
+    return;
+  }
+
+  const focusedElement = document.activeElement;
+  const focusedNodeId = focusedElement?.getAttribute("data-key"); // 获取 DOM 的 data-key 属性
+
+  // 回车键
+  if (event.keyCode === 13 && focusedNodeId) {
+    tree.setCurrentKey(focusedNodeId); // 设置当前节点为选中
+    tree.$nextTick(() => {
+      const currentNode = tree.getCurrentNode(); // 获取当前选中的节点
+      if (!currentNode) {
+        console.warn("没有选中的节点");
+        return;
+      }
+
+      // 展开当前节点并收起其他节点
+      Object.keys(tree.store.nodesMap).forEach((key) => {
+        tree.store.nodesMap[key].expanded = false; // 收起所有节点
+      });
+      tree.store.nodesMap[currentNode.id].expanded = true; // 展开当前节点
+
+      // 如果有子节点,选中第一个子节点
+      if (currentNode.children && currentNode.children.length > 0) {
+        const firstChild = currentNode.children[0];
+        const firstChildKey = firstChild.id.toString();
+        tree.setCurrentKey(firstChildKey); // 选中第一个子节点
+        setTimeout(() => {
+          const firstChildDom = tree.$el.querySelector(`[data-key="${firstChildKey}"]`);
+          if (firstChildDom) {
+            firstChildDom.focus();
+            firstChildDom.scrollIntoView({ block: "nearest" });
+          }
+        });
+      } else {
+        // 如果没有子节点,执行确认操作
         console.log("当前子节点:", currentNode.label);
-		formData.value.sczl_dedh = currentNode.label.split("【")[0]
-        GetDedhVisible.value = false; // 关闭弹窗
-      }
-    });
-  }
-  // 上下箭头键
-  else if (event.keyCode === 38 || event.keyCode === 40) {
-    const currentNode = tree.getCurrentNode();
-    if (currentNode) {
-      const currentNodeDom = tree.$el.querySelector(`[data-key="${currentNode.id}"]`);
-      if (currentNodeDom) {
-        currentNodeDom.focus();
-      }
-    }
-  }
-};
-
-// 弹窗键盘事件处理(绑定在弹窗上)
-const entdedh = (event) => {
-  console.log("键盘事件触发"); // 用于调试
-  event.preventDefault(); // 阻止浏览器默认行为(如滚动页面)
-  event.stopPropagation(); // 阻止事件冒泡
-
-  const tree = table_fplb.value?.$el;
-  if (!tree) return;
-
-	if (event.key === "ArrowDown" || event.key === "ArrowUp") {
-    // 上下箭头键:切换选中的兄弟节点
-    const focusedElement = document.activeElement;
-    const focusedNodeId = focusedElement?.getAttribute("data-key");
-    const currentNode = table_fplb.value?.store.nodesMap[focusedNodeId];
-
-    if (currentNode) {
-      let nextNode;
-      if (event.key === "ArrowDown") {
-        nextNode = table_fplb.value?.getNextSibling(currentNode);
-      } else if (event.key === "ArrowUp") {
-        nextNode = table_fplb.value?.getPreviousSibling(currentNode);
-      }
-
-      if (nextNode) {
-        const nextNodeKey = nextNode.data.id.toString();
-        table_fplb.value?.setCurrentKey(nextNodeKey); // 设置选中下一个节点
-        focusAndScrollToNode(nextNodeKey); // 聚焦到下一个节点并滚动到视图中
-      }
-    }
-  } else {
+		formData.value.sczl_dedh = currentNode.label.split("【")[0]
+        GetDedhVisible.value = false; // 关闭弹窗
+      }
+    });
+  }
+  // 上下箭头键
+  else if (event.keyCode === 38 || event.keyCode === 40) {
+    const currentNode = tree.getCurrentNode();
+    if (currentNode) {
+      const currentNodeDom = tree.$el.querySelector(`[data-key="${currentNode.id}"]`);
+      if (currentNodeDom) {
+        currentNodeDom.focus();
+      }
+    }
+  }
+};
+
+// 弹窗键盘事件处理(绑定在弹窗上)
+const entdedh = (event) => {
+  console.log("键盘事件触发"); // 用于调试
+  event.preventDefault(); // 阻止浏览器默认行为(如滚动页面)
+  event.stopPropagation(); // 阻止事件冒泡
+
+  const tree = table_fplb.value?.$el;
+  if (!tree) return;
+
+	if (event.key === "ArrowDown" || event.key === "ArrowUp") {
+    // 上下箭头键:切换选中的兄弟节点
+    const focusedElement = document.activeElement;
+    const focusedNodeId = focusedElement?.getAttribute("data-key");
+    const currentNode = table_fplb.value?.store.nodesMap[focusedNodeId];
+
+    if (currentNode) {
+      let nextNode;
+      if (event.key === "ArrowDown") {
+        nextNode = table_fplb.value?.getNextSibling(currentNode);
+      } else if (event.key === "ArrowUp") {
+        nextNode = table_fplb.value?.getPreviousSibling(currentNode);
+      }
+
+      if (nextNode) {
+        const nextNodeKey = nextNode.data.id.toString();
+        table_fplb.value?.setCurrentKey(nextNodeKey); // 设置选中下一个节点
+        focusAndScrollToNode(nextNodeKey); // 聚焦到下一个节点并滚动到视图中
+      }
+    }
+  } else {
    // 默认行为:展开所有节点并选中第一个节点
        const firstNodeDom = tree.querySelector("[data-key]");
        if (firstNodeDom) {
@@ -1560,9 +1568,9 @@ const entdedh = (event) => {
            table_fplb.value?.store.expandNode(firstNode, true);
            expandAllNodes(firstNode); // 递归展开第一个节点的所有子节点
          }
-       }
-  }
-};
+       }
+  }
+};
 
 	
 	// let GetDedhtreeData = reactive([]);
@@ -1888,6 +1896,8 @@ const entdedh = (event) => {
 			sys_id: sys_id,
 		}
 		if (ADD.value == '新增') {
+			console.log(restoredData)
+			return;
 			const response = await inspectadd(restoredData);
 			// ADD.value='1'
 			// console.log(ADD.value)
@@ -1904,7 +1914,6 @@ const entdedh = (event) => {
 					//刷新页面
 					getTableData()
 				}
-				dialogFormVisible.value = false
 			}
 
 		} else {
@@ -2134,6 +2143,15 @@ const entdedh = (event) => {
 				return;
 			}
 			updateDetailData()
+			for (let i = 1; i < 10; i++) {
+				formData.value[`流程单号${i}`]=0;
+			}
+			for (let i = 0; i < 12; i++) {
+				formData.value[`sczl_bh${i}`] = '';
+				formData.value[`sczl_bh${i}_name`] = '';
+				formData.value[`sczl_cl${i}`] = 0;
+				formData.value[`sczl_fp${i}`] = 0;
+				}
 		});
 	}
 	let tables = ref(5);

+ 33 - 9
src/view/yunyin/chanpinziliao/chanpinziliao.vue

@@ -87,7 +87,7 @@
             </el-form-item>
               <div class="dialog-footer" style="text-align: right ">
                 <el-button @click="cpgyfzhandleCancel">取消</el-button>
-                <el-button type="primary" @click="cpgyfzhandleConfirm">确定</el-button>
+                <el-button type="primary" @click="cpgyfzhandleConfirm":disabled="!clickedlist">确定</el-button>
               </div>
           </el-dialog>
 
@@ -1520,13 +1520,7 @@ export default {
         return "warning-row"
       }
     },
-    rowClassStyle({row,rowIndex}){
-      // debugger
-      // console.log(row.Gy0_yjno, this.currentGy0_yjno)
-      if(row.Gy0_yjno==this.currentGy0_yjno){
-        return "warning-row"
-      }
-    },
+
     clickybupdate(row,column,event){
       this.currentGy0_yjno = row.Gy0_yjno
     },
@@ -1938,7 +1932,26 @@ const is_copy_gy = ref(0);
 const is_copy_yb = ref(0);
 const is_copy_yj = ref(0);
 const toProUpperCase = ref('');
+ //默认启用按钮可点击
+const clickedlist = ref(true);
+ //存储定时器时间
+let clickTimer = null;
 const cpgyfzhandleConfirm = async () => {
+    //防止重复点击
+    if (!clickedlist.value) {
+    // 如果按钮已经被禁用,则不执行任何操作
+    return;
+  }
+  clickedlist.value = false;
+  // 清除之前的定时器(如果有的话),以避免重复设置
+  if (clickTimer) {
+    clearTimeout(clickTimer);
+  }
+  //设置定时器,在3秒后重新启用按钮
+  clickTimer = setTimeout(() => {
+    clickedlist.value = true;
+    clickTimer = null;
+  }, 3000);
   // console.log(cpgyfzformData)
   if(cpgyfzformData['process'] === ''){
     ElMessage({type: 'warning',message: '参照产品代号不能为空' })
@@ -3678,7 +3691,8 @@ const meshandleCancel = async () => {
 let gyformDataTest = reactive({})
 const _gyrow = ref('')
 const clickybupdate = async (row) => {
-	console.log(row)
+	console.log(row.Gy0_yjno)
+  currentGy0_yjno.value = row.Gy0_yjno
 	_gyrow.value = row 
 }
 
@@ -4118,6 +4132,16 @@ const createROLuckyExcel = (files) => {
 
 	})
 }
+
+//===============颜色==================================
+//工艺资料背景颜色变黄
+const currentGy0_yjno = ref(null)
+const rowClassStyle = ({row,rowIndex}) =>{
+  console.log(row)
+  if(row['Gy0_yjno'].substr(0, 2)==currentGy0_yjno.value){
+    return "warning-row"
+  }
+}
 </script>
 <style scoped>
 :deep(.plan-usage-low div) {

+ 0 - 1
src/view/yunyin/shengchanguanli/gongdanziliao.vue

@@ -4062,7 +4062,6 @@ const rowClassStyle2 = ({row,rowIndex}) =>{
   if(row['印件-工序'].substr(0, 2)==currentGy0_yjno.value){
     return "warning-row"
   }
-  return "warning-row"
 }
 //表格文字颜色
 const tableDataCellClass = ({row, column, rowIndex, columnIndex}) =>{