|
|
@ -7,11 +7,11 @@ |
|
|
|
<a-row style="margin-left: 14px"> |
|
|
|
<a-row style="margin-left: 14px"> |
|
|
|
<a-button @click="handleAdd(1)" type="primary">添加部门</a-button> |
|
|
|
<a-button @click="handleAdd(1)" type="primary">添加部门</a-button> |
|
|
|
<a-button @click="handleAdd(2)" type="primary">添加下级</a-button> |
|
|
|
<a-button @click="handleAdd(2)" type="primary">添加下级</a-button> |
|
|
|
<a-button type="primary" icon="download" @click="handleExportXls('部门信息')">导出</a-button> |
|
|
|
<!--<a-button type="primary" icon="download" @click="handleExportXls('部门信息')">导出</a-button>--> |
|
|
|
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
|
|
|
<!--<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> |
|
|
|
<a-button type="primary" icon="import">导入</a-button> |
|
|
|
<!--<a-button type="primary" icon="import">导入</a-button>--> |
|
|
|
</a-upload> |
|
|
|
<!--</a-upload>--> |
|
|
|
<a-button title="删除多条数据" @click="batchDel" type="default">批量删除</a-button> |
|
|
|
<!--<a-button title="删除多条数据" @click="batchDel" type="default">批量删除</a-button>--> |
|
|
|
<!--<a-button @click="refresh" type="default" icon="reload" :loading="loading">刷新</a-button>--> |
|
|
|
<!--<a-button @click="refresh" type="default" icon="reload" :loading="loading">刷新</a-button>--> |
|
|
|
</a-row> |
|
|
|
</a-row> |
|
|
|
<div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px"> |
|
|
|
<div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px"> |
|
|
@ -28,7 +28,7 @@ |
|
|
|
<a-dropdown :trigger="[this.dropTrigger]" @visibleChange="dropStatus"> |
|
|
|
<a-dropdown :trigger="[this.dropTrigger]" @visibleChange="dropStatus"> |
|
|
|
<span style="user-select: none"> |
|
|
|
<span style="user-select: none"> |
|
|
|
<a-tree |
|
|
|
<a-tree |
|
|
|
checkable |
|
|
|
|
|
|
|
multiple |
|
|
|
multiple |
|
|
|
@select="onSelect" |
|
|
|
@select="onSelect" |
|
|
|
@check="onCheck" |
|
|
|
@check="onCheck" |
|
|
@ -78,9 +78,10 @@ |
|
|
|
<a-form-item |
|
|
|
<a-form-item |
|
|
|
:labelCol="labelCol" |
|
|
|
:labelCol="labelCol" |
|
|
|
:wrapperCol="wrapperCol" |
|
|
|
:wrapperCol="wrapperCol" |
|
|
|
label="机构名称"> |
|
|
|
label="部门名称"> |
|
|
|
<a-input placeholder="请输入机构/部门名称" v-decorator="['departName', validatorRules.departName ]"/> |
|
|
|
<a-input placeholder="请输入机构/部门名称" v-decorator="['departName', validatorRules.departName ]"/> |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
<template v-if="!orgCategoryDisabled"> |
|
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级部门"> |
|
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级部门"> |
|
|
|
<a-tree-select |
|
|
|
<a-tree-select |
|
|
|
style="width:100%" |
|
|
|
style="width:100%" |
|
|
@ -91,45 +92,43 @@ |
|
|
|
placeholder="无"> |
|
|
|
placeholder="无"> |
|
|
|
</a-tree-select> |
|
|
|
</a-tree-select> |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
</template> |
|
|
|
<a-form-item |
|
|
|
<a-form-item |
|
|
|
:labelCol="labelCol" |
|
|
|
:labelCol="labelCol" |
|
|
|
:wrapperCol="wrapperCol" |
|
|
|
:wrapperCol="wrapperCol" |
|
|
|
label="机构编码"> |
|
|
|
label="部门编码"> |
|
|
|
<a-input disabled placeholder="请输入机构编码" v-decorator="['orgCode', validatorRules.orgCode ]"/> |
|
|
|
<a-input disabled placeholder="请输入部门编码" v-decorator="['orgCode', validatorRules.orgCode ]"/> |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
<a-form-item |
|
|
|
<a-form-item |
|
|
|
:labelCol="labelCol" |
|
|
|
:labelCol="labelCol" |
|
|
|
:wrapperCol="wrapperCol" |
|
|
|
:wrapperCol="wrapperCol" |
|
|
|
label="机构类型"> |
|
|
|
label="部门类型"> |
|
|
|
<template v-if="orgCategoryDisabled"> |
|
|
|
<template v-if="orgCategoryDisabled"> |
|
|
|
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型"> |
|
|
|
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择部门类型"> |
|
|
|
<a-radio value="1"> |
|
|
|
<a-radio value="1"> |
|
|
|
行政 |
|
|
|
管理机构 |
|
|
|
</a-radio> |
|
|
|
</a-radio> |
|
|
|
<a-radio value="2"> |
|
|
|
<a-radio value="2"> |
|
|
|
教学 |
|
|
|
生产企业 |
|
|
|
|
|
|
|
</a-radio> |
|
|
|
|
|
|
|
<a-radio value="4"> |
|
|
|
|
|
|
|
网店 |
|
|
|
</a-radio> |
|
|
|
</a-radio> |
|
|
|
<a-radio value="5"> |
|
|
|
<a-radio value="5"> |
|
|
|
公司 |
|
|
|
门店 |
|
|
|
|
|
|
|
</a-radio> |
|
|
|
|
|
|
|
<a-radio value="6"> |
|
|
|
|
|
|
|
供应商 |
|
|
|
|
|
|
|
</a-radio> |
|
|
|
|
|
|
|
<a-radio value="7"> |
|
|
|
|
|
|
|
物流公司 |
|
|
|
</a-radio> |
|
|
|
</a-radio> |
|
|
|
</a-radio-group> |
|
|
|
</a-radio-group> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
<template v-else> |
|
|
|
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型"> |
|
|
|
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择部门类型"> |
|
|
|
<a-radio value="1"> |
|
|
|
|
|
|
|
行政 |
|
|
|
|
|
|
|
</a-radio> |
|
|
|
|
|
|
|
<a-radio value="2"> |
|
|
|
|
|
|
|
教学 |
|
|
|
|
|
|
|
</a-radio> |
|
|
|
|
|
|
|
<a-radio value="3"> |
|
|
|
<a-radio value="3"> |
|
|
|
班级 |
|
|
|
子部门 |
|
|
|
</a-radio> |
|
|
|
|
|
|
|
<a-radio value="4"> |
|
|
|
|
|
|
|
分组 |
|
|
|
|
|
|
|
</a-radio> |
|
|
|
|
|
|
|
<a-radio value="5"> |
|
|
|
|
|
|
|
公司 |
|
|
|
|
|
|
|
</a-radio> |
|
|
|
</a-radio> |
|
|
|
</a-radio-group> |
|
|
|
</a-radio-group> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -170,9 +169,9 @@ |
|
|
|
</a-empty> |
|
|
|
</a-empty> |
|
|
|
</a-card> |
|
|
|
</a-card> |
|
|
|
</a-tab-pane> |
|
|
|
</a-tab-pane> |
|
|
|
<a-tab-pane tab="部门权限" key="2" forceRender> |
|
|
|
<!--<a-tab-pane tab="部门权限" key="2" forceRender>--> |
|
|
|
<depart-auth-modal ref="departAuth"/> |
|
|
|
<!--<depart-auth-modal ref="departAuth"/>--> |
|
|
|
</a-tab-pane> |
|
|
|
<!--</a-tab-pane>--> |
|
|
|
</a-tabs> |
|
|
|
</a-tabs> |
|
|
|
|
|
|
|
|
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
@ -189,16 +188,16 @@ |
|
|
|
// 表头 |
|
|
|
// 表头 |
|
|
|
const columns = [ |
|
|
|
const columns = [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '机构名称', |
|
|
|
title: '部门名称', |
|
|
|
dataIndex: 'departName' |
|
|
|
dataIndex: 'departName' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '机构类型', |
|
|
|
title: '部门类型', |
|
|
|
align: 'center', |
|
|
|
align: 'center', |
|
|
|
dataIndex: 'orgType' |
|
|
|
dataIndex: 'orgType' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '机构编码', |
|
|
|
title: '部门编码', |
|
|
|
dataIndex: 'orgCode', |
|
|
|
dataIndex: 'orgCode', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
@ -273,9 +272,9 @@ |
|
|
|
edges: [] |
|
|
|
edges: [] |
|
|
|
}, |
|
|
|
}, |
|
|
|
validatorRules: { |
|
|
|
validatorRules: { |
|
|
|
departName: {rules: [{required: true, message: '请输入机构/部门名称!'}]}, |
|
|
|
departName: {rules: [{required: true, message: '请输入部门/部门名称!'}]}, |
|
|
|
orgCode: {rules: [{required: true, message: '请输入机构编码!'}]}, |
|
|
|
orgCode: {rules: [{required: true, message: '请输入部门编码!'}]}, |
|
|
|
orgCategory: {rules: [{required: true, message: '请输入机构类型!'}]}, |
|
|
|
orgCategory: {rules: [{required: true, message: '请输入部门类型!'}]}, |
|
|
|
mobile: {rules: [{validator: this.validateMobile}]} |
|
|
|
mobile: {rules: [{validator: this.validateMobile}]} |
|
|
|
}, |
|
|
|
}, |
|
|
|
url: { |
|
|
|
url: { |
|
|
@ -447,10 +446,10 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 触发onSelect事件时,为部门树右侧的form表单赋值 |
|
|
|
// 触发onSelect事件时,为部门树右侧的form表单赋值 |
|
|
|
setValuesToForm(record) { |
|
|
|
setValuesToForm(record) { |
|
|
|
if(record.orgCategory == '1'){ |
|
|
|
if(record.orgCategory == '3'){ |
|
|
|
this.orgCategoryDisabled = true; |
|
|
|
this.orgCategoryDisabled =false ; |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
this.orgCategoryDisabled = false; |
|
|
|
this.orgCategoryDisabled =true; |
|
|
|
} |
|
|
|
} |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.form.getFieldDecorator('fax', {initialValue: ''}) |
|
|
|
this.form.getFieldDecorator('fax', {initialValue: ''}) |
|
|
|