wuguojie пре 8 месеци
родитељ
комит
067a441006
2 измењених фајлова са 28 додато и 9 уклоњено
  1. 28 8
      src/views/insurancePolicy/index.vue
  2. 0 1
      src/views/insurancePolicy/orderDetail.vue

+ 28 - 8
src/views/insurancePolicy/index.vue

@@ -1210,11 +1210,11 @@
             <el-table-column label="操作" align="center" width="360">
               <template #default="scope">
                 <div v-if="currentRow.some(a => a.id === scope.row.id)">
-                  <el-button link type="primary" @click="handleCount(scope)">优惠测算</el-button>
+                  <el-button v-if="scope.row.quoteResult" link type="primary" @click="handleCount(scope)">优惠测算</el-button>
                   <el-button v-if="scope.row.quoteResult" link type="primary" @click="toDetail(scope)">详情</el-button>
                   <el-button link type="primary" :loading="scope.row.loading" @click="handleSubmit(InsurancePolicyRefs,scope)">计算保费</el-button>
-                  <el-button link type="primary" @click="handleShare(scope)">分享</el-button>
-                  <el-button link type="primary" @click="handleUnderwriting(scope)">核保</el-button>
+                  <el-button v-if="scope.row.quoteResult" link type="primary" @click="handleShare(scope)">分享</el-button>
+                  <el-button v-if="scope.row.quoteResult" link type="primary" @click="handleUnderwriting(scope)">核保</el-button>
                 </div>
               </template>
             </el-table-column>
@@ -1315,7 +1315,7 @@
       title="分享"
     >
       <div class="imageCode">
-        <img  />
+        <img :src="shareImageUrl" />
       </div>
       <template #footer>
         <el-button plain type="primary" @click="handleSaveImage">保存图片</el-button>
@@ -1426,7 +1426,6 @@ import insurance from "../additionalOrder/additional/modules/insuranceSelect.vue
 import driving from '../../layouts/components/DrivingType/index.vue'
 import detail from '../../layouts/components/JYXDetail/index.vue'
 import QRCode from 'qrcode'
-import QrcodeVue from 'qrcode.vue';
 
 
 const SalesmanSelectRef = ref()
@@ -2552,14 +2551,35 @@ let tableData = ref([])
 
 // 分享
 let shareShow = ref(false)
-const handleShare = (scope) => {
-  shareShow.value = true
+let shareImageUrl = ref('')
+const handleShare = async (scope) => {
+    shareShow.value = true
+    shareImageUrl.value = await QRCode.toDataURL('http://www.baidu.com', {
+        width: 150,
+        margin: 2
+    });
 }
 const handleSaveImage = () => {
   shareShow.value = false
+    const link = document.createElement('a');
+    link.href = shareImageUrl.value;
+    link.download = '报价.png';
+    link.click();
 }
-const handleCopyLink = () => {
+const handleCopyLink = async () => {
   shareShow.value = false
+    try {
+        await navigator.clipboard.writeText('你想要复制的文本');
+        ElMessage({
+            message: '复制成功!',
+            type: 'success'
+        })
+    } catch (err) {
+        ElMessage({
+            message: '复制失败!',
+            type: 'error'
+        })
+    }
 }
 
 // 优惠测算

+ 0 - 1
src/views/insurancePolicy/orderDetail.vue

@@ -1032,7 +1032,6 @@ import api from '@/api'
 import { useRoute, useRouter } from 'vue-router'
 import { ElMessage } from "element-plus";
 
-import QrcodeVue from 'qrcode.vue';
 import DialogInsuranceEdit from '@/views/orderBatchAdjust/DialogInsuranceEdit.vue';
 import DialogInsuranceCancel from '@/views/orderBatchAdjust/DialogInsuranceCancel.vue';