Commit b96c901c by yiyu.li

add

parent 32ab390d
......@@ -107,6 +107,8 @@
:columns="columns1"
:data="data1"
highlight-row
@on-current-change="handleRowChange"
@on-row-click="onExpand"
></Table>
<div class="pageDiv">
<div class="pageDirection">
......@@ -117,6 +119,8 @@
show-sizer
show-total
:page-size-opts="[10, 20, 30, 40, 100]"
@on-change="changePage"
@on-page-size-change="handlePageSize"
></Page>
</div>
</div>
......@@ -257,7 +261,6 @@ export default {
columns1: [
{
type: "expand",
// title: "装配详情",
width: "50",
render: (h, params) => {
// let str = "";
......@@ -266,11 +269,15 @@ export default {
// } else if (params.row.managetype === 2) {
// str = "批次";
// }
return h(Table, {
props:{
data:params.row.childrens,
columns:this.columns2
}
return h("Table", {
props: {
data: params.row.childrens,
columns: this.columns2,
highlightRow: true,
},
on: {
onCurrentChange: () => {},
},
});
},
},
......@@ -305,7 +312,7 @@ export default {
title: "父工装编号",
key: "code",
},
{
title: "装配详情",
key: "s",
......@@ -316,7 +323,7 @@ export default {
// } else if (params.row.managetype === 2) {
// str = "批次";
// }
return h('div', '详情');
return h("div", "详情");
},
},
{
......@@ -376,24 +383,24 @@ export default {
pagesize: 10,
columns2: [
{
title: "工装类型",
title: "工装类型",
key: "category",
},
{
title: "工装料号",
key: "category",
title: "工装料号",
key: "partnumber",
},
{
title: "工装名称",
key: "category",
title: "工装名称",
key: "name",
},
{
title: "工装规格",
key: "category",
title: "工装规格",
key: "specfication",
},
{
title: "工装编号",
key: "category",
title: "工装编号",
key: "code",
},
],
modal: false,
......@@ -450,7 +457,6 @@ export default {
// this.data1 = arr;
console.log(this.data1);
this.data1 = res.data.data;
}
});
},
......@@ -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******** */
handleBeforeUpload(file) {
this.spinShow = true;
......@@ -598,20 +626,24 @@ export default {
/*********文件上传 end******** */
request(url, data, type) {
if (type == "get") {
return this.axios.request({
url: url,
params: data,
method: type,
}).then((res) => {
return this.axios
.request({
url: url,
params: data,
method: type,
})
.then((res) => {
return res;
})
.catch((error) => error);
} else {
return this.axios.request({
url: url,
data,
method: type,
}).then((res) => {
return this.axios
.request({
url: url,
data,
method: type,
})
.then((res) => {
return res;
})
.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