Merge remote-tracking branch 'remotes/origin/test'

This commit is contained in:
joylink_cuiweidong 2021-01-12 20:22:06 +08:00
commit b8c8f773c3
2 changed files with 84 additions and 0 deletions

View File

@ -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() {

View 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>