|
|
@@ -8,8 +8,8 @@
|
|
|
<div>
|
|
|
<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>
|
|
|
<el-divider></el-divider>
|
|
|
|
|
|
@@ -42,9 +42,9 @@
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
- <kt-common-table permsEdit="sys:distributionManage:edit" permsDelete="sys:distributionManage:delete" :data="pageResult" :columns="columns"
|
|
|
- editButtonName="编辑" deleteButtonName="删除" :showBatchDelete="true" @findPage="findPage"
|
|
|
- @handleEdit="handleTableEdit" @handleDeleteFlag="handleTableDeleteFlag"
|
|
|
+ <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>
|
|
|
</SplitArea>
|
|
|
@@ -131,7 +131,7 @@
|
|
|
<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="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>
|
|
|
@@ -326,50 +326,50 @@ export default {
|
|
|
/**Split 结束 */
|
|
|
getDictItems(typeName) {
|
|
|
//--数据字典--
|
|
|
- this.$api.dict.findByLableName(typeName).then((response)=>{
|
|
|
- this[typeName + "options"] = response.data; // 把获取到的数据赋给this.data
|
|
|
- }).catch((error)=>{
|
|
|
- this[typeName + "options"] = [];
|
|
|
- })
|
|
|
- },
|
|
|
- //--left tree begin-------
|
|
|
- findLeftTreeData: function() {
|
|
|
- // 获取数据
|
|
|
- this.$api.dept.findTree().then((res) => {
|
|
|
- this.treeDataRecursion(res.data, 2);
|
|
|
- this.ztreeNodes = res.data;
|
|
|
- });
|
|
|
- this.$api.dept.findTree().then(res => {
|
|
|
- this.ztreeNodes = res.data;
|
|
|
- });
|
|
|
- },
|
|
|
- //树过滤五级机构递归
|
|
|
- treeDataRecursion(data, num, one) {
|
|
|
- data = data || this.ztreeNodes;
|
|
|
- one = one || 0;
|
|
|
- one++;
|
|
|
- for (let i = 0; i < data.length; i++) {
|
|
|
- if (data[i].comlevel == 5 && (data[i].managementSource != num)) {
|
|
|
- data.splice(i, 1);
|
|
|
- i = i - 1;
|
|
|
- } else {
|
|
|
- this.treeDataRecursion(data[i].children, num, one);
|
|
|
- }
|
|
|
+ this.$api.dict.findByLableName(typeName).then((response) => {
|
|
|
+ this[typeName + "options"] = response.data; // 把获取到的数据赋给this.data
|
|
|
+ }).catch((error) => {
|
|
|
+ this[typeName + "options"] = [];
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //--left tree begin-------
|
|
|
+ findLeftTreeData: function () {
|
|
|
+ // 获取数据
|
|
|
+ this.$api.dept.findTree().then((res) => {
|
|
|
+ this.treeDataRecursion(res.data, 2);
|
|
|
+ this.ztreeNodes = res.data;
|
|
|
+ });
|
|
|
+ this.$api.dept.findTree().then(res => {
|
|
|
+ this.ztreeNodes = res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //树过滤五级机构递归
|
|
|
+ treeDataRecursion(data, num, one) {
|
|
|
+ data = data || this.ztreeNodes;
|
|
|
+ one = one || 0;
|
|
|
+ one++;
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ if (data[i].comlevel == 5 && (data[i].managementSource != num)) {
|
|
|
+ data.splice(i, 1);
|
|
|
+ i = i - 1;
|
|
|
+ } else {
|
|
|
+ this.treeDataRecursion(data[i].children, num, one);
|
|
|
}
|
|
|
- },
|
|
|
- onZTreeCreated: function(ztreeObj) {
|
|
|
- this.ztreeObj = ztreeObj;
|
|
|
- // onCreated 中操作ztreeObj对象展开第一个节点
|
|
|
- ztreeObj.expandNode(ztreeObj.getNodes()[0], true);
|
|
|
- this.currentTreeNode=ztreeObj.getNodes()[0];
|
|
|
- },
|
|
|
- onZTreeClick: function(evt, treeId, treeNode) {
|
|
|
- // 点击事件
|
|
|
- this.currentTreeNode = treeNode;
|
|
|
- this.pageRequest.columnFilters.deptid.value = this.currentTreeNode.id;
|
|
|
- this.findPage();
|
|
|
- },
|
|
|
- //--left tree start-------
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onZTreeCreated: function (ztreeObj) {
|
|
|
+ this.ztreeObj = ztreeObj;
|
|
|
+ // onCreated 中操作ztreeObj对象展开第一个节点
|
|
|
+ ztreeObj.expandNode(ztreeObj.getNodes()[0], true);
|
|
|
+ this.currentTreeNode = ztreeObj.getNodes()[0];
|
|
|
+ },
|
|
|
+ onZTreeClick: function (evt, treeId, treeNode) {
|
|
|
+ // 点击事件
|
|
|
+ this.currentTreeNode = treeNode;
|
|
|
+ this.pageRequest.columnFilters.deptid.value = this.currentTreeNode.id;
|
|
|
+ this.findPage();
|
|
|
+ },
|
|
|
+ //--left tree start-------
|
|
|
|
|
|
// 查询Start
|
|
|
queryInfo(val) {
|
|
|
@@ -380,35 +380,35 @@ export default {
|
|
|
// 查询End
|
|
|
|
|
|
|
|
|
- // 右侧工具方法Start
|
|
|
- handleAddButton(){
|
|
|
- if(this.currentTreeNode == null ){
|
|
|
- return this.$message.info("请选择门店下团队");
|
|
|
- }
|
|
|
- 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.deptInfo = result.data;
|
|
|
- this.deptInfo.teamid = res.data.id;
|
|
|
- this.deptInfo.teamname = res.data.name;
|
|
|
- this.dialogVisible = true;
|
|
|
- })
|
|
|
- }else{
|
|
|
- return this.$message.info("请选择门店下团队");
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- handleDialogBefore(done) {
|
|
|
- // 退出对话框之前确认提示
|
|
|
- var that = this;
|
|
|
- this.$confirm('确认关闭?')
|
|
|
- .then(_ => {
|
|
|
- done();
|
|
|
+ // 右侧工具方法Start
|
|
|
+ handleAddButton() {
|
|
|
+ if (this.currentTreeNode == null) {
|
|
|
+ return this.$message.info("请选择门店下团队");
|
|
|
+ }
|
|
|
+ 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.deptInfo = result.data;
|
|
|
+ this.deptInfo.teamid = res.data.id;
|
|
|
+ this.deptInfo.teamname = res.data.name;
|
|
|
+ this.dialogVisible = true;
|
|
|
})
|
|
|
- .catch(_ => {});
|
|
|
- },
|
|
|
+ } else {
|
|
|
+ return this.$message.info("请选择门店下团队");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleDialogBefore(done) {
|
|
|
+ // 退出对话框之前确认提示
|
|
|
+ var that = this;
|
|
|
+ this.$confirm('确认关闭?')
|
|
|
+ .then(_ => {
|
|
|
+ done();
|
|
|
+ })
|
|
|
+ .catch(_ => { });
|
|
|
+ },
|
|
|
|
|
|
// 右侧列表的方法Start
|
|
|
findPage(data) {
|
|
|
@@ -450,19 +450,26 @@ export default {
|
|
|
},
|
|
|
// 批量删除人员
|
|
|
handleTableBatchDelete(data) {
|
|
|
-
|
|
|
},
|
|
|
// 删除单个人员
|
|
|
handleTableDeleteFlag(data) {
|
|
|
-
|
|
|
+ this.$api.retail.retailIdDelete(data.row.id).then((res) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ this.findPage();
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
// 右侧列表的方法End
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
// 新增或修改的弹出框Start
|
|
|
-
|
|
|
-
|
|
|
closeDialog() {
|
|
|
// 清空数据
|
|
|
this.deptInfo = {};
|
|
|
@@ -538,22 +545,22 @@ export default {
|
|
|
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.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("操作失败")
|
|
|
- })
|
|
|
+ for (let i = 0; i < this.retailSettingForm.length; i++) {
|
|
|
+ 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("操作失败")
|
|
|
+ })
|
|
|
// 新增分销End
|
|
|
this.$api.retail.saveRetail(param).then(res => {
|
|
|
if (res.code == 200) {
|