瀏覽代碼

feat:添加农事,报价单转发功能

wangsisi 2 天之前
父節點
當前提交
a73cb0e3e0

+ 7 - 1
src/components/chatWindow.vue

@@ -326,13 +326,19 @@ watch(
                         linkUrl:`/completed_work?json=${JSON.stringify({id:params.id})}`,
                         time: getCurrentTime(),
                     };
-                    if(params.executeEvidence.length > 5) {
+                    if(params.executeEvidence && params.executeEvidence.length > 5) {
                         const imgArr = JSON.parse(params.executeEvidence);
                         message.coverUrl = imgArr[imgArr.length - 1];
                     }
                     
                     if(params.type === 'quotation') {
                         message.cardType = 'quotation';
+                        const jsonParams = {
+                            id:params.id,
+                            farmWorkOrderId:params.farmWorkOrderId,
+                            isAssign: true
+                        }
+                        message.linkUrl = `/completed_work?json=${JSON.stringify(jsonParams)}`;
                     }
                     
                     sendMessage(message);

+ 16 - 1
src/components/popup/priceSheetPopup.vue

@@ -129,6 +129,7 @@
 import { Popup } from "vant";
 import { ref, computed, onActivated } from "vue";
 import { useRouter } from "vue-router";
+import { ElMessage } from "element-plus";
 import wx from "weixin-js-sdk";
 import html2canvas from "html2canvas";
 
@@ -221,7 +222,21 @@ function fetchPriceData() {
 }
 
 const handleShare = () => {
-    console.log("handleShare");
+    const userId = quotationData.value.users[0]?.userId;
+    const parmasPage = {
+        farmWorkOrderId:quotationData.value.orderId,
+        farmMiniUserId:userId,
+        farmMiniUserName:quotationData.value.expertUserName,
+        farmId:quotationData.value.farmId,
+        farmWorkName:quotationData.value.farmWorkName,
+        id:quotationData.value.id,
+        type:'quotation'
+    }
+    if(userId){
+        router.push(`/chat_frame?userId=${userId}&name=${parmasPage.farmMiniUserName}&farmId=${parmasPage.farmId}&pageParams=${JSON.stringify(parmasPage)}`);
+    }else{
+        ElMessage.warning('尚未绑定用户,暂时无法分享')
+    }   
 };
 
 const handleWechat = () => {

+ 1 - 0
src/views/old_mini/modify_work/completedWork.vue

@@ -482,6 +482,7 @@ onActivated(async () => {
     parmasPage.value = {
         farmMiniUserId:detailData.value.users[0]?.userId,
         farmMiniUserName:detailData.value.expertUserName,
+        farmWorkOrderId:detailData.value.orderId,
         farmId:detailData.value.farmId,
         executeEvidence:JSON.stringify(detailData.value.executeEvidence),
         farmWorkName:detailData.value.farmWorkName,

+ 1 - 1
src/views/old_mini/task_condition/components/task.vue

@@ -316,7 +316,7 @@ function handlePopupBtn() {
 function handleForward(item) {
     onlyShare.value = true;
     setTimeout(() => {
-        uploadExecuteRef.value.showPopup({...item, type:'quotation'},'share-sheet');
+        uploadExecuteRef.value.showPopup({...item, type:'quotation', farmWorkOrderId:item.orderId},'share-sheet');
     }, 10);
    
 }