Showing
2 changed files
with
25 additions
and
18 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-07-23 18:31:35 | 2 | * @Date: 2024-07-23 18:31:35 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-07-26 10:11:43 | 4 | + * @LastEditTime: 2024-07-26 16:28:22 |
| 5 | * @FilePath: /temple_material_request/src/components/materialDetail/index.vue | 5 | * @FilePath: /temple_material_request/src/components/materialDetail/index.vue |
| 6 | * @Description: 物资详情页面 | 6 | * @Description: 物资详情页面 |
| 7 | --> | 7 | --> |
| 8 | <template> | 8 | <template> |
| 9 | - <div v-if="showRight" class="material-detail-page"> | 9 | + <div class="material-detail-page"> |
| 10 | <van-popup | 10 | <van-popup |
| 11 | v-model:show="showRight" | 11 | v-model:show="showRight" |
| 12 | position="right" | 12 | position="right" |
| 13 | - closeable | ||
| 14 | - @close="onClose" | ||
| 15 | :style="{ height: '100%', width: '100%' }" | 13 | :style="{ height: '100%', width: '100%' }" |
| 16 | > | 14 | > |
| 17 | <div style="margin-top: 3rem; background-color: white;"> | 15 | <div style="margin-top: 3rem; background-color: white;"> |
| ... | @@ -92,6 +90,10 @@ | ... | @@ -92,6 +90,10 @@ |
| 92 | </van-col> | 90 | </van-col> |
| 93 | </van-row> | 91 | </van-row> |
| 94 | </div> | 92 | </div> |
| 93 | + <div style="height: 4rem;"></div> | ||
| 94 | + <div style="padding: 1rem; position: fixed; bottom: 10px; left:0; right: 0;"> | ||
| 95 | + <van-button block :color="styleColor.baseColor" @click="onClose">关闭</van-button> | ||
| 96 | + </div> | ||
| 95 | </div> | 97 | </div> |
| 96 | </van-popup> | 98 | </van-popup> |
| 97 | </div> | 99 | </div> |
| ... | @@ -106,6 +108,7 @@ import { Cookies, $, _, axios, storeToRefs, mainStore, Toast, useTitle } from '@ | ... | @@ -106,6 +108,7 @@ import { Cookies, $, _, axios, storeToRefs, mainStore, Toast, useTitle } from '@ |
| 106 | //import { } from '@/utils/generateIcons.js' | 108 | //import { } from '@/utils/generateIcons.js' |
| 107 | //import { } from '@/composables' | 109 | //import { } from '@/composables' |
| 108 | import { getSkuInfoAPI } from "@/api/material"; | 110 | import { getSkuInfoAPI } from "@/api/material"; |
| 111 | +import { styleColor } from "@/constant.js"; | ||
| 109 | 112 | ||
| 110 | const $route = useRoute(); | 113 | const $route = useRoute(); |
| 111 | const $router = useRouter(); | 114 | const $router = useRouter(); | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-07-23 10:50:38 | 2 | * @Date: 2024-07-23 10:50:38 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-07-26 14:39:00 | 4 | + * @LastEditTime: 2024-07-26 16:25:16 |
| 5 | * @FilePath: /temple_material_request/src/views/material_list.vue | 5 | * @FilePath: /temple_material_request/src/views/material_list.vue |
| 6 | * @Description: 物资情况页面 | 6 | * @Description: 物资情况页面 |
| 7 | --> | 7 | --> |
| ... | @@ -21,7 +21,7 @@ | ... | @@ -21,7 +21,7 @@ |
| 21 | <div class="item-title van-ellipsis" :style="{ color: styleColor.baseColor }" @click="onClickTitle(item)">{{ item.product_name }} / {{ item.spec }}</div> | 21 | <div class="item-title van-ellipsis" :style="{ color: styleColor.baseColor }" @click="onClickTitle(item)">{{ item.product_name }} / {{ item.spec }}</div> |
| 22 | <div class="item-attr"> | 22 | <div class="item-attr"> |
| 23 | <div v-for="(x, index) in item.order_list" :key="index"> | 23 | <div v-for="(x, index) in item.order_list" :key="index"> |
| 24 | - 申领人: {{ x.contact_name }} {{ x.use_time }} 使用 | 24 | + 申领人:{{ x.contact_name }} {{ x.use_time }} 使用 |
| 25 | </div> | 25 | </div> |
| 26 | </div> | 26 | </div> |
| 27 | </van-col> | 27 | </van-col> |
| ... | @@ -39,7 +39,7 @@ | ... | @@ -39,7 +39,7 @@ |
| 39 | </van-tab> | 39 | </van-tab> |
| 40 | </van-tabs> | 40 | </van-tabs> |
| 41 | <div style="height: 4rem;"></div> | 41 | <div style="height: 4rem;"></div> |
| 42 | - <div style="position: fixed; left: 0; right: 0; bottom: 0; padding: 1rem; background-color: white;"> | 42 | + <div style="position: fixed; left: 0; right: 0; bottom: 0; padding: 1rem; background-color: white; box-shadow: 0rem -0.33rem 0.33rem 0.08rem rgba(0,0,0,0.06);"> |
| 43 | <van-button @click="onClickRequest" type="primary" block :color="styleColor.baseColor">我要申领</van-button> | 43 | <van-button @click="onClickRequest" type="primary" block :color="styleColor.baseColor">我要申领</van-button> |
| 44 | </div> | 44 | </div> |
| 45 | </div> | 45 | </div> |
| ... | @@ -68,6 +68,8 @@ const activity_id = $route.query.activity_id ? $route.query.activity_id : ''; | ... | @@ -68,6 +68,8 @@ const activity_id = $route.query.activity_id ? $route.query.activity_id : ''; |
| 68 | const form_id = $route.query.form_id ? $route.query.form_id : ''; | 68 | const form_id = $route.query.form_id ? $route.query.form_id : ''; |
| 69 | const client_id = $route.query.client_id ? $route.query.client_id : ''; | 69 | const client_id = $route.query.client_id ? $route.query.client_id : ''; |
| 70 | 70 | ||
| 71 | +const dept_id = ref(''); | ||
| 72 | + | ||
| 71 | onMounted(async () => { | 73 | onMounted(async () => { |
| 72 | const { data, code } = await getActivityDeptsAPI({ activity_id, is_previous: 0, only_my_dept: 0 }); | 74 | const { data, code } = await getActivityDeptsAPI({ activity_id, is_previous: 0, only_my_dept: 0 }); |
| 73 | if (code) { | 75 | if (code) { |
| ... | @@ -80,6 +82,7 @@ onMounted(async () => { | ... | @@ -80,6 +82,7 @@ onMounted(async () => { |
| 80 | message: '物资列表为空,将前往添加!', | 82 | message: '物资列表为空,将前往添加!', |
| 81 | confirmButtonColor: styleColor.baseColor | 83 | confirmButtonColor: styleColor.baseColor |
| 82 | }).then(() => { | 84 | }).then(() => { |
| 85 | + // 跳转购物车页面 | ||
| 83 | $router.push({ | 86 | $router.push({ |
| 84 | path: '/material_pre_request', | 87 | path: '/material_pre_request', |
| 85 | query: { | 88 | query: { |
| ... | @@ -93,9 +96,12 @@ onMounted(async () => { | ... | @@ -93,9 +96,12 @@ onMounted(async () => { |
| 93 | } | 96 | } |
| 94 | }); | 97 | }); |
| 95 | 98 | ||
| 99 | +// 切换组别模块 | ||
| 96 | const active = ref(0); | 100 | const active = ref(0); |
| 97 | -const onChange = async (index) => { | 101 | +const tabList = ref([]); // 组别列表 |
| 102 | +const onChange = async (index) => { // 切换组别回调 | ||
| 98 | dept_id.value = tabList.value[index]['dept_id']; | 103 | dept_id.value = tabList.value[index]['dept_id']; |
| 104 | + // 重置物资列表 | ||
| 99 | limit.value = 20; | 105 | limit.value = 20; |
| 100 | offset.value = 0; | 106 | offset.value = 0; |
| 101 | loading.value = false; | 107 | loading.value = false; |
| ... | @@ -103,12 +109,9 @@ const onChange = async (index) => { | ... | @@ -103,12 +109,9 @@ const onChange = async (index) => { |
| 103 | list.value = []; | 109 | list.value = []; |
| 104 | } | 110 | } |
| 105 | 111 | ||
| 106 | -const tabList = ref([]); // 组别列表 | 112 | +// 物资列表模块 |
| 107 | -const dept_id = ref(''); | ||
| 108 | - | ||
| 109 | const limit = ref(20); | 113 | const limit = ref(20); |
| 110 | const offset = ref(0); | 114 | const offset = ref(0); |
| 111 | - | ||
| 112 | const list = ref([]); | 115 | const list = ref([]); |
| 113 | const loading = ref(false); | 116 | const loading = ref(false); |
| 114 | const finished = ref(false); | 117 | const finished = ref(false); |
| ... | @@ -135,7 +138,13 @@ const onClickTitle = (item) => { // 点击物资标题回调 | ... | @@ -135,7 +138,13 @@ const onClickTitle = (item) => { // 点击物资标题回调 |
| 135 | material_id.value = item.good_id; | 138 | material_id.value = item.good_id; |
| 136 | } | 139 | } |
| 137 | 140 | ||
| 141 | +const show_material_detail = ref(false); | ||
| 142 | +const onCloseDetail = () => { // 关闭物资详情回调 | ||
| 143 | + show_material_detail.value = false; | ||
| 144 | +} | ||
| 145 | + | ||
| 138 | const onClickRequest = () => { // 我要申领物资 | 146 | const onClickRequest = () => { // 我要申领物资 |
| 147 | + // 上一次申领物资列表 | ||
| 139 | $router.push({ | 148 | $router.push({ |
| 140 | path: '/material_request', | 149 | path: '/material_request', |
| 141 | query: { | 150 | query: { |
| ... | @@ -143,12 +152,7 @@ const onClickRequest = () => { // 我要申领物资 | ... | @@ -143,12 +152,7 @@ const onClickRequest = () => { // 我要申领物资 |
| 143 | form_id, | 152 | form_id, |
| 144 | client_id | 153 | client_id |
| 145 | } | 154 | } |
| 146 | - }) | 155 | + }); |
| 147 | -} | ||
| 148 | - | ||
| 149 | -const show_material_detail = ref(false); | ||
| 150 | -const onCloseDetail = () => { | ||
| 151 | - show_material_detail.value = false; | ||
| 152 | } | 156 | } |
| 153 | </script> | 157 | </script> |
| 154 | 158 | ... | ... |
-
Please register or login to post a comment