|
@@ -14,37 +14,81 @@
|
|
|
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)"
|
|
|
+ >
|
|
|
+ {{ 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>
|
|
@@ -52,7 +96,8 @@
|
|
|
<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>
|
|
@@ -60,29 +105,65 @@
|
|
|
<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>
|
|
@@ -149,6 +230,7 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "客户名称",
|
|
|
prop: "name",
|
|
|
+ slot: "name",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -251,11 +333,15 @@ 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,
|
|
@@ -555,7 +641,10 @@ 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,
|
|
@@ -573,7 +662,10 @@ 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(
|
|
|
() => {
|
|
@@ -626,17 +718,32 @@ const getDict = () => {
|
|
|
};
|
|
|
});
|
|
|
});
|
|
|
- proxy.get("/tenantUser/list", { pageNum: 1, pageSize: 10000, tenantId: useUserStore().user.tenantId }).then((res) => {
|
|
|
- userList.value = res.rows.map((item) => {
|
|
|
- return {
|
|
|
- label: item.nickName,
|
|
|
- value: item.userId,
|
|
|
- };
|
|
|
+ proxy
|
|
|
+ .get("/tenantUser/list", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10000,
|
|
|
+ tenantId: useUserStore().user.tenantId,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ userList.value = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.nickName,
|
|
|
+ value: item.userId,
|
|
|
+ };
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
};
|
|
|
getDict();
|
|
|
getList();
|
|
|
+
|
|
|
+const handleClickName = (row) => {
|
|
|
+ proxy.$router.push({
|
|
|
+ path: "/customer/customer/portrait",
|
|
|
+ query: {
|
|
|
+ id: row.id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|