Commit 5d763a79 authored by 仇晓婷's avatar 仇晓婷

生产准备

parent 3f73768d
<template>
<Row>
<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>
</template>
<script>
export default {
data() {
return {
fileds: [], //扩展属性
entity: {
// json: {},
},
};
},
props: ["materialId", "forItem"],
mounted() {
// this.get();
},
watch: {
materialId(v) {
this.get();
},
},
methods: {
get() {
this.$api
.get(
`${material}/custompropertydefinition/getmaterialdefinitionproperty`,
{ materialId: this.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;
}
// console.log(u);
// this.$set(this.entity.customProperties,u.filed,v)
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.$set(this.entity, u.filed, v);
});
}
});
},
},
};
</script>
\ No newline at end of file
......@@ -195,7 +195,7 @@ 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;
......
......@@ -41,12 +41,13 @@
<span>{{entity.materialNumber}}</span>
</FormItem>
</Col>
<Col v-for="li in fileds" :key="li.field" :span="li.span">
<!-- <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>
</Col>-->
</Row>
<CustomProperties :materialId="entity.materialId" :forItem="forItem" @onValue="onValue" />
<Row>
<Col span="24" style="text-align:right">
<FormItem label>
......@@ -80,6 +81,7 @@ export default {
quantity: 0,
json: {},
},
forItem: {},
rules: {
materialId: [
{
......@@ -121,39 +123,44 @@ export default {
this.entity.materialNumber = e.mmcode;
this.entity.json.nameMaterial = e.name;
this.entity.json.materialNumber = e.mmcode;
var forItem = v;
Api.getmaterialdefinitionproperty({ materialId: e.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;
}
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]);
}
}
this.$set(this.entity, u.filed, v);
});
}
}
);
this.forItem = v;
// var forItem = v;
// Api.getmaterialdefinitionproperty({ materialId: e.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;
// }
// 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]);
// }
// }
// this.$set(this.entity, u.filed, v);
// });
// }
// }
// );
},
onValue(filed, v) {
this.$set(this.entity, filed, v);
},
clickChange(val) {
// this.routingDetailList.forEach((e) => {
......
......@@ -62,6 +62,8 @@ import InputTime from '@/components/page/inputTime.vue'
import OutputTime from '@/components/page/outputTime.vue'
import ViewerImg from '@/components/page/viewer.vue'
import ImportExcel from '@/components/page/import/process.vue'
import CustomProperties from '@/components/page/customProperties.vue'
// import FormMaking from 'form-making'
// import 'form-making/dist/FormMaking.css'
......@@ -129,7 +131,7 @@ Vue.component("ViewerImg", ViewerImg)
Vue.component("StoreTree", StoreTree)
Vue.component("StoreSelect", StoreSelect)
Vue.component("ImportExcel",ImportExcel)
Vue.component("CustomProperties",CustomProperties)
//注入mock
......
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