|
@@ -1,19 +1,30 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
- <el-main ref="elMain" style="padding: 0px;">
|
|
|
|
|
- <Split :gutterSize="2" style="height: calc(100vh - 120px);">
|
|
|
|
|
|
|
+ <el-main ref="elMain" style="padding: 0px">
|
|
|
|
|
+ <Split :gutterSize="2" style="height: calc(100vh - 120px)">
|
|
|
<!-- 左侧树Start -->
|
|
<!-- 左侧树Start -->
|
|
|
<SplitArea :size="leftSplitWidth" :minSize="240">
|
|
<SplitArea :size="leftSplitWidth" :minSize="240">
|
|
|
<div>
|
|
<div>
|
|
|
<div>
|
|
<div>
|
|
|
<el-checkbox v-model="containsSubDept">包含下级机构</el-checkbox>
|
|
<el-checkbox v-model="containsSubDept">包含下级机构</el-checkbox>
|
|
|
|
|
|
|
|
- <kt-button style="margin-left: 15px;margin-bottom: 10px;" icon="el-icon-plus" label="添加分销" type="primary"
|
|
|
|
|
- perms="sys:distributionManage:add" @click="handleAddButton" />
|
|
|
|
|
|
|
+ <kt-button
|
|
|
|
|
+ style="margin-left: 15px; margin-bottom: 10px"
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
|
+ label="添加分销"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ perms="sys:distributionManage:add"
|
|
|
|
|
+ @click="handleAddButton"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
<el-divider></el-divider>
|
|
<el-divider></el-divider>
|
|
|
|
|
|
|
|
- <tree :setting="ztreeSetting" :nodes="ztreeNodes" @onClick="onZTreeClick" @onCreated="onZTreeCreated" />
|
|
|
|
|
|
|
+ <tree
|
|
|
|
|
+ :setting="ztreeSetting"
|
|
|
|
|
+ :nodes="ztreeNodes"
|
|
|
|
|
+ @onClick="onZTreeClick"
|
|
|
|
|
+ @onCreated="onZTreeCreated"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</SplitArea>
|
|
</SplitArea>
|
|
|
<!-- 左侧树End -->
|
|
<!-- 左侧树End -->
|
|
@@ -25,86 +36,202 @@
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="5">
|
|
<el-col :span="5">
|
|
|
<el-form-item label="分销级别">
|
|
<el-form-item label="分销级别">
|
|
|
- <el-select style="100%" clearable size="small" v-model="queryFrom.retailtype" placeholder="请选择">
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ clearable
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ v-model="queryFrom.retailtype"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ >
|
|
|
<el-option label="一级分销" value="1"></el-option>
|
|
<el-option label="一级分销" value="1"></el-option>
|
|
|
<el-option label="二级分销" value="2"></el-option>
|
|
<el-option label="二级分销" value="2"></el-option>
|
|
|
- <!--<el-option label="三级分销" value="3"></el-option>-->
|
|
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ <el-col :span="5">
|
|
|
|
|
+ <el-form-item label="业务来源">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ clearable
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ v-model="queryFrom.source"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="val in organizationSourceoptions"
|
|
|
|
|
+ :key="val.dictValue"
|
|
|
|
|
+ :label="val.dictTag"
|
|
|
|
|
+ :value="val.dictValue"
|
|
|
|
|
+ ></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <!-- <el-col :span="5">
|
|
|
|
|
+ <el-form-item label="机构">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ clearable
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ v-model="queryFrom.retailtype"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option label="一级分销" value="1"></el-option>
|
|
|
|
|
+ <el-option label="二级分销" value="2"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col> -->
|
|
|
<el-col :span="4">
|
|
<el-col :span="4">
|
|
|
<el-form-item label="">
|
|
<el-form-item label="">
|
|
|
- <el-button size="small" type="primary" @click="queryInfo">查询</el-button>
|
|
|
|
|
|
|
+ <el-button size="small" type="primary" @click="queryInfo"
|
|
|
|
|
+ >查询</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="batchOperation"
|
|
|
|
|
+ :disabled="selectIds.length < 1"
|
|
|
|
|
+ >批量设置</el-button
|
|
|
|
|
+ >
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- <kt-common-table permsEdit="sys:distributionManage:edit" permsDelete="sys:distributionManage:delete"
|
|
|
|
|
- :data="pageResult" :columns="columns" editButtonName="编辑" deleteButtonName="删除" :showBatchDelete="false"
|
|
|
|
|
- @findPage="findPage" @handleEdit="handleTableEdit" deleteName="批量删除" @handleDeleteFlag="handleTableDeleteFlag"
|
|
|
|
|
- @handleDelete="handleTableBatchDelete">
|
|
|
|
|
|
|
+ <kt-common-table
|
|
|
|
|
+ permsEdit="sys:distributionManage:edit"
|
|
|
|
|
+ permsDelete="sys:distributionManage:delete"
|
|
|
|
|
+ :data="pageResult"
|
|
|
|
|
+ :columns="columns"
|
|
|
|
|
+ editButtonName="编辑"
|
|
|
|
|
+ deleteButtonName="删除"
|
|
|
|
|
+ :showBatchDelete="false"
|
|
|
|
|
+ @findPage="findPage"
|
|
|
|
|
+ @handleEdit="handleTableEdit"
|
|
|
|
|
+ deleteName="批量删除"
|
|
|
|
|
+ @handleDeleteFlag="handleTableDeleteFlag"
|
|
|
|
|
+ @handleDelete="handleTableBatchDelete"
|
|
|
|
|
+ :select="true"
|
|
|
|
|
+ @selectionChange="selectionChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot="scope">
|
|
|
|
|
+ {{ 123 }}
|
|
|
|
|
+ </template>
|
|
|
</kt-common-table>
|
|
</kt-common-table>
|
|
|
</SplitArea>
|
|
</SplitArea>
|
|
|
<!-- 右侧列表页面End -->
|
|
<!-- 右侧列表页面End -->
|
|
|
</Split>
|
|
</Split>
|
|
|
</el-main>
|
|
</el-main>
|
|
|
|
|
|
|
|
- <el-dialog v-dialogDrag title="分销管理" :visible.sync="dialogVisible" width="1200px" @close="closeDialog"
|
|
|
|
|
- :before-close="handleDialogBefore">
|
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ v-dialogDrag
|
|
|
|
|
+ title="分销管理"
|
|
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
|
|
+ width="1200px"
|
|
|
|
|
+ @close="closeDialog"
|
|
|
|
|
+ :before-close="handleDialogBefore"
|
|
|
|
|
+ >
|
|
|
<el-tabs v-model="activeTabs">
|
|
<el-tabs v-model="activeTabs">
|
|
|
<el-tab-pane label="行政信息" name="first">
|
|
<el-tab-pane label="行政信息" name="first">
|
|
|
<el-form label-width="120px">
|
|
<el-form label-width="120px">
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="机构编码">
|
|
<el-form-item label="机构编码">
|
|
|
- <el-input size="medium" style="width: 100%;" :value="deptInfo.id" disabled></el-input>
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ size="medium"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :value="deptInfo.id"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="机构名称">
|
|
<el-form-item label="机构名称">
|
|
|
- <el-input size="medium" style="width: 100%;" :value="deptInfo.name" disabled></el-input>
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ size="medium"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :value="deptInfo.name"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="上级机构编码">
|
|
<el-form-item label="上级机构编码">
|
|
|
- <el-input size="medium" style="width: 100%;" :value="deptInfo.parentId" disabled></el-input>
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ size="medium"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :value="deptInfo.parentId"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="机构类型">
|
|
<el-form-item label="机构类型">
|
|
|
- <el-select size="medium" style="width: 100%;" disabled :value="deptInfo.comtype" placeholder="请选择">
|
|
|
|
|
- <el-option v-for="item in comtypeoptions" :key="item.label" :label="item.label"
|
|
|
|
|
- :value="item.value"></el-option>
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ size="medium"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ :value="deptInfo.comtype"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in comtypeoptions"
|
|
|
|
|
+ :key="item.label"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="机构级别">
|
|
<el-form-item label="机构级别">
|
|
|
- <el-select size="medium" style="width: 100%;" disabled :value="deptInfo.comlevel" placeholder="请选择">
|
|
|
|
|
- <el-option v-for="item in comleveloptions" :key="item.label" :label="item.label"
|
|
|
|
|
- :value="item.value"></el-option>
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ size="medium"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ :value="deptInfo.comlevel"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in comleveloptions"
|
|
|
|
|
+ :key="item.label"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="机构性质">
|
|
<el-form-item label="机构性质">
|
|
|
- <el-select size="medium" style="width: 100%;" disabled :value="deptInfo.comattribute" placeholder="请选择">
|
|
|
|
|
- <el-option v-for="item in comattributeoptions" :key="item.label" :label="item.label"
|
|
|
|
|
- :value="item.value"></el-option>
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ size="medium"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ :value="deptInfo.comattribute"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in comattributeoptions"
|
|
|
|
|
+ :key="item.label"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="机构地址" style="width: 100%;">
|
|
|
|
|
- <el-input size="medium" type="textarea" :rows="3" style="width: 100%;"
|
|
|
|
|
- :autosize="{ minRows: 3, maxRows: 4 }" placeholder="请输入内容" :value="deptInfo.address" disabled>
|
|
|
|
|
|
|
+ <el-form-item label="机构地址" style="width: 100%">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ size="medium"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ :rows="3"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :autosize="{ minRows: 3, maxRows: 4 }"
|
|
|
|
|
+ placeholder="请输入内容"
|
|
|
|
|
+ :value="deptInfo.address"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ >
|
|
|
</el-input>
|
|
</el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
@@ -112,53 +239,95 @@
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="团队编码">
|
|
<el-form-item label="团队编码">
|
|
|
- <el-input size="medium" style="width: 100%;" :value="deptInfo.teamid" disabled></el-input>
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ size="medium"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :value="deptInfo.teamid"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="团队名称">
|
|
<el-form-item label="团队名称">
|
|
|
- <el-input size="medium" style="width: 100%;" :value="deptInfo.teamname" disabled></el-input>
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ size="medium"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :value="deptInfo.teamname"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="分佣设置" name="second">
|
|
<el-tab-pane label="分佣设置" name="second">
|
|
|
<el-form v-model="distributionForm" label-width="120px">
|
|
<el-form v-model="distributionForm" label-width="120px">
|
|
|
<el-form-item label="分销方式:">
|
|
<el-form-item label="分销方式:">
|
|
|
- <el-radio-group v-model="distributionForm.retailtype" @change="retailtypeChange">
|
|
|
|
|
- <el-row style="margin: 15px 0px;"><el-radio label="1">一级分销</el-radio></el-row>
|
|
|
|
|
- <el-row style="margin: 15px 0px;"><el-radio label="2">二级分销</el-radio></el-row>
|
|
|
|
|
- <el-row style="margin: 15px 0px;"><el-radio label="3">三级分销</el-radio></el-row>
|
|
|
|
|
- <el-row style="margin: 15px 0px;"><el-radio label="0">无分销分式</el-radio></el-row>
|
|
|
|
|
|
|
+ <el-radio-group
|
|
|
|
|
+ v-model="distributionForm.retailtype"
|
|
|
|
|
+ @change="retailtypeChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-row style="margin: 15px 0px"
|
|
|
|
|
+ ><el-radio label="1">一级分销</el-radio></el-row
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-row style="margin: 15px 0px"
|
|
|
|
|
+ ><el-radio label="2">二级分销</el-radio></el-row
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-row style="margin: 15px 0px"
|
|
|
|
|
+ ><el-radio label="3">三级分销</el-radio></el-row
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-row style="margin: 15px 0px"
|
|
|
|
|
+ ><el-radio label="0">无分销分式</el-radio></el-row
|
|
|
|
|
+ >
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
- <el-table :data="retailSettingForm" border style="width: 100%" :span-method="arraySpanMethod">
|
|
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ :data="retailSettingForm"
|
|
|
|
|
+ border
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :span-method="arraySpanMethod"
|
|
|
|
|
+ >
|
|
|
<el-table-column label="佣金级别" align="center" prop="retailLevel">
|
|
<el-table-column label="佣金级别" align="center" prop="retailLevel">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.retailLevel }}级佣金
|
|
{{ scope.row.retailLevel }}级佣金
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="佣金比例(%)" align="center" prop="retailRate">
|
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="佣金比例(%)"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="retailRate"
|
|
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-input-number v-model="scope.row.retailRate" :precision="2" :min="0" :step="0.01"
|
|
|
|
|
- :max="100"></el-input-number>
|
|
|
|
|
|
|
+ <el-input-number
|
|
|
|
|
+ v-model="scope.row.retailRate"
|
|
|
|
|
+ :precision="2"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :step="0.01"
|
|
|
|
|
+ :max="100"
|
|
|
|
|
+ ></el-input-number>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="说明" align="center" width="700">
|
|
<el-table-column label="说明" align="center" width="700">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<template v-if="distributionForm.retailtype == 1">
|
|
<template v-if="distributionForm.retailtype == 1">
|
|
|
- <img src="@/assets/image/distribution/distribution1.png" width="600px" />
|
|
|
|
|
|
|
+ <img
|
|
|
|
|
+ src="@/assets/image/distribution/distribution1.png"
|
|
|
|
|
+ width="600px"
|
|
|
|
|
+ />
|
|
|
</template>
|
|
</template>
|
|
|
<template v-if="distributionForm.retailtype == 2">
|
|
<template v-if="distributionForm.retailtype == 2">
|
|
|
- <img src="@/assets/image/distribution/distribution2.png" width="600px" />
|
|
|
|
|
|
|
+ <img
|
|
|
|
|
+ src="@/assets/image/distribution/distribution2.png"
|
|
|
|
|
+ width="600px"
|
|
|
|
|
+ />
|
|
|
</template>
|
|
</template>
|
|
|
<template v-if="distributionForm.retailtype == 3">
|
|
<template v-if="distributionForm.retailtype == 3">
|
|
|
- <img src="@/assets/image/distribution/distribution3.png" width="600px" />
|
|
|
|
|
|
|
+ <img
|
|
|
|
|
+ src="@/assets/image/distribution/distribution3.png"
|
|
|
|
|
+ width="600px"
|
|
|
|
|
+ />
|
|
|
</template>
|
|
</template>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -166,30 +335,115 @@
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
<span slot="footer" class="dialog-footer" v-if="activeTabs == 'second'">
|
|
<span slot="footer" class="dialog-footer" v-if="activeTabs == 'second'">
|
|
|
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
|
|
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button size="small" type="primary" @click="comfirmRetail">确 定</el-button>
|
|
|
|
|
|
|
+ <el-button size="small" type="primary" @click="comfirmRetail"
|
|
|
|
|
+ >确 定</el-button
|
|
|
|
|
+ >
|
|
|
</span>
|
|
</span>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ v-dialogDrag
|
|
|
|
|
+ title="分销管理"
|
|
|
|
|
+ :visible.sync="batcnVisible"
|
|
|
|
|
+ width="1200px"
|
|
|
|
|
+ @close="closeDialog"
|
|
|
|
|
+ :before-close="handleDialogBefore"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-tabs v-model="activeTabs">
|
|
|
|
|
+ <el-form v-model="distributionForm" label-width="120px">
|
|
|
|
|
+ <el-form-item label="分销方式:">
|
|
|
|
|
+ <el-radio-group
|
|
|
|
|
+ v-model="distributionForm.retailtype"
|
|
|
|
|
+ @change="retailtypeChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-row style="margin: 15px 0px"
|
|
|
|
|
+ ><el-radio label="1">一级分销</el-radio></el-row
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-row style="margin: 15px 0px"
|
|
|
|
|
+ ><el-radio label="2">二级分销</el-radio></el-row
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-row style="margin: 15px 0px"
|
|
|
|
|
+ ><el-radio label="3">三级分销</el-radio></el-row
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-row style="margin: 15px 0px"
|
|
|
|
|
+ ><el-radio label="0">无分销分式</el-radio></el-row
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-radio-group>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ :data="retailSettingForm"
|
|
|
|
|
+ border
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :span-method="arraySpanMethod"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column label="佣金级别" align="center" prop="retailLevel">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{ scope.row.retailLevel }}级佣金
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="佣金比例(%)" align="center" prop="retailRate">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-input-number
|
|
|
|
|
+ v-model="scope.row.retailRate"
|
|
|
|
|
+ :precision="2"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :step="0.01"
|
|
|
|
|
+ :max="100"
|
|
|
|
|
+ ></el-input-number>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="说明" align="center" width="700">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <template v-if="distributionForm.retailtype == 1">
|
|
|
|
|
+ <img
|
|
|
|
|
+ src="@/assets/image/distribution/distribution1.png"
|
|
|
|
|
+ width="600px"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="distributionForm.retailtype == 2">
|
|
|
|
|
+ <img
|
|
|
|
|
+ src="@/assets/image/distribution/distribution2.png"
|
|
|
|
|
+ width="600px"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="distributionForm.retailtype == 3">
|
|
|
|
|
+ <img
|
|
|
|
|
+ src="@/assets/image/distribution/distribution3.png"
|
|
|
|
|
+ width="600px"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-tabs>
|
|
|
|
|
|
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button size="small" @click="batcnVisible = false">取 消</el-button>
|
|
|
|
|
+ <el-button size="small" type="primary" @click="comfirmBatch"
|
|
|
|
|
+ >确 定</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import Cookies from "js-cookie"
|
|
|
|
|
|
|
+import Cookies from "js-cookie";
|
|
|
import KtButton from "@/views/Core/KtButton"; // 按钮权限组件
|
|
import KtButton from "@/views/Core/KtButton"; // 按钮权限组件
|
|
|
-import tree from "@/components/ztree.vue"; // 机构树组件
|
|
|
|
|
-import KtCommonTable from "@/views/Core/KtCommonTable.vue";//表格组件
|
|
|
|
|
-import CommonUtil from "@/utils/comutil.js"
|
|
|
|
|
|
|
+import tree from "@/components/ztree.vue"; // 机构树组件
|
|
|
|
|
+import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
|
|
|
|
|
+import CommonUtil from "@/utils/comutil.js";
|
|
|
|
|
+import { create } from "tinymce";
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
KtButton,
|
|
KtButton,
|
|
|
tree,
|
|
tree,
|
|
|
- KtCommonTable
|
|
|
|
|
|
|
+ KtCommonTable,
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
-
|
|
|
|
|
return {
|
|
return {
|
|
|
peopleid: "",
|
|
peopleid: "",
|
|
|
peopledeptid: "",
|
|
peopledeptid: "",
|
|
@@ -204,17 +458,17 @@ export default {
|
|
|
ztreeObj: null,
|
|
ztreeObj: null,
|
|
|
ztreeSetting: {
|
|
ztreeSetting: {
|
|
|
check: {
|
|
check: {
|
|
|
- enable: false
|
|
|
|
|
|
|
+ enable: false,
|
|
|
},
|
|
},
|
|
|
data: {
|
|
data: {
|
|
|
simpleData: {
|
|
simpleData: {
|
|
|
enable: true,
|
|
enable: true,
|
|
|
- pIdKey: "parentId"
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ pIdKey: "parentId",
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
view: {
|
|
view: {
|
|
|
- showIcon: false
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ showIcon: false,
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
ztreeNodes: [],
|
|
ztreeNodes: [],
|
|
|
currentTreeNode: null,
|
|
currentTreeNode: null,
|
|
@@ -235,102 +489,233 @@ export default {
|
|
|
|
|
|
|
|
distributionForm: {
|
|
distributionForm: {
|
|
|
id: "",
|
|
id: "",
|
|
|
- retailtype: '', //分销方式
|
|
|
|
|
- disrate1: 0, //一级分销比例
|
|
|
|
|
- disrate2: 0, //二级分销比例
|
|
|
|
|
- disrate3: 0, //三级分销比例ss
|
|
|
|
|
- creator: '', //创建人
|
|
|
|
|
- createtime: "",//创建时间
|
|
|
|
|
|
|
+ retailtype: "", //分销方式
|
|
|
|
|
+ disrate1: 0, //一级分销比例
|
|
|
|
|
+ disrate2: 0, //二级分销比例
|
|
|
|
|
+ disrate3: 0, //三级分销比例ss
|
|
|
|
|
+ creator: "", //创建人
|
|
|
|
|
+ createtime: "", //创建时间
|
|
|
},
|
|
},
|
|
|
// 弹出框 End--------
|
|
// 弹出框 End--------
|
|
|
|
|
|
|
|
// 右侧列表查询数据Start
|
|
// 右侧列表查询数据Start
|
|
|
queryFrom: {
|
|
queryFrom: {
|
|
|
- "retailtype": ""
|
|
|
|
|
|
|
+ retailtype: "",
|
|
|
|
|
+ source: "",
|
|
|
},
|
|
},
|
|
|
pageResult: {},
|
|
pageResult: {},
|
|
|
- pageRequest: { //查询的默认条件
|
|
|
|
|
|
|
+ pageRequest: {
|
|
|
|
|
+ //查询的默认条件
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
pageSize: 20,
|
|
pageSize: 20,
|
|
|
columnFilters: {
|
|
columnFilters: {
|
|
|
- "deptid": {
|
|
|
|
|
- "name": "deptid",
|
|
|
|
|
- "value": ''
|
|
|
|
|
|
|
+ deptid: {
|
|
|
|
|
+ name: "deptid",
|
|
|
|
|
+ value: "",
|
|
|
},
|
|
},
|
|
|
- "containsSubDept": {
|
|
|
|
|
- "name": "containsSubDept",
|
|
|
|
|
- "value": "1"
|
|
|
|
|
|
|
+ containsSubDept: {
|
|
|
|
|
+ name: "containsSubDept",
|
|
|
|
|
+ value: "1",
|
|
|
},
|
|
},
|
|
|
- "retailtype": {
|
|
|
|
|
- "name": "retailtype",
|
|
|
|
|
- "value": ""
|
|
|
|
|
|
|
+ retailtype: {
|
|
|
|
|
+ name: "retailtype",
|
|
|
|
|
+ value: "",
|
|
|
|
|
+ },
|
|
|
|
|
+ source: {
|
|
|
|
|
+ name: "source",
|
|
|
|
|
+ value: "",
|
|
|
},
|
|
},
|
|
|
// "status":{
|
|
// "status":{
|
|
|
// "name":"status",
|
|
// "name":"status",
|
|
|
// "value":"2"
|
|
// "value":"2"
|
|
|
// }
|
|
// }
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
- columns: [ // 数据列
|
|
|
|
|
|
|
+ columns: [
|
|
|
|
|
+ // 数据列
|
|
|
{ prop: "id", label: "分销编码", minWidth: 80, sortable: false },
|
|
{ prop: "id", label: "分销编码", minWidth: 80, sortable: false },
|
|
|
{ prop: "deptid", label: "团队编码", minWidth: 80, sortable: false },
|
|
{ prop: "deptid", label: "团队编码", minWidth: 80, sortable: false },
|
|
|
{ prop: "deptname", label: "团队名称", minWidth: 80, sortable: false },
|
|
{ prop: "deptname", label: "团队名称", minWidth: 80, sortable: false },
|
|
|
- { prop: "retailtype", label: "分销方式", minWidth: 80, sortable: false },
|
|
|
|
|
- { prop: "disrate1", label: "一级佣金比例", minWidth: 80, sortable: false },
|
|
|
|
|
- { prop: "disrate2", label: "二级佣金比例", minWidth: 80, sortable: false },
|
|
|
|
|
- { prop: "disrate3", label: "三级佣金比例", minWidth: 80, sortable: false },
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: "source",
|
|
|
|
|
+ label: "业务来源",
|
|
|
|
|
+ minWidth: 80,
|
|
|
|
|
+ sortable: false,
|
|
|
|
|
+ formatter: this.managementSourceFormatter,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: "retailtype",
|
|
|
|
|
+ label: "分销方式",
|
|
|
|
|
+ minWidth: 80,
|
|
|
|
|
+ sortable: false,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: "disrate1",
|
|
|
|
|
+ label: "一级佣金比例",
|
|
|
|
|
+ minWidth: 80,
|
|
|
|
|
+ sortable: false,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: "disrate2",
|
|
|
|
|
+ label: "二级佣金比例",
|
|
|
|
|
+ minWidth: 80,
|
|
|
|
|
+ sortable: false,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: "disrate3",
|
|
|
|
|
+ label: "三级佣金比例",
|
|
|
|
|
+ minWidth: 80,
|
|
|
|
|
+ sortable: false,
|
|
|
|
|
+ },
|
|
|
// { prop: "display",label: "是否显示用佣金",minWidth: 80,sortable: false},
|
|
// { prop: "display",label: "是否显示用佣金",minWidth: 80,sortable: false},
|
|
|
// { prop: "paytype",label: "提现方式",minWidth: 120,sortable: false},
|
|
// { prop: "paytype",label: "提现方式",minWidth: 120,sortable: false},
|
|
|
// { prop: "minamount",label: "最少提现额度",minWidth: 120,sortable: false},
|
|
// { prop: "minamount",label: "最少提现额度",minWidth: 120,sortable: false},
|
|
|
// { prop: "maxamount",label: "每日提现上限",minWidth: 100,sortable: false},
|
|
// { prop: "maxamount",label: "每日提现上限",minWidth: 100,sortable: false},
|
|
|
// { prop: "status", label: "状态", minWidth: 70, sortable: false},
|
|
// { prop: "status", label: "状态", minWidth: 70, sortable: false},
|
|
|
{ prop: "creator", label: "创建人", minWidth: 100, sortable: false },
|
|
{ prop: "creator", label: "创建人", minWidth: 100, sortable: false },
|
|
|
- { prop: "createtime", label: "创建时间", minWidth: 100, sortable: false }
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: "createtime",
|
|
|
|
|
+ label: "创建时间",
|
|
|
|
|
+ minWidth: 100,
|
|
|
|
|
+ sortable: false,
|
|
|
|
|
+ },
|
|
|
],
|
|
],
|
|
|
|
|
+ selectIds: [],
|
|
|
|
|
+ batcnVisible: false,
|
|
|
|
|
+ organizationSourceoptions: [],
|
|
|
// 右侧列表查询数据End
|
|
// 右侧列表查询数据End
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
mounted() {
|
|
|
- this.findLeftTreeData();// 获取机构树的数据
|
|
|
|
|
|
|
+ this.findLeftTreeData(); // 获取机构树的数据
|
|
|
//用像素初始化左边的split的宽度
|
|
//用像素初始化左边的split的宽度
|
|
|
- this.changeTreeWidth(240);// 初始化树的宽度
|
|
|
|
|
|
|
+ this.changeTreeWidth(240); // 初始化树的宽度
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
- containsSubDept() { // 监听是否包含下级
|
|
|
|
|
- this.pageRequest.columnFilters.containsSubDept.value = this.containsSubDept ? "1" : "0";
|
|
|
|
|
|
|
+ containsSubDept() {
|
|
|
|
|
+ // 监听是否包含下级
|
|
|
|
|
+ this.pageRequest.columnFilters.containsSubDept.value = this
|
|
|
|
|
+ .containsSubDept
|
|
|
|
|
+ ? "1"
|
|
|
|
|
+ : "0";
|
|
|
this.findPage();
|
|
this.findPage();
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.peopleid = Cookies.get('user');
|
|
|
|
|
- if (this.peopleid != 'admin') {
|
|
|
|
|
- this.peopledeptid = Cookies.get('user').split('D')[0];
|
|
|
|
|
|
|
+ this.peopleid = Cookies.get("user");
|
|
|
|
|
+ if (this.peopleid != "admin") {
|
|
|
|
|
+ this.peopledeptid = Cookies.get("user").split("D")[0];
|
|
|
this.pageRequest.columnFilters.deptid.value = this.peopledeptid;
|
|
this.pageRequest.columnFilters.deptid.value = this.peopledeptid;
|
|
|
} else {
|
|
} else {
|
|
|
- this.peopledeptid = '9';
|
|
|
|
|
|
|
+ this.peopledeptid = "9";
|
|
|
this.pageRequest.columnFilters.deptid.value = this.peopledeptid;
|
|
this.pageRequest.columnFilters.deptid.value = this.peopledeptid;
|
|
|
}
|
|
}
|
|
|
//获取所有下拉框数据(字典)
|
|
//获取所有下拉框数据(字典)
|
|
|
this.getDictItems("comlevel");
|
|
this.getDictItems("comlevel");
|
|
|
this.getDictItems("comattribute");
|
|
this.getDictItems("comattribute");
|
|
|
this.getDictItems("comtype");
|
|
this.getDictItems("comtype");
|
|
|
|
|
+ this.$api.insCompany.dicType("organizationSource").then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.columns.forEach((e) => {
|
|
|
|
|
+ if (e.prop == "source") {
|
|
|
|
|
+ e.options = res.data.ddList;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ this.organizationSourceoptions = res.data.ddList;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ managementSourceFormatter(row, column) {
|
|
|
|
|
+ let source = row.source;
|
|
|
|
|
+ switch (source) {
|
|
|
|
|
+ case "1":
|
|
|
|
|
+ return <el-tag>渠道</el-tag>;
|
|
|
|
|
+ case "2":
|
|
|
|
|
+ return <el-tag type="success">个代</el-tag>;
|
|
|
|
|
+ case "3":
|
|
|
|
|
+ return <el-tag type="warning">电销</el-tag>;
|
|
|
|
|
+ default:
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ //批量设置
|
|
|
|
|
+ batchOperation() {
|
|
|
|
|
+ this.batcnVisible = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ comfirmBatch() {
|
|
|
|
|
+ if (this.distributionForm.retailtype == "") {
|
|
|
|
|
+ return this.$message.info("请选择分销方式");
|
|
|
|
|
+ }
|
|
|
|
|
+ // if(this.distributionForm.display=''){
|
|
|
|
|
+ // return this.$message.info("请选择是否显示佣金");
|
|
|
|
|
+ // }]
|
|
|
|
|
+ // if(this.distributionForm.paytype.length==0){
|
|
|
|
|
+ // return this.$message.info("请选择提现方式");
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ let param = {};
|
|
|
|
|
+ Object.assign(param, this.distributionForm);
|
|
|
|
|
+ // param.deptid = this.deptInfo.teamid;
|
|
|
|
|
+ // param.deptname = this.deptInfo.teamname;
|
|
|
|
|
+ // param.paytype = param.paytype.toString();
|
|
|
|
|
+
|
|
|
|
|
+ param.disrate1 = "";
|
|
|
|
|
+ param.disrate2 = "";
|
|
|
|
|
+ param.disrate3 = "";
|
|
|
|
|
+
|
|
|
|
|
+ for (let i = 0; i < this.retailSettingForm.length; i++) {
|
|
|
|
|
+ param["disrate" + this.retailSettingForm[i].retailLevel] =
|
|
|
|
|
+ this.retailSettingForm[i].retailRate;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.$api.retail
|
|
|
|
|
+ .saveRetailBatch({
|
|
|
|
|
+ disrate1: param.disrate1,
|
|
|
|
|
+ disrate2: param.disrate2,
|
|
|
|
|
+ disrate3: param.disrate3,
|
|
|
|
|
+ retailLevel: param.retailLevel,
|
|
|
|
|
+ ids: this.selectIds,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$message.success("操作成功");
|
|
|
|
|
+ this.findPage();
|
|
|
|
|
+ this.batcnVisible = false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.info("操作失败 " + res.msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ this.$message.error("操作失败");
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ selectionChange({ selections }) {
|
|
|
|
|
+ // console.log(selections);
|
|
|
|
|
+ this.selectIds = selections.map((v) => {
|
|
|
|
|
+ return v.deptid;
|
|
|
|
|
+ });
|
|
|
|
|
+ // console.log(this.selectIds);
|
|
|
|
|
+ },
|
|
|
/**Split 开始 */
|
|
/**Split 开始 */
|
|
|
changeTreeWidth(widthVal) {
|
|
changeTreeWidth(widthVal) {
|
|
|
// 初始化树的宽度
|
|
// 初始化树的宽度
|
|
|
- this.leftSplitWidth = Math.ceil(widthVal / this.$refs.elMain.$el.clientWidth * 100);
|
|
|
|
|
- this.rightSplitWidth = 100 - (this.leftSplitWidth)
|
|
|
|
|
|
|
+ this.leftSplitWidth = Math.ceil(
|
|
|
|
|
+ (widthVal / this.$refs.elMain.$el.clientWidth) * 100
|
|
|
|
|
+ );
|
|
|
|
|
+ this.rightSplitWidth = 100 - this.leftSplitWidth;
|
|
|
},
|
|
},
|
|
|
/**Split 结束 */
|
|
/**Split 结束 */
|
|
|
getDictItems(typeName) {
|
|
getDictItems(typeName) {
|
|
|
//--数据字典--
|
|
//--数据字典--
|
|
|
- this.$api.dict.findByLableName(typeName).then((response) => {
|
|
|
|
|
- this[typeName + "options"] = response.data; // 把获取到的数据赋给this.data
|
|
|
|
|
- }).catch((error) => {
|
|
|
|
|
- this[typeName + "options"] = [];
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.$api.dict
|
|
|
|
|
+ .findByLableName(typeName)
|
|
|
|
|
+ .then((response) => {
|
|
|
|
|
+ this[typeName + "options"] = response.data; // 把获取到的数据赋给this.data
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((error) => {
|
|
|
|
|
+ this[typeName + "options"] = [];
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
//--left tree begin-------
|
|
//--left tree begin-------
|
|
|
findLeftTreeData: function () {
|
|
findLeftTreeData: function () {
|
|
@@ -339,7 +724,7 @@ export default {
|
|
|
this.treeDataRecursion(res.data, 2);
|
|
this.treeDataRecursion(res.data, 2);
|
|
|
this.ztreeNodes = res.data;
|
|
this.ztreeNodes = res.data;
|
|
|
});
|
|
});
|
|
|
- this.$api.dept.findTree().then(res => {
|
|
|
|
|
|
|
+ this.$api.dept.findTree().then((res) => {
|
|
|
this.ztreeNodes = res.data;
|
|
this.ztreeNodes = res.data;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -349,7 +734,7 @@ export default {
|
|
|
one = one || 0;
|
|
one = one || 0;
|
|
|
one++;
|
|
one++;
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
- if (data[i].comlevel == 5 && (data[i].managementSource != num)) {
|
|
|
|
|
|
|
+ if (data[i].comlevel == 5 && data[i].managementSource != num) {
|
|
|
data.splice(i, 1);
|
|
data.splice(i, 1);
|
|
|
i = i - 1;
|
|
i = i - 1;
|
|
|
} else {
|
|
} else {
|
|
@@ -373,41 +758,42 @@ export default {
|
|
|
|
|
|
|
|
// 查询Start
|
|
// 查询Start
|
|
|
queryInfo(val) {
|
|
queryInfo(val) {
|
|
|
- this.pageRequest.columnFilters.retailtype.value = this.queryFrom.retailtype;
|
|
|
|
|
|
|
+ this.pageRequest.columnFilters.retailtype.value =
|
|
|
|
|
+ this.queryFrom.retailtype;
|
|
|
|
|
+ this.pageRequest.columnFilters.source.value = this.queryFrom.source;
|
|
|
this.pageRequest.pageNum = 1;
|
|
this.pageRequest.pageNum = 1;
|
|
|
this.findPage();
|
|
this.findPage();
|
|
|
},
|
|
},
|
|
|
// 查询End
|
|
// 查询End
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// 右侧工具方法Start
|
|
// 右侧工具方法Start
|
|
|
handleAddButton() {
|
|
handleAddButton() {
|
|
|
if (this.currentTreeNode == null) {
|
|
if (this.currentTreeNode == null) {
|
|
|
return this.$message.info("请选择门店下团队");
|
|
return this.$message.info("请选择门店下团队");
|
|
|
}
|
|
}
|
|
|
- this.activeTabs = 'first'
|
|
|
|
|
|
|
+ this.activeTabs = "first";
|
|
|
// 查询机构信息
|
|
// 查询机构信息
|
|
|
- this.$api.dept.getDeptById(this.currentTreeNode.id).then(res => {
|
|
|
|
|
- if ((res.data.deptType == 'D') && (res.data.id.indexOf('M') >= 0)) {
|
|
|
|
|
- this.$api.dept.getDeptById(res.data.parentId).then(result => {
|
|
|
|
|
|
|
+ this.$api.dept.getDeptById(this.currentTreeNode.id).then((res) => {
|
|
|
|
|
+ if (res.data.deptType == "D" && res.data.id.indexOf("M") >= 0) {
|
|
|
|
|
+ this.$api.dept.getDeptById(res.data.parentId).then((result) => {
|
|
|
this.deptInfo = result.data;
|
|
this.deptInfo = result.data;
|
|
|
this.deptInfo.teamid = res.data.id;
|
|
this.deptInfo.teamid = res.data.id;
|
|
|
this.deptInfo.teamname = res.data.name;
|
|
this.deptInfo.teamname = res.data.name;
|
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
} else {
|
|
} else {
|
|
|
return this.$message.info("请选择门店下团队");
|
|
return this.$message.info("请选择门店下团队");
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
handleDialogBefore(done) {
|
|
handleDialogBefore(done) {
|
|
|
// 退出对话框之前确认提示
|
|
// 退出对话框之前确认提示
|
|
|
var that = this;
|
|
var that = this;
|
|
|
- this.$confirm('确认关闭?')
|
|
|
|
|
- .then(_ => {
|
|
|
|
|
|
|
+ this.$confirm("确认关闭?")
|
|
|
|
|
+ .then((_) => {
|
|
|
done();
|
|
done();
|
|
|
})
|
|
})
|
|
|
- .catch(_ => { });
|
|
|
|
|
|
|
+ .catch((_) => {});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 右侧列表的方法Start
|
|
// 右侧列表的方法Start
|
|
@@ -417,17 +803,20 @@ export default {
|
|
|
this.pageRequest.pageNum = data.pageRequest.pageNum;
|
|
this.pageRequest.pageNum = data.pageRequest.pageNum;
|
|
|
this.pageRequest.pageSize = data.pageRequest.pageSize;
|
|
this.pageRequest.pageSize = data.pageRequest.pageSize;
|
|
|
}
|
|
}
|
|
|
- this.$api.retail.findPage(this.pageRequest).then((res) => {
|
|
|
|
|
- this.pageResult = res.data;
|
|
|
|
|
- }).then(data != null ? data.callback : '')
|
|
|
|
|
|
|
+ this.$api.retail
|
|
|
|
|
+ .findPage(this.pageRequest)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ this.pageResult = res.data;
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(data != null ? data.callback : "");
|
|
|
},
|
|
},
|
|
|
//编辑
|
|
//编辑
|
|
|
handleTableEdit(data) {
|
|
handleTableEdit(data) {
|
|
|
- let dataObj = Object.assign({}, data.row)
|
|
|
|
|
- console.log(dataObj)
|
|
|
|
|
- var deptid = dataObj.deptid.split('D')[0];
|
|
|
|
|
- this.$api.dept.getDeptById(deptid).then(res => {
|
|
|
|
|
- if (res.code = 200) {
|
|
|
|
|
|
|
+ let dataObj = Object.assign({}, data.row);
|
|
|
|
|
+ console.log(dataObj);
|
|
|
|
|
+ var deptid = dataObj.deptid.split("D")[0];
|
|
|
|
|
+ this.$api.dept.getDeptById(deptid).then((res) => {
|
|
|
|
|
+ if ((res.code = 200)) {
|
|
|
this.deptInfo = res.data;
|
|
this.deptInfo = res.data;
|
|
|
this.deptInfo.teamid = dataObj.deptid;
|
|
this.deptInfo.teamid = dataObj.deptid;
|
|
|
this.deptInfo.teamname = dataObj.deptname;
|
|
this.deptInfo.teamname = dataObj.deptname;
|
|
@@ -436,33 +825,31 @@ export default {
|
|
|
this.retailSettingForm = [];
|
|
this.retailSettingForm = [];
|
|
|
for (let i = 0; i < dataObj.retailtype; i++) {
|
|
for (let i = 0; i < dataObj.retailtype; i++) {
|
|
|
this.retailSettingForm.push({
|
|
this.retailSettingForm.push({
|
|
|
- retailLevel: (i + 1),
|
|
|
|
|
- retailRate: dataObj['disrate' + (i + 1)]
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ retailLevel: i + 1,
|
|
|
|
|
+ retailRate: dataObj["disrate" + (i + 1)],
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.info("加载失败");
|
|
this.$message.info("加载失败");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
return;
|
|
return;
|
|
|
},
|
|
},
|
|
|
// 批量删除人员
|
|
// 批量删除人员
|
|
|
- handleTableBatchDelete(data) {
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ handleTableBatchDelete(data) {},
|
|
|
// 删除单个人员
|
|
// 删除单个人员
|
|
|
handleTableDeleteFlag(data) {
|
|
handleTableDeleteFlag(data) {
|
|
|
this.$api.retail.retailIdDelete(data.row.id).then((res) => {
|
|
this.$api.retail.retailIdDelete(data.row.id).then((res) => {
|
|
|
- if (res.code == '200') {
|
|
|
|
|
|
|
+ if (res.code == "200") {
|
|
|
this.findPage();
|
|
this.findPage();
|
|
|
this.$message({
|
|
this.$message({
|
|
|
- type: 'success',
|
|
|
|
|
|
|
+ type: "success",
|
|
|
message: res.msg,
|
|
message: res.msg,
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
- type: 'error',
|
|
|
|
|
|
|
+ type: "error",
|
|
|
message: res.msg,
|
|
message: res.msg,
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -487,13 +874,11 @@ export default {
|
|
|
// this.distributionForm.minamount=1;
|
|
// this.distributionForm.minamount=1;
|
|
|
// this.distributionForm.maxamount=1000;
|
|
// this.distributionForm.maxamount=1000;
|
|
|
// this.distributionForm.commission=0;
|
|
// this.distributionForm.commission=0;
|
|
|
- this.distributionForm.creator = '';
|
|
|
|
|
- this.distributionForm.createtime = '';
|
|
|
|
|
|
|
+ this.distributionForm.creator = "";
|
|
|
|
|
+ this.distributionForm.createtime = "";
|
|
|
},
|
|
},
|
|
|
// 提交
|
|
// 提交
|
|
|
- submitForm() {
|
|
|
|
|
-
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ submitForm() {},
|
|
|
|
|
|
|
|
// 新增或修改的弹出框End
|
|
// 新增或修改的弹出框End
|
|
|
|
|
|
|
@@ -503,9 +888,9 @@ export default {
|
|
|
this.retailSettingForm = [];
|
|
this.retailSettingForm = [];
|
|
|
for (let i = 0; i < e; i++) {
|
|
for (let i = 0; i < e; i++) {
|
|
|
this.retailSettingForm.push({
|
|
this.retailSettingForm.push({
|
|
|
- retailLevel: (i + 1),
|
|
|
|
|
- retailRate: 0
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ retailLevel: i + 1,
|
|
|
|
|
+ retailRate: 0,
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
@@ -520,12 +905,12 @@ export default {
|
|
|
const _col_1 = _row_1 > 0 ? 1 : 0; //如果被合并了_row=0则它这个列需要取消
|
|
const _col_1 = _row_1 > 0 ? 1 : 0; //如果被合并了_row=0则它这个列需要取消
|
|
|
return {
|
|
return {
|
|
|
rowspan: _row_1,
|
|
rowspan: _row_1,
|
|
|
- colspan: _col_1
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ colspan: _col_1,
|
|
|
|
|
+ };
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
comfirmRetail() {
|
|
comfirmRetail() {
|
|
|
- if (this.distributionForm.retailtype == '') {
|
|
|
|
|
|
|
+ if (this.distributionForm.retailtype == "") {
|
|
|
return this.$message.info("请选择分销方式");
|
|
return this.$message.info("请选择分销方式");
|
|
|
}
|
|
}
|
|
|
// if(this.distributionForm.display=''){
|
|
// if(this.distributionForm.display=''){
|
|
@@ -541,45 +926,48 @@ export default {
|
|
|
param.deptname = this.deptInfo.teamname;
|
|
param.deptname = this.deptInfo.teamname;
|
|
|
// param.paytype = param.paytype.toString();
|
|
// param.paytype = param.paytype.toString();
|
|
|
|
|
|
|
|
- param.disrate1 = '';
|
|
|
|
|
- param.disrate2 = '';
|
|
|
|
|
- param.disrate3 = '';
|
|
|
|
|
|
|
+ param.disrate1 = "";
|
|
|
|
|
+ param.disrate2 = "";
|
|
|
|
|
+ param.disrate3 = "";
|
|
|
|
|
|
|
|
for (let i = 0; i < this.retailSettingForm.length; i++) {
|
|
for (let i = 0; i < this.retailSettingForm.length; i++) {
|
|
|
- param['disrate' + this.retailSettingForm[i].retailLevel] = this.retailSettingForm[i].retailRate;
|
|
|
|
|
|
|
+ param["disrate" + this.retailSettingForm[i].retailLevel] =
|
|
|
|
|
+ this.retailSettingForm[i].retailRate;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.$api.retail.saveRetail(param).then(res => {
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- this.$message.success("操作成功");
|
|
|
|
|
- this.findPage()
|
|
|
|
|
- this.dialogVisible = false;
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.info("操作失败 " + res.msg);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }).catch(err => {
|
|
|
|
|
- this.$message.error("操作失败")
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.$api.retail
|
|
|
|
|
+ .saveRetail(param)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$message.success("操作成功");
|
|
|
|
|
+ this.findPage();
|
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.info("操作失败 " + res.msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ this.$message.error("操作失败");
|
|
|
|
|
+ });
|
|
|
// 新增分销End
|
|
// 新增分销End
|
|
|
- this.$api.retail.saveRetail(param).then(res => {
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- this.$message.success("操作成功");
|
|
|
|
|
- this.findPage()
|
|
|
|
|
- this.dialogVisible = false;
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.info("操作失败 " + res.msg);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }).catch(err => {
|
|
|
|
|
- this.$message.error("操作失败")
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.$api.retail
|
|
|
|
|
+ .saveRetail(param)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$message.success("操作成功");
|
|
|
|
|
+ this.findPage();
|
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.info("操作失败 " + res.msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ this.$message.error("操作失败");
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
// 新增分销End
|
|
// 新增分销End
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|