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",
......@@ -805,28 +805,28 @@ export default {
};
}
}
return outPar
return outPar;
},
openAccessory(row) {
if(row.mainRoutingSetStatus!=1)
{
this.$Message.error("请设置订单工艺!")
return
}
if (row.mainRoutingSetStatus != 1) {
this.$Message.error("请设置订单工艺!");
return;
} else {
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 && row.isSupportingFinish == 0) {
this.$Message.error("请去工艺设置生成料单!");
// this.title = "申请配套";
// this.details = () => import("./addAccessory");
} else {
this.title = "配套清单";
this.details = () => import("./editAccessory");
}
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>
......@@ -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,8 +170,61 @@ 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) => {
......@@ -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");
......
<template>
<div>
<DataGrid :columns="columns" ref="grid" :conditions="easySearch" :action="action" exportTitle="工艺Bom">
<div>
<DataGrid
:columns="columns"
ref="grid"
:conditions="easySearch"
:action="action"
exportTitle="工艺Bom"
>
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
......@@ -15,15 +21,31 @@
<Search :headid="hid" />
</template>
<template slot="buttons">
<Button type="primary" @click="add" v-show="headerStatus==0||headerStatus==4">新增</Button>
<Button type="primary" @click="add" v-if="headerStatus==0||headerStatus==4">新增</Button>
<Button @click="openModalIm">导入</Button>
</template>
</DataGrid>
<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" />
<Modal v-model="modal" :title="title" width="850" footer-hide>
<component
:is="detail"
:eid="curId"
:headid="hid"
:productBomId="productBomId"
:materialId="materialId"
@on-close="cancel"
@on-ok="ok"
/>
</Modal>
<ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
</div>
<ImportExcel
ref="importExcel"
@on-get-data="getData"
:modalTitle="temTitle"
:columns="columns"
:open="ModalIm"
@on-cancel="ModalImCancel"
@on-ok="ok"
/>
</div>
</template>
<script>
......@@ -32,26 +54,27 @@ import Search from "./search";
export default {
name: "list",
components: {
Search
Search,
},
head: {
title: "工艺配套表",
author: "henq",
description: "routingsupporting 4/27/2020 10:35:33 AM"
description: "routingsupporting 4/27/2020 10:35:33 AM",
},
props: ["headerid"],
data() {
return {
materialId: null,
action: Api.index,
easySearch: {
keys: {
op: "nameMaterial",
value: null
value: null,
},
routingHeaderId: {
op: "Equal",
value: -1
}
value: -1,
},
},
modal: false,
title: "新增",
......@@ -59,70 +82,64 @@ export default {
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)
);
}
},
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: "routingDetailId",
// title: this.l("routingDetailId"),
// hide: true,
// import: true,
// },
// {
// 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
high: true,
},
// {
// key: "materialId",
// title: this.l("materialId"),
// align: "left",
// hide: true,
// import: true,
// },
{
key: "nameMaterial",
title: this.l("nameMaterial"),
......@@ -130,132 +147,157 @@ export default {
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,
hide: false,
type: "user",
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',
key: "quantity",
title: this.l("quantity"),
high: true,
width: 80,
},
// {
// 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,
width: 180,
align: "center",
render: (h, params) => {
return h("div", {
class: "action"
}, [
return h(
"div",
{
class: "action",
},
[
h(
"op", {
"op",
{
attrs: {
oprate: "detail"
oprate: "detail",
},
on: {
click: () => this.view(params.row.id)
}
click: () => this.view(params.row),
},
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op", {
"op",
{
attrs: {
oprate: "edit"
oprate: "edit",
},
on: {
click: () => this.edit(params.row.id)
}
click: () => this.edit(params.row.id),
},
},
this.headerStatus == 4 || this.headerStatus == 0 ? "编辑" : ""
),
h(
"op", {
"op",
{
attrs: {
oprate: "delete"
oprate: "delete",
},
on: {
click: () => this.remove(params.row.id)
}
click: () => this.remove(params.row.id),
},
},
this.headerStatus == 4 || this.headerStatus == 0 ? "删除" : ""
)
]);
}
}
),
]
);
},
},
],
headerStatus: -1,
productBomId: -1,
......@@ -265,24 +307,21 @@ export default {
};
},
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;
}
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
}) {
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
......@@ -307,8 +346,9 @@ export default {
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
view(row) {
this.curId = row.id;
this.materialId = row.materialId;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
......@@ -321,7 +361,7 @@ export default {
this.modal = true;
},
remove(id) {
Api.delete(id).then(r => {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
......@@ -335,14 +375,14 @@ export default {
//批量导入start
//导入功能
openModalIm() {
this.ModalIm = true
this.ModalIm = true;
},
ModalImCancel() {
this.ModalIm = false
this.ModalIm = false;
},
getData(val) {
let url = `${technologyUrl}productinfoimportservice/import`;
this.$refs.importExcel.deelData(url, this.cols, this.formatMethod(val))
this.$refs.importExcel.deelData(url, this.cols, this.formatMethod(val));
},
//根据页面二次处理数据
formatMethod(val) {
......@@ -352,66 +392,70 @@ export default {
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 : '',
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 : '',
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 : ''
drawNum: ele.drawNum ? ele.drawNum : "",
};
if (ele.routingDetailId && ele.routingDetailId != null) {
obj.ico = false
obj.ico = false;
} else {
obj.ico = true
obj.ico = true;
}
tempList.push(obj);
});
return tempList
return tempList;
},
//批量导入end
//工艺规程id和name之间的转换
//获取工艺规程信息
getRoutingHeaderData() {
let data = {
conditions: []
conditions: [],
};
Api.getRoutingheaderList(data).then((r) => {
if (r.success) {
this.routingHeaderData = r.result || []
this.routingHeaderData = r.result || [];
}
});
},
//根据工艺规程ID获得name
getRoutingHeaderName(val) {
let routingHeaderDataList = this.$u.clone(this.routingHeaderData)
let routingHeaderName = ""
routingHeaderDataList.forEach(ele => {
let routingHeaderDataList = this.$u.clone(this.routingHeaderData);
let routingHeaderName = "";
routingHeaderDataList.forEach((ele) => {
if (ele.id == Number(val)) {
routingHeaderName = ele.name
routingHeaderName = ele.name;
}
})
return routingHeaderName
});
return routingHeaderName;
},
l(key) {
let vkey = "routingsupporting" + "." + key;
return this.$t(vkey) || key;
}
}
},
},
};
</script>
......
......@@ -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