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",
...@@ -805,28 +805,28 @@ export default { ...@@ -805,28 +805,28 @@ export default {
}; };
} }
} }
return outPar return outPar;
}, },
openAccessory(row) { openAccessory(row) {
if(row.mainRoutingSetStatus!=1) if (row.mainRoutingSetStatus != 1) {
{ this.$Message.error("请设置订单工艺!");
this.$Message.error("请设置订单工艺!") return;
return } else {
}
this.orderId = row.id; this.orderId = row.id;
this.mesCode = row.mesCode; this.mesCode = row.mesCode;
this.productName = row.productName; this.productName = row.productName;
this.drawnNumber = row.drawnNumber; this.drawnNumber = row.drawnNumber;
this.count = row.quantity; this.count = row.quantity;
if (row.isSupportingFinish == 0) { if (row.mainRoutingSetStatus == 1 && row.isSupportingFinish == 0) {
this.title = "申请配套"; this.$Message.error("请去工艺设置生成料单!");
this.details = () => import("./addAccessory"); // this.title = "申请配套";
// this.details = () => import("./addAccessory");
} else { } else {
this.title = "配套清单"; this.title = "配套清单";
this.details = () => import("./editAccessory"); 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: { };
eid: Number
}, },
props: ["eid", "materialId"],
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>
...@@ -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,8 +170,61 @@ export default { ...@@ -142,8 +170,61 @@ 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) => {
...@@ -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");
......
...@@ -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