|
@@ -14,81 +14,42 @@
|
|
|
action: () => openModal('add'),
|
|
|
},
|
|
|
]"
|
|
|
- @get-list="getList"
|
|
|
- >
|
|
|
+ @get-list="getList">
|
|
|
<template #address="{ item }">
|
|
|
<span>{{ item.countryName }}</span>
|
|
|
<span v-if="item.provinceName"> ,{{ item.provinceName }}</span>
|
|
|
<span v-if="item.cityName"> ,{{ item.cityName }}</span>
|
|
|
</template>
|
|
|
<template #name="{ item }">
|
|
|
- <div
|
|
|
- style="cursor: pointer; color: #409eff"
|
|
|
- @click="handleClickName(item)"
|
|
|
- >
|
|
|
+ <div style="cursor: pointer; color: #409eff" @click="handleClickName(item)">
|
|
|
{{ item.name }}
|
|
|
</div>
|
|
|
</template>
|
|
|
</byTable>
|
|
|
</div>
|
|
|
|
|
|
- <el-dialog
|
|
|
- :title="modalType == 'add' ? '新增' : '编辑'"
|
|
|
- v-if="dialogVisible"
|
|
|
- v-model="dialogVisible"
|
|
|
- width="800"
|
|
|
- v-loading="loadingOperation"
|
|
|
- >
|
|
|
- <byForm
|
|
|
- :formConfig="formConfig"
|
|
|
- :formOption="formOption"
|
|
|
- v-model="formData.data"
|
|
|
- :rules="rules"
|
|
|
- ref="submit"
|
|
|
- >
|
|
|
+ <el-dialog :title="modalType == 'add' ? '新增' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="800" v-loading="loadingOperation">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
|
|
|
<template #address>
|
|
|
<el-row style="width: 100%">
|
|
|
<el-col :span="8">
|
|
|
<el-form-item prop="countryId">
|
|
|
- <el-select
|
|
|
- v-model="formData.data.countryId"
|
|
|
- placeholder="国家"
|
|
|
- @change="(val) => getCityData(val, '20', true)"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in countryData"
|
|
|
- :label="item.chineseName"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
+ <el-select v-model="formData.data.countryId" placeholder="国家" @change="(val) => getCityData(val, '20', true)">
|
|
|
+ <el-option v-for="item in countryData" :label="item.chineseName" :value="item.id"> </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item prop="provinceId">
|
|
|
- <el-select
|
|
|
- v-model="formData.data.provinceId"
|
|
|
- placeholder="省/洲"
|
|
|
- @change="(val) => getCityData(val, '30', true)"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in provinceData"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
+ <el-select v-model="formData.data.provinceId" placeholder="省/洲" @change="(val) => getCityData(val, '30', true)">
|
|
|
+ <el-option v-for="item in provinceData" :label="item.name" :value="item.id"> </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item prop="cityId">
|
|
|
<el-select v-model="formData.data.cityId" placeholder="城市">
|
|
|
- <el-option
|
|
|
- v-for="item in cityData"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
+ <el-option v-for="item in cityData" :label="item.name" :value="item.id"> </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -96,8 +57,7 @@
|
|
|
<el-row style="margin-top: 20px; width: 100%">
|
|
|
<el-col :span="24">
|
|
|
<el-form-item prop="address">
|
|
|
- <el-input v-model="formData.data.address" type="textarea">
|
|
|
- </el-input>
|
|
|
+ <el-input v-model="formData.data.address" type="textarea"> </el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -105,65 +65,29 @@
|
|
|
<template #person>
|
|
|
<div>
|
|
|
<el-button type="primary" @click="clickAddPerson"> 添加 </el-button>
|
|
|
- <byTable
|
|
|
- :source="formData.data.customerUserList"
|
|
|
- :config="configPerson"
|
|
|
- hideSearch
|
|
|
- hidePagination
|
|
|
- >
|
|
|
- </byTable>
|
|
|
+ <byTable :source="formData.data.customerUserList" :config="configPerson" hideSearch hidePagination> </byTable>
|
|
|
</div>
|
|
|
</template>
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitForm('submit')"
|
|
|
- size="large"
|
|
|
- :loading="submitLoading"
|
|
|
- >
|
|
|
- 确 定
|
|
|
- </el-button>
|
|
|
+ <el-button type="primary" @click="submitForm('submit')" size="large" :loading="submitLoading"> 确 定 </el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog title="添加联系人" v-model="openPerson" width="400">
|
|
|
- <byForm
|
|
|
- :formConfig="formConfigPerson"
|
|
|
- :formOption="formOption"
|
|
|
- v-model="formPerson.data"
|
|
|
- :rules="rulesPerson"
|
|
|
- ref="person"
|
|
|
- >
|
|
|
- </byForm>
|
|
|
+ <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>
|
|
|
+ <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>
|
|
|
+ <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>
|
|
|
+ <el-button @click="openAllocation = false" size="large">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitAllocation('allocation')" size="large"> 确 定 </el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -333,15 +257,11 @@ const config = computed(() => {
|
|
|
},
|
|
|
el: "button",
|
|
|
click() {
|
|
|
- ElMessageBox.confirm(
|
|
|
- "此操作将永久删除该数据, 是否继续?",
|
|
|
- "提示",
|
|
|
- {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }
|
|
|
- ).then(() => {
|
|
|
+ ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
proxy
|
|
|
.post("/customer/delete", {
|
|
|
id: row.id,
|
|
@@ -393,6 +313,7 @@ const formConfig = computed(() => {
|
|
|
{
|
|
|
type: "slot",
|
|
|
slotName: "address",
|
|
|
+ prop: "countryId",
|
|
|
label: "详细地址",
|
|
|
},
|
|
|
{
|
|
@@ -408,56 +329,21 @@ const formConfig = computed(() => {
|
|
|
label: "客户来源",
|
|
|
prop: "source",
|
|
|
itemWidth: 50,
|
|
|
- isLoad: {
|
|
|
- url: "/dictTenantData/page",
|
|
|
- labelKey: "dictValue",
|
|
|
- labelVal: "dictKey",
|
|
|
- method: "post",
|
|
|
- req: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 999,
|
|
|
- dictCode: "customer_source",
|
|
|
- tenantId: useUserStore().user.tenantId,
|
|
|
- },
|
|
|
- resUrl: "rows",
|
|
|
- },
|
|
|
+ data: customerSource.value,
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
label: "客户类型",
|
|
|
prop: "status",
|
|
|
itemWidth: 50,
|
|
|
- isLoad: {
|
|
|
- url: "/dictTenantData/page",
|
|
|
- labelKey: "dictValue",
|
|
|
- labelVal: "dictKey",
|
|
|
- method: "post",
|
|
|
- req: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 999,
|
|
|
- dictCode: "customer_status",
|
|
|
- tenantId: useUserStore().user.tenantId,
|
|
|
- },
|
|
|
- resUrl: "rows",
|
|
|
- },
|
|
|
+ data: customerStatus.value,
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
label: "业务员",
|
|
|
prop: "userId",
|
|
|
itemWidth: 100,
|
|
|
- isLoad: {
|
|
|
- url: "/tenantUser/list",
|
|
|
- labelKey: "nickName",
|
|
|
- labelVal: "userId",
|
|
|
- method: "get",
|
|
|
- resUrl: "rows",
|
|
|
- req: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10000,
|
|
|
- tenantId: useUserStore().user.tenantId,
|
|
|
- },
|
|
|
- },
|
|
|
+ data: userList.value,
|
|
|
},
|
|
|
{
|
|
|
type: "slot",
|
|
@@ -470,7 +356,7 @@ let rules = ref({
|
|
|
name: [{ required: true, message: "请输入客户名称", trigger: "blur" }],
|
|
|
countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
|
|
|
provinceId: [{ required: true, message: "请选择省/州", trigger: "change" }],
|
|
|
- // cityId: [{ required: true, message: "请选择城市", trigger: "change" }],
|
|
|
+ cityId: [{ required: true, message: "请选择城市", trigger: "change" }],
|
|
|
source: [{ required: true, message: "请选择客户来源", trigger: "change" }],
|
|
|
status: [{ required: true, message: "请选择类型", trigger: "change" }],
|
|
|
});
|
|
@@ -481,18 +367,7 @@ const formConfigAllocation = computed(() => {
|
|
|
label: "业务员",
|
|
|
prop: "userId",
|
|
|
itemWidth: 100,
|
|
|
- isLoad: {
|
|
|
- url: "/tenantUser/list",
|
|
|
- labelKey: "nickName",
|
|
|
- labelVal: "userId",
|
|
|
- method: "get",
|
|
|
- resUrl: "rows",
|
|
|
- req: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10000,
|
|
|
- tenantId: useUserStore().user.tenantId,
|
|
|
- },
|
|
|
- },
|
|
|
+ data: userList.value,
|
|
|
},
|
|
|
];
|
|
|
});
|
|
@@ -641,10 +516,7 @@ const submitAllocation = () => {
|
|
|
};
|
|
|
const submitPerson = () => {
|
|
|
person.value.handleSubmit(() => {
|
|
|
- if (
|
|
|
- formData.data.customerUserList &&
|
|
|
- formData.data.customerUserList.length > 0
|
|
|
- ) {
|
|
|
+ if (formData.data.customerUserList && formData.data.customerUserList.length > 0) {
|
|
|
formData.data.customerUserList.push({
|
|
|
name: formPerson.data.name,
|
|
|
phone: formPerson.data.phone,
|
|
@@ -662,10 +534,7 @@ const submitPerson = () => {
|
|
|
};
|
|
|
const submitForm = () => {
|
|
|
submit.value.handleSubmit(() => {
|
|
|
- if (
|
|
|
- formData.data.customerUserList &&
|
|
|
- formData.data.customerUserList.length > 0
|
|
|
- ) {
|
|
|
+ if (formData.data.customerUserList && formData.data.customerUserList.length > 0) {
|
|
|
submitLoading.value = true;
|
|
|
proxy.post("/customer/" + modalType.value, formData.data).then(
|
|
|
() => {
|