Commit b96c901c by yiyu.li

add

parent 32ab390d
...@@ -107,6 +107,8 @@ ...@@ -107,6 +107,8 @@
:columns="columns1" :columns="columns1"
:data="data1" :data="data1"
highlight-row highlight-row
@on-current-change="handleRowChange"
@on-row-click="onExpand"
></Table> ></Table>
<div class="pageDiv"> <div class="pageDiv">
<div class="pageDirection"> <div class="pageDirection">
...@@ -117,6 +119,8 @@ ...@@ -117,6 +119,8 @@
show-sizer show-sizer
show-total show-total
:page-size-opts="[10, 20, 30, 40, 100]" :page-size-opts="[10, 20, 30, 40, 100]"
@on-change="changePage"
@on-page-size-change="handlePageSize"
></Page> ></Page>
</div> </div>
</div> </div>
...@@ -257,7 +261,6 @@ export default { ...@@ -257,7 +261,6 @@ export default {
columns1: [ columns1: [
{ {
type: "expand", type: "expand",
// title: "装配详情",
width: "50", width: "50",
render: (h, params) => { render: (h, params) => {
// let str = ""; // let str = "";
...@@ -266,11 +269,15 @@ export default { ...@@ -266,11 +269,15 @@ export default {
// } else if (params.row.managetype === 2) { // } else if (params.row.managetype === 2) {
// str = "批次"; // str = "批次";
// } // }
return h(Table, { return h("Table", {
props:{ props: {
data:params.row.childrens, data: params.row.childrens,
columns:this.columns2 columns: this.columns2,
} highlightRow: true,
},
on: {
onCurrentChange: () => {},
},
}); });
}, },
}, },
...@@ -305,7 +312,7 @@ export default { ...@@ -305,7 +312,7 @@ export default {
title: "父工装编号", title: "父工装编号",
key: "code", key: "code",
}, },
{ {
title: "装配详情", title: "装配详情",
key: "s", key: "s",
...@@ -316,7 +323,7 @@ export default { ...@@ -316,7 +323,7 @@ export default {
// } else if (params.row.managetype === 2) { // } else if (params.row.managetype === 2) {
// str = "批次"; // str = "批次";
// } // }
return h('div', '详情'); return h("div", "详情");
}, },
}, },
{ {
...@@ -376,24 +383,24 @@ export default { ...@@ -376,24 +383,24 @@ export default {
pagesize: 10, pagesize: 10,
columns2: [ columns2: [
{ {
title: "工装类型", title: "工装类型",
key: "category", key: "category",
}, },
{ {
title: "工装料号", title: "工装料号",
key: "category", key: "partnumber",
}, },
{ {
title: "工装名称", title: "工装名称",
key: "category", key: "name",
}, },
{ {
title: "工装规格", title: "工装规格",
key: "category", key: "specfication",
}, },
{ {
title: "工装编号", title: "工装编号",
key: "category", key: "code",
}, },
], ],
modal: false, modal: false,
...@@ -450,7 +457,6 @@ export default { ...@@ -450,7 +457,6 @@ export default {
// this.data1 = arr; // this.data1 = arr;
console.log(this.data1); console.log(this.data1);
this.data1 = res.data.data; this.data1 = res.data.data;
} }
}); });
}, },
...@@ -569,6 +575,28 @@ export default { ...@@ -569,6 +575,28 @@ export default {
} }
}); });
}, },
handleRowChange(currentRow, oldCurrentRow) {
this.detailobj = currentRow;
},
onExpand(row, index) {
this.detailobj = row;
this.data1.forEach((item, i) => {
//这个循环是为了每次只能展开一个,其他自动收起,不需要可以去掉
i !== index ? (this.data1[i]._expanded = false) : "";
});
this.data1[index]._expanded = !this.data1[index]._expanded;
this.data1.sort();
},
handlePageSize(value) {
this.page = 1;
this.pagesize = value;
this.search(0);
},
changePage(value) {
this.page = value;
this.search(0);
},
/*********文件上传 start******** */ /*********文件上传 start******** */
handleBeforeUpload(file) { handleBeforeUpload(file) {
this.spinShow = true; this.spinShow = true;
...@@ -598,20 +626,24 @@ export default { ...@@ -598,20 +626,24 @@ export default {
/*********文件上传 end******** */ /*********文件上传 end******** */
request(url, data, type) { request(url, data, type) {
if (type == "get") { if (type == "get") {
return this.axios.request({ return this.axios
url: url, .request({
params: data, url: url,
method: type, params: data,
}).then((res) => { method: type,
})
.then((res) => {
return res; return res;
}) })
.catch((error) => error); .catch((error) => error);
} else { } else {
return this.axios.request({ return this.axios
url: url, .request({
data, url: url,
method: type, data,
}).then((res) => { method: type,
})
.then((res) => {
return res; return res;
}) })
.catch((error) => error); .catch((error) => error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment