Browse Source

2022-9-27 16:00

codeMan 2 years ago
parent
commit
86a2280f02

+ 16 - 4
src/HDrpManagement/ProductGroupMag/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="container normal-panel normal-margin" style="display:flex">
-      <add type="add" @addSuccess="$refs.list.listData()" :productData="productList" :brandData="brandList" v-if="tool.checkAuth($route.name,'update')"></add>
+      <add-group type="add" @addSuccess="$refs.list.listData()" :productData="productList" :brandData="brandList" v-if="tool.checkAuth($route.name,'update')"></add-group>
       <Up type="all" style="margin-left:16px" @upSuccess="$refs.list.listData()" :id="checkboxData.map(item => item.sa_itemgroupid)" v-if="Object.keys(checkboxData).length > 0 && checkboxData[0].isonsale == 0 && tool.checkAuth($route.name,'up_sales')"></Up>
       <Down type="all" style="margin-left:16px" @downSuccess="$refs.list.listData()" :id="checkboxData.map(item => item.sa_itemgroupid)" v-if="Object.keys(checkboxData).length > 0 && checkboxData[0].isonsale == 1 && tool.checkAuth($route.name,'down_sales')"></Down>
     </div>
@@ -10,8 +10,11 @@
         <template v-slot:detail="scope">
           <el-button type="text" size="small" @click="$router.push({path:'/projectTarget_edit',query:{id:scope.data.sa_salestargetbillid,type:'onlyread'}})">详 情</el-button>
         </template>
+        <template v-slot:groupDetail="scope">
+          <add-group-detail :rowData="scope.data"/>
+        </template>
         <template v-slot:edit="scope">
-          <add v-if="tool.checkAuth($route.name,'update')" type="edit" @addSuccess="$refs.list.listData()" :productData="productList" :brandData="brandList" :groupData="scope.data"></add>
+          <edit-group v-if="tool.checkAuth($route.name,'update')" type="edit" @addSuccess="$refs.list.listData()" :productData="productList" :brandData="brandList" :groupData="scope.data"></edit-group>
         </template>
         <template v-slot:del="scope">
           <Del v-if="tool.checkAuth($route.name,'delete')" type="group" @deleteSuccess="$refs.list.listData()" :id="scope.data.sa_itemgroupid"></Del>
@@ -30,20 +33,24 @@
 <script>
 import list from './modules/list'
 
-import add from './modules/add'
+import addGroup from './modules/addGroup'
+import editGroup from './modules/editGroup'
 import Del from './modules/delete'
 import Up from './modules/up'
 import Down from './modules/down'
 import detail from './modules/details.vue'
+import addGroupDetail from './modules/addGroupDetail'
 export default {
   name:"index",
   components:{
     list,
-    add,
+    addGroup,
+    editGroup,
     detail,
     Del,
     Up,
     Down,
+    addGroupDetail
   },
   data() {
     return {
@@ -58,6 +65,11 @@ export default {
     this.getProductList()
     this.getBrandList()
   },
+  provide() {
+    return {
+      productList: () => this.productList
+    }
+  },
   methods: {
     /* 可选择的商品列表 */
     async getProductList() {

+ 3 - 4
src/HDrpManagement/ProductGroupMag/modules/add.vue → src/HDrpManagement/ProductGroupMag/modules/addGroup.vue

@@ -1,8 +1,7 @@
 <template>
   <div>
-    <el-button type="primary" size="small" @click="dialogTableVisible=true" v-if="type == 'add'">新增产品组</el-button>
-    <el-button type="text" size="small" @click="editBtn" v-else>编辑</el-button>
-    <el-dialog title="新增产品" :visible.sync="dialogTableVisible" width="30%">
+    <el-button type="primary" size="small" @click="dialogTableVisible=true">新增产品组</el-button>
+    <el-dialog title="新增产品组" append-to-body :visible.sync="dialogTableVisible" width="30%">
       <el-row :gutter="20">
         <el-form label-position="right" ref="form" :rules="rules" inline label-width="100px" :model="form" size="small">
           <el-col :span="24">
@@ -115,7 +114,7 @@ export default {
             "id": "20220922164303",
             "version":1,
             "content": {
-                "sa_itemgroupid":this.type == 'add' ? 0 : this.groupData.sa_itemgroupid,    
+                "sa_itemgroupid":0,    
                 "sa_brandid":this.form.sa_brandid,
                 "groupname":this.form.groupname,
                 "itemno":this.form.itemno,

+ 94 - 0
src/HDrpManagement/ProductGroupMag/modules/addGroupDetail.vue

@@ -0,0 +1,94 @@
+<template>
+  <div>
+    <el-button type="text" size="small" @click="detailBtn">明细</el-button>
+    <el-dialog title="产品组明细" append-to-body :visible.sync="dialogTableVisible" width="70%">
+      <add-btn v-if="tool.checkAuth($route.name,'insert')" @onSuccess="getDetail" style="margin-bottom:16px" :id="rowData.sa_itemgroupid" />
+      <tableLayout v-if="dialogTableVisible" :layout="tablecols" :data="list" :opwidth="200" :custom="true" height="40vh" fixedName="operation">
+        <template v-slot:customcol="scope">
+            <span v-if="scope.column.data[scope.column.columnname]">{{scope.column.data[scope.column.columnname]}}</span>
+            <span v-else-if="scope.column.columnname != 'operation'">--</span>
+        </template>
+        <template v-slot:opreation="scope">
+          <div style="display:flex;justify-content:space-around">
+            <Del type="detail" v-if="tool.checkAuth($route.name,'delete')" :id="rowData.sa_itemgroupid" @deleteSuccess="getDetail" :detailId="scope.data.sa_itemgroupmxid"/>
+            <editBtn v-if="tool.checkAuth($route.name,'update')" :id="rowData.sa_itemgroupid" @onSuccess="getDetail" :rowData="scope.data"/>
+          </div>
+        </template>
+      </tableLayout>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import AddBtn from './addGroupDetailBtn'
+import editBtn from './editGroupDetailBtn'
+import { log } from '@antv/g2plot/lib/utils'
+import Del from './delete'
+
+export default {
+  data () {
+    return {
+      dialogTableVisible:false,
+      list:[],
+      form: {
+        product:[]
+      },
+      tablecols:[],
+      rules: {
+        product: [
+          { required: true, message: '请选择商品', trigger: 'blur' },
+        ],
+      }
+    }
+  },
+  props:['rowData'],
+  components:{AddBtn,Del,editBtn},
+
+  watch: {
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).groupDetailTable.tablecols
+  },
+  methods: {
+    async getDetail() {
+      let res = await this.$api.requested({
+        "id": "20220923101603",
+        "version":1,
+        "content": {
+          "sa_itemgroupid":this.rowData.sa_itemgroupid
+
+        }
+      })
+      this.list = res.data
+    },
+    detailBtn() {
+      this.getDetail()
+      this.dialogTableVisible = true
+    },
+    handleClose(tag) {
+      this.form.tag.splice(this.form.tag.indexOf(tag), 1);
+    },
+  }
+}
+
+</script>
+<style scoped>
+/deep/.el-dialog__body {
+  padding-top: 10px !important;
+}
+/deep/.dialog-footer {
+  margin-top: 10px !important;
+}
+/deep/.el-form-item__content {
+  width: calc(100% - 100px) !important;
+}
+/deep/.el-select {
+  width: 100% !important;
+}
+/deep/.el-form-item {
+  width: 100% !important;
+}
+/deep/.el-input{
+  width: 100% !important;
+}
+</style>

+ 105 - 0
src/HDrpManagement/ProductGroupMag/modules/addGroupDetailBtn.vue

@@ -0,0 +1,105 @@
+<template>
+  <div>
+    <el-button type="primary" size="small" @click="dialogTableVisible=true">新增明细</el-button>
+    <el-dialog title="产品组明细" append-to-body :visible.sync="dialogTableVisible" width="30%">
+      <el-form label-position="right" ref="form" :rules="rules" inline label-width="100px" :model="form" size="small">
+        <el-form-item label="商品" prop="product">
+          <el-select v-model="form.product" multiple placeholder="请选择商品">
+            <el-option
+              v-for="item in productList()"
+              :key="item.itemid"
+              :label="item.itemname"
+              :value="item.itemid">
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <div>
+          <el-button @click="dialogTableVisible = false" size="small">取 消</el-button>
+          <el-button type="primary" @click="submit" size="small">确 定</el-button>
+        </div>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { log } from '@antv/g2plot/lib/utils'
+export default {
+  data () {
+    return {
+      dialogTableVisible:false,
+      form: {
+        product:[]
+      },
+      rules: {
+        product: [
+          { required: true, message: '请选择商品', trigger: 'blur' },
+        ],
+      }
+    }
+  },
+  inject: ['productList'],
+  props:['id'],
+  watch: {
+    
+  },
+  created() {
+    
+  },
+  methods: {
+    submit() {
+     this.$refs.form.validate(async val => {
+        if(val) {
+          this.form.product = this.form.product.map(item => {
+            return {
+              sa_itemgroupmxid:0,
+              itemid:item
+            }
+          })
+          let res = await this.$api.requested({
+            "accesstoken": "69f1a508bad99ddffdce4bc3c919a0d0",
+            "id": "20220923110303",
+            "version":1,
+            "content": {
+              "sa_itemgroupid":this.id,
+              "itemclassinfos":this.form.product
+            }
+          })
+          this.tool.showMessage(res,() => {
+            this.dialogTableVisible = false
+            this.$emit('onSuccess')
+          })
+        }
+     })
+    },
+    handleClose(tag) {
+      this.form.tag.splice(this.form.tag.indexOf(tag), 1);
+    },
+    
+  }
+}
+
+</script>
+<style scoped>
+/deep/.el-dialog__body {
+  padding-bottom: 0 !important;
+  padding-top: 10px !important;
+}
+/deep/.dialog-footer {
+  margin-top: 10px !important;
+}
+/deep/.el-form-item__content {
+  width: calc(100% - 100px) !important;
+}
+/deep/.el-select {
+  width: 100% !important;
+}
+/deep/.el-form-item {
+  width: 100% !important;
+}
+/deep/.el-input{
+  width: 100% !important;
+}
+</style>

+ 194 - 0
src/HDrpManagement/ProductGroupMag/modules/editGroup.vue

@@ -0,0 +1,194 @@
+<template>
+  <div>
+    <el-button type="text" size="small" @click="editBtn">编辑</el-button>
+    <el-dialog title="编辑产品组" append-to-body :visible.sync="dialogTableVisible" width="30%">
+      <el-row :gutter="20">
+        <el-form label-position="right" ref="form" :rules="rules" inline label-width="100px" :model="form" size="small">
+          <el-col :span="24">
+            <el-form-item label="产品组名称" prop="groupname">
+              <el-input v-model="form.groupname" placeholder="请输入商品组名称"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="品牌" prop="sa_brandid">
+              <el-select v-model="form.sa_brandid" placeholder="请选择品牌">
+                <el-option
+                  v-for="item in brandData"
+                  :key="item.sa_brandid"
+                  :label="item.brandname"
+                  :value="item.sa_brandid"
+                  size="small">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="商品" prop="itemno">
+              <el-select v-model="form.itemno" placeholder="请选择商品">
+                <el-option
+                  v-for="item in productData"
+                  :key="item.itemno"
+                  :label="item.itemname"
+                  :value="item.itemno"
+                  size="small">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="自定义标签" prop="tag" style="margin-bottom:0px; !important">
+              <el-tag
+                :key="tag"
+                v-for="tag in form.tag"
+                closable
+                :disable-transitions="false"
+                @close="handleClose(tag)">
+                {{tag}}
+              </el-tag>
+              <el-input
+                class="input-new-tag"
+                v-if="inputVisible"
+                v-model="inputValue"
+                ref="saveTagInput"
+                size="small"
+                @keyup.enter.native="handleInputConfirm"
+                @blur="handleInputConfirm"
+              >
+              </el-input>
+              <el-button v-else class="button-new-tag" size="small" @click="showInput">+ New 标签</el-button>
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+        <div>
+          <el-button @click="dialogTableVisible = false" size="small">取 消</el-button>
+          <el-button type="primary" @click="submit" size="small">确 定</el-button>
+        </div>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+      dialogTableVisible:false,
+      /* 当前选择的组 */
+      seleteGroup:'',
+      inputVisible: false,
+      inputValue: '',
+      form:{
+        sa_brandid:'',
+        groupname:'',
+        itemno:'',
+        tag:[]
+      },
+      rules:{
+        sa_brandid: [
+          { required: true, message: '请选择品牌', trigger: 'blur' },
+        ],
+        groupname: [
+          { required: true, message: '请输入商品组名称', trigger: 'blur' },
+        ],
+        itemno: [
+          { required: true, message: '请选择商品', trigger: 'blur' },
+        ]
+      }
+    }
+  },
+  props:['type','brandData','productData','groupData'],
+  watch: {
+    
+  },
+  created() {
+    
+  },
+  methods: {
+    submit() {
+      this.$refs.form.validate(async val => {
+        if(val) {
+          let res = await this.$api.requested({
+            "id": "20220922164303",
+            "version":1,
+            "content": {
+                "sa_itemgroupid":this.groupData.sa_itemgroupid,    
+                "sa_brandid":this.form.sa_brandid,
+                "groupname":this.form.groupname,
+                "itemno":this.form.itemno,
+                "tag": this.form.tag
+            }
+          })
+          this.tool.showMessage(res,() => {
+            this.$emit('addSuccess')
+            this.dialogTableVisible = false
+          })
+        }
+      })
+    },
+    editBtn() {      
+      this.dialogTableVisible = true
+      this.seleteGroup = this.groupData
+      let temp = JSON.parse(JSON.stringify(this.seleteGroup))
+      this.form = {
+        sa_brandid:temp.sa_brandid,
+        groupname:temp.groupname,
+        itemno:temp.itemno,
+        tag:temp.tag1
+      }
+    },
+    handleClose(tag) {
+      this.form.tag.splice(this.form.tag.indexOf(tag), 1);
+    },
+    showInput() {
+      this.inputVisible = true;
+      this.$nextTick(_ => {
+        this.$refs.saveTagInput.$refs.input.focus();
+      });
+    },
+    handleInputConfirm() {
+      let inputValue = this.inputValue;
+      if (inputValue) {
+        this.form.tag.push(inputValue);
+      }
+      this.inputVisible = false;
+      this.inputValue = '';
+    }
+  }
+}
+
+</script>
+<style scoped>
+/deep/.el-dialog__body {
+  padding-top: 10px !important;
+  padding-bottom: 0 !important;
+}
+/deep/.dialog-footer {
+  margin-top: 10px !important;
+}
+/deep/.el-form-item__content {
+  width: calc(100% - 100px) !important;
+}
+/deep/.el-select {
+  width: 100% !important;
+}
+/deep/.el-form-item {
+  width: 100% !important;
+}
+.el-tag + .el-tag {
+  margin-left: 10px;
+  margin-bottom: 10px;
+}
+.button-new-tag {
+  margin-left: 10px;
+  height: 32px;
+  line-height: 30px;
+  padding-top: 0;
+  padding-bottom: 0;
+}
+.input-new-tag {
+  width: 90px;
+  margin-left: 10px;
+}
+</style>

+ 108 - 0
src/HDrpManagement/ProductGroupMag/modules/editGroupDetailBtn.vue

@@ -0,0 +1,108 @@
+<template>
+  <div>
+    <el-button type="text" size="small" @click="editBtn">编辑</el-button>
+    <el-dialog title="产品组明细" append-to-body :visible.sync="dialogTableVisible" width="30%">
+      <el-form label-position="right" ref="form" :rules="rules" inline label-width="100px" :model="form" size="small">
+        <el-form-item label="商品" prop="product">
+          <el-select v-model="form.product" placeholder="请选择商品">
+            <el-option
+              v-for="item in productList()"
+              :key="item.itemid"
+              :label="item.itemname"
+              :value="item.itemid">
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <div>
+          <el-button @click="dialogTableVisible = false" size="small">取 消</el-button>
+          <el-button type="primary" @click="submit" size="small">确 定</el-button>
+        </div>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { log } from '@antv/g2plot/lib/utils'
+export default {
+  data () {
+    return {
+      dialogTableVisible:false,
+      form: {
+        product:''
+      },
+      rules: {
+        product: [
+          { required: true, message: '请选择商品', trigger: 'blur' },
+        ],
+      }
+    }
+  },
+  inject: ['productList'],
+  props:['id','rowData'],
+  watch: {
+    
+  },
+  created() {
+    
+  },
+  methods: {
+    editBtn() {
+      this.form.product = this.rowData.itemid
+      this.dialogTableVisible = true
+    },
+    submit() {
+     this.$refs.form.validate(async val => {
+        if(val) {
+          let res = await this.$api.requested({
+            "accesstoken": "69f1a508bad99ddffdce4bc3c919a0d0",
+            "id": "20220923110303",
+            "version":1,
+            "content": {
+              "sa_itemgroupid":this.id,
+              "itemclassinfos":[
+                {
+                  sa_itemgroupmxid:this.rowData.sa_itemgroupmxid,
+                  itemid:this.form.product
+                }
+              ]
+            }
+          })
+          this.tool.showMessage(res,() => {
+            this.dialogTableVisible = false
+            this.$emit('onSuccess')
+          })
+        }
+     })
+    },
+    handleClose(tag) {
+      this.form.tag.splice(this.form.tag.indexOf(tag), 1);
+    },
+    
+  }
+}
+
+</script>
+<style scoped>
+/deep/.el-dialog__body {
+  padding-bottom: 0 !important;
+  padding-top: 10px !important;
+}
+/deep/.dialog-footer {
+  margin-top: 10px !important;
+}
+/deep/.el-form-item__content {
+  width: calc(100% - 100px) !important;
+}
+/deep/.el-select {
+  width: 100% !important;
+}
+/deep/.el-form-item {
+  width: 100% !important;
+}
+/deep/.el-input{
+  width: 100% !important;
+}
+</style>

+ 2 - 1
src/HDrpManagement/ProductGroupMag/modules/list.vue

@@ -1,12 +1,13 @@
 <template>
   <div>
-    <table1 :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="tableHieght" :checkbox="true" v-on="$listeners">
+    <table1 :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="tableHieght" :checkbox="true" v-on="$listeners" fixedName="operation">
       <template v-slot:customcol="scope">
         <p >{{scope.column.data[scope.column.columnname]}}</p>
       </template>
       <template v-slot:opreation="scope">
         <div style="display:flex;justify-content:space-around">
           <slot name="detail" :data="scope.data"></slot>
+          <slot name="groupDetail" :data="scope.data"></slot>
           <slot name="edit" :data="scope.data"></slot>
           <slot name="up" :data="scope.data"></slot>
           <slot name="down" :data="scope.data"></slot>

+ 2 - 4
src/HDrpManagement/ProductGroupMag/modules/table.vue

@@ -5,7 +5,7 @@
         type="selection"
         width="55" @handleSelectionChange="handleSelectionChange" @select-all="selectAll" v-if="checkbox" :selectable="isCheck">
       </el-table-column>
-      <el-table-column :show-overflow-tooltip="col.title == '来源' || col.title == '地址' || col.title == '备注'" v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" :width="col.width">
+      <el-table-column :show-overflow-tooltip="col.title == '来源' || col.title == '地址' || col.title == '备注'" v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" :width="col.width" :fixed="col.columnname === fixedName?'right':false">
         <template slot-scope="scope">
           <!-- 自定义表格显示内容 -->
           <slot v-if="custom" name="customcol" :column="{data:scope.row,columnname:col.columnname}"></slot>
@@ -28,7 +28,7 @@ export default {
     custom:是否启用自定义结构;
     opwidth:操作列宽度
   */
-  props:['layout','data','custom','height','checkbox'],
+  props:['layout','data','custom','height','checkbox','fixedName'],
   data () {
     return {
       list:[],
@@ -49,14 +49,12 @@ export default {
     },
     handleSelectionChange(val) {
       this.upOrDown = val[0] ? val[0].isonsale : ''
-      console.log(this.upOrDown);
       this.$emit('checkboxCallBack',val)      
     },
     selectAll(val) {
 
     },
     cellClass(row){
-      console.log(row)
       if (row.columnIndex === 0) {
         if(this.upOrDown === '') {
           return 'DisableSelection'

+ 18 - 2
src/HManagement/marketing/agent/modules/edit_agent.vue

@@ -89,6 +89,7 @@
         <el-tab-pane label="经销商团队" name="first"></el-tab-pane>
         <el-tab-pane label="业绩目标" name="second"></el-tab-pane>
         <el-tab-pane label="代理区域" name="third"></el-tab-pane>
+        <el-tab-pane label="营销类别" name="saleclass"></el-tab-pane>
       </el-tabs>
     </div>
     <div class="container normal-panel" v-if="activeName === 'first'">
@@ -98,18 +99,24 @@
     <div class="container normal-panel" v-if="activeName === 'third'">
       <salescope></salescope>
     </div>
+    <!--营销类别-->
+    <div class="container normal-panel" v-if="activeName === 'saleclass'">
+      <sale-class></sale-class>
+    </div>
   </div>
 </template>
 
 <script>
 import salescope from './salescope/list.vue'
+import SaleClass from './saleclass/index'
 import selectAgent from '../../../../components/selectAgent/index.vue'
 import arealist from '../../area/list.vue'
 export default {
   components:{
     selectAgent,
     arealist,
-    salescope
+    salescope,
+    SaleClass
   },
   data () {
     return {
@@ -149,7 +156,14 @@ export default {
       arealist:[],
       agent_type:[],
       agent_level:[],
-      tablecols:[]
+      tablecols:[],
+      sys_enterpriseid:''
+    }
+  },
+  /* 企业id */
+  provide() {
+    return {
+      sys_enterpriseid: () => this.sys_enterpriseid
     }
   },
   methods:{
@@ -161,6 +175,8 @@ export default {
             "sa_agentsid": this.$route.query.id
         }
       })
+      this.sys_enterpriseid = res.data.sys_enterpriseid
+      
       let arr = ['province','city','county']
       res.data.value = []
       arr.forEach(e=>{

+ 54 - 0
src/HManagement/marketing/agent/modules/saleclass/index.vue

@@ -0,0 +1,54 @@
+<template>
+  <div>
+    <add-sale-class class="normal-margin" @addSuccess="getClassList" v-if="tool.checkAuth($route.name,'add_saleClass')"/>
+    <tableLayout v-if="saleClassList" :layout="tablecols" :data="saleClassList" :custom="false" height="calc(100vh - 495px)" fixedName="operation">
+      <template v-slot:opreation="scope">
+        <Del v-if="tool.checkAuth($route.name,'delete')" :id="scope.data.sys_enterprise_saleclassid" @onSuccess="getClassList"/>
+      </template>
+    </tableLayout>
+  </div>
+</template>
+
+<script>
+import addSaleClass from './modules/addSaleClass'
+import Del from './modules/del'
+export default {
+  name: '',
+  data() {
+    return {
+      saleClassList:'',
+      tablecols:[]
+    };
+  },
+  components:{addSaleClass,Del},
+  computed:{
+  },
+  watch:{
+  },
+  created() {
+    this.getClassList()
+    this.tablecols = this.tool.tabelCol(this.$route.name)['saleClassTable'].tablecols
+  },
+  methods: {
+    /* 获取类别数据 */
+    async getClassList() {
+      let res = await this.$api.requested({
+        "id": 20220924134502,
+        "content": {
+            "pageNumber": 1,
+            "pageSize": 20,
+            "where": {
+                "condition": ""
+            }
+        },
+      })
+      console.log(res);
+      this.saleClassList = res.data
+    }
+  },
+};
+</script>
+
+<style scoped>
+
+</style>

+ 135 - 0
src/HManagement/marketing/agent/modules/saleclass/modules/addSaleClass.vue

@@ -0,0 +1,135 @@
+<template>
+  <div>
+    <el-button size="small" type="primary" icon="el-icon-plus" @click="dialogVisible = true">新建
+    </el-button>
+    <el-dialog title="营销类别授权" :visible.sync="dialogVisible" width="400px">
+      <el-cascader v-model="selectArr" ref="select" @change="change" :options="deplist" :props="{ multiple: true, checkStrictly: true }" clearable size="small">
+      </el-cascader>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="small" @click="dialogVisible = false">取 消</el-button>
+        <el-button size="small" type="primary" @click="submit()" :disabled="selectArr.length == 0">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { log } from '@antv/g2plot/lib/utils';
+export default {
+  props: ['data'],
+  data () {
+    return {
+      dialogVisible: false,
+      deplist:[],
+      result:'',
+      selectArr:[]
+    }
+  },
+  created() {
+    this.department()
+  },
+  inject: ['sys_enterpriseid'],
+  methods: {
+    async department () {
+      const res = await this.$api.requested({
+        "id": "20220922110403",
+        "version": 1,
+        "content": {
+          "sa_brandid": 0
+        }
+      })
+      // // 数据格式转换成elementui-tree所需的格式
+      res.data = res.data.map(item => {
+        return {
+          brandname: item.brandname,
+          rowindex: item.rowindex,
+          sa_brandid: item.sa_brandid,
+          itemclassid:item.sa_brandid,
+          value:item.sa_brandid,
+          subdep: item.ttemclass
+        }
+      })
+      this.deplist = this.createMenu(res.data)
+      console.log(this.deplist);
+      
+    },
+    createMenu (array) {
+      var that = this
+      let arr = []
+      function convertToElementTree (node) {
+        // 新节点
+        var elNode = {
+          label: node["brandname"] || node['itemclassname'],
+          parentid: node['parentid'],
+          value: node['itemclassid'],
+          sa_brandid: node['sa_brandid'],
+          changeby: node["changeby"],
+          changedate: node['changedate'],
+          createby: node['createby'],
+          createdate: node['createdate'],
+          itemclassfullname: node['itemclassfullname'],
+          itemclassfullnum: node["itemclassfullnum"],
+          itemclassid: node['itemclassid'],
+          itemclassname: node['itemclassname'],
+          itemclassnum: node['itemclassnum'],
+          children: []
+        }
+        if(elNode.sa_brandid) elNode.disabled = true
+        if (node.subdep && node.subdep.length > 0) {
+          // 如果存在子节点
+          for (var index = 0; index < node.subdep.length; index++) {
+            // 遍历子节点, 把每个子节点看做一颗独立的树, 传入递归构造子树, 并把结果放回到新node的children中
+            elNode.children.push(convertToElementTree(node.subdep[index]));
+          }
+        }
+        if(elNode.children.length == 0) {
+            delete elNode.children
+        }
+        return elNode;
+      }
+      array.forEach((element) => {
+        arr.push(convertToElementTree(element))
+      });
+      return arr
+    },
+    async submit() {
+      if(this.selectArr.length == 0) return
+      let res = await this.$api.requested({
+          "id": 20220924134302,
+          "content": {
+              "sys_enterpriseid": this.sys_enterpriseid(), //企业id
+              "itemclassid":this.result
+          },
+      })
+      console.log(res);
+      this.tool.showMessage(res,() => {
+        this.dialogVisible = false
+        this.selectArr = []
+        this.$emit('addSuccess')
+      })
+    },
+    change(data) {
+      let temp = JSON.parse(JSON.stringify(data))
+      temp.forEach(item => {
+        item.shift()
+      })    
+      let temp2 = []
+      temp.forEach(item => {
+        temp2.push(...item)
+      })    
+      temp2 = [...new Set(temp2)]
+      this.result = temp2
+    }
+  }
+}
+
+</script>
+<style scoped>
+/deep/.el-cascader {
+  width: 100%;
+}
+/deep/.el-dialog__body {
+  padding-top: 10px !important;
+  padding-bottom: 0 !important;
+}
+</style>

+ 32 - 0
src/HManagement/marketing/agent/modules/saleclass/modules/del.vue

@@ -0,0 +1,32 @@
+<template>
+  <div class="inline-16">
+    <el-popconfirm
+      title="确定删除吗?"
+      @confirm="deleteRow">
+      <el-button size="small" type="text" slot="reference">删 除</el-button>
+    </el-popconfirm>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['id'],
+  methods:{
+    deleteRow () {
+      this.$api.requested({
+        "id": 20220924134402,
+        "content": {
+            "sys_enterprise_saleclassids": [this.id]
+        },
+      }).then(res=>{
+        this.tool.showMessage(res,()=>{
+          this.$emit('onSuccess')
+        })
+      })
+    },
+  }
+}
+
+</script>
+<style>
+</style>