hookehuyr

fix 李琛测试调整优化细节

<!--
* @Date: 2024-07-23 12:53:15
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-07-26 17:39:31
* @LastEditTime: 2024-07-27 21:00:09
* @FilePath: /temple_material_request/src/views/material_pre_request.vue
* @Description: 待申领物资页面
-->
......@@ -38,7 +38,7 @@
{{ item.product_name }} / {{ item.spec }}
</div>
</van-col>
<van-col span="8" style="display: flex; align-items: center;">
<van-col v-if="item.edit" span="8" style="display: flex; align-items: center;">
<van-field
v-model="item.apply_number"
style="border: 1px solid #f0f0f0; padding: 0; border-radius: 5px;"
......@@ -47,12 +47,15 @@
input-align="center"
placeholder="数量"
type="number"
:disabled="!item.edit"
@blur="onBlur(item)"
@focus="onFocus(item)"
>
<template #left-icon></template>
</van-field>&nbsp;&nbsp;<span style="font-size: 0.9rem; color: #666;">个</span>
</van-col>
<van-col v-else span="8" style="display: flex; align-items: center; justify-content: end;">
<span style="font-size: 0.9rem; color: #666;">{{ item.apply_number }}</span>&nbsp;&nbsp;<span style="font-size: 0.9rem; color: #666;">个</span>
</van-col>
</van-row>
<div v-if="item.error" style="padding: 0.5rem 2rem 0 0; font-size: 0.85rem; color: red; text-align: right;">输入值有误</div>
</div>
......@@ -141,7 +144,7 @@ const $route = useRoute();
const $router = useRouter();
useTitle($route.meta.title);
const activity_id = $route.query.activity_id ? $route.query.activity_id : 800863;
const activity_id = $route.query.activity_id ? $route.query.activity_id : '';
const form_id = $route.query.form_id ? $route.query.form_id : '';
const client_id = $route.query.client_id ? $route.query.client_id : '';
......@@ -155,6 +158,9 @@ const getDeptsList = async () => {
const { data, code } = await myDeptsAPI();
if (code) {
my_depts.value = data;
if (data.length === 1) { // 默认选中第一个
type_checked.value = data[0].dept_id;
}
if (!data.length) {
showToast('您暂无组别无法申领物资');
disabled_btn.value = true;
......@@ -316,6 +322,12 @@ const onBlur = async (item) => { // 输入框失去焦点回调
}
}
const onFocus = (item) => {
if (item.apply_number === '0') {
item.apply_number = '';
}
}
const list = ref([]);
const material_id = ref('');
......