Commit 47593bf7 authored by renjintao's avatar renjintao

tabletree

parent 7b639e42
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
</div> </div>
</Sider> </Sider>
<Content class="content"> <Content class="content">
<!--:data="dataT"-->
<DataGrid <DataGrid
:action="action" :action="action"
:columns="columns" :columns="columns"
...@@ -327,8 +328,8 @@ export default { ...@@ -327,8 +328,8 @@ export default {
params.row.id == params.row.rootId && params.row.id == params.row.rootId &&
params.row.divideMark != 0) || params.row.divideMark != 0) ||
params.row.status != 1 params.row.status != 1
// ||(params.row.id != params.row.rootId && this.sondeletecheck1(params.row.rootId)>0) ? // ||(params.row.id != params.row.rootId && this.sondeletecheck1(params.row.rootId)>0)
? "display:none" "display:none"
: "" : ""
}, },
"删除" "删除"
...@@ -351,6 +352,67 @@ export default { ...@@ -351,6 +352,67 @@ export default {
]); ]);
} }
} }
// //传list数据时的判断
// {
// title: "操作",
// key: "action",
// width: 180,
// align: "left",
// render: (h, params) => {
// return h("div", { class: "action" }, [
// h(
// "op",
// {
// attrs: { oprate: "detail" },
// on: { click: () => this.detail(params.row) }
// },
// "查看"
// ),
// h(
// "op",
// {
// attrs: { oprate: "edit" },
// on: { click: () => this.edit(params.row) },
// style:
// (params.row.rootId == 0 && params.row.divideMark == 1) ||
// params.row.rootId != 0 ||
// params.row.status != 1
// ? "display:none"
// : ""
// },
// "编辑"
// ),
// h(
// "op",
// {
// attrs: { oprate: "remove" },
// on: { click: () => this.remove(params.row) },
// style:
// (params.row.rootId == 0 && params.row.divideMark == 1) ||
// params.row.status != 1
// ? // ||(params.row.id != params.row.rootId && this.sondeletecheck1(params.row.rootId)>0)
// "display:none"
// : ""
// },
// "删除"
// ),
// h(
// "op",
// {
// attrs: { oprate: "detail" },
// on: { click: () => this.split(params.row) },
// style:
// params.row.divideMark == 1 ||
// params.row.status != 1 ||
// params.row.quantity <= 1
// ? "display:none"
// : ""
// },
// "分解"
// )
// ]);
// }
// }
], ],
treeData: [], treeData: [],
treeInputSearch: "", treeInputSearch: "",
...@@ -372,6 +434,207 @@ export default { ...@@ -372,6 +434,207 @@ export default {
urgencyLevel: null //紧急程度 urgencyLevel: null //紧急程度
}, },
list: [], list: [],
//data测试数据
dataT: [],
dataTemp: [
{
mesCode: "DDBH_20200414_32",
taskType: 2,
productId: 71,
quantity: 10,
remark: "5",
taskRequire: "4",
status: 1,
divideMark: 1,
productName: "铅笔",
drawnNumber: "qianbii11",
rootId: 0,
batchNumber: "5",
projectNumber: "5",
urgencyLevel: 2,
productingPreparationPeople: 0,
productingPreparationFinishDate: "0001-01-01 00:00:00",
quotationPeople: 0,
quotationFinishDate: "0001-01-01 00:00:00",
upId: 0,
demandStartDate: "2020-04-14 00:00:01",
demandFinishDate: "2020-04-15 00:00:01",
rootCode: "DDBH_20200414_32",
creationTime: "2020-04-16 17:21:03",
id: 46
},
{
mesCode: "DDBH_20200414_3202",
taskType: 2,
productId: 71,
quantity: 6,
remark: "5",
taskRequire: "4",
status: 4,
divideMark: 0,
productCode: "No1~No6",
productName: "铅笔",
drawnNumber: "qianbii11",
rootId: 46,
batchNumber: "5",
projectNumber: "5",
urgencyLevel: 2,
productingPreparationPeople: 56,
productingPreparationFinishDate: "2020-04-17 23:59:59",
quotationPeople: 108,
quotationFinishDate: "2020-04-17 23:59:59",
upId: 46,
demandStartDate: "2020-04-14 00:00:01",
demandFinishDate: "2020-04-15 00:00:01",
rootCode: "DDBH_20200414_32",
lastModificationTime: "2020-04-15 10:40:22",
lastModifierUserId: 1,
creationTime: "2020-04-14 17:32:13",
creatorUserId: 1,
id: 52
},
{
mesCode: "DDBH_20200414_320101",
taskType: 2,
productId: 71,
quantity: 3,
remark: "5",
taskRequire: "4",
status: 1,
divideMark: 0,
productName: "铅笔",
drawnNumber: "qianbii11",
rootId: 46,
batchNumber: "5",
projectNumber: "5",
urgencyLevel: 2,
productingPreparationPeople: 0,
productingPreparationFinishDate: "0001-01-01 00:00:00",
quotationPeople: 0,
quotationFinishDate: "0001-01-01 00:00:00",
upId: 51,
demandStartDate: "2020-04-14 00:00:01",
demandFinishDate: "2020-04-15 00:00:01",
rootCode: "DDBH_20200414_32",
lastModificationTime: "2020-04-14 17:50:18",
lastModifierUserId: 1,
creationTime: "2020-04-14 17:32:13",
creatorUserId: 1,
id: 53
},
{
mesCode: "DDBH_20200414_320102",
taskType: 2,
productId: 71,
quantity: 1,
remark: "5",
taskRequire: "4",
status: 1,
divideMark: 0,
productName: "铅笔",
drawnNumber: "qianbii11",
rootId: 46,
batchNumber: "5",
projectNumber: "5",
urgencyLevel: 2,
productingPreparationPeople: 0,
productingPreparationFinishDate: "0001-01-01 00:00:00",
quotationPeople: 0,
quotationFinishDate: "0001-01-01 00:00:00",
upId: 51,
demandStartDate: "2020-04-14 00:00:01",
demandFinishDate: "2020-04-15 00:00:01",
rootCode: "DDBH_20200414_32",
lastModificationTime: "2020-04-14 17:50:18",
lastModifierUserId: 1,
creationTime: "2020-04-14 17:32:13",
creatorUserId: 1,
id: 54
},
{
mesCode: "DDBH_20200414_31",
taskType: 2,
productId: 70,
quantity: 8,
remark: "5",
taskRequire: "4",
status: 4,
divideMark: 0,
productCode: "No1~No8",
productName: "口罩模具",
drawnNumber: "LXG_KZ_001",
rootId: 0,
batchNumber: "5",
projectNumber: "5",
urgencyLevel: 2,
productingPreparationPeople: 56,
productingPreparationFinishDate: "2020-04-16 23:59:59",
quotationPeople: 108,
quotationFinishDate: "2020-04-16 23:59:59",
upId: 0,
demandStartDate: "2020-04-14 00:00:01",
demandFinishDate: "2020-04-15 00:00:01",
rootCode: "DDBH_20200414_31",
isDeleted: false,
creationTime: "2020-04-16 17:21:03",
id: 45
},
{
mesCode: "DDBH_20200414_30",
taskType: 2,
productId: 69,
quantity: 18,
remark: "5",
taskRequire: "4",
status: 4,
divideMark: 0,
productCode: "No1~No18",
productName: "护目镜",
drawnNumber: "LXG_HMJ_001",
rootId: 0,
batchNumber: "5",
projectNumber: "5",
urgencyLevel: 2,
productingPreparationPeople: 56,
productingPreparationFinishDate: "2020-04-16 23:59:59",
quotationPeople: 1,
quotationFinishDate: "2020-04-24 23:59:59",
upId: 0,
demandStartDate: "2020-04-14 00:00:01",
demandFinishDate: "2020-04-15 00:00:01",
rootCode: "DDBH_20200414_30",
isDeleted: false,
creationTime: "2020-04-16 17:21:03",
id: 44
},
{
mesCode: "DDBH_20200414_28",
taskType: 1,
productId: 22,
quantity: 15,
remark: "rr",
taskRequire: "r",
status: 1,
divideMark: 0,
productName: "te",
drawnNumber: "te",
rootId: 0,
batchNumber: "r",
projectNumber: "rr",
urgencyLevel: 2,
productingPreparationPeople: 0,
productingPreparationFinishDate: "0001-01-01 00:00:00",
quotationPeople: 0,
quotationFinishDate: "0001-01-01 00:00:00",
upId: 0,
demandStartDate: "2020-04-14 00:00:01",
demandFinishDate: "2020-04-15 00:00:01",
rootCode: "DDBH_20200414_28",
isDeleted: false,
creationTime: "2020-04-16 17:21:03",
id: 42
}
],
data1: [], data1: [],
selectdata: [], selectdata: [],
//以下为手写死数据集: //以下为手写死数据集:
...@@ -403,6 +666,7 @@ export default { ...@@ -403,6 +666,7 @@ export default {
}, },
mounted() { mounted() {
this.initTree(); this.initTree();
//this.dataformat();//data传数据转为tree类型
this.tableHeight = window.innerHeight - 220; this.tableHeight = window.innerHeight - 220;
//this.$refs.CustomTable.getTableHeight(this.tableHeight); //this.$refs.CustomTable.getTableHeight(this.tableHeight);
window.onresize = () => { window.onresize = () => {
...@@ -629,9 +893,10 @@ export default { ...@@ -629,9 +893,10 @@ export default {
this.$Message.error("删除的原始订单中有非新建状态的子订单!"); this.$Message.error("删除的原始订单中有非新建状态的子订单!");
this.actIds = []; this.actIds = [];
return false; return false;
} else {
this.deletelModal = true;
} }
}, 400); }, 400);
this.deletelModal = true;
}, },
//批量删除 //批量删除
removeList() { removeList() {
...@@ -680,15 +945,16 @@ export default { ...@@ -680,15 +945,16 @@ export default {
//删除前判断子订单 //删除前判断子订单
sondeletecheck1(code) { sondeletecheck1(code) {
let param = { id: code }; let param = { id: code };
let delStaut=0 let delStaut = 0;
Api.sondeletecheck(param).then(res => { Api.sondeletecheck(param).then(res => {
if (res.result == 1) {//可以删除 if (res.result == 1) {
//可以删除
delStaut = 0; delStaut = 0;
} else { } else {
delStaut = 1; delStaut = 1;
} }
}); });
return delStaut return delStaut;
}, },
//删除确定 //删除确定
removeOk() { removeOk() {
...@@ -749,12 +1015,14 @@ export default { ...@@ -749,12 +1015,14 @@ export default {
this.ids = []; this.ids = [];
this.getAllIds(value); this.getAllIds(value);
if (this.ids.length > 0) { if (this.ids.length > 0) {
this.orderSearchForm.productId = this.ids.join(","); this.orderSearchForm.productId = this.ids;
} else { } else {
this.orderSearchForm.productId = "-1"; this.orderSearchForm.productId = [];
this.orderSearchForm.productName = "";
} }
this.easySearch.productId.value = this.ids; this.easySearch.productId.value = this.orderSearchForm.productId;
this.$refs.grid.easySearch();
} else {
this.easySearch.productId.value = [];
this.$refs.grid.easySearch(); this.$refs.grid.easySearch();
} }
}, },
...@@ -816,8 +1084,23 @@ export default { ...@@ -816,8 +1084,23 @@ export default {
selectRows.forEach(e => { selectRows.forEach(e => {
this.arrayIds.push(e.id); this.arrayIds.push(e.id);
}); });
} },
//list end //list end
//将数组数据转为tree
dataformat() {
this.dataT = this.$u.toTree(
this.dataTemp,
0,
u => {
if (u.divideMark == 1) {
u._disabled = true;
}
u._showChildren = true;
},
"rootId"
);
this.dataT = this.$u.clone(this.dataT);
},
} }
}; };
</script> </script>
......
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