|
|
@@ -16,32 +16,21 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<el-divider></el-divider> -->
|
|
|
- <el-tree
|
|
|
- :data="ztreeNodes"
|
|
|
- :props="{ children: 'children', label: 'name' }"
|
|
|
- node-key="id"
|
|
|
- :default-expanded-keys="['9']"
|
|
|
- @node-click="onZTreeClick"
|
|
|
- ></el-tree>
|
|
|
+ <el-tree :data="ztreeNodes" :props="{ children: 'children', label: 'name' }" node-key="id"
|
|
|
+ :default-expanded-keys="['9']" @node-click="onZTreeClick"></el-tree>
|
|
|
</div>
|
|
|
</SplitArea>
|
|
|
<!-- 左侧树End -->
|
|
|
|
|
|
<!-- 右侧列表页面Start -->
|
|
|
<SplitArea :size="rightSplitWidth">
|
|
|
- <templateTable
|
|
|
- :searchData.sync="queryFrom"
|
|
|
- :tableConfig="tableConfig"
|
|
|
- :data="pageResult"
|
|
|
- @getList="findPage"
|
|
|
- @handleSearchList="handleSearchList"
|
|
|
- :pagination="pageData"
|
|
|
- >
|
|
|
- <template slot="type" slot-scope="scope">
|
|
|
- <span
|
|
|
- :style="{ background: scope.row.type == '1' ? 'linear-gradient( 180deg, #66CDBB 0%, #33A08D 100%)' : '#A6A6A6', borderRadius: '4px', padding: '4px 10px', color: '#fff' }">{{
|
|
|
- scope.row.type == 1 ? "是" : "否" }}</span>
|
|
|
- </template>
|
|
|
+ <templateTable :searchData.sync="queryFrom" :tableConfig="tableConfig" :data="pageResult" @getList="findPage"
|
|
|
+ @handleSearchList="handleSearchList" :pagination="pageData">
|
|
|
+ <template slot="type" slot-scope="scope">
|
|
|
+ <span
|
|
|
+ :style="{ background: scope.row.type == '1' ? 'linear-gradient( 180deg, #66CDBB 0%, #33A08D 100%)' : '#A6A6A6', borderRadius: '4px', padding: '4px 10px', color: '#fff' }">{{
|
|
|
+ scope.row.type == 1 ? "是" : "否" }}</span>
|
|
|
+ </template>
|
|
|
</templateTable>
|
|
|
</SplitArea>
|
|
|
<!-- 右侧列表页面End -->
|
|
|
@@ -49,62 +38,45 @@
|
|
|
</el-main>
|
|
|
|
|
|
<!-- 新增修改界面 -->
|
|
|
- <el-dialog
|
|
|
- :title="dialogTitle"
|
|
|
- width="40%"
|
|
|
- :visible.sync="dialogVisible"
|
|
|
- :close-on-click-modal="false"
|
|
|
- :before-close="handleDialogBefore"
|
|
|
- @close="closeDialog"
|
|
|
- v-dialogDrag
|
|
|
- >
|
|
|
- <el-form
|
|
|
- :model="formData"
|
|
|
- :rules="rules"
|
|
|
- ref="formData"
|
|
|
- :inline="true"
|
|
|
- label-width="110px"
|
|
|
- size="small"
|
|
|
- >
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="工号" prop="userId">
|
|
|
- <el-input v-model="formData.userId" disabled></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="名称" prop="userName">
|
|
|
- <el-input v-model="formData.userName" disabled></el-input>
|
|
|
- <!-- <el-select v-model="formData.name" disabled clearable filterable placeholder="选择名称" @change="userChange">
|
|
|
+ <el-dialog :title="dialogTitle" width="40%" :visible.sync="dialogVisible" :close-on-click-modal="false"
|
|
|
+ :before-close="handleDialogBefore" @close="closeDialog" v-dialogDrag>
|
|
|
+ <el-form :model="formData" :rules="rules" ref="formData" :inline="true" label-width="110px" size="small">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="工号" prop="userId">
|
|
|
+ <el-input v-model="formData.userId" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="名称" prop="userName">
|
|
|
+ <el-input v-model="formData.userName" disabled></el-input>
|
|
|
+ <!-- <el-select v-model="formData.name" disabled clearable filterable placeholder="选择名称" @change="userChange">
|
|
|
<el-option v-for="(item, index) in useroption" :key="index" :label="item.name"
|
|
|
:value="item.name"></el-option>
|
|
|
</el-select> -->
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="抽成比例" prop="proportional">
|
|
|
- <el-input v-model="formData.proportional" placeholder="请输入抽成比例"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="推荐人" prop="suggestId">
|
|
|
- <el-select v-model="formData.suggestId" @change="suggestChange" :disabled="dialogTitle=='编辑'" clearable placeholder="请选择推荐人">
|
|
|
- <el-option
|
|
|
- v-for="val in sysPartnerOption"
|
|
|
- :key="val.userId"
|
|
|
- :label="val.userName"
|
|
|
- :value="val.userId">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button size="small" @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" size="small" @click="submitForm">提交</el-button>
|
|
|
- </span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="抽成比例" prop="proportional">
|
|
|
+ <el-input v-model="formData.proportional" placeholder="请输入抽成比例"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="推荐人" prop="suggestName">
|
|
|
+ <el-select v-model="formData.suggestName" @change="suggestChange" :disabled="dialogTitle == '编辑'" clearable
|
|
|
+ placeholder="请选择推荐人">
|
|
|
+ <el-option v-for="val in sysPartnerOption" :key="val.userId" :label="val.userName" :value="val.userName">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="small" @click="dialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="submitForm">提交</el-button>
|
|
|
+ </span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -134,12 +106,12 @@ export default {
|
|
|
label: "名称",
|
|
|
prop: "userId",
|
|
|
type: "select",
|
|
|
- options:[]
|
|
|
+ options: []
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
],
|
|
|
-
|
|
|
- useroption:[],
|
|
|
+
|
|
|
+ useroption: [],
|
|
|
tableConfig: {
|
|
|
columns: [
|
|
|
// 数据列
|
|
|
@@ -163,37 +135,37 @@ export default {
|
|
|
loading: true,
|
|
|
isPaginationShow: true,
|
|
|
isShowIndex: true,
|
|
|
- operationWidth:180,
|
|
|
+ operationWidth: 180,
|
|
|
optBtns: [
|
|
|
- {
|
|
|
- type: "primary",
|
|
|
- label: "编辑合伙人",
|
|
|
- perm: "sys:agent:edit",
|
|
|
- icon: "fa fa-edit",
|
|
|
- hide:(row)=>{
|
|
|
- return row.type!=='1'
|
|
|
- },
|
|
|
- click: (row, index) => {
|
|
|
- return this.handleTableEdit(row,'2');
|
|
|
- },
|
|
|
+ {
|
|
|
+ type: "primary",
|
|
|
+ label: "编辑合伙人",
|
|
|
+ perm: "sys:agent:edit",
|
|
|
+ icon: "fa fa-edit",
|
|
|
+ hide: (row) => {
|
|
|
+ return row.type !== '1'
|
|
|
},
|
|
|
- {
|
|
|
- type: "primary",
|
|
|
- label: "编辑",
|
|
|
- icon: "fa fa-edit",
|
|
|
- hide:(row)=>{
|
|
|
- return row.type=='1'
|
|
|
- },
|
|
|
- click: (row, index) => {
|
|
|
- return this.handleTableEdit(row,'1');
|
|
|
- },
|
|
|
+ click: (row, index) => {
|
|
|
+ return this.handleTableEdit(row, '2');
|
|
|
},
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "primary",
|
|
|
+ label: "编辑",
|
|
|
+ icon: "fa fa-edit",
|
|
|
+ hide: (row) => {
|
|
|
+ return row.type == '1'
|
|
|
+ },
|
|
|
+ click: (row, index) => {
|
|
|
+ return this.handleTableEdit(row, '1');
|
|
|
+ },
|
|
|
+ },
|
|
|
{
|
|
|
type: "primary",
|
|
|
label: "删除",
|
|
|
- hide:(row)=>{
|
|
|
- return row.type=='1'
|
|
|
- },
|
|
|
+ hide: (row) => {
|
|
|
+ return row.type == '1'
|
|
|
+ },
|
|
|
icon: "el-icon-delete",
|
|
|
click: (row, index) => {
|
|
|
return this.handleTableDeleteFlag(row);
|
|
|
@@ -201,15 +173,15 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
- rules:{
|
|
|
+ rules: {
|
|
|
proportional: [
|
|
|
- { required: true, message: '请输入抽成比例', trigger: 'blur' },
|
|
|
- ],
|
|
|
- userName: [
|
|
|
- { required: true, message: '请选择名称', trigger: 'change' }
|
|
|
- ],
|
|
|
-
|
|
|
-
|
|
|
+ { required: true, message: '请输入抽成比例', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ userName: [
|
|
|
+ { required: true, message: '请选择名称', trigger: 'change' }
|
|
|
+ ],
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
pageData: {
|
|
|
pageNum: 1,
|
|
|
@@ -223,7 +195,8 @@ export default {
|
|
|
pageResult: [],
|
|
|
dialogTitle: "",
|
|
|
dialogVisible: false, // 新增编辑界面是否显示
|
|
|
- sysPartnerOption:[]
|
|
|
+ sysPartnerOption: [],
|
|
|
+ currentTreeNodeId: ''
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
@@ -232,31 +205,31 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
findLeftTreeData: function () {
|
|
|
- this.$api.dept.findTree().then((res) => {
|
|
|
- this.treeDataRecursion(res.data, '1');
|
|
|
- this.ztreeNodes = res.data;
|
|
|
- });
|
|
|
- },
|
|
|
- //树过滤五级机构递归
|
|
|
- treeDataRecursion(data, num, one) {
|
|
|
- data = data || this.ztreeNodes;
|
|
|
- one = one || 0;
|
|
|
- one++;
|
|
|
- for (let i = 0; i < data.length; i++) {
|
|
|
- if (data[i].comlevel == 5 && (data[i].managementSource != num)) {
|
|
|
- data.splice(i, 1);
|
|
|
- i = i - 1;
|
|
|
- } else {
|
|
|
- this.treeDataRecursion(data[i].children, num, one);
|
|
|
- }
|
|
|
+ this.$api.dept.findTree().then((res) => {
|
|
|
+ this.treeDataRecursion(res.data, '1');
|
|
|
+ this.ztreeNodes = res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //树过滤五级机构递归
|
|
|
+ treeDataRecursion(data, num, one) {
|
|
|
+ data = data || this.ztreeNodes;
|
|
|
+ one = one || 0;
|
|
|
+ one++;
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ if (data[i].comlevel == 5 && (data[i].managementSource != num)) {
|
|
|
+ data.splice(i, 1);
|
|
|
+ i = i - 1;
|
|
|
+ } else {
|
|
|
+ this.treeDataRecursion(data[i].children, num, one);
|
|
|
}
|
|
|
- },
|
|
|
- userChange(val){
|
|
|
- if(val){
|
|
|
- this.formData.userId= this.useroption.find(e=>e.name==val).id
|
|
|
}
|
|
|
- else{
|
|
|
- this.formData.userId=''
|
|
|
+ },
|
|
|
+ userChange(val) {
|
|
|
+ if (val) {
|
|
|
+ this.formData.userId = this.useroption.find(e => e.name == val).id
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.formData.userId = ''
|
|
|
}
|
|
|
},
|
|
|
// 查询Start
|
|
|
@@ -264,7 +237,7 @@ export default {
|
|
|
this.findPage();
|
|
|
},
|
|
|
|
|
|
-
|
|
|
+
|
|
|
// 右侧列表的方法Start
|
|
|
findPage(data) {
|
|
|
this.tableConfig.loading = true;
|
|
|
@@ -272,6 +245,7 @@ export default {
|
|
|
.sysPartnerPage({
|
|
|
...this.pageData,
|
|
|
...data,
|
|
|
+ deptId: this.currentTreeNodeId
|
|
|
})
|
|
|
.then((res) => {
|
|
|
this.tableConfig.loading = false;
|
|
|
@@ -281,31 +255,36 @@ export default {
|
|
|
this.pageData.totalSize = res.data.totalSize;
|
|
|
});
|
|
|
},
|
|
|
- suggestChange(e){
|
|
|
- this.formData.suggestName=''
|
|
|
- if(e){
|
|
|
- this.formData.suggestName=this.sysPartnerOption.find(val=>val.userId==e).userName
|
|
|
+ suggestChange(e) {
|
|
|
+ this.formData.suggestId = ''
|
|
|
+ if (e) {
|
|
|
+ this.formData.suggestId = this.sysPartnerOption.find(val => val.userName == e).userId
|
|
|
}
|
|
|
},
|
|
|
handleSearchList(data) {
|
|
|
this.findPage(data);
|
|
|
},
|
|
|
//编辑
|
|
|
- async handleTableEdit(params,type) {
|
|
|
- this.$api.insCompany.queryRecommendAndPartner(params.parentId).then(res=>{
|
|
|
- this.sysPartnerOption=res.data
|
|
|
+ async handleTableEdit(params, type) {
|
|
|
+ this.$api.insCompany.queryRecommendAndPartner(params.parentId).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.sysPartnerOption = res.data
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
})
|
|
|
- this.dialogTitle =type=='1'?'编辑': "编辑合伙人";
|
|
|
- this.dialogVisible= true
|
|
|
- params.userName=params.name
|
|
|
- params.userId=params.id
|
|
|
- this.formData= JSON.parse(JSON.stringify(params))
|
|
|
+ this.dialogTitle = type == '1' ? '编辑' : "编辑合伙人";
|
|
|
+ params.userName = params.name
|
|
|
+ params.userId = params.id
|
|
|
+ this.formData = JSON.parse(JSON.stringify(params))
|
|
|
+ this.dialogVisible = true
|
|
|
},
|
|
|
// 删除单个人员
|
|
|
handleTableDeleteFlag(data) {
|
|
|
this.$confirm("确认删除?")
|
|
|
.then(() => {
|
|
|
- this.$api.insCompany.sysPartnerDel(data.id ).then((res) => {
|
|
|
+ this.$api.insCompany.sysPartnerDel(data.id).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message({
|
|
|
message: "删除成功",
|
|
|
@@ -317,45 +296,45 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
- .catch(() => {});
|
|
|
+ .catch(() => { });
|
|
|
},
|
|
|
-
|
|
|
- //新增人员
|
|
|
- handleAddButton() {
|
|
|
+
|
|
|
+ //新增人员
|
|
|
+ handleAddButton() {
|
|
|
if (this.currentTreeNode == null) {
|
|
|
this.$message.info("请选择所属公司或部门");
|
|
|
return;
|
|
|
}
|
|
|
if (
|
|
|
this.currentTreeNode.comlevel != null &&
|
|
|
- this.currentTreeNode.comlevel !== "5"
|
|
|
+ this.currentTreeNode.comlevel !== "5"
|
|
|
) {
|
|
|
this.$message.info("请选择第五级机构");
|
|
|
return;
|
|
|
}
|
|
|
- this.$api.insCompany.agencyGetUserInfo(this.currentTreeNode.parentId).then(res=>{
|
|
|
- if(res.code==200){
|
|
|
- this.formList.forEach(e=>{
|
|
|
- if(e.prop=='userId'){
|
|
|
- e.options=res.data
|
|
|
- }
|
|
|
- })
|
|
|
- this.useroption=res.data
|
|
|
- }
|
|
|
- })
|
|
|
- this.$api.insCompany.queryRecommendAndPartner(this.currentTreeNode.parentId).then(res=>{
|
|
|
- this.sysPartnerOption=res.data
|
|
|
- })
|
|
|
-
|
|
|
+ this.$api.insCompany.agencyGetUserInfo(this.currentTreeNode.parentId).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.formList.forEach(e => {
|
|
|
+ if (e.prop == 'userId') {
|
|
|
+ e.options = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.useroption = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$api.insCompany.queryRecommendAndPartner(this.currentTreeNode.parentId).then(res => {
|
|
|
+ this.sysPartnerOption = res.data
|
|
|
+ })
|
|
|
+
|
|
|
this.dialogTitle = "新增";
|
|
|
- this.formData={
|
|
|
- deptName:this.currentTreeNode.name,
|
|
|
- deptId:this.currentTreeNode.id,
|
|
|
- comlevel:this.currentTreeNode.comlevel,
|
|
|
- source:this.currentTreeNode.managementSource,
|
|
|
+ this.formData = {
|
|
|
+ deptName: this.currentTreeNode.name,
|
|
|
+ deptId: this.currentTreeNode.id,
|
|
|
+ comlevel: this.currentTreeNode.comlevel,
|
|
|
+ source: this.currentTreeNode.managementSource,
|
|
|
}
|
|
|
this.dialogVisible = true;
|
|
|
- if(this.$refs["formData"]){
|
|
|
+ if (this.$refs["formData"]) {
|
|
|
this.$refs["formData"].resetFields();
|
|
|
}
|
|
|
},
|
|
|
@@ -363,24 +342,17 @@ export default {
|
|
|
// 点击事件
|
|
|
this.currentTreeNode = evt;
|
|
|
this.pageData.pageNum = 1;
|
|
|
- let data={
|
|
|
- deptId:this.currentTreeNode.id
|
|
|
- }
|
|
|
- this.findPage(data);
|
|
|
+ this.pageData.pageSize = 10;
|
|
|
+ this.currentTreeNodeId = this.currentTreeNode.id
|
|
|
+ this.findPage();
|
|
|
|
|
|
},
|
|
|
- suggestChange(e){
|
|
|
- this.formData.suggestName=''
|
|
|
- if(e){
|
|
|
- this.formData.suggestName=this.sysPartnerOption.find(val=>val.userId==e).userName
|
|
|
- }
|
|
|
- },
|
|
|
- userChange(val){
|
|
|
- if(val){
|
|
|
- this.formData.userId= this.useroption.find(e=>e.name==val).id
|
|
|
+ userChange(val) {
|
|
|
+ if (val) {
|
|
|
+ this.formData.userId = this.useroption.find(e => e.name == val).id
|
|
|
}
|
|
|
- else{
|
|
|
- this.formData.userId=''
|
|
|
+ else {
|
|
|
+ this.formData.userId = ''
|
|
|
}
|
|
|
},
|
|
|
handleDialogBefore(done) {
|
|
|
@@ -389,7 +361,7 @@ export default {
|
|
|
.then((_) => {
|
|
|
done();
|
|
|
})
|
|
|
- .catch((_) => {});
|
|
|
+ .catch((_) => { });
|
|
|
},
|
|
|
closeDialog() {
|
|
|
// 清空数据
|
|
|
@@ -401,7 +373,7 @@ export default {
|
|
|
this.$refs.formData.validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.$confirm("确认提交吗?", "提示", {}).then(() => {
|
|
|
-
|
|
|
+
|
|
|
if (this.dialogTitle == "编辑合伙人") {
|
|
|
this.$api.insCompany
|
|
|
.sysPartnerAdd(this.formData)
|
|
|
@@ -446,7 +418,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 下一步
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -468,14 +440,17 @@ export default {
|
|
|
.queryFrom .queryButton .el-form-item__content {
|
|
|
margin-left: 0px !important;
|
|
|
}
|
|
|
+
|
|
|
.disc {
|
|
|
-webkit-text-security: disc;
|
|
|
position: relative;
|
|
|
}
|
|
|
+
|
|
|
.none {
|
|
|
-webkit-text-security: none;
|
|
|
position: relative;
|
|
|
}
|
|
|
+
|
|
|
.icon {
|
|
|
color: #ccc;
|
|
|
position: absolute;
|