|
|
@@ -3,7 +3,7 @@ |
|
|
|
<card-header class="company-node-view-header"> |
|
|
|
<template #title>{{node.label}}</template> |
|
|
|
<template #right> |
|
|
|
<el-dropdown v-if="!editing"> |
|
|
|
<el-dropdown v-if="!editing" trigger="click"> |
|
|
|
<el-button size="small">企业管理</el-button> |
|
|
|
<el-dropdown-menu slot="dropdown"> |
|
|
|
<el-dropdown-item> |
|
|
@@ -308,6 +308,34 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<div |
|
|
|
class="company-access" |
|
|
|
v-if="!editing && node.id" |
|
|
|
> |
|
|
|
<div class="form-subtitle">{{ isServiceProvider ? '平台权限' : '服务商权限' }}</div> |
|
|
|
<div class="node-form-field" v-if="!isServiceProvider"> |
|
|
|
<span>允许成为服务商</span> |
|
|
|
<el-switch |
|
|
|
:value="isServiceProvider" |
|
|
|
@change="toggleAccess('serviceProviderStatus')" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div class="node-form-field" v-if="isServiceProvider"> |
|
|
|
<span>允许访问模板控制台</span> |
|
|
|
<el-switch |
|
|
|
:value="canAccessTemplateConsole" |
|
|
|
@change="toggleAccess('templateConsoleStatus')" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div class="node-form-field" v-if="isServiceProvider"> |
|
|
|
<span>允许代理模板</span> |
|
|
|
<el-switch |
|
|
|
:value="canAccessTemplateProxy" |
|
|
|
@change="toggleAccess('templateProxyStatus')" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
@@ -389,6 +417,15 @@ export default { |
|
|
|
selectProvinceId() { |
|
|
|
return this.nodeDetailFormData.proviceID; |
|
|
|
}, |
|
|
|
isServiceProvider() { |
|
|
|
return this.nodeDetailData.serviceProviderStatus === 1; |
|
|
|
}, |
|
|
|
canAccessTemplateConsole() { |
|
|
|
return this.nodeDetailData.templateConsoleStatus === 1; |
|
|
|
}, |
|
|
|
canAccessTemplateProxy() { |
|
|
|
return this.nodeDetailData.templateProxyStatus === 1; |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
editing(v) { |
|
|
@@ -401,12 +438,12 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
node(nextNode) { |
|
|
|
this.nodeDetailFormData = {}; |
|
|
|
this.nodeDetailData = {}; |
|
|
|
if (nextNode && nextNode.id) { |
|
|
|
this.editing = false; |
|
|
|
this.loadCompanyInfo(nextNode.id); |
|
|
|
} else { |
|
|
|
this.nodeDetailFormData = {}; |
|
|
|
this.nodeDetailData = {}; |
|
|
|
this.editing = true; |
|
|
|
} |
|
|
|
}, |
|
|
@@ -470,7 +507,6 @@ export default { |
|
|
|
*/ |
|
|
|
updateCompanyInfo() { |
|
|
|
this.$refs["form"].validate(async (valid) => { |
|
|
|
console.log("valid", valid); |
|
|
|
if (!valid) return; |
|
|
|
this.nodeDetailFormData.modifyUserID = sessionStorage.userId; |
|
|
|
const res = await services.updateCompany(this.nodeDetailFormData); |
|
|
@@ -488,19 +524,14 @@ export default { |
|
|
|
duration: 2500, |
|
|
|
}); |
|
|
|
this.loadCompanyInfo(); |
|
|
|
this.nodeDetailData = this.nodeDetailFormData; |
|
|
|
// this.initCompanyRecord = {...this.nodeDetailFormData};//保存之后信息得同步 否则取消的时候回出问题 |
|
|
|
// this.el_formLabelcolor = "textlabelgray"; |
|
|
|
// this.editButtonGroup = 1; |
|
|
|
this.nodeDetailData = { ...this.nodeDetailFormData }; |
|
|
|
this.editing = false; |
|
|
|
// this.rightTitle = this.nodeDetailFormData.companyName; |
|
|
|
}); |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 新建企业,保存数据 |
|
|
|
*/ |
|
|
|
createCompany() { |
|
|
|
debugger; |
|
|
|
this.$refs["form"].validate(async (valid) => { |
|
|
|
if (!valid) return; |
|
|
|
this.nodeDetailFormData.createUserID = sessionStorage.userId; |
|
|
@@ -616,6 +647,48 @@ export default { |
|
|
|
}) |
|
|
|
.catch(() => {}); |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 服务商权限/控制台访问/模块代理控制 勾选项 |
|
|
|
*/ |
|
|
|
toggleAccess(field) { |
|
|
|
const nextFlag = !this.nodeDetailFormData[field]; |
|
|
|
const [positiveText, negativeText] = (() => { |
|
|
|
if (field === "serviceProviderStatus") { |
|
|
|
return ["允许成为服务商", "取消服务商资质"]; |
|
|
|
} |
|
|
|
if (field === "templateConsoleStatus") { |
|
|
|
return ["允许访问模板控制台", "取消模板控台的访问权限"]; |
|
|
|
} |
|
|
|
if (field === "templateProxyStatus") { |
|
|
|
return ["允许代理模板", "取消代理模板的权限"]; |
|
|
|
} |
|
|
|
return []; |
|
|
|
})(); |
|
|
|
this.$confirm(`确认${nextFlag ? positiveText : negativeText}?`, "", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning", |
|
|
|
}).then(async () => { |
|
|
|
this.nodeDetailFormData.modifyUserID = sessionStorage.userId; |
|
|
|
this.nodeDetailFormData[field] = nextFlag ? 1 : 0; |
|
|
|
const res = await services.updateCompany(this.nodeDetailFormData); |
|
|
|
// todo |
|
|
|
const flag = res.Code === 0; |
|
|
|
if (!flag) { |
|
|
|
this.$notify({ |
|
|
|
message: res.Msg, |
|
|
|
type: ["warning"], |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.$notify({ |
|
|
|
message: `变更成功。`, |
|
|
|
type: ["success"], |
|
|
|
duration: 2500, |
|
|
|
}); |
|
|
|
this.nodeDetailData = {...this.nodeDetailFormData}; |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
@@ -627,6 +700,7 @@ export default { |
|
|
|
padding: 0 24px; |
|
|
|
} |
|
|
|
&-body { |
|
|
|
position: relative; |
|
|
|
padding: 0 24px; |
|
|
|
} |
|
|
|
.form { |
|
|
@@ -645,6 +719,24 @@ export default { |
|
|
|
width: 50%; |
|
|
|
padding-right: 20px; |
|
|
|
} |
|
|
|
.company-access { |
|
|
|
&:before { |
|
|
|
content: ""; |
|
|
|
position: absolute; |
|
|
|
left: 0; |
|
|
|
right: 0; |
|
|
|
height: 1px; |
|
|
|
background-color: rgba(#000, 0.2); |
|
|
|
} |
|
|
|
.node-form-field { |
|
|
|
display: inline-flex; |
|
|
|
justify-content: space-between; |
|
|
|
flex-direction: row; |
|
|
|
height: 40px; |
|
|
|
line-height: 40px; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.dropdown-button { |
|
|
|