Commit 1ea98a1e authored by renjintao's avatar renjintao

工艺规程&&工艺Bom......ing

parent 5d7f2c42
...@@ -102,6 +102,7 @@ export default { ...@@ -102,6 +102,7 @@ export default {
userId: this.$store.state.userInfo.userId, userId: this.$store.state.userInfo.userId,
treeData: [], //物料数据 treeData: [], //物料数据
codeRuleData: [], //物料编码 codeRuleData: [], //物料编码
routingHeaderData: [], //工艺规程
}; };
}, },
props: { props: {
...@@ -276,6 +277,7 @@ export default { ...@@ -276,6 +277,7 @@ export default {
//物料加载类型数据 //物料加载类型数据
this.getTreeData(); this.getTreeData();
this.getcodeRuleData(); this.getcodeRuleData();
this.getRoutingHeaderData();
}, },
methods: { methods: {
//数据加载 //数据加载
...@@ -518,7 +520,8 @@ export default { ...@@ -518,7 +520,8 @@ export default {
const tHeader = []; // 设置Excel的表格第一行的标题 const tHeader = []; // 设置Excel的表格第一行的标题
const filterVal = []; //list里对象的属性 const filterVal = []; //list里对象的属性
var tempCol = []; var tempCol = [];
var tempCol1 = []; var tempCol1 = []; //存放物料相关表头
var tempCol2 = []; //存放工艺规程相关表头
var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => { columnsCur.forEach((el) => {
if ((el.hide && el.import) || (!el.hide && el.key != "action" && el.type != "selection" && el.key != "ico")) { if ((el.hide && el.import) || (!el.hide && el.key != "action" && el.type != "selection" && el.key != "ico")) {
...@@ -534,6 +537,13 @@ export default { ...@@ -534,6 +537,13 @@ export default {
code: el.materialKey code: el.materialKey
}); //临时存放物料管理大类和子类列表 }); //临时存放物料管理大类和子类列表
} }
if (el.techKey) {
tempCol2.push({
key: el.key,
code: el.techKey
}); //临时存放工艺规程相关转换
}
tHeader.push(el.title); tHeader.push(el.title);
filterVal.push(el.key); filterVal.push(el.key);
} }
...@@ -546,7 +556,7 @@ export default { ...@@ -546,7 +556,7 @@ export default {
e[ele.key] e[ele.key]
); );
}); });
//导出数据增加对应的物料管理信息 //导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】
tempCol1.forEach((elcol1) => { tempCol1.forEach((elcol1) => {
if (elcol1.code == 1) { if (elcol1.code == 1) {
e[elcol1.key] = this.getType1(e[elcol1.key]) e[elcol1.key] = this.getType1(e[elcol1.key])
...@@ -556,6 +566,12 @@ export default { ...@@ -556,6 +566,12 @@ export default {
e[elcol1.key] = this.getType3(e[elcol1.key]) e[elcol1.key] = this.getType3(e[elcol1.key])
} }
}); });
//导出工艺规程相关转换表头信息
tempCol2.forEach((elcol2) => {
if (elcol2.code == 1) {
e[elcol2.key] = this.getRoutingHeaderName(e[elcol2.key])
}
});
}); });
...@@ -620,6 +636,29 @@ export default { ...@@ -620,6 +636,29 @@ export default {
return codeRuleName return codeRuleName
}, },
//物料大类和子类的解析end //物料大类和子类的解析end
//工艺规程的解析start
//获取工艺规程名称
getRoutingHeaderData() {
let data = {
conditions: []
};
this.$api.post(`${technologyUrl}routingheader/list`, data).then((r) => {
if (r.success) {
this.routingHeaderData = r.result || []
}
});
},
getRoutingHeaderName(val) {
let routingHeaderDataList = this.$u.clone(this.routingHeaderData)
let routingHeaderName = ""
routingHeaderDataList.forEach(ele => {
if (ele.id == val) {
routingHeaderName = ele.name
}
})
return routingHeaderName
},
//工艺规程的解析end
}, },
computed: { computed: {
columnsNow() { columnsNow() {
......
This diff is collapsed.
...@@ -27,4 +27,8 @@ export default { ...@@ -27,4 +27,8 @@ export default {
getmaterialids(params) { getmaterialids(params) {
return Api.get(`${technologyUrl}productinfo/getmaterialids`, params); return Api.get(`${technologyUrl}productinfo/getmaterialids`, params);
}, },
//获取所有工艺规程
getRoutingheaderList(params) {
return Api.post(`${technologyUrl}routingheader/list`, params);
},
} }
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" :headid="hid" :productBomId="productBomId" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" :headid="hid" :productBomId="productBomId" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
<ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="cols" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" /> <ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
</div> </div>
</template> </template>
...@@ -58,7 +58,9 @@ export default { ...@@ -58,7 +58,9 @@ export default {
detail: null, detail: null,
curId: 0, curId: 0,
hid: 0, hid: 0,
columns: [{ columns: [
{
key: "routingDetailNo", key: "routingDetailNo",
title: this.l("routingDetailNo"), title: this.l("routingDetailNo"),
align: "left", align: "left",
...@@ -66,12 +68,31 @@ export default { ...@@ -66,12 +68,31 @@ export default {
width: 100, width: 100,
sortable: true sortable: true
}, },
{
key: "routingHeaderId",
title: this.l("routingHeaderName"),
hide: true,
import: true,
techKey: '1',
render: (h, params) => {
return h(
"span", {},
this.getRoutingHeaderName(params.row.routingHeaderId)
);
}
},
{ {
key: "routingDetailName", key: "routingDetailName",
title: this.l("routingDetailName"), title: this.l("routingDetailName"),
align: "left", align: "left",
high: true high: true
}, },
{
key: "routingDetailId",
title: this.l("routingDetailId"),
hide: true,
import: true,
},
{ {
key: "quantity", key: "quantity",
title: this.l("quantity"), title: this.l("quantity"),
...@@ -95,6 +116,13 @@ export default { ...@@ -95,6 +116,13 @@ export default {
easy: true, easy: true,
high: true high: true
}, },
{
key: "materialId",
title: this.l("materialId"),
align: "left",
hide: true,
import: true
},
{ {
key: "nameMaterial", key: "nameMaterial",
title: this.l("nameMaterial"), title: this.l("nameMaterial"),
...@@ -233,6 +261,7 @@ export default { ...@@ -233,6 +261,7 @@ export default {
productBomId: -1, productBomId: -1,
ModalIm: false, ModalIm: false,
temTitle: "工艺Bom", temTitle: "工艺Bom",
routingHeaderData: [],
}; };
}, },
created() { created() {
...@@ -247,6 +276,7 @@ export default { ...@@ -247,6 +276,7 @@ export default {
}, },
mounted() { mounted() {
console.log(this); console.log(this);
this.getRoutingHeaderData();
this.search(); this.search();
}, },
async fetch({ async fetch({
...@@ -316,23 +346,33 @@ export default { ...@@ -316,23 +346,33 @@ export default {
}, },
//根据页面二次处理数据 //根据页面二次处理数据
formatMethod(val) { formatMethod(val) {
// alert(JSON.stringify(val))
let tempData = this.$u.clone(val); let tempData = this.$u.clone(val);
let tempList = []; let tempList = [];
tempData.forEach((ele) => { tempData.forEach((ele) => {
let obj = { let obj = {
name: ele.name ? ele.name : '', routingHeaderId: Number(this.headerid),
version: ele.version ? Number(ele.version) : '', routingDetailId: ele.routingDetailId ? Number(ele.routingDetailId) : null,
drawing: ele.drawing ? ele.drawing : '', routingDetailNo: ele.routingDetailNo ? Number(ele.routingDetailNo) : null,
description: ele.description ? ele.description : "", routingDetailName: ele.routingDetailName ? ele.routingDetailName : '',
code: 0, routingStepId: 0,
status: this.nodeInfo.status == 1 ? 3 : 0, quantity: ele.quantity ? Number(ele.quantity) : 0,
codeRuleId: this.nodeInfo.codeRuleId, materialId: ele.materialId ? ele.materialId : '',
categoryId: this.nodeInfo.categoryId, //左侧树点击的id materialType: ele.materialType ? Number(ele.materialType) : '',
customProperties: {}, materialNumber: ele.materialNumber ? ele.materialNumber : '',
rootCategoryId: this.nodeInfo.rootCategoryId, //左侧树点击的数据的最顶层id nameMaterial: ele.nameMaterial ? ele.nameMaterial : '',
codeRuleType: this.nodeInfo.codeRuleType brand: ele.brand ? ele.brand : '',
specifications: ele.specifications ? ele.specifications : '',
xhgg: ele.xhgg ? ele.xhgg : '',
texture: ele.texture ? ele.texture : '',
procurementStandards: ele.procurementStandards ? ele.procurementStandards : '',
qualityGrade: ele.qualityGrade ? ele.qualityGrade : '',
state: null,
extend: "",
remark: "",
drawNum: ele.drawNum ? ele.drawNum : ''
}; };
if (ele.name && ele.name != '') { if (ele.routingDetailId && ele.routingDetailId != null) {
obj.ico = false obj.ico = false
} else { } else {
obj.ico = true obj.ico = true
...@@ -344,6 +384,29 @@ export default { ...@@ -344,6 +384,29 @@ export default {
}, },
//批量导入end //批量导入end
//工艺规程id和name之间的转换
//获取工艺规程信息
getRoutingHeaderData() {
let data = {
conditions: []
};
Api.getRoutingheaderList(data).then((r) => {
if (r.success) {
this.routingHeaderData = r.result || []
}
});
},
//根据工艺规程ID获得name
getRoutingHeaderName(val) {
let routingHeaderDataList = this.$u.clone(this.routingHeaderData)
let routingHeaderName = ""
routingHeaderDataList.forEach(ele => {
if (ele.id == Number(val)) {
routingHeaderName = ele.name
}
})
return routingHeaderName
},
l(key) { l(key) {
let vkey = "routingsupporting" + "." + key; let vkey = "routingsupporting" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
......
...@@ -595,7 +595,7 @@ export default { ...@@ -595,7 +595,7 @@ export default {
isSendPpm: 1, isSendPpm: 1,
fileId: "", fileId: "",
phase: ele.phase ? ele.phase : null, phase: ele.phase ? ele.phase : null,
isEffect: ele.phase ? ele.phase : 1 isEffect: ele.isEffect ? ele.isEffect : 1
}; };
if (ele.name && ele.name != '') { if (ele.name && ele.name != '') {
obj.ico = false obj.ico = false
......
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