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

修改ok

parent 793d06df
......@@ -249,7 +249,7 @@ export default {
field:"c"+maxId,
title: "",
note: "",
dataType: "",
dataType: 0,
required: false,
isunique: false,
fieldType: 3,
......
......@@ -29,42 +29,22 @@
</FormItem>
</Col>
<Col :span="24">
<h4>属性配置</h4>
</Col>
<Col :span="24" style="padding:20px 0 0px 10px;margin-bottom:10px;" class="table-solt">
<!--fieldType 1.固有,2.默认,3自定义; -->
<Table border :columns="columns" :data="checkList" class="tableCommon" height="450">
<h4>扩展属性</h4>
<Table border :columns="columns" :data="checkList">
<template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<Input v-else v-model="row.title" placeholder="请输入" @on-blur="setRow(row,index)" />
<Input
v-if="row.fieldType==3"
v-model="row.title"
placeholder="请输入名称"
@on-blur="setRow(row,index)"
/>
</template>
<template slot-scope="{ row, index }" slot="note">
<div v-if="row.fieldType==1">{{row.note}}</div>
<Input v-model="row.note" placeholder="请输入" @on-blur="setRow(row,index)" v-else />
</template>
<template slot-scope="{ row, index }" slot="dataType">
<Row>
<Col :span="12">
<state
v-if="row.fieldType==1"
code="materail.category.dataType"
:value="row.dataType"
type="text"
></state>
<Dictionary
v-else
@on-change="setRow(row,index)"
v-model="row.dataType"
code="materail.category.dataType"
type="select"
: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>
<!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> -->
<Select
v-model="row.dictionaryCode"
v-if="row.dataType==3"
v-model="row.note"
clearable
transfer
v-else
......@@ -76,22 +56,27 @@
:key="item.code"
>{{ item.name }}</Option>
</Select>
</Col>
</Row>
<span v-else>{{row.note}}</span>
</template>
<template slot-scope="{ row, index }" slot="dataType">
<Dictionary
@on-change="setRow(row,index)"
v-model="row.dataType"
code="materail.category.dataType"
type="select"
:value="row.dataType"
:key="row.dataType"
></Dictionary>
</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
v-if="row.dataType==1||row.dataType==2"
@on-change="setRow(row,index)"
v-model="row.unitName"
code="material.main.unitName"
type="select"
placeholder="请选择单位"
:value="row.unitName"
:key="row.unitName"
></Dictionary>
......@@ -102,18 +87,16 @@
<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"
v-if="row.fieldType==2||row.fieldType==3"
>
<!-- 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>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button>
</Col>
<Col :span="24" class="tr mt10">
<FormItem>
......@@ -162,12 +145,6 @@ export default {
key: "note",
slot: "note"
},
{
title: "属性类型",
key: "dataType",
align: "center",
slot: "dataType"
},
{
title: "单位",
key: "unitName",
......@@ -234,6 +211,11 @@ export default {
this.checkList = r.result;
}
});
Api.getChildren({ id: 582 }).then(r => {
if (r.result) {
this.codeList = r.result;
}
});
},
remove(index, row) {
if (row.add == 0) {
......@@ -260,7 +242,7 @@ export default {
field:"c"+maxId,
title: "",
note: "",
dataType: "",
dataType: "0",
required: false,
isunique: false,
fieldType: 3,
......
......@@ -256,6 +256,15 @@ export default {
if (u.dataType == 3) {
col.code = u.note;
}
if(u.unitName){
var units= this.$store.getters.dictionaryByKey("material.main.unitName");
let item=units.filter(p=>{
return p.code==u.unitName;
})
console.log(units,item)
col.title+="("+item[0].name+")";
}
return col;
});
this.cols = this.cols.concat(extra);
......
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