修复选择负责人

This commit is contained in:
WindowBird 2025-11-14 16:03:10 +08:00
parent fca8927fb4
commit 12cbd23bb2
4 changed files with 33 additions and 33 deletions

View File

@ -44,21 +44,23 @@ export const getDictDataList = (params = {}) => {
// 合并参数 // 合并参数
const requestParams = { ...defaultParams, ...params }; const requestParams = { ...defaultParams, ...params };
// 构建查询字符串 // 构建查询参数数组兼容uniapp
const searchParams = new URLSearchParams(); const queryParams = [];
Object.entries(requestParams).forEach(([key, value]) => { Object.entries(requestParams).forEach(([key, value]) => {
if (value !== undefined && value !== null && value !== '') { if (value !== undefined && value !== null && value !== '') {
searchParams.append(key, value.toString()); queryParams.push(`${key}=${encodeURIComponent(value.toString())}`);
} }
}); });
const queryString = searchParams.toString(); const queryString = queryParams.join('&');
const url = `/system/dict/data/list${queryString ? `?${queryString}` : ''}`; const url = `/system/dict/data/list${queryString ? `?${queryString}` : ''}`;
console.log('请求URL:', url); // 调试用
return uni.$uv.http.get(url, { return uni.$uv.http.get(url, {
custom: { custom: {
auth: true auth: true
} }
}); });
}; };

View File

@ -73,35 +73,30 @@ export const getUserListAll = () => {
}; };
/** /**
* 分页获取用户列表 * 分页获取用户列表uni-app兼容版本
* @param {Object} params 查询参数 * @param {Object} params 查询参数
* @param {number} params.pageNum 页码 * @param {number} params.pageNum 页码默认1
* @param {number} params.pageSize 每页数量 * @param {number} params.pageSize 每页数量默认100
* @param {string|number} params.status 启用状态 * @param {string|number} params.status 启用状态默认0
* @param {string|number} params.delFlag 删除标记 * @param {string|number} params.delFlag 删除标记默认0
* @returns {Promise<Object>} 用户列表 * @returns {Promise<Object>} 用户列表
*/ */
export const getUserList = (params = {}) => { export const getUserList = (params = {}) => {
const defaultParams = { // 合并参数并过滤空值
const requestParams = Object.entries({
pageNum: 1, pageNum: 1,
pageSize: 100, pageSize: 100,
status: 0, status: 0,
delFlag: 0 delFlag: 0,
}; ...params
})
.filter(([_, value]) => value !== undefined && value !== null && value !== '')
.map(([key, value]) => `${key}=${encodeURIComponent(value.toString())}`)
.join('&');
const searchParams = new URLSearchParams(); const url = `/system/user/list${requestParams ? `?${requestParams}` : ''}`;
Object.entries({ ...defaultParams, ...params }).forEach(([key, value]) => {
if (value !== undefined && value !== null && value !== '') { return uni.$uv.http.get(url, {
searchParams.append(key, value); custom: { auth: true }
}
}); });
};
const queryString = searchParams.toString();
return uni.$uv.http.get(`/system/user/list${queryString ? `?${queryString}` : ''}`, {
custom: {
auth: true
}
});
};

View File

@ -53,7 +53,9 @@ const handleClick = (item) => {
return; return;
} }
if (item.key === 'task') { if (item.key === 'task') {
uni.switchTab({ url: '/pages/index/index' }); uni.navigateTo({
url: '/pages/task/add/index'
});
return; return;
} }
if (item.key === 'customer') { if (item.key === 'customer') {

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="task-add-page"> <view class="task-add-page">
<scroll-view class="content-scroll" scroll-y> <view class="content-scroll" >
<view class="form-card"> <view class="form-card">
<view class="section-title">任务信息</view> <view class="section-title">任务信息</view>
@ -114,7 +114,7 @@
</view> </view>
</view> </view>
</view> </view>
</scroll-view> </view>
<view class="submit-bar"> <view class="submit-bar">
<uv-button <uv-button
@ -886,7 +886,7 @@ onLoad(async (options) => {
background: #fff; background: #fff;
border-top-left-radius: 16px; border-top-left-radius: 16px;
border-top-right-radius: 16px; border-top-right-radius: 16px;
max-height: 76%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
@ -922,7 +922,8 @@ onLoad(async (options) => {
} }
.member-list { .member-list {
flex: 1; height: 600px;
} }
.member-item { .member-item {