Compare commits

4 Commits

Author SHA1 Message Date
wangzhuo
a6a98eb2b6 fix: 客户人员-编辑-多选组件失去焦点关闭 2025-09-01 13:56:20 +08:00
wangzhuo
d37b721c28 fix: 主归属人-变更审核 2025-09-01 13:50:12 +08:00
wangzhuo
ca7572c542 fix: 客户人员-多选表单、日期表单问题修复 2025-09-01 13:46:13 +08:00
wangzhuo
c10a0be121 fix: 计划查看-头部空白高度修复 2025-09-01 13:29:47 +08:00
11 changed files with 307 additions and 181 deletions

View File

@@ -1,12 +1,5 @@
import request from "@/utils/request" import request from "@/utils/request"
// 获取用户信息
export function getPersonalPlanList(params) {
return request.post({
url: '/getPersonalPlanList',
params
})
}
export function getUserInfo(data) { export function getUserInfo(data) {
return request.get({ return request.get({
url: '/crm/app/user/getUserInfo', url: '/crm/app/user/getUserInfo',

View File

@@ -43,7 +43,7 @@
</template> </template>
<script setup> <script setup>
import { onMounted, reactive, ref } from "vue"; import { onMounted, reactive, ref, defineExpose} from "vue";
const props = defineProps({ const props = defineProps({
// 是否显示全部清空按钮 // 是否显示全部清空按钮
@@ -175,6 +175,17 @@ const handleChange = (index, item) => {
// 触发回调函数 // 触发回调函数
emit("change", changevalue, realValue); emit("change", changevalue, realValue);
}; };
// 失去焦点时关闭选项列表
const handleBlur = () => {
active.value = false;
};
// 定义组件实例暴露的方法
defineExpose({
handleBlur
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -168,8 +168,8 @@
<uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top"> <uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top">
<!-- 索引hobbyIndex 范围hobbyList 响应handleHobbyChange--> <!-- 索引hobbyIndex 范围hobbyList 响应handleHobbyChange-->
<uni-easyinput v-model="formData.hobby" placeholder="请输入爱好" :disabled="!editable"/> <uni-easyinput v-model="formData.hobby" placeholder="请输入爱好" :disabled="!editable"/>
<multipleSelect :multiple="true" :value="hobbyIndex" downInner :options="hobbyList" <multipleSelect ref="hobbySelectRef" :multiple="true" downInner :value="hobbyIds" :options="hobbyList"
@change="handleHobbyChange" :slabel="'name'" @change="handleHobbyChange" :slabel="'name'"
></multipleSelect><!--placeholder="请选择爱好标签"--> ></multipleSelect><!--placeholder="请选择爱好标签"-->
</uni-forms-item> </uni-forms-item>
@@ -467,20 +467,29 @@ let handleThinkLevelChange = (e) => {
// 系统推荐等级 // 系统推荐等级
let recommendLevel = ref(""); let recommendLevel = ref("");
let getRecommendLevel = async () => { let getRecommendLevel = async () => {
if (formData.value.cusEstate && formData.value.functionalRequirements) { if (formData.value.cusEstate) {
let {cusEstate, functionalRequirements} = formData.value; let {cusEstate, functionalRequirements} = formData.value;
let param = {cusEstate, functionalRequirements}; let param = {cusEstate, functionalRequirements};
if (formData.value.salesmanThinkLevel) { if (formData.value.salesmanThinkLevel) {
param.personnelLevel = formData.value.salesmanThinkLevel; param.personnelLevel = formData.value.salesmanThinkLevel;
} }
let res = await getCustomerLevel(param).catch(err => { let res = await getCustomerLevel(param)
/*.catch(err => {
console.error(err, "客户的系统推荐等级获取失败") console.error(err, "客户的系统推荐等级获取失败")
}) })*/
if (!res.systemRecommendationLevel) { try{
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐" if(res.data.systemRecommendationLevel){
console.log(formData.value.systemThinkLevel + "???") formData.value.systemThinkLevel = res.data.systemRecommendationLevel;
}else{
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐";
}
}catch(e){
if (res.systemRecommendationLevel) {
formData.value.systemThinkLevel = res.systemRecommendationLevel;
}else{
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐"
}
} }
formData.value.systemThinkLevel = res.systemRecommendationLevel;
} else { } else {
recommendLevel.value = "无公司等级信息,无法推荐等级"; recommendLevel.value = "无公司等级信息,无法推荐等级";
} }
@@ -509,8 +518,7 @@ let handleUserTypeChange = (e) => {
// 选择日期 // 选择日期
function handleTenureTimeChange(e) { function handleTenureTimeChange(e) {
let {value} = e.detail; formData.value.tenureTime = e;
formData.value.tenureTime = value;
} }
// 需求层次索引 // 需求层次索引
@@ -533,16 +541,16 @@ let handleDevelopChange = e => {
// 选择生日 // 选择生日
function handleBirthdayChange(e) { function handleBirthdayChange(e) {
let{value} = e.detail formData.value.birthday = e;
formData.value.birthday = value;
} }
// 爱好标签索引 // 爱好标签索引
let hobbyIndex = reactive([]); let hobbyIds = ref([]);
let hobbies = ref([]);
// 选择爱好标签 // 选择爱好标签
const handleHobbyChange = (item, value) => { const handleHobbyChange = (items, ids) => {
// console.log("爱好", item, value); hobbyIds.value = [];
hobbyIndex = value; hobbies.value = items;
}; };
// 选择 // 选择
const handleNativeChange = (e) => { const handleNativeChange = (e) => {

View File

@@ -1,3 +1,8 @@
<!--
* @author wangzhuo
* @date 2025年9月1日
* @description 编辑客户人员信息
-->
<template> <template>
<view class="con-body"> <view class="con-body">
<view class="con-bg"> <view class="con-bg">
@@ -17,7 +22,7 @@
<!-- 正文内容 --> <!-- 正文内容 -->
<view class="white-bg"> <view class="white-bg">
<view class="form-con"> <view class="form-con" @click="handleBlur">
<uni-forms ref="formRef" :model="formData" :rules="rules" label-width="40%"> <uni-forms ref="formRef" :model="formData" :rules="rules" label-width="40%">
<!-- 选择客户 --> <!-- 选择客户 -->
<uni-forms-item label="客户名称" name="cusName" required class="f-c-right"> <uni-forms-item label="客户名称" name="cusName" required class="f-c-right">
@@ -168,8 +173,8 @@
<uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top"> <uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top">
<!-- 索引hobbyIndex 范围hobbyList 响应handleHobbyChange--> <!-- 索引hobbyIndex 范围hobbyList 响应handleHobbyChange-->
<uni-easyinput v-model="formData.hobby" placeholder="请输入爱好"/> <uni-easyinput v-model="formData.hobby" placeholder="请输入爱好"/>
<multipleSelect :multiple="true" :value="hobbyIndex" downInner :options="hobbyList" <multipleSelect ref="hobbySelectRef" :multiple="true" downInner :value="hobbyIds" :options="hobbyList"
@change="handleHobbyChange" :slabel="'name'" @change="handleHobbyChange" :slabel="'name'"
></multipleSelect><!--placeholder="请选择爱好标签"--> ></multipleSelect><!--placeholder="请选择爱好标签"-->
</uni-forms-item> </uni-forms-item>
@@ -468,20 +473,29 @@ let handleThinkLevelChange = (e) => {
// 系统推荐等级 // 系统推荐等级
let recommendLevel = ref(""); let recommendLevel = ref("");
let getRecommendLevel = async () => { let getRecommendLevel = async () => {
if (formData.value.cusEstate && formData.value.functionalRequirements) { if (formData.value.cusEstate) {
let {cusEstate, functionalRequirements} = formData.value; let {cusEstate, functionalRequirements} = formData.value;
let param = {cusEstate, functionalRequirements}; let param = {cusEstate, functionalRequirements};
if (formData.value.salesmanThinkLevel) { if (formData.value.salesmanThinkLevel) {
param.personnelLevel = formData.value.salesmanThinkLevel; param.personnelLevel = formData.value.salesmanThinkLevel;
} }
let res = await getCustomerLevel(param).catch(err => { let res = await getCustomerLevel(param)
/*.catch(err => {
console.error(err, "客户的系统推荐等级获取失败") console.error(err, "客户的系统推荐等级获取失败")
}) })*/
if (!res.systemRecommendationLevel) { try{
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐" if(res.data.systemRecommendationLevel){
console.log(formData.value.systemThinkLevel + "???") formData.value.systemThinkLevel = res.data.systemRecommendationLevel;
}else{
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐";
}
}catch(e){
if (res.systemRecommendationLevel) {
formData.value.systemThinkLevel = res.systemRecommendationLevel;
}else{
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐"
}
} }
formData.value.systemThinkLevel = res.systemRecommendationLevel;
} else { } else {
recommendLevel.value = "无公司等级信息,无法推荐等级"; recommendLevel.value = "无公司等级信息,无法推荐等级";
} }
@@ -510,8 +524,7 @@ let handleUserTypeChange = (e) => {
// 选择日期 // 选择日期
function handleTenureTimeChange(e) { function handleTenureTimeChange(e) {
let {value} = e.detail; formData.value.tenureTime = e;
formData.value.tenureTime = value;
} }
// 需求层次索引 // 需求层次索引
@@ -534,17 +547,19 @@ let handleDevelopChange = e => {
// 选择生日 // 选择生日
function handleBirthdayChange(e) { function handleBirthdayChange(e) {
let{value} = e.detail formData.value.birthday = e;
formData.value.birthday = value;
} }
// 爱好标签索引 // 爱好标签索引
let hobbyIndex = reactive([]); let hobbyIds = ref([]);
let hobbies = ref([]);
// 选择爱好标签 // 选择爱好标签
const handleHobbyChange = (item, value) => { const handleHobbyChange = (items, ids) => {
// console.log("爱好", item, value); console.log('选择爱好', items, ids);
hobbyIndex = value; hobbyIds.value = [];
hobbies.value = items;
}; };
// 选择 // 选择
const handleNativeChange = (e) => { const handleNativeChange = (e) => {
formData.value.nativec = (e.detail.value.map(item => { formData.value.nativec = (e.detail.value.map(item => {
@@ -567,17 +582,22 @@ let handleWorkingStatusChange = e => {
formData.value.workingStatus = workingStatusList[value].name; formData.value.workingStatus = workingStatusList[value].name;
} }
const hobbySelectRef = ref(null);
// 多选组件失去焦点关闭
let handleBlur = () => {
if (hobbySelectRef.value) hobbySelectRef.value.handleBlur();
}
let submitForm = async () => { let submitForm = async () => {
let hobbyTags = hobbyIndex.map(it => { let hobbyTags = hobbies.value.map(it => {
let {name} = hobbyList[it]; let {name} = it;
return name; return name;
}) })
formData.value.iphone = formData.value.mobilePhone; // 特殊处理
const hobbyTagString = hobbyTags.join(''); const hobbyTagString = hobbyTags.join('');
console.log(hobbyTagString); console.log(hobbyTagString);
if (hobbyTagString || formData.value.hobby) { if (hobbyTagString || formData.value.hobby) {
formData.value.hobby = formData.value.hobby ? formData.value.hobby + '' + hobbyTagString : hobbyTagString; formData.value.hobby = hobbyTagString ? (formData.value.hobby ? formData.value.hobby + '' : '') + hobbyTagString : formData.value.hobby;
} }
formData.value.iphone = formData.value.mobilePhone; // 特殊处理
// console.log(formData.value, "校验表单数据") // console.log(formData.value, "校验表单数据")
// console.log(recommendLevel); // console.log(recommendLevel);
formData.value.cusName = customerUser.value.cusName; formData.value.cusName = customerUser.value.cusName;

View File

@@ -21,7 +21,7 @@
<!-- 正文内容 --> <!-- 正文内容 -->
<view class="white-bg"> <view class="white-bg">
<view class="form-con"> <view class="form-con" @click="handleBlur">
<uni-forms ref="formRef" :model="formData" :rules="rules" label-width="40%"> <uni-forms ref="formRef" :model="formData" :rules="rules" label-width="40%">
<!-- 选择客户 --> <!-- 选择客户 -->
<uni-forms-item label="客户名称" name="cusName" required class="f-c-right"> <uni-forms-item label="客户名称" name="cusName" required class="f-c-right">
@@ -178,7 +178,7 @@
<uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top"> <uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top">
<!-- 索引hobbyIndex 范围hobbyList 响应handleHobbyChange--> <!-- 索引hobbyIndex 范围hobbyList 响应handleHobbyChange-->
<uni-easyinput v-model="formData.hobby" placeholder="请输入爱好"/> <uni-easyinput v-model="formData.hobby" placeholder="请输入爱好"/>
<multipleSelect :multiple="true" :value="hobbyIndex" downInner :options="hobbyList" <multipleSelect ref="hobbySelectRef" :multiple="true" downInner :value="hobbyIds" :options="hobbyList"
@change="handleHobbyChange" :slabel="'name'" @change="handleHobbyChange" :slabel="'name'"
></multipleSelect><!--placeholder="请选择爱好标签"--> ></multipleSelect><!--placeholder="请选择爱好标签"-->
@@ -271,7 +271,7 @@
</template> </template>
<script setup> <script setup>
import {ref, onMounted, computed, reactive} from 'vue' import {ref, reactive} from 'vue'
import customHeader from '@/components/customHeader.vue' import customHeader from '@/components/customHeader.vue'
import multipleSelect from '@/components/multipleSelect.vue' import multipleSelect from '@/components/multipleSelect.vue'
import { import {
@@ -284,7 +284,8 @@ import {
} from "./dataMap"; } from "./dataMap";
import city from "@/utils/area"; import city from "@/utils/area";
import {getCustomerLevel, saveappCrmCusUserNew} from "@/api/crm/customer/getCustomer"; import {getCustomerLevel, saveappCrmCusUserNew} from "@/api/crm/customer/getCustomer";
// 对 multipleSelect 组件的引用
const hobbySelectRef = ref(null);
// 表单引用 // 表单引用
const formRef = ref({}); const formRef = ref({});
// 表单数据 // 表单数据
@@ -412,7 +413,7 @@ let handleCustomerClick = () => {
let { let {
cusName, // 公司名称 cusName, // 公司名称
cusEstate, // 等级 cusEstate, // 等级
cusId, cusId,
} = data; } = data;
customerUser.value.cusName = cusName; customerUser.value.cusName = cusName;
if (!cusEstate) customerUser.value.sysThinkLevel = "该客户暂无等级信息,无法进行系统推荐" if (!cusEstate) customerUser.value.sysThinkLevel = "该客户暂无等级信息,无法进行系统推荐"
@@ -448,20 +449,29 @@ let handleThinkLevelChange = (e) => {
// 系统推荐等级 // 系统推荐等级
let recommendLevel = ref(""); let recommendLevel = ref("");
let getRecommendLevel = async () => { let getRecommendLevel = async () => {
if (formData.value.cusEstate && formData.value.functionalRequirements) { if (formData.value.cusEstate) {
let {cusEstate, functionalRequirements} = formData.value; let {cusEstate, functionalRequirements} = formData.value;
let param = {cusEstate, functionalRequirements}; let param = {cusEstate, functionalRequirements};
if (formData.value.salesmanThinkLevel) { if (formData.value.salesmanThinkLevel) {
param.personnelLevel = formData.value.salesmanThinkLevel; param.personnelLevel = formData.value.salesmanThinkLevel;
} }
let res = await getCustomerLevel(param).catch(err => { let res = await getCustomerLevel(param)
/*.catch(err => {
console.error(err, "客户的系统推荐等级获取失败") console.error(err, "客户的系统推荐等级获取失败")
}) })*/
if (!res.systemRecommendationLevel) { try{
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐" if(res.data.systemRecommendationLevel){
console.log(formData.value.systemThinkLevel + "???") formData.value.systemThinkLevel = res.data.systemRecommendationLevel;
}else{
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐";
}
}catch(e){
if (res.systemRecommendationLevel) {
formData.value.systemThinkLevel = res.systemRecommendationLevel;
}else{
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐"
}
} }
formData.value.systemThinkLevel = res.systemRecommendationLevel;
} else { } else {
recommendLevel.value = "无公司等级信息,无法推荐等级"; recommendLevel.value = "无公司等级信息,无法推荐等级";
} }
@@ -489,9 +499,9 @@ let handleUserTypeChange = (e) => {
} }
// 选择日期 // 选择日期
function handleTenureTimeChange(e) { function handleTenureTimeChange(val) {
let {value} = e.detail; console.log(val)
formData.value.tenureTime = value; formData.value.tenureTime = val;
} }
// 需求层次索引 // 需求层次索引
@@ -513,18 +523,20 @@ let handleDevelopChange = e => {
} }
// 选择生日 // 选择生日
function handleBirthdayChange(e) { function handleBirthdayChange(val) {
let{value} = e.detail formData.value.birthday = val;
formData.value.birthday = value;
} }
// 爱好标签索引 // 爱好标签索引
let hobbyIndex = reactive([]); let hobbyIds = ref([]);
let hobbies = ref([]);
// 选择爱好标签 // 选择爱好标签
const handleHobbyChange = (item, value) => { const handleHobbyChange = (items, ids) => {
// console.log("爱好", item, value); console.log('选择爱好', items, ids);
hobbyIndex = value; hobbyIds.value = [];
hobbies.value = items;
}; };
// 选择 // 选择
const handleNativeChange = (e) => { const handleNativeChange = (e) => {
formData.value.nativec = (e.detail.value.map(item => { formData.value.nativec = (e.detail.value.map(item => {
@@ -546,16 +558,93 @@ let handleWorkingStatusChange = e => {
workingStatusIndex.value = 0; workingStatusIndex.value = 0;
formData.value.workingStatus = workingStatusList[value].name; formData.value.workingStatus = workingStatusList[value].name;
} }
// 多选组件失去焦点关闭
let submitForm = async () => { let handleBlur = () => {
let hobbyTags = hobbyIndex.map(it => { if (hobbySelectRef.value) hobbySelectRef.value.handleBlur();
let {name} = hobbyList[it]; }
// 提取爱好标签处理逻辑
const processHobbyTags = () => {
let hobbyTags = hobbies.value.map(it => {
let {name} = it;
return name; return name;
}) })
const hobbyTagString = hobbyTags.join(''); const hobbyTagString = hobbyTags.join('');
console.log(hobbyTagString); console.log(hobbyTagString);
if (hobbyTagString || formData.value.hobby) { if (hobbyTagString || formData.value.hobby) {
formData.value.hobby = formData.value.hobby ? formData.value.hobby + '' + hobbyTagString : hobbyTagString; formData.value.hobby = hobbyTagString ? (formData.value.hobby ? formData.value.hobby + '' : '') + hobbyTagString : formData.value.hobby;
}
};
// 提取表单验证逻辑
const validateForm = async () => {
formData.value.cusName = customerUser.value.cusName;
await formRef.value.validate();
console.log(formData.value, "提交表单数据");
};
// 提取API调用逻辑
const saveCustomerUser = async () => {
uni.showLoading();
try {
const res = await saveappCrmCusUserNew(formData.value);
if(res.code === 200){
uni.showToast({
title: "保存成功"
});
} else {
uni.showToast({
title: "操作失败",
icon: "error"
});
}
setTimeout(() => uni.navigateBack(), 1500);
} catch(err) {
uni.showToast({
icon: 'none',
title: "保存失败"
});
}
finally{
uni.hideLoading()
}
};
// 简化后的 submitForm 方法
let submitForm = async () => {
console.log(formData.value);
try {
if(formData.value.iphone){
formData.value.mobilePhone = formData.value.iphone;
}
// 处理爱好标签
processHobbyTags();
// 表单验证
await validateForm();
// 保存客户人员信息
await saveCustomerUser();
} catch (err) {
uni.showToast({
icon: 'none',
title: '请检查并完善信息'
});
console.warn(err);
}
};
/*let submitForm = async () => {
let hobbyTags = hobbies.value.map(it => {
let {name} = it;
return name;
})
const hobbyTagString = hobbyTags.join('');
console.log(hobbyTagString);
if (hobbyTagString || formData.value.hobby) {
formData.value.hobby = hobbyTagString ? (formData.value.hobby ? formData.value.hobby + '' : '') + hobbyTagString : formData.value.hobby;
}
if(formData.value.iphone){
formData.value.mobilePhone = formData.value.iphone;
} }
// console.log(formData.value, "校验表单数据") // console.log(formData.value, "校验表单数据")
// console.log(recommendLevel); // console.log(recommendLevel);
@@ -565,19 +654,19 @@ let submitForm = async () => {
console.log(formData.value, "提交表单数据") console.log(formData.value, "提交表单数据")
// 请求保存 // 请求保存
uni.showLoading() uni.showLoading()
saveappCrmCusUserNew(formData.value).then(res=>{ saveappCrmCusUserNew(formData.value).then(res => {
uni.hideLoading(); uni.hideLoading();
if(res.code === 200){ if (res.code === 200) {
uni.showToast({ uni.showToast({
title: "保存成功" title: "保存成功"
}) })
}else{ } else {
uni.showToast({ uni.showToast({
title: "操作失败" title: "操作失败"
}) })
} }
setTimeout(()=>uni.navigateBack(), 1500); setTimeout(() => uni.navigateBack(), 1500);
}).catch(err=>{ }).catch(() => {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: "保存失败" title: "保存失败"
@@ -593,7 +682,7 @@ let submitForm = async () => {
}) })
console.warn(err); console.warn(err);
} }
} }*/
</script> </script>

View File

@@ -133,8 +133,8 @@ const upOption = ref({
page: {num: 0, size: 10}, page: {num: 0, size: 10},
noMoreSize: 5, noMoreSize: 5,
empty: { empty: {
tip: '~ 空空如也 ~', tip: '~ 空空如也 ~',
icon: "../../../../static/images/mescroll-empty.png" icon: "../../static/images/mescroll-empty.png"
}, },
textLoading: '加载中...', textLoading: '加载中...',
textNoMore: '已经到底了' textNoMore: '已经到底了'

View File

@@ -168,8 +168,8 @@
<uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top"> <uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top">
<!-- 索引hobbyIndex 范围hobbyList 响应handleHobbyChange--> <!-- 索引hobbyIndex 范围hobbyList 响应handleHobbyChange-->
<uni-easyinput v-model="formData.hobby" placeholder="请输入爱好" :disabled="!editable"/> <uni-easyinput v-model="formData.hobby" placeholder="请输入爱好" :disabled="!editable"/>
<multipleSelect :multiple="true" :value="hobbyIndex" downInner :options="hobbyList" <multipleSelect ref="hobbySelectRef" :multiple="true" downInner :value="hobbyIds" :options="hobbyList"
@change="handleHobbyChange" :slabel="'name'" @change="handleHobbyChange" :slabel="'name'"
></multipleSelect><!--placeholder="请选择爱好标签"--> ></multipleSelect><!--placeholder="请选择爱好标签"-->
</uni-forms-item> </uni-forms-item>
@@ -439,20 +439,29 @@ let handleThinkLevelChange = (e) => {
// 系统推荐等级 // 系统推荐等级
let recommendLevel = ref(""); let recommendLevel = ref("");
let getRecommendLevel = async () => { let getRecommendLevel = async () => {
if (formData.value.cusEstate && formData.value.functionalRequirements) { if (formData.value.cusEstate) {
let {cusEstate, functionalRequirements} = formData.value; let {cusEstate, functionalRequirements} = formData.value;
let param = {cusEstate, functionalRequirements}; let param = {cusEstate, functionalRequirements};
if (formData.value.salesmanThinkLevel) { if (formData.value.salesmanThinkLevel) {
param.personnelLevel = formData.value.salesmanThinkLevel; param.personnelLevel = formData.value.salesmanThinkLevel;
} }
let res = await getCustomerLevel(param).catch(err => { let res = await getCustomerLevel(param)
/*.catch(err => {
console.error(err, "客户的系统推荐等级获取失败") console.error(err, "客户的系统推荐等级获取失败")
}) })*/
if (!res.systemRecommendationLevel) { try{
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐" if(res.data.systemRecommendationLevel){
console.log(formData.value.systemThinkLevel + "???") formData.value.systemThinkLevel = res.data.systemRecommendationLevel;
}else{
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐";
}
}catch(e){
if (res.systemRecommendationLevel) {
formData.value.systemThinkLevel = res.systemRecommendationLevel;
}else{
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐"
}
} }
formData.value.systemThinkLevel = res.systemRecommendationLevel;
} else { } else {
recommendLevel.value = "无公司等级信息,无法推荐等级"; recommendLevel.value = "无公司等级信息,无法推荐等级";
} }
@@ -481,8 +490,7 @@ let handleUserTypeChange = (e) => {
// 选择日期 // 选择日期
function handleTenureTimeChange(e) { function handleTenureTimeChange(e) {
let {value} = e.detail; formData.value.tenureTime = e;
formData.value.tenureTime = value;
} }
// 需求层次索引 // 需求层次索引
@@ -505,17 +513,19 @@ let handleDevelopChange = e => {
// 选择生日 // 选择生日
function handleBirthdayChange(e) { function handleBirthdayChange(e) {
let{value} = e.detail formData.value.birthday = e;
formData.value.birthday = value;
} }
// 爱好标签索引 // 爱好标签索引
let hobbyIndex = reactive([]); let hobbyIds = ref([]);
let hobbies = ref([]);
// 选择爱好标签 // 选择爱好标签
const handleHobbyChange = (item, value) => { const handleHobbyChange = (items, ids) => {
// console.log("爱好", item, value); console.log('选择爱好', items, ids);
hobbyIndex = value; hobbyIds.value = [];
hobbies.value = items;
}; };
// 选择 // 选择
const handleNativeChange = (e) => { const handleNativeChange = (e) => {
formData.value.nativec = (e.detail.value.map(item => { formData.value.nativec = (e.detail.value.map(item => {
@@ -539,16 +549,18 @@ let handleWorkingStatusChange = e => {
} }
let submitForm = async () => { let submitForm = async () => {
let hobbyTags = hobbyIndex.map(it => { let hobbyTags = hobbies.value.map(it => {
let {name} = hobbyList[it]; let {name} = it;
return name; return name;
}) })
formData.value.iphone = formData.value.mobilePhone; // 特殊处理
const hobbyTagString = hobbyTags.join(''); const hobbyTagString = hobbyTags.join('');
console.log(hobbyTagString); console.log(hobbyTagString);
if (hobbyTagString || formData.value.hobby) { if (hobbyTagString || formData.value.hobby) {
formData.value.hobby = formData.value.hobby ? formData.value.hobby + '' + hobbyTagString : hobbyTagString; formData.value.hobby = hobbyTagString ? (formData.value.hobby ? formData.value.hobby + '' : '') + hobbyTagString : formData.value.hobby;
} }
formData.value.iphone = formData.value.mobilePhone; // 特殊处理
// console.log(formData.value, "校验表单数据") // console.log(formData.value, "校验表单数据")
// console.log(recommendLevel); // console.log(recommendLevel);
formData.value.cusName = customerUser.value.cusName; formData.value.cusName = customerUser.value.cusName;

View File

@@ -11,18 +11,18 @@
</customHeader> </customHeader>
<!-- 高度来避免头部遮挡 --> <!-- 高度来避免头部遮挡 -->
<view class="top-height" :style="{ paddingTop: navBarPaddingTop + 'px' }"></view> <view class="top-height"></view>
<!-- 正文内容 --> <!-- 正文内容 -->
<view class="all-body"> <view class="all-body">
<!-- 搜索--> <!-- 搜索-->
<!-- <view class="search">--> <!-- <view class="search">-->
<!-- <uni-search-bar class="custom-search" radius="28" placeholder="请输入客户人员名称" clearButton="auto"--> <!-- <uni-search-bar class="custom-search" radius="28" placeholder="请输入客户人员名称" clearButton="auto"-->
<!-- cancelButton="none" bgColor="#6FA2F8" textColor="#ffffff"--> <!-- cancelButton="none" bgColor="#6FA2F8" textColor="#ffffff"-->
<!-- v-model="searchValue"--> <!-- v-model="searchValue"-->
<!-- />--> <!-- />-->
<!-- <button type="default" @click="clearSearchValue" size="mini" class="btn-search">清空</button>--> <!-- <button type="default" @click="clearSearchValue" size="mini" class="btn-search">清空</button>-->
<!-- </view>--> <!-- </view>-->
<!-- 分页部分 --> <!-- 分页部分 -->
<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" <mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
@@ -122,10 +122,7 @@ let list = ref([]);
const upOption = ref({ const upOption = ref({
page: {num: 0, size: 10}, page: {num: 0, size: 10},
noMoreSize: 5, noMoreSize: 5,
empty: { empty: {tip: '~ 空空如也 ~'},
tip: '~ 空空如也 ~',
icon: "../../static/images/mescroll-empty.png"
},
textLoading: '加载中...', textLoading: '加载中...',
textNoMore: '已经到底了' textNoMore: '已经到底了'
}); });

View File

@@ -8,7 +8,7 @@
<!-- #endif --> <!-- #endif -->
<!-- 高度来避免头部遮挡 --> <!-- 高度来避免头部遮挡 -->
<view class="top-height" :style="{ paddingTop: navBarPaddingTop + 'px' }"></view> <view class="top-height"></view>
<view class="white-bg"> <view class="white-bg">
<navigator url="/pages/business/CRM/plan/myPlan"> <navigator url="/pages/business/CRM/plan/myPlan">

View File

@@ -28,9 +28,9 @@
</view> </view>
<view class="nav-list"> <view class="nav-list">
<view class="nav-item" :class="{active:index==activeTab}" <view class="nav-item" :class="{active:index==activeTab}"
v-for="(item,index) in allPlans" :key="index" v-for="(item,index) in allPlans" :key="index"
@click="handleNav(index)" @click="handleNav(index)"
>{{ getTapLabel(item) }} >{{ getTapLabel(item) }}
</view> </view>
</view> </view>
@@ -54,7 +54,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class='bottom-spliter bg-gray'></view> <view class='bottom-spliter bg-gray'></view>
</block> </block>
<!-- 底部加高度来避免tabbar遮挡 --> <!-- 底部加高度来避免tabbar遮挡 -->
@@ -269,13 +269,13 @@ function handleEdit(index) {
} }
.white-bg.white-bg-2 { .white-bg.white-bg-2 {
/* margin-bottom: 20rpx; */ /* margin-bottom: 20rpx; */
} }
.bottom-spliter{ .bottom-spliter{
height: 20rpx; height: 20rpx;
} }
.bg-gray{ .bg-gray{
background-color: #f0f0f0; background-color: #f0f0f0;
} }
.report-list .w-b-title .btn-edit { .report-list .w-b-title .btn-edit {
background-color: #5C96F7; background-color: #5C96F7;
@@ -286,14 +286,14 @@ function handleEdit(index) {
} }
.nav-list { .nav-list {
/* display: flex;*/ /* display: flex;*/
/* width: 690rpx;*/ /* width: 690rpx;*/
overflow-x: auto; /* 允许横向滚动 */ overflow-x: auto; /* 允许横向滚动 */
/*overflow-y: hidden; 隐藏垂直滚动 */ /*overflow-y: hidden; 隐藏垂直滚动 */
/*-ms-overflow-style: none; IE 隐藏滚动条 */ /*-ms-overflow-style: none; IE 隐藏滚动条 */
/* scrollbar-width: none; */ /*Firefox 隐藏滚动条 */ /* scrollbar-width: none; */ /*Firefox 隐藏滚动条 */
/* 添加高度以确保有足够的空间 */ /* 添加高度以确保有足够的空间 */
/* height: 80rpx;*/ /* height: 80rpx;*/
white-space: nowrap; /* 保持子元素在同一行显示 */ white-space: nowrap; /* 保持子元素在同一行显示 */
/* 添加这些属性确保滚动正常工作 */ /* 添加这些属性确保滚动正常工作 */
scroll-behavior: smooth; scroll-behavior: smooth;
@@ -310,7 +310,7 @@ function handleEdit(index) {
} }
.nav-list .nav-item { .nav-list .nav-item {
/* flex: 0 0 auto; 关键:不放大、不缩小、自动宽度 */ /* flex: 0 0 auto; 关键:不放大、不缩小、自动宽度 */
/* width: 200rpx;*/ /* width: 200rpx;*/
display: inline-block; display: inline-block;
background-color: #05A3F4; background-color: #05A3F4;
border-radius: 10rpx; border-radius: 10rpx;

View File

@@ -11,8 +11,7 @@
</customHeader> </customHeader>
<!-- 高度来避免头部遮挡 --> <!-- 高度来避免头部遮挡 -->
<view class="top-height" :style="{ paddingTop: navBarPaddingTop + 'px' }"></view> <view class="top-height"></view>
<!-- 正文内容 --> <!-- 正文内容 -->
<view> <view>
@@ -37,61 +36,61 @@
</view> </view>
<!-- 分页部分 --> <!-- 分页部分 -->
<!-- <mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"--> <!-- <mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"-->
<!-- :up="upOption" :down="downOption" :fixed="false" textColor="#ffffff" bgColor="#ffffff"--> <!-- :up="upOption" :down="downOption" :fixed="false" textColor="#ffffff" bgColor="#ffffff"-->
<!-- class="scroll-h" :class="{'loading-scroll':cssFlag}">--> <!-- class="scroll-h" :class="{'loading-scroll':cssFlag}">-->
<view class="white-bg" v-if="list.length"> <view class="white-bg" v-if="list.length">
<!--v-for="(item, index) in list" :key="index" @click="handleDetail(item)"--> <!--v-for="(item, index) in list" :key="index" @click="handleDetail(item)"-->
<view style="text-align: center; margin-bottom: 30rpx; font-size: 30rpx;"> <view style="text-align: center; margin-bottom: 30rpx; font-size: 30rpx;">
{{ parseInt(searchValue.selectDate.substring(5, 7)) }} {{ parseInt(searchValue.selectDate.substring(5, 7)) }}
<span class="line"></span> <span class="line"></span>
{{searchValue.selectDate.substring(0, 4) }} {{searchValue.selectDate.substring(0, 4) }}
</view> </view>
<uni-row class="demo-uni-row">
<uni-col :span="1">
<view class="demo-uni-col right-radius">序号</view>
</uni-col>
<uni-col :span="2">
<view class="demo-uni-col left-radius">姓名</view>
</uni-col>
<block v-for="(field, i) in OrdinalDate">
<uni-col :span="3">
<view class="demo-uni-col mar-left">
<text>{{ WeekShortCN[i] }}</text>
<text v-if="list[0][field]">{{ list[0][field].substring(8) }}</text>
</view>
</uni-col>
</block>
</uni-row>
<block v-for="(item, index) in list" :key="index">
<uni-row class="demo-uni-row"> <uni-row class="demo-uni-row">
<uni-col :span="1"> <uni-col :span="1">
<view class="demo-uni-col right-radius">序号</view> <view class="demo-uni-col right-radius">
<text>{{ index + 1 }}</text>
</view>
</uni-col> </uni-col>
<uni-col :span="2"> <uni-col :span="2">
<view class="demo-uni-col left-radius">姓名</view> <view class="demo-uni-col left-radius">
<text>{{ item.nickName || item.userName }}</text>
</view>
</uni-col> </uni-col>
<block v-for="(field, i) in OrdinalDate"> <block v-for="(field, i) in WorkType">
<uni-col :span="3"> <uni-col :span="3">
<view class="demo-uni-col mar-left"> <view class="demo-uni-col mar-left color-white" @click="handleDetail(index, i)"
<text>{{ WeekShortCN[i] }}</text> :style="{ backgroundColor: COLOR_MAP[item[field]] }"
<text v-if="list[0][field]">{{ list[0][field].substring(8) }}</text> ><!--@click="handleView(index, i)"-->
<text v-if="item[field]">{{ item[field] }}</text>
<text v-else style="color: gray">暂无</text>
</view> </view>
</uni-col> </uni-col>
</block> </block>
</uni-row> </uni-row>
<block v-for="(item, index) in list" :key="index"> </block>
<uni-row class="demo-uni-row"> </view>
<uni-col :span="1"> <view v-else style="text-align: center; margin-top: 50%; color: white">
<view class="demo-uni-col right-radius"> 暂无数据
<text>{{ index + 1 }}</text> </view>
</view> <!-- </mescroll-uni>-->
</uni-col>
<uni-col :span="2">
<view class="demo-uni-col left-radius">
<text>{{ item.nickName || item.userName }}</text>
</view>
</uni-col>
<block v-for="(field, i) in WorkType">
<uni-col :span="3">
<view class="demo-uni-col mar-left color-white" @click="handleDetail(index, i)"
:style="{ backgroundColor: COLOR_MAP[item[field]] }"
><!--@click="handleView(index, i)"-->
<text v-if="item[field]">{{ item[field] }}</text>
<text v-else style="color: gray">暂无</text>
</view>
</uni-col>
</block>
</uni-row>
</block>
</view>
<view v-else style="text-align: center; margin-top: 50%; color: white">
暂无数据
</view>
<!-- </mescroll-uni>-->
</view> </view>
</view> </view>
</view> </view>
@@ -144,10 +143,7 @@ const mescrollRef = ref(null);
const upOption = ref({ const upOption = ref({
page: {num: 0, size: 10}, page: {num: 0, size: 10},
noMoreSize: 5, noMoreSize: 5,
empty: { empty: {tip: '~ 空空如也 ~'},
tip: '~ 空空如也 ~',
icon: "../../../../static/images/mescroll-empty.png"
},
textLoading: '加载中...', textLoading: '加载中...',
textNoMore: '已经到底了' textNoMore: '已经到底了'
}); });