浏览代码

Merge branch 'vfeat/20250103-商家分红设置' into dev

GuYun-D 2 月之前
父节点
当前提交
16a4bf65fc

+ 2 - 2
src/views/rm-bank/merchant-dividends/components/MerchantDividendsDeatil.vue

@@ -3,10 +3,10 @@
     <el-dialog title="分红信息" :visible.sync="merchantDividendsDeatilVisible" width="40%">
       <el-descriptions title="分红信息" :column="2" border>
         <el-descriptions-item label="商家ID">{{ form.shopId }}</el-descriptions-item>
-        <el-descriptions-item label="利润分红比例">{{ form.profitRate * 100 + '%' }}</el-descriptions-item>
+        <el-descriptions-item label="利润分红比例">{{ (form.profitRate * 100).toFixed(2) + '%' }}</el-descriptions-item>
         <el-descriptions-item label="赠送总份额">{{ form.totalQuota || 0 }}</el-descriptions-item>
         <el-descriptions-item label="实际达成目标">{{ form.actualAmount || 0 }}</el-descriptions-item>
-        <el-descriptions-item label="年度运营目标">{{ form.targetAmount || 0 }}</el-descriptions-item>
+        <el-descriptions-item label="年度运营目标">{{ (form.targetAmount * 100).toFixed(2) + '%' }}</el-descriptions-item>
         <el-descriptions-item label="分红平衡点">{{ form.balancePoint || 0 }}</el-descriptions-item>
         <el-descriptions-item label="创建时间">{{ form.createTime }}</el-descriptions-item>
       </el-descriptions>

+ 12 - 2
src/views/rm-bank/merchant-dividends/components/MerchantDividendsModal.vue

@@ -27,6 +27,7 @@
       </el-form-item>
       <el-form-item label="年度运营目标" prop="targetAmount">
         <el-input v-model="merchantDividendsForm.targetAmount" placeholder="请输入年度运营目标" />
+        <div class="tip">范围0-1,精确到小数点后2位, 多于两位默认会保留2位</div>
       </el-form-item>
       <el-form-item label="分红平衡点" prop="balancePoint">
         <el-input v-model="merchantDividendsForm.balancePoint" placeholder="请输入分红平衡点" />
@@ -43,7 +44,6 @@
 import { postShopDividendSettingsApi, patchShopDividendSettingsByIdApi } from '@/api/rm-bank'
 import { businessListGetAll } from '@/api/business'
 
-
 const validateNumber = (label) => {
   return (_, value, cb) => {
     const num = value * 1
@@ -94,7 +94,17 @@ export default {
         ],
         targetAmount: [
           { required: true, message: '请输入年度运营目标', trigger: 'blur' },
-          { validator: validateNumber('年度运营目标'), trigger: 'blur' }
+          { validator: validateNumber('年度运营目标'), trigger: 'blur' },
+          {
+            validator: (_, value, cb) => {
+              if (value < 0 || value > 1) {
+                cb(new Error('年度运营目标必须在0-1之间'))
+              } else {
+                cb()
+              }
+            },
+            trigger: 'blur'
+          }
         ],
         balancePoint: [
           { required: true, message: '请输入分红平衡点', trigger: 'blur' },

+ 3 - 3
src/views/rm-bank/merchant-dividends/index.vue

@@ -19,7 +19,7 @@
 
         <el-table-column prop="profitRate" label="利润分红比例" align="center">
           <template slot-scope="scope">
-            <el-tag size="mini">{{ scope.row.profitRate * 100 + '%' }} </el-tag>
+            <el-tag size="mini">{{ (scope.row.profitRate * 100).toFixed(2) + '%' }}</el-tag>
           </template>
         </el-table-column>
 
@@ -31,7 +31,7 @@
 
         <el-table-column prop="targetAmount" label="年度运营目标" align="center">
           <template slot-scope="scope">
-            <el-tag type="warning" size="mini">{{ scope.row.targetAmount || '0' }}</el-tag>
+            <el-tag type="warning" size="mini">{{ (scope.row.targetAmount * 100).toFixed(2) + '%' }}</el-tag>
           </template>
         </el-table-column>
 
@@ -84,7 +84,7 @@ import MerchantDividendsDeatil from './components/MerchantDividendsDeatil.vue'
 
 export default {
   name: 'MerchantDividendsList',
-  components: {MerchantDividendsModal,MerchantDividendsDeatil},
+  components: { MerchantDividendsModal, MerchantDividendsDeatil },
   data() {
     return {
       query: {