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

部门

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