hookehuyr

fix 李琛测试调整优化细节

1 <!-- 1 <!--
2 * @Date: 2024-07-23 12:53:15 2 * @Date: 2024-07-23 12:53:15
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-07-26 17:39:31 4 + * @LastEditTime: 2024-07-27 21:00:09
5 * @FilePath: /temple_material_request/src/views/material_pre_request.vue 5 * @FilePath: /temple_material_request/src/views/material_pre_request.vue
6 * @Description: 待申领物资页面 6 * @Description: 待申领物资页面
7 --> 7 -->
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
38 {{ item.product_name }} / {{ item.spec }} 38 {{ item.product_name }} / {{ item.spec }}
39 </div> 39 </div>
40 </van-col> 40 </van-col>
41 - <van-col span="8" style="display: flex; align-items: center;"> 41 + <van-col v-if="item.edit" span="8" style="display: flex; align-items: center;">
42 <van-field 42 <van-field
43 v-model="item.apply_number" 43 v-model="item.apply_number"
44 style="border: 1px solid #f0f0f0; padding: 0; border-radius: 5px;" 44 style="border: 1px solid #f0f0f0; padding: 0; border-radius: 5px;"
...@@ -47,12 +47,15 @@ ...@@ -47,12 +47,15 @@
47 input-align="center" 47 input-align="center"
48 placeholder="数量" 48 placeholder="数量"
49 type="number" 49 type="number"
50 - :disabled="!item.edit"
51 @blur="onBlur(item)" 50 @blur="onBlur(item)"
51 + @focus="onFocus(item)"
52 > 52 >
53 <template #left-icon></template> 53 <template #left-icon></template>
54 </van-field>&nbsp;&nbsp;<span style="font-size: 0.9rem; color: #666;">个</span> 54 </van-field>&nbsp;&nbsp;<span style="font-size: 0.9rem; color: #666;">个</span>
55 </van-col> 55 </van-col>
56 + <van-col v-else span="8" style="display: flex; align-items: center; justify-content: end;">
57 + <span style="font-size: 0.9rem; color: #666;">{{ item.apply_number }}</span>&nbsp;&nbsp;<span style="font-size: 0.9rem; color: #666;">个</span>
58 + </van-col>
56 </van-row> 59 </van-row>
57 <div v-if="item.error" style="padding: 0.5rem 2rem 0 0; font-size: 0.85rem; color: red; text-align: right;">输入值有误</div> 60 <div v-if="item.error" style="padding: 0.5rem 2rem 0 0; font-size: 0.85rem; color: red; text-align: right;">输入值有误</div>
58 </div> 61 </div>
...@@ -141,7 +144,7 @@ const $route = useRoute(); ...@@ -141,7 +144,7 @@ const $route = useRoute();
141 const $router = useRouter(); 144 const $router = useRouter();
142 useTitle($route.meta.title); 145 useTitle($route.meta.title);
143 146
144 -const activity_id = $route.query.activity_id ? $route.query.activity_id : 800863; 147 +const activity_id = $route.query.activity_id ? $route.query.activity_id : '';
145 const form_id = $route.query.form_id ? $route.query.form_id : ''; 148 const form_id = $route.query.form_id ? $route.query.form_id : '';
146 const client_id = $route.query.client_id ? $route.query.client_id : ''; 149 const client_id = $route.query.client_id ? $route.query.client_id : '';
147 150
...@@ -155,6 +158,9 @@ const getDeptsList = async () => { ...@@ -155,6 +158,9 @@ const getDeptsList = async () => {
155 const { data, code } = await myDeptsAPI(); 158 const { data, code } = await myDeptsAPI();
156 if (code) { 159 if (code) {
157 my_depts.value = data; 160 my_depts.value = data;
161 + if (data.length === 1) { // 默认选中第一个
162 + type_checked.value = data[0].dept_id;
163 + }
158 if (!data.length) { 164 if (!data.length) {
159 showToast('您暂无组别无法申领物资'); 165 showToast('您暂无组别无法申领物资');
160 disabled_btn.value = true; 166 disabled_btn.value = true;
...@@ -316,6 +322,12 @@ const onBlur = async (item) => { // 输入框失去焦点回调 ...@@ -316,6 +322,12 @@ const onBlur = async (item) => { // 输入框失去焦点回调
316 } 322 }
317 } 323 }
318 324
325 +const onFocus = (item) => {
326 + if (item.apply_number === '0') {
327 + item.apply_number = '';
328 + }
329 +}
330 +
319 const list = ref([]); 331 const list = ref([]);
320 332
321 const material_id = ref(''); 333 const material_id = ref('');
......