liujq 2 years ago
parent
commit
9b7b64097c

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-4a9beb7e.e112ef7d.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.2bce587e.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.6163d674.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-4a9beb7e.e59c1612.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-f0e6a848.e4bb03d1.js


+ 1 - 1
src/api/cust.js

@@ -31,7 +31,7 @@ export default {
   admcustomerdel: params => { // 客户 -  删除
     return getRequestNoSort('/adm/customer/del', params, 'loading')
   },
-  admcustomerimport: params => { // 客户 -  删除
+  admcustomerimport: params => { // 客户 -  导入
     return getRequestNoSort('/adm/customer/import', params, 'loading')
   },
 }

+ 12 - 0
src/api/user.js

@@ -31,4 +31,16 @@ export default {
   admusersearch: params => { // 用户搜索
     return getRequestNoSort('/adm/user/search', params, 'loading')
   },
+  admdeptlist: params => { // 渠道 -  列表
+    return getRequest('/adm/dept/list', params)
+  },
+  admdeptedit: params => { // 渠道 -  编辑
+    return getRequestNoSort('/adm/dept/edit', params, 'loading')
+  },
+  admdeptdetail: params => { // 渠道 -  详情
+    return getRequestNoSort('/adm/dept/detail', params, 'loading')
+  },
+  admdeptdel: params => { // 渠道 -  删除
+    return getRequestNoSort('/adm/dept/del', params, 'loading')
+  },
 }

+ 1 - 1
src/views/cust/index.vue

@@ -65,11 +65,11 @@ export default {
   mounted() {
     this.listConfig = {
       rows: [
+        { label: '创建人', prop: 'createBy' },
         { label: '姓名', prop: 'name' },
         { label: '手机号', prop: 'phone' },
         { label: '性别', prop: 'sex', type: 'tag', tags: arrToObj(this.$dictData.sex), tagTypeObj: {'male': 'primary', 'female': 'danger'} },
         { label: '备注', prop: 'demand', fullShow: true, minWidth: 200, align: 'left' },
-        { label: '创建人', prop: 'createBy' },
         { label: '创建时间', prop: 'create_at' },
         { label: '操作', width: 120, type: 'handle2', operations:
           [

+ 4 - 2
src/views/report/components/popup/IndexRecord.vue

@@ -38,7 +38,7 @@
       </div>
       <div class="xl-form" style="padding-top: 20px;">
         <div class="xl-form-footer">
-            <div class="scoped-btn-more">
+            <div class="scoped-btn-more" v-if="curRoles !== '6'">
               <el-button type="small" icon="el-icon-plus" class="xl-form-btn bgc2" @click="openPopup">更新报备进度</el-button>
               <el-button type="small" icon="el-icon-warning" class="xl-form-btn bgc4" @click="openStatePopup">修改状态</el-button>
             </div>
@@ -88,9 +88,12 @@ export default {
       dtlObj: {},
       isStateShow: false,
       sexObj: {},
+      curRoles: ''
     }
   },
   mounted() {
+    const uObj = JSON.parse(this.$storage('fp_user'))
+    this.curRoles = uObj.roles
     this.sexObj = arrToObj(this.$dictData.sex)
     this.listConfig = {
       rows: [
@@ -130,7 +133,6 @@ export default {
   methods: {
     getData () {
       this.$api.cust.admreportdetail({id: this.curObj.id}).then(res => {
-        console.log(res)
         this.dtlObj = res || {}
         this.reportFlow = res.report_flow || []
       })

+ 1 - 1
src/views/report/index.vue

@@ -100,6 +100,7 @@ export default {
   mounted() {
     this.listConfig = {
       rows: [
+        { label: '报备人', prop: 'createBy' },
         { label: '姓名', prop: 'name' },
         { label: '电话', prop: 'phone' },
         { label: '客户状态', prop: 'report_state', type: 'tag', tags: arrToObj(this.$dictData.report_state	), tagTypeObj: {'1': 'success', '2': 'warning', '3': 'danger'}},
@@ -108,7 +109,6 @@ export default {
         { label: '报备时间', prop: 'create_at' },
         { label: '性别', prop: 'sex', type: 'tag', tags: arrToObj(this.$dictData.sex), tagTypeObj: {'male': 'primary', 'female': 'danger'} },
         { label: '备注', prop: 'remark', fullShow: true },
-        { label: '报备人', prop: 'createBy' },
         { label: '操作', width: 90, type: 'handle2', operations:
           [
             { label: '报备详情', func: this.openQPopup, btnType: 'primary' },

+ 2 - 2
src/views/user/auth.vue

@@ -13,9 +13,9 @@
       :total-records="totalRecords"
       @currentChange="pageHandle"
       @sizeChange="sizeChange"
-      :isAdd="true"
-      @add="openPopup"
     />
+    <!-- :isAdd="true"
+      @add="openPopup" -->
     <popup-edit
       :isShow="isDtlShow"
       :curObj="curObj"

+ 114 - 0
src/views/user/channel.vue

@@ -0,0 +1,114 @@
+<template>
+  <div class="app-container">
+    <search-form
+      :list-loading="listLoading"
+      @change="searchHandle"
+    />
+    <table-list
+      :list-loading="listLoading"
+      :data="tableData2"
+      :columns="listConfig"
+      :current-page="currentPage"
+      :page-size="pageSize"
+      :total-records="totalRecords"
+      @currentChange="pageHandle"
+      @sizeChange="sizeChange"
+      :isAdd="true"
+      @add="openPopup"
+    />
+    <popup-edit
+      :isShow="isDtlShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import SearchForm from './components/searchForm/Index'
+import PopupEdit from './components/popup/ChannelEdit'
+import baseTable from '_m/baseTable.js'
+export default {
+  name: 'index',
+  components: {
+    SearchForm,
+    PopupEdit,
+  },
+  provide() {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  data() {
+    return {
+      apiStr: 'user.admdeptlist',
+      searchForm: null,
+      isDtlShow: false,
+      curObj: {},
+    }
+  },
+  computed: {
+    tableData2() {
+      const arr = [...this.tableData]
+      arr.map(item => {
+        item.nickname = item.leader_user.nickname
+        item.phone = item.leader_user.phone
+      })
+      return arr
+    }
+  },
+  created() {},
+  mounted() {
+    this.listConfig = {
+      rows: [
+        { label: '渠道名称', prop: 'dept_name' },
+        { label: '昵称', prop: 'nickname' },
+        { label: '手机号', prop: 'phone' },
+        { label: '更新时间', prop: 'update_at' },
+        { label: '操作', width: 70, type: 'handle2', operations:
+          [
+            { label: '删除', func: this.delHandle, btnType: 'danger' },
+          ]
+        }
+      ]
+    }
+  },
+  methods: {
+    delHandle(row) {
+      this.$msg(`您确定要删除该渠道吗?`, 'confirm', () => {
+        this.$api.user.admdeptdel({
+          id: row.id
+        }).then(data => {
+          this.$msgs(`已删除!`)
+          this.fetchData()
+        })
+      }, null, true)
+    },
+    openPopup(row) {
+      if (row && row.id) {
+        this.curObj = row
+      } else {
+        this.curObj = {}
+      }
+      this.isDtlShow = true
+    },
+    closePopup(obj) {
+      if (obj) {
+        const params = obj
+        let apiStr = 'admdeptedit'
+        if (obj.id) apiStr = 'admdeptedit'
+        this.$api.user[apiStr]({
+          ...params
+        }).then(data => {
+          this.$msgs('修改成功')
+          this.fetchData()
+          this.isDtlShow = false
+        })
+      } else {
+        this.isDtlShow = false
+      }
+    }
+  }
+}
+</script>

+ 28 - 6
src/views/user/components/popup/AuthEdit.vue

@@ -5,13 +5,13 @@
       :show-close="false"
       :close-on-click-modal="false"
       :visible.sync="isShow"
-      title="用户审核"
+      :title="`审核:${curObj.real_name}--(推荐人${curObj.referrer})`"
       :fullscreen="false"
       width="360px"
       custom-class="xl-dialog"
       center
     >
-      <base-form ref="ruleForm" :data="formData" :is-inline="false" label-width="60px">
+      <base-form ref="ruleForm" :data="formData" :is-inline="false" label-width="70px">
         <div slot="footer">
           <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
           <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
@@ -45,10 +45,32 @@ export default {
     },
   },
   methods: {
-    getDef() {
-      this.formData = [
-        { label: '处理', key: 'auth_state', type: 'select', class: 'c-2', options: [{val: '1', key: '通过'}, {val: '3', key: '拒绝'}] },
-      ]
+    getDef(fieldStr) {
+      let params = { ...this.curObj }
+      if (fieldStr === 'changeStr') {
+        const oldform = this.$refs.ruleForm.baseForm
+        params = {...this.curObj, ...oldform}
+      } else {
+        params.auth_state = '1'
+      }
+      if (params.group_type == 2) {
+        this.formData = [
+          { label: '处理', key: 'auth_state', rules: 1, type: 'select', class: 'c-2', options: [{val: '1', key: '通过'}, {val: '3', key: '拒绝'}] },
+          { label: '角色', key: 'group_type', rules: 1, class: 'c-2', type: 'select', options: this.$dictData.group_type, changeHandle: this.groupTypeChange },
+          { label: '所属渠道', key: 'dept_id', type: 'selectRemote',
+            remoteParams: { skey: 'dept_name', api: `user.admdeptlist`, opKey: 'dept_name', opVal: 'id' },
+          }
+        ]
+      } else {
+        this.formData = [
+          { label: '处理', key: 'auth_state', rules: 1, type: 'select', class: 'c-2', options: [{val: '1', key: '通过'}, {val: '3', key: '拒绝'}] },
+          { label: '角色', key: 'group_type', rules: 1, class: 'c-2', type: 'select', options: this.$dictData.group_type, changeHandle: this.groupTypeChange },
+        ]
+      }
+      this.setDefaultValue(params)
+    },
+    groupTypeChange () {
+      this.getDef('changeStr')
     },
     close(str) {
       if (str === 'confirm') {

+ 74 - 0
src/views/user/components/popup/ChannelEdit.vue

@@ -0,0 +1,74 @@
+<template>
+  <div>
+    <el-dialog
+      v-loading="loading"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :visible.sync="isShow"
+      title="用户审核"
+      :fullscreen="false"
+      width="360px"
+      custom-class="xl-dialog"
+      center
+    >
+      <base-form ref="ruleForm" :data="formData" :is-inline="false" label-width="60px">
+        <div slot="footer">
+          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+        </div>
+      </base-form>
+    </el-dialog>
+  </div>
+</template>
+<script>
+export default {
+  components: {},
+  mixins: [...mixins],
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      formData: [],
+      loading: true,
+      cObj: {},
+      isShowMap: false
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        this.getDef()
+      }
+    },
+  },
+  methods: {
+    getDef() {
+      this.formData = [
+        { label: '处理', key: 'auth_state', type: 'select', class: 'c-2', options: [{val: '1', key: '通过'}, {val: '3', key: '拒绝'}] },
+      ]
+    },
+    close(str) {
+      if (str === 'confirm') {
+        this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
+          if (valid) {
+            const oldform = this.$refs.ruleForm.baseForm
+            let newForm = { ...oldform }
+            if (this.curObj.id) {
+              newForm.id = this.curObj.id
+            }
+            this.$emit('close', newForm)
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.setDefaultValue()
+      }
+    },
+  }
+}
+</script>
+<style lang="scss" scoped>
+</style>

Some files were not shown because too many files changed in this diff