|
|
@@ -88,7 +88,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="推荐人" prop="suggestId">
|
|
|
- <el-select v-model="formData.suggestId" @change="suggestChange" clearable placeholder="请选择推荐人">
|
|
|
+ <el-select v-model="formData.suggestId" @change="suggestChange" :disabled="dialogTitle=='编辑'" clearable placeholder="请选择推荐人">
|
|
|
<el-option
|
|
|
v-for="val in sysPartnerOption"
|
|
|
:key="val.userId"
|
|
|
@@ -163,23 +163,37 @@ export default {
|
|
|
loading: true,
|
|
|
isPaginationShow: true,
|
|
|
isShowIndex: true,
|
|
|
- operationWidth:150,
|
|
|
+ operationWidth:180,
|
|
|
optBtns: [
|
|
|
{
|
|
|
type: "primary",
|
|
|
- label: "编辑",
|
|
|
+ label: "编辑合伙人",
|
|
|
perm: "sys:agent:edit",
|
|
|
icon: "fa fa-edit",
|
|
|
hide:(row)=>{
|
|
|
return row.type!=='1'
|
|
|
},
|
|
|
click: (row, index) => {
|
|
|
- return this.handleTableEdit(row);
|
|
|
+ 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'
|
|
|
+ },
|
|
|
icon: "el-icon-delete",
|
|
|
click: (row, index) => {
|
|
|
return this.handleTableDeleteFlag(row);
|
|
|
@@ -277,26 +291,15 @@ export default {
|
|
|
this.findPage(data);
|
|
|
},
|
|
|
//编辑
|
|
|
- async handleTableEdit(params) {
|
|
|
+ async handleTableEdit(params,type) {
|
|
|
this.$api.insCompany.queryRecommendAndPartner(params.parentId).then(res=>{
|
|
|
this.sysPartnerOption=res.data
|
|
|
})
|
|
|
- this.dialogTitle = "编辑";
|
|
|
+ this.dialogTitle =type=='1'?'编辑': "编辑合伙人";
|
|
|
this.dialogVisible= true
|
|
|
params.userName=params.name
|
|
|
params.userId=params.id
|
|
|
this.formData= JSON.parse(JSON.stringify(params))
|
|
|
-
|
|
|
- // this.$api.insCompany
|
|
|
- // .agencyQueryById(params.id)
|
|
|
- // .then((res) => {
|
|
|
- // if(res.code==200){
|
|
|
- // this.dialogTitle = "编辑";
|
|
|
- // this.dialogVisible= true
|
|
|
- // this.formData=res.data
|
|
|
- // }
|
|
|
-
|
|
|
- // });
|
|
|
},
|
|
|
// 删除单个人员
|
|
|
handleTableDeleteFlag(data) {
|
|
|
@@ -398,7 +401,9 @@ export default {
|
|
|
this.$refs.formData.validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.$confirm("确认提交吗?", "提示", {}).then(() => {
|
|
|
- this.$api.insCompany
|
|
|
+
|
|
|
+ if (this.dialogTitle == "编辑合伙人") {
|
|
|
+ this.$api.insCompany
|
|
|
.sysPartnerAdd(this.formData)
|
|
|
.then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
@@ -416,45 +421,26 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- // if (this.dialogTitle == "新增") {
|
|
|
- // this.$api.insCompany
|
|
|
- // .sysPartnerAdd(this.formData)
|
|
|
- // .then((res) => {
|
|
|
- // if (res.code == 200) {
|
|
|
- // this.$message({
|
|
|
- // message: "保存成功",
|
|
|
- // type: "success",
|
|
|
- // });
|
|
|
- // this.dialogVisible = false;
|
|
|
- // this.$refs["formData"].resetFields();
|
|
|
- // this.findPage();
|
|
|
- // } else {
|
|
|
- // this.$message({
|
|
|
- // message: `保存失败,请重新添加,(${res.msg})`,
|
|
|
- // type: "error",
|
|
|
- // });
|
|
|
- // }
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // this.$api.insCompany
|
|
|
- // .agencyEdit(this.formData)
|
|
|
- // .then((res) => {
|
|
|
- // if (res.code == 200) {
|
|
|
- // this.$message({
|
|
|
- // message: "编辑成功",
|
|
|
- // type: "success",
|
|
|
- // });
|
|
|
- // this.dialogVisible = false;
|
|
|
- // this.$refs["formData"].resetFields();
|
|
|
- // this.findPage();
|
|
|
- // } else {
|
|
|
- // this.$message({
|
|
|
- // message: `编辑失败,请重新添加,(${res.msg})`,
|
|
|
- // type: "error",
|
|
|
- // });
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
+ } else {
|
|
|
+ this.$api.insCompany
|
|
|
+ .sysPartnerEdit(this.formData)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: "编辑成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.$refs["formData"].resetFields();
|
|
|
+ this.findPage();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: `编辑失败,请重新添加,(${res.msg})`,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
});
|