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

物料添加字典选项

parent 48a46201
...@@ -45,21 +45,41 @@ ...@@ -45,21 +45,41 @@
<Input v-model="row.note" placeholder="请输入" @on-blur="setRow(row,index)" v-else /> <Input v-model="row.note" placeholder="请输入" @on-blur="setRow(row,index)" v-else />
</template> </template>
<template slot-scope="{ row, index }" slot="dataType"> <template slot-scope="{ row, index }" slot="dataType">
<state <Row>
v-if="row.fieldType==1" <Col :span="12">
code="materail.category.dataType" <state
:value="row.dataType" v-if="row.fieldType==1"
type="text" code="materail.category.dataType"
></state> :value="row.dataType"
<Dictionary type="text"
v-else ></state>
@on-change="setRow(row,index)" <Dictionary
v-model="row.dataType" v-else
code="materail.category.dataType" @on-change="setRow(row,index)"
type="select" v-model="row.dataType"
:value="row.dataType" code="materail.category.dataType"
:key="row.dataType" type="select"
></Dictionary> :value="row.dataType"
:key="row.dataType"
></Dictionary>
</Col>
<Col :span="12" v-if="row.dataType==3">
<div v-if="row.fieldType==1">'/'+{{row.dictionaryCode}}</div>
<Select
v-model="row.dictionaryCode"
clearable
transfer
v-else
@on-change="setRow(row,index)"
>
<Option
v-for="item in codeList"
:value="item.code"
:key="item.code"
>{{ item.name }}</Option>
</Select>
</Col>
</Row>
</template> </template>
<template slot-scope="{ row, index }" slot="unitName"> <template slot-scope="{ row, index }" slot="unitName">
<state <state
...@@ -119,6 +139,7 @@ export default { ...@@ -119,6 +139,7 @@ export default {
codeRuleId: this.nodeInfo.codeRuleId codeRuleId: this.nodeInfo.codeRuleId
}, },
disabled: false, disabled: false,
codeList: [],
columns: [ columns: [
{ {
title: "序号", title: "序号",
...@@ -136,19 +157,22 @@ export default { ...@@ -136,19 +157,22 @@ export default {
title: "备注", title: "备注",
key: "note", key: "note",
align: "center", align: "center",
slot: "note" slot: "note",
width: "150"
}, },
{ {
title: "属性类型", title: "属性类型",
key: "dataType", key: "dataType",
align: "center", align: "center",
slot: "dataType" slot: "dataType",
width: "200"
}, },
{ {
title: "单位", title: "单位",
key: "unitName", key: "unitName",
align: "center", align: "center",
slot: "unitName" slot: "unitName",
width: "150"
}, },
{ {
title: "是否必填", title: "是否必填",
...@@ -165,7 +189,7 @@ export default { ...@@ -165,7 +189,7 @@ export default {
{ {
title: "操作", title: "操作",
slot: "action", slot: "action",
width: 100,
align: "center" align: "center"
} }
], ],
...@@ -209,6 +233,11 @@ export default { ...@@ -209,6 +233,11 @@ export default {
}); });
} }
}); });
Api.getChildren({ id: 582 }).then(r => {
if (r.result) {
this.codeList = r.result;
}
});
}, },
remove(index, row) { remove(index, row) {
if (row.add == 0) { if (row.add == 0) {
......
...@@ -26,5 +26,7 @@ export default { ...@@ -26,5 +26,7 @@ export default {
delete(id) { delete(id) {
return Api.delete(`${systemUrl}/category/delete`,{params:{id:id}}); return Api.delete(`${systemUrl}/category/delete`,{params:{id:id}});
}, },
getChildren(params){
return Api.get(`${systemUrl}/Dictionary/getChildren`,params); //字典
},
} }
\ No newline at end of file
...@@ -43,21 +43,41 @@ ...@@ -43,21 +43,41 @@
<Input v-model="row.note" placeholder="请输入" @on-blur="setRow(row,index)" v-else /> <Input v-model="row.note" placeholder="请输入" @on-blur="setRow(row,index)" v-else />
</template> </template>
<template slot-scope="{ row, index }" slot="dataType"> <template slot-scope="{ row, index }" slot="dataType">
<state <Row>
v-if="row.fieldType==1" <Col :span="12">
code="materail.category.dataType" <state
:value="row.dataType" v-if="row.fieldType==1"
type="text" code="materail.category.dataType"
></state> :value="row.dataType"
<Dictionary type="text"
v-else ></state>
@on-change="setRow(row,index)" <Dictionary
v-model="row.dataType" v-else
code="materail.category.dataType" @on-change="setRow(row,index)"
type="select" v-model="row.dataType"
:value="row.dataType" code="materail.category.dataType"
:key="row.dataType" type="select"
></Dictionary> :value="row.dataType"
:key="row.dataType"
></Dictionary>
</Col>
<Col :span="12" v-if="row.dataType==3">
<div v-if="row.fieldType==1">'/'+{{row.dictionaryCode}}</div>
<Select
v-model="row.dictionaryCode"
clearable
transfer
v-else
@on-change="setRow(row,index)"
>
<Option
v-for="item in codeList"
:value="item.code"
:key="item.code"
>{{ item.name }}</Option>
</Select>
</Col>
</Row>
</template> </template>
<template slot-scope="{ row, index }" slot="unitName"> <template slot-scope="{ row, index }" slot="unitName">
<state <state
......
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
<Input v-model="upName" placeholder="请输入" disabled></Input> <Input v-model="upName" placeholder="请输入" disabled></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <!-- <Col :span="12">
<FormItem label="编码" prop="code"> <FormItem label="编码" prop="code">
<Input v-model="entity.code" placeholder="请输入" disabled></Input> <Input v-model="entity.code" placeholder="请输入" disabled></Input>
</FormItem> </FormItem>
</Col> </Col> -->
<Col :span="12"> <Col :span="12">
<FormItem label="名称" prop="name"> <FormItem label="名称" prop="name">
<Input v-model="entity.name" placeholder="请输入"></Input> <Input v-model="entity.name" placeholder="请输入"></Input>
......
...@@ -2,27 +2,27 @@ ...@@ -2,27 +2,27 @@
<div> <div>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<Col :span="12"> <!-- <Col :span="12">
<FormItem label="编码" prop="code"> <FormItem label="编码" prop="code">
<Input v-model="entity.code" placeholder="请输入" disabled></Input> <Input v-model="entity.code" placeholder="请输入" disabled></Input>
</FormItem> </FormItem>
</Col> </Col> -->
<Col :span="12"> <Col :span="12">
<FormItem label="名称" prop="name"> <FormItem label="名称" prop="name">
<Input v-model="entity.name" placeholder="请输入"></Input> <Input v-model="entity.name" placeholder="请输入"></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <!-- <Col :span="12">
<FormItem label="状态" prop="status" placeholder="请选择"> <FormItem label="状态" prop="status" placeholder="请选择">
<Dictionary <Dictionary
code="materail.category.status" code="material.main.status"
v-model="entity.status" v-model="entity.status"
type="select" type="select"
:value="entity.status" :value="entity.status"
:key="entity.status" :key="entity.status"
></Dictionary> ></Dictionary>
</FormItem> </FormItem>
</Col> </Col> -->
<Col :span="12"> <Col :span="12">
<FormItem label="版本" prop="version"> <FormItem label="版本" prop="version">
<Input v-model="entity.version" placeholder="请输入"></Input> <Input v-model="entity.version" placeholder="请输入"></Input>
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="状态" prop="status" placeholder="请选择"> <FormItem label="状态" prop="status" placeholder="请选择" v-if="entity.status==3||entity.status==2">
<Dictionary <Dictionary
code="materail.category.status" code="material.main.status"
v-model="entity.status" v-model="entity.status"
type="select" type="select"
:value="entity.status" :value="entity.status"
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<script> <script>
import Api from "./api"; import Api from "./api";
export default { export default {
props: ["nodeInfo",'eid'], props: ["nodeInfo", "eid"],
data() { data() {
return { return {
arr: [], arr: [],
...@@ -79,7 +79,6 @@ export default { ...@@ -79,7 +79,6 @@ export default {
}, },
remove(index, row) { remove(index, row) {
// if (row.add == 0) { // if (row.add == 0) {
// //新增的删除,直接删 // //新增的删除,直接删
// this.checkList.splice(index, 1); // this.checkList.splice(index, 1);
......
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