|
|
@@ -1385,16 +1385,33 @@ const treeData = ref([]);
|
|
|
//工单资料菜单列表
|
|
|
const DataListdata = async () => {
|
|
|
try {
|
|
|
- const response = await OutputSstatisticsMenu();
|
|
|
- const dataList = response.data;
|
|
|
- dataList.forEach((item) => {
|
|
|
- let obj = {};
|
|
|
- obj.label = item.date;
|
|
|
- obj.children = [];
|
|
|
- item.sbbh.forEach((child) => {
|
|
|
- obj.children.push({label: child});
|
|
|
- });
|
|
|
- treeData.value.push(obj);
|
|
|
+
|
|
|
+ const response = await OutputSstatisticsMenu();
|
|
|
+ const dataList = response.data;
|
|
|
+ dataList.forEach((item) => {
|
|
|
+ let obj = {};
|
|
|
+ obj.label = item.date;
|
|
|
+ obj.children = [];
|
|
|
+ item.sbbh.forEach((child, index) => {
|
|
|
+ obj.children.push({
|
|
|
+ label: child,
|
|
|
+ parentDate: item.date // 添加上级日期并避免重复
|
|
|
+ });
|
|
|
+ });
|
|
|
+ console.log(obj);
|
|
|
+ treeData.value.push(obj);
|
|
|
+
|
|
|
+ // const response = await OutputSstatisticsMenu();
|
|
|
+ // const dataList = response.data;
|
|
|
+ // dataList.forEach((item) => {
|
|
|
+ // let obj = {};
|
|
|
+ // obj.label = item.date;
|
|
|
+ // obj.children = [];
|
|
|
+ // item.sbbh.forEach((child) => {
|
|
|
+ // obj.children.push({label: child});
|
|
|
+ // });
|
|
|
+ // console.log(obj)
|
|
|
+ // treeData.value.push(obj);
|
|
|
});
|
|
|
} catch (error) {
|
|
|
console.error(error);
|
|
|
@@ -1444,19 +1461,24 @@ const handleNodeClick = async (node) => {
|
|
|
// 给当前点击的节点改变颜色
|
|
|
clickedNode.querySelector('.el-tree-node__label').style.color = 'red';
|
|
|
}
|
|
|
+ console.log(node)
|
|
|
tabledate2.value=[]
|
|
|
if(node.children !==undefined ){
|
|
|
- params.value.mouth= node.label
|
|
|
+ // params.value.mouth= node.label
|
|
|
+ params.value.mouth= node.parentDate
|
|
|
}
|
|
|
if (node.children === undefined){
|
|
|
+ params.value.mouth = node.parentDate
|
|
|
params.value.sist = node.label
|
|
|
MachineList(params.value)
|
|
|
}
|
|
|
- console.log();
|
|
|
+ // console.log();
|
|
|
// _WorkList_page();
|
|
|
};
|
|
|
const MachineList = async(params)=>{
|
|
|
try {
|
|
|
+ console.log(params)
|
|
|
+ console.log(12312312321)
|
|
|
const MachineListData = await MachineOperation(params);
|
|
|
let data = MachineListData.data
|
|
|
for (var key in data){
|