Commit dfd83c51 authored by renjintao's avatar renjintao

state

parent 1586601e
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="120">
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="120">
<Row>
<!--
<Col :span="12">
......@@ -37,12 +37,7 @@
<Col :span="12">
<FormItem :label="l('routingDetailName')" prop="routingDetailId">
<Select v-model="entity.routingDetailId">
<Option
v-for="(item, index) in routingDetailList"
:value="item.value"
:key="index"
>{{ item.label }}</Option
>
<Option v-for="(item, index) in routingDetailList" :value="item.value" :key="index">{{ item.label }}</Option>
</Select>
</FormItem>
</Col>
......@@ -59,24 +54,9 @@
<Materiel :bomId="productBomId" v-model="entity.materialId" @on-change="change"></Materiel>
</FormItem>-->
<FormItem :label="l('nameMaterial')" prop="materialId">
<Select
v-model="entity.materialId"
placeholder="请选择"
style="width: 300px"
>
<Option
v-for="(item, index) in listData"
:key="index"
:value="item.value"
:label="item.label"
style="display: none"
></Option>
<Tree
key="mytree"
:data="dataTree"
ref="mytree"
:render="renderContent"
></Tree>
<Select v-model="entity.materialId" placeholder="请选择" style="width: 300px">
<Option v-for="(item, index) in listData" :key="index" :value="item.value" :label="item.label" style="display: none"></Option>
<Tree key="mytree" :data="dataTree" ref="mytree" :render="renderContent"></Tree>
</Select>
<!-- <Materiel
v-model="entity.materialId"
......@@ -93,10 +73,7 @@
</Col>-->
<Col :span="12">
<FormItem :label="l('quantity')" prop="quantity">
<InputNumber
v-model="entity.quantity"
style="width: 100%"
></InputNumber>
<InputNumber v-model="entity.quantity" style="width: 100%"></InputNumber>
</FormItem>
</Col>
<Divider orientation="left">物料属性</Divider>
......@@ -153,9 +130,11 @@
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</Form>
</template>
<script>
<script>
import Api from "./api";
import ApiDetail from "../api";
export default {
......@@ -180,36 +159,30 @@ export default {
texture: "",
procurementStandards: "",
qualityGrade: "",
state: null,
state: 0,
extend: "",
remark: "",
drawNum: "",
json: {},
},
rules: {
routingDetailId: [
{
routingDetailId: [{
required: true,
message: "请选择工序",
type: "number",
trigger: "change",
},
],
materialId: [
{
}, ],
materialId: [{
required: true,
message: "请选择工序",
trigger: "change",
},
],
quantity: [
{
}, ],
quantity: [{
required: true,
type: "number",
message: "请选择工序",
trigger: "blur",
},
],
}, ],
},
routingDetailList: [],
};
......@@ -228,11 +201,14 @@ export default {
this.getData();
},
methods: {
renderContent(h, { root, node, data }) {
renderContent(h, {
root,
node,
data
}) {
//渲染树的样式
return h(
"span",
{
"span", {
style: {
cursor: "pointer",
},
......@@ -262,14 +238,18 @@ export default {
this.entity.materialNumber = data.mmcode;
this.entity.json.nameMaterial = data.name;
this.entity.json.materialNumber = data.mmcode;
Api.getMaterial({ id: data.materialId }).then((r) => {
Api.getMaterial({
id: data.materialId
}).then((r) => {
if (r.result) {
this.forItem = r.result;
}
});
},
getData() {
Api.alltree({ id: this.productBomId }).then((r) => {
Api.alltree({
id: this.productBomId
}).then((r) => {
if (r.success) {
this.dataTree = r.result;
// this.$Message.success("获取物料成功");
......@@ -344,8 +324,7 @@ export default {
}
},
productBomId(v) {
if (v > 0) {
}
if (v > 0) {}
},
},
};
......
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