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

生产准备

parent ca559b17
......@@ -25,23 +25,22 @@
</Col>
<Col span="24">
<FormItem :label="l('count')" prop="quantity">
<InputNumber v-model="entity.quantity" style="width:280px"></InputNumber>
<InputNumber v-model="entity.quantity"></InputNumber>
</FormItem>
</Col>
</Row>
<Divider orientation="left">资源属性</Divider>
<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>
<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>
......@@ -77,15 +76,27 @@ export default {
creator: this.$store.state.userInfo.userName,
routingHeaderId: this.eid, //工艺规程id
nameMaterial: "",
name: "",
materialNumber: "",
materialId: null,
quantity: 0,
json: {},
},
rules: {
title: [{ required: true, message: "必填", trigger: "blur" }],
content: [{ required: true, message: "必填", trigger: "blur" }],
materialId: [
{
required: true,
message: "请选择工序",
trigger: "change",
},
],
quantity: [
{
required: true,
type: "number",
message: "请选择工序",
trigger: "blur",
},
],
routingDetailId: [
{
required: true,
......@@ -105,7 +116,7 @@ export default {
methods: {
change(e, v) {
// console.log(e)
console.log(v);
// console.log(v);
this.entity.nameMaterial = e.name;
this.entity.materialId = e.materialId;
this.entity.materialNumber = e.mmcode;
......@@ -166,9 +177,7 @@ export default {
tempObj.value = data.id;
tempObj.label = data.taskSeq + " " + data.name;
tempD.push(tempObj);
this.entity.name = data.name;
});
this.routingDetailList = tempD;
});
},
......
<template>
<div class="detail">
<Row>
<Filed :span="8" :name="l('routingDetail')">{{entity.routingDetailId}}</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>
<Filed :span="8" :name="l('count')">{{entity.quantity}}</Filed>
......@@ -78,19 +78,13 @@ export default {
if (u.dataType == 1 || u.dataType == 2) {
a = 0;
}
// console.log(u);
// this.$set(this.entity.customProperties,u.filed,v)
for (let key of Object.keys(forItem)) {
// console.log(key);
// console.log(forItem[key]);
if (key == u.field) {
this.entity[key] = forItem[key];
return (u.newConten = forItem[key]);
}
}
this.$set(this.entity, u.filed, a);
// console.log(this.entity)
});
}
});
......
......@@ -25,23 +25,22 @@
</Col>
<Col span="24">
<FormItem :label="l('count')" prop="quantity">
<InputNumber v-model="entity.quantity" style="width:280px"></InputNumber>
<InputNumber v-model="entity.quantity"></InputNumber>
</FormItem>
</Col>
</Row>
<Divider orientation="left">资源属性</Divider>
<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>
<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>
......@@ -81,18 +80,32 @@ export default {
materialNumber: "",
materialId: null,
quantity: 0,
name: "",
json: {},
},
rules: {
// routingDetailId: [
// {
// required: true,
// message: "请选择工序",
// type: "number",
// trigger: "change",
// },
// ],
routingDetailId: [
{
required: true,
message: "请选择工序",
type: "number",
trigger: "change",
},
],
materialId: [
{
required: true,
message: "请选择工序",
trigger: "change",
},
],
quantity: [
{
required: true,
type: "number",
message: "请选择工序",
trigger: "blur",
},
],
},
routingDetailList: [],
};
......@@ -107,21 +120,42 @@ export default {
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity.id = r.result.id;
this.entity.routingDetailId = r.result.routingDetailId;
this.entity.quantity = r.result.quantity;
this.entity = r.result;
var materialId = r.result.materialId;
let conditions = [];
conditions = [
{
fieldName: "codeRuleType",
fieldValue: "3",
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) => {
if (materialId == e.id) {
Item = e;
}
});
this.getCustom(materialId, Item);
});
});
},
change(e, v) {
// console.log(e)
//console.log(e);
// console.log(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.getCustom(e.materialId, v);
},
getCustom(materialId, v) {
// console.log(v)
//获取自定义属性
var forItem = v;
Api.getmaterialdefinitionproperty({ materialId: e.materialId }).then(
Api.getmaterialdefinitionproperty({ materialId: materialId }).then(
(r) => {
if (r.result) {
this.fileds = r.result.filter(function (item) {
......@@ -133,19 +167,15 @@ export default {
// return item.fieldType != 1;
return item.fieldType;
});
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
// console.log(u);
// this.$set(this.entity.customProperties,u.filed,v)
for (let key of Object.keys(forItem)) {
// console.log(key);
// console.log(forItem[key]);
if (key == u.field) {
this.entity.json[key] = forItem[key];
return (u.newConten = forItem[key]);
u.newConten = forItem[key];
}
}
this.$set(this.entity, u.filed, v);
......@@ -174,7 +204,6 @@ export default {
tempObj.value = data.id;
tempObj.label = data.taskSeq + " " + data.name;
tempD.push(tempObj);
this.entity.name = data.name;
});
this.routingDetailList = tempD;
});
......
......@@ -43,6 +43,7 @@ export default {
title: "新增",
detail: null,
curId: 0,
materialId: "",
columns: [
// {
// type: "index",
......@@ -174,8 +175,6 @@ export default {
mounted() {
// console.log(this);
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
......
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