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

物料加单位字段

parent 0044e078
...@@ -29,56 +29,70 @@ ...@@ -29,56 +29,70 @@
</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="300">
<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 <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> </template>
<!-- <template slot-scope="{ row, index }" slot="result"> <template slot-scope="{ row, index }" slot="dataType">
<Input v-model="row.result" placeholder="请输入" @on-blur="setRow(row,index)" /> <!-- <state
</template>--> v-if="row.fieldType==1"
<template slot-scope="{ row, index }" slot="required"> code="materail.main.company"
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox> :value="row.company"
</template> type="text"
<template slot-scope="{ row, index }" slot="isUnique"> ></state> -->
<Checkbox v-model="row.isUnique" @on-change="setRow(row,index)"></Checkbox> <Dictionary
</template> @on-change="setRow(row,index)"
<template v-model="row.company"
slot-scope="{ row, index }" code="materail.main.company"
slot="action" type="select"
v-if="row.fieldType==2||row.fieldType==3" :value="row.company"
> :key="row.company"
<a @click="remove(index,row)" style="color:#FF7A8B">删除</a> ></Dictionary>
</template> </template>
</Table> <template slot-scope="{ row, index }" slot="required">
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button> <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>
...@@ -129,12 +143,12 @@ export default { ...@@ -129,12 +143,12 @@ export default {
align: "center", align: "center",
slot: "dataType" slot: "dataType"
}, },
// { {
// title: "是否显示", title: "单位",
// key: "result", key: "company",
// align: "center", align: "center",
// slot: "result" slot: "company"
// }, },
{ {
title: "是否必填", title: "是否必填",
key: "required", key: "required",
...@@ -181,7 +195,11 @@ export default { ...@@ -181,7 +195,11 @@ export default {
} }
]; ];
Api.listTable({ conditions: conditions ,sortBy:'id',isDesc:false}).then(r => { Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
if (r.result) { if (r.result) {
var arr = r.result; var arr = r.result;
this.checkList = arr.filter(function(item) { this.checkList = arr.filter(function(item) {
......
...@@ -122,6 +122,7 @@ export default { ...@@ -122,6 +122,7 @@ export default {
methods: { methods: {
clickItem(val) { clickItem(val) {
this.nodeInfo.codeRuleId = val; this.nodeInfo.codeRuleId = val;
this.model8 = val;
this.loadTree(this.nodeInfo.codeRuleId); this.loadTree(this.nodeInfo.codeRuleId);
this.cityList.forEach(e => { this.cityList.forEach(e => {
if (val == e.id) { if (val == e.id) {
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<!-- <Select v-model="model8" clearable style="width:130px;float:left;margin-top:8px" @on-change='chnangeClick' placeholder="请选择类型"> <!-- <Select v-model="model8" clearable style="width:130px;float:left;margin-top:8px" @on-change='chnangeClick' placeholder="请选择类型">
<Option v-for="item in cityList" :value="item.id" :key="item.id">{{ item.name }}</Option> <Option v-for="item in cityList" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select> </Select>
</Select> --> </Select>-->
<Dropdown @on-click="clickItem"> <Dropdown @on-click="clickItem">
<a href="javascript:void(0)"> <a href="javascript:void(0)">
{{downName}} {{downName}}
<Icon type="ios-arrow-down"></Icon> <Icon type="ios-arrow-down"></Icon>
...@@ -66,10 +66,10 @@ export default { ...@@ -66,10 +66,10 @@ export default {
name: "masterData", name: "masterData",
data() { data() {
return { return {
model8:'', model8: "",
type: "", type: "",
keys: "", keys: "",
cityList:[], cityList: [],
expand: false, expand: false,
list: [], list: [],
nodeInfo: { nodeInfo: {
...@@ -77,14 +77,14 @@ export default { ...@@ -77,14 +77,14 @@ export default {
rootCategoryId: 0, rootCategoryId: 0,
ids: [] ids: []
}, },
downName: "请选择类型", downName: "请选择类型",
modal: false, modal: false,
title: "新增", title: "新增",
curId: 0, curId: 0,
detail: null, detail: null,
showMenu: true, showMenu: true,
dataList: [], dataList: [],
codeRuleId:'', codeRuleId: ""
}; };
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
...@@ -92,19 +92,20 @@ export default { ...@@ -92,19 +92,20 @@ export default {
}, },
created() { created() {
// this.loadTree(); // this.loadTree();
this.listSlecet(); this.listSlecet();
}, },
methods: { methods: {
clickItem(val) { clickItem(val) {
this.codeRuleId = val; this.codeRuleId = val;
this.loadTree(this.codeRuleId); this.model8 = val;
this.loadTree(this.codeRuleId);
this.cityList.forEach(e => { this.cityList.forEach(e => {
if (val == e.id) { if (val == e.id) {
this.downName = e.name; this.downName = e.name;
} }
}); });
}, },
listSlecet() { listSlecet() {
let data = { let data = {
conditions: [] conditions: []
}; };
...@@ -114,14 +115,14 @@ export default { ...@@ -114,14 +115,14 @@ export default {
}, },
// chnangeClick(val){ // chnangeClick(val){
// this.codeRuleId = val; // this.codeRuleId = val;
// this.loadTree(this.codeRuleId); // this.loadTree(this.codeRuleId);
// }, // },
showMenuFn() { showMenuFn() {
//this.$Message.info("展开左侧树") //this.$Message.info("展开左侧树")
this.showMenu = true; this.showMenu = true;
}, },
ok(row) { ok(row) {
this.loadTree(this.codeRuleId); this.loadTree(this.codeRuleId);
// this.modal = false; // this.modal = false;
// this.curId = 0; // this.curId = 0;
// if (row) { // if (row) {
...@@ -195,12 +196,11 @@ export default { ...@@ -195,12 +196,11 @@ export default {
}); });
}, },
toggle() { toggle() {
if (this.model8) { if (this.model8) {
this.expand = !this.expand; this.expand = !this.expand;
} else { } else {
this.$Message.error("请先选择类型"); this.$Message.error("请先选择类型");
} }
}, },
change(v, b) { change(v, b) {
let ids = []; let ids = [];
...@@ -275,7 +275,6 @@ export default { ...@@ -275,7 +275,6 @@ export default {
background: rgba(245, 246, 250, 1); background: rgba(245, 246, 250, 1);
opacity: 1; opacity: 1;
padding-left: 10px; padding-left: 10px;
} }
.search { .search {
height: 50px; height: 50px;
......
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