ソースを参照

fix: 农事报价信息

lxf 2 週間 前
コミット
48d1f1a78e

+ 12 - 8
src/components/popup/priceSheetPopup.vue

@@ -14,7 +14,7 @@
                         <div class="qr-text">扫码查看详情</div>
                     </div>
                 </div>
-                <div class="sheet-content">
+                <div class="sheet-content" v-loading="loading">
                     <!-- 报价详情区域 -->
                     <div class="quotation-info">
                         <div class="info-item">
@@ -206,14 +206,18 @@ const handleShowPopup = (data) => {
     showPopup.value = true;
 };
 
+const loading = ref(false);
 function fetchPriceData() {
     if (!quotationData.value?.id) {
         return;
     }
+    loading.value = true;
     VE_API.z_farm_work_record_cost.getByRecordId({ farmWorkRecordId: quotationData.value.id }).then(({ data }) => {
         priceData.value = data;
     }).catch(() => {
         // 获取价格数据失败
+    }).finally(() => {
+        loading.value = false;
     });
 }
 
@@ -330,16 +334,16 @@ const handleEdit = () => {
 
 // 清空数据
 const clearData = () => {
-    quotationData.value = {};
-    priceData.value = {};
+    // quotationData.value = {};
+    // priceData.value = {};
 };
 
 // 监听弹窗关闭,清空数据
-watch(showPopup, (newVal) => {
-    if (!newVal) {
-        // clearData();
-    }
-});
+// watch(showPopup, (newVal) => {
+//     if (!newVal) {
+//         clearData();
+//     }
+// });
 
 const handleCancel = () => {
     showPopup.value = false;

+ 0 - 2
src/components/taskItem.vue

@@ -217,7 +217,6 @@ const getTriggerImg = async () => {
 
 // 更新触发图片(上传成功后调用)
 const updateTriggerImg = async () => {
-    console.log('updateTriggerImg', props.itemData.id)
     if (!props.itemData?.id) return;
     
     // 重新获取详情
@@ -270,7 +269,6 @@ function buildPrescriptionText(list) {
 async function getItemDetail(id) {
     const { data } = await VE_API.z_farm_work_record.getDetail({ id });
     detailItem.value = data[0];
-    console.log('detailItem', detailItem.value)
 }
 
 // 保留方法名以兼容,但同步返回已生成的文案

+ 11 - 5
src/views/old_mini/task_condition/components/task.vue

@@ -182,14 +182,20 @@ const setTaskItemRef = (el, index) => {
     }
 };
 
-const handleUploadSuccess = () =>{
-    console.log('handleUploadSuccess', taskItemRefs.value)
-    getSimpleList();
+const handleUploadSuccess = async () =>{
+    // 先保存当前需要更新的 item id
+    const currentItemIds = taskList.value.map(item => item.id || item.workRecordId);
+    
+    // 刷新列表
+    await getSimpleList();
+    
+    // 等待 DOM 更新完成,refs 被重新收集
+    await nextTick();
+    
     // 更新所有task-item的triggerImg
     taskItemRefs.value.forEach(ref => {
         if (ref && ref.updateTriggerImg) {
             ref.updateTriggerImg();
-            console.log('updateTriggerImg', ref)
         }
     });
 }
@@ -229,7 +235,7 @@ function getSimpleList() {
     taskItemRefs.value = [];
     const location = store.state.home.miniUserLocationPoint;
     const startFlowStatus = getStartFlowStatus(activeIndex.value);
-    VE_API.z_farm_work_record.getSimpleList({ role: 2, location, flowStatus: startFlowStatus }).then(({data}) => {
+    return VE_API.z_farm_work_record.getSimpleList({ role: 2, location, flowStatus: startFlowStatus }).then(({data}) => {
         loading.value = false;
         // 假设返回的数据结构是 { list: [], total: 0 } 或者直接是数组
         if (Array.isArray(data) && data.length > 0) {