Parcourir la source

feat: 招标企业、邮箱自动获取,保存状态

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe il y a 4 mois
Parent
commit
3246ffc7a5

+ 10 - 0
apps/mobile/src/api/modules/pay.js

@@ -414,3 +414,13 @@ export function creditReportEntSearch(data) {
     data
   })
 }
+
+// 企业信用报告生成时间配置
+export function creditReportTime(data) {
+  data = qs.stringify(data)
+  return request({
+    url: '/subscribepay/config',
+    method: 'POST',
+    data
+  })
+}

+ 12 - 1
apps/mobile/src/store/modules/createOrder.js

@@ -176,9 +176,13 @@ export default {
       amount: false,
       submit: false
     },
-    isShowGiftNotice: false
+    isShowGiftNotice: false,
+    bidCreditReportInfo: {} // 投标企业信用报告信息
   }),
   mutations: {
+    SAVE_BID_CREDIT_REPORT_INFO(state, info) {
+      state.bidCreditReportInfo = info
+    },
     /**
      * 设置产品列表及更新下属信息
      * @param state
@@ -192,6 +196,7 @@ export default {
       state.productSpec.maps = productSpecMap
       state.product.index = defaultIndex
     },
+
     /**
      * 更新指定的产品规格信息
      * @param state
@@ -424,6 +429,9 @@ export default {
         )
       )
     },
+    async saveBidCreditReportInfo({ commit }, info) {
+      await commit('SAVE_BID_CREDIT_REPORT_INFO', Object.assign({}, info))
+    },
     // 根据商品ID、扩展等参数获取商品类型、规格等详细信息
     async getProductInfo({ commit, dispatch, getters, state }, payload) {
       // 合并一些请求参数
@@ -745,6 +753,9 @@ export default {
     }
   },
   getters: {
+    getBidCreditReportInfo(state) {
+      return state.bidCreditReportInfo
+    },
     // 用于提交订单的数据
     submitHooks(state) {
       return state.hooks.submit

+ 7 - 2
apps/mobile/src/views/article/components/ContentHeader.vue

@@ -162,7 +162,9 @@ export default {
       return this.otherModel.collectionTags
     }
   },
-  created() {},
+  mounted() {
+    console.log(this.summary, 'summary')
+  },
   methods: {
     async onCollectionTagClick(tag) {
       if (this.beforeLeavePage) {
@@ -190,10 +192,13 @@ export default {
       }
     },
     creditReport() {
+      const buyer = this.summary?.buyers[0]?.name
       this.$router.push({
-        path: '/order/create/creditreport'
+        path: '/order/create/creditreport',
+        query: buyer ? { buyer } : {}
       })
     },
+
     async findRenMai() {
       const hasPower = await this.checkHasRemMaiPower()
       if (hasPower) {

+ 75 - 46
apps/mobile/src/views/article/content.vue

@@ -14,7 +14,7 @@ small-tab
           class="j-main article-content-main"
           :class="{
             'show-underline': otherModel.hasProject,
-            'no-scroll': showBindPhone
+            'no-scroll': showBindPhone,
           }"
           @click="onScrollWrapperClick"
           @scroll.passive="onScroll"
@@ -325,13 +325,13 @@ export default {
   },
   computed: {
     ...mapState({
-      preAgentInfo: (state) => state.article.preAgentInfo,
-      content: (state) => state.article.mainModel.content,
-      summary: (state) => state.article.mainModel.summary,
-      mainModel: (state) => state.article.mainModel,
-      expandModel: (state) => state.article.expandModel,
-      otherModel: (state) => state.article.otherModel,
-      bindPhone: (state) => state.article.bindPhone
+      preAgentInfo: state => state.article.preAgentInfo,
+      content: state => state.article.mainModel.content,
+      summary: state => state.article.mainModel.summary,
+      mainModel: state => state.article.mainModel,
+      expandModel: state => state.article.expandModel,
+      otherModel: state => state.article.otherModel,
+      bindPhone: state => state.article.bindPhone
     }),
     IsCustomTopNet() {
       return this.content.IsCustomTopNet || false
@@ -375,7 +375,8 @@ export default {
           show: this.content.isCanRead, // 是否展示全部内容
           showContentModule: this.hasPowerToReadSunPublishContent
         }
-      } else {
+      }
+      else {
         return {
           show: this.content.isCanRead,
           showContentModule: true
@@ -401,10 +402,10 @@ export default {
       return this.mainModel.moduleShow
     },
     advancedModuleShow() {
-      const { tbService, customerRecommend, timeline, zbRecommend } =
-        this.expandModel.moduleShow
-      const toBCustom =
-        this.IsCustomTopNet || this.IsSunPublishContent || this.yyszbContent
+      const { tbService, customerRecommend, timeline, zbRecommend }
+        = this.expandModel.moduleShow
+      const toBCustom
+        = this.IsCustomTopNet || this.IsSunPublishContent || this.yyszbContent
       return Object.assign({}, this.expandModel.moduleShow, {
         tbService: toBCustom ? false : tbService,
         customerRecommend: toBCustom ? false : customerRecommend,
@@ -423,7 +424,8 @@ export default {
       // 如果是有权限用户(权限7),则有数据展示,无数据不展示。无权限7用户则一直展示,展示广告引导
       if (this.hasCustomerModulePower) {
         return this.advancedModuleShow.customerRecommend
-      } else {
+      }
+      else {
         return true
       }
     },
@@ -456,6 +458,7 @@ export default {
   mounted() {
     this.getStickyOffset()
     this.restoreScrollTop()
+    console.log(this.summary, 'summary')
   },
   methods: {
     ...mapMutations('article', [
@@ -491,26 +494,31 @@ export default {
           }
           this.checkNpsView()
         })
-      } else {
+      }
+      else {
         try {
           await this.getPreAgentInfo()
           const { data, msg } = await this.getBaseInfo()
           if (data) {
             this.finishLoading()
-          } else {
+          }
+          else {
             this.finishLoading()
             this.isError = true
             // 无效参数 = d解析错误
             // 未查到当前招标信息 = 文章不存在
             if (msg.includes('未查到当前招标信息')) {
               this.errorText = '由于相关部门要求,该信息已下架,敬请原谅'
-            } else {
+            }
+            else {
               this.errorText = '该页面信息不存在'
             }
           }
-        } catch (error) {
+        }
+        catch (error) {
           console.error(error)
-        } finally {
+        }
+        finally {
           // console.log('基础接口请求完成')
         }
         if (this.canReadConf.show) {
@@ -534,7 +542,8 @@ export default {
       let subType = ''
       try {
         subType = this.content?._ob?.subType
-      } catch (error) {
+      }
+      catch (error) {
         console.log(error)
       }
       let prefix = ''
@@ -544,7 +553,8 @@ export default {
       const newTitle = prefix + title
       if (otherTitle) {
         this.postMessageToMiniProgram(otherTitle)
-      } else {
+      }
+      else {
         this.postMessageToMiniProgram(newTitle)
       }
     },
@@ -558,7 +568,8 @@ export default {
             title
           }
         })
-      } catch (e) {
+      }
+      catch (e) {
         console.log(e)
       }
     },
@@ -570,7 +581,8 @@ export default {
     },
     appHeaderActions() {
       const { $envs } = this
-      if (!$envs.inApp) return
+      if (!$envs.inApp)
+        return
       if (this.yyszbContent) {
         return
       }
@@ -598,9 +610,11 @@ export default {
       // project-name事件委托
       if (checkUnderline.status) {
         this.clickKeywordUnderline(e)
-      } else if (e.target.classList.contains('free-view')) {
+      }
+      else if (e.target.classList.contains('free-view')) {
         this.clickFreeView(e)
-      } else if (e.target.className.includes('third-party-popover')) {
+      }
+      else if (e.target.className.includes('third-party-popover')) {
         this.popup.thirdPartyVerify = true
       }
     },
@@ -618,7 +632,8 @@ export default {
             this.goMemberFollowPage()
           }
         })
-      } else if (checkWinnerName.status) {
+      }
+      else if (checkWinnerName.status) {
         this.goToEntPortraitPage(checkWinnerName.target)
       }
     },
@@ -638,7 +653,8 @@ export default {
             industry: _ob ? _ob.buyerClass : undefined
           }
         })
-      } else {
+      }
+      else {
         openAppOrWxPage(LINKS.项目详情页)
       }
     },
@@ -649,11 +665,12 @@ export default {
         ?.replace(/\?/g, '%3F')
       if (!id) {
         return this.$toast('暂无数据')
-      } else {
-        const noPower =
-          !this.bigMemberPower.includes(4) &&
-          !this.bigMemberPower.includes(12) &&
-          !this.bigMemberPower.includes(13)
+      }
+      else {
+        const noPower
+          = !this.bigMemberPower.includes(4)
+          && !this.bigMemberPower.includes(12)
+          && !this.bigMemberPower.includes(13)
         if (this.isMember && noPower) {
           if (eName) {
             this.beforeLeavePage()
@@ -662,10 +679,12 @@ export default {
               app: LINKS.旧版企业信息前缀.app + eName,
               h5: LINKS.旧版企业信息前缀.h5 + eName
             })
-          } else {
+          }
+          else {
             return this.$toast('暂无数据')
           }
-        } else {
+        }
+        else {
           this.beforeLeavePage()
           sessionStorage.removeItem('$data-ent_portrait')
           openAppOrWxPage(LINKS.企业画像页面, {
@@ -711,12 +730,14 @@ export default {
       if (this.$envs.inWX) {
         try {
           await this.getShareInfoReq()
-        } catch (error) {
+        }
+        catch (error) {
           console.log(error)
         }
         await this.calcWxShareInfo()
         this.initShareMixin()
-      } else {
+      }
+      else {
         this.getShareInfoReq()
       }
     },
@@ -753,7 +774,8 @@ export default {
       if (window.location.href.includes('open_infocontent')) {
         const query = window.location.search.slice(1)
         link += `${query}`
-      } else {
+      }
+      else {
         link += '&source=wx_infocontentshare'
       }
 
@@ -770,19 +792,22 @@ export default {
             subhref = `${add1}/content/${encryptid}${add2}`
             this.wxShareCache.subhref = subhref
           }
-        } catch (error) {
+        }
+        catch (error) {
           console.warn(error)
         }
       }
 
       if (encryptid) {
         link = subhref
-      } else {
+      }
+      else {
         link = window.location.href
       }
       if (!link.includes('?')) {
         link += '?'
-      } else {
+      }
+      else {
         link += '&'
       }
       if (!encryptid) {
@@ -827,12 +852,14 @@ export default {
           link += `${location.search}&source=app_infocontentshare&from=${
             this.shareInfoRes.userId || ''
           }`
-        } else {
+        }
+        else {
           link += `?source=app_infocontentshare&from=${
             this.shareInfoRes.userId || ''
           }`
         }
-      } else if (shareType === 3) {
+      }
+      else if (shareType === 3) {
         // 分享到朋友圈
         link += '&qrcodeType=app_infocontent_timeline_z'
         shareTitle = this.getRandomShareText()
@@ -844,7 +871,8 @@ export default {
       // this.shareConf.link = link
       if (this.$envs.inApp && shareToWx) {
         this.refreshShareLink(this.domainConf.wx)
-      } else {
+      }
+      else {
         this.refreshShareLink()
       }
     },
@@ -867,7 +895,8 @@ export default {
     },
     checkNpsView() {
       const targetVm = this.$refs.npsCard
-      if (!targetVm) return
+      if (!targetVm)
+        return
       const target = targetVm.$el
       const scrollWrapper = this.$refs.scrollWrapper
       const visible = isElementInScrollArea(target, scrollWrapper)
@@ -878,9 +907,9 @@ export default {
     checkTestBindPhone(name, next) {
       this.$testBindPhone({
         props: {
-          name: name
+          name
         },
-        next: next
+        next
       })
     }
   }

+ 12 - 4
apps/mobile/src/views/create-order/components/creditreport/Footer.vue

@@ -12,8 +12,9 @@
       :show-price="showPrice"
       @input="checkedChange"
       @confirmBtn="onConfirm"
-      @cancelBtn="onCancel"
+      @cancelBtn="onCreditRepoert"
       @pass="checkedChange"
+      @toLink="saveBaseInfo"
     />
   </div>
 </template>
@@ -37,7 +38,8 @@ export default {
     ...mapGetters('createOrder', [
       'productOrderAmount',
       'productUI',
-      'canSubmitOrder'
+      'canSubmitOrder',
+      'getBidCreditReportInfo'
     ]),
     params() {
       const { pay, origin, discount } = this.productOrderAmount
@@ -57,7 +59,7 @@ export default {
       return this.productUI.personalPay
     },
     confirmBtnTipText() {
-      return this.productUI.personalPay ? undefined : ''
+      return this.productUI.personalPay ? undefined : '(支付后可开票)'
     },
     confirmBtnText() {
       return this.productUI.submitText || '提交订单'
@@ -71,11 +73,17 @@ export default {
         read: f
       })
     },
-    onCancel() {
+    onCreditRepoert() {
+      console.log(this.getBidCreditReportInfo, 'getBidCreditReportInfo')
+      // 将getBidCreditReportInfo保存到本地
+      this.saveBaseInfo()
       this.$router.push({
         path: '/common/pdfview'
       })
     },
+    saveBaseInfo() {
+      this.$storage.set('bidCreditReportInfo', this.getBidCreditReportInfo, { storage: sessionStorage })
+    },
     onConfirm() {
       this.submitCreatedProductOrder()
     }

+ 46 - 9
apps/mobile/src/views/create-order/components/creditreport/ProductionCard.vue

@@ -19,7 +19,7 @@
           placeholder="必填"
           :show-error="false"
           :rules="[
-            { required: true, message: '请输入投标企业名称' },
+            { required: true, message: '必填' },
             { pattern: /^.{3,}$/, message: '输入内容需大于两个字' }, // 添加正则验证规则
           ]"
           @input="onInput($event, 'ent')"
@@ -45,7 +45,7 @@
           placeholder="必填"
           :show-error="false"
           :rules="[
-            { required: true, message: '请输入投标单位名称' },
+            { required: true, message: '必填' },
             { pattern: /^.{3,}$/, message: '输入内容需大于两个字' }, // 添加正则验证规则
           ]"
           @input="onInput($event, 'company')"
@@ -71,14 +71,14 @@
           :show-error="false"
           :rules="[
             { required: true, message: '请输入邮箱' },
-            { pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, message: '请输入有效的邮箱地址' }, // 邮箱校验正则规则
+            { pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, message: '邮箱格式错误' }, // 邮箱校验正则规则
           ]"
           @blur="onBlur('email')"
         />
       </van-form>
     </div>
     <div class="report-tip">
-      支付成功后,系统将在XX分钟内将报告发送至您的邮箱,您也可前往“资产-报告下载记录”查看详情。
+      支付成功后,系统将在{{ bidCreditReportTime }}分钟内将报告发送至您的邮箱,您也可前往“资产-报告下载记录”查看详情。
     </div>
   </div>
 </template>
@@ -89,7 +89,7 @@ import { Field, Form } from 'vant'
 import { debounce } from '@/utils/utils'
 import { mixinHeader } from '@/utils/mixins/header'
 import { openAppOrWxPage } from '@/utils'
-import { creditReportEntSearch } from '@/api/modules/'
+import { creditReportEntSearch, creditReportTime } from '@/api/modules/'
 import orderActivityHelper from '@/utils/mixins/modules/order-activity-helper'
 
 export default {
@@ -116,18 +116,55 @@ export default {
         email: ''
       },
       entList: [],
-      companyList: []
+      companyList: [],
+      bidCreditReportTime: 0
     }
   },
   computed: {
-    ...mapGetters('createOrder', ['productExtend', 'productId'])
+    ...mapGetters('createOrder', ['productExtend', 'productId', 'getBidCreditReportInfo'])
+  },
+  watch: {
+    info: {
+      deep: true,
+      handler(newVal) {
+        this.saveBidCreditReportInfo(newVal)
+      }
+    },
+  },
+  created() {
+    const { buyer } = this.$route.query
+    if (buyer) {
+      this.info.buyer = buyer
+    }
   },
   mounted() {
     this.updatePayAmount()
+    this.getCreditReportTime()
+    this.getUserInfoFun()
+    const bidCreditReportInfo = this.$storage.get('bidCreditReportInfo', {}, {
+      storage: sessionStorage
+    })
+    if (Object.keys(bidCreditReportInfo).length) {
+      Object.assign(this.info, bidCreditReportInfo)
+      // 删除本地缓存
+      this.$storage.rm('bidCreditReportInfo', { storage: sessionStorage })
+    }
   },
   methods: {
-    ...mapActions('createOrder', ['setProductInfo']),
-    ...mapMutations('createOrder'),
+    ...mapActions('createOrder', ['setProductInfo', 'saveBidCreditReportInfo']),
+    ...mapActions('user', ['getUserInfo']),
+    async getCreditReportTime() {
+      const { error_code: code, data } = await creditReportTime()
+      if (code === 0) {
+        this.bidCreditReportTime = data.bidCreditReport_makeTime
+      }
+    },
+    async getUserInfoFun() {
+      const { error_code: code, data } = await this.getUserInfo()
+      if (code === 0) {
+        this.info.email = data.reportMail || ''
+      }
+    },
     async updatePayAmount() {
       const { productId } = this.conf
       this.setProductInfo({

+ 9 - 6
apps/mobile/src/views/reportAnalysis/components/listItem.vue

@@ -69,21 +69,21 @@
           </p>
         </div>
       </div>
-      <div v-if="tagclass === 'blue'">
-        <div v-if="data.scopeClass" class="item">
+      <div v-if="tagclass === 'blue2'">
+        <div v-if="data.ent" class="item">
           <p class="label">
             投标企业名称:
           </p>
           <p class="value ellipsis">
-            {{ data.scopeClass | scopeClassF }}
+            {{ data.ent }}
           </p>
         </div>
-        <div v-if="data.s_buyerClass" class="item">
+        <div v-if="data.buyer" class="item">
           <p class="label long">
             投标单位名称:
           </p>
           <p class="value ellipsis">
-            {{ data.s_buyerClass | buyerClassF }}
+            {{ data.buyer }}
           </p>
         </div>
       </div>
@@ -225,6 +225,9 @@ export default {
       else if (val === '3') {
         return '市场分析定制报告'
       }
+      else if (val === '4') {
+        return '投标企业信用报告'
+      }
     },
     timeRangeF(val) {
       return val ? val.replace('_', '至') : '-'
@@ -495,7 +498,7 @@ export default {
     background-color: #00d086;
   }
 
-  .blue {
+  .blue, .blue2 {
     background-color: #3399ff;
   }
 

+ 14 - 1
apps/mobile/src/views/reportAnalysis/reportDownload.vue

@@ -214,14 +214,24 @@ export default {
       else if (val === '3') {
         return 'blue'
       }
+      else if (val === '4') {
+        return 'blue2'
+      }
     }
   },
   created() {
     this.getcount()
   },
   methods: {
-    viewReportExample() {},
+    viewReportExample() {
+      this.$router.push({
+        path: '/common/pdfview'
+      })
+    },
     goBuy() {
+      this.$router.push({
+        path: '/order/create/creditreport'
+      })
     },
     async getcount() {
       const { data } = await pdfaccount({})
@@ -346,6 +356,9 @@ export default {
         else if (item.type === '3') {
           defaultName = '市场分析定制报告'
         }
+        else if (item.type === '4') {
+          defaultName = '投标企业信用报告'
+        }
         if (newIOSApp) {
           const loading = this.$toast.loading({
             duration: 0,