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

工艺bom

parent 5d763a79
......@@ -19,15 +19,26 @@ export default {
},
props: ["materialId", "forItem"],
mounted() {
// this.get();
if (this.materialId) {
this.get();
}
},
watch: {
materialId(v) {
this.get();
},
// forItem: {
// handler(newName, oldName) {
// if (newName.id) {
// this.get();
// }
// },
// immediate: true,
// },
},
methods: {
get() {
this.$api
.get(
`${material}/custompropertydefinition/getmaterialdefinitionproperty`,
......@@ -45,21 +56,22 @@ export default {
return item.fieldType;
});
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
// let v = "";
// if (u.dataType == 1 || u.dataType == 2) {
// v = 0;
// }
// console.log(u);
// this.$set(this.entity.customProperties,u.filed,v)
// console.log(this.forItem);
for (let key of Object.keys(this.forItem)) {
// console.log(key);
console.log(this.forItem[key]);
if (key == u.field) {
// this.entity.json[key] = 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);
});
}
......
......@@ -98,7 +98,7 @@ export default {
action: '操作',
creationTime: '操作时间',
libraryTube: '操作人',
routingDetail:'工序',
routingDetail:'工序名称',
routingDetailNo:'工序号'
},
MaterialPowder: {
......
......@@ -244,8 +244,8 @@ export default {
},
},
this.setName(params.row.isSupportingFinish).name
)
}
);
},
},
{
key: "projectNumber",
......@@ -803,30 +803,30 @@ export default {
name: item.name,
color: item.color,
};
}
}
}
return outPar
return outPar;
},
openAccessory(row) {
if(row.mainRoutingSetStatus!=1)
{
this.$Message.error("请设置订单工艺!")
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");
if (row.mainRoutingSetStatus != 1) {
this.$Message.error("请设置订单工艺!");
return;
} else {
this.title = "配套清单";
this.details = () => import("./editAccessory");
this.orderId = row.id;
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() {
this.modalAccessory = false;
......
......@@ -34,7 +34,7 @@
</Col>
-->
<Col :span="8">
<Col :span="12">
<FormItem :label="l('routingDetailName')" prop="routingDetailId">
<Select v-model="entity.routingDetailId">
<Option
......@@ -45,30 +45,52 @@
</Select>
</FormItem>
</Col>
<Col :span="8">
<!-- <Col :span="8">
<FormItem :label="l('materialType')" prop="materialType">
<Dictionary
code="mes_xingchi_resource.material.materialReType"
v-model="entity.materialType"
></Dictionary>
</FormItem>
</Col>
<Col :span="8">
<FormItem :label="l('nameMaterial')" prop="materialNumber">
</Col>-->
<Col :span="12">
<!-- <FormItem :label="l('nameMaterial')" prop="materialNumber">
<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>
</Col>
<Col :span="8" v-if="false">
<!-- <Col :span="8" v-if="false">
<FormItem :label="l('nameMaterial')" prop="nameMaterial">
<Input v-model="entity.nameMaterial"></Input>
</FormItem>
</Col>
<Col :span="8">
</Col>-->
<Col :span="12">
<FormItem :label="l('quantity')" prop="quantity">
<InputNumber v-model="entity.quantity" style="width:100%"></InputNumber>
</FormItem>
</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">
<Input v-model="entity.brand"></Input>
</FormItem>
......@@ -102,7 +124,7 @@
<FormItem :label="l('drawNum')" prop="drawNum">
<Input v-model="entity.drawNum"></Input>
</FormItem>
</Col>
</Col>-->
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
......@@ -117,6 +139,7 @@ export default {
name: "Add",
data() {
return {
forItem: {},
entity: {
routingHeaderId: null,
routingDetailId: null,
......@@ -136,9 +159,32 @@ export default {
extend: "",
remark: "",
drawNum: "",
json: {},
},
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: [],
};
......@@ -156,6 +202,9 @@ export default {
this.loadDetails();
},
methods: {
// onValue(filed, v) {
// this.$set(this.entity, filed, v);
// },
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
......@@ -179,10 +228,14 @@ export default {
handleClose() {
this.$emit("on-close");
},
change(e) {
change(e, v) {
this.entity.nameMaterial = e.name;
this.entity.materialId = e.materialId;
this.entity.materialNumber = e.mmcode;
this.entity.json.nameMaterial = e.name;
this.entity.json.materialNumber = e.mmcode;
this.forItem = v;
},
loadDetails() {
//获取工序列表
......
......@@ -31,4 +31,10 @@ export default {
getRoutingheaderList(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>
<div class="detail">
<Row>
<Filed :span="12" :name="l('routingHeaderId')" v-if="false">{{entity.routingHeaderId}}</Filed>
<Filed :span="12" :name="l('routingDetailId')">{{entity.routingDetailId}}</Filed>
<Filed :span="12" :name="l('routingStepId')" v-if="false">{{entity.routingStepId}}</Filed>
<Filed :span="12" :name="l('quantity')">{{entity.quantity}}</Filed>
<Filed :span="12" :name="l('materialId')">{{entity.materialId}}</Filed>
<Filed :span="12" :name="l('materialType')"><state
code="mes_xingchi_resource.material.materialReType"
:value="entity.materialType+''"
type="text"
></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 :span="8" :name="l('routingDetailNo')">{{entity.routingDetailNo}}</Filed>
<Filed :span="8" :name="l('routingDetailName')">{{entity.routingDetailName}}</Filed>
<Filed :span="8" :name="l('materialNumber')">{{entity.materialNumber}}</Filed>
<Filed :span="8" :name="l('nameMaterial')">{{entity.nameMaterial}}</Filed>
<Filed :span="8" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="8" :name="l('creatorUserId')">
<User :value="parseInt(entity.creatorUserId)" />
</Filed>
<Filed :span="12" :name="l('extend')" v-if="false">{{entity.extend}}</Filed>
<Filed :span="12" :name="l('drawNum')">{{entity.drawNum}}</Filed>
<Filed :span="24" :name="l('remark')">{{entity.remark}}</Filed>
<Filed :span="8" :name="l('quantity')">{{entity.quantity}}</Filed>
<Filed v-for="li in fileds" :key="li.field" :span="li.span" :name="li.title">{{li.newConten}}</Filed>
</Row>
</div>
</template>
......@@ -38,26 +22,72 @@ export default {
name: "Add",
data() {
return {
fileds: [],
entity: {},
rules: {
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() {
if (this.eid > 0) {
this.load(this.eid);
this.load(this.eid, this.materialId);
}
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
load(e, v) {
Api.get({ id: e }).then((r) => {
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() {
......@@ -66,14 +96,14 @@ export default {
l(key) {
key = "routingsupporting" + "." + key;
return this.$t(key);
}
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
this.load(v, this.materialId);
}
}
}
},
},
};
</script>
......@@ -7,7 +7,7 @@
<InputNumber v-model="entity.routingStepId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<Col :span="12">
<FormItem :label="l('materialId')" prop="materialId">
<InputNumber v-model="entity.materialId"></InputNumber>
</FormItem>
......@@ -34,7 +34,7 @@
</Col>
-->
<Col :span="8">
<Col :span="12">
<FormItem :label="l('routingDetailName')" prop="routingDetailId">
<Select v-model="entity.routingDetailId">
<Option
......@@ -45,30 +45,57 @@
</Select>
</FormItem>
</Col>
<Col :span="8">
<!-- <Col :span="8">
<FormItem :label="l('materialType')" prop="materialType">
<Dictionary
code="mes_xingchi_resource.material.materialReType"
v-model="entity.materialType"
></Dictionary>
</FormItem>
</Col>
<Col :span="8">
<FormItem :label="l('nameMaterial')" prop="materialNumber">
<Materiel v-model="entity.materialId" :bomId="productBomId" @on-change="change"></Materiel>
</Col>-->
<Col :span="12">
<!-- <FormItem :label="l('nameMaterial')" prop="materialNumber">
<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>
</Col>
<Col :span="8" v-if="false">
<!-- <Col :span="8" v-if="false">
<FormItem :label="l('nameMaterial')" prop="nameMaterial">
<Input v-model="entity.nameMaterial"></Input>
</FormItem>
</Col>
<Col :span="8">
</Col>-->
<Col :span="12">
<FormItem :label="l('quantity')" prop="quantity">
<InputNumber v-model="entity.quantity"></InputNumber>
<InputNumber v-model="entity.quantity" style="width:100%"></InputNumber>
</FormItem>
</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">
<Input v-model="entity.brand"></Input>
</FormItem>
......@@ -102,7 +129,7 @@
<FormItem :label="l('drawNum')" prop="drawNum">
<Input v-model="entity.drawNum"></Input>
</FormItem>
</Col>
</Col>-->
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
......@@ -118,6 +145,7 @@ export default {
data() {
return {
entity: {},
fileds: [], //扩展属性
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
......@@ -142,9 +170,62 @@ export default {
load(v) {
Api.get({ id: v }).then((r) => {
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() {
this.$refs.form.validate((v) => {
if (v) {
......@@ -175,16 +256,17 @@ export default {
tempDetails.forEach((data) => {
let tempObj = {};
tempObj.value = data.id;
tempObj.label = data.name;
tempObj.label = data.taskSeq + " " + data.name;
tempD.push(tempObj);
});
this.routingDetailList = tempD;
});
},
change(e) {
change(e, v) {
this.entity.nameMaterial = e.name;
this.entity.materialId = e.materialId;
this.entity.materialNumber = e.mmcode;
this.getCustom(e.materialId, v);
},
handleClose() {
this.$emit("on-close");
......
......@@ -47,7 +47,7 @@
</FormItem>
</Col>-->
</Row>
<CustomProperties :materialId="entity.materialId" :forItem="forItem" @onValue="onValue" />
<CustomProperties :materialId="entity.materialId" :forItem="forItem" />
<Row>
<Col span="24" style="text-align:right">
<FormItem label>
......@@ -123,7 +123,6 @@ export default {
this.entity.materialNumber = e.mmcode;
this.entity.json.nameMaterial = e.name;
this.entity.json.materialNumber = e.mmcode;
this.forItem = v;
// var forItem = v;
// Api.getmaterialdefinitionproperty({ materialId: e.materialId }).then(
......@@ -159,9 +158,7 @@ export default {
// }
// );
},
onValue(filed, v) {
this.$set(this.entity, filed, v);
},
clickChange(val) {
// this.routingDetailList.forEach((e) => {
// if (e.id == val) {
......
<template>
<div class="detail">
<Row>
<Filed :span="8" :name="l('routingDetailNo')">{{entity.routingDetailNo}}</Filed>
<Filed :span="8" :name="l('routingDetail')">{{entity.routingDetailName}}</Filed>
<Filed :span="8" :name="l('nameOfResource')">{{entity.nameMaterial}}</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