Commit 52938112 authored by 仇晓婷's avatar 仇晓婷

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

parents 7f08beb0 79d960c7
...@@ -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,10 +520,11 @@ export default { ...@@ -518,10 +520,11 @@ export default {
const tHeader = []; // 设置Excel的表格第一行的标题 const tHeader = []; // 设置Excel的表格第一行的标题
const filterVal = []; //list里对象的属性 const filterVal = []; //list里对象的属性
var tempCol = []; var tempCol = [];
var tempCol1 = []; var tempCol1 = []; //存放物料相关表头
var columnsCur = this.$u.clone(this.columnsNow); //导出列标题信息griddata this.$refs.grid.columnsCur var tempCol2 = []; //存放工艺规程相关表头
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")) {
if (el.code) { if (el.code) {
tempCol.push({ tempCol.push({
key: el.key, key: el.key,
...@@ -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() {
......
...@@ -215,12 +215,13 @@ export default { ...@@ -215,12 +215,13 @@ export default {
useData.forEach(eles => { useData.forEach(eles => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id //如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if ( if (
eles.departmentTitle && [(eles.departmentTitle &&
eles.departmentTitle != "" && eles.departmentTitle != "") || (eles.departmentName &&
eles.departmentName != "")] &&
(!eles.departmentId || eles.departmentId == "") (!eles.departmentId || eles.departmentId == "")
) { ) {
this.departArr.forEach((e) => { this.departArr.forEach((e) => {
if (eles.departmentTitle && eles.departmentTitle == e.name) { if ((eles.departmentTitle && eles.departmentTitle == e.name) || (eles.departmentName && eles.departmentName == e.name)) {
eles.departmentId = e.id; eles.departmentId = e.id;
} }
}); });
...@@ -228,14 +229,16 @@ export default { ...@@ -228,14 +229,16 @@ export default {
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle //如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
eles.departmentId && eles.departmentId &&
eles.departmentId + "" != "" && eles.departmentId + "" != "" &&
(!eles.departmentTitle || eles.departmentTitle == "") (!eles.departmentTitle || eles.departmentTitle == "") && (!eles.departmentName || eles.departmentName == "")
) { ) {
this.departArr.forEach((e) => { this.departArr.forEach((e) => {
if (eles.departmentId && eles.departmentId == e.id) { if (eles.departmentId && eles.departmentId == e.id) {
eles.departmentTitle = e.name; eles.departmentTitle = e.name;
eles.departmentName = e.name;
} }
}); });
} }
arrTitleUse.forEach((elem) => { arrTitleUse.forEach((elem) => {
if (eles[elem.key] && eles[elem.key] != "" && eles[elem.key] != null) { if (eles[elem.key] && eles[elem.key] != "" && eles[elem.key] != null) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值 //如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
......
<template> <template>
<Select v-model="dep" :placeholder="placeholdeinfo" clearable @on-clear="onClear"> <Select v-model="dep" :placeholder="placeholdeinfo" clearable @on-clear="onClear">
<Option <Option v-for="(item,index) in list" :key="index" :value="item.value" style="display:none" :label="item.label"></Option>
v-for="(item,index) in list"
:key="index"
:value="item.value"
style="display:none"
:label="item.label"
></Option>
<Tree key="mytree" :data="data1" ref="mytree" :render="renderContent"></Tree> <Tree key="mytree" :data="data1" ref="mytree" :render="renderContent"></Tree>
</Select> </Select>
</template> </template>
<script>
<script>
export default { export default {
name: "Add", name: "Add",
model: { model: {
...@@ -59,7 +54,10 @@ export default { ...@@ -59,7 +54,10 @@ export default {
this.selectdata = data; this.selectdata = data;
if (data[0].isProduct == "1") { if (data[0].isProduct == "1") {
this.list = []; this.list = [];
this.list.push({ label: data[0].title, value: data[0].id }); this.list.push({
label: data[0].title,
value: data[0].id
});
this.orderSearchForm.productName = data[0].title; this.orderSearchForm.productName = data[0].title;
this.orderSearchForm.productId = data[0].productId; this.orderSearchForm.productId = data[0].productId;
this.orderSearchForm.drawingNo = data[0].drawingNo; this.orderSearchForm.drawingNo = data[0].drawingNo;
...@@ -97,7 +95,11 @@ export default { ...@@ -97,7 +95,11 @@ export default {
} }
}); });
}, },
renderContent(h, { root, node, data }) { renderContent(h, {
root,
node,
data
}) {
let type = "md-folder"; let type = "md-folder";
let title = data.title; let title = data.title;
if (data.isProduct != 0) { if (data.isProduct != 0) {
...@@ -114,8 +116,7 @@ export default { ...@@ -114,8 +116,7 @@ export default {
} }
//渲染树的样式 //渲染树的样式
return h( return h(
"span", "span", {
{
on: { on: {
click: () => { click: () => {
let arrTree = []; let arrTree = [];
...@@ -134,8 +135,7 @@ export default { ...@@ -134,8 +135,7 @@ export default {
} }
}), }),
h( h(
"span", "span", {
{
style: { style: {
color: data.isProduct == 0 ? "#000" : "rgba(38, 128, 235, 1)" color: data.isProduct == 0 ? "#000" : "rgba(38, 128, 235, 1)"
} }
...@@ -171,7 +171,10 @@ export default { ...@@ -171,7 +171,10 @@ export default {
dataTemp.forEach(data => { dataTemp.forEach(data => {
if (data.isProduct == 1 && data.id == this.dep) { if (data.isProduct == 1 && data.id == this.dep) {
this.placeholdeinfo = data.title; this.placeholdeinfo = data.title;
this.list.push({ label: data.title, value: data.id }); this.list.push({
label: data.title,
value: data.id
});
} }
}); });
} }
......
...@@ -1175,10 +1175,11 @@ export default { ...@@ -1175,10 +1175,11 @@ export default {
code: '工艺文件编号', code: '工艺文件编号',
productId: '产品id', productId: '产品id',
productName: '产品名称', productName: '产品名称',
productBomId: '产品BomId',
drawingNo: '图号', drawingNo: '图号',
version: '版本', version: '版本',
author: '编制人', author: '编制人',
departmentId: '主制车间', departmentId: '主制车间Id',
departmentName: '主制车间', departmentName: '主制车间',
isMain: '主工艺', isMain: '主工艺',
upId: '父工艺', upId: '父工艺',
...@@ -1188,8 +1189,8 @@ export default { ...@@ -1188,8 +1189,8 @@ export default {
approvalStatus: '审批状态', approvalStatus: '审批状态',
remark: '工艺说明', remark: '工艺说明',
approvalStatusRemark: '审批备注', approvalStatusRemark: '审批备注',
auditUserId1: '审批人', auditUserId1: '审批人1',
auditUserId2: '审批人', auditUserId2: '审批人2',
isDeleted: '是否删除', isDeleted: '是否删除',
platesnum: '板数', platesnum: '板数',
isEffect: '有效', isEffect: '有效',
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<Search /> <Search />
</template> </template>
<template slot="buttons"> <template slot="buttons">
应用规则:
<Select v-model="rulesAi" multiple style="width:280px;" class="tl"> <Select v-model="rulesAi" multiple style="width:280px;" class="tl">
<Option v-for="item in rulesAiList" :value="item.value" :key="item.value">{{ item.label }}</Option> <Option v-for="item in rulesAiList" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select> </Select>
......
This diff is collapsed.
...@@ -74,12 +74,16 @@ export default { ...@@ -74,12 +74,16 @@ export default {
key: "codeRuleType", key: "codeRuleType",
title: "类型", title: "类型",
align: "center", align: "center",
code: "material.code.type" code: "material.code.type",
import: true,
hide: true,
}, },
{ {
key: "codeRuleId", key: "codeRuleId",
title: "编码名称", title: "编码名称",
materialKey: '3', materialKey: '3',
import: true,
hide: true,
render: (h, params) => { render: (h, params) => {
return h( return h(
"span", {}, "span", {},
...@@ -92,6 +96,8 @@ export default { ...@@ -92,6 +96,8 @@ export default {
title: "大类", title: "大类",
align: "right", align: "right",
materialKey: '1', materialKey: '1',
import: true,
hide: true,
render: (h, params) => { render: (h, params) => {
return h( return h(
"span", {}, "span", {},
...@@ -104,6 +110,8 @@ export default { ...@@ -104,6 +110,8 @@ export default {
title: "子类", title: "子类",
align: "right", align: "right",
materialKey: '2', materialKey: '2',
import: true,
hide: true,
render: (h, params) => { render: (h, params) => {
return h( return h(
"span", {}, "span", {},
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="110"> <Form ref="form" :model="entity" :rules="rules" :label-width="110">
<Row> <Row>
<!-- <Col :span="12"> <!-- <Col :span="12">
<FormItem :label="l('classId')" prop="classId"> <FormItem :label="l('classId')" prop="classId">
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</Col> </Col>
<Col :span="8"> <Col :span="8">
<FormItem :label="l('departmentName')" prop="departmentId"> <FormItem :label="l('departmentName')" prop="departmentId">
<departmentSelect v-model="entity.departmentId" type="3" @on-change="departChange"></departmentSelect> <departmentSelect v-model="entity.departmentId" :type="3" @on-change="departChange"></departmentSelect>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="8"> <Col :span="8">
...@@ -151,9 +151,11 @@ ...@@ -151,9 +151,11 @@
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script>
<script>
import Api from "./api"; import Api from "./api";
import ApiWorkflow from "../workflow/process/api"; import ApiWorkflow from "../workflow/process/api";
import iQuill from "@/components/quill"; import iQuill from "@/components/quill";
...@@ -197,16 +199,22 @@ export default { ...@@ -197,16 +199,22 @@ export default {
fileId: "" fileId: ""
}, },
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{
code: [{ required: true, message: "必填", trigger: "blur" }], required: true,
routingType: [ message: "必填",
{ trigger: "blur"
}],
code: [{
required: true,
message: "必填",
trigger: "blur"
}],
routingType: [{
required: true, required: true,
message: "请选择工艺类型", message: "请选择工艺类型",
trigger: "change", trigger: "change",
type: "number" type: "number"
} }]
]
}, },
parms: { parms: {
app: "technology", app: "technology",
...@@ -328,7 +336,9 @@ export default { ...@@ -328,7 +336,9 @@ export default {
} }
}, },
load(v) { load(v) {
Api.get({ id: v }).then(r => { Api.get({
id: v
}).then(r => {
this.entity = r.result; this.entity = r.result;
this.entity.isEffect = parseInt(r.result.isEffect); this.entity.isEffect = parseInt(r.result.isEffect);
this.entity.id = 0; this.entity.id = 0;
...@@ -336,7 +346,10 @@ export default { ...@@ -336,7 +346,10 @@ export default {
this.getCodNumber(); this.getCodNumber();
}, },
getCodNumber() { getCodNumber() {
Api.getCodeNumber({ code: "GY", count: "1" }).then(r => { Api.getCodeNumber({
code: "GY",
count: "1"
}).then(r => {
if (r.success) { if (r.success) {
this.entity.code = r.result[0]; this.entity.code = r.result[0];
} else { } else {
......
...@@ -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);
},
} }
...@@ -16,11 +16,13 @@ ...@@ -16,11 +16,13 @@
</template> </template>
<template slot="buttons"> <template slot="buttons">
<Button type="primary" @click="add" v-show="headerStatus==0||headerStatus==4">新增</Button> <Button type="primary" @click="add" v-show="headerStatus==0||headerStatus==4">新增</Button>
<Button @click="openModalIm">导入</Button>
</template> </template>
</DataGrid> </DataGrid>
<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="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
</div> </div>
</template> </template>
...@@ -56,7 +58,9 @@ export default { ...@@ -56,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",
...@@ -64,12 +68,31 @@ export default { ...@@ -64,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"),
...@@ -93,6 +116,13 @@ export default { ...@@ -93,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"),
...@@ -229,6 +259,9 @@ export default { ...@@ -229,6 +259,9 @@ export default {
], ],
headerStatus: -1, headerStatus: -1,
productBomId: -1, productBomId: -1,
ModalIm: false,
temTitle: "工艺Bom",
routingHeaderData: [],
}; };
}, },
created() { created() {
...@@ -243,6 +276,7 @@ export default { ...@@ -243,6 +276,7 @@ export default {
}, },
mounted() { mounted() {
console.log(this); console.log(this);
this.getRoutingHeaderData();
this.search(); this.search();
}, },
async fetch({ async fetch({
...@@ -298,6 +332,81 @@ export default { ...@@ -298,6 +332,81 @@ export default {
this.curId = 0; this.curId = 0;
this.modal = false; this.modal = false;
}, },
//批量导入start
//导入功能
openModalIm() {
this.ModalIm = true
},
ModalImCancel() {
this.ModalIm = false
},
getData(val) {
let url = `${technologyUrl}productinfoimportservice/import`;
this.$refs.importExcel.deelData(url, this.cols, this.formatMethod(val))
},
//根据页面二次处理数据
formatMethod(val) {
// alert(JSON.stringify(val))
let tempData = this.$u.clone(val);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
routingHeaderId: Number(this.headerid),
routingDetailId: ele.routingDetailId ? Number(ele.routingDetailId) : null,
routingDetailNo: ele.routingDetailNo ? Number(ele.routingDetailNo) : null,
routingDetailName: ele.routingDetailName ? ele.routingDetailName : '',
routingStepId: 0,
quantity: ele.quantity ? Number(ele.quantity) : 0,
materialId: ele.materialId ? ele.materialId : '',
materialType: ele.materialType ? Number(ele.materialType) : '',
materialNumber: ele.materialNumber ? ele.materialNumber : '',
nameMaterial: ele.nameMaterial ? ele.nameMaterial : '',
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.routingDetailId && ele.routingDetailId != null) {
obj.ico = false
} else {
obj.ico = true
}
tempList.push(obj);
});
return tempList
},
//批量导入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;
......
This diff is collapsed.
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