Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
temple_material_request
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2024-07-29 15:21:50 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
810cf0edee80d329dbd4348358a4ffdd36d5ed01
810cf0ed
1 parent
9d8dfd77
我要申领按钮判断逻辑调整,如果 can_ref_previous 为true,就跳转到上次活动的页面为 false 就跳转到购物车
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
src/views/material_list.vue
src/views/material_pre_request.vue
src/views/material_list.vue
View file @
810cf0e
<!--
* @Date: 2024-07-23 10:50:38
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-07-29 1
0:58:3
7
* @LastEditTime: 2024-07-29 1
5:19:1
7
* @FilePath: /temple_material_request/src/views/material_list.vue
* @Description: 物资情况页面
-->
...
...
@@ -70,6 +70,7 @@ const form_id = $route.query.form_id ? $route.query.form_id : '';
const client_id = $route.query.client_id ? $route.query.client_id : '';
const dept_id = ref('');
const canRefPrevious = ref(false); // 是否参考上一次活动
onMounted(async () => {
const { data, code } = await getActivityDeptsAPI({ activity_id, is_previous: 0, only_my_dept: 0 });
...
...
@@ -77,16 +78,6 @@ onMounted(async () => {
tabList.value = data;
if (tabList.value.length) { // 默认选中组别ID
dept_id.value = tabList.value[0]['dept_id'];
} else { // 组别为空时跳转到申领物资页面
// 跳转申领物资页面
$router.push({
path: '/material_request',
query: {
activity_id,
form_id,
client_id
}
})
}
}
});
...
...
@@ -113,7 +104,7 @@ const finished = ref(false);
const onLoad = async () => {
// 异步更新数据
const { code, data } = await getGoodUseListAPI({ activity_id, dept_id: dept_id.value, is_previous: 0, offset: offset.value, limit: limit.value });
const { code, data
, can_ref_previous
} = await getGoodUseListAPI({ activity_id, dept_id: dept_id.value, is_previous: 0, offset: offset.value, limit: limit.value });
if (code) {
list.value = _.concat(list.value, data);
list.value = _.uniqBy(list.value, 'good_id');
...
...
@@ -124,6 +115,7 @@ const onLoad = async () => {
// 加载状态结束
finished.value = true;
}
canRefPrevious.value = can_ref_previous;
}
};
...
...
@@ -139,6 +131,7 @@ const onCloseDetail = () => { // 关闭物资详情回调
}
const onClickRequest = () => { // 我要申领物资
if (canRefPrevious.value) { // 跳转上次活动页面
// 上一次申领物资列表
$router.push({
path: '/material_request',
...
...
@@ -148,6 +141,16 @@ const onClickRequest = () => { // 我要申领物资
client_id
}
});
} else { // 跳转购物车
$router.push({
path: '/material_pre_request',
query: {
activity_id,
form_id,
client_id
}
});
}
}
</script>
...
...
src/views/material_pre_request.vue
View file @
810cf0e
<!--
* @Date: 2024-07-23 12:53:15
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-07-29 1
0:30:14
* @LastEditTime: 2024-07-29 1
4:07:12
* @FilePath: /temple_material_request/src/views/material_pre_request.vue
* @Description: 待申领物资页面
-->
...
...
@@ -69,7 +69,7 @@
<!-- -->
<div style="display: flex; justify-content: space-between; align-items: center;">
<div style="display: flex; align-items: center;" @click="showPicker = true">
<div style="font-size: 0.85rem; color: #202020;">
使
用时间:</div>
<div style="font-size: 0.85rem; color: #202020;">
领
用时间:</div>
<div style="border: 1px solid #f0f0f0; border-radius: 5px; padding: 0.5rem 0.35rem 0.5rem 1rem; min-width: 6rem; font-size: 0.85rem; display: flex; align-items: center; justify-content: space-between;">{{ use_time }} <van-icon name="notes-o" size="1rem" :color="styleColor.baseColor" /></div>
</div>
<div style="display: flex; align-items: center;">
...
...
Please
register
or
login
to post a comment