Browse Source

Merge branch 'feat/v20241028-拆分分佣等级' into dev

GuYun-D 5 months ago
parent
commit
d729594765

+ 100 - 94
src/views/commissionAllocation/gradeCommission/components/EditModal.vue

@@ -18,99 +18,103 @@
           <el-option label="组合活动" :value="6" />
         </el-select>
       </el-form-item>
-      <el-form-item label="团长规则" prop="leadersRule">
-        <el-select v-model="formData.leadersRule" size="mini" placeholder="请选择团长规则">
-          <el-option label="比例" :value="1" />
-          <el-option label="金额" :value="2" />
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="formData.leadersRule" label="直接团长规则" prop="leadersMoney">
-        <el-input v-model="formData.leadersMoney" placeholder="请输入直接团长规则" style="width: 250px">
-          <template #append>
-            <div v-if="formData.leadersRule === 1">%</div>
-            <div v-else-if="formData.leadersRule === 2">元</div>
-          </template>
-        </el-input>
-      </el-form-item>
-      <el-form-item v-if="formData.leadersRule" label="间接团长规则" prop="leadersInMoney">
-        <el-input v-model="formData.leadersInMoney" placeholder="请输入间接团长规则" style="width: 250px">
-          <template #append>
-            <div v-if="formData.leadersRule === 1">%</div>
-            <div v-else-if="formData.leadersRule === 2">元</div>
-          </template>
-        </el-input>
-      </el-form-item>
-      <el-form-item label="合伙人规则" prop="partnerRule">
-        <el-select v-model="formData.partnerRule" size="mini" placeholder="请选择合伙人规则">
-          <el-option label="比例" :value="1" />
-          <el-option label="金额" :value="2" />
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="formData.partnerRule" label="直接合伙人规则" prop="partnerMoney">
-        <el-input v-model="formData.partnerMoney" placeholder="请输入直接合伙人规则" style="width: 250px">
-          <template #append>
-            <div v-if="formData.partnerRule === 1">%</div>
-            <div v-else-if="formData.partnerRule === 2">元</div>
-          </template>
-        </el-input>
-      </el-form-item>
-      <el-form-item v-if="formData.partnerRule" label="间接合伙人规则" prop="partnerInMoney">
-        <el-input v-model="formData.partnerInMoney" placeholder="请输入间接合伙人规则" style="width: 250px">
-          <template #append>
-            <div v-if="formData.partnerRule === 1">%</div>
-            <div v-else-if="formData.partnerRule === 2">元</div>
-          </template>
-        </el-input>
-      </el-form-item>
-      <el-form-item label="加盟商规则" prop="franchiseeRule">
-        <el-select v-model="formData.franchiseeRule" size="mini" placeholder="请选择加盟商规则">
-          <el-option label="比例" :value="1" />
-          <el-option label="金额" :value="2" />
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="formData.franchiseeRule" label="加盟商佣金规则" prop="franchiseeMoney">
-        <el-input v-model="formData.franchiseeMoney" placeholder="请输入加盟商佣金规则" style="width: 250px">
-          <template #append>
-            <div v-if="formData.franchiseeRule === 1">%</div>
-            <div v-else-if="formData.franchiseeRule === 2">元</div>
-          </template>
-        </el-input>
-      </el-form-item>
-      <el-form-item label="代理商规则" prop="agentRule">
-        <el-select v-model="formData.agentRule" size="mini" placeholder="请选择代理商规则">
-          <el-option label="比例" :value="1" />
-          <el-option label="金额" :value="2" />
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="formData.agentRule" label="代理商佣金规则" prop="agentMoney">
-        <el-input v-model="formData.agentMoney" placeholder="请输入代理商佣金规则" style="width: 250px">
-          <template #append>
-            <div v-if="formData.agentRule === 1">%</div>
-            <div v-else-if="formData.agentRule === 2">元</div>
-          </template>
-        </el-input>
-      </el-form-item>
-      <el-form-item label="社区店规则" prop="communityRule">
-        <el-select v-model="formData.communityRule" size="mini" placeholder="请选择社区店规则">
-          <el-option label="比例" :value="1" />
-          <el-option label="金额" :value="2" />
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="formData.communityRule" label="社区店佣金规则" prop="communityMoney">
-        <el-input v-model="formData.communityMoney" placeholder="请输入社区店佣金规则" style="width: 250px">
-          <template #append>
-            <div v-if="formData.communityRule === 1">%</div>
-            <div v-else-if="formData.communityRule === 2">元</div>
-          </template>
-        </el-input>
-      </el-form-item>
-      <el-form-item label="分佣来源" prop="sourceType">
-        <el-select v-model="formData.sourceType" size="mini" placeholder="请选择分佣来源">
-          <el-option label="订单金额" :value="1" />
-          <el-option label="赠送代金券" :value="2" />
-          <el-option label="消费金" :value="3" />
-        </el-select>
-      </el-form-item>
+      <div v-show="[0, 1].includes(type)">
+        <el-form-item label="团长规则" prop="leadersRule">
+          <el-select v-model="formData.leadersRule" size="mini" placeholder="请选择团长规则">
+            <el-option label="比例" :value="1" />
+            <el-option label="金额" :value="2" />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="formData.leadersRule" label="直接团长规则" prop="leadersMoney">
+          <el-input v-model="formData.leadersMoney" placeholder="请输入直接团长规则" style="width: 250px">
+            <template #append>
+              <div v-if="formData.leadersRule === 1">%</div>
+              <div v-else-if="formData.leadersRule === 2">元</div>
+            </template>
+          </el-input>
+        </el-form-item>
+        <el-form-item v-if="formData.leadersRule" label="间接团长规则" prop="leadersInMoney">
+          <el-input v-model="formData.leadersInMoney" placeholder="请输入间接团长规则" style="width: 250px">
+            <template #append>
+              <div v-if="formData.leadersRule === 1">%</div>
+              <div v-else-if="formData.leadersRule === 2">元</div>
+            </template>
+          </el-input>
+        </el-form-item>
+        <el-form-item label="合伙人规则" prop="partnerRule">
+          <el-select v-model="formData.partnerRule" size="mini" placeholder="请选择合伙人规则">
+            <el-option label="比例" :value="1" />
+            <el-option label="金额" :value="2" />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="formData.partnerRule" label="直接合伙人规则" prop="partnerMoney">
+          <el-input v-model="formData.partnerMoney" placeholder="请输入直接合伙人规则" style="width: 250px">
+            <template #append>
+              <div v-if="formData.partnerRule === 1">%</div>
+              <div v-else-if="formData.partnerRule === 2">元</div>
+            </template>
+          </el-input>
+        </el-form-item>
+        <el-form-item v-if="formData.partnerRule" label="间接合伙人规则" prop="partnerInMoney">
+          <el-input v-model="formData.partnerInMoney" placeholder="请输入间接合伙人规则" style="width: 250px">
+            <template #append>
+              <div v-if="formData.partnerRule === 1">%</div>
+              <div v-else-if="formData.partnerRule === 2">元</div>
+            </template>
+          </el-input>
+        </el-form-item>
+      </div>
+      <div v-show="[0, 2].includes(type)">
+        <el-form-item label="加盟商规则" prop="franchiseeRule">
+          <el-select v-model="formData.franchiseeRule" size="mini" placeholder="请选择加盟商规则">
+            <el-option label="比例" :value="1" />
+            <el-option label="金额" :value="2" />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="formData.franchiseeRule" label="加盟商佣金规则" prop="franchiseeMoney">
+          <el-input v-model="formData.franchiseeMoney" placeholder="请输入加盟商佣金规则" style="width: 250px">
+            <template #append>
+              <div v-if="formData.franchiseeRule === 1">%</div>
+              <div v-else-if="formData.franchiseeRule === 2">元</div>
+            </template>
+          </el-input>
+        </el-form-item>
+        <el-form-item label="代理商规则" prop="agentRule">
+          <el-select v-model="formData.agentRule" size="mini" placeholder="请选择代理商规则">
+            <el-option label="比例" :value="1" />
+            <el-option label="金额" :value="2" />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="formData.agentRule" label="代理商佣金规则" prop="agentMoney">
+          <el-input v-model="formData.agentMoney" placeholder="请输入代理商佣金规则" style="width: 250px">
+            <template #append>
+              <div v-if="formData.agentRule === 1">%</div>
+              <div v-else-if="formData.agentRule === 2">元</div>
+            </template>
+          </el-input>
+        </el-form-item>
+        <el-form-item label="社区店规则" prop="communityRule">
+          <el-select v-model="formData.communityRule" size="mini" placeholder="请选择社区店规则">
+            <el-option label="比例" :value="1" />
+            <el-option label="金额" :value="2" />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="formData.communityRule" label="社区店佣金规则" prop="communityMoney">
+          <el-input v-model="formData.communityMoney" placeholder="请输入社区店佣金规则" style="width: 250px">
+            <template #append>
+              <div v-if="formData.communityRule === 1">%</div>
+              <div v-else-if="formData.communityRule === 2">元</div>
+            </template>
+          </el-input>
+        </el-form-item>
+        <el-form-item label="分佣来源" prop="sourceType">
+          <el-select v-model="formData.sourceType" size="mini" placeholder="请选择分佣来源">
+            <el-option label="订单金额" :value="1" />
+            <el-option label="赠送代金券" :value="2" />
+            <el-option label="消费金" :value="3" />
+          </el-select>
+        </el-form-item>
+      </div>
     </el-form>
     <template #footer>
       <span class="dialog-footer">
@@ -134,6 +138,7 @@ export default {
         width: '820px',
         title: ''
       },
+      type: 0,
       visible: false,
       activityList: [],
       formData: {
@@ -199,7 +204,8 @@ export default {
       const res = await getAllPlatformBeeCurrency({})
       this.activityList = res.data
     },
-    handleOpen(params = {}) {
+    handleOpen(params = {}, type) {
+      this.type = type
       this.modalOptions.title = params.ruleId ? '编辑平台消费金活动分佣规则' : '添加平台消费金活动分佣规则'
       this.formData = Object.assign(this.$options.data().formData, params, {
         ruleId: params.ruleId || '',

+ 39 - 58
src/views/commissionAllocation/gradeCommission/index.vue

@@ -2,37 +2,20 @@
   <div class="app-container">
     <!-- 查询和其他操作 -->
     <div class="filter-container">
-      <el-select
-        v-model="listQuery.activityType" clearable size="mini" class="filter-item"
-        style="width: 200px;" placeholder="请选择活动类型"
-      >
+      <el-select v-model="listQuery.activityType" clearable size="mini" class="filter-item" style="width: 200px" placeholder="请选择活动类型">
         <el-option label="499" :value="1" />
         <el-option label="商圈" :value="2" />
         <el-option label="爆品" :value="3" />
         <el-option label="消费金" :value="4" />
       </el-select>
-      <el-button
-        size="mini" class="filter-item" type="primary" icon="el-icon-search"
-        style="margin-left:10px;"
-        @click="handleSearch"
-      >
-        查找
-      </el-button>
+      <el-button size="mini" class="filter-item" type="primary" icon="el-icon-search" style="margin-left: 10px" @click="handleSearch">查找</el-button>
       <br />
-      <el-button
-        size="mini" type="primary" icon="el-icon-plus"
-        @click="$refs.EditModal && $refs.EditModal.handleOpen({ ruleId: '' })"
-      >
-        添加
-      </el-button>
+      <el-button size="mini" type="primary" icon="el-icon-plus" @click="$refs.EditModal && $refs.EditModal.handleOpen({ ruleId: '' }, 0)">添加</el-button>
     </div>
 
     <!-- 查询结果 -->
     <div v-tableHeight>
-      <el-table
-        v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
-        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
-      >
+      <el-table v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list" v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }">
         <el-table-column align="center" width="100" label="规则ID" prop="ruleId" fixed="left" />
         <el-table-column align="center" width="80" label="活动ID" prop="activityId" fixed="left" show-overflow-tooltip />
         <el-table-column align="center" width="100" label="关联活动" prop="activityName" fixed="left" show-overflow-tooltip />
@@ -94,17 +77,12 @@
           </template>
         </el-table-column>
         <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
-        <el-table-column align="center" label="操作" width="220" fixed="right" class-name="small-padding fixed-width">
+        <el-table-column align="center" label="操作" width="280" fixed="right" class-name="small-padding fixed-width">
           <template slot-scope="{ row }">
-            <el-button type="warning" size="mini" @click="handleDetail(row)">
-              详情
-            </el-button>
-            <el-button size="mini" @click="handleEdit(row)">
-              编辑
-            </el-button>
-            <el-button type="danger" size="mini" @click="handleDelete(row)">
-              删除
-            </el-button>
+            <el-button type="warning" size="mini" @click="handleDetail(row)">详情</el-button>
+            <el-button type="primary" size="mini" @click="handleEdit(row, 1)">编辑业务</el-button>
+            <el-button type="primary" size="mini" @click="handleEdit(row, 2)">编辑行政</el-button>
+            <el-button type="danger" size="mini" @click="handleDelete(row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -112,10 +90,13 @@
 
     <div>
       <el-pagination
-        :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize"
-        layout="total, sizes, prev, pager, next, jumper" :total="total"
-        @size-change="(val) => ((listQuery.pageSize = val) && getList())"
-        @current-change="(val) => ((listQuery.page = val) && getList())"
+        :current-page="listQuery.page"
+        :page-sizes="[10, 20, 50, 100]"
+        :page-size="listQuery.pageSize"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="total"
+        @size-change="(val) => (listQuery.pageSize = val) && getList()"
+        @current-change="(val) => (listQuery.page = val) && getList()"
       />
     </div>
 
@@ -170,8 +151,8 @@ export default {
     handleDetail(row) {
       this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
     },
-    handleEdit(row) {
-      this.$refs.EditModal && this.$refs.EditModal.handleOpen(row)
+    handleEdit(row, type) {
+      this.$refs.EditModal && this.$refs.EditModal.handleOpen(row, type)
     },
     handleDelete(row) {
       this.$confirm('确定删除此项?')
@@ -188,29 +169,29 @@ export default {
 
 <style lang="scss" scoped>
 .app-container {
-	padding: 20px;
-	display: flex;
-	flex-direction: column;
+  padding: 20px;
+  display: flex;
+  flex-direction: column;
 
-	.filter-container {
-		.filter-item {
-			display: inline-block;
-			vertical-align: middle;
-			margin-bottom: 10px;
-		}
-	}
+  .filter-container {
+    .filter-item {
+      display: inline-block;
+      vertical-align: middle;
+      margin-bottom: 10px;
+    }
+  }
 
-	.small-padding {
-		.cell {
-			padding-left: 5px;
-			padding-right: 5px;
-		}
-	}
+  .small-padding {
+    .cell {
+      padding-left: 5px;
+      padding-right: 5px;
+    }
+  }
 
-	.fixed-width {
-		.el-button--mini {
-			padding: 7px 10px;
-		}
-	}
+  .fixed-width {
+    .el-button--mini {
+      padding: 7px 10px;
+    }
+  }
 }
 </style>