Commit 4865541a authored by 仇晓婷's avatar 仇晓婷

Merge branch 'product' of http://git.mes123.com/zhouyx/mes-ui into product

parents 9dcf529c 0b9ab7d5
This diff is collapsed.
This diff is collapsed.
......@@ -234,7 +234,8 @@ export default {
attrs: {
icon: "md-options",
type: "icon",
title: "工序参数设置"
title: "工序参数设置",
oprate: "edit",
},
on: { click: () => this.openAddModel(2, params.row) }
}),
......@@ -243,7 +244,7 @@ export default {
icon: "md-return-left",
type: "icon",
title: "移出排产池",
oprate: "delete",
oprate: "edit",
msg: "确认要移出排产吗?"
},
on: { click: () => this.remove(params.row.part_task_pk) }
......@@ -253,7 +254,7 @@ export default {
icon: "md-refresh",
type: "icon",
title: "恢复工序",
oprate: "delete",
oprate: "edit",
msg: "确认要恢复工序吗?"
},
on: { click: () => this.refresh(params.row.part_task_pk) }
......
......@@ -71,7 +71,7 @@ export default {
easySearch: {
keys: {
op:
"mesCode,remark,taskRequire,productCode,productName,drawnNumber,batchNumber,projectNumber",
"mesCode,productCode,productName,drawnNumber,batchNumber,projectNumber",
value: null
}
},
......@@ -235,15 +235,102 @@ export default {
]);
}
}
]
],
treeData: [],
treeInputSearch: "",
ocolumn: [],
treeHeight: "",
tableHeight: "",
ids: [],
orderSearchForm: {
productId: "", //产品id
productName: "", //产品名称
taskType: "", //任务类型
stage: "", //阶段
materialId: "", //材料
quantity: null, //数量
guestName: "", //甲方客户
printSupply: "", //3D打印承制单位
functionaryOffice: "", //厂内责任机关
mainDepartmentId: "", //厂内责任主体部门ID
taskRequire: "", //任务接点要求
putintDocmentCode: "", //甲方投产输入文件编号
technologyDocmentCode: "", //甲方技术输入文件编号
outerDrawnNumber: "", //外部图号/模型号
modelVersion: "", //模型版本
taskCode: "", //甲方任务号
designer: "", //甲方设计人员
officeFunctionary: "", //厂内机关负责人
mainRoutingPeople: "", //厂内主工艺人员
routing_Method: "", //工艺方法
outer_Envelope_Size: "", //包装尺寸
demandStartDate: "", //开始时间
demandFinishDate: "", //完成时间
remark: "", //备注
projectNumber: "", //项目号
batchNumber: "", //批次号
urgencyLevel: null //紧急程度
},
list: [],
data1: [],
selectdata: [],
//以下为手写死数据集:
orderCatList: [], //订单类型下拉
outerCodeList: [], //型号外部代码下拉
missionCodeList: [], //任务号下拉
stageList: [], //阶段下拉
materailList: [], //材料下拉
routingAccessList: [], //工艺方法下拉
drawNumberList: [], //图号下拉
docNameList: [], //文档名称下拉
ownerGustList: [], //甲方客户下拉
mainDeptList: [], //厂内主体部门下拉
taskTypeList: [], //任务类型
statusList: [] //状态类型
};
},
created() {
this.treeHeight = window.innerHeight - 150;
},
mounted() {
console.log(this);
this.initTree();
this.tableHeight = window.innerHeight - 220;
this.$refs.CustomTable.getTableHeight(this.tableHeight);
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.treeHeight = window.screenHeight - 150;
this.tableHeight = window.screenHeight - 220;
this.$refs.CustomTable.getTableHeight(this.tableHeight);
})();
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
computed: {
searchList() {
let nodeList = this.treeData;
var text = this.treeInputSearch;
var newNodeList = [];
function searchTree(nodeLists, value) {
for (let i = 0; i < nodeLists.length; i++) {
if (nodeLists[i].title.indexOf(value) != -1) {
newNodeList.push(nodeLists[i]);
} else if (nodeLists[i].children.length > 0) {
searchTree(nodeLists[i].children, value);
}
}
}
if (text != "") {
searchTree(nodeList, text);
} else {
return nodeList;
}
return newNodeList;
}
},
methods: {
addOk() {
this.$refs.grid.load();
......@@ -290,7 +377,83 @@ export default {
l(key) {
let vkey = "mes_plan" + "." + key;
return this.$t(vkey) || key;
}
},
//new start
initTree() {
var sumData = [];
this.$http.order.getallselecttree().then(res => {
alert(JSON.stringify(res))
if (res.result) {
for (var i = 0; i < res.result.length; i++) {
sumData = sumData.concat(res.result[i]);
}
this.treeData = sumData;
this.data1 = JSON.parse(JSON.stringify(sumData));
} else {
this.$Message.error("加载产品树失败!");
}
});
},
selectTreeNode(value) {
if (value.length > 0) {
this.ids = [];
this.getAllIds(value);
if (this.ids.length > 0) {
this.orderSearchForm.productId = this.ids.join(",");
} else {
this.orderSearchForm.productId = "-1";
this.orderSearchForm.productName = "";
}
this.$refs.CustomTable.easySearch(this.orderSearchForm);
}
},
//得到此树节点下所有是产品的productId
getAllIds(trees) {
trees.forEach((data, index) => {
var that = this;
if (data.isProduct) {
this.ids.push(data.productId);
}
if (data.children.length > 0) {
this.getAllIds(data.children);
}
});
},
handleSelect(data) {
if (data.length > 0) {
this.selectdata = [];
this.selectdata = data;
this.list = [];
this.list.push({ label: data[0].title, value: data[0].id });
//this.formValidate.classType=data[0].id;
if (data[0].isProduct == "1") {
this.orderSearchForm.productName = data[0].id;
this.orderSearchForm.productId = data[0].productId;
} else {
this.$Message.error("此节点不是产品,请选择产品节点!");
}
}
},
renderContent(h, { root, node, data }) {
//渲染树的样式
return h(
"span",
{
style: {
color: data.isProduct != "1" ? "#249E91" : "#333", //根据选中状态设置样式
cursor: "pointer"
},
on: {
click: () => {
let arrTree = [];
arrTree.push(data);
this.handleSelect(arrTree); //手动选择树节点
}
}
},
data.title
);
},
}
};
</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