瀏覽代碼

Merge branch 'dev/v2.4.46_tsz' of jianyu/qmx_page_admin into feature/v2.4.46

汤世哲 3 月之前
父節點
當前提交
2b042739b4

+ 8 - 1
src/views/create-order/components/order-detail-submodule/ChangeRecord.vue

@@ -59,6 +59,13 @@ export default {
             return row.signingSubject? row.signingSubject : '-'
           } 
         },
+        {
+          prop: 'name',
+          label: '红冲产品',
+          render: (row) => {
+            return row.name? row.name : '-'
+          }
+        },
         {
           prop:'payMoney',
           label: '合同金额变动',
@@ -70,7 +77,7 @@ export default {
         },
         {
           prop:'commission',
-          label: '佣金变动',
+          label: '销售费用变动',
           render: (row) => {
             const positive = row.commission > 0? '+' : ''
             const commission = row.commission? this.localed(row.commission / 100) : this.localed(0)

+ 7 - 2
src/views/create-order/components/order-detail-submodule/ContractInfo.vue

@@ -10,7 +10,7 @@
           <span class="red-chong" v-if="setRedPunchDisplay('签约主体')">(红冲过)</span>
         </div>
         <div class="contract-info-card-item" v-if="contractResStatus">
-          协议签订时间:{{ contractRes?.contract_time || '-' }}
+          协议签订时间:{{ formatDate(contractRes?.contract_time) }}
         </div>
         <div class="contract-info-card-item" v-if="contractResStatus">
           协议编号:{{ contractRes?.contract_code || '-'  }}
@@ -29,7 +29,7 @@
           协议归档状态:{{contractRes?.contract_archive_status === 1 ? '已归档' : '未归档' }}
         </div>
         <div class="contract-info-card-item" v-if="contractRes?.contract_archive_status === 1">
-          归档时间:{{ contractRes?.contract_archive_time || '-'  }}
+          归档时间:{{ formatDate(contractRes?.contract_archive_time)  }}
         </div>
         <div class="contract-info-card-item" v-if="contractRes?.contract_archive_status === 1">
           归档份数:{{ contractRes?.contract_archive_num || '-'  }}
@@ -173,6 +173,11 @@ export default {
         this.$message.error('暂无权限')
       }
     },
+    formatDate(timeString) {
+      if (!timeString) return '-';
+      // 只取空格前的日期部分
+      return timeString.split(' ')[0];
+    },
     async editContractArchiveConfirm() {
       const {
         signTime,

+ 83 - 7
src/views/create-order/components/order-detail-submodule/OrderDetailCard.vue

@@ -15,12 +15,12 @@
             <span class="red-chong" v-if="setRedPunchDisplay('合同金额')">(红冲过)</span>
           </div>
           <div v-else-if="item.key === 'final_price_total'">
-            {{ item.label }}:{{ orderData[item.key] || '-' }}
+            {{ item.label }}:{{ orderData[item.key] || '-' }}
             <span class="red-chong" v-if="setRedPunchDisplay('合同金额')">(红冲过)</span>
           </div>
           <div v-else-if="item.key === 'commission'">
             {{ item.label }}:¥{{ formatNumber(orderData[item.key]) || '0.00' }}
-            <span class="red-chong" v-if="setRedPunchDisplay('渠道佣金')">(红冲过)</span>
+            <span class="red-chong" v-if="setRedPunchDisplay('销售费用')">(红冲过)</span>
           </div>
           <div v-else-if="item.key === 'rate_total'">
             {{ item.label }}:{{ orderData[item.key] || '-' }}
@@ -41,12 +41,16 @@
           :title="setProductTitle(product, index)"
           :subtitle="product.auto !== 1 ? '该产品暂不支持系统自动开通权限,请联系运维开通': ''"
           >
+          <template #actions>
+            <button @click="openPermissionActivation(product)" class="order-detail-product-actions-btn" v-if="isShowPermission(product)">权限开通</button>
+          </template>
           <div class="order-detail-product-content">
             <div class="grouped-items">
               <div
                 v-for="(item, index) in productInfoItems"
                 :key="index"
-                :class="`item-span-${item.span}`">
+                :class="`item-span-${item.span}`"
+                >
                 <div
                   class="order-detail-card-item"
                   v-if="shouldRenderItem(item, product)"
@@ -94,6 +98,28 @@
               </div>
             </div>
           </div>
+          <template #activity>
+            <div v-if="product.activity_code" class="order-detail-product-activity">
+              <div class="order-detail-product-activity-title">
+                <span>活动商品:</span>
+                <span>{{ product.activity_code || '买2年大会员送:1年大会员+人脉管理+阳光直采+1000条数据流量包高级字段包+腾讯视频年卡' }}</span>
+              </div>
+              <div class="order-detail-product-activity-item">
+                <div class="order-detail-product-activity-item-title">
+                  <span>合同金额合计:</span>
+                  <span>¥{{ product.final_price }}</span>
+                </div>
+                <div class="order-detail-product-activity-item-title">
+                  <span>标准售价合计:</span>
+                  <span>¥{{ product.original_price }}</span>
+                </div>
+                <div class="order-detail-product-activity-item-title">
+                  <span>折扣率:</span>
+                  <span>{{ product.rate }}</span>
+                </div>
+              </div>
+            </div>
+          </template>
         </ProductCard>
       </div>
     </InfoCard>
@@ -104,6 +130,7 @@
         </div>
       </div>
     </InfoCard>
+    <newDetailModel ref="newDetailModel" :data="orderDetail"></newDetailModel>
   </div>
 </template>
 
@@ -113,12 +140,14 @@ import ProductCard from '../../ui/ProductCard.vue';
 import { paymentTypeOptions } from '../../data/options.js';
 import { div, calcDiscountRate, roundToTwoDecimals } from '@/utils/number/';
 import TableCard from '../../ui/TableCard.vue';
+import newDetailModel from '@/views/order/components/new-detailModel.vue';
 export default {
   name: 'OrderDetailCard',
   components: {
     InfoCard,
     ProductCard,
-    TableCard
+    TableCard,
+    newDetailModel
   },
   props: {
     orderDetail: {
@@ -147,7 +176,7 @@ export default {
         { label: '合同金额合计', key: 'final_price_total' },
         { label: '标准售价合计', key: 'original_price_total'},
         { label: '折扣率', key: 'rate_total' },
-        { label: '渠道佣金', key: 'commission'},
+        { label: '销售费用', key: 'commission'},
         { label: '净合同金额合计', key: 'pure_amount'},
         { label: '0元订单类型', key: 'zero_type', condition: () => this.orderData.final_price_total === '0.00' },
       ],
@@ -272,12 +301,22 @@ export default {
       this.setTotalAmounts(productData);
       this.productData = productData;
     },
+    // 权限开通
+    openPermissionActivation() {
+      this.$refs.newDetailModel.permissionActivationShow = true;
+    },
+    isShowPermission (product) {
+      const { auto, attribute } = product
+      const { return_status } = this.orderData?.return_status
+      // 仅当该产品类型支持系统自动开通权限,且产品属性为会员服务或资源包,且“回款状态”为“全额回款”才展示,否则不展示;
+      return auto === 1 && (attribute === 1 || attribute === 2) && return_status === 1
+    },
     // 设置红冲标识显示字段
     setRedPunchDisplay(product) { 
       const { isUpCommission, isUpEnt, isUpCash } = this.orderDetailInfo?.redPunchData || {};
       const RETURN_BOOL = {
         '合同金额': isUpCash,
-        '渠道佣金': isUpCommission,
+        '销售费用': isUpCommission,
         '签约主体': isUpEnt,
         '折扣率': isUpCash
       }
@@ -344,7 +383,7 @@ export default {
       console.log(totalOriginalPrice, 'totalOriginalPrice')
       const rateTotal = div(totalFinalPrice, totalOriginalPrice) ? (div(totalFinalPrice, totalOriginalPrice) * 100).toFixed(2) + '%' : '无法计算';
 
-      this.orderData.final_price_total = '¥' + totalFinalPrice;
+      this.orderData.final_price_total = totalFinalPrice;
       this.orderData.original_price_total = '¥' + totalOriginalPrice;
       this.orderData.rate_total = rateTotal;
     },
@@ -516,6 +555,16 @@ export default {
     align-items: center;
     margin-bottom: 6px;
   }
+  .order-detail-product-actions-btn {
+    padding: 4px 17px;
+    background: $color_main;
+    font-size: 14px;
+    line-height: 22px;
+    color: $white;
+    border-radius: 4px;
+    border: none;
+    cursor: pointer;
+  }
   .grouped-items {
     display: flex;
     flex-wrap: wrap;
@@ -558,5 +607,32 @@ export default {
       color: #2ABED1;
     }
   }
+  .order-detail-product-activity {
+    padding: 14px 20px;
+    border: 1px solid $color_main;
+    background: rgba(42, 190, 209, 0.08);
+    border-radius: 8px;
+    &-title {
+      font-size: 14px;
+      line-height: 22px;
+      color: $color_main;
+    }
+    &-item {
+      display: flex;
+      align-items: center;
+      margin-top: 8px;
+    }
+    &-item-title {
+      margin-right: 24px;
+      &>span {
+        font-size: 14px;
+        line-height: 22px;
+        color: #686868;
+      }
+      &>span:last-child {
+        color: #1D1D1D; 
+      }
+    }
+  }
 }
 </style>

+ 37 - 13
src/views/create-order/components/order-detail-submodule/PaymentInfo.vue

@@ -22,12 +22,13 @@
           width="1108px"
         >
           <template v-slot:return_voucher_url="{ row }">
-            <span @click="vouched(row.row.return_voucher_url)" class="column-cell">点击查看</span>
+            <span v-if="row.row.return_voucher_url" @click="vouched(row.row.return_voucher_url)" class="column-cell">点击查看</span>
+            <span v-else>-</span>
           </template>
         </TableCard>
       </div>
     </InfoCard>
-    <InfoCard title="用户自助下单对公转账">
+    <InfoCard v-if="orderTransfer.length" title="用户自助下单对公转账">
       <div class="payment-info-content">
         <TableCard
           class="payment-info-content-table"
@@ -78,14 +79,15 @@ export default {
           label: '回款时间',
           prop: 'return_time',
           width: '112',
-          render (row) {
-            return defaultRender(row.return_time)
-          }
+          render: (row) => this.formatDate(row.return_time)
         },
         {
-          label: '支付凭证',
-          prop: 'return_voucher_url',
-          width: '90'
+          label: '回款金额',
+          prop: 'return_money',
+          width: '90',
+          render: (row) => {
+            return row.return_money ? '¥' + this.returnAmount(row.return_money) : this.returnAmount(0)
+          }
         },
         {
           label: '支付方式',
@@ -100,11 +102,11 @@ export default {
             return payCashStatus.find(v => v.v == row.return_type).n || '-'
           }
         },
-        // {
-        //   label: '手续费',
-        //   prop: 'commission',
-        //   width: '90'
-        // },
+        {
+          label: '手续费',
+          prop: 'commission',
+          width: '90'
+        },
         {
           label: '回款银行',
           prop: 'bank_name',
@@ -137,6 +139,11 @@ export default {
             return row.flow_money ? '¥' + this.returnAmount(row.flow_money) : this.returnAmount(0)
           }
         },
+        {
+          label: '支付凭证',
+          prop: 'return_voucher_url',
+          width: '90'
+        },
         {
           label: '操作时间',
           prop: 'operate_time',
@@ -260,6 +267,11 @@ export default {
       const amount = (val / 100).toFixed(2) || 0;
       return amount;
     },
+    formatDate(timeString) {
+      if (!timeString) return '-';
+      // 只取空格前的日期部分
+      return timeString.split(' ')[0];
+    },
     setReturnType(val) {
       if (val === 1) {
           return '微信支付'
@@ -285,6 +297,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+
 .payment-info {
   background: #F2F2F4;
   ::v-deep {
@@ -308,6 +321,17 @@ export default {
   .payment-info-content-table {
     border-radius: 4px;
     ::v-deep {
+      .el-table__body-wrapper {
+        &::-webkit-scrollbar {
+          display: block; /* 强制显示滚动条 */
+          height: 8px;
+        }
+
+        &::-webkit-scrollbar-thumb {
+          background-color: rgba(0, 0, 0, 0.2);
+          border-radius: 4px;
+        }
+      }
       .cell {
         text-align: center;
         font-size: 14px;

+ 23 - 13
src/views/create-order/ui/ProductCard.vue

@@ -1,20 +1,25 @@
 <template>
-  <div class="product-card">
-    <div class="product-card-header">
-      <div class="product-header-left">
-        <h3 class="product-header-title">
-          <slot name="title">{{ title }}</slot>
-        </h3>
-        <span class="product-header-subtitle">
-          <slot name="subtitle">{{ subtitle }}</slot>
-        </span>
+  <div class="product-card-container">
+    <div class="product-card">
+      <div class="product-card-header">
+        <div class="product-header-left">
+          <h3 class="product-header-title">
+            <slot name="title">{{ title }}</slot>
+          </h3>
+          <span class="product-header-subtitle">
+            <slot name="subtitle">{{ subtitle }}</slot>
+          </span>
+        </div>
+        <div class="product-header-right product-header-actions">
+          <slot name="actions"></slot>
+        </div>
       </div>
-      <div class="product-header-right product-header-actions">
-        <slot name="actions"></slot>
+      <div class="product-card-content">
+        <slot name="default"></slot>
       </div>
     </div>
-    <div class="product-card-content">
-      <slot name="default"></slot>
+    <div class="product-card-activity">
+      <slot name="activity"></slot>
     </div>
   </div>
 </template>
@@ -36,6 +41,11 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.product-card-container {
+  &:not(:last-of-type) {
+    margin-bottom: 20px;
+  }
+}
 .product-card {
   font-size: 14px;
   border: 1px solid #E0E0E0;