Commit 3186ef6c by wangzhihui

```

feat(api): 添加业务适配相关API接口并修复代码格式问题

- 添加getStaffSceneLabelList、findAllMerchantPageApi等业务适配API
- 修复api文件中method赋值的代码格式问题
- 统一长字符串的换行格式

feat(router): 更新路由配置添加分配门店功能并优化组件导入格式

- 在residentManage模块中添加分配门店路由配置
- 优化多个组件的_import调用格式,使其符合代码规范
- 调整路由配置中的缩进和逗号格式

feat(router): 更新销售管理模块路由配置并添加信息核验功能

- 重构salesManagement路由配置的格式和缩进
- 在客户管理中添加信息核验功能按钮
- 统一所有路由配置的代码格式规范
```
1 parent 1c9193a6
......@@ -358,7 +358,8 @@ export function getTemplateList(data = {}) {
// 督导
export function getStaffList(data) {
data.method = "dj.api.smartcarlife.digital.management.template.staff.ref.list";
data.method =
"dj.api.smartcarlife.digital.management.template.staff.ref.list";
return request(data, "post");
}
......@@ -394,15 +395,15 @@ export function getSummaryStaff(data) {
// 更新模版绑定员工
export function updateStaff(data) {
data.method
= "dj.api.smartcarlife.digital.management.template.staff.ref.update";
data.method =
"dj.api.smartcarlife.digital.management.template.staff.ref.update";
return request(data, "post");
}
// 导出未提交明细列表
export function exportSummary(data) {
data.method
= "dj.api.smartcarlife.digital.management.record.staff.summary.export";
data.method =
"dj.api.smartcarlife.digital.management.record.staff.summary.export";
return request(data, "post");
}
......@@ -410,7 +411,8 @@ export function exportSummary(data) {
export function getAllStaff(data) {
// data.method = 'dj.api.smartcarlife.staff.specificBusinessRolePerson.areaSupervision.pageConfigured'
// data.method = 'dj.api.smartcarlife.staff.specificBusinessRolePerson.areaSupervision.listConfigured'
data.method = "dj.api.smartcarlife.digital.management.supervision.staff.list";
data.method =
"dj.api.smartcarlife.digital.management.supervision.staff.list";
return request(data, "post");
}
......@@ -575,8 +577,8 @@ export function getPerformanceSalaryConfigAPI(data) {
}
// 批量新增或修改绩效工资扣减规则
export function updatePerformanceSalaryConfigAPI(data) {
data.method
= "dj.api.smartcarlife.performanceSalaryConfig.batchInsertOrUpdate";
data.method =
"dj.api.smartcarlife.performanceSalaryConfig.batchInsertOrUpdate";
return request(data, "post");
}
......@@ -669,8 +671,8 @@ export function staffBaseInfoPageList(data = {}) {
// 北森员工信息批量修改
export function updateBatchSalary(data) {
data.method
= "dj.api.smartcarlife.staffBaseInfo.salaryEffectiveRule.updateBatch";
data.method =
"dj.api.smartcarlife.staffBaseInfo.salaryEffectiveRule.updateBatch";
return request(data, "post");
}
......@@ -691,7 +693,7 @@ export function getCommissionListApi(data = {}) {
}
// 获取督导管理列表数据
export function getSupervisorListApi(data = {}) {
data.method = "dj.api.supervisor.manage.page"
data.method = "dj.api.supervisor.manage.page";
return request(data, "post");
}
// 获取督导管理汇总数据
......@@ -706,8 +708,8 @@ export function getWeeklyRangesApi(data = {}) {
}
// 获取督导详情数据
export function getSupervisorDetailApi(data = {}) {
data.method = "dj.api.supervisor.manage.detail.staff.page"
return request(data, "post")
data.method = "dj.api.supervisor.manage.detail.staff.page";
return request(data, "post");
}
// 获取督导详情汇总数据
export function getSupervisorDetailSummaryApi(data = {}) {
......@@ -787,3 +789,42 @@ export function listExcellentCaseCategories(data = {}) {
return request(data, "post");
}
//适配业务
export function getStaffSceneLabelList(data = {}) {
data.method = "dj.api.smartcarlife.scene.getScenesByParams";
return request(data, "post");
}
export function findAllMerchantPageApi(data = {}) {
data.method = "dj.api.scenemerchantref.findAllMerchantPage";
return request(data, "post");
}
export function findAllSceneByMerchantIdApi(data = {}) {
data.method = "dj.api.scenemerchantref.findAllSceneByMerchantId";
return request(data, "post");
}
export function assignStoreApi(data = {}) {
data.method = "j.api.smartcarlife.staffBaseInfo.account.merchant.assign";
return request(data, "post");
}
//北森岗位
export function beiSenJobPostPageApi(data = {}) {
data.method = "dj.api.smartcarlife.staffBaseInfo.beiSenJobPost.page";
return request(data, "post");
}
// 北森账号列表
export function beiSenEmployeePageApi(data = {}) {
data.method = "dj.api.smartcarlife.staffBaseInfo.beiSenEmployee.page";
return request(data, "post");
}
// 手动同步指定北森账号信息
export function beiSenEmployeeSingleSyncApi(data = {}) {
data.method = "dj.api.smartcarlife.staffBaseInfo.single.beiSen.sync";
return request(data, "post");
}
//账号信息-禁用账号
export function beiSenEmployeeDisableApi(data = {}) {
data.method = "dj.api.smartcarlife.staffBaseInfo.account.disable";
return request(data, "post");
}
......@@ -218,6 +218,12 @@ export const routerName = {
],
handle: "handleConfigurationPerformance",
},
{
authId: "9120516",
parentId: "91205",
label: "分配门店",
handle: "handleAssignStore",
},
],
component: _import("residentManage/inStoreManage/inStoreControlList"),
},
......@@ -243,7 +249,9 @@ export const routerName = {
cache: false,
activePath: "/inStoreManage",
},
component: _import("residentManage/inStoreManage/configurationPerformance"),
component: _import(
"residentManage/inStoreManage/configurationPerformance"
),
},
// 91206: {
// path: "/staffManage",
......@@ -828,7 +836,9 @@ export const routerName = {
sideHidden: true,
activePath: "/salaryPerformance",
},
component: _import("residentManage/salaryPerformance/performanceScheme/view/index"),
component: _import(
"residentManage/salaryPerformance/performanceScheme/view/index"
),
},
912120102: {
path: "/configureCommissionPlan",
......@@ -840,7 +850,9 @@ export const routerName = {
sideHidden: true,
activePath: "/salaryPerformance",
},
component: _import("residentManage/salaryPerformance/performanceScheme/view/configureCommissionPlan"),
component: _import(
"residentManage/salaryPerformance/performanceScheme/view/configureCommissionPlan"
),
},
912120103: {
path: "/configureStoreCommissionPlan",
......@@ -852,7 +864,9 @@ export const routerName = {
sideHidden: true,
activePath: "/salaryPerformance",
},
component: _import("residentManage/salaryPerformance/performanceScheme/view/configureStoreCommissionPlan"),
component: _import(
"residentManage/salaryPerformance/performanceScheme/view/configureStoreCommissionPlan"
),
},
91213: {
path: "/inStorePoints",
......@@ -1286,7 +1300,9 @@ export const routerName = {
parentId: "91223",
activePath: "/recruitmentManagement",
},
component: _import("residentManage/recruitmentManagement/addRecruitment"),
component: _import(
"residentManage/recruitmentManagement/addRecruitment"
),
},
912230601: {
path: "/disposeRecruitment",
......@@ -1298,7 +1314,7 @@ export const routerName = {
activePath: "/recruitmentManagement",
},
component: _import(
"residentManage/recruitmentManagement/disposeRecruitment",
"residentManage/recruitmentManagement/disposeRecruitment"
),
},
912230301: {
......@@ -1310,7 +1326,9 @@ export const routerName = {
parentId: "91223",
activePath: "/recruitmentManagement",
},
component: _import("residentManage/recruitmentManagement/lookRecruitment"),
component: _import(
"residentManage/recruitmentManagement/lookRecruitment"
),
},
91226: {
path: "/outstandingCase",
......@@ -1363,7 +1381,9 @@ export const routerName = {
parentId: "912",
cache: false,
},
component: _import("residentManage/supervisionManagement/supervision/index"),
component: _import(
"residentManage/supervisionManagement/supervision/index"
),
auth: [
{
authId: "9122401",
......@@ -1375,10 +1395,10 @@ export const routerName = {
authId: "912240101",
name: "查看详情",
parentId: "91224",
}
},
],
}
]
},
],
},
912240101: {
path: "/supervisionDetail",
......@@ -1389,7 +1409,9 @@ export const routerName = {
parentId: "91224",
activePath: "/supervisionManagement",
},
component: _import("residentManage/supervisionManagement/supervision/detail"),
component: _import(
"residentManage/supervisionManagement/supervision/detail"
),
},
91225: {
path: "/supervisionMissionManagement",
......@@ -1398,7 +1420,7 @@ export const routerName = {
title: "督导任务管理",
authId: "91225",
parentId: "912",
cache: false
cache: false,
},
auth: [
{
......@@ -1411,11 +1433,13 @@ export const routerName = {
authId: "912250101",
name: "详情",
parentId: "91225",
}
},
],
}
},
],
component: _import("residentManage/supervisionManagement/mission/index")
component: _import(
"residentManage/supervisionManagement/mission/index"
),
},
912250101: {
path: "/supervisionMissionDetail",
......@@ -1426,6 +1450,8 @@ export const routerName = {
parentId: "91225",
activePath: "/supervisionMissionManagement",
},
component: _import("residentManage/supervisionManagement/mission/detail"),
}
component: _import(
"residentManage/supervisionManagement/mission/detail"
),
},
};
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
const _import = require("@/libs/util.import." + process.env.NODE_ENV);
export const routerName = {
921: {
path: "/salesManagement",
name: "salesManagement",
meta: {
title: "销售管理",
authId: "921",
parentId: "1",
cache: false
}
},
92101: {
path: "/customer",
name: "customer",
meta: {
title: "客户管理",
authId: "92101",
parentId: "921",
cache: false
},
auth: [
{
authId: "9210101",
parentId: "92101",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9210102",
parentId: "92101",
label: "首次绑定",
handle: "handleEdit",
ruleObj: {
attr: "potentialCustomersStatus",
rule: {
3: "首次绑定",
4: "重新绑定"
}
}
},
{
authId: "9210103",
parentId: "92101",
label: "详情",
handle: "handleDetail"
}
],
component: _import("salesManagement/customer/index")
},
92102: {
path: "/organize",
name: "organize",
meta: {
title: "组织架构管理",
authId: "92102",
parentId: "921",
cache: false
},
auth: [
{
authId: "9210201",
parentId: "92102",
label: "编辑",
handle: "handleEdit",
addRoutePath: [
{
authId: "92103",
name: "编辑",
parentId: "92102"
}
]
}
],
component: _import("salesManagement/organize/index")
},
92103: {
path: "/editOrganize",
name: "editOrganize",
meta: {
title: "编辑",
authId: "92103",
parentId: "92102",
sideHidden: true,
activePath: "/editOrganize"
},
component: _import("salesManagement/organize/editOrganize")
},
92104: {
path: "/availableInStores",
name: "availableInStores",
meta: {
title: "门店上架",
authId: "92104",
parentId: "921",
cache: false
},
auth: [
{
authId: "9210401",
parentId: "92104",
label: "嘀加上架与销售合同",
handle: "navigateToApprovalPage",
category: "Button",
type: 'primary',
addRoutePath: [
{
authId: "9210403",
name: "嘀加上架与销售合同",
parentId: "92104"
}
]
},
{
authId: "9210402",
parentId: "92104",
label: "嘀加上架修改",
handle: "navigateToApprovalPage",
category: "Button",
type: 'primary',
addRoutePath: [
{
authId: "9210404",
name: "嘀加上架修改",
parentId: "92104"
}
]
},
],
component: _import("salesManagement/availableInStores/index")
},
9210403: {
path: "/tigaListingAndSalesContract",
name: "tigaListingAndSalesContract",
meta: {
title: "嘀加上架与销售合同",
authId: "9210403",
parentId: "92104",
activePath: "/tigaListingAndSalesContract",
cache: false
},
auth: [],
component: _import("salesManagement/availableInStores/tigaListingAndSalesContract/index")
},
9210404: {
path: "/addAndModifyTheListing",
name: "addAndModifyTheListing",
meta: {
title: "嘀加上架修改",
authId: "9210404",
parentId: "92104",
activePath: "/addAndModifyTheListing",
cache: false
},
auth: [],
component: _import("salesManagement/availableInStores/tigaListingAndSalesContract/index")
}
}
921: {
path: "/salesManagement",
name: "salesManagement",
meta: {
title: "销售管理",
authId: "921",
parentId: "1",
cache: false,
},
},
92101: {
path: "/customer",
name: "customer",
meta: {
title: "客户管理",
authId: "92101",
parentId: "921",
cache: false,
},
auth: [
{
authId: "9210101",
parentId: "92101",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport",
},
{
authId: "9210102",
parentId: "92101",
label: "首次绑定",
handle: "handleEdit",
ruleObj: {
attr: "potentialCustomersStatus",
rule: {
3: "首次绑定",
4: "重新绑定",
},
},
},
{
authId: "9210103",
parentId: "92101",
label: "详情",
handle: "handleDetail",
},
{
authId: "9210104",
parentId: "92101",
label: "信息核验",
handle: "handleInfoCheck",
},
],
component: _import("salesManagement/customer/index"),
},
92102: {
path: "/organize",
name: "organize",
meta: {
title: "组织架构管理",
authId: "92102",
parentId: "921",
cache: false,
},
auth: [
{
authId: "9210201",
parentId: "92102",
label: "编辑",
handle: "handleEdit",
addRoutePath: [
{
authId: "92103",
name: "编辑",
parentId: "92102",
},
],
},
],
component: _import("salesManagement/organize/index"),
},
92103: {
path: "/editOrganize",
name: "editOrganize",
meta: {
title: "编辑",
authId: "92103",
parentId: "92102",
sideHidden: true,
activePath: "/editOrganize",
},
component: _import("salesManagement/organize/editOrganize"),
},
92104: {
path: "/availableInStores",
name: "availableInStores",
meta: {
title: "门店上架",
authId: "92104",
parentId: "921",
cache: false,
},
auth: [
{
authId: "9210401",
parentId: "92104",
label: "嘀加上架与销售合同",
handle: "navigateToApprovalPage",
category: "Button",
type: "primary",
addRoutePath: [
{
authId: "9210403",
name: "嘀加上架与销售合同",
parentId: "92104",
},
],
},
{
authId: "9210402",
parentId: "92104",
label: "嘀加上架修改",
handle: "navigateToApprovalPage",
category: "Button",
type: "primary",
addRoutePath: [
{
authId: "9210404",
name: "嘀加上架修改",
parentId: "92104",
},
],
},
],
component: _import("salesManagement/availableInStores/index"),
},
9210403: {
path: "/tigaListingAndSalesContract",
name: "tigaListingAndSalesContract",
meta: {
title: "嘀加上架与销售合同",
authId: "9210403",
parentId: "92104",
activePath: "/tigaListingAndSalesContract",
cache: false,
},
auth: [],
component: _import(
"salesManagement/availableInStores/tigaListingAndSalesContract/index"
),
},
9210404: {
path: "/addAndModifyTheListing",
name: "addAndModifyTheListing",
meta: {
title: "嘀加上架修改",
authId: "9210404",
parentId: "92104",
activePath: "/addAndModifyTheListing",
cache: false,
},
auth: [],
component: _import(
"salesManagement/availableInStores/tigaListingAndSalesContract/index"
),
},
};
<!-- 分配门店 -->
<template>
<baseDialog :dialog-config="dialogConfig" :config="config" :is-show.sync="visible" @handleClick="handleAddConfirm">
<div class="detail-dialog">
<el-form ref="editFormRef" :model="infoForm" :rules="formRules" label-width="110px">
<div style="background: #f8f8f8; padding: 15px; margin-bottom: 20px; border-radius: 4px;">
<h4 style="margin-top: 0; margin-bottom: 15px; font-size: 14px;">基本信息</h4>
<el-row>
<el-col :span="12">
<span style="color: #666;">员工姓名:</span><span>{{ detail.staffName }}</span>
</el-col>
<el-col :span="12">
<span style="color: #666;">手机号:</span><span>{{ detail.staffPhone }}</span>
</el-col>
</el-row>
</div>
<el-form-item label="入职门店:" prop="merchantId">
<el-select v-model="infoForm.merchantId" placeholder="请选择入职门店" style="width: 432px" remote
reserve-keyword filterable :remote-method="remoteMethod" @change="changeMerchant">
<el-option v-for="(item, index) in merchantList" :key="index" :label="item.merchantName"
:value="item.merchantId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="业务场景:" prop="sceneCodeList">
<el-checkbox-group v-model="infoForm.sceneCodeList" @change="changeStaffSceneLabel">
<div v-for="item in sceneOptionList" :key="item.baseSceneCode" style="margin-bottom: 8px;">
<el-checkbox :label="item.baseSceneCode">{{ item.baseSceneCodeName }}</el-checkbox>
</div>
</el-checkbox-group>
</el-form-item>
<el-form-item label="关联园区店:">
<span>{{ relatedYqMerchantNames }}</span>
</el-form-item>
</el-form>
</div>
</baseDialog>
</template>
<script>
import { findAllMerchantPageApi, findAllSceneByMerchantIdApi, assignStoreApi } from "@api/resident";
export default {
name: "AssignStoreDialog",
props: {
visibleSync: {
type: Boolean,
default: false,
},
detail: {
type: Object,
default: () => ({}),
},
},
data() {
return {
config: {
showClose: true,
appendToBody: false, // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
isShowFooter: true,
cancel_name: "取 消",
confirm_name: "确定分配",
},
dialogConfig: {
title: "分配门店",
width: "720px",
},
infoForm: {
merchantId: "",
merchantName: "",
sceneCodeList: [],
},
formRules: {
merchantId: [
{ required: true, message: "请选择入职门店", trigger: ["blur", "change"] },
],
sceneCodeList: [
{ type: "array", required: true, message: "请选择业务场景", trigger: ["blur", "change"] },
],
},
merchantList: [],
sceneOptionList: [],
relatedYqMerchantNames: "",
};
},
computed: {
visible: {
get() {
return this.visibleSync;
},
set(newVal) {
this.$emit("update:visibleSync", newVal);
},
},
},
mounted() {
// Initialize form with defaults if available
const initialMerchantName = this.detail.merchantName || (this.detail.merchantList && this.detail.merchantList.length > 0 ? this.detail.merchantList[0].merchantName : "");
const initialMerchantId = this.detail.merchantId || (this.detail.merchantList && this.detail.merchantList.length > 0 ? this.detail.merchantList[0].merchantId : "");
if (initialMerchantName) {
this.merchantList = [{ merchantId: initialMerchantId, merchantName: initialMerchantName }];
this.infoForm.merchantId = initialMerchantId;
this.infoForm.merchantName = initialMerchantName;
this.getSceneList(initialMerchantId);
} else {
this.remoteMethod("");
}
},
methods: {
remoteMethod(query) {
const params = {
currentPage: 1,
pageSize: 50,
merchantName: query || "",
};
findAllMerchantPageApi(params).then((res) => {
this.merchantList = res.list || [];
});
},
changeMerchant(val) {
const selected = this.merchantList.find((item) => item.merchantId === val);
this.infoForm.merchantName = selected ? selected.merchantName : "";
this.infoForm.sceneCodeList = [];
this.sceneOptionList = [];
this.updateRelatedYqMerchantNames();
if (val) {
this.getSceneList(val);
}
},
getSceneList(merchantId) {
findAllSceneByMerchantIdApi({ merchantId }).then((res) => {
this.sceneOptionList = res || [];
});
},
changeStaffSceneLabel() {
this.updateRelatedYqMerchantNames();
},
updateRelatedYqMerchantNames() {
const selectedScenes = this.sceneOptionList.filter(item =>
this.infoForm.sceneCodeList.includes(item.baseSceneCode)
);
const names = [];
selectedScenes.forEach(scene => {
if (scene.yqMerchant && scene.yqMerchant.merchantName) {
if (!names.includes(scene.yqMerchant.merchantName)) {
names.push(scene.yqMerchant.merchantName);
}
}
});
this.relatedYqMerchantNames = names.join(",");
},
handleAddConfirm() {
this.$refs.editFormRef.validate((valid) => {
if (valid) {
const selectedScenes = this.sceneOptionList.filter(item =>
this.infoForm.sceneCodeList.includes(item.baseSceneCode)
);
const sceneList = selectedScenes.map(scene => {
return {
baseSceneCode: scene.baseSceneCode,
sceneType: scene.sceneType,
yqMerchantList: scene.yqMerchant ? [{
yqMerchantName: scene.yqMerchant.merchantName,
yqMerchantId: scene.yqMerchant.merchantId
}] : []
};
});
const params = {
staffId: this.detail.staffId || this.detail.id,
merchantName: this.infoForm.merchantName,
merchantId: this.infoForm.merchantId,
sceneList: sceneList
};
assignStoreApi(params).then(() => {
this.$message.success("分配门店成功");
this.$emit("refreshTable");
this.visible = false;
});
}
});
},
},
};
</script>
<style scoped>
.detail-dialog {
padding: 0 20px;
}
</style>
<!-- 禁用账号弹窗 -->
<template>
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible" @handleClick="confirmDisable" :config="baseDialogConfig">
<div class="disable-dialog-content">
<div style="background: #f8f8f8; padding: 15px; border-radius: 4px; margin-bottom: 20px;">
<div style="font-weight: bold; margin-bottom: 10px; color: #333; font-size: 14px;">基本信息</div>
<el-row style="font-size: 14px; line-height: 28px;">
<el-col :span="12">
<span style="color: #666;">员工姓名:</span><span style="color: #333;">{{ staffName }}</span>
</el-col>
<el-col :span="12">
<span style="color: #666;">业务场景:</span><span style="color: #333;">{{ formattedSceneLabel }}</span>
</el-col>
</el-row>
<el-row style="font-size: 14px; line-height: 28px;">
<el-col :span="24">
<span style="color: #666;">门店:</span><span style="color: #333;">{{ merchantName }}</span>
</el-col>
</el-row>
</div>
<div style="display: flex; align-items: flex-start;">
<i class="el-icon-warning" style="color: #ff9900; font-size: 24px; margin-right: 12px; margin-top: 2px;"></i>
<div>
<div style="font-size: 16px; font-weight: bold; color: #333; margin-bottom: 8px;">确认禁用该员工的门店账号?</div>
<div style="font-size: 14px; color: #999;">禁用后,该账号将无法登录业务端开展业务。</div>
</div>
</div>
</div>
</baseDialog>
</template>
<script>
import { beiSenEmployeeDisableApi } from "@/api/resident";
export default {
name: "DisableAccountDialog",
props: {
disableDialogVisible: {
type: Boolean,
default: false,
},
currentRow: {
type: Object,
default: () => null,
},
staffName: {
type: String,
default: "",
},
formattedSceneLabel: {
type: String,
default: "",
}
},
data() {
return {
dialogConfig: {
title: "禁用账号",
width: "600px",
},
};
},
computed: {
visible: {
get() {
return this.disableDialogVisible;
},
set(newVal) {
this.$emit("dialogClose", { flag: newVal, attrName: "disableDialogVisible" });
},
},
baseDialogConfig() {
return {
confirmText: "禁用",
cancelText: "取消",
}
},
merchantName() {
return this.currentRow ? this.currentRow.merchantName : '';
}
},
methods: {
confirmDisable() {
if (!this.currentRow) return;
const row = this.currentRow;
beiSenEmployeeDisableApi({ accountId: row.id }).then(() => {
this.$message.success('账号已禁用');
this.visible = false;
this.$emit("refreshDetail");
}).catch(() => {
this.visible = false;
this.$emit("disableFailed", row);
});
},
},
};
</script>
<style scoped>
.disable-dialog-content {
padding: 0 20px;
}
</style>
<!-- 北森同步弹窗 -->
<template>
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible" @handleClick="submitSyncBeiSen"
:config="baseDialogConfig">
<div class="sync-beisen-dialog">
<div style="display: flex; gap: 10px; margin-bottom: 20px;">
<el-input v-model="syncSearchForm.staffName" placeholder="请输入姓名" style="width: 200px" clearable></el-input>
<el-input v-model="syncSearchForm.mobilePhone" placeholder="请输入手机号" style="width: 200px"
clearable></el-input>
<el-button type="primary" @click="handleSyncSearch">查询</el-button>
</div>
<div v-loading="syncLoading"
style="min-height: 100px; max-height: 400px; overflow-y: auto; padding: 10px; border: 1px solid #EBEEF5; border-radius: 4px;">
<div v-if="!syncResultList.length" style="text-align: center; color: #909399; margin-top: 40px;">
<i class="el-icon-document" style="font-size: 40px; margin-bottom: 10px; display: block;"></i>
未查询到匹配的北森员工数据
</div>
<el-radio-group v-else v-model="selectedBeiSenUserId"
style="display: flex; flex-direction: column; gap: 15px;">
<el-radio v-for="item in syncResultList" :key="item.userID" :label="item.userID">
{{ item.name }} | {{ item.mobilePhone }}
</el-radio>
</el-radio-group>
</div>
</div>
</baseDialog>
</template>
<script>
import { beiSenEmployeePageApi, beiSenEmployeeSingleSyncApi } from "@/api/resident";
export default {
name: "SyncBeiSenDialog",
props: {
syncBeiSenVisible: {
type: Boolean,
default: false,
},
detail: {
type: Object,
default: () => ({}),
},
},
data() {
return {
dialogConfig: {
title: "北森同步",
width: "600px",
},
syncSearchForm: {
staffName: "",
mobilePhone: "",
},
syncLoading: false,
syncResultList: [],
selectedBeiSenUserId: "",
};
},
computed: {
visible: {
get() {
return this.syncBeiSenVisible;
},
set(newVal) {
this.$emit("dialogClose", { flag: newVal, attrName: "syncBeiSenVisible" });
},
},
baseDialogConfig() {
return {
showClose: true,
appendToBody: false, // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
isShowFooter: true,
confirm_name: "提交同步",
cancel_name: "取 消"
}
}
},
mounted() {
// 默认查询
// this.handleSyncSearch();
},
methods: {
handleSyncSearch() {
if (!this.syncSearchForm.staffName && !this.syncSearchForm.mobilePhone) {
this.syncResultList = [];
return;
}
this.syncLoading = true;
const params = {
staffName: this.syncSearchForm.staffName,
mobilePhone: this.syncSearchForm.mobilePhone,
pageNum: 1,
pageSize: 9999
};
beiSenEmployeePageApi(params).then(res => {
this.syncLoading = false;
this.syncResultList = res.list || [];
this.selectedBeiSenUserId = "";
}).catch(() => {
this.syncLoading = false;
});
},
submitSyncBeiSen() {
if (!this.selectedBeiSenUserId) return;
const params = {
staffId: this.detail.id, // detail is fetched from staffBaseInfoPageList/getDetail, usually has id
beiSenUserID: this.selectedBeiSenUserId
};
beiSenEmployeeSingleSyncApi(params).then(() => {
this.$message.success("同步成功");
this.visible = false;
this.$emit("refreshDetail");
});
},
},
};
</script>
<style scoped>
.sync-beisen-dialog {
padding: 0 20px;
}
</style>
......@@ -3,7 +3,8 @@
<div>
<d2-container>
<div class="header" slot="header" style="padding: 10px 20px;">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="labelWidth" :form-data="showFormData">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="labelWidth"
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
......@@ -24,7 +25,8 @@
<auth-button category="Button" />
</div>
</div>
<d2-table ref="customerTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams" :noLoading="noLoading" :before-search-fn="beforeSearchFn" @apiFinish="apiFinish">
<d2-table ref="customerTable" :get-list-api="getListApi" :search-form="searchFormSearch"
:table-params="tableParams" :noLoading="noLoading" :before-search-fn="beforeSearchFn" @apiFinish="apiFinish">
<div slot="brandList" slot-scope="scope">
<el-tooltip v-if="scope.scope.brandList && scope.scope.brandList.length" effect="dark" placement="top">
<div slot="content" class="tooltip-content-max">
......@@ -36,9 +38,16 @@
</div>
<div slot="auth-button" slot-scope="scope" width="400">
<!-- 首次绑定 / 重新绑定 -->
<span v-if="[3, 4].includes(scope.scope.potentialCustomersStatus)" style="margin-right: 10px">
<span
v-if="[4].includes(scope.scope.potentialCustomersStatus) || ([3].includes(scope.scope.potentialCustomersStatus) && scope.scope.isBind == '1')"
style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9210102']" />
</span>
<!-- 信息核验 -->
<span v-if="([3].includes(scope.scope.potentialCustomersStatus) && scope.scope.isBind == '0')"
style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9210104']" />
</span>
<!-- 详情 -->
<span>
<auth-button :data="scope.scope" :show-btn-ids="['9210103']" />
......@@ -48,13 +57,19 @@
</div>
</d2-container>
<!-- 查看 -->
<customer-detail-dialog :detail-visible="detailVisible" :record-info="recordInfo" v-if="detailVisible" @dialogClose="dialogClose" />
<customer-detail-dialog :detail-visible="detailVisible" :record-info="recordInfo" v-if="detailVisible"
@dialogClose="dialogClose" />
<!-- 首次绑定 / 重新绑定 -->
<glsk-form-dialog v-if="editVisible" :selectVisible="editVisible" :dialogConfig="editDialogConfig" label-width="104px" dialog-width="520px" :formRules="editRules" :editData="editData" :editFormData="editFormData" :slotArr="slotArr" :base-data="baseData" @handleClose="editVisible = false" @handleConfirm="handleEditConfirm">
<glsk-form-dialog v-if="editVisible" :selectVisible="editVisible" :dialogConfig="editDialogConfig" label-width="104px"
dialog-width="520px" :formRules="editRules" :editData="editData" :editFormData="editFormData" :slotArr="slotArr"
:base-data="baseData" @handleClose="editVisible = false" @handleConfirm="handleEditConfirm">
<template #merchantMutilHtml>
<el-select v-model="editData[editFormData[1].name]" :placeholder="editFormData[1].placeholder" @change="editFormData[1].changeAttr" style="width: 274px" filterable remote reserve-keyword @visible-change="(event) => selectVisibleChange(event, editFormData[1])" :remote-method="(event) => remoteMethod(event, editFormData[1].searchKey, 'store')
" v-el-select-loadmore="interestsLoadmoreMerchant">
<el-option v-for="subItem in editFormData[1].optionList" :key="subItem[editFormData[1].optionId]" :label="subItem[editFormData[1].optionLabel]" :value="subItem[editFormData[1].optionId]">
<el-select v-model="editData[editFormData[1].name]" :placeholder="editFormData[1].placeholder"
@change="editFormData[1].changeAttr" style="width: 274px" filterable remote reserve-keyword
@visible-change="(event) => selectVisibleChange(event, editFormData[1])" :remote-method="(event) => remoteMethod(event, editFormData[1].searchKey, 'store')
" v-el-select-loadmore="interestsLoadmoreMerchant">
<el-option v-for="subItem in editFormData[1].optionList" :key="subItem[editFormData[1].optionId]"
:label="subItem[editFormData[1].optionLabel]" :value="subItem[editFormData[1].optionId]">
</el-option>
</el-select>
</template>
......@@ -92,10 +107,6 @@ export default {
name: "3"
},
{
label: '已绑定',
name: "4"
},
{
label: '未签约',
name: "2"
}
......@@ -111,7 +122,10 @@ export default {
flowSituation: '',
salesPersonId: '',
signedDate: '',
expectedDate: ''
expectedDate: '',
isBind: '',
merchantName: '',
storeName: ''
},
searchFormSearch: {},
showFormData: [{
......@@ -215,14 +229,28 @@ export default {
type: 'datePicker',
// pickerOptions: 'rangePickerOptions',
isClear: true
}, {
},
{
label: '信息核验',
name: 'isBind',
type: 'select',
optionList: [
{ value: '', label: '全部' },
{ value: '1', label: '是' },
{ value: '0', label: '否' }
],
optionId: 'value',
optionLabel: 'label',
isClear: true
},
{
label: '门店名称',
name: 'storeName',
type: 'input',
maxlength: '50',
isClear: true
}, {
label: '关联商户',
label: '商户名称',
name: 'merchantName',
type: 'input',
maxlength: '50',
......@@ -328,6 +356,14 @@ export default {
4: "greenSpot"
}[cellValue.potentialCustomersStatus]
}
}, {
label: '信息核验',
prop: 'isBind',
formatter: (cellValue) => {
if (cellValue.isBind === 1) return '是'
if (cellValue.isBind === 0) return '否'
return '-'
}
}]
},
baseData: {
......@@ -484,7 +520,10 @@ export default {
apiFinish() {
this.tableLoading = false
},
// 信息核验
handleInfoCheck() {
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
......@@ -647,7 +686,10 @@ export default {
flowSituation: '',
salesPersonId: '',
signedDate: '',
expectedDate: ''
expectedDate: '',
isBind: '',
storeName: '',
merchantName: '',
}
this.baseData.cityList = []
const cityIdx = this.showFormData.findIndex((item) => item.name == 'cityId')
......@@ -719,6 +761,7 @@ export default {
max-height: 320px;
overflow-y: scroll;
}
.count-txt {
font-weight: 700;
color: #2a58ad;
......@@ -730,6 +773,7 @@ export default {
box-sizing: border-box;
margin-right: 10px;
}
.fields-txt {
width: 346px;
display: inline-block;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!