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 { ...@@ -195,7 +195,7 @@ 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;
......
...@@ -41,12 +41,13 @@ ...@@ -41,12 +41,13 @@
<span>{{entity.materialNumber}}</span> <span>{{entity.materialNumber}}</span>
</FormItem> </FormItem>
</Col> </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'"> <FormItem :label="li.title+':'" :prop="li.name" v-if="li.field!='name'&&li.field!='code'">
<div>{{li.newConten}}</div> <div>{{li.newConten}}</div>
</FormItem> </FormItem>
</Col> </Col>-->
</Row> </Row>
<CustomProperties :materialId="entity.materialId" :forItem="forItem" @onValue="onValue" />
<Row> <Row>
<Col span="24" style="text-align:right"> <Col span="24" style="text-align:right">
<FormItem label> <FormItem label>
...@@ -80,6 +81,7 @@ export default { ...@@ -80,6 +81,7 @@ export default {
quantity: 0, quantity: 0,
json: {}, json: {},
}, },
forItem: {},
rules: { rules: {
materialId: [ materialId: [
{ {
...@@ -121,39 +123,44 @@ export default { ...@@ -121,39 +123,44 @@ 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;
var forItem = v;
Api.getmaterialdefinitionproperty({ materialId: e.materialId }).then( this.forItem = v;
(r) => { // var forItem = v;
if (r.result) { // Api.getmaterialdefinitionproperty({ materialId: e.materialId }).then(
this.fileds = r.result.filter(function (item) { // (r) => {
item.span = 12; // if (r.result) {
if (item.dataType > 4) { // this.fileds = r.result.filter(function (item) {
item.span = 24; // item.span = 12;
} // if (item.dataType > 4) {
delete item["id"]; // item.span = 24;
// return item.fieldType != 1; // }
return item.fieldType; // delete item["id"];
}); // // return item.fieldType != 1;
this.fileds.map((u) => { // return item.fieldType;
let v = ""; // });
if (u.dataType == 1 || u.dataType == 2) { // this.fileds.map((u) => {
v = 0; // let v = "";
} // if (u.dataType == 1 || u.dataType == 2) {
console.log(u); // v = 0;
// this.$set(this.entity.customProperties,u.filed,v) // }
for (let key of Object.keys(forItem)) { // console.log(u);
// console.log(key); // // this.$set(this.entity.customProperties,u.filed,v)
// console.log(forItem[key]); // for (let key of Object.keys(forItem)) {
if (key == u.field) { // // console.log(key);
this.entity.json[key] = forItem[key]; // // console.log(forItem[key]);
return (u.newConten = 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.$set(this.entity, u.filed, v);
} // });
); // }
// }
// );
},
onValue(filed, v) {
this.$set(this.entity, filed, v);
}, },
clickChange(val) { clickChange(val) {
// this.routingDetailList.forEach((e) => { // this.routingDetailList.forEach((e) => {
......
...@@ -62,6 +62,8 @@ import InputTime from '@/components/page/inputTime.vue' ...@@ -62,6 +62,8 @@ import InputTime from '@/components/page/inputTime.vue'
import OutputTime from '@/components/page/outputTime.vue' import OutputTime from '@/components/page/outputTime.vue'
import ViewerImg from '@/components/page/viewer.vue' import ViewerImg from '@/components/page/viewer.vue'
import ImportExcel from '@/components/page/import/process.vue' import ImportExcel from '@/components/page/import/process.vue'
import CustomProperties from '@/components/page/customProperties.vue'
// import FormMaking from 'form-making' // import FormMaking from 'form-making'
// import 'form-making/dist/FormMaking.css' // import 'form-making/dist/FormMaking.css'
...@@ -129,7 +131,7 @@ Vue.component("ViewerImg", ViewerImg) ...@@ -129,7 +131,7 @@ Vue.component("ViewerImg", ViewerImg)
Vue.component("StoreTree", StoreTree) Vue.component("StoreTree", StoreTree)
Vue.component("StoreSelect", StoreSelect) Vue.component("StoreSelect", StoreSelect)
Vue.component("ImportExcel",ImportExcel) Vue.component("ImportExcel",ImportExcel)
Vue.component("CustomProperties",CustomProperties)
//注入mock //注入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