Commit b62c2ed1 authored by 周远喜's avatar 周远喜

Merge branch 'product' of http://git.mes123.com/zhouyx/mes-ui into product

parents 9b6cb7dd 94873de6
...@@ -29,56 +29,91 @@ ...@@ -29,56 +29,91 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<h4>扩展属性</h4> <h4>扩展属性</h4>
<Table border :columns="columns" :data="checkList" height="300"> <Table border :columns="columns" :data="checkList" height="450">
<template slot-scope="{ row, index }" slot="title"> <template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div> <div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<Input <Input
v-if="row.fieldType==3" v-if="row.fieldType==3"
v-model="row.title" v-model="row.title"
placeholder="请输入" placeholder="请输入"
@on-blur="setRow(row,index)" @on-blur="setRow(row,index)"
/> />
</template> </template>
<template slot-scope="{ row, index }" slot="note"> <template slot-scope="{ row, index }" slot="note">
<div v-if="row.fieldType==1">{{row.note}}</div> <div v-if="row.fieldType==1">{{row.note}}</div>
<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"
</template> :key="row.dataType"
<!-- <template slot-scope="{ row, index }" slot="result"> ></Dictionary>
<Input v-model="row.result" placeholder="请输入" @on-blur="setRow(row,index)" /> </Col>
</template>--> <Col :span="12" v-if="row.dataType==3">
<template slot-scope="{ row, index }" slot="required"> <div v-if="row.fieldType==1">'/'+{{row.dictionaryCode}}</div>
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox> <Select
</template> v-model="row.dictionaryCode"
<template slot-scope="{ row, index }" slot="isUnique"> clearable
<Checkbox v-model="row.isUnique" @on-change="setRow(row,index)"></Checkbox> transfer
</template> v-else
<template @on-change="setRow(row,index)"
slot-scope="{ row, index }" >
slot="action" <Option
v-if="row.fieldType==2||row.fieldType==3" v-for="item in codeList"
> :value="item.code"
<a @click="remove(index,row)" style="color:#FF7A8B">删除</a> :key="item.code"
</template> >{{ item.name }}</Option>
</Table> </Select>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button> </Col>
</Row>
</template>
<template slot-scope="{ row, index }" slot="unitName">
<state
v-if="row.fieldType==1"
code="material.main.unitName"
:value="row.unitName"
type="text"
></state>
<Dictionary
v-else
@on-change="setRow(row,index)"
v-model="row.unitName"
code="material.main.unitName"
type="select"
:value="row.unitName"
:key="row.unitName"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="required">
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox>
</template>
<template slot-scope="{ row, index }" slot="isUnique">
<Checkbox v-model="row.isUnique" @on-change="setRow(row,index)"></Checkbox>
</template>
<template
slot-scope="{ row, index }"
slot="action"
v-if="row.fieldType==2||row.fieldType==3"
>
<a @click="remove(index,row)" style="color:#FF7A8B">删除</a>
</template>
</Table>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button>
</Col> </Col>
<Col :span="24" class="tr mt10"> <Col :span="24" class="tr mt10">
<FormItem> <FormItem>
...@@ -104,6 +139,7 @@ export default { ...@@ -104,6 +139,7 @@ export default {
codeRuleId: this.nodeInfo.codeRuleId codeRuleId: this.nodeInfo.codeRuleId
}, },
disabled: false, disabled: false,
codeList: [],
columns: [ columns: [
{ {
title: "序号", title: "序号",
...@@ -126,7 +162,9 @@ export default { ...@@ -126,7 +162,9 @@ export default {
{ {
title: "备注", title: "备注",
key: "note", key: "note",
slot: "note" align: "center",
slot: "note",
width: "150"
}, },
// { // {
...@@ -139,13 +177,15 @@ export default { ...@@ -139,13 +177,15 @@ export default {
title: "属性类型", title: "属性类型",
key: "dataType", key: "dataType",
align: "center", align: "center",
slot: "dataType" slot: "dataType",
width: "200"
}, },
{ {
title: "单位", title: "单位",
key: "company", key: "unitName",
align: "center", align: "center",
slot: "company" slot: "unitName",
width: "150"
}, },
{ {
title: "必填", title: "必填",
...@@ -164,7 +204,6 @@ export default { ...@@ -164,7 +204,6 @@ export default {
{ {
title: "操作", title: "操作",
slot: "action", slot: "action",
width: 80,
align: "center" align: "center"
} }
], ],
...@@ -209,6 +248,11 @@ export default { ...@@ -209,6 +248,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
...@@ -29,56 +29,91 @@ ...@@ -29,56 +29,91 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<h4>扩展属性</h4> <h4>属性配置</h4>
<Table border :columns="columns" :data="checkList" height="300"> </Col>
<template slot-scope="{ row, index }" slot="title"> <Col :span="24" style="padding:20px 0 0px 10px;margin-bottom:10px;" class="table-solt">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div> <!--fieldType 1.固有,2.默认,3自定义; -->
<Input <Table border :columns="columns" :data="checkList" class="tableCommon" height="450">
v-if="row.fieldType==3" <template slot-scope="{ row, index }" slot="title">
v-model="row.title" <div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
placeholder="请输入" <Input v-else v-model="row.title" placeholder="请输入" @on-blur="setRow(row,index)" />
@on-blur="setRow(row,index)" </template>
/> <template slot-scope="{ row, index }" slot="note">
</template> <div v-if="row.fieldType==1">{{row.note}}</div>
<template slot-scope="{ row, index }" slot="note"> <Input v-model="row.note" placeholder="请输入" @on-blur="setRow(row,index)" v-else />
<div v-if="row.fieldType==1">{{row.note}}</div> </template>
<Input v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" v-else /> <template slot-scope="{ row, index }" slot="dataType">
</template> <Row>
<template slot-scope="{ row, index }" slot="dataType"> <Col :span="12">
<state <state
v-if="row.fieldType==1" v-if="row.fieldType==1"
code="materail.category.dataType" code="materail.category.dataType"
:value="row.dataType" :value="row.dataType"
type="text" type="text"
></state> ></state>
<Dictionary <Dictionary
v-else v-else
@on-change="setRow(row,index)" @on-change="setRow(row,index)"
v-model="row.dataType" v-model="row.dataType"
code="materail.category.dataType" code="materail.category.dataType"
type="select" type="select"
:value="row.dataType" :value="row.dataType"
:key="row.dataType" :key="row.dataType"
></Dictionary> ></Dictionary>
</template> </Col>
<!-- <template slot-scope="{ row, index }" slot="result"> <Col :span="12" v-if="row.dataType==3">
<Input v-model="row.result" placeholder="请输入" @on-blur="setRow(row,index)" /> <div v-if="row.fieldType==1">'/'+{{row.dictionaryCode}}</div>
</template>--> <Select
<template slot-scope="{ row, index }" slot="required"> v-model="row.dictionaryCode"
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox> clearable
</template> transfer
<template slot-scope="{ row, index }" slot="isUnique"> v-else
<Checkbox v-model="row.isUnique" @on-change="setRow(row,index)"></Checkbox> @on-change="setRow(row,index)"
</template> >
<template <Option
slot-scope="{ row, index }" v-for="item in codeList"
slot="action" :value="item.code"
v-if="row.fieldType==2||row.fieldType==3" :key="item.code"
> >{{ item.name }}</Option>
<a @click="remove(index,row)" style="color:#FF7A8B">删除</a> </Select>
</template> </Col>
</Table> </Row>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button> </template>
<template slot-scope="{ row, index }" slot="unitName">
<state
v-if="row.fieldType==1"
code="material.main.unitName"
:value="row.unitName"
type="text"
></state>
<Dictionary
v-else
@on-change="setRow(row,index)"
v-model="row.unitName"
code="material.main.unitName"
type="select"
:value="row.unitName"
:key="row.unitName"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="required">
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox>
</template>
<template slot-scope="{ row, index }" slot="isUnique">
<Checkbox v-model="row.isUnique" @on-change="setRow(row,index)"></Checkbox>
</template>
<template
slot-scope="{ row, index }"
slot="action"
v-if="row.fieldType==2||row.fieldType==3||!row.notEditDelete"
>
<!-- notEditDelete=true,删除不显示 -->
<a @click="remove(index,row)" style="color:#FF7A8B">删除</a>
</template>
</Table>
</Col>
<Col :span="24" style="margin-bottom:20px;">
<Button type="primary" long @click="addNew" class="mt10">添加</Button>
</Col> </Col>
<Col :span="24" class="tr mt10"> <Col :span="24" class="tr mt10">
<FormItem> <FormItem>
...@@ -127,13 +162,18 @@ export default { ...@@ -127,13 +162,18 @@ export default {
key: "note", key: "note",
slot: "note" slot: "note"
}, },
{
// { title: "属性类型",
// title: "是否显示", key: "dataType",
// key: "result", align: "center",
// align: "center", slot: "dataType"
// slot: "result" },
// }, {
title: "单位",
key: "unitName",
align: "center",
slot: "unitName"
},
{ {
title: "必填", title: "必填",
key: "required", key: "required",
......
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
}, },
methods: { methods: {
search() { search() {
alert(JSON.stringify(this.easySearch)); // alert(JSON.stringify(this.easySearch));
console.log(this.easySearch); console.log(this.easySearch);
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
}, },
......
...@@ -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"
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,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: [],
...@@ -162,7 +162,6 @@ export default { ...@@ -162,7 +162,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);
......
...@@ -120,7 +120,7 @@ export default { ...@@ -120,7 +120,7 @@ export default {
render: (h, params) => { render: (h, params) => {
return h("state", { return h("state", {
props: { props: {
code: "materail.category.status", code: "material.main.status",
type: "text", type: "text",
value: params.row.status + "" value: params.row.status + ""
} }
...@@ -137,19 +137,19 @@ export default { ...@@ -137,19 +137,19 @@ export default {
title: "描述", title: "描述",
align: "left" align: "left"
}, },
{ {
key: "creationTime", key: "creationTime",
title: "创建时间", title: "创建时间",
hide:false, hide:false,
align: "left", align: "left",
type:"date" type:"date"
}, },
{ {
key: "creatorUserId", key: "creatorUserId",
title: "创建人", title: "创建人",
hide:false, hide: false,
align: "left", align: "left",
type:"user" type: "user"
}, },
{ {
title: "操作", title: "操作",
...@@ -241,24 +241,26 @@ export default { ...@@ -241,24 +241,26 @@ export default {
}).then(r => { }).then(r => {
if (r.result) { if (r.result) {
var items = r.result.filter(u => { var items = r.result.filter(u => {
return !this.columns.some(p => { return (
return p.key == u.field; !this.columns.some(p => {
})&&u.dataType!=5; return p.key == u.field;
}) && u.dataType != 5
);
}); });
this.cols=this.$u.clone(this.columns); this.cols = this.$u.clone(this.columns);
let extra= items.map(u=>{ let extra = items.map(u => {
var col={ var col = {
key:u.field, key: u.field,
title:u.title title: u.title
}; };
if(u.dataType==3){ if (u.dataType == 3) {
col.code=u.note; col.code = u.note;
} }
return col return col;
}) });
this.cols= this.cols.concat(extra); this.cols = this.cols.concat(extra);
var action=this.cols.splice(this.columns.length-1,1); var action = this.cols.splice(this.columns.length - 1, 1);
this.cols.push(this.columns[this.columns.length-1]); this.cols.push(this.columns[this.columns.length - 1]);
} }
}); });
}, },
...@@ -330,8 +332,8 @@ export default { ...@@ -330,8 +332,8 @@ export default {
watch: { watch: {
nodeInfo: { nodeInfo: {
handler(newName, oldName) { handler(newName, oldName) {
console.log("ovo",newName,oldName) console.log("ovo", newName, oldName);
if(newName.rootCategoryId){ if (newName.rootCategoryId) {
this.initCols(); this.initCols();
} }
if (newName.categoryId) { if (newName.categoryId) {
......
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