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

工艺bom

parent 5d763a79
...@@ -19,15 +19,26 @@ export default { ...@@ -19,15 +19,26 @@ export default {
}, },
props: ["materialId", "forItem"], props: ["materialId", "forItem"],
mounted() { mounted() {
// this.get(); if (this.materialId) {
this.get();
}
}, },
watch: { watch: {
materialId(v) { materialId(v) {
this.get(); this.get();
}, },
// forItem: {
// handler(newName, oldName) {
// if (newName.id) {
// this.get();
// }
// },
// immediate: true,
// },
}, },
methods: { methods: {
get() { get() {
this.$api this.$api
.get( .get(
`${material}/custompropertydefinition/getmaterialdefinitionproperty`, `${material}/custompropertydefinition/getmaterialdefinitionproperty`,
...@@ -45,21 +56,22 @@ export default { ...@@ -45,21 +56,22 @@ export default {
return item.fieldType; return item.fieldType;
}); });
this.fileds.map((u) => { this.fileds.map((u) => {
let v = ""; // let v = "";
if (u.dataType == 1 || u.dataType == 2) { // if (u.dataType == 1 || u.dataType == 2) {
v = 0; // v = 0;
} // }
// console.log(u); // console.log(u);
// this.$set(this.entity.customProperties,u.filed,v) // this.$set(this.entity.customProperties,u.filed,v)
// console.log(this.forItem);
for (let key of Object.keys(this.forItem)) { for (let key of Object.keys(this.forItem)) {
// console.log(key);
console.log(this.forItem[key]);
if (key == u.field) { if (key == u.field) {
// this.entity.json[key] = this.forItem[key]; // this.entity.json[key] = this.forItem[key];
return (u.newConten = this.forItem[key]); return (u.newConten = this.forItem[key]);
} }
} }
this.$emit("onValue", u.filed, v); // this.$emit("onValue", u.filed, v, this.forItem[key]);
// this.$set(this.entity, u.filed, v); // this.$set(this.entity, u.filed, v);
}); });
} }
......
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
action: '操作', action: '操作',
creationTime: '操作时间', creationTime: '操作时间',
libraryTube: '操作人', libraryTube: '操作人',
routingDetail:'工序', routingDetail:'工序名称',
routingDetailNo:'工序号' routingDetailNo:'工序号'
}, },
MaterialPowder: { MaterialPowder: {
......
...@@ -244,8 +244,8 @@ export default { ...@@ -244,8 +244,8 @@ export default {
}, },
}, },
this.setName(params.row.isSupportingFinish).name this.setName(params.row.isSupportingFinish).name
) );
} },
}, },
{ {
key: "projectNumber", key: "projectNumber",
...@@ -803,30 +803,30 @@ export default { ...@@ -803,30 +803,30 @@ export default {
name: item.name, name: item.name,
color: item.color, color: item.color,
}; };
} }
} }
return outPar return outPar;
}, },
openAccessory(row) { openAccessory(row) {
if(row.mainRoutingSetStatus!=1) if (row.mainRoutingSetStatus != 1) {
{ this.$Message.error("请设置订单工艺!");
this.$Message.error("请设置订单工艺!") return;
return
}
this.orderId = row.id;
this.mesCode = row.mesCode;
this.productName = row.productName;
this.drawnNumber = row.drawnNumber;
this.count = row.quantity;
if (row.isSupportingFinish == 0) {
this.title = "申请配套";
this.details = () => import("./addAccessory");
} else { } else {
this.title = "配套清单"; this.orderId = row.id;
this.details = () => import("./editAccessory"); this.mesCode = row.mesCode;
this.productName = row.productName;
this.drawnNumber = row.drawnNumber;
this.count = row.quantity;
if (row.mainRoutingSetStatus == 1 && row.isSupportingFinish == 0) {
this.$Message.error("请去工艺设置生成料单!");
// this.title = "申请配套";
// this.details = () => import("./addAccessory");
} else {
this.title = "配套清单";
this.details = () => import("./editAccessory");
this.modalAccessory = true;
}
} }
this.modalAccessory = true;
}, },
ok() { ok() {
this.modalAccessory = false; this.modalAccessory = false;
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</Col> </Col>
--> -->
<Col :span="8"> <Col :span="12">
<FormItem :label="l('routingDetailName')" prop="routingDetailId"> <FormItem :label="l('routingDetailName')" prop="routingDetailId">
<Select v-model="entity.routingDetailId"> <Select v-model="entity.routingDetailId">
<Option <Option
...@@ -45,30 +45,52 @@ ...@@ -45,30 +45,52 @@
</Select> </Select>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="8"> <!-- <Col :span="8">
<FormItem :label="l('materialType')" prop="materialType"> <FormItem :label="l('materialType')" prop="materialType">
<Dictionary <Dictionary
code="mes_xingchi_resource.material.materialReType" code="mes_xingchi_resource.material.materialReType"
v-model="entity.materialType" v-model="entity.materialType"
></Dictionary> ></Dictionary>
</FormItem> </FormItem>
</Col> </Col>-->
<Col :span="8"> <Col :span="12">
<FormItem :label="l('nameMaterial')" prop="materialNumber"> <!-- <FormItem :label="l('nameMaterial')" prop="materialNumber">
<Materiel :bomId="productBomId" v-model="entity.materialId" @on-change="change"></Materiel> <Materiel :bomId="productBomId" v-model="entity.materialId" @on-change="change"></Materiel>
</FormItem>-->
<FormItem :label="l('nameMaterial')" prop="materialId">
<Materiel
v-model="entity.materialId"
@on-change="change"
:codeRuleType="1"
:setType="true"
></Materiel>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="8" v-if="false"> <!-- <Col :span="8" v-if="false">
<FormItem :label="l('nameMaterial')" prop="nameMaterial"> <FormItem :label="l('nameMaterial')" prop="nameMaterial">
<Input v-model="entity.nameMaterial"></Input> <Input v-model="entity.nameMaterial"></Input>
</FormItem> </FormItem>
</Col> </Col>-->
<Col :span="8"> <Col :span="12">
<FormItem :label="l('quantity')" prop="quantity"> <FormItem :label="l('quantity')" prop="quantity">
<InputNumber v-model="entity.quantity" style="width:100%"></InputNumber> <InputNumber v-model="entity.quantity" style="width:100%"></InputNumber>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="8"> <Divider orientation="left">物料属性</Divider>
<Row>
<Col :span="12" v-if="entity.materialId">
<FormItem label="名称:">
<span>{{entity.nameMaterial}}</span>
</FormItem>
</Col>
<Col :span="12" v-if="entity.materialId">
<FormItem label="编码:">
<span>{{entity.materialNumber}}</span>
</FormItem>
</Col>
</Row>
<CustomProperties :materialId="entity.materialId" :forItem="forItem" />
<!-- <Col :span="8">
<FormItem :label="l('brand')" prop="brand"> <FormItem :label="l('brand')" prop="brand">
<Input v-model="entity.brand"></Input> <Input v-model="entity.brand"></Input>
</FormItem> </FormItem>
...@@ -102,7 +124,7 @@ ...@@ -102,7 +124,7 @@
<FormItem :label="l('drawNum')" prop="drawNum"> <FormItem :label="l('drawNum')" prop="drawNum">
<Input v-model="entity.drawNum"></Input> <Input v-model="entity.drawNum"></Input>
</FormItem> </FormItem>
</Col> </Col>-->
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
...@@ -117,6 +139,7 @@ export default { ...@@ -117,6 +139,7 @@ export default {
name: "Add", name: "Add",
data() { data() {
return { return {
forItem: {},
entity: { entity: {
routingHeaderId: null, routingHeaderId: null,
routingDetailId: null, routingDetailId: null,
...@@ -136,9 +159,32 @@ export default { ...@@ -136,9 +159,32 @@ export default {
extend: "", extend: "",
remark: "", remark: "",
drawNum: "", drawNum: "",
json: {},
}, },
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], routingDetailId: [
{
required: true,
message: "请选择工序",
type: "number",
trigger: "change",
},
],
materialId: [
{
required: true,
message: "请选择工序",
trigger: "change",
},
],
quantity: [
{
required: true,
type: "number",
message: "请选择工序",
trigger: "blur",
},
],
}, },
routingDetailList: [], routingDetailList: [],
}; };
...@@ -156,6 +202,9 @@ export default { ...@@ -156,6 +202,9 @@ export default {
this.loadDetails(); this.loadDetails();
}, },
methods: { methods: {
// onValue(filed, v) {
// this.$set(this.entity, filed, v);
// },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
...@@ -179,10 +228,14 @@ export default { ...@@ -179,10 +228,14 @@ export default {
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
}, },
change(e) { change(e, v) {
this.entity.nameMaterial = e.name; this.entity.nameMaterial = e.name;
this.entity.materialId = e.materialId; this.entity.materialId = e.materialId;
this.entity.materialNumber = e.mmcode; this.entity.materialNumber = e.mmcode;
this.entity.json.nameMaterial = e.name;
this.entity.json.materialNumber = e.mmcode;
this.forItem = v;
}, },
loadDetails() { loadDetails() {
//获取工序列表 //获取工序列表
......
...@@ -31,4 +31,10 @@ export default { ...@@ -31,4 +31,10 @@ export default {
getRoutingheaderList(params) { getRoutingheaderList(params) {
return Api.post(`${technologyUrl}routingheader/list`, params); return Api.post(`${technologyUrl}routingheader/list`, params);
}, },
getmaterialdefinitionproperty(params){
return Api.get(`${material}/custompropertydefinition/getmaterialdefinitionproperty`,params);
},
materiallist(params){
return Api.post(`${material}/material/materiallist`,params);
},
} }
<template> <template>
<div class="detail"> <div class="detail">
<Row> <Row>
<Filed :span="12" :name="l('routingHeaderId')" v-if="false">{{entity.routingHeaderId}}</Filed> <Filed :span="8" :name="l('routingDetailNo')">{{entity.routingDetailNo}}</Filed>
<Filed :span="12" :name="l('routingDetailId')">{{entity.routingDetailId}}</Filed> <Filed :span="8" :name="l('routingDetailName')">{{entity.routingDetailName}}</Filed>
<Filed :span="12" :name="l('routingStepId')" v-if="false">{{entity.routingStepId}}</Filed> <Filed :span="8" :name="l('materialNumber')">{{entity.materialNumber}}</Filed>
<Filed :span="12" :name="l('quantity')">{{entity.quantity}}</Filed> <Filed :span="8" :name="l('nameMaterial')">{{entity.nameMaterial}}</Filed>
<Filed :span="12" :name="l('materialId')">{{entity.materialId}}</Filed>
<Filed :span="12" :name="l('materialType')"><state <Filed :span="8" :name="l('creationTime')">{{entity.creationTime}}</Filed>
code="mes_xingchi_resource.material.materialReType"
:value="entity.materialType+''" <Filed :span="8" :name="l('creatorUserId')">
type="text" <User :value="parseInt(entity.creatorUserId)" />
></state></Filed>
<Filed :span="12" :name="l('materialNumber')">{{entity.materialNumber}}</Filed>
<Filed :span="12" :name="l('nameMaterial')">{{entity.nameMaterial}}</Filed>
<Filed :span="12" :name="l('brand')">{{entity.brand}}</Filed>
<Filed :span="12" :name="l('specifications')">{{entity.specifications}}</Filed>
<Filed :span="12" :name="l('xhgg')">{{entity.xhgg}}</Filed>
<Filed :span="12" :name="l('texture')">{{entity.texture}}</Filed>
<Filed :span="12" :name="l('procurementStandards')">{{entity.procurementStandards}}</Filed>
<Filed :span="12" :name="l('qualityGrade')">{{entity.qualityGrade}}</Filed>
<Filed :span="12" :name="l('state')">
<state
code="Process.state"
:value="entity.state+''"
type="text"
></state>
</Filed> </Filed>
<Filed :span="12" :name="l('extend')" v-if="false">{{entity.extend}}</Filed> <Filed :span="8" :name="l('quantity')">{{entity.quantity}}</Filed>
<Filed :span="12" :name="l('drawNum')">{{entity.drawNum}}</Filed> <Filed v-for="li in fileds" :key="li.field" :span="li.span" :name="li.title">{{li.newConten}}</Filed>
<Filed :span="24" :name="l('remark')">{{entity.remark}}</Filed>
</Row> </Row>
</div> </div>
</template> </template>
...@@ -38,26 +22,72 @@ export default { ...@@ -38,26 +22,72 @@ export default {
name: "Add", name: "Add",
data() { data() {
return { return {
fileds: [],
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }] code: [{ required: true, message: "必填", trigger: "blur" }],
} },
}; };
}, },
props: { props: ["eid", "materialId"],
eid: Number
},
mounted() { mounted() {
if (this.eid > 0) { if (this.eid > 0) {
this.load(this.eid); this.load(this.eid, this.materialId);
} }
}, },
methods: { methods: {
load(v) { load(e, v) {
Api.get({ id: v }).then(r => { Api.get({ id: e }).then((r) => {
this.entity = r.result; this.entity = r.result;
this.$emit("on-load"); });
let conditions = [];
conditions = [
{
fieldName: "codeRuleType",
fieldValue: "1",
conditionalType: "In",
},
];
Api.materiallist({ type: 0, conditions: conditions }).then((r) => {
let data = [];
var forItem = {};
data = r.result.filter((u) => u.status == 3);
data.forEach((e) => {
if (e.id == v) {
forItem = e;
}
});
Api.getmaterialdefinitionproperty({ materialId: v }).then((r) => {
if (r.result) {
console.log(r);
this.fileds = r.result.filter(function (item) {
item.span = 8;
if (item.dataType == 8 || item.dataType == 5) {
item.span = 24;
}
delete item["id"];
// return item.fieldType != 1;
return item.fieldType;
});
this.fileds.map((u) => {
let a = "";
if (u.dataType == 1 || u.dataType == 2) {
a = 0;
}
for (let key of Object.keys(forItem)) {
if (key == u.field) {
this.entity[key] = forItem[key];
return (u.newConten = forItem[key]);
}
}
this.$set(this.entity, u.filed, a);
});
}
});
// this.$emit("on-load");
}); });
}, },
handleClose() { handleClose() {
...@@ -66,14 +96,14 @@ export default { ...@@ -66,14 +96,14 @@ export default {
l(key) { l(key) {
key = "routingsupporting" + "." + key; key = "routingsupporting" + "." + key;
return this.$t(key); return this.$t(key);
} },
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v > 0) { if (v > 0) {
this.load(v); this.load(v, this.materialId);
} }
} },
} },
}; };
</script> </script>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<InputNumber v-model="entity.routingStepId"></InputNumber> <InputNumber v-model="entity.routingStepId"></InputNumber>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('materialId')" prop="materialId"> <FormItem :label="l('materialId')" prop="materialId">
<InputNumber v-model="entity.materialId"></InputNumber> <InputNumber v-model="entity.materialId"></InputNumber>
</FormItem> </FormItem>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</Col> </Col>
--> -->
<Col :span="8"> <Col :span="12">
<FormItem :label="l('routingDetailName')" prop="routingDetailId"> <FormItem :label="l('routingDetailName')" prop="routingDetailId">
<Select v-model="entity.routingDetailId"> <Select v-model="entity.routingDetailId">
<Option <Option
...@@ -45,30 +45,57 @@ ...@@ -45,30 +45,57 @@
</Select> </Select>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="8"> <!-- <Col :span="8">
<FormItem :label="l('materialType')" prop="materialType"> <FormItem :label="l('materialType')" prop="materialType">
<Dictionary <Dictionary
code="mes_xingchi_resource.material.materialReType" code="mes_xingchi_resource.material.materialReType"
v-model="entity.materialType" v-model="entity.materialType"
></Dictionary> ></Dictionary>
</FormItem> </FormItem>
</Col> </Col>-->
<Col :span="8"> <Col :span="12">
<FormItem :label="l('nameMaterial')" prop="materialNumber"> <!-- <FormItem :label="l('nameMaterial')" prop="materialNumber">
<Materiel v-model="entity.materialId" :bomId="productBomId" @on-change="change"></Materiel> <Materiel :bomId="productBomId" v-model="entity.materialId" @on-change="change"></Materiel>
</FormItem>-->
<FormItem :label="l('nameMaterial')" prop="materialId">
<Materiel
v-model="entity.materialId"
@on-change="change"
:codeRuleType="1"
:setType="true"
></Materiel>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="8" v-if="false"> <!-- <Col :span="8" v-if="false">
<FormItem :label="l('nameMaterial')" prop="nameMaterial"> <FormItem :label="l('nameMaterial')" prop="nameMaterial">
<Input v-model="entity.nameMaterial"></Input> <Input v-model="entity.nameMaterial"></Input>
</FormItem> </FormItem>
</Col> </Col>-->
<Col :span="8"> <Col :span="12">
<FormItem :label="l('quantity')" prop="quantity"> <FormItem :label="l('quantity')" prop="quantity">
<InputNumber v-model="entity.quantity"></InputNumber> <InputNumber v-model="entity.quantity" style="width:100%"></InputNumber>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="8"> <Divider orientation="left">物料属性</Divider>
<Row>
<Col :span="12" v-if="entity.materialId">
<FormItem label="名称:">
<span>{{entity.nameMaterial}}</span>
</FormItem>
</Col>
<Col :span="12" v-if="entity.materialId">
<FormItem label="编码:">
<span>{{entity.materialNumber}}</span>
</FormItem>
</Col>
<Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title+':'" :prop="li.name" v-if="li.field!='name'&&li.field!='code'">
<div>{{li.newConten}}</div>
</FormItem>
</Col>
</Row>
<!-- <Col :span="8">
<FormItem :label="l('brand')" prop="brand"> <FormItem :label="l('brand')" prop="brand">
<Input v-model="entity.brand"></Input> <Input v-model="entity.brand"></Input>
</FormItem> </FormItem>
...@@ -102,7 +129,7 @@ ...@@ -102,7 +129,7 @@
<FormItem :label="l('drawNum')" prop="drawNum"> <FormItem :label="l('drawNum')" prop="drawNum">
<Input v-model="entity.drawNum"></Input> <Input v-model="entity.drawNum"></Input>
</FormItem> </FormItem>
</Col> </Col>-->
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
...@@ -118,6 +145,7 @@ export default { ...@@ -118,6 +145,7 @@ export default {
data() { data() {
return { return {
entity: {}, entity: {},
fileds: [], //扩展属性
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
}, },
...@@ -142,9 +170,62 @@ export default { ...@@ -142,9 +170,62 @@ 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.materialType = Number(r.result.materialType); var materialId = r.result.materialId;
let conditions = [];
conditions = [
{
fieldName: "codeRuleType",
fieldValue: "1",
conditionalType: "In",
},
];
Api.materiallist({ type: 0, conditions: conditions }).then((r) => {
let data = [];
var Item = {};
data = r.result.filter((u) => u.status == 3);
data.forEach((e) => {
console.log(e)
if (materialId == e.id) {
Item = e;
}
});
this.getCustom(materialId, Item);
});
}); });
}, },
getCustom(materialId, v) {
// console.log(v)
//获取自定义属性
var forItem = v;
Api.getmaterialdefinitionproperty({ materialId: materialId }).then(
(r) => {
if (r.result) {
this.fileds = r.result.filter(function (item) {
item.span = 12;
if (item.dataType > 4) {
item.span = 24;
}
delete item["id"];
// return item.fieldType != 1;
return item.fieldType;
});
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
for (let key of Object.keys(forItem)) {
if (key == u.field) {
u.newConten = forItem[key];
}
}
this.$set(this.entity, u.filed, v);
});
}
}
);
},
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
...@@ -175,16 +256,17 @@ export default { ...@@ -175,16 +256,17 @@ export default {
tempDetails.forEach((data) => { tempDetails.forEach((data) => {
let tempObj = {}; let tempObj = {};
tempObj.value = data.id; tempObj.value = data.id;
tempObj.label = data.name; tempObj.label = data.taskSeq + " " + data.name;
tempD.push(tempObj); tempD.push(tempObj);
}); });
this.routingDetailList = tempD; this.routingDetailList = tempD;
}); });
}, },
change(e) { change(e, v) {
this.entity.nameMaterial = e.name; this.entity.nameMaterial = e.name;
this.entity.materialId = e.materialId; this.entity.materialId = e.materialId;
this.entity.materialNumber = e.mmcode; this.entity.materialNumber = e.mmcode;
this.getCustom(e.materialId, v);
}, },
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
......
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :conditions="easySearch" :action="action" exportTitle="工艺Bom"> <DataGrid
<template slot="easySearch"> :columns="columns"
<Form ref="formInline" :model="easySearch" inline> ref="grid"
<FormItem prop="keys"> :conditions="easySearch"
<Input placeholder="请输入关键字物料名称" v-model="easySearch.keys.value" v-width="260" /> :action="action"
</FormItem> exportTitle="工艺Bom"
<FormItem> >
<Button type="primary" @click="search">查询</Button> <template slot="easySearch">
</FormItem> <Form ref="formInline" :model="easySearch" inline>
</Form> <FormItem prop="keys">
</template> <Input placeholder="请输入关键字物料名称" v-model="easySearch.keys.value" v-width="260" />
<template slot="searchForm"> </FormItem>
<Search :headid="hid" /> <FormItem>
</template> <Button type="primary" @click="search">查询</Button>
<template slot="buttons"> </FormItem>
<Button type="primary" @click="add" v-show="headerStatus==0||headerStatus==4">新增</Button> </Form>
<Button @click="openModalIm">导入</Button> </template>
</template> <template slot="searchForm">
<Search :headid="hid" />
</template>
<template slot="buttons">
<Button type="primary" @click="add" v-if="headerStatus==0||headerStatus==4">新增</Button>
<Button @click="openModalIm">导入</Button>
</template>
</DataGrid> </DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal v-model="modal" :title="title" width="850" 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"
:materialId="materialId"
@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" /> <ImportExcel
</div> ref="importExcel"
@on-get-data="getData"
:modalTitle="temTitle"
:columns="columns"
:open="ModalIm"
@on-cancel="ModalImCancel"
@on-ok="ok"
/>
</div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import Search from "./search"; import Search from "./search";
export default { export default {
name: "list", name: "list",
components: { components: {
Search Search,
}, },
head: { head: {
title: "工艺配套表", title: "工艺配套表",
author: "henq", author: "henq",
description: "routingsupporting 4/27/2020 10:35:33 AM" description: "routingsupporting 4/27/2020 10:35:33 AM",
}, },
props: ["headerid"], props: ["headerid"],
data() { data() {
return { return {
action: Api.index, materialId: null,
easySearch: { action: Api.index,
keys: { easySearch: {
op: "nameMaterial", keys: {
value: null op: "nameMaterial",
}, value: null,
routingHeaderId: {
op: "Equal",
value: -1
}
},
modal: false,
title: "新增",
detail: null,
curId: 0,
hid: 0,
columns: [
{
key: "routingDetailNo",
title: this.l("routingDetailNo"),
align: "left",
high: true,
width: 100,
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",
title: this.l("routingDetailName"),
align: "left",
high: true
},
{
key: "routingDetailId",
title: this.l("routingDetailId"),
hide: true,
import: true,
},
{
key: "quantity",
title: this.l("quantity"),
align: "right",
high: true,
width: 80,
},
{
key: "materialType",
title: this.l("materialType"),
align: "center",
easy: true,
high: true,
code: "mes_xingchi_resource.material.materialReType",
width: 100,
},
{
key: "materialNumber",
title: this.l("materialNumber"),
align: "left",
easy: true,
high: true
},
{
key: "materialId",
title: this.l("materialId"),
align: "left",
hide: true,
import: true
},
{
key: "nameMaterial",
title: this.l("nameMaterial"),
align: "left",
easy: true,
high: true,
},
{
key: "brand",
title: this.l("brand"),
align: "left",
easy: true,
high: true
},
{
key: "specifications",
title: this.l("specifications"),
align: "left",
easy: true,
high: true
},
{
key: "xhgg",
title: this.l("xhgg"),
align: "left",
easy: true,
high: true,
hide: true,
},
{
key: "texture",
title: this.l("texture"),
align: "left",
easy: true,
high: true
},
{
key: "procurementStandards",
title: this.l("procurementStandards"),
align: "left",
easy: true,
high: true
},
{
key: "qualityGrade",
title: this.l("qualityGrade"),
align: "left",
easy: true,
high: true
},
{
key: "drawNum",
title: this.l("drawNum"),
align: "left",
easy: true,
high: true
},
{
key: "creationTime",
title: this.l("creationTime"),
hide: true,
align: "left",
hide: true,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
hide: true,
align: "left",
hide: true,
type: 'user',
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
hide: true,
align: "left",
hide: true,
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
hide: true,
align: "left",
hide: true,
type: 'user',
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", {
class: "action"
}, [
h(
"op", {
attrs: {
oprate: "detail"
},
on: {
click: () => this.view(params.row.id)
}
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op", {
attrs: {
oprate: "edit"
},
on: {
click: () => this.edit(params.row.id)
}
},
this.headerStatus == 4 || this.headerStatus == 0 ? "编辑" : ""
),
h(
"op", {
attrs: {
oprate: "delete"
},
on: {
click: () => this.remove(params.row.id)
}
},
this.headerStatus == 4 || this.headerStatus == 0 ? "删除" : ""
)
]);
}
}
],
headerStatus: -1,
productBomId: -1,
ModalIm: false,
temTitle: "工艺Bom",
routingHeaderData: [],
};
},
created() {
if (this.headerid != -1) {
this.easySearch.routingHeaderId.value = this.headerid;
} else {
this.easySearch.routingHeaderId.value = this.$route.query.id;
}
this.hid = Number(this.easySearch.routingHeaderId.value)
this.headerStatus = this.$route.query.headerStatus
this.productBomId = Number(this.$route.query.productBomId)
},
mounted() {
console.log(this);
this.getRoutingHeaderData();
this.search();
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
}, },
search() { routingHeaderId: {
this.$refs.grid.reload(this.easySearch); op: "Equal",
value: -1,
}, },
add() { },
this.curId = 0; modal: false,
this.hid = Number(this.headerid); title: "新增",
this.title = "新增"; detail: null,
this.detail = () => import("./add"); curId: 0,
this.modal = true; hid: 0,
columns: [
{
key: "routingDetailNo",
title: this.l("routingDetailNo"),
align: "left",
high: true,
width: 100,
sortable: true,
}, },
copy(id) { // {
this.curId = id; // key: "routingHeaderId",
this.title = "克隆"; // title: this.l("routingHeaderName"),
this.detail = () => import("./add"); // hide: true,
this.modal = true; // import: true,
// techKey: "1",
// render: (h, params) => {
// return h(
// "span",
// {},
// this.getRoutingHeaderName(params.row.routingHeaderId)
// );
// },
// },
{
key: "routingDetailName",
title: this.l("routingDetailName"),
align: "left",
high: true,
}, },
view(id) { // {
this.curId = id; // key: "routingDetailId",
this.title = "详情"; // title: this.l("routingDetailId"),
this.detail = () => import("./detail"); // hide: true,
this.modal = true; // import: true,
}, // },
edit(id) {
this.curId = id; // {
this.hid = Number(this.headerid); // key: "materialType",
this.title = "编辑"; // title: this.l("materialType"),
this.detail = () => import("./edit"); // align: "center",
this.modal = true; // easy: true,
}, // high: true,
remove(id) { // code: "mes_xingchi_resource.material.materialReType",
Api.delete(id).then(r => { // width: 100,
if (r.success) { // },
this.$refs.grid.load(); {
this.$Message.success("删除成功"); key: "materialNumber",
} title: this.l("materialNumber"),
}); align: "left",
}, easy: true,
cancel() { high: true,
this.curId = 0;
this.modal = false;
},
//批量导入start
//导入功能
openModalIm() {
this.ModalIm = true
}, },
ModalImCancel() { // {
this.ModalIm = false // key: "materialId",
// title: this.l("materialId"),
// align: "left",
// hide: true,
// import: true,
// },
{
key: "nameMaterial",
title: this.l("nameMaterial"),
align: "left",
easy: true,
high: true,
}, },
getData(val) { {
let url = `${technologyUrl}productinfoimportservice/import`; key: "creationTime",
this.$refs.importExcel.deelData(url, this.cols, this.formatMethod(val)) title: this.l("creationTime"),
align: "left",
}, },
//根据页面二次处理数据 {
formatMethod(val) { key: "creatorUserId",
// alert(JSON.stringify(val)) title: this.l("creatorUserId"),
let tempData = this.$u.clone(val); hide: false,
let tempList = []; type: "user",
tempData.forEach((ele) => { align: "left",
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之间的转换 key: "quantity",
//获取工艺规程信息 title: this.l("quantity"),
getRoutingHeaderData() { high: true,
let data = { width: 80,
conditions: []
};
Api.getRoutingheaderList(data).then((r) => {
if (r.success) {
this.routingHeaderData = r.result || []
}
});
}, },
//根据工艺规程ID获得name // {
getRoutingHeaderName(val) { // key: "brand",
let routingHeaderDataList = this.$u.clone(this.routingHeaderData) // title: this.l("brand"),
let routingHeaderName = "" // align: "left",
routingHeaderDataList.forEach(ele => { // easy: true,
if (ele.id == Number(val)) { // high: true,
routingHeaderName = ele.name // },
} // {
}) // key: "specifications",
return routingHeaderName // title: this.l("specifications"),
// align: "left",
// easy: true,
// high: true,
// },
// {
// key: "xhgg",
// title: this.l("xhgg"),
// align: "left",
// easy: true,
// high: true,
// hide: true,
// },
// {
// key: "texture",
// title: this.l("texture"),
// align: "left",
// easy: true,
// high: true,
// },
// {
// key: "procurementStandards",
// title: this.l("procurementStandards"),
// align: "left",
// easy: true,
// high: true,
// },
// {
// key: "qualityGrade",
// title: this.l("qualityGrade"),
// align: "left",
// easy: true,
// high: true,
// },
// {
// key: "drawNum",
// title: this.l("drawNum"),
// align: "left",
// easy: true,
// high: true,
// },
// {
// key: "creationTime",
// title: this.l("creationTime"),
// hide: true,
// align: "left",
// hide: true,
// },
// {
// key: "creatorUserId",
// title: this.l("creatorUserId"),
// hide: true,
// align: "left",
// hide: true,
// type: "user",
// },
// {
// key: "lastModificationTime",
// title: this.l("lastModificationTime"),
// hide: true,
// align: "left",
// hide: true,
// },
// {
// key: "lastModifierUserId",
// title: this.l("lastModifierUserId"),
// hide: true,
// align: "left",
// hide: true,
// type: "user",
// },
{
title: "操作",
key: "action",
width: 180,
align: "center",
render: (h, params) => {
return h(
"div",
{
class: "action",
},
[
h(
"op",
{
attrs: {
oprate: "detail",
},
on: {
click: () => this.view(params.row),
},
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op",
{
attrs: {
oprate: "edit",
},
on: {
click: () => this.edit(params.row.id),
},
},
this.headerStatus == 4 || this.headerStatus == 0 ? "编辑" : ""
),
h(
"op",
{
attrs: {
oprate: "delete",
},
on: {
click: () => this.remove(params.row.id),
},
},
this.headerStatus == 4 || this.headerStatus == 0 ? "删除" : ""
),
]
);
},
}, },
l(key) { ],
let vkey = "routingsupporting" + "." + key; headerStatus: -1,
return this.$t(vkey) || key; productBomId: -1,
} ModalIm: false,
temTitle: "工艺Bom",
routingHeaderData: [],
};
},
created() {
this.hid = this.easySearch.routingHeaderId.value;
this.headerStatus = this.$route.query.headerStatus;
this.productBomId = Number(this.$route.query.productBomId);
if (this.headerid != -1) {
this.easySearch.routingHeaderId.value = this.headerid;
} else {
this.easySearch.routingHeaderId.value = this.$route.query.id;
} }
},
mounted() {
console.log(this);
this.getRoutingHeaderData();
this.search();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.hid = Number(this.headerid);
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
view(row) {
this.curId = row.id;
this.materialId = row.materialId;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.hid = Number(this.headerid);
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
cancel() {
this.curId = 0;
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) {
let vkey = "routingsupporting" + "." + key;
return this.$t(vkey) || key;
},
},
}; };
</script> </script>
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</FormItem> </FormItem>
</Col>--> </Col>-->
</Row> </Row>
<CustomProperties :materialId="entity.materialId" :forItem="forItem" @onValue="onValue" /> <CustomProperties :materialId="entity.materialId" :forItem="forItem" />
<Row> <Row>
<Col span="24" style="text-align:right"> <Col span="24" style="text-align:right">
<FormItem label> <FormItem label>
...@@ -123,7 +123,6 @@ export default { ...@@ -123,7 +123,6 @@ export default {
this.entity.materialNumber = e.mmcode; this.entity.materialNumber = e.mmcode;
this.entity.json.nameMaterial = e.name; this.entity.json.nameMaterial = e.name;
this.entity.json.materialNumber = e.mmcode; this.entity.json.materialNumber = e.mmcode;
this.forItem = v; this.forItem = v;
// var forItem = v; // var forItem = v;
// Api.getmaterialdefinitionproperty({ materialId: e.materialId }).then( // Api.getmaterialdefinitionproperty({ materialId: e.materialId }).then(
...@@ -159,9 +158,7 @@ export default { ...@@ -159,9 +158,7 @@ export default {
// } // }
// ); // );
}, },
onValue(filed, v) {
this.$set(this.entity, filed, v);
},
clickChange(val) { clickChange(val) {
// this.routingDetailList.forEach((e) => { // this.routingDetailList.forEach((e) => {
// if (e.id == val) { // if (e.id == val) {
......
<template> <template>
<div class="detail"> <div class="detail">
<Row> <Row>
<Filed :span="8" :name="l('routingDetailNo')">{{entity.routingDetailNo}}</Filed>
<Filed :span="8" :name="l('routingDetail')">{{entity.routingDetailName}}</Filed> <Filed :span="8" :name="l('routingDetail')">{{entity.routingDetailName}}</Filed>
<Filed :span="8" :name="l('nameOfResource')">{{entity.nameMaterial}}</Filed> <Filed :span="8" :name="l('nameOfResource')">{{entity.nameMaterial}}</Filed>
<Filed :span="8" :name="l('resourceId')">{{entity.materialNumber}}</Filed> <Filed :span="8" :name="l('resourceId')">{{entity.materialNumber}}</Filed>
......
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