代码调整
This commit is contained in:
parent
5cfef217d0
commit
fbb8157ff1
@ -21,6 +21,9 @@ export default class ELines extends Group {
|
||||
if ((model.type == '01' && (!model.logicSectionCodeList || !model.logicSectionCodeList.length)) || model.type == '02' || model.type == '03') {
|
||||
this.createLine();
|
||||
}
|
||||
if (model.type == '05') {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
createLine() {
|
||||
|
81
src/views/system/userControl/bindCompany.vue
Normal file
81
src/views/system/userControl/bindCompany.vue
Normal file
@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="绑定单位" :visible.sync="dialogVisible" width="30%" :before-close="doClose" center :close-on-click-modal="false">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doCreate">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { bindCompany } from '@/api/management/user';
|
||||
|
||||
export default {
|
||||
name:'BindCompany',
|
||||
props: {
|
||||
companyList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
name: '',
|
||||
userId: '',
|
||||
companyId:''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'name', label: '名称', type: 'text', disabled:true, rightWidth:true },
|
||||
{ prop: 'companyId', label: '单位', type: 'select', options: this.companyList}
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
companyId: [
|
||||
{ required: true, message: '请选择单位', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doShow(row) {
|
||||
this.dialogVisible = true;
|
||||
this.formModel.name = row.name;
|
||||
this.formModel.userId = row.id;
|
||||
},
|
||||
doClose() {
|
||||
this.dialogVisible = false;
|
||||
this.formModel = {
|
||||
name: '',
|
||||
userId: '',
|
||||
companyId:''
|
||||
};
|
||||
},
|
||||
doCreate() {
|
||||
let formModel = Object.assign({}, this.formModel);
|
||||
delete formModel.name;
|
||||
formModel = 'userId=' + formModel.userId + '&&companyId=' + formModel.companyId;
|
||||
bindCompany(formModel).then(res=>{
|
||||
this.doClose();
|
||||
this.$emit('create');
|
||||
}).catch((error) => {
|
||||
this.$message.error('绑定单位失败: ' + error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user