From d36c043377ce99f9302f55790dcc99a51461c336 Mon Sep 17 00:00:00 2001 From: wangxiangwen4 <1906413238@qq.com> Date: Mon, 21 Jul 2025 17:59:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E9=99=86+=E5=90=88=E5=B9=B6+=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=AD=89=E7=BA=A7=E5=BF=85=E5=A1=AB=EF=BC=88ts?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA=E9=94=99=E8=AF=AF=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E4=B8=8D=E5=BD=B1=E5=93=8D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- activitylink/src/api/manage/activity.js | 7 +- activitylink/src/api/manage/gift.js | 164 ++++++- activitylink/src/api/manage/level.js | 60 ++- activitylink/src/views/homePage.vue | 40 +- .../src/views/zhongchou/activity/index.vue | 66 ++- .../src/views/zhongchou/activity/set/index.vue | 39 ++ .../views/zhongchou/gift/importFixedList/index.vue | 519 ++++++++++----------- .../src/views/zhongchou/gift/importuser/index.vue | 498 ++++++++++---------- activitylink/src/views/zhongchou/gift/index.vue | 472 ++++++++++++------- activitylink/src/views/zhongchou/level/index.vue | 436 +++++++++-------- activitylink/src/views/zhongchou/winning/index.vue | 10 + 11 files changed, 1374 insertions(+), 937 deletions(-) diff --git a/activitylink/src/api/manage/activity.js b/activitylink/src/api/manage/activity.js index 486aee2..981985d 100644 --- a/activitylink/src/api/manage/activity.js +++ b/activitylink/src/api/manage/activity.js @@ -65,11 +65,12 @@ export function showsetDetail(activityId){ }) } -// export function showaddDetail(activityId,stock,addTotal){ +// 更新后用的 +// export function showsetDetail(data){ // return request({ -// url: '/admin/funding/addDateVirtual', +// url: '/admin/funding/getDate', // method: 'post', -// params: { activityId,stock,addTotal } +// data // }) // } diff --git a/activitylink/src/api/manage/gift.js b/activitylink/src/api/manage/gift.js index e3a7c04..091746a 100644 --- a/activitylink/src/api/manage/gift.js +++ b/activitylink/src/api/manage/gift.js @@ -1,17 +1,161 @@ import request from '@/utils/request' -// export function deleteUser(id) { -// return request({ -// url: '/admin/prize/update', -// method: 'post', -// params: { id } -// }) -// } +//奖品新增 +export function addPrize(data) { + return request({ + url: '/admin/prize/add', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} -export function getGiftList(pageNum,pageSize) { +// 奖品删除 +export function deletePrize(id) { return request({ - url: '/admin/prize/list', + url: '/admin/prize/delete', method: 'post', params: { pageNum,pageSize } }) -} \ No newline at end of file +} +//奖品分页查询 +export function getPrizeList(params) { + return request({ + url: '/admin/prize/list', + method: 'post', + params: params + }) +} +// 根据id查询奖品 +export function getprizebyid(params) { + return request({ + url: '/admin/prize/detail', + method: 'post', + params: params + }) +} +// 修改奖品 +export function updatePrize(data) { + return request({ + url: '/admin/prize/update', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} +// 查询普通用户 +export function getUserList(data) { + return request({ + url: '/admin/user/list', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} +// 普通用户新增 +export function addUser(data) { + return request({ + url: '/admin/user/add', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} +// 普通用户删除 +export function deleteUser(id) { + return request({ + url: '/admin/user/delete', + method: 'post', + params: { id }, + headers: { + 'Content-Type': 'application/json' + } + }) +} +// 普通用户批量删除 +export function deleteUsers(ids) { + return request({ + url: '/admin/user/delete/batch', + method: 'post', + params: { ids } + }) +} +// 内定用户查全部 +export function getFixUserList(data) { + return request({ + url: '/admin/user/list/fix', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} +// 内定用户删除 +export function deleteFixUser(id) { + return request({ + url: '/admin/user/delete/fix', + method: 'post', + params: { id }, + headers:{ + 'Content-Type': 'application/json' + } + }) +} +// 内定用户新增 +export function addFixUser(data) { + return request({ + url: '/admin/prize/addFixUser', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} +// 内定用户批量删除 +export function deleteFixUsers(ids) { + return request({ + url: '/admin/user/delete/fix/batch', + method: 'post', + params: { ids }, + headers: { + 'Content-Type': 'application/json' + } + }) +} +// 导入用户 +export const importUsers = (file) => { + const formData = new FormData(); + formData.append('file', file); + return request({ + url: '/admin/user/import', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; +// 导入内定用户 +export const importFixUsers = (file,gradeId) => { + const formData = new FormData(); + formData.append('file', file); + formData.append('gradeId',gradeId); + return request({ + url: '/admin/user/import/fix', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; diff --git a/activitylink/src/api/manage/level.js b/activitylink/src/api/manage/level.js index d7fed4e..021d1a9 100644 --- a/activitylink/src/api/manage/level.js +++ b/activitylink/src/api/manage/level.js @@ -1,30 +1,60 @@ import request from '@/utils/request' - -export function deleteLevel() { +// 等级查询 +export function getLevelList(params) { + return request({ + url: '/admin/grade/list', + method: 'post', + params: params + }) +} +// 等级新增 +export function addLevel(data) { + return request({ + url: '/admin/grade/add', + method: 'post', + data, + headers: { + 'Content-Type': 'application/json' + } + }) +} +// 删除等级 +export function deleteGrade(id) { return request({ url: '/admin/grade/delete', method: 'post', - + params: { id } }) } - - -export function getLevelList(pageNum,pageSize){ +// 根据id查询等级 +// export function getgradedetails(params) { +// return request({ +// url: '/admin/grade/details', +// method: 'post', +// params: params +// }) +// } +// 修改等级 +export function updateGrade(data) { return request({ - url: '/admin/grade/list', + url: '/admin/grade/update', method: 'post', - params: { - pageNum, - pageSize + data, + headers: { + 'Content-Type': 'application/json' } }) } - -export function addLevel(data) { +// 等级名下拉框,礼品新增那边 +export function getGradeNameList() { return request({ - url: '/admin/grade/add', + url: '/admin/grade/allGradeName', method: 'post', - data + headers: { + 'Content-Type': 'application/json' + } }) -} \ No newline at end of file +} + + diff --git a/activitylink/src/views/homePage.vue b/activitylink/src/views/homePage.vue index a03962c..51cd0aa 100644 --- a/activitylink/src/views/homePage.vue +++ b/activitylink/src/views/homePage.vue @@ -26,27 +26,25 @@ const username = ref(""); const password = ref(""); // username.value=='90038794' && password.value=='697522'写死的账号密码 const loginHandler = async () => { - // try { - // const response = await adminlogin({ - // username: username.value, - // password: password.value - // }) - router.push('/zhongchou/mainimg') - // 假设后端返回 code == 200 表示成功 -// if (response.code ) { -// const token = response.code - -// // ✅ 保存 token 到 localStorage -// localStorage.setItem('token', token) -// ElMessage.success('登录成功,欢迎您使用本系统') -// router.push('/zhongchou/mainimg') -// } else { -// ElMessage.error(response.message || '登录失败,请检查用户名或密码') -// } - // } catch (error) { - // ElMessage.error('登录失败,请稍后再试') - // console.error('登录错误:', error) - // } + try { + const response = await adminlogin({ + username: username.value, + password: password.value + }) + // router.push('/zhongchou/mainimg') + if (response.code === 200 ) { + const token = response.data.token + // console.log(token) + localStorage.setItem('token', token) + ElMessage.success('登录成功,欢迎您使用本系统') + router.push('/zhongchou/mainimg') + } else { + ElMessage.error(response.message || '登录失败,请检查用户名或密码') + } + } catch (error) { + ElMessage.error('登录失败,请稍后再试') + console.error('登录错误:', error) + } } \ No newline at end of file + ElMessageBox.confirm(`确定要删除选中的${selectedIds.value.length}条数据吗?`, + '删除确认', + { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + } + ).then(async () => { + try { + const response = await deleteFixUsers(selectedIds.value.join(',')) + if (response.code === 200) { + ElMessage.success('批量删除成功') + getFixUsers() + selectedIds.value = [] + } else { + ElMessage.error(response.message || '批量删除失败') + } + } catch (error) { + console.error('批量删除请求失败:', error) + ElMessage.error('网络错误,批量删除失败') + } + }).catch(() => { + ElMessage.info('已取消批量删除') + }) +} +const handleSelectionChange = (selection) => { + selectedIds.value = selection.map(row => row.id) +} +const trimJwcode = (value) => { + searchObj.value.jwcode = value.replace(/\D/g, '') +} +const trimAddJwcode = (value) => { + addObj.value.jwcode = value.replace(/\D/g, '') +} +const handleSizeChange = (val) => { + pagination.value.pageSize = val + pagination.value.pageNum = 1 + getFixUsers() +} +const handleCurrentChange = (val) => { + pagination.value.pageNum = val + getFixUsers() +} +// 返回上一页 +const goBack = () => { + router.back() +} +onMounted(() => { + getFixUsers() +}) + + \ No newline at end of file diff --git a/activitylink/src/views/zhongchou/gift/importuser/index.vue b/activitylink/src/views/zhongchou/gift/importuser/index.vue index f38ae5e..533307c 100644 --- a/activitylink/src/views/zhongchou/gift/importuser/index.vue +++ b/activitylink/src/views/zhongchou/gift/importuser/index.vue @@ -1,275 +1,259 @@ - - - - - - - - - - - - - - - - - const handleJingwangIdInput = (value) => { - searchData.value.jingwangId = value.replace(/\D/g, '') + \ No newline at end of file + +.el-table { + margin-top: 10px; +} + +.el-pagination { + margin: 0; +} + \ No newline at end of file diff --git a/activitylink/src/views/zhongchou/gift/index.vue b/activitylink/src/views/zhongchou/gift/index.vue index cb0f275..5186a93 100644 --- a/activitylink/src/views/zhongchou/gift/index.vue +++ b/activitylink/src/views/zhongchou/gift/index.vue @@ -1,90 +1,111 @@ - - \ No newline at end of file diff --git a/activitylink/src/views/zhongchou/level/index.vue b/activitylink/src/views/zhongchou/level/index.vue index b01f96f..4fcfe0a 100644 --- a/activitylink/src/views/zhongchou/level/index.vue +++ b/activitylink/src/views/zhongchou/level/index.vue @@ -1,242 +1,282 @@ \ No newline at end of file diff --git a/activitylink/src/views/zhongchou/winning/index.vue b/activitylink/src/views/zhongchou/winning/index.vue index 4ef7a02..fc985fb 100644 --- a/activitylink/src/views/zhongchou/winning/index.vue +++ b/activitylink/src/views/zhongchou/winning/index.vue @@ -106,6 +106,16 @@ const fetchWinLevelList = async () => { } } +const handleSizeChange = (val) => { + pagination.value.pageSize = val + pagination.value.pageNum = 1 + getPrizes() +} + +const handleCurrentChange = (val) => { + pagination.value.pageNum = val + getPrizes() +} // 获取中奖列表 const fetchWinList = async () => { try {