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

部门

parent 90488a30
......@@ -11,13 +11,13 @@
<Input v-model="entity.departcode" placeholder="请输入..."></Input>
</FormItem>
</Col>
<Col :span="12">
<!-- <FormItem :label="l('organizationType')" prop="organizationType">
<!-- <Col :span="12">
<FormItem :label="l('organizationType')" prop="organizationType">
<Input v-model="entity.organization_Type" readonly placeholder="请选择...">
<Button slot="append" @click="selectDepart">选择</Button>
</Input>
</FormItem>-->
</Col>
</FormItem>
</Col>-->
<Col :span="12">
<FormItem :label="l('upMent')">
<b>{{entity.name}}</b>
......@@ -26,7 +26,7 @@
<Col :span="24">
<FormItem :label="l('cityName')">
<Cascader :data="citys" v-model="entity.description02"></Cascader>
<Cascader :data="citys" v-model="entity.location"></Cascader>
</FormItem>
</Col>
<Col :span="12">
......@@ -64,14 +64,12 @@ export default {
// components: { OrganizType },
data() {
return {
showTree: false, //组织类型
// showTree: false, //组织类型
disabled: false,
citys: citys(),
entity: {
name: "",
// organization_Id: 0,
// organization_Type: "",
property: []
organization_Id: 0,
organization_Type: ""
},
rules: {
title02: [
......@@ -97,32 +95,23 @@ export default {
handleSubmit() {
this.$refs["form"].validate(value => {
if (value) {
// let property = "";
if (this.entity.property) {
if (
this.entity.property[0] == 1 ||
this.entity.property[1] == 1 ||
this.entity.property[2] == 1
) {
this.entity.isProduction = 1;
} else {
this.entity.isProduction = 0;
}
alert(this.entity.property);
// property = this.entity.property.join;
if (
this.entity.property[0] == 1 ||
this.entity.property[1] == 1 ||
this.entity.property[2] == 1
) {
this.entity.isProduction = 1;
} else {
this.entity.isProduction = "";
// property = "";
this.entity.isProduction = 0;
}
let paramsdata = {
name: this.entity.title02, //部门名称
parent_Id: this.entity.id, //上级部门 [id]
code: this.entity.departcode, //部门编号
// organization_Id: this.entity.organization_Id, //组织类型 [id]
location: this.entity.location, //省市县
location: this.entity.location.join(), //省市县
isProduction: this.entity.isProduction, //是否生产班组:1是,0否
property: this.entity.property, //属性
parentTitle: this.entity.name //上级名称
property: this.entity.property.join() //属性
};
Api.create(paramsdata)
.then(r => {
......@@ -141,9 +130,9 @@ export default {
}
});
},
// selectDepart() {
// this.showTree = true;
// },
selectDepart() {
this.showTree = true;
},
handleClose() {
this.$emit("on-close");
},
......@@ -154,9 +143,10 @@ export default {
},
watch: {
val(v) {
console.log(v);
this.entity = {};
this.entity.name = v.name;
this.entity.id = v.parent_Id;
this.entity.id = v.id;
}
}
};
......
......@@ -47,7 +47,7 @@
:show.sync="showTree"
:value.sync="entity.organization_Id"
:text.sync="entity.organizationType"
/>-->
/> -->
</Form>
</template>
<script>
......@@ -59,7 +59,7 @@ export default {
// components: { OrganizType },
data() {
return {
showTree: false, //组织类型
// showTree: false, //组织类型
disabled: false,
citys: citys(),
entity: {
......@@ -69,15 +69,15 @@ export default {
rules: {
title02: [
{ required: true, message: "库位名不能为空", trigger: "blur" }
],
organizationType: [
{
// type: 'array',
required: true,
message: "组织类型不能为空",
trigger: "blur"
}
]
// organizationType: [
// {
// // type: 'array',
// required: true,
// message: "组织类型不能为空",
// trigger: "blur"
// }
// ]
}
};
},
......@@ -85,21 +85,15 @@ export default {
handleSubmit() {
this.$refs["form"].validate(value => {
if (value) {
// var property = "";
if (this.entity.property) {
if (
this.entity.property[0] == 1 ||
this.entity.property[1] == 1 ||
this.entity.property[2] == 1
) {
this.entity.isProduction = 1;
} else {
this.entity.isProduction = 0;
}
if (
this.entity.property[0] == 1 ||
this.entity.property[1] == 1 ||
this.entity.property[2] == 1
) {
this.entity.isProduction = 1;
} else {
this.entity.isProduction = "";
this.entity.isProduction = 0;
}
alert(this.entity.property);
let location;
if (this.entity.location) {
location = this.entity.location.join(",");
......@@ -110,11 +104,10 @@ export default {
name: this.entity.title02, //部门名称
parent_Id: 0, //上级部门 [id]
code: this.entity.departcode, //部门编号
// organization_Id: this.entity.organization_Id, //组织类型 [id]
organization_Id: this.entity.organization_Id, //组织类型 [id]
location: location, //省市县
isProduction: this.entity.isProduction, //是否生产班组:1是,0否
property: this.entity.property, //属性
parentTitle: ""
property: this.entity.property.join() //属性
};
Api.create(paramsdata)
.then(r => {
......
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