|  | @@ -25,6 +25,21 @@
 | 
	
		
			
				|  |  |            />
 | 
	
		
			
				|  |  |          </el-select>
 | 
	
		
			
				|  |  |        </el-form-item>
 | 
	
		
			
				|  |  | +      <el-form-item label="分销商标签">
 | 
	
		
			
				|  |  | +        <el-select
 | 
	
		
			
				|  |  | +          v-model="queryParams.personsType"
 | 
	
		
			
				|  |  | +          placeholder="分销商标签"
 | 
	
		
			
				|  |  | +          clearable
 | 
	
		
			
				|  |  | +          style="width: 140px"
 | 
	
		
			
				|  |  | +        >
 | 
	
		
			
				|  |  | +          <el-option
 | 
	
		
			
				|  |  | +            v-for="dict in dict.type.persons_type"
 | 
	
		
			
				|  |  | +            :key="dict.value"
 | 
	
		
			
				|  |  | +            :label="dict.label"
 | 
	
		
			
				|  |  | +            :value="dict.value"
 | 
	
		
			
				|  |  | +          />
 | 
	
		
			
				|  |  | +        </el-select>
 | 
	
		
			
				|  |  | +      </el-form-item>
 | 
	
		
			
				|  |  |        <el-form-item>
 | 
	
		
			
				|  |  |          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
 | 
	
		
			
				|  |  |          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
 | 
	
	
		
			
				|  | @@ -62,10 +77,22 @@
 | 
	
		
			
				|  |  |            v-hasPermi="['personnelMr:personnelMr:codeSet']"
 | 
	
		
			
				|  |  |          >推广码海报设置</el-button>
 | 
	
		
			
				|  |  |        </el-col>
 | 
	
		
			
				|  |  | +      <el-col :span="1.5">
 | 
	
		
			
				|  |  | +        <el-button
 | 
	
		
			
				|  |  | +          type="danger"
 | 
	
		
			
				|  |  | +          plain
 | 
	
		
			
				|  |  | +          icon="el-icon-s-tools"
 | 
	
		
			
				|  |  | +          size="mini"
 | 
	
		
			
				|  |  | +          @click="openRetailRate"
 | 
	
		
			
				|  |  | +          v-hasPermi="['personnelMr:personnelMr:codeSet']"
 | 
	
		
			
				|  |  | +        >批量设置佣金税率</el-button>
 | 
	
		
			
				|  |  | +      </el-col>
 | 
	
		
			
				|  |  |        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 | 
	
		
			
				|  |  |      </el-row>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    <el-table ref="tables" v-loading="loading" :data="dataList" border>
 | 
	
		
			
				|  |  | +    <el-table ref="tables" v-loading="loading" :data="dataList" @selection-change="handleSelectionChange" border>
 | 
	
		
			
				|  |  | +      <el-table-column type="selection" width="55">
 | 
	
		
			
				|  |  | +    </el-table-column>
 | 
	
		
			
				|  |  |        <el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
 | 
	
		
			
				|  |  |        <el-table-column label="分销商名称" align="center" prop="name" />
 | 
	
		
			
				|  |  |        <el-table-column label="分销商类型" align="center" prop="type">
 | 
	
	
		
			
				|  | @@ -73,6 +100,17 @@
 | 
	
		
			
				|  |  |            <dict-tag :options="dict.type.distribution_type" :value="scope.row.type"/>
 | 
	
		
			
				|  |  |          </template>
 | 
	
		
			
				|  |  |        </el-table-column>
 | 
	
		
			
				|  |  | +      <el-table-column label="分销商标签" align="center" prop="type">
 | 
	
		
			
				|  |  | +        <template slot-scope="scope">
 | 
	
		
			
				|  |  | +          <dict-tag :options="dict.type.persons_type" :value="scope.row.personsType"/>
 | 
	
		
			
				|  |  | +        </template>
 | 
	
		
			
				|  |  | +      </el-table-column>
 | 
	
		
			
				|  |  | +      <el-table-column label="佣金税率" align="center" prop="type">
 | 
	
		
			
				|  |  | +        <template slot-scope="scope">
 | 
	
		
			
				|  |  | +          <span>{{ scope.row.retailRate }}%</span>
 | 
	
		
			
				|  |  | +        </template>
 | 
	
		
			
				|  |  | +      </el-table-column>
 | 
	
		
			
				|  |  | +      <!-- <el-table-column label="佣金税率" align="center" prop="retailRate" /> -->
 | 
	
		
			
				|  |  |        <el-table-column label="负责人" align="center" prop="contact" />
 | 
	
		
			
				|  |  |        <el-table-column label="账号/联系电话" align="center" prop="mobile" />
 | 
	
		
			
				|  |  |        <el-table-column label="被扫次数" align="center" prop="scanCounts" />
 | 
	
	
		
			
				|  | @@ -232,7 +270,43 @@
 | 
	
		
			
				|  |  |            type="primary"
 | 
	
		
			
				|  |  |            @click="submitForm"
 | 
	
		
			
				|  |  |            v-loading.fullscreen.lock="setLoading"
 | 
	
		
			
				|  |  | -          element-loading-text="提交中..."
 | 
	
		
			
				|  |  | +          element-loading-text="请等待..."
 | 
	
		
			
				|  |  | +          element-loading-spinner="el-icon-loading"
 | 
	
		
			
				|  |  | +          element-loading-background="rgba(0, 0, 0, 0.8)"
 | 
	
		
			
				|  |  | +        >
 | 
	
		
			
				|  |  | +          <span v-if="loading">提交中...</span>
 | 
	
		
			
				|  |  | +          <span v-else>保存</span>
 | 
	
		
			
				|  |  | +        </el-button>
 | 
	
		
			
				|  |  | +      </div>
 | 
	
		
			
				|  |  | +    </el-dialog>
 | 
	
		
			
				|  |  | +    <el-dialog
 | 
	
		
			
				|  |  | +      title="佣金税率设置"
 | 
	
		
			
				|  |  | +      :visible.sync="showRetailRate"
 | 
	
		
			
				|  |  | +      width="650px"
 | 
	
		
			
				|  |  | +      :destroy-on-close="true"
 | 
	
		
			
				|  |  | +      :close-on-click-modal="false"
 | 
	
		
			
				|  |  | +    >
 | 
	
		
			
				|  |  | +      <el-form :model="retailRateForm" ref="retailRateForm" :rules="retailRateFormRules" label-width="120px">
 | 
	
		
			
				|  |  | +        <el-form-item label="佣金税率设置" prop="retailRate">
 | 
	
		
			
				|  |  | +          <el-input
 | 
	
		
			
				|  |  | +            type="number"
 | 
	
		
			
				|  |  | +            v-model="retailRateForm.retailRate"
 | 
	
		
			
				|  |  | +            placeholder="请输入佣金税率"
 | 
	
		
			
				|  |  | +            clearable
 | 
	
		
			
				|  |  | +            @change="retailRateChange"
 | 
	
		
			
				|  |  | +            style="width: 260px;"
 | 
	
		
			
				|  |  | +          >
 | 
	
		
			
				|  |  | +            <template slot="append">%</template>
 | 
	
		
			
				|  |  | +          </el-input>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +      </el-form>
 | 
	
		
			
				|  |  | +      <div slot="footer" class="dialog-footer">
 | 
	
		
			
				|  |  | +        <el-button @click="showRetailRate = false">取消</el-button>
 | 
	
		
			
				|  |  | +        <el-button
 | 
	
		
			
				|  |  | +          type="primary"
 | 
	
		
			
				|  |  | +          @click="submitRetailRateForm"
 | 
	
		
			
				|  |  | +          v-loading.fullscreen.lock="loading"
 | 
	
		
			
				|  |  | +          element-loading-text="请等待..."
 | 
	
		
			
				|  |  |            element-loading-spinner="el-icon-loading"
 | 
	
		
			
				|  |  |            element-loading-background="rgba(0, 0, 0, 0.8)"
 | 
	
		
			
				|  |  |          >
 | 
	
	
		
			
				|  | @@ -246,7 +320,7 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -import { pageList, deleteById, updateStatus, configUpdate, getSetInfo, getRetailQrcode } from '@/api/distribution/personnelMr'
 | 
	
		
			
				|  |  | +import { pageList, deleteById, updateStatus, configUpdate, getSetInfo, getRetailQrcode ,batchUpdateRetailRate} from '@/api/distribution/personnelMr'
 | 
	
		
			
				|  |  |  import addAndEdit from "./dialog/addAndEdit.vue";
 | 
	
		
			
				|  |  |  import promotionCode from "./dialog/promotionCode.vue";
 | 
	
		
			
				|  |  |  import { Message } from 'element-ui'
 | 
	
	
		
			
				|  | @@ -260,7 +334,7 @@ export default {
 | 
	
		
			
				|  |  |        return url
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  | -  dicts: ['distribution_type','user_allow_withdraw'],
 | 
	
		
			
				|  |  | +  dicts: ['distribution_type','user_allow_withdraw','persons_type'],
 | 
	
		
			
				|  |  |    components: { addAndEdit, promotionCode },
 | 
	
		
			
				|  |  |    data() {
 | 
	
		
			
				|  |  |      let validateNumber = (rule, value, callback) => {
 | 
	
	
		
			
				|  | @@ -341,6 +415,13 @@ export default {
 | 
	
		
			
				|  |  |        setRules: [],
 | 
	
		
			
				|  |  |        setLoading: false,
 | 
	
		
			
				|  |  |        getShareImgBase64Loading: false,
 | 
	
		
			
				|  |  | +      showRetailRate: false,//税率设置弹窗
 | 
	
		
			
				|  |  | +      retailRateForm: {ids:[],retailRate:undefined},
 | 
	
		
			
				|  |  | +      retailRateFormRules: {
 | 
	
		
			
				|  |  | +        retailRate: [
 | 
	
		
			
				|  |  | +          { required: true, message: '请输入佣金税率', trigger: ['change','blur'] },
 | 
	
		
			
				|  |  | +        ],
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    created() {
 | 
	
	
		
			
				|  | @@ -394,6 +475,15 @@ export default {
 | 
	
		
			
				|  |  |      openSet() {
 | 
	
		
			
				|  |  |        this.setStatus = true
 | 
	
		
			
				|  |  |        this.getSetApi();
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +     /** 佣金税率设置 */
 | 
	
		
			
				|  |  | +     openRetailRate() {
 | 
	
		
			
				|  |  | +      if(this.ids.length == 0){
 | 
	
		
			
				|  |  | +        this.$message.warning("请选择分销商");
 | 
	
		
			
				|  |  | +        return;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      console.log('ids',this.ids)
 | 
	
		
			
				|  |  | +      this.showRetailRate = true;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      /** 海报设置按钮操作 */
 | 
	
		
			
				|  |  |      codeSet() {
 | 
	
	
		
			
				|  | @@ -454,6 +544,40 @@ export default {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    /** 佣金税率输入事件 */
 | 
	
		
			
				|  |  | +    retailRateChange(value) {
 | 
	
		
			
				|  |  | +      // 检查输入值是否大于0
 | 
	
		
			
				|  |  | +      if (value <= 0) {
 | 
	
		
			
				|  |  | +        // 如果小于等于0,则将输入值置为0
 | 
	
		
			
				|  |  | +        this.retailRateForm.retailRate = 0;
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        // 如果大于0,则保留输入值
 | 
	
		
			
				|  |  | +        this.retailRateForm.retailRate = value;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    // 佣金税率设置
 | 
	
		
			
				|  |  | +    submitRetailRateForm(){
 | 
	
		
			
				|  |  | +      this.retailRateForm.ids = this.ids;
 | 
	
		
			
				|  |  | +      this.$refs["retailRateForm"].validate(async (valid) => {
 | 
	
		
			
				|  |  | +        if (valid) {
 | 
	
		
			
				|  |  | +          try {
 | 
	
		
			
				|  |  | +            this.loading = true;
 | 
	
		
			
				|  |  | +            const { code } = await batchUpdateRetailRate({ ...this.retailRateForm });
 | 
	
		
			
				|  |  | +            if (code === 200) {
 | 
	
		
			
				|  |  | +              this.setLoading = false;
 | 
	
		
			
				|  |  | +              this.$message.success("操作成功!");
 | 
	
		
			
				|  |  | +              this.getList();
 | 
	
		
			
				|  |  | +              this.retailRateForm={ids:[],retailRate:undefined};
 | 
	
		
			
				|  |  | +              this.showRetailRate = false;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          } catch (error) {
 | 
	
		
			
				|  |  | +          } finally {
 | 
	
		
			
				|  |  | +            this.loading = false;
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  | +      
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /** 禁用或者启用发布按钮操作 */
 | 
	
		
			
				|  |  |      ionlineApi(row) {
 | 
	
	
		
			
				|  | @@ -546,6 +670,12 @@ export default {
 | 
	
		
			
				|  |  |          }, 300); // 这里加上 300ms 的延迟是为了让 DOM 元素完全渲染完成后再进行图片的生成
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    // 多选框选中数据
 | 
	
		
			
				|  |  | +    handleSelectionChange(selection) {
 | 
	
		
			
				|  |  | +      this.ids = selection.map(item => item.id)
 | 
	
		
			
				|  |  | +      this.single = selection.length!=1
 | 
	
		
			
				|  |  | +      this.multiple = !selection.length
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  </script>
 |