|
|
@@ -5,11 +5,11 @@
|
|
|
<!-- 左侧树Start -->
|
|
|
<SplitArea :size="leftSplitWidth" :minSize="240">
|
|
|
<div>
|
|
|
- <div>
|
|
|
+ <!-- <div>
|
|
|
<kt-button style="background-color: #ffc000; border: #ffc000" icon="fa fa-plus" label="新增" type="primary"
|
|
|
perms="sys:teamchannel:add" @click="handleAddButton" />
|
|
|
</div>
|
|
|
- <el-divider></el-divider>
|
|
|
+ <el-divider></el-divider> -->
|
|
|
<el-tree :data="ztreeNodes" :props="{ children: 'children', label: 'name' }" node-key="id"
|
|
|
:default-expanded-keys="['9']" @node-click="onZTreeClick"></el-tree>
|
|
|
</div>
|
|
|
@@ -19,7 +19,7 @@
|
|
|
<!-- 右侧列表页面Start -->
|
|
|
<SplitArea :size="rightSplitWidth">
|
|
|
<templateTable :searchData.sync="queryFrom" :tableConfig="tableConfig" :data="pageResult" @getList="findPage"
|
|
|
- @handleSearchList="handleSearchList" :pagination="pageData" :formList="formList">
|
|
|
+ @handleSearchList="handleSearchList" :pagination="pageData" :formList="formList" :btnGroup="btnGroup" @selectionChange="handleSelectionChange">
|
|
|
<!-- <template slot="source" slot-scope="scope">
|
|
|
<span>
|
|
|
{{ statMaps(scope.row.source) }}</span
|
|
|
@@ -34,50 +34,213 @@
|
|
|
<!-- <el-dialog :title="dialogTitle" width="40%" :visible.sync="dialogVisible" :close-on-click-modal="false"
|
|
|
:before-close="handleDialogBefore" @close="closeDialog" v-dialogDrag> -->
|
|
|
|
|
|
- <Dialog ref="Dialog" :title="dialogTitle" @handleDialogBefore="handleDialogBefore">
|
|
|
+ <Dialog ref="Dialog" title="编辑工作室" @handleDialogBefore="handleDialogBefore" width="50%">
|
|
|
<template slot="content">
|
|
|
|
|
|
- <el-form :model="formData" :rules="rules" ref="formData" :inline="true" label-width="110px" size="small">
|
|
|
+ <el-form :model="formData" :rules="rules" ref="dataForm" label-width="110px" size="small">
|
|
|
<div class="info-title" >机构信息</div>
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="机构编码" prop="deptId">
|
|
|
- <el-input v-model="formData.deptId" disabled></el-input>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="机构编码" prop="id">
|
|
|
+ <el-input
|
|
|
+ style="width: 100%"
|
|
|
+ disabled
|
|
|
+ v-model="dataForm.id"
|
|
|
+ placeholder="机构编码"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="机构名称" prop="deptName">
|
|
|
- <el-input v-model="formData.deptName" disabled></el-input>
|
|
|
- <!-- <el-select v-model="formData.deptName" clearable filterable :disabled="dialogTitle=='编辑'" placeholder="选择机构名称" @change="deptChange">
|
|
|
- <el-option v-for="(item, index) in deptoption" :key="index" :label="item.name"
|
|
|
- :value="item.name"></el-option>
|
|
|
- </el-select> -->
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="机构名称" prop="name">
|
|
|
+ <el-input
|
|
|
+ style="width: 100%"
|
|
|
+ disabled
|
|
|
+ v-model="dataForm.name"
|
|
|
+ placeholder="机构名称"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
-
|
|
|
-
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="机构等级" prop="comlevel">
|
|
|
- <el-select v-model="formData.comlevel" style="width: 200px;" disabled>
|
|
|
- <el-option v-for="val in comleveloptions" :key="val.value" :label="val.label"
|
|
|
- :value="val.value">
|
|
|
- </el-option>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="上级机构" prop="parentName">
|
|
|
+ <el-input
|
|
|
+ style="width: 100%"
|
|
|
+ disabled
|
|
|
+ v-model="dataForm.parentName"
|
|
|
+ placeholder="上级机构"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row >
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="省公司" prop="province">
|
|
|
+ <el-select
|
|
|
+ disabled
|
|
|
+ @change="selectProvince"
|
|
|
+ value-key="areaCname"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="selectAddress.province"
|
|
|
+ placeholder="请选择省"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in provinces"
|
|
|
+ :value="item"
|
|
|
+ :key="item.areaCode"
|
|
|
+ :label="item.areaCname"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="支公司" prop="city">
|
|
|
+ <el-select
|
|
|
+ disabled
|
|
|
+ @change="selectCity"
|
|
|
+ value-key="areaCname"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="selectAddress.city"
|
|
|
+ placeholder="请选择市"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in cities"
|
|
|
+ :key="index"
|
|
|
+ :value="item"
|
|
|
+ :label="item.areaCname"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="营销服务部" prop="area">
|
|
|
+ <el-select
|
|
|
+ disabled
|
|
|
+ @change="selectArea"
|
|
|
+ value-key="areaCname"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="selectAddress.area"
|
|
|
+ placeholder="请选择区"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in areas"
|
|
|
+ :key="index"
|
|
|
+ :value="item"
|
|
|
+ :label="item.areaCname"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- selectArea area -->
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="8" v-show="dataForm.comlevel==5">
|
|
|
+ <el-form-item label="门店" prop="house">
|
|
|
+ <el-input placeholder="门店" v-model="dataForm.house"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col> -->
|
|
|
+ </el-row>
|
|
|
+ <el-row >
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="门店" prop="house">
|
|
|
+ <el-input
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="门店"
|
|
|
+ v-model="dataForm.house"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="业务来源" prop="managementSource">
|
|
|
+ <el-select
|
|
|
+ disabled
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="dataForm.managementSource"
|
|
|
+ >
|
|
|
+ <!-- <el-option label="渠道" value="1"></el-option>
|
|
|
+ <el-option label="个代" value="2"></el-option>
|
|
|
+ <el-option label="服务" value="3"></el-option> -->
|
|
|
+ <el-option
|
|
|
+ v-for="val in business_sourceoptions"
|
|
|
+ :key="val.value"
|
|
|
+ :label="val.label"
|
|
|
+ :value="val.value"
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="业务来源" prop="source">
|
|
|
- <!-- <el-input v-model="formData.source" disabled></el-input> -->
|
|
|
- <el-select v-model="formData.source" style="width: 200px;" clearable placeholder="请选择业务来源" disabled>
|
|
|
- <el-option v-for="val in organizationSourceoptions" :key="val.dictValue" :label="val.dictTag"
|
|
|
- :value="val.dictValue">
|
|
|
- </el-option>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="机构类型" prop="comtype">
|
|
|
+ <el-select
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="dataForm.comtype"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in comtypeoptions"
|
|
|
+ :key="item.label"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="抽成比例" prop="proportional">
|
|
|
- <el-input v-model="formData.proportional" placeholder="请输入抽成比例"></el-input>
|
|
|
+
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="机构级别" prop="comlevel">
|
|
|
+ <el-select
|
|
|
+ style="width: 100%"
|
|
|
+ disabled
|
|
|
+ v-model="dataForm.comlevel"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in comleveloptions"
|
|
|
+ :key="item.label"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="机构性质" prop="comattribute">
|
|
|
+ <el-select
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="dataForm.comattribute"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in comattributeoptions"
|
|
|
+ :key="item.label"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="机构地址" prop="address">
|
|
|
+ <el-input
|
|
|
+ v-model="dataForm.address"
|
|
|
+ placeholder="机构地址"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="排序" prop="orderNum">
|
|
|
+ <el-input-number
|
|
|
+ v-model="dataForm.orderNum"
|
|
|
+ placeholder="排序"
|
|
|
+ controls-position="right"
|
|
|
+ :min="0"
|
|
|
+ ></el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -90,7 +253,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="名称" prop="userName">
|
|
|
- <el-select v-model="formData.userName" style="width: 200px;" clearable filterable placeholder="选择管理员名称"
|
|
|
+ <el-select v-model="formData.userName" disabled style="width: 200px;" clearable filterable placeholder="选择管理员名称"
|
|
|
@change="userChange">
|
|
|
<el-option v-for="(item, index) in useroption" :key="index" :label="item.name"
|
|
|
:value="item.name"></el-option>
|
|
|
@@ -107,7 +270,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="推荐人姓名" prop="suggestName">
|
|
|
- <el-select v-model="formData.suggestName" style="width: 200px;" :disabled="isdisabled" @change="suggestChange"
|
|
|
+ <el-select v-model="formData.suggestName" style="width: 200px;" disabled @change="suggestChange"
|
|
|
clearable placeholder="请选择推荐人">
|
|
|
<el-option v-for="val in sysPartnerOption" :key="val.userId" :label="val.userName" :value="val.userName">
|
|
|
</el-option>
|
|
|
@@ -126,7 +289,36 @@
|
|
|
|
|
|
<!-- </el-dialog> -->
|
|
|
</Dialog>
|
|
|
-
|
|
|
+<!-- 比例配制 -->
|
|
|
+<el-dialog
|
|
|
+ :title="proportitle"
|
|
|
+ width="30%"
|
|
|
+ top="5vh"
|
|
|
+ :visible.sync="proportionDialogVisible"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ @close="closeDialogproportion"
|
|
|
+ v-dialogDrag
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ :model="proportionData"
|
|
|
+ :rules="proportionRules"
|
|
|
+ ref="proportionData"
|
|
|
+ label-width="160px"
|
|
|
+ size="small"
|
|
|
+ class="personnelInformation"
|
|
|
+ >
|
|
|
+ <el-form-item label="工作室佣金比例" prop="proportional">
|
|
|
+ <el-input placeholder="请输入内容" style="width: 250px;" v-model="proportionData.proportional">
|
|
|
+ <template slot="append">%</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="small" @click="proportionDialogVisible = false">取 消</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="addproportion('proportionData')">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -134,14 +326,24 @@
|
|
|
import KtButton from "@/views/Core/KtButton"; // 按钮权限组件
|
|
|
import templateTable from "../../components/TemplateTable/index.vue";
|
|
|
import Dialog from "../../components/Dialog/index.vue";
|
|
|
+import mixa from "./mixin";
|
|
|
+const mixin = new mixa({
|
|
|
+ treeTypeNum: null,
|
|
|
+});
|
|
|
export default {
|
|
|
components: {
|
|
|
KtButton,
|
|
|
templateTable,
|
|
|
Dialog
|
|
|
},
|
|
|
+ mixins: [mixin],
|
|
|
data() {
|
|
|
return {
|
|
|
+ proportionDialogVisible:false,
|
|
|
+ proportionRules:{
|
|
|
+ proportional: [{ required: false, message: "请输入工作室佣金比例", trigger: "blur" }],
|
|
|
+ },
|
|
|
+ proportionData:{},
|
|
|
comleveloptions:[],
|
|
|
isdisabled: false,
|
|
|
ztreeNodes: [],
|
|
|
@@ -211,10 +413,11 @@ export default {
|
|
|
},
|
|
|
// { name: "source", label: "业务来源", type: "slot" },
|
|
|
],
|
|
|
+ isCheckBox:true,
|
|
|
loading: true,
|
|
|
isPaginationShow: true,
|
|
|
isShowIndex: true,
|
|
|
- operationWidth: 150,
|
|
|
+ operationWidth: 200,
|
|
|
optBtns: [
|
|
|
{
|
|
|
type: "primary",
|
|
|
@@ -226,25 +429,33 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ label: "比例配置",
|
|
|
type: "primary",
|
|
|
- label: "删除",
|
|
|
- icon: "el-icon-delete",
|
|
|
+ icon: "fa fa-edit",
|
|
|
click: (row, index) => {
|
|
|
- return this.handleTableDeleteFlag(row);
|
|
|
+ return this.proportionalAocation(row);
|
|
|
},
|
|
|
},
|
|
|
+ // {
|
|
|
+ // type: "primary",
|
|
|
+ // label: "删除",
|
|
|
+ // icon: "el-icon-delete",
|
|
|
+ // click: (row, index) => {
|
|
|
+ // return this.handleTableDeleteFlag(row);
|
|
|
+ // },
|
|
|
+ // },
|
|
|
],
|
|
|
},
|
|
|
rules: {
|
|
|
- proportional: [
|
|
|
- { required: true, message: '请输入抽成比例', trigger: 'blur' },
|
|
|
- ],
|
|
|
- userName: [
|
|
|
- { required: true, message: '请选择名称', trigger: 'change' }
|
|
|
- ],
|
|
|
- deptName: [
|
|
|
- { required: true, message: '请选择机构名称', trigger: 'change' }
|
|
|
- ],
|
|
|
+ // proportional: [
|
|
|
+ // { required: true, message: '请输入抽成比例', trigger: 'blur' },
|
|
|
+ // ],
|
|
|
+ // comtype: [
|
|
|
+ // { required: true, message: '请选择机构类型', trigger: 'change' }
|
|
|
+ // ],
|
|
|
+ // comattribute: [
|
|
|
+ // { required: true, message: '请选择机构性质', trigger: 'change' }
|
|
|
+ // ],
|
|
|
|
|
|
},
|
|
|
pageData: {
|
|
|
@@ -261,12 +472,48 @@ export default {
|
|
|
dialogVisible: false, // 新增编辑界面是否显示
|
|
|
sysPartnerOption: [],
|
|
|
organizationSourceoptions: [],
|
|
|
- currentTreeNodeId: ""
|
|
|
+ currentTreeNodeId: "",
|
|
|
+ comattributeoptions: [],
|
|
|
+ comtypeoptions: [],
|
|
|
+ business_sourceoptions: [],
|
|
|
+ organizationSourceoptions: [],
|
|
|
+ dataForm:{},
|
|
|
+ disabledAddress: {
|
|
|
+ province: false,
|
|
|
+ city: false,
|
|
|
+ area: false,
|
|
|
+ },
|
|
|
+ selectAddress: {
|
|
|
+ province: "",
|
|
|
+ city: "",
|
|
|
+ area: "",
|
|
|
+ },
|
|
|
+ // 部门DialogEnd
|
|
|
+ provinces: [], //省数据
|
|
|
+ cities: [], //市数据
|
|
|
+ areas: [], //区数据
|
|
|
+ business_sourceoptions: [],
|
|
|
+ organizationSourceoptions: [],
|
|
|
+ btnGroup:[{
|
|
|
+ name:'批量比例配置',
|
|
|
+ disabled:()=>{
|
|
|
+ return this.tableDataList.length==0
|
|
|
+ },
|
|
|
+ click:()=>this.proportionalAllocation()
|
|
|
+ }],
|
|
|
+ proportitle:'',
|
|
|
+ tableDataList:[]
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.findPage();
|
|
|
- this.findLeftTreeData(); // 获取机构树的数据
|
|
|
+ //获取所有下拉框数据
|
|
|
+ this.getDictItems("comlevel");
|
|
|
+ this.getDictItems("comattribute");
|
|
|
+ this.getDictItems("comtype");
|
|
|
+ this.getDictItems("business_source")
|
|
|
+ this.getDicType("organizationSource");
|
|
|
+ this.getQueryTree()
|
|
|
this.$api.insCompany.dicType('organizationSource').then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.tableConfig.columns.forEach(e => {
|
|
|
@@ -287,12 +534,105 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleSelectionChange(e){
|
|
|
+ this.tableDataList=e
|
|
|
+ },
|
|
|
+ //获取省市区树数据
|
|
|
+ getQueryTree() {
|
|
|
+ this.$api.dept.queryTree().then((res) => {
|
|
|
+ this.provinces = res.data; //
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //--数据字典 begin --
|
|
|
+ getDictItems(typeName) {
|
|
|
+ this.$api.dict
|
|
|
+ .findByLableName(typeName)
|
|
|
+ .then((response) => {
|
|
|
+ this[typeName + "options"] = response.data; // 把获取到的数据赋给this.data
|
|
|
+ // this.ztreeNodes = this[typeName + "options"];
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ this[typeName + "options"] = [];
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getDicType(type) {
|
|
|
+ this.$api.insCompany.dicType(type).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this[type + "options"] = res.data.ddList;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //公司区域选择
|
|
|
+ //-- address begin --
|
|
|
+ // 选择省
|
|
|
+ selectProvince(value) {
|
|
|
+ this.selectAddress.province = { areaCname: value.areaCname };
|
|
|
+ this.dataForm.province = value.areaCode;
|
|
|
+ this.cities = value.child;
|
|
|
+ this.selectAddress.city = "";
|
|
|
+ this.dataForm.city = "";
|
|
|
+ this.selectAddress.area = "";
|
|
|
+ this.dataForm.area = "";
|
|
|
+ },
|
|
|
+ // 选择市
|
|
|
+ selectCity(value) {
|
|
|
+ this.selectAddress.city = { areaCname: value.areaCname };
|
|
|
+ this.dataForm.city = value.areaCode;
|
|
|
+ this.areas = value.child;
|
|
|
+ this.selectAddress.area = "";
|
|
|
+ this.dataForm.area = "";
|
|
|
+ },
|
|
|
+ // 选择区
|
|
|
+ selectArea(value) {
|
|
|
+ this.selectAddress.area = { areaCname: value.areaCname };
|
|
|
+ this.dataForm.area = value.areaCode;
|
|
|
+ },
|
|
|
+ handleDeleteFlag(data) {
|
|
|
+ let that = this;
|
|
|
+ this.$api.dept.batchDelete(data.params).then((data) => {
|
|
|
+ that.findTreeData();
|
|
|
+ that.filters.id = that.currentTreeNode.id;
|
|
|
+ that.findSubDeptPage();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //-- formatter begin--
|
|
|
+ comlevelFormatter(row, column) {
|
|
|
+ let comlevel = row.comlevel;
|
|
|
+ return CommonUtil.getDataName({
|
|
|
+ dataList: this.comleveloptions,
|
|
|
+ value: "value",
|
|
|
+ label: "label",
|
|
|
+ data: comlevel,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ comattributeFormatter(row, column) {
|
|
|
+ let comattribute = row.comattribute;
|
|
|
+ return CommonUtil.getDataName({
|
|
|
+ dataList: this.comattributeoptions,
|
|
|
+ value: "value",
|
|
|
+ label: "label",
|
|
|
+ data: comattribute,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ comtypeFormatter(row, column) {
|
|
|
+ let comtype = row.comtype;
|
|
|
+ return CommonUtil.getDataName({
|
|
|
+ dataList: this.comtypeoptions,
|
|
|
+ value: "value",
|
|
|
+ label: "label",
|
|
|
+ data: comtype,
|
|
|
+ });
|
|
|
+ },
|
|
|
findLeftTreeData: function () {
|
|
|
this.$api.insCompany.getSysDeptTree().then((res) => {
|
|
|
// this.treeDataRecursion(res.data, treeTypeNum);
|
|
|
this.ztreeNodes = res.data;
|
|
|
});
|
|
|
},
|
|
|
+ closeDialogproportion() {
|
|
|
+ this.proportionData = {};
|
|
|
+ this.proportionDialogVisible = false;
|
|
|
+ },
|
|
|
//添加人员
|
|
|
handleAddButton() {
|
|
|
this.isdisabled=false
|
|
|
@@ -334,6 +674,16 @@ export default {
|
|
|
this.$refs["formData"].resetFields();
|
|
|
}
|
|
|
},
|
|
|
+ // 比例配置
|
|
|
+ proportionalAocation(row){
|
|
|
+ this.proportitle='工作室比例配置'
|
|
|
+ this.proportionDialogVisible=true
|
|
|
+ this.proportionData=row
|
|
|
+ },
|
|
|
+ proportionalAllocation(){
|
|
|
+ this.proportitle='工作室比例批量配置'
|
|
|
+ this.proportionDialogVisible=true
|
|
|
+ },
|
|
|
onZTreeClick: function (evt, treeId, treeNode) {
|
|
|
// 点击事件
|
|
|
this.currentTreeNode = evt;
|
|
|
@@ -347,8 +697,60 @@ export default {
|
|
|
if (e) {
|
|
|
this.formData.suggestId = this.sysPartnerOption.find(val => val.userName == e).userId
|
|
|
}
|
|
|
- console.log(e,222222222);
|
|
|
-
|
|
|
+ },
|
|
|
+ addproportion(formName){
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ console.log();
|
|
|
+ if(this.proportitle=='工作室比例配置'){
|
|
|
+ this.$api.insCompany
|
|
|
+ .agencyEdit(
|
|
|
+ this.proportionData,
|
|
|
+ )
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: "保存成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.proportionDialogVisible = false;
|
|
|
+ this.$refs["proportionData"].resetFields();
|
|
|
+ this.findPage();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: `保存失败,请重新添加,(${res.msg})`,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.$api.insCompany
|
|
|
+ .agencyEditAll({
|
|
|
+ ...this.proportionData,
|
|
|
+ ids:this.tableDataList.map(e=>e.id)
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: "保存成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.proportionDialogVisible = false;
|
|
|
+ this.$refs["proportionData"].resetFields();
|
|
|
+ this.findPage();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: `保存失败,请重新添加,(${res.msg})`,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
userChange(val) {
|
|
|
if (val) {
|
|
|
@@ -416,14 +818,69 @@ export default {
|
|
|
.agencyQueryById(params.id)
|
|
|
.then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
- this.isdisabled = res.data.suggestId ? true : false
|
|
|
- this.dialogTitle = "编辑工作室信息";
|
|
|
+ // this.isdisabled = res.data.suggestId ? true : false
|
|
|
// this.dialogVisible = true
|
|
|
- this.$refs.Dialog.open()
|
|
|
+ this.$refs.Dialog.open()
|
|
|
+ this.dataForm=res.data.sysDept
|
|
|
+ this.formData = res.data.sysAgencyLeader
|
|
|
+ this.$api.dept.getDeptById(res.data.sysDept.parentId).then((res) => {
|
|
|
+ this.dataForm.parentName = res.data.name;
|
|
|
+ });
|
|
|
+ this.transitionFun("province", this.dataForm.province);
|
|
|
+ this.transitionFun("city", this.dataForm.city);
|
|
|
+ this.transitionFun("area", this.dataForm.area);
|
|
|
+ let cityArr = this.provinces.filter((item) => {
|
|
|
+ return this.dataForm.province == item.areaCode;
|
|
|
+ });
|
|
|
+ if (cityArr.length > 0) {
|
|
|
+ this.cities = cityArr[0].child;
|
|
|
+ let areaArr = this.cities.filter((item) => {
|
|
|
+ return this.dataForm.city == item.areaCode;
|
|
|
+ });
|
|
|
+ if (areaArr.length > 0) {
|
|
|
+ this.areas = areaArr[0].child;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.getProvinceData(); //获取市、区下拉框对应数据
|
|
|
|
|
|
- this.formData = res.data
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ /****
|
|
|
+ * 获取市、区下拉框对应数据
|
|
|
+ */
|
|
|
+ getProvinceData() {
|
|
|
+ let cityArr = this.provinces.filter((item) => {
|
|
|
+ return this.dataForm.province == item.areaCode;
|
|
|
+ });
|
|
|
+ if (cityArr.length > 0) {
|
|
|
+ this.cities = cityArr[0].child;
|
|
|
+ let areaArr = this.cities.filter((item) => {
|
|
|
+ return this.dataForm.city == item.areaCode;
|
|
|
+ });
|
|
|
+ if (areaArr.length > 0) {
|
|
|
+ this.areas = areaArr[0].child;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /****
|
|
|
+ * 省市县code转换为文字
|
|
|
+ * 闭包搜寻多维数组数据进行转换
|
|
|
+ * objName为省市县赋值名称
|
|
|
+ * codeParams为需要进行判断的省市县code
|
|
|
+ * data为进行查找的数据
|
|
|
+ */
|
|
|
+ transitionFun(objName, codeParams, data) {
|
|
|
+ data = data || this.provinces;
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ if (codeParams == data[i].areaCode) {
|
|
|
+ this.selectAddress[objName] = { areaCname: data[i].areaCname };
|
|
|
+ } else {
|
|
|
+ if (data[i].child.length) {
|
|
|
+ this.transitionFun(objName, codeParams, data[i].child);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
// 删除单个人员
|
|
|
handleTableDeleteFlag(data) {
|
|
|
@@ -453,31 +910,11 @@ export default {
|
|
|
},
|
|
|
// 提交
|
|
|
submitForm() {
|
|
|
- this.$refs.formData.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
+ // this.$refs.dataForm.validate((valid) => {
|
|
|
+ // if (valid) {
|
|
|
this.$confirm("确认提交吗?", "提示", {}).then(() => {
|
|
|
- if (this.dialogTitle == "新增工作室信息") {
|
|
|
- this.$api.insCompany
|
|
|
- .agencyAdd(this.formData)
|
|
|
- .then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$message({
|
|
|
- message: "保存成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.$refs.Dialog.close()
|
|
|
- this.$refs["formData"].resetFields();
|
|
|
- this.findPage();
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: `保存失败,请重新添加,(${res.msg})`,
|
|
|
- type: "error",
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$api.insCompany
|
|
|
- .agencyEdit(this.formData)
|
|
|
+ this.$api.insCompany
|
|
|
+ .agencyEditInfo({sysAgencyLeader:this.formData,sysDept:this.dataForm})
|
|
|
.then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message({
|
|
|
@@ -494,10 +931,48 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
+ // if (this.dialogTitle == "新增工作室信息") {
|
|
|
+ // this.$api.insCompany
|
|
|
+ // .agencyAdd({sysAgencyLeader:this.formData,sysDept:this.dataForm})
|
|
|
+ // .then((res) => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.$message({
|
|
|
+ // message: "保存成功",
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+ // this.$refs.Dialog.close()
|
|
|
+ // this.$refs["formData"].resetFields();
|
|
|
+ // this.findPage();
|
|
|
+ // } else {
|
|
|
+ // this.$message({
|
|
|
+ // message: `保存失败,请重新添加,(${res.msg})`,
|
|
|
+ // type: "error",
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // this.$api.insCompany
|
|
|
+ // .agencyEditInfo({sysAgencyLeader:this.formData,sysDept:this.dataForm})
|
|
|
+ // .then((res) => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.$message({
|
|
|
+ // message: "编辑成功",
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+ // this.$refs.Dialog.close()
|
|
|
+ // this.$refs["formData"].resetFields();
|
|
|
+ // this.findPage();
|
|
|
+ // } else {
|
|
|
+ // this.$message({
|
|
|
+ // message: `编辑失败,请重新添加,(${res.msg})`,
|
|
|
+ // type: "error",
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
});
|
|
|
- }
|
|
|
- });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
},
|
|
|
// 下一步
|
|
|
|