|
|
@@ -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 = () => {
|