Browse Source

Merge branch 'master' of https://git.7in6.com/Minong/mes-admin-backend-ui

Lexie 1 year ago
parent
commit
a323b62cb3

+ 44 - 15
src/view/yunyin/chanpinziliao/chanpinziliao.vue

@@ -578,14 +578,19 @@
 
         <layout>
         <!--    左侧树侧形结构-->
-        <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
-          <div class="JKWTree-tree" style="height: 200px">
-            <h3> 产品管理</h3>
-            <el-tree :data="treeData" @node-click="handleNodeClick" @node-expand="handleNodeExpand">
-              <template #default="{node,data}">{{data['客户编号']}}【{{data['客户名称']}}】</template>
-            </el-tree>
-          </div>
-        </layout-sider>
+          <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
+            <div class="JKWTree-tree" style="height: 200px">
+              <h3> 产品管理</h3>
+              <!--            <el-tree :data="treeData" @node-click="handleNodeClick" @node-expand="handleNodeExpand">-->
+              <!--              <template #default="{node,data}">{{data['客户编号']}}【{{data['客户名称']}}】</template>-->
+              <!--            </el-tree>-->
+              <el-tree :data="treeData" node-key="label" @node-click="handleNodeClick" @node-expand="handleNodeExpand">
+                <template #default="{ node, data }">
+                  {{ node.label }}
+                </template>
+              </el-tree>
+            </div>
+          </layout-sider>
 
         <!--  右侧内容区域 -->
         <layout-content >
@@ -2443,8 +2448,25 @@ const hscstzCancel = () => {hscstzlist.value = false;};
 const treeData = ref({})
 const getCustomdata = async () => {
   try {
-    const data  = await getCustom()
-    treeData.value = data.data;
+    // const data  = await getCustom()
+    // console.log("左侧菜单列表↓")
+    // console.log(data)
+    // treeData.value = data.data;
+    const response = await getCustom();
+    console.log("左侧菜单列表↓");
+    console.log(response);
+    const formattedData = [];
+    for (const category in response.data) {
+      const categoryNode = {
+        label: category, // 使用分类名称作为节点标签
+        children: response.data[category].map(item => ({
+          label: `${item['客户编号']}【${item['客户名称']}】`, // 将客户信息格式化为节点标签
+          ...item // 保留原始数据,可能在后面需要使用
+        }))
+      };
+      formattedData.push(categoryNode);
+    }
+    treeData.value = formattedData;
   } catch (error) {
     console.error('Error fetching custom data:', error);
   }
@@ -2455,6 +2477,11 @@ getCustomdata()
 const tableData = reactive([])
 const _custom_code = ref(null)
 const handleNodeClick = async (node) => {
+  if(node.label === '印刷产品' || node.label === '糊盒产品'){
+    tableData.splice(0);
+    return false;
+  }
+  console.log(node.客户编号)
   _custom_code.value = node.客户编号;
   //清空搜索框
   searchInfo.value = '';
@@ -2480,6 +2507,8 @@ const tableRowClick = async (row) => {
   _product_code.value = row.产品编号;
   _kehu_code.value = row.产品名称;
   const res = await getProductData({product_code:_product_code.value});
+  console.log(row.产品编号 + "--->下方表格获取数据")
+  console.log(res)
   yjtableData.splice(0, yjtableData.length, ...res.data.yjData);
   gytableData.splice(0, gytableData.length, ...res.data.gyData);
   ybtableData.splice(0, ybtableData.length, ...res.data.ybData);
@@ -2720,7 +2749,7 @@ const addcpyj_onclick = () => {
 	  gdyj_clearFormData();
 	  add_gdyjdialogFormVisible.value = true
 	}
-	
+
 }
 //印件代号Tab或回车
 // const openSearchModal = (code) => {
@@ -2877,7 +2906,7 @@ const add_gdyjenterDialog = () => {
 		  type: 'error',
 		  message: '失败'
 		})
-	}	
+	}
   });
 
 }
@@ -3099,7 +3128,7 @@ const selectSHNode = (node,check) => {
    console.log(node.level)
    if(node.level==1){
    	console.log(node.label)
-	
+
    }
    if(node.level==2){
    	add_gyformData.标准损耗=node.sys_bh
@@ -3178,9 +3207,9 @@ const addgyenterDialog = () => {
   		  type: 'error',
   		  message: '失败'
   		})
-  	}	
+  	}
   });
-  
+
 }
 //工艺新增取消
 const addgycloseDialog = () => {

+ 2 - 2
src/view/yunyin/shengchanguanli/gongdanziliao.vue

@@ -1672,7 +1672,7 @@ const _getOrderProcessCount = async () => {
     // 优化后的代码,使用模板字符串连接字段值并在单个数字前添加零
     const formattedYjno = item.Gy0_yjno.length === 1 ? `0${item.Gy0_yjno}` : item.Gy0_yjno;
     const formattedGxh = item.Gy0_gxh.length === 1 ? `0${item.Gy0_gxh}` : item.Gy0_gxh;
-    const concatenatedValue = `${formattedYjno}-${formattedGxh} ${item.Gy0_gxmc}`;
+    const concatenatedValue = `${formattedYjno}-${formattedGxh} ${item.Gy0_gxmc} 【${item.Add_gxmc} 】`;
     return {
       ...item,
       concatenatedData: concatenatedValue, // 使用新属性名
@@ -3042,7 +3042,7 @@ const _cha_WorkList = async (node) => {
     if (regex.test(search)) {
       // 符合条件,执行搜索操作
       console.log('搜索内容为纯数字加字母');
-      const WorkListdata = await WorkList({search:search,limit:1,page:1});//接口调用函数
+      const WorkListdata = await WorkList({search:search,limit:100,page:1});//接口调用函数
       if(WorkListdata.data.total === 0){
         ElMessage({type: 'warning',message: '未搜索具体查询条件'})
       }