chending1994 пре 4 година
родитељ
комит
d52a87cb72

+ 27 - 1
src/api/markting.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request'
 
-// 新建市场活动
+// 查询市场活动
 export function getMarketActivityList(params) {
   return request({
     url: 'sale/market',
@@ -9,6 +9,7 @@ export function getMarketActivityList(params) {
   })
 }
 
+// 新建或保存市场活动
 export function saveOrUptMarketActivity(data) {
   return request({
     url: 'sale/market',
@@ -17,3 +18,28 @@ export function saveOrUptMarketActivity(data) {
   })
 }
 
+// 查询市场活动详情
+export function getMarketActivityInfo(id) {
+  return request({
+    url: `sale/market/${id}`,
+    method: 'get'
+  })
+}
+
+// 查询活动的销售线索-用于活动页面查详情使用
+export function getSaleLeads(params) {
+  return request({
+    url: `sale/leads`,
+    method: 'get',
+    params
+  })
+}
+
+// 销售线索
+export function getSaleLeadsList(data) {
+  return request({
+    url: `/sale/leads/search`,
+    method: 'post',
+    data
+  })
+}

+ 4 - 2
src/components/Table/index.js

@@ -137,6 +137,7 @@ export default {
      */
     loadData (pagination, filters, sorter) {
       this.localLoading = true
+      console.log(pagination);
       const parameter = Object.assign({
         curPage: (pagination && pagination.current) ||
           this.showPagination && this.localPagination.current || this.pageNum,
@@ -152,6 +153,7 @@ export default {
         ...filters
       }
       )
+      console.log(parameter);
       const result = this.data(parameter)
       // 对接自己的通用数据接口需要修改下方代码中的 r.curPage, r.totalCount, r.data
       // eslint-disable-next-line
@@ -175,13 +177,13 @@ export default {
           // 这里用于判断接口是否有返回 r.totalCount 且 this.showPagination = true 且 curPage 和 pageSize 存在 且 totalCount 小于等于 curPage * pageSize 的大小
           // 当情况满足时,表示数据不满足分页大小,关闭 table 分页功能
           try {
-            if ((['auto', true].includes(this.showPagination) && r.totalCount <= (r.curPage * this.localPagination.pageSize))) {
+            if ((['auto', true].includes(this.showPagination) && r.total <= (r.curPage * this.localPagination.pageSize))) {
               this.localPagination.hideOnSinglePage = true
             }
           } catch (e) {
             this.localPagination = false
           }
-          this.localDataSource = r.data // 返回结果中的数组数据
+          this.localDataSource = r.records || [] // 返回结果中的数组数据
           this.localLoading = false
         })
       }

+ 13 - 3
src/views/markting/active/info.vue

@@ -2,7 +2,7 @@
   <a-card :bordered="false">
     <a-tabs :default-active-key="1" @change="callback">
       <a-tab-pane :key="item.id" :tab="item.tab" v-for="(item, index) in tabs" >
-        <base-form v-if="item.id == 1"></base-form>
+        <base-form :info="info" v-if="item.id == 1"></base-form>
         <sales-leads v-else></sales-leads>
       </a-tab-pane>
     </a-tabs>
@@ -11,6 +11,7 @@
 </template>
 
 <script>
+import { getMarketActivityInfo } from '@/api/markting';
 import BaseForm from '../components/BaseForm';
 import SalesLeads from '../components/SalesLeads';
 
@@ -20,7 +21,7 @@ export default {
       visible: false,
       confirmLoading: false,
       mdl: null,
-
+      info: {},
       tabs: [
         {
           id: 1,
@@ -34,7 +35,10 @@ export default {
     }
   },
   created() {
-
+    const id = this.$route.query.id;
+    if(id) {
+      this.loadInfo(id);
+    }
   },
   components: {
     BaseForm,
@@ -47,6 +51,12 @@ export default {
     callback(key) {
       console.log(key);
     },
+    async loadInfo(id) {
+      const { data, code } = await getMarketActivityInfo(id);
+      if(code === 0) {
+        this.info = data;
+      }
+    }
   }
 }
 </script>

+ 20 - 44
src/views/markting/active/list.vue

@@ -34,8 +34,8 @@
         :alert="false"
         :rowSelection="rowSelection"
         showPagination="auto">
-        <span @click="handleInfo(record)" slot="serial" slot-scope="text, record, index">
-          {{ index + 1 }}
+        <span @click="handleInfo(record)" slot="label" slot-scope="text, record, index">
+          <span class="link-text">{{ text }}</span>
         </span>
         <span slot="status" slot-scope="text">
           <a-badge :status="text | statusTypeFilter" :text="text | statusFilter" />
@@ -64,15 +64,13 @@ import { STable, Ellipsis } from '@/components';
 import { getRoleList, getServiceList } from '@/api/manage';
 import { getMarketActivityList, saveOrUptMarketActivity } from '@/api/markting';
 import ActiveForm from '../modules/ActiveForm';
+import { postConfig } from '@/api/basics';
 
 const columns = [
-  {
-    title: '#',
-    scopedSlots: { customRender: 'serial' }
-  },
   {
     title: '市场活动名称',
-    dataIndex: 'label'
+    dataIndex: 'label',
+    scopedSlots: { customRender: 'label' }
   },
   {
     title: '活动类型',
@@ -145,13 +143,15 @@ export default {
       advanced: false,
       // 查询参数
       queryParam: {
-        curPage: 1
+        curPage: 1,
+        size: 1
       },
       loadData: parameter => {
         const requestParameters = Object.assign({}, parameter, this.queryParam)
         console.log('loadData request parameters:', requestParameters)
         return getMarketActivityList(requestParameters)
           .then(res => {
+            console.log(res.data);
             return res.data
           })
       },
@@ -230,34 +230,23 @@ export default {
       this.confirmLoading = true
       ruleForm.validate(async valid  => {
         if (valid) {
+          let postData = { ...form };
+          if(postData.departmentId && postData.departmentId.length > 0) {
+            const departmentId = postData.departmentId.pop();
+            postData.departmentId = departmentId;
+          }
           if (form.id > 0) {
-            const { data, code } = await saveOrUptMarketActivity(form);
+            const { data, code } = await saveOrUptMarketActivity(postData);
             if(code === 0) {
-              console.log(data);
               this.visible = false
               this.confirmLoading = false
               ruleForm.resetFields()
               this.$refs.table.refresh()
               this.$message.info('修改成功')
             }
-            // 修改 e.g.
-            // new Promise((resolve, reject) => {
-            //   setTimeout(() => {
-            //     resolve()
-            //     console.log(form)
-            //   }, 1000)
-            // }).then(res => {
-            //   this.visible = false
-            //   this.confirmLoading = false
-            //   // 重置表单数据
-            //   // ruleForm.resetFields()
-            //   // 刷新表格
-            //   this.$refs.table.refresh()
-            //   this.$message.info('修改成功')
-            // })
           } else {
             // 新增
-            const { data, code } = await saveOrUptMarketActivity(form);
+            const { data, code } = await saveOrUptMarketActivity(postData);
             if(code === 0) {
               console.log(data);
               this.visible = false
@@ -266,22 +255,6 @@ export default {
               this.$refs.table.refresh()
               this.$message.info('新增成功')
             }
-
-            // new Promise((resolve, reject) => {
-            //   setTimeout(() => {
-            //     resolve()
-            //     console.log(form)
-            //   }, 1000)
-            // }).then(res => {
-            //   this.visible = false
-            //   this.confirmLoading = false
-            //   // 重置表单数据
-            //   // ruleForm.resetFields()
-            //   // 刷新表格
-            //   this.$refs.table.refresh()
-
-            //   this.$message.info('新增成功')
-            // })
           }
         } else {
           this.confirmLoading = false
@@ -317,6 +290,9 @@ export default {
 }
 </script>
 
-<style>
-
+<style lang="less" soped>
+@import '~ant-design-vue/es/style/themes/default.less';
+.link-text {
+  color: @primary-color;
+}
 </style>

+ 15 - 14
src/views/markting/components/BaseForm.vue

@@ -3,48 +3,43 @@
     <a-row>
       <a-col :span="6">
         <span>市场活动名称:</span>
-        <span>地推</span>
+        <span>{{ info.label }}</span>
         <a-divider />
       </a-col>
       <a-col :span="6" offset="1">
         <span>开始日期:</span>
-        <span>2020-10-10</span>
+        <span>{{ info.startDate }}</span>
         <a-divider />
       </a-col>
     </a-row>
     <a-row>
       <a-col :span="6">
         <span>结束日期:</span>
-        <span>2020-11-11</span>
+        <span>{{ info.endDate }}</span>
         <a-divider />
       </a-col>
       <a-col :span="6" offset="1">
         <span>采单人:</span>
-        <span>逻辑狗</span>
+        <span>{{ info.orderLabel }}</span>
         <a-divider />
       </a-col>
     </a-row>
     <a-row>
-      <a-col :span="6">
-        <span>负责人主属部门:</span>
-        <span>未填写</span>
+      <a-col :span="6" >
+        <span>属部门:</span>
+        <span>{{ info.departmentLabel }}</span>
         <a-divider />
       </a-col>
       <a-col :span="6" offset="1">
         <span>活动类型:</span>
-        <span>品牌活动</span>
+        <span>{{ info.typeLabel }}</span>
         <a-divider />
       </a-col>
     </a-row>
     <a-row>
       <a-col :span="6">
         <span>描述:</span>
-        <span>未填写</span>
-        <a-divider />
-      </a-col>
-      <a-col :span="6" offset="1">
-        <span>归属部门:</span>
-        <span>销售部</span>
+        <span>{{ info.description }}</span>
         <a-divider />
       </a-col>
     </a-row>
@@ -53,6 +48,12 @@
 
 <script>
 export default {
+  props: {
+    info: {
+      type: Object,
+      default: () => {}
+    }
+  },
   data() {
     return {
 

+ 69 - 29
src/views/markting/components/SalesLeads.vue

@@ -14,14 +14,11 @@
       :alert="false"
       :rowSelection="rowSelection"
       showPagination="auto">
-      <span slot="serial" slot-scope="text, record, index">
-        {{ index + 1 }}
+      <span slot="handleState" slot-scope="text, record, index">
+        {{ record.followState < 1 ? '未跟进' : '已跟进' }}
       </span>
-      <span slot="status" slot-scope="text">
-        <a-badge :status="text | statusTypeFilter" :text="text | statusFilter" />
-      </span>
-      <span slot="description" slot-scope="text">
-        <ellipsis :length="4" tooltip>{{ text }}</ellipsis>
+      <span slot="important" slot-scope="text">
+        {{ text | importantFilter }}
       </span>
     </s-table>
 
@@ -43,7 +40,7 @@ import moment from 'moment'
 import { STable, Ellipsis } from '@/components';
 import MemberForm from '../modules/MemberForm';
 import { getRoleList, getServiceList } from '@/api/manage';
-
+import { getSaleLeads } from '@/api/markting';
 
 const columns = [
   {
@@ -51,30 +48,49 @@ const columns = [
     scopedSlots: { customRender: 'serial' }
   },
   {
-    title: '规则编号',
-    dataIndex: 'no'
+    title: '学生姓名',
+    dataIndex: 'babyName'
+  },
+  {
+    title: '家长姓名',
+    dataIndex: 'parentsName',
   },
   {
-    title: '描述',
-    dataIndex: 'description',
-    scopedSlots: { customRender: 'description' }
+    title: '家长手机号',
+    dataIndex: 'parentsPhone',
+  },
+  {
+    title: '跟进处理',
+    scopedSlots: { customRender: 'handleState' } // followState< 1 未跟进  否则已跟进
+  },
+    {
+    title: '跟进状态',
+    dataIndex: 'followState',  //  跟进状态,未跟进0,待跟进1,跟进中2,试听3,已听4,已签约5
+  },
+    {
+    title: '重要程度',
+    dataIndex: 'important', // 重要程度 0一般1中等2非常
+     scopedSlots: { customRender: 'important' }
+  },
+    {
+    title: '性别',
+    dataIndex: 'babyGender', // 宝宝性别012
+  },
+    {
+    title: '前销售',
+    dataIndex: 'preSaleLabel',
   },
   {
-    title: '服务调用次数',
-    dataIndex: 'callNo',
-    sorter: true,
-    needTotal: true,
-    customRender: (text) => text + ' 次'
+    title: '采单人',
+    dataIndex: 'orderLabel',
   },
   {
-    title: '状态',
-    dataIndex: 'status',
-    scopedSlots: { customRender: 'status' }
+    title: '市场活动名称',
+    dataIndex: 'marketActivityLabel',
   },
   {
-    title: '更新时间',
-    dataIndex: 'updatedAt',
-    sorter: true
+    title: '推广渠道',
+    dataIndex: 'channelLabel',
   }
 ]
 
@@ -97,21 +113,39 @@ const statusMap = {
   }
 }
 
+const importantMap = {
+  0: {
+    status: 'default',
+    text: '一般'
+  },
+  1: {
+    status: 'processing',
+    text: '中等'
+  },
+  2: {
+    status: 'success',
+    text: '非常'
+  }
+}
+
 export default {
   data() {
     this.columns = columns
     return {
+      id: '',
       visible: false,
       confirmLoading: false,
       mdl: null,
       // 查询参数
-      queryParam: {},
+      queryParam: {
+        curPage: 1
+      },
       loadData: parameter => {
         const requestParameters = Object.assign({}, parameter, this.queryParam)
         console.log('loadData request parameters:', requestParameters)
-        return getServiceList(requestParameters)
+        return getSaleLeads(requestParameters)
           .then(res => {
-            return res.result
+            return res.data
           })
       },
       selectedRowKeys: [],
@@ -129,10 +163,16 @@ export default {
     },
     statusTypeFilter (type) {
       return statusMap[type].status
-    }
+    },
+    importantFilter (type) {
+      return importantMap[type].text
+    },
   },
   created() {
-
+    const id = this.$route.query.id;
+    if(id) {
+      this.queryParam.activityId = id;
+    }
   },
   computed: {
     rowSelection () {

+ 132 - 41
src/views/markting/leads/list.vue

@@ -21,12 +21,12 @@
       <div class="table-page-search-wrapper">
         <a-form layout="inline">
           <a-row :gutter="20">
-            <a-col :md="5" :sm="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item label="搜索线索">
                 <a-input v-model="queryParam.id" placeholder="请输入线索姓名或手机号"/>
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item label="跟进人">
                 <a-select v-model="queryParam.status" placeholder="请选择跟进人" default-value="0">
                   <a-select-option value="0">全部</a-select-option>
@@ -35,27 +35,27 @@
                 </a-select>
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item label="添加时间">
                 <a-range-picker allowClear v-model="createTime" :format="dateFormat" @change="handleTimeChange" />
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item label="跟进添加">
                 <a-range-picker allowClear v-model="createTime" :format="dateFormat" @change="handleTimeChange" />
               </a-form-item>
             </a-col>
-            <a-col :md="4" :sm="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item label="最后跟进">
                 <a-range-picker allowClear v-model="createTime" :format="dateFormat" @change="handleTimeChange" />
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item label="待回访日期">
                 <a-range-picker allowClear v-model="createTime" :format="dateFormat" @change="handleTimeChange" />
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item label="来源渠道">
                 <a-select v-model="queryParam.status" placeholder="请选择来源渠道" default-value="0">
                   <a-select-option value="0">全部</a-select-option>
@@ -64,7 +64,7 @@
                 </a-select>
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item label="意向度">
                 <a-select v-model="queryParam.status" placeholder="请选择意向度" default-value="0">
                   <a-select-option value="0">全部</a-select-option>
@@ -73,7 +73,7 @@
                 </a-select>
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item label="意向课程">
                 <a-select v-model="queryParam.status" placeholder="请选择意向课程" default-value="0">
                   <a-select-option value="0">全部</a-select-option>
@@ -82,7 +82,7 @@
                 </a-select>
               </a-form-item>
             </a-col>
-            <a-col :md="4" :sm="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item label="采单员">
                 <a-select v-model="queryParam.status" placeholder="请选择采单员" default-value="0">
                   <a-select-option value="0">全部</a-select-option>
@@ -91,7 +91,7 @@
                 </a-select>
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item label="线索状态">
                 <a-select v-model="queryParam.status" placeholder="请选择线索状态" default-value="0">
                   <a-select-option value="0">全部</a-select-option>
@@ -100,7 +100,7 @@
                 </a-select>
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item label="跟进状态">
                 <a-select v-model="queryParam.status" placeholder="请选择跟进状态" default-value="0">
                   <a-select-option value="0">全部</a-select-option>
@@ -109,7 +109,7 @@
                 </a-select>
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item label="就读年级">
                 <a-select v-model="queryParam.status" placeholder="请选择就读年级" default-value="0">
                   <a-select-option value="0">全部</a-select-option>
@@ -146,14 +146,17 @@
         :alert="false"
         :rowSelection="rowSelection"
         showPagination="auto">
-        <span slot="serial" slot-scope="text, record, index">
-          {{ index + 1 }}
+        <span slot="handleState" slot-scope="text, record, index">
+          {{ record.followState < 1 ? '未跟进' : '已跟进' }}
         </span>
-        <span slot="status" slot-scope="text">
-          <a-badge :status="text | statusTypeFilter" :text="text | statusFilter" />
+        <span slot="important" slot-scope="text">
+          {{ text | importantFilter }}
         </span>
-        <span slot="description" slot-scope="text">
-          <ellipsis :length="4" tooltip>{{ text }}</ellipsis>
+        <span slot="followState" slot-scope="text">
+          {{ text | followStateFilter }}
+        </span>
+        <span slot="babyGender" slot-scope="text">
+          {{ text | genderFilter }}
         </span>
         <span slot="action" slot-scope="text, record">
           <template>
@@ -217,8 +220,8 @@
 
 <script>
 import moment from 'moment'
+import { getSaleLeadsList} from '@/api/markting'
 import { STable, Ellipsis } from '@/components';
-import { getRoleList, getServiceList } from '@/api/manage'
 import MemberForm from '../modules/MemberForm'   // 添加线索
 import AssignSales from '../modules/AssignSales' // 分配线索
 import CancelLeads from '../modules/CancelLeads' // 标为无效
@@ -227,38 +230,69 @@ import Info from '../components/Info'
 
 const columns = [
   {
-    title: '#',
-    scopedSlots: { customRender: 'serial' }
+    title: '学员姓名',
+    dataIndex: 'babyName'
+  },
+  {
+    title: '联系电话',
+    dataIndex: 'parentsPhone',
+  },
+  {
+    title: '添加时间',
+    dataIndex: 'parentsPhone',
+  },
+  {
+    title: '线索状态',
+    scopedSlots: { customRender: 'handleState' } // followState< 1 未跟进  否则已跟进
+  },
+  {
+    title: '市场活动名称',
+    dataIndex: 'followState',//  跟进状态,未跟进0,待跟进1,跟进中2,试听3,已听4,已签约5
+    scopedSlots: { customRender: 'followState' }
+  },
+  {
+    title: '意向度',
+    dataIndex: 'important', // 重要程度 0一般1中等2非常
+    scopedSlots: { customRender: 'important' }
+  },
+  {
+    title: '意向课程',
+    dataIndex: 'babyGender', // 宝宝性别012
+    scopedSlots: { customRender: 'babyGender' }
+  },
+    {
+    title: '就读年级',
+    dataIndex: 'preSaleLabel',
+  },
+  {
+    title: '就读学校',
+    dataIndex: 'orderLabel',
   },
   {
-    title: '规则编号',
-    dataIndex: 'no'
+    title: '跟进状态',
+    dataIndex: 'marketActivityLabel',
   },
   {
-    title: '描述',
-    dataIndex: 'description',
-    scopedSlots: { customRender: 'description' }
+    title: '负责销售',
+    dataIndex: 'channelLabel',
   },
   {
-    title: '服务调用次数',
-    dataIndex: 'callNo',
-    sorter: true,
-    needTotal: true,
-    customRender: (text) => text + ' 次'
+    title: '最后跟进时间',
+    dataIndex: 'channelLabel',
   },
   {
-    title: '状态',
-    dataIndex: 'status',
-    scopedSlots: { customRender: 'status' }
+    title: '待回访时间',
+    dataIndex: 'channelLabel',
   },
   {
-    title: '更新时间',
-    dataIndex: 'updatedAt',
-    sorter: true
+    title: '采单员',
+    dataIndex: 'channelLabel',
   },
   {
     title: '操作',
-    scopedSlots: { customRender: 'action' },
+    scopedSlots: {
+      customRender: 'action'
+    }
   }
 ]
 
@@ -281,6 +315,54 @@ const statusMap = {
   }
 }
 
+const importantMap = {
+  0: {
+    status: 'default',
+    text: '一般'
+  },
+  1: {
+    status: 'processing',
+    text: '中等'
+  },
+  2: {
+    status: 'success',
+    text: '非常'
+  }
+}
+
+const followStateMap = {
+  0: {
+    text: '未跟进'
+  },
+  1: {
+    text: '待跟进'
+  },
+  2: {
+    text: '跟进中'
+  },
+  3: {
+    text: '试听'
+  },
+  4: {
+    text: '已听'
+  },
+  5: {
+    text: '已签约'
+  }
+}
+
+const genderMap = {
+  0: {
+    text: '女'
+  },
+  1: {
+    text: '男'
+  },
+  2: {
+    text: '未知'
+  }
+}
+
 export default {
   name: 'SeasList',
   components: {
@@ -311,9 +393,9 @@ export default {
       loadData: parameter => {
         const requestParameters = Object.assign({}, parameter, this.queryParam)
         console.log('loadData request parameters:', requestParameters)
-        return getServiceList(requestParameters)
+        return getSaleLeadsList(requestParameters)
           .then(res => {
-            return res.result
+            return res.data
           })
       },
       selectedRowKeys: [],
@@ -326,6 +408,15 @@ export default {
     },
     statusTypeFilter (type) {
       return statusMap[type].status
+    },
+    importantFilter (type) {
+      return importantMap[type].text
+    },
+    followStateFilter (type) {
+      return followStateMap[type].text
+    },
+    genderFilter (type) {
+      return genderMap[type].text
     }
   },
   created() {

+ 41 - 14
src/views/markting/modules/ActiveForm.vue

@@ -17,6 +17,8 @@
               <div class="title-text">基础信息</div>
             </div>
           </a-col>
+        </a-row>
+        <a-row>
           <a-col :md="12" :sm="24">
             <a-form-model-item prop="label" label="市场活动名称">
               <a-input v-model="form.label" placeholder="请输入市场活动名称"/>
@@ -27,6 +29,8 @@
               <a-date-picker v-model="form.startDate" valueFormat="YYYY-MM-DD" style="width: 100%" placeholder="请选择回访日期"/>
             </a-form-model-item>
           </a-col>
+        </a-row>
+        <a-row>
           <a-col :md="12" :sm="24">
             <a-form-model-item prop="endDate" label="结束日期">
               <a-date-picker v-model="form.endDate" valueFormat="YYYY-MM-DD" style="width: 100%" placeholder="请选择回访日期"/>
@@ -34,29 +38,29 @@
           </a-col>
           <a-col :md="12" :sm="24">
             <a-form-model-item prop="orderId" label="采单人">
-              <a-select v-model="form.orderId" @select="handleSelectOrder" labelInValue placeholder="请选择意向度" default-value="0">
+              <a-select v-model="form.orderId" @select="handleSelectOrder" placeholder="请选择意向度" default-value="0">
               <!-- <a-select v-model="form.order" @select="handleSelectOrder" labelInValue placeholder="请选择意向度" default-value="0"> -->
-                <a-select-option value="0">全部</a-select-option>
-                <a-select-option value="1">关闭</a-select-option>
-                <a-select-option value="2">运行中</a-select-option>
+                <a-select-option :value="item.id" v-for="(item, index) in userList" :key="index" >{{ item.label }}</a-select-option>
               </a-select>
             </a-form-model-item>
           </a-col>
+        </a-row>
+        <a-row>
           <a-col :md="12" :sm="24">
             <a-form-model-item prop="typeId" label="活动类型">
-              <a-select v-model="form.typeId" labelInValue placeholder="请选择意向度" default-value="0">
+              <a-select v-model="form.typeId" placeholder="请选择意向度" default-value="0">
               <!-- <a-select v-model="form.type" labelInValue placeholder="请选择意向度" default-value="0"> -->
-                <a-select-option value="0">全部</a-select-option>
-                <a-select-option value="1">关闭</a-select-option>
-                <a-select-option value="2">运行中</a-select-option>
+                <a-select-option :value="item.id" v-for="(item, index) in typeList" :key="index" >{{ item.label }}</a-select-option>
               </a-select>
             </a-form-model-item>
           </a-col>
           <a-col :md="12" :sm="24">
             <a-form-model-item prop="address" label="地点">
-              <a-input v-model="form.address" placeholder="请输入市场活动名称"/>
+              <a-input v-model="form.address" placeholder="请输入地点"/>
             </a-form-model-item>
           </a-col>
+        </a-row>
+        <a-row>
           <a-col :md="12" :sm="24">
             <a-form-model-item prop="description" label="描述">
               <a-input v-model="form.description" placeholder="请输入描述"/>
@@ -66,7 +70,9 @@
             <a-form-model-item prop="departmentId" label="归属部门">
               <a-cascader  
                 :fieldNames="fieldNames"
-                :options="departList" 
+                changeOnSelect
+                :options="departList"
+                v-model="form.departmentId"
                 placeholder="请选择归属部门" 
                 @change="onChange" />
               <!-- <a-select v-model="form.departmentId" labelInValue placeholder="请选择意向度" default-value="0">
@@ -83,7 +89,8 @@
 </template>
 
 <script>
-import { getDepart } from '@/api/role';
+import { getDepart, searchUser } from '@/api/role';
+import { getConfig } from '@/api/basics';
 
 export default {
   props: {
@@ -117,14 +124,13 @@ export default {
         startDate: undefined,
         endDate: undefined,
         orderId: undefined,
-        orderLabel: undefined,
         typeId: undefined,
-        typeLabel: undefined,
         description: '',
         departmentId: undefined,
-        departmentLabel: undefined
       },
       departList: [],
+      userList: [],
+      typeList: [],
       fieldNames: { label: 'label', value: 'id', children: 'children' },
       rules: {
         label: [
@@ -156,6 +162,8 @@ export default {
     //   this.model && this.form.setFieldsValue(pick(this.model, fields))
     // })
     this.loaddepart();
+    this.loadUser();
+    this.loadConfig();
   },
   methods: {
     handleSelectOrder(value) {
@@ -169,6 +177,25 @@ export default {
         this.departList = JSON.parse(JSON.stringify(this.formatData(data))) || []
       }
     },
+    async loadUser() {
+      const { data, code } = await searchUser({
+        curPage: 1
+      });
+      if(code === 0) {
+        const { records } = data;
+        this.userList = records;
+      }
+    },
+    async loadConfig() {
+      const { data, code } = await getConfig({
+        curPage: 1,
+        type: 'CHANNELS'
+      });
+      if(code === 0) {
+        const { records } = data;
+        this.typeList = records;
+      }
+    },
     // 格式化数据,递归将空的children置为undefined
     formatData(data) {
       const that = this

+ 6 - 10
src/views/markting/modules/MemberForm.vue

@@ -75,7 +75,7 @@
               <a-date-picker v-model="form.id" format="YYYY-MM-DD"/>
             </a-form-model-item>
           </a-col>
-          <a-col span="12">
+          <!-- <a-col span="12">
             <a-form-model-item prop="id" label="民族">
               <a-input v-model="form.id" placeholder="请输入民族" />
             </a-form-model-item>
@@ -84,7 +84,7 @@
             <a-form-model-item prop="id" label="昵称">
               <a-input v-model="form.id" placeholder="请输入昵称" />
             </a-form-model-item>
-          </a-col>
+          </a-col> -->
         </a-row>
 
         <!-- 家长信息 -->
@@ -114,17 +114,17 @@
               </a-select>
             </a-form-model-item>
           </a-col>
-          <a-col span="12">
+          <!-- <a-col span="12">
             <a-form-model-item prop="id" label="QQ">
               <a-input v-model="form.id" placeholder="请输入QQ号码" />
             </a-form-model-item>
-          </a-col>
+          </a-col> -->
           <a-col span="12">
             <a-form-model-item prop="id" label="行业">
               <a-input v-model="form.id" placeholder="请输入行业" />
             </a-form-model-item>
           </a-col>
-          <a-col span="12">
+          <!-- <a-col span="12">
             <a-form-model-item prop="id" label="邮箱">
               <a-input v-model="form.id" placeholder="请输入邮箱" />
             </a-form-model-item>
@@ -133,7 +133,7 @@
             <a-form-model-item prop="id" label="固定电话">
               <a-input v-model="form.id" placeholder="请输入固定电话" />
             </a-form-model-item>
-          </a-col>
+          </a-col> -->
         </a-row>
 
         <!-- 来源 -->
@@ -197,10 +197,6 @@
 </template>
 
 <script>
-import pick from 'lodash.pick'
-
-// 表单字段
-const fields = ['description', 'id']
 
 export default {
   props: {