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

部门,人员

parent afcbf600
...@@ -68,7 +68,8 @@ export default { ...@@ -68,7 +68,8 @@ export default {
citys: citys(), citys: citys(),
entity: { entity: {
organization_Id: 0, organization_Id: 0,
organization_Type: "" organization_Type: "",
property: []
}, },
rules: { rules: {
title02: [ title02: [
...@@ -94,10 +95,17 @@ export default { ...@@ -94,10 +95,17 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs["form"].validate(value => { this.$refs["form"].validate(value => {
if (value) { if (value) {
if (this.entity.property[0] == 1 || this.entity.property[1] == 1) { let property = "";
this.entity.isProduction = 1; if (this.entity.property) {
if (this.entity.property[0] == 1 || this.entity.property[1] == 1) {
this.entity.isProduction = 1;
} else {
this.entity.isProduction = 0;
}
property = this.entity.property.join;
} else { } else {
this.entity.isProduction = 0; this.entity.isProduction ='';
property = "";
} }
let paramsdata = { let paramsdata = {
name: this.entity.title02, //部门名称 name: this.entity.title02, //部门名称
...@@ -106,8 +114,8 @@ export default { ...@@ -106,8 +114,8 @@ export default {
organization_Id: this.entity.organization_Id, //组织类型 [id] organization_Id: this.entity.organization_Id, //组织类型 [id]
location: this.entity.location, //省市县 location: this.entity.location, //省市县
isProduction: this.entity.isProduction, //是否生产班组:1是,0否 isProduction: this.entity.isProduction, //是否生产班组:1是,0否
property: this.entity.property.join(), //属性 property: property, //属性
parentTitle:this.entity.name, //上级名称 parentTitle: this.entity.name //上级名称
}; };
Api.create(paramsdata) Api.create(paramsdata)
.then(r => { .then(r => {
......
...@@ -84,10 +84,17 @@ export default { ...@@ -84,10 +84,17 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs["form"].validate(value => { this.$refs["form"].validate(value => {
if (value) { if (value) {
if (this.entity.property[0] == 1 || this.entity.property[1] == 1) { let property = "";
this.entity.isProduction = 1; if (this.entity.property) {
if (this.entity.property[0] == 1 || this.entity.property[1] == 1) {
this.entity.isProduction = 1;
} else {
this.entity.isProduction = 0;
}
property = this.entity.property.join;
} else { } else {
this.entity.isProduction = 0; this.entity.isProduction = "";
property = "";
} }
let location; let location;
if (this.entity.location) { if (this.entity.location) {
...@@ -102,7 +109,7 @@ export default { ...@@ -102,7 +109,7 @@ export default {
organization_Id: this.entity.organization_Id, //组织类型 [id] organization_Id: this.entity.organization_Id, //组织类型 [id]
location: location, //省市县 location: location, //省市县
isProduction: this.entity.isProduction, //是否生产班组:1是,0否 isProduction: this.entity.isProduction, //是否生产班组:1是,0否
property: this.entity.property.join(), //属性 property: property, //属性
parentTitle: "" parentTitle: ""
}; };
Api.create(paramsdata) Api.create(paramsdata)
......
...@@ -133,7 +133,7 @@ export default { ...@@ -133,7 +133,7 @@ export default {
}, },
watch: { watch: {
row(v) { row(v) {
console.log(v)
this.entity = this.row; this.entity = this.row;
if (v.property == "1,2") { if (v.property == "1,2") {
this.entity.property = ["1", "2"]; this.entity.property = ["1", "2"];
...@@ -141,8 +141,8 @@ export default { ...@@ -141,8 +141,8 @@ export default {
this.entity.property = ["1"]; this.entity.property = ["1"];
} else if (v.property == "2") { } else if (v.property == "2") {
this.entity.property = ["2"]; this.entity.property = ["2"];
}else{ } else {
this.entity.property=[] this.entity.property = [];
} }
this.city_level = this.row.location.split(","); this.city_level = this.row.location.split(",");
} }
......
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