|
|
@@ -57,8 +57,7 @@
|
|
|
<el-form-item label="部门" prop="belongingDepartmentId" class="custom-form-item">
|
|
|
<el-input v-model="queryParams.belongingDepartmentId" placeholder="请输入部门" clearable />
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ </el-col> </el-row>
|
|
|
|
|
|
<!-- 第三行 -->
|
|
|
<el-row :gutter="20" class="mt-15">
|
|
|
@@ -101,9 +100,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="tools-right">
|
|
|
- <el-button type="primary" icon="Back" class="blue-btn">退回到客户公海池</el-button>
|
|
|
- <el-button type="primary" icon="Switch" class="blue-btn">转移业务员</el-button>
|
|
|
- <el-button type="primary" icon="UserFilled" class="blue-btn">转移客服人员</el-button>
|
|
|
+ <el-button type="primary" icon="Back" class="blue-btn" @click="handleReturnHighSeas">退回到客户公海池</el-button>
|
|
|
+ <el-button type="primary" icon="Switch" class="blue-btn" @click="handleTransferSales">转移业务员</el-button>
|
|
|
+ <el-button type="primary" icon="UserFilled" class="blue-btn" @click="handleTransferSupport">转移客服人员</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -146,6 +145,26 @@
|
|
|
/>
|
|
|
</el-card>
|
|
|
|
|
|
+ <!-- 转移人员弹窗 -->
|
|
|
+ <el-dialog :title="transferDialog.title" v-model="transferDialog.visible" width="400px" append-to-body>
|
|
|
+ <el-form ref="transferRef" :model="transferForm" :rules="transferRules" label-width="100px">
|
|
|
+ <el-form-item label="选择人员:" prop="staffId">
|
|
|
+ <template #label>
|
|
|
+ <span style="color: #f56c6c; margin-right: 4px;">*</span>选择人员:
|
|
|
+ </template>
|
|
|
+ <el-select v-model="transferForm.staffId" placeholder="请选择" filterable style="width: 100%">
|
|
|
+ <el-option v-for="item in staffOptions" :key="item.staffId" :label="item.staffName" :value="item.staffId" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="transferDialog.visible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitTransfer">确 认</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 客户详情组件 (有效客户专用) -->
|
|
|
<valid-customer-info ref="detailRef" />
|
|
|
</div>
|
|
|
@@ -154,7 +173,7 @@
|
|
|
<script setup name="CustomerValid">
|
|
|
import { ref, reactive, onMounted, getCurrentInstance } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
-import { listValidCustomer, releaseToPool, listCompanyOption } from "@/api/customer/customerInfo/index";
|
|
|
+import { listValidCustomer, releaseToPool, listCompanyOption, transferSalesPerson, transferServiceStaff } from "@/api/customer/customerInfo/index";
|
|
|
import { listIndustryCategory } from "@/api/customer/industryCategory";
|
|
|
import { listLevel } from "@/api/customer/customerLevel";
|
|
|
import { selectStaffOptionList } from "@/api/customer/crmStaff";
|
|
|
@@ -241,28 +260,68 @@ const handleReturnHighSeas = () => {
|
|
|
if (ids.value.length === 0) { proxy.$modal.msgWarning("请选择要操作的数据"); return; }
|
|
|
proxy.$modal.confirm(`是否将选中的${ids.value.length}个客户退回到客户公海池?`).then(() => {
|
|
|
loading.value = true;
|
|
|
- const promises = ids.value.map(id => releaseToPool(id, "有效客户退回"));
|
|
|
- Promise.all(promises).then(() => {
|
|
|
+ // 一次性调用批量接口
|
|
|
+ releaseToPool(ids.value, "有效客户退回").then(() => {
|
|
|
proxy.$modal.msgSuccess("退回成功");
|
|
|
- getList();
|
|
|
+ // 跳转到公海池页面
|
|
|
+ router.push('/customer/highseas');
|
|
|
}).catch(() => {
|
|
|
loading.value = false;
|
|
|
});
|
|
|
}).catch(() => {});
|
|
|
};
|
|
|
|
|
|
+const transferDialog = reactive({
|
|
|
+ visible: false,
|
|
|
+ title: '',
|
|
|
+ type: '' // 'sales' 或 'support'
|
|
|
+});
|
|
|
+const transferForm = reactive({
|
|
|
+ staffId: undefined
|
|
|
+});
|
|
|
+const transferRules = {
|
|
|
+ staffId: [{ required: true, message: '请选择人员', trigger: 'change' }]
|
|
|
+};
|
|
|
+const transferRef = ref(null);
|
|
|
+
|
|
|
const handleTransferSales = () => {
|
|
|
if (ids.value.length === 0) { proxy.$modal.msgWarning("请选择要操作的数据"); return; }
|
|
|
- proxy.$modal.confirm("是否转移选中客户的业务负责人?").then(() => {
|
|
|
- proxy.$modal.msgSuccess("操作成功");
|
|
|
- }).catch(() => {});
|
|
|
+ transferDialog.title = '转移业务员';
|
|
|
+ transferDialog.type = 'sales';
|
|
|
+ transferForm.staffId = undefined;
|
|
|
+ if (transferRef.value) transferRef.value.clearValidate();
|
|
|
+ transferDialog.visible = true;
|
|
|
};
|
|
|
|
|
|
const handleTransferSupport = () => {
|
|
|
if (ids.value.length === 0) { proxy.$modal.msgWarning("请选择要操作的数据"); return; }
|
|
|
- proxy.$modal.confirm("是否转移选中客户的客服助理?").then(() => {
|
|
|
- proxy.$modal.msgSuccess("操作成功");
|
|
|
- }).catch(() => {});
|
|
|
+ transferDialog.title = '转移客服人员';
|
|
|
+ transferDialog.type = 'support';
|
|
|
+ transferForm.staffId = undefined;
|
|
|
+ if (transferRef.value) transferRef.value.clearValidate();
|
|
|
+ transferDialog.visible = true;
|
|
|
+};
|
|
|
+
|
|
|
+const submitTransfer = () => {
|
|
|
+ transferRef.value.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ const data = { customerIds: ids.value };
|
|
|
+ let apiCall = null;
|
|
|
+ if (transferDialog.type === 'sales') {
|
|
|
+ data.salesPersonId = transferForm.staffId;
|
|
|
+ apiCall = transferSalesPerson(data);
|
|
|
+ } else {
|
|
|
+ data.serviceStaffId = transferForm.staffId;
|
|
|
+ apiCall = transferServiceStaff(data);
|
|
|
+ }
|
|
|
+
|
|
|
+ apiCall.then(() => {
|
|
|
+ proxy.$modal.msgSuccess("转移成功");
|
|
|
+ transferDialog.visible = false;
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const handleQuery = debounce(() => {
|