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

部门加字段

parent 369364b5
...@@ -420,7 +420,8 @@ export default { ...@@ -420,7 +420,8 @@ export default {
DipartLocation: { DipartLocation: {
name: "部门", name: "部门",
organizationType: "组织类型", organizationType: "组织类型",
status: '是否生产班组', // status: '是否生产班组',
status:'属性',
departcode: '部门编号', departcode: '部门编号',
department: '部门名称', department: '部门名称',
cityName: '省市县', cityName: '省市县',
......
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
<Col :span="12"> <Col :span="12">
<FormItem :label="l('upMent')"> <FormItem :label="l('upMent')">
<b>{{entity.name}}</b> <b>{{entity.name}}</b>
</FormItem> </FormItem>
</Col> </Col>
<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.description02"></Cascader>
...@@ -31,10 +31,14 @@ ...@@ -31,10 +31,14 @@
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')"> <FormItem :label="l('status')">
<RadioGroup v-model="entity.isProduction"> <!-- <RadioGroup v-model="entity.isProduction">
<Radio label="1"></Radio> <Radio label="1"></Radio>
<Radio label="0"></Radio> <Radio label="0"></Radio>
</RadioGroup> </RadioGroup>-->
<CheckboxGroup v-model="entity.isProduction">
<Checkbox label="1">生产班组</Checkbox>
<Checkbox label="2">排产资源</Checkbox>
</CheckboxGroup>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
...@@ -51,11 +55,11 @@ ...@@ -51,11 +55,11 @@
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
import OrganizType from '@/components/modalTree/organizType.vue' import OrganizType from "@/components/modalTree/organizType.vue";
import citys from '@/libs/citys' import citys from "@/libs/citys";
export default { export default {
name: 'Add', name: "Add",
components: { OrganizType }, components: { OrganizType },
data() { data() {
return { return {
...@@ -64,72 +68,72 @@ export default { ...@@ -64,72 +68,72 @@ export default {
citys: citys(), citys: citys(),
entity: { entity: {
organization_Id: 0, organization_Id: 0,
organization_Type: '' organization_Type: ""
}, },
rules: { rules: {
title02: [ title02: [
{ required: true, message: '库位名不能为空', trigger: 'blur' } { required: true, message: "库位名不能为空", trigger: "blur" }
], ],
organizationType: [ organizationType: [
{ {
required: true, required: true,
message: '组织类型不能为空', message: "组织类型不能为空",
trigger: 'blur' trigger: "blur"
} }
] ]
} }
} };
},
props: {
val: Object
},
created() {
this.entity = {};
}, },
props: {
val: Object
},
created() {
this.entity = {}
},
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs['form'].validate(value=>{ this.$refs["form"].validate(value => {
if(value){ if (value) {
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, //省市县
isProduction: this.entity.isProduction,//是否生产班组:1是,0否 isProduction: this.entity.isProduction //是否生产班组:1是,0否
} };
Api.create(paramsdata) Api.create(paramsdata)
.then((r) => { .then(r => {
this.disabled = false this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success('保存成功!') this.$Message.success("保存成功!");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败,请联系管理员') this.$Message.error("保存失败,请联系管理员");
} }
}) })
.catch((err) => { .catch(err => {
this.disabled = false this.disabled = false;
this.$Message.error('保存失败,请联系管理员') this.$Message.error("保存失败,请联系管理员");
}) });
} }
}) });
}, },
selectDepart() { selectDepart() {
this.showTree = true this.showTree = true;
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'DipartLocation' + '.' + key key = "DipartLocation" + "." + key;
return this.$t(key) return this.$t(key);
} }
}, },
watch: { watch: {
val(v) { val(v) {
this.entity = this.val this.entity = this.val;
} }
} }
} };
</script> </script>
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('organizationType')" prop="organizationType"> <FormItem :label="l('organizationType')" prop="organizationType">
<Input v-model="entity.organizationType" readonly placeholder="请选择..."> <Input v-model="entity.organizationType" readonly placeholder="请选择...">
<Button slot="append" @click="selectDepart">选择</Button> <Button slot="append" @click="selectDepart">选择</Button>
</Input> </Input>
...@@ -21,10 +21,14 @@ ...@@ -21,10 +21,14 @@
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')"> <FormItem :label="l('status')">
<RadioGroup v-model="entity.status"> <!-- <RadioGroup v-model="entity.status">
<Radio label="1"></Radio> <Radio label="1"></Radio>
<Radio label="0"></Radio> <Radio label="0"></Radio>
</RadioGroup> </RadioGroup>-->
<CheckboxGroup v-model="entity.isProduction">
<Checkbox label="1">生产班组</Checkbox>
<Checkbox label="2">排产资源</Checkbox>
</CheckboxGroup>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
...@@ -46,11 +50,11 @@ ...@@ -46,11 +50,11 @@
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
import OrganizType from '@/components/modalTree/organizType.vue' import OrganizType from "@/components/modalTree/organizType.vue";
import citys from '@/libs/citys' import citys from "@/libs/citys";
export default { export default {
name: 'Add', name: "Add",
components: { OrganizType }, components: { OrganizType },
data() { data() {
return { return {
...@@ -59,69 +63,68 @@ export default { ...@@ -59,69 +63,68 @@ export default {
citys: citys(), citys: citys(),
entity: { entity: {
organization_Id: 0, organization_Id: 0,
organizationType: '' organizationType: ""
}, },
rules: { rules: {
title02: [ title02: [
{ required: true, message: '库位名不能为空', trigger: 'blur' } { required: true, message: "库位名不能为空", trigger: "blur" }
], ],
organizationType: [ organizationType: [
{ {
// type: 'array', // type: 'array',
required: true, required: true,
message: '组织类型不能为空', message: "组织类型不能为空",
trigger: 'blur' trigger: "blur"
} }
] ]
} }
} };
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs['form'].validate(value =>{ this.$refs["form"].validate(value => {
if(value){ if (value) {
let location ; let location;
if(this.entity.location){ if (this.entity.location) {
location = this.entity.location.join(',') location = this.entity.location.join(",");
}else{ } else {
location = '' location = "";
} }
let paramsdata = { let paramsdata = {
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.status,//是否生产班组:1是,0否 isProduction: this.entity.isProduction //是否生产班组:1是,0否
} };
Api.create(paramsdata) Api.create(paramsdata)
.then((r) => { .then(r => {
this.disabled = false this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success('保存成功!') this.$Message.success("保存成功!");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败,请联系管理员') this.$Message.error("保存失败,请联系管理员");
} }
}) })
.catch((err) => { .catch(err => {
this.disabled = false this.disabled = false;
this.$Message.error('保存失败,请联系管理员') this.$Message.error("保存失败,请联系管理员");
}) });
} }
}) });
}, },
selectDepart() { selectDepart() {
this.showTree = true this.showTree = true;
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'DipartLocation' + '.' + key key = "DipartLocation" + "." + key;
return this.$t(key) return this.$t(key);
} }
} }
} };
</script> </script>
\ No newline at end of file
...@@ -20,10 +20,14 @@ ...@@ -20,10 +20,14 @@
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')"> <FormItem :label="l('status')">
<RadioGroup v-model="entity.isProduction"> <!-- <RadioGroup v-model="entity.isProduction">
<Radio label="1"></Radio> <Radio label="1"></Radio>
<Radio label="0"></Radio> <Radio label="0"></Radio>
</RadioGroup> </RadioGroup>-->
<CheckboxGroup v-model="entity.isProduction">
<Checkbox label="1">生产班组</Checkbox>
<Checkbox label="2">排产资源</Checkbox>
</CheckboxGroup>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
...@@ -31,7 +35,6 @@ ...@@ -31,7 +35,6 @@
<Cascader :data="citys" v-model="city_level"></Cascader> <Cascader :data="citys" v-model="city_level"></Cascader>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
...@@ -46,90 +49,88 @@ ...@@ -46,90 +49,88 @@
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
import OrganizType from '@/components/modalTree/organizType.vue' import OrganizType from "@/components/modalTree/organizType.vue";
import citys from '@/libs/citys' import citys from "@/libs/citys";
export default { export default {
name: 'Add', name: "Add",
components: { OrganizType }, components: { OrganizType },
data() { data() {
return { return {
city_level:[], city_level: [],
showTree: false, //组织类型 showTree: false, //组织类型
disabled: false, disabled: false,
citys: citys(), citys: citys(),
entity: { entity: {
organization_Id: 0, organization_Id: 0,
organizationType: '' organizationType: ""
}, },
rules: { rules: {
name: [ name: [{ required: true, message: "库位名不能为空", trigger: "blur" }],
{ required: true, message: '库位名不能为空', trigger: 'blur' }
],
organizationType: [ organizationType: [
{ {
required: true, required: true,
message: '组织类型不能为空', message: "组织类型不能为空",
trigger: 'blur' trigger: "blur"
} }
] ]
} }
} };
},
props: {
row: Object
},
created() {
// this.entity = {}
}, },
props: {
row: Object
},
created() {
// this.entity = {}
},
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs['form'].validate(value=>{ this.$refs["form"].validate(value => {
if(value){ if (value) {
let paramsdata = { let paramsdata = {
id: this.entity.id, id: this.entity.id,
name: this.entity.name,//部门名称 name: this.entity.name, //部门名称
parent_Id: this.entity.parent_Id,//上级部门 [id] parent_Id: this.entity.parent_Id, //上级部门 [id]
code: this.entity.code,//部门编号 code: this.entity.code, //部门编号
organizationType: this.entity.organizationType,//组织类型 [name] organizationType: this.entity.organizationType, //组织类型 [name]
organization_Id: this.entity.organization_Id,//组织类型 [id] organization_Id: this.entity.organization_Id, //组织类型 [id]
location: this.city_level.join(','),//省市县 location: this.city_level.join(","), //省市县
isProduction: this.entity.isProduction,//是否生产班组:1是,0否 isProduction: this.entity.isProduction //是否生产班组:1是,0否
} };
Api.update(paramsdata) Api.update(paramsdata)
.then((r) => { .then(r => {
this.disabled = false this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success('编辑成功') this.$Message.success("编辑成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('编辑失败,请联系管理员') this.$Message.error("编辑失败,请联系管理员");
} }
}) })
.catch((err) => { .catch(err => {
this.disabled = false this.disabled = false;
this.$Message.error('编辑失败,请联系管理员') this.$Message.error("编辑失败,请联系管理员");
}) });
} }
}) });
}, },
selectDepart() { selectDepart() {
this.showTree = true this.showTree = true;
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'DipartLocation' + '.' + key key = "DipartLocation" + "." + key;
return this.$t(key) return this.$t(key);
} }
}, },
watch: { watch: {
row(v) { row(v) {
this.entity = this.row this.entity = this.row;
this.entity.isProduction = this.row.isProduction.toString() this.entity.isProduction = this.row.isProduction.toString();
this.city_level = this.row.location.split(',') this.city_level = this.row.location.split(",");
} }
} }
} };
</script> </script>
\ No newline at end of file
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