<template>
|
<div>
|
<vol-box v-model="showDetialBox" :lazy="true" :height="350" :width="600" :padding="15" title="料框属性维护">
|
<el-form :inline="true" :model="TrayBarcodePropertys" label-width="auto" class="demo-form-inline">
|
<el-form-item label="料框属性:">
|
<el-input v-model="TrayBarcodePropertys.TrayBarcodeProperty" placeholder="料框属性" />
|
</el-form-item>
|
<el-form-item label="托盘容量:">
|
<el-input v-model="TrayBarcodePropertys.Capacity" placeholder="托盘容量" />
|
</el-form-item>
|
<el-button @click="addProductType" type="primary">添加产品工序</el-button>
|
<el-button @click="save" type="success">提交数据</el-button>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="工序:" v-for="(input, index) in TrayBarcodePropertys.ProcessCodes"
|
:key="index">
|
<el-input v-model="input.ProcessCode" placeholder="工序" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="产品类型:" v-for="(input, index) in TrayBarcodePropertys.ProductTypes"
|
:key="index">
|
<el-input v-model="input.ProductType" placeholder="产品类型" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
</vol-box>
|
</div>
|
</template>
|
|
<script>
|
import VolBox from "@/components/basic/VolBox.vue";
|
import http from "@/../src/api/http.js";
|
export default {
|
components: { VolBox },
|
data() {
|
return {
|
showDetialBox: false,
|
TrayBarcodePropertys: {
|
TrayBarcodeProperty: '',
|
Capacity: 0,
|
ProcessCodes: [{ ProcessCode: '', }],
|
ProductTypes: [{ ProductType: '', }]
|
}
|
}
|
},
|
methods: {
|
addProductType() {
|
this.TrayBarcodePropertys.ProductTypes.push({ ProductType: '' })
|
this.TrayBarcodePropertys.ProcessCodes.push({ ProcessCode: '' })
|
},
|
open() {
|
this.showDetialBox = true
|
},
|
save() {
|
console.log(this.TrayBarcodePropertys)
|
let data = ({...this.TrayBarcodePropertys, ProcessCodes:JSON.stringify(this.TrayBarcodePropertys.ProcessCodes) , ProductTypes:JSON.stringify(this.TrayBarcodePropertys.ProductTypes)});
|
|
debugger;
|
http.post('api/Production/AddData', data).then(res => {
|
if (res.code == 200) {
|
// ElMessage.success(res.msg)
|
this.$message.success('添加成功')
|
this.$parent.load();
|
} else {
|
// ElMessage.error(res.msg)
|
this.$message.error(x.message)
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped></style>
|