Procházet zdrojové kódy

Merge branch 'dev/v1.1.1_tsz' of jianyu/web into feature/v1.1.1

汤世哲 před 3 měsíci
rodič
revize
f6476e8942

binární
apps/mobile/src/assets/image/reportanalysis/credit-corner-bg.png


+ 15 - 0
apps/mobile/src/router/modules/order.js

@@ -114,6 +114,21 @@ export default [
           desc: () => import('@/views/order/components/bigmember/Introduction')
         })
       },
+      {
+        path: 'creditreport',
+        name: 'createCreditReportOrder',
+        meta: {
+          header: true,
+          productId: 103,
+          title: '购买投标企业信用报告'
+        },
+        components: createRouterNamedComponents({
+          default: () =>
+            import('@/views/create-order/components/creditreport/Default'),
+          activity: null,
+          form: null
+        })
+      },
       {
         path: 'datareport',
         name: 'createDataReportOrder',

+ 14 - 0
apps/mobile/src/views/create-order/components/creditreport/Default.vue

@@ -0,0 +1,14 @@
+<template>
+  <ProductionCard />
+</template>
+
+<script>
+import ProductionCard from './ProductionCard'
+
+export default {
+  name: 'ProductionCardDefault',
+  components: {
+    ProductionCard
+  }
+}
+</script>

+ 256 - 0
apps/mobile/src/views/create-order/components/creditreport/ProductionCard.vue

@@ -0,0 +1,256 @@
+<template>
+  <div class="production-card credit-report-production-card">
+    <div class="report-func">
+      <div class="report-func-title">
+        报告作用
+      </div>
+      <div class="report-func-content">
+        信用报告通过信用背书、风险预警、政策适配,三大核心作用,成为投标企业参与市场竞争的关键工具。
+      </div>
+    </div>
+    <div class="report-info">
+      <van-form @submit="onSubmit">
+        <van-field
+          v-model="info.entName"
+          class="ent-input-field"
+          required
+          name="pattern"
+          label="投标企业名称"
+          placeholder="必填"
+          :show-error="false"
+          :rules="[
+            { required: true, message: '请输入投标企业名称' },
+            { pattern: /^.{3,}$/, message: '输入内容需大于两个字' }, // 添加正则验证规则
+          ]"
+          @input="onInput($event, 'ent')"
+          @blur="onBlur"
+        >
+          <template #extra>
+            <!-- 添加联想弹窗 -->
+            <div v-if="entList.length" class="ent-popup-container">
+              <div class="ent-popup-wrap">
+                <div v-for="(item, index) in entList" :key="index" class="wrap-list" @click="clickAssociation(item, 'ent')">
+                  {{ item.value }}
+                </div>
+              </div>
+            </div>
+          </template>
+        </van-field>
+        <van-field
+          v-model="info.companyName"
+          class="company-input-field"
+          required
+          name="pattern"
+          label="投标单位名称"
+          placeholder="必填"
+          :show-error="false"
+          :rules="[
+            { required: true, message: '请输入投标单位名称' },
+            { pattern: /^.{3,}$/, message: '输入内容需大于两个字' }, // 添加正则验证规则
+          ]"
+          @input="onInput($event, 'company')"
+          @blur="onBlur"
+        >
+          <template #extra>
+            <!-- 添加联想弹窗 -->
+            <div v-if="companyList.length" class="ent-popup-container">
+              <div class="ent-popup-wrap">
+                <div v-for="(item, index) in companyList" :key="index" class="wrap-list" @click="clickAssociation(item, 'company')">
+                  {{ item.value }}
+                </div>
+              </div>
+            </div>
+          </template>
+        </van-field>
+        <van-field
+          v-model="info.email"
+          required
+          name="pattern"
+          label="邮箱"
+          placeholder="必填,报告将发送至邮箱"
+          :show-error="false"
+          :rules="[
+            { required: true, message: '请输入邮箱' },
+            { pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, message: '请输入有效的邮箱地址' }, // 邮箱校验正则规则
+          ]"
+        />
+      </van-form>
+    </div>
+    <div class="report-tip">
+      支付成功后,系统将在XX分钟内将报告发送至您的邮箱,您也可前往“资产-报告下载记录”查看详情。
+    </div>
+  </div>
+</template>
+
+<script>
+import { mapMutations } from 'vuex'
+import { Field, Form } from 'vant'
+import { debounce } from '@/utils/utils'
+import { getCompanyAssociation } from '@/api/modules/'
+
+export default {
+  name: 'CreditReportProductionCard',
+  components: {
+    [Form.name]: Form,
+    [Field.name]: Field
+  },
+  data() {
+    return {
+      pageLayoutConf: {
+        title: '购买投标企业信用报告'
+      },
+      conf: {
+        productId: 104,
+        productName: '购买投标企业信用报告',
+        linkKey: 'creditReportLink',
+      },
+      info: {
+        entName: '',
+        companyName: '',
+        email: ''
+      },
+      entList: [],
+      companyList: []
+    }
+  },
+  computed: {},
+  mounted() {
+    this.updatePayAmount()
+  },
+  methods: {
+    ...mapMutations('createOrder', ['updateOrderAmount']),
+    updatePayAmount() {
+      // 假设新的支付金额为 100
+      const newPayAmount = 10000
+      this.updateOrderAmount({
+        originalPrice: 12000, // 可根据实际情况修改
+        discountAmount: 2000, // 可根据实际情况修改
+        discountPrice: newPayAmount
+      })
+    },
+    clickAssociation(item, type) {
+      if (type === 'ent') {
+        this.info.entName = item.value
+        this.entList = []
+      }
+      else {
+        this.info.companyName = item.value
+        this.companyList = []
+      }
+    },
+    onInput(value, type) {
+      const pattner = /^.{3,}$/
+      if (!pattner.test(value))
+        return
+      this.getCompany(value, type)
+    },
+    onBlur() {
+      // setTimeout(() => {
+      //   this.entList = []
+      //   this.companyList = []
+      // }, 300)
+    },
+    // 获取公司联想数据
+    getCompany: debounce(function (val, type) {
+      if (val) {
+        getCompanyAssociation({ name: val, num: 10 }).then((res) => {
+          if (type === 'ent') {
+            this.entList = res.data?.map((item) => {
+              return { label: item, value: item }
+            }) || []
+          }
+          else {
+            this.companyList = res.data?.map((item) => {
+              return { label: item, value: item }
+            }) || []
+          }
+        })
+      }
+    }, 500),
+    onSubmit(values) {
+      console.log('submit', values)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.credit-report-production-card {
+  .report-func {
+    padding: 12px 16px;
+    background: #fff;
+    .report-func-title {
+      font-size: 16px;
+      line-height: 24px;
+      color: #171826;
+      margin-bottom: 4px;
+    }
+    .report-func-content {
+      font-size: 13px;
+      line-height: 20px;
+      color:#5F5E64;
+    }
+  }
+  .report-info {
+    margin-top: 8px;
+    ::v-deep {
+      .van-cell {
+        padding: 15px 16px 15px 24px;
+        .van-cell__title {
+         font-size: 15px;
+         line-height: 22px;
+         color: #5F5E64;
+        }
+        input::placeholder {
+          font-size: 15px;
+          line-height: 22px;
+          color: #C0C4CC;
+        }
+        &.ent-input-field, &.company-input-field {
+          position: relative;
+          .ent-popup-container {
+            position: absolute;
+            top: 54px;
+            right: 20px;
+            overflow: hidden;
+            overflow-y: auto;
+            width: 230px;
+            max-height: 150px;
+            z-index: 1;
+            background: #fff;
+            border: 1px solid #2ABED1;
+            border-radius: 8px;
+          }
+          .ent-popup-wrap {
+            display: flex;
+            flex-direction: column;
+            .wrap-list {
+              width: 100%;
+              white-space: nowrap;
+              overflow: hidden;
+              text-overflow: ellipsis;
+              padding: 4px 10px;
+              font-size: 15px;
+              line-height: 22px;
+              color: #171826;
+              border-bottom: 1px solid rgba(0, 0, 0, 0.05);
+            }
+          }
+        }
+        &.van-field--error .van-field__control {
+          color: #171826;
+        }
+      }
+      .van-cell--required::before {
+        left: 16px;
+      }
+    }
+  }
+  .report-tip {
+    padding: 12px 16px;
+    font-size: 12px;
+    line-height: 18px;
+    color: #9B9CA3;
+  }
+}
+</style>

+ 147 - 46
apps/mobile/src/views/reportAnalysis/reportDownload.vue

@@ -1,8 +1,12 @@
 <template>
   <div id="reportDownload">
     <div class="reportContent">
-      <div class="title">报告下载余额</div>
-      <div class="desc">注:请在有效期内使用,过期清零,不可转赠。</div>
+      <div class="title">
+        报告下载余额
+      </div>
+      <div class="desc">
+        注:请在有效期内使用,过期清零,不可转赠。
+      </div>
       <div class="box_content">
         <div class="item">
           <div class="line green" />
@@ -10,9 +14,7 @@
             <div class="left">
               <span class="count">{{ winner.total }}</span>
               <span class="unit">份</span>
-              <span class="textbtn" @click="goDetail('企业中标分析报告')"
-                >查明细</span
-              >
+              <span class="textbtn" @click="goDetail('企业中标分析报告')">查明细</span>
               <span class="texticon" />
             </div>
             <div class="right" @click="rechargeNow('企业中标分析报告')">
@@ -20,7 +22,9 @@
             </div>
           </div>
           <div class="textGroup">
-            <div class="left">企业中标分析报告下载余额</div>
+            <div class="left">
+              企业中标分析报告下载余额
+            </div>
             <div v-if="winner.minEndTime" class="right">
               最近有效期至:{{ winner.minEndTime }}
             </div>
@@ -32,9 +36,7 @@
             <div class="left">
               <span class="count">{{ buyer.total }}</span>
               <span class="unit">份</span>
-              <span class="textbtn" @click="goDetail('业主采购分析报告')"
-                >查明细</span
-              >
+              <span class="textbtn" @click="goDetail('业主采购分析报告')">查明细</span>
               <span class="texticon" />
             </div>
             <div class="right" @click="rechargeNow('业主采购分析报告')">
@@ -42,7 +44,9 @@
             </div>
           </div>
           <div class="textGroup">
-            <div class="left">业主采购分析报告下载余额</div>
+            <div class="left">
+              业主采购分析报告下载余额
+            </div>
             <div v-if="buyer.minEndTime" class="right">
               最近有效期至:{{ buyer.minEndTime }}
             </div>
@@ -54,9 +58,7 @@
             <div class="left">
               <span class="count">{{ market.total }}</span>
               <span class="unit">份</span>
-              <span class="textbtn" @click="goDetail('市场分析定制报告')"
-                >查明细</span
-              >
+              <span class="textbtn" @click="goDetail('市场分析定制报告')">查明细</span>
               <span class="texticon" />
             </div>
             <div class="right" @click="rechargeNow('市场分析定制报告')">
@@ -64,15 +66,39 @@
             </div>
           </div>
           <div class="textGroup">
-            <div class="left">市场分析定制报告下载余额</div>
+            <div class="left">
+              市场分析定制报告下载余额
+            </div>
             <div v-if="market.minEndTime" class="right">
               最近有效期至:{{ market.minEndTime }}
             </div>
           </div>
         </div>
       </div>
+      <!-- S 投标企业信用报告入口 S -->
+      <div class="credit_report">
+        <div class="credit_report_main">
+          <div class="credit_report_title">
+            <span>投标企业信用报告</span>
+            <div class="credit_report_action">
+              <div class="credit_report_example" @click="viewReportExample">
+                报告样例 <span class="texticon" />
+              </div>
+              <div class="credit_report_btn" @click="goBuy">
+                去购买
+              </div>
+            </div>
+          </div>
+          <div class="credit_report_content">
+            <span>信用报告通过信用背书、风险预警、政策适配,三大核心作用,成为投标企业参与市场竞争的关键工具‌。</span>
+          </div>
+        </div>
+      </div>
+      <!-- E 投标企业信用报告入口 E -->
       <div class="content_list">
-        <div class="title">报告下载记录</div>
+        <div class="title">
+          报告下载记录
+        </div>
         <div class="list_box">
           <van-list
             ref="vanList"
@@ -106,7 +132,9 @@
       :before-close="beforeEmailDialogClose"
     >
       <div class="attachment-content">
-        <div class="attachment-tip-text">附件将以邮件的形式发送至您的邮箱</div>
+        <div class="attachment-tip-text">
+          附件将以邮件的形式发送至您的邮箱
+        </div>
         <van-field
           v-model="attachment.email"
           class="attachment-email-input"
@@ -179,9 +207,11 @@ export default {
     colorFilter(val) {
       if (val === '1') {
         return 'green'
-      } else if (val === '2') {
+      }
+      else if (val === '2') {
         return 'yellow'
-      } else if (val === '3') {
+      }
+      else if (val === '3') {
         return 'blue'
       }
     }
@@ -190,6 +220,9 @@ export default {
     this.getcount()
   },
   methods: {
+    viewReportExample() {},
+    goBuy() {
+    },
     async getcount() {
       const { data } = await pdfaccount({})
       if (data) {
@@ -216,13 +249,14 @@ export default {
         this.list.total = data.count
         // this.list.total = 10 //不支持分页可以写死
         this.list.value = this.list.value.concat(data.list)
-      } else {
+      }
+      else {
         this.list.finished = true
       }
       // 数据请求完成(根据页码计算,当前页是否是最后一页)
       // 请求完成后,页码就变为了下一页的页面,所以这里要-1
-      const isLastPage =
-        (this.list.pageNum - 1) * this.list.pageSize >= this.list.total
+      const isLastPage
+        = (this.list.pageNum - 1) * this.list.pageSize >= this.list.total
       if (isLastPage) {
         this.list.finished = true
       }
@@ -233,11 +267,13 @@ export default {
         this.$router.push({
           path: '/order/create/enterpriseanalysis'
         })
-      } else if (type === '业主采购分析报告') {
+      }
+      else if (type === '业主采购分析报告') {
         this.$router.push({
           path: '/order/create/owneranalysis'
         })
-      } else if (type === '市场分析定制报告') {
+      }
+      else if (type === '市场分析定制报告') {
         this.$router.push({
           path: '/order/create/marketanalysis'
         })
@@ -263,7 +299,8 @@ export default {
             eId: item.ent
           }
         })
-      } else {
+      }
+      else {
         // 采购单位画像
         // 跳转页面
         let goLink = ''
@@ -271,13 +308,15 @@ export default {
           goLink = `/big/wx/page/unit_portrayal?entName=${encodeURIComponent(
             item.entName
           )}`
-        } else {
+        }
+        else {
           // 新商机管理采购单位画像
           if (this.isNewBusiness) {
             goLink = `/jyapp/big/page/client_portrayal?entName=${encodeURIComponent(
               item.entName
             )}&from=client`
-          } else {
+          }
+          else {
             goLink = `/jyapp/big/page/unit_portrayal?entName=${encodeURIComponent(
               item.entName
             )}`
@@ -300,9 +339,11 @@ export default {
         let defaultName = '报告'
         if (item.type === '1') {
           defaultName = '企业中标分析报告'
-        } else if (item.type === '2') {
+        }
+        else if (item.type === '2') {
           defaultName = '业主采购分析报告'
-        } else if (item.type === '3') {
+        }
+        else if (item.type === '3') {
           defaultName = '市场分析定制报告'
         }
         if (newIOSApp) {
@@ -316,11 +357,13 @@ export default {
             loading.clear()
             appDownLoadFile(name, types, fileUrl, size)
           })
-        } else {
+        }
+        else {
           location.href = fileUrl
           // window.open(fileUrl)
         }
-      } else {
+      }
+      else {
         // fileUrl: 下载地址
         if (fileUrl) {
           if (platform === 'wx') {
@@ -332,11 +375,13 @@ export default {
                 target: encodeURIComponent(fileUrl)
               }
             })
-          } else {
+          }
+          else {
             // window.open(fileUrl)
             location.href = fileUrl
           }
-        } else {
+        }
+        else {
           console.log('获取附件fid失败')
         }
       }
@@ -344,7 +389,8 @@ export default {
     viewReport() {
       if (this.$envs.inAppOrH5) {
         location.href = '/jyapp/big/page/report_analysis'
-      } else {
+      }
+      else {
         location.href = '/big/wx/page/report_analysis'
       }
     },
@@ -358,7 +404,8 @@ export default {
       if (code === 0) {
         done && done()
         this.$toast('已发送至邮箱')
-      } else {
+      }
+      else {
         done && done(false)
         this.$toast('发送失败')
       }
@@ -377,7 +424,8 @@ export default {
       if (!emailRegExp.test(email)) {
         done(false)
         return this.$toast('邮箱格式错误')
-      } else {
+      }
+      else {
         const { fileUrl } = this.attachment
 
         if (!fileUrl) {
@@ -396,7 +444,8 @@ export default {
           console.log(fileSize, '文件大小')
           try {
             callback(fileSize)
-          } catch (e) {
+          }
+          catch (e) {
             console.log(e)
           }
         }
@@ -407,7 +456,7 @@ export default {
 }
 </script>
 
-<style>
+<style lang="scss">
 #reportDownload {
   background-color: #f5f6f7;
 
@@ -475,14 +524,6 @@ export default {
               margin-left: 12px;
             }
 
-            .texticon {
-              width: 12px;
-              height: 12px;
-              display: inline-block;
-              background-image: url(@/assets/image/reportanalysis/icon_download.png);
-              background-size: contain;
-              background-repeat: no-repeat;
-            }
           }
 
           .right {
@@ -536,7 +577,67 @@ export default {
         margin-bottom: 0;
       }
     }
-
+    .texticon {
+      width: 12px;
+      height: 12px;
+      display: inline-block;
+      background-image: url(@/assets/image/reportanalysis/icon_download.png);
+      background-size: contain;
+      background-repeat: no-repeat;
+    }
+    .credit_report {
+      margin-top: 16px;
+      width: 100%;
+      background: linear-gradient(to right, #EFFDFF, #FFFFFF);
+      border: 1px solid #87DFEA;
+      box-shadow: 0px 2px 8px 0px rgba(54, 147, 179, 0.05);
+      border-radius: 8px;
+      .credit_report_main {
+        padding: 12px;
+        width: 100%;
+        height: 100%;
+        background: url(../../assets/image/reportanalysis/credit-corner-bg.png) no-repeat;
+        background-size: 58px 55px;
+        background-position: right bottom;
+      }
+      .credit_report_title {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        > span {
+          font-size: 16px;
+          line-height: 24px;
+          color: #171826;
+        }
+      }
+      .credit_report_action {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        .credit_report_example {
+          display: flex;
+          align-items: center;
+          margin-right: 10px;
+          font-size: 12px;
+          line-height: 18px;
+          color: #2ABED1;
+        }
+        .credit_report_btn {
+          padding: 2px 17px;
+          background: #2ABED1;
+          color: #fff;
+          font-size: 12px;
+          line-height: 18px;
+          border-radius: 4px;
+        }
+      }
+      .credit_report_content {
+        margin-top: 10px;
+        font-size: 12px;
+        line-height: 18px;
+        color: #5F5E64;
+      }
+    }
     .content_list {
       margin-top: 16px;