chenlei 7 meses atrás
pai
commit
6544cab9d3

+ 8 - 0
pc/wcarrier/comp/auth.vue

@@ -136,6 +136,14 @@ export default {
           delete params.channelAuthStatus
           this.$http(this.$interfaces.pay.carrier_open_account, params).then(res => {
             this.value.channelAuthStatus = 2
+            this.$http(this.$interfaces.user.refresh_carrier_token).then(res => {
+              this.$store.commit('updateIdentity', res)
+            })
+          }).catch(() => {
+            // 即使认证失败也刷新一下token,身份信息可能有更新
+            this.$http(this.$interfaces.user.refresh_carrier_token).then(res => {
+              this.$store.commit('updateIdentity', res)
+            })
           })
         } else {
           return false

+ 27 - 31
pc/wcarrier/comp/authorize.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div class="defbb">
     <div class="defbb p-spac">
       平台账户授权 [
       <span class="gray-color" :class="{ 'green-color': progress }">{{
@@ -8,7 +8,7 @@
       ]<span class="ml-spac p-wcolor" v-if="waring"> [ 提醒:请先绑定“授权手机号”!]</span>
     </div>
     <div class="items p-spacd2">
-      <div class="center justify-between p-spacd2 defbb">
+      <div class="center justify-between p-spacd2">
         <div>授权手机号</div>
         <div>
           <span class="mr-spac">{{ value }}</span>
@@ -17,24 +17,26 @@
           }}</el-button>
         </div>
       </div>
-      <div class="center justify-between p-spacd2 defbb">
+      <div class="center justify-between p-spacd2 defbt">
         <div>转账授权</div>
         <div
           class="pointer p-color"
-          :class="{ 'gray-color': !isBindPhone}"
+          :class="{ 'gray-color': !isBindPhone,'green-color':balanceAuthed}"
           @click="authEvent(0)"
         >
-          {{balanceAuthed?'已授权':'去授权'}}
+          <i class="el-icon-loading
+" v-if="$reqState($interfaces.pay.sign_balance_protocol).ing"></i>{{balanceAuthed?'已授权':'去授权'}}
         </div>
       </div>
-      <div class="center justify-between p-spacd2 defbb" v-if="isDealer">
+      <div class="center justify-between p-spacd2 defbt" v-if="isDealer">
         <div>提现授权</div>
         <div
           class="pointer p-color"
-          :class="{ 'gray-color': !isBindPhone }"
+          :class="{ 'gray-color': !isBindPhone,'green-color':withdrawAuthed }"
           @click="authEvent(1)"
         >
-          {{withdrawAuthed?'已授权':'去授权'}}
+          <i class="el-icon-loading
+" v-if="$reqState($interfaces.pay.sign_balance_protocol).ing"></i>{{withdrawAuthed?'已授权':'去授权'}}
         </div>
       </div>
     </div>
@@ -124,7 +126,7 @@
   </div>
 </template>
 <script>
-import { $sendVerificationCode, $unbindPhone, $bindPhone, $signContract, $signContractQuery, $signBalanceProtocol } from '@/service/pay'
+import { $sendVerificationCode, $unbindPhone, $bindPhone, $signContractQuery } from '@/service/pay'
 export default {
   name: 'authorize',
   data() {
@@ -242,26 +244,15 @@ export default {
       if (type === 0) {
         // 已授权
         if (this.carrierBalanceInfo.balanceStatus === 2) {
-          const params = {
-            jumpUrl: window.location.href,
-            source: 2
-          }
-          $signContractQuery(params).then(res => {
-            if (res.code === 0) {
-              window.location.href = res.data
-            }
-          })
+          this.$router.push('accountSetting/balanceProtocol')
         } else {
           const params = {
             source: 2,
             backUrl: window.location.href,
-            jumpUrl: location.href
-            // jumpUrl: location.href.split('/#')[0] + '/#/signSuccess'
+            jumpUrl: location.href.split('/#')[0] + '/#/signSuccess'
           }
-          $signContract(params).then(res => {
-            if (res.code === 0) {
-              window.open(res.data.data)
-            }
+          this.$http(this.$interfaces.pay.sign_balance_protocol, params).then(res => {
+            window.location.href = res
           })
         }
       }
@@ -269,18 +260,23 @@ export default {
       if (type === 1) {
         // 已授权
         if (this.carrierWithdrawInfo.withdrawStatus === 2) {
-          this.$router.push('accountSetting/balanceProtocol')
+          const params = {
+            jumpUrl: window.location.href,
+            source: 2
+          }
+          $signContractQuery(params).then(res => {
+            if (res.code === 0) {
+              window.location.href = res.data
+            }
+          })
         } else {
           const params = {
             source: 2,
             backUrl: window.location.href,
-            jumpUrl: location.href
-            // jumpUrl: location.href.split('/#')[0] + '/#/signSuccess'
+            jumpUrl: location.href.split('/#')[0] + '/#/signSuccess'
           }
-          $signBalanceProtocol(params).then(res => {
-            if (res.code === 0) {
-              window.open(res.data)
-            }
+          this.$http(this.$interfaces.pay.sign_withdraw_protocol, params).then(res => {
+            window.location.href = res
           })
         }
       }

+ 120 - 0
pc/wcarrier/comp/bankInfo.vue

@@ -0,0 +1,120 @@
+<template>
+  <div>
+    <div class="defbb p-spac">
+      平台提现公户<span class="ml-spac gray-color" :class="{ 'green-color': saved }">[ {{saved?'已上报':'未上报'}} ]</span>
+    </div>
+
+    <div class="defbb" :class="{ 'read-only': saved }">
+      <el-form ref="form" :model="value" :rules="rules" size="mini" label-width="120px" label-position="right"
+         class="p-spac pb-spacd4">
+        <div class="flex">
+          <el-form-item prop="account" label="提现公户账号:" class="mr-spac">
+            <el-input v-model="value.account" placeholder="请输入" ></el-input>
+          </el-form-item>
+          <el-form-item prop="bankName" label="开户行支行:">
+            <el-input v-model="value.bankName" placeholder="请输入" ></el-input>
+          </el-form-item>
+        </div>
+        <div class="flex">
+          <el-form-item prop="bank" label="开户银行:" class="mr-spac">
+            <el-select v-model="value.bank" filterable placeholder="请选择" >
+              <el-option v-for="(item, index) in banks" :key="index" :label="item.bankName" :value="item.bankName">
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="unionBank" label="支行行号:">
+            <el-input v-model="value.unionBank" placeholder="请输入" ></el-input>
+          </el-form-item>
+          <div class="ml-spac pt-spac" v-if="!saved">
+              <el-button type="text" @click="save()" :loading="$reqState($interfaces.pay.bind_bank).ing">确定上报</el-button>
+          </div>
+        </div>
+      </el-form>
+    </div>
+  </div>
+</template>
+<script>
+
+
+export default {
+  name: 'bankInfo',
+  data() {
+    return {
+      banks: [],
+      rules: {
+        account: { required: true, message: ' ', trigger: 'blur' },
+        bankName: { required: true, message: ' ', trigger: 'blur' },
+        bank: { required: true, message: ' ', trigger: 'blur' },
+        unionBank: { required: true, message: ' ', trigger: 'blur' }
+
+      }
+    }
+  },
+  props: {
+    value: {
+      type: Object,
+      default: () => ({})
+    }
+  },
+  computed: {
+
+    saved() {
+      return this.value.bankStatus === 2
+    }
+
+  },
+  watch: {
+
+
+  },
+  mounted() {
+    this.$http(this.$interfaces.user.list_by_keywords, { keywords: '' }).then(res => {
+      this.banks = res
+    })
+  },
+  methods: {
+    save() {
+      this.$refs.form.validate((valid) => {
+        if (!valid) {
+          return
+        }
+        this.$http(this.$interfaces.pay.bind_bank, this.value).then(res => {
+          this.value.bankStatus = 2
+        })
+      })
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+.el-input,
+.el-select {
+  width: 300px;
+}
+
+.el-select--mini {
+  font-size: 12px;
+}
+
+.el-form-item--mini.el-form-item {
+  margin-bottom: 6px;
+}
+
+.read-only {
+  ::v-deep .el-form-item__label::before,
+  ::v-deep .el-input__suffix {
+    display: none;
+  }
+
+  .el-input,
+  .el-select,
+  ::v-deep input {
+    font-size: 14px;
+    padding: 0;
+    border: 0;
+    pointer-events: none;
+  }
+
+}
+</style>

+ 14 - 12
pc/wcarrier/comp/invoice.vue

@@ -4,12 +4,12 @@
     <el-form
       ref="form"
       :model="value"
+      :disabled="$props.disabled"
       size="mini"
       label-width="110px"
       label-position="left"
-      :disabled="$props.disabled"
       class="p-spac pb-spacd4"
-    >
+      >
       <div class="flex">
         <el-form-item prop="fpAddress" label="购方地址:" label-width="85px" class="mr-spac">
           <el-input v-model="value.fpAddress" placeholder="请输入" v-empty="emptyArgs"></el-input>
@@ -75,16 +75,13 @@ export default {
   },
   computed: {
     showOpers() {
-      const rv = false
-      // 设置了disabled
-      if (this.$props.disabled != null) {
-        return !this.$props.disabled
+      if (this.$props.disabled) {
+        return false
       }
-      // 设置了readOnly
-      if (this.$props.readOnly != null) {
+      if (this.$props.readOnly) {
         return !this.isReadOnly
       }
-      return rv
+      return true
     },
     saved() {
       return this.value.fpStatus === 2
@@ -93,26 +90,30 @@ export default {
       return (this.readOnly || !this.isEdit)
     },
     emptyArgs() {
-      return { open: this.isReadOnly, text: '[ 暂无内容 ]' }
+      return { open: !this.disabled && this.isReadOnly, text: '[ 暂无内容 ]' }
     }
   },
   watch: {
+    disabled() {
+      console.log('disabled', this.disabled)
+    },
     value() {
       staticData.formDataRaw = { ...this.value }
+      this.isEdit = !this.saved
     },
     isEdit: {
       handler(val) {
+        console.log('isEdit', val)
         if (val) {
           staticData.formDataRaw = { ...this.value }
         }
       }
     }
   },
-  created() {
+  mounted() {
     this.$http(this.$interfaces.user.list_by_keywords, { keywords: '' }).then(res => {
       this.banks = res
     })
-    this.isEdit = !this.saved
   },
   methods: {
     save() {
@@ -144,6 +145,7 @@ export default {
       display: none;
     }
     .el-input,.el-select,::v-deep input {
+        font-size: 14px;
         padding: 0;
         border:0;
         pointer-events: none;

+ 29 - 8
pc/wcarrier/join.vue

@@ -1,7 +1,7 @@
 <!-- eslint-disable vue/valid-v-model -->
 
 <template>
-  <div class="p-spac p-fz">
+  <div class="p-fz" v-show="inited">
     <div class="defbb p-spac">企业认证 [ <span class="gray-color" :class="{ 'green-color': isAuth }">{{ authText }}</span> ]
     </div>
     <div v-if="isAuth" class="s-fz flex p-spac p-b-0">
@@ -88,7 +88,7 @@
           </div>
           <div v-else></div>
           <el-button v-if="isAuth && (unStart || isReject)" type="primary" size="medium" class="auth-btn"
-            @click="submitForm()">{{ reviewBtnText }}</el-button>
+            @click="transportUp()" :loading="$reqState($interfaces.user.road_transport_up).ing">{{ reviewBtnText }}</el-button>
         </div>
       </div>
     </template>
@@ -96,11 +96,15 @@
       <div class="defbb p-spac">
         开票补充信息<span class="ml-spac p-wcolor" v-if="!isreView">[ 提醒:请先完成“资质审核”!]</span>
       </div>
-      <invoice :disabled="!isreView" :readOnly="false" v-model="carrierFpInfo" class="p-spacd2 p-b-0" />
+      <invoice :disabled="!isreView" :readOnly="!module.carrierFpInfo.edit" v-model="carrierFpInfo" class="p-spacd2 p-b-0" />
     </template>
     <authorize v-model="bindPhone" :carrierBalanceInfo="carrierBalanceInfo" :carrierWithdrawInfo="carrierWithdrawInfo"
       :tradeType="tradeType" v-if="$props.module.carrierWithdrawInfo && isreView" />
+    <bankInfo v-model="carrierBankInfo" v-if="tradeType===1"/>
     <review class="w50" :orgId="safeOrgId" v-if="$props.module.review" @feedback="reviewFeedback" />
+    <div class="p-spac">
+      合同签约<span class="ml-spac gray-color" :class="{'green-color':contracted}">[ {{ contracted ?'已签约 (线下)':'未知' }} ]</span>
+    </div>
   </div>
 </template>
 <script>
@@ -108,11 +112,13 @@ import UploadImg from 'submodule/components/pc/upload/uploadImg.vue'
 import auth from './comp/auth.vue'
 import invoice from './comp/invoice.vue'
 import authorize from './comp/authorize.vue'
+import bankInfo from './comp/bankInfo.vue'
 import review from './comp/review.vue'
 
 export default {
   name: 'join',
   data() {
+    const _this = this
     return {
       args: {},
       /** 交易模式(1经销模式;2直销模式,默认经销模式1) */
@@ -198,7 +204,7 @@ export default {
       },
       carrierRoadInfoImg: [
         {
-          path: '',
+          get path() { return _this.$tools.getFullFileUrl(_this.carrierRoadInfo.roadTransport) },
           defaultPath: require('@/assets/images/main/license@2x.png'),
           text: '上传道路运输经营许可证'
         }
@@ -212,7 +218,7 @@ export default {
       }
     }
   },
-  components: { UploadImg, auth, invoice, authorize, review },
+  components: { UploadImg, auth, invoice, authorize, review, bankInfo },
   props: {
     orgId: {
       type: String,
@@ -226,13 +232,23 @@ export default {
           show: false,
           edit: false
         },
-        carrierFpInfo: false,
+        carrierFpInfo: {
+          show: false,
+          edit: false
+        },
         carrierWithdrawInfo: false,
         review: false
       })
     }
   },
   computed: {
+    /** 合同已签约 */
+    contracted() {
+      return this.carrierContractInfo.contractStatus === 2
+    },
+    inited() {
+      return (this.safeOrgId && this.$reqState(this.$interfaces.user.get_carrier_info).sus) || !this.safeOrgId
+    },
     safeOrgId() {
       return this.$props.orgId ||
         this.args.orgId
@@ -261,7 +277,7 @@ export default {
       return this.carrierRoadInfo.roadTransportStatus === 2
     },
     operateState() {
-      return ['未发起', '待审核', '已认证', '已驳回'][this.carrierRoadInfo.roadTransportStatus]
+      return ['未发起', '待审核', '已过审', '已驳回'][this.carrierRoadInfo.roadTransportStatus]
     },
     // 营运许可证为查看状态
     carrierRoadInfoView() {
@@ -291,12 +307,17 @@ export default {
     getCarrierInfo() {
       if (this.safeOrgId) {
         this.$http(this.$interfaces.user.get_carrier_info, { orgId: this.safeOrgId }).then(res => {
+          this.bindPhone = res.bindPhone
           this.tradeType = res.org.tradeType
           this.carrierAuthInfo = res.carrierAuthInfo
           this.carrierBalanceInfo = res.carrierBalanceInfo
           this.carrierBankInfo = res.carrierBankInfo
           this.carrierContractInfo = res.carrierContractInfo
           this.carrierFpInfo = res.carrierFpInfo
+          // // 资质审核可编辑&&驳回 清空许可证路径
+          // if (this.module.carrierRoadInfo.edit && res.carrierRoadInfo.roadTransportStatus === 3) {
+          //   res.carrierRoadInfo.roadTransport = ''
+          // }
           this.carrierRoadInfo = res.carrierRoadInfo
           this.carrierWithdrawInfo = res.carrierWithdrawInfo
         })
@@ -307,7 +328,7 @@ export default {
       this.carrierRoadInfo.roadTransport = path
       // this.carrierRoadInfo.roadTransport = process.env.VUE_APP_FILE_URL + path
     },
-    submitForm() {
+    transportUp() {
       this.$refs.carrierRoadInfo.validate((valid) => {
         if (valid) {
           this.$http(this.$interfaces.user.road_transport_up, {