|
@@ -10,7 +10,7 @@
|
|
|
highlight-current-row
|
|
|
:action-list="[
|
|
|
{
|
|
|
- text: '添加用户',
|
|
|
+ text: '添加客户',
|
|
|
action: () => openModal('add'),
|
|
|
},
|
|
|
]"
|
|
@@ -71,13 +71,21 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog title="添加联系人" v-model="openPerson" width="400" v-loading="openPerson">
|
|
|
+ <el-dialog title="添加联系人" v-model="openPerson" width="400">
|
|
|
<byForm :formConfig="formConfigPerson" :formOption="formOption" v-model="formPerson.data" :rules="rulesPerson" ref="person"> </byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="openPerson = false" size="large">取 消</el-button>
|
|
|
<el-button type="primary" @click="submitPerson('person')" size="large"> 确 定 </el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog title="分配" v-model="openAllocation" width="300">
|
|
|
+ <byForm :formConfig="formConfigAllocation" :formOption="formOption" v-model="formAllocation.data" ref="allocation"> </byForm>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="openAllocation = false" size="large">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitAllocation('allocation')" size="large"> 确 定 </el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -93,6 +101,7 @@ const loading = ref(false);
|
|
|
const loadingOperation = ref(false);
|
|
|
const submitLoading = ref(false);
|
|
|
const openPerson = ref(false);
|
|
|
+const openAllocation = ref(false);
|
|
|
const customerSource = ref([]);
|
|
|
const customerStatus = ref([]);
|
|
|
const userList = ref([]);
|
|
@@ -213,6 +222,21 @@ const config = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
attrs: {
|
|
|
+ label: "分配",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ openAllocation.value = true;
|
|
|
+ formAllocation.data = {
|
|
|
+ id: row.id,
|
|
|
+ userId: row.userId,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
label: "修改",
|
|
|
type: "primary",
|
|
|
text: true,
|
|
@@ -264,6 +288,9 @@ let formData = reactive({
|
|
|
let formPerson = reactive({
|
|
|
data: {},
|
|
|
});
|
|
|
+let formAllocation = reactive({
|
|
|
+ data: {},
|
|
|
+});
|
|
|
const formOption = reactive({
|
|
|
inline: true,
|
|
|
labelWidth: 100,
|
|
@@ -359,23 +386,20 @@ let rules = ref({
|
|
|
source: [{ required: true, message: "请选择客户来源", trigger: "change" }],
|
|
|
status: [{ required: true, message: "请选择类型", trigger: "change" }],
|
|
|
});
|
|
|
-const formConfigPerson = computed(() => {
|
|
|
+const formConfigAllocation = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
- type: "input",
|
|
|
- prop: "name",
|
|
|
- label: "联系人名称",
|
|
|
- required: true,
|
|
|
- itemWidth: 100,
|
|
|
- itemType: "text",
|
|
|
- },
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- prop: "phone",
|
|
|
- label: "联系人电话",
|
|
|
- required: true,
|
|
|
+ type: "select",
|
|
|
+ label: "业务员",
|
|
|
+ prop: "userId",
|
|
|
itemWidth: 100,
|
|
|
- itemType: "text",
|
|
|
+ isLoad: {
|
|
|
+ url: "/tenantUser/list?pageNum=1&pageSize=10000",
|
|
|
+ labelKey: "userName",
|
|
|
+ labelVal: "userId",
|
|
|
+ method: "get",
|
|
|
+ resUrl: "rows",
|
|
|
+ },
|
|
|
},
|
|
|
];
|
|
|
});
|
|
@@ -419,13 +443,33 @@ const configPerson = computed(() => {
|
|
|
},
|
|
|
];
|
|
|
});
|
|
|
-
|
|
|
+const formConfigPerson = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "name",
|
|
|
+ label: "联系人名称",
|
|
|
+ required: true,
|
|
|
+ itemWidth: 100,
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "phone",
|
|
|
+ label: "联系人电话",
|
|
|
+ required: true,
|
|
|
+ itemWidth: 100,
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
let rulesPerson = ref({
|
|
|
name: [{ required: true, message: "请输入联系人名称", trigger: "blur" }],
|
|
|
phone: [{ required: true, message: "请输入联系人电话", trigger: "blur" }],
|
|
|
});
|
|
|
const submit = ref(null);
|
|
|
const person = ref(null);
|
|
|
+const allocation = ref(null);
|
|
|
const getList = async (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
loading.value = true;
|
|
@@ -490,6 +534,18 @@ const clickAddPerson = () => {
|
|
|
formPerson.data = {};
|
|
|
openPerson.value = true;
|
|
|
};
|
|
|
+const submitAllocation = () => {
|
|
|
+ allocation.value.handleSubmit(() => {
|
|
|
+ proxy.post("/customer/CustomerAllocation", formAllocation.data).then(() => {
|
|
|
+ ElMessage({
|
|
|
+ message: "分配成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ openAllocation.value = false;
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
const submitPerson = () => {
|
|
|
person.value.handleSubmit(() => {
|
|
|
if (formData.data.customerUserList && formData.data.customerUserList.length > 0) {
|