lvkun996 3 weeks ago
parent
commit
192ebdd5bc

+ 4 - 4
src/App.vue

@@ -7,8 +7,8 @@
 </template>
 
 <script>
-import { domTitle, setDocumentTitle } from '@/utils/domUtil'
-import { i18nRender } from '@/locales'
+// import { domTitle, setDocumentTitle } from '@/utils/domUtil'
+// import { i18nRender } from '@/locales'
 
 export default {
   data () {
@@ -18,8 +18,8 @@ export default {
   computed: {
     locale () {
       // 只是为了切换语言时,更新标题
-      const { title } = this.$route.meta
-      title && (setDocumentTitle(`${i18nRender(title)} - ${domTitle}`))
+      // const { title } = this.$route.meta
+      // title && (setDocumentTitle(`${i18nRender(title)} - ${domTitle}`))
 
       return this.$i18n.getLocaleMessage(this.$store.getters.lang).antLocale
     }

+ 21 - 0
src/api/markting.js

@@ -9,6 +9,13 @@ export function getMarketActivityList (params) {
   })
 }
 
+export function delMarketActivityById (id) {
+  return request({
+    url: `sale/market/${id}`,
+    method: 'DELETE'
+  })
+}
+
 // 新建或保存市场活动
 export function saveOrUptMarketActivity (data) {
   return request({
@@ -62,6 +69,12 @@ export function getTnternational (params) {
   })
 }
 
+export function delTnternationalById (id) {
+  return request({
+    url: `/sale/${id}`,
+    method: 'DELETE'
+  })
+}
 // 捞取销售线索
 export function takeleads (data) {
   return request({
@@ -90,6 +103,14 @@ export function postLeads (data) {
   })
 }
 
+export function updateLeads (data) {
+  return request({
+    url: `/sale/leads`,
+    method: 'PUT',
+    data
+  })
+}
+
 // 查询线索详情  // type 为student 或者为 leads
 export function getLeadsDetail (id, type) {
   return request({

+ 1 - 1
src/components/Table/index.js

@@ -33,7 +33,7 @@ export default {
     },
     showSizeChanger: {
       type: Boolean,
-      default: true
+      default: false
     },
     size: {
       type: String,

+ 0 - 1
src/config/router.config.js

@@ -18,7 +18,6 @@ export const asyncRouterMap = [
       {
         path: '/markting',
         component: RouteView,
-        redirect: '/markting/seas',
         name: 'Markting',
         meta: { title: '销售管理', icon: 'user', keepAlive: true, permission: [ '/markting' ] },
         children: [

+ 0 - 1
src/permission.js

@@ -7,7 +7,6 @@ import notification from 'ant-design-vue/es/notification'
 import asyncRouterMap from '@/config/router.config' // 需要处理的路由
 import { setDocumentTitle, domTitle } from '@/utils/domUtil'
 import { ACCESS_TOKEN } from '@/store/mutation-types'
-import { i18nRender } from '@/locales'
 import { _token } from '@/utils/global'
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
 

+ 2 - 2
src/views/account-old/center/index.vue

@@ -28,7 +28,7 @@
           <div class="account-center-tags">
             <div class="tagsTitle">标签</div>
             <div>
-              <template v-for="(tag, index) in tags">
+              <span v-for="(tag, index) in tags" :key="index">
                 <a-tooltip v-if="tag.length > 20" :key="tag" :title="tag">
                   <a-tag
                     :key="tag"
@@ -42,7 +42,7 @@
                   :closable="index !== 0"
                   :close="() => handleTagClose(tag)"
                 >{{ tag }}</a-tag>
-              </template>
+              </span>
               <a-input
                 v-if="tagInputVisible"
                 ref="tagInput"

+ 25 - 3
src/views/markting/active/list.vue

@@ -44,8 +44,8 @@
         :columns="columns"
         :data="loadData"
         :alert="false"
-        :rowSelection="rowSelection"
-        showPagination="auto">
+        :showPagination="false"
+      >
         <span @click="handleInfo(record)" slot="label" slot-scope="text, record">
           <span class="link-text">{{ text }}</span>
         </span>
@@ -55,6 +55,14 @@
         <span slot="description" slot-scope="text">
           <ellipsis :length="4" tooltip>{{ text }}</ellipsis>
         </span>
+        <span slot="action" slot-scope="text, record">
+          <a-popconfirm
+            title="确定删除吗?"
+            @confirm="handleDelete(record.id)"
+          >
+            <a>删除</a>
+          </a-popconfirm>
+        </span>
       </s-table>
 
       <!-- 分配 -->
@@ -72,7 +80,7 @@
 
 <script>
 import { STable, Ellipsis } from '@/components'
-import { getMarketActivityList, saveOrUptMarketActivity } from '@/api/markting'
+import { getMarketActivityList, saveOrUptMarketActivity, delMarketActivityById } from '@/api/markting'
 import ActiveForm from '../modules/ActiveForm'
 
 const columns = [
@@ -108,6 +116,11 @@ const columns = [
   {
     title: '创建时间',
     dataIndex: 'createTime'
+  },
+  {
+    title: '操作',
+    dataIndex: 'action',
+    scopedSlots: { customRender: 'action' }
   }
 ]
 
@@ -186,6 +199,15 @@ export default {
 
   },
   methods: {
+    async handleDelete (id) {
+      const { code } = await delMarketActivityById(id)
+      if (code === 0) {
+        this.$message.info('删除成功')
+        this.$refs.table.refresh()
+      } else {
+        this.$message.error('删除失败')
+      }
+    },
     handleAdd () {
       this.visible = true
     },

+ 29 - 6
src/views/markting/leads/list.vue

@@ -207,7 +207,10 @@
         :data-source="leadsList"
         :alert="false"
         :rowSelection="rowSelection"
-        showPagination="auto">
+        showPagination="auto"
+        :pagination="queryParam"
+        @change="onChange"
+      >
         <!-- <template slot="babyName" slot-scope="text, record">
           <span class="babyName cp" >{{ text }}</span>
         </template> -->
@@ -232,6 +235,8 @@
             <a @click="handlePre(record)" v-action:1004007>转为试听</a>
             <a-divider type="vertical" />
             <a @click="handleSub(record)" v-action:1004008>购课</a>
+            <a-divider type="vertical" />
+            <a @click="handleUpdate(record)" v-action:1004008>编辑</a>
           </template>
         </span>
       </a-table>
@@ -277,6 +282,7 @@
       :curData="curData"
       :followerState="followerState"
       :intention="INTENTION"
+      @success="getSaleLeadsList"
     />
     <!-- /添加记录 -->
     <!-- 转为试听 -->
@@ -289,7 +295,7 @@
 
 <script>
 
-import { getSaleLeadsList, getLeadsCount, getMarketActivityList, deleteLeads, sendbackLeads } from '@/api/markting'
+import { getSaleLeadsList, getLeadsCount, getMarketActivityList, deleteLeads, sendbackLeads, getLeadsDetail } from '@/api/markting'
 import { searchUser } from '@/api/role'
 import { getConfig } from '@/api/basics'
 import { basicSellTab } from '@/utils/global'
@@ -342,7 +348,7 @@ const columns = [
     dataIndex: 'followTime'
   },
   {
-    title: '回访时间',
+    title: '回访时间',
     dataIndex: 'callbackTime'
   },
   {
@@ -502,7 +508,10 @@ export default {
         'intentionId': '',
         'label': '',
         'orderId': '',
-        'state': ''
+        'state': '',
+        page: 0,
+        total: 0,
+        pageSize: 10
       },
       leadsList: [],
       loading: false,
@@ -548,6 +557,17 @@ export default {
     }
   },
   methods: {
+    async handleUpdate (record) {
+      const { data } = await getLeadsDetail(record.id, 'leads')
+      this.$refs.createModal.visible = true
+      this.$refs.createModal.opraType = 'update'
+      this.$refs.createModal.formData = data
+    },
+    onChange ({ current }) {
+      console.log(current)
+      this.queryParam.curPage = current
+      this.getSaleLeadsList()
+    },
     // 线索详情
     goleadsDetailPage (records) {
       this.$router.push({
@@ -616,6 +636,7 @@ export default {
         console.log(data, 'hello world')
         const { records } = data
         this.leadsList = records
+        this.queryParam.total = data.total
       }
     },
     toggleAdvanced () {
@@ -705,7 +726,7 @@ export default {
           okType: 'danger',
           okText: '删除',
           cancelText: '取消',
-          onOk () {
+          onOk: () => {
             console.log('OK')
             // 在这里调用删除接口
 
@@ -716,6 +737,7 @@ export default {
                 data ? this.$message.success('删除成功') : this.$message.success('删除失败')
                 resolve(data)
                 this.selectedRowKeys = []
+                this.getSaleLeadsList()
               }
             }).catch(() => console.log('Oops errors!'))
           },
@@ -729,6 +751,7 @@ export default {
     addLeads () {
       console.log(this.$refs.createModal.$options.data().formData)
       this.$refs.createModal.visible = true
+        this.$refs.createModal.opraType = 'add'
       this.$refs.createModal.formData = this.$refs.createModal.$options.data().formData
     },
     // 退回公海池
@@ -741,7 +764,7 @@ export default {
           content: `确定要将选择的线索退回公海池?`,
           okText: '确定',
           cancelText: '取消',
-          onOk () {
+          onOk: () => {
             console.log('OK')
             // 在这里调用删除接口
 

+ 4 - 3
src/views/markting/modules/AddLeads.vue

@@ -49,7 +49,7 @@
             <a-radio :value="false">关</a-radio>
           </a-radio-group>
         </a-form-model-item>
-        <a-form-model-item prop="callbackDate" label="回访日期">
+        <a-form-model-item prop="callbackTime" label="回访日期">
           <a-date-picker formData="YYYY-MM-DD" @change="changeCallbackDate" style="width: 100%" placeholder="请选择回访日期"/>
         </a-form-model-item>
         <a-form-model-item prop="callbackType" label="回访方式">
@@ -110,7 +110,7 @@ export default {
     }
     return {
       form: {
-        'callbackDate': '',
+        'callbackTime': '',
         'callbackTheme': '',
         'callbackType': '',
         'enableCallback': true,
@@ -179,11 +179,12 @@ export default {
       if (code === 0) {
         console.log(data)
         this.$message.success('操作成功')
+        this.$emit('success')
       }
       this.visible = false
     },
     changeCallbackDate (date, dateStr) {
-      this.form.callbackDate = dateStr
+      this.form.callbackTime = dateStr
     }
   }
 }

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

@@ -1,6 +1,6 @@
 <template>
   <a-modal
-    title="新建名单"
+    :title="'opraType' === 'add' ? '新建名单' : '编辑名单'"
     width="50%"
     :visible="visible"
     :confirmLoading="loading"
@@ -39,7 +39,7 @@
             </a-form-model-item>
           </a-col>
           <a-col span="12">
-            <a-form-model-item prop="id" label="销售负责人">
+            <a-form-model-item prop="saleId" label="销售负责人">
               <a-select
                 show-search
                 :filter-option="filterOption"
@@ -103,8 +103,10 @@
           <a-col span="12">
             <a-form-model-item prop="name" label="生日">
               <a-date-picker
+                :value="formData.babyBirthday"
                 @change="babyBirthdayChange"
-                format="YYYY-MM-DD"/>
+                format="YYYY-MM-DD"
+              />
             </a-form-model-item>
           </a-col>
         </a-row>
@@ -128,7 +130,7 @@
             <a-form-model-item prop="parentsPhone" label="手机号码">
               <a-input
                 placeholder="请输入家长手机号"
-                v-model="formData.parentsPhone" />
+                v-model.trim="formData.parentsPhone" />
             </a-form-model-item>
           </a-col>
           <a-col span="12">
@@ -218,7 +220,7 @@
           </a-row>
           <a-row>
             <a-col span="12">
-              <a-form-model-item prop="name" label="市场活动名称">
+              <a-form-model-item prop="marketActivityId" label="市场活动名称">
                 <a-select
                   show-search
                   :filter-option="filterOption"
@@ -236,7 +238,7 @@
               </a-form-model-item>
             </a-col>
             <a-col span="12">
-              <a-form-model-item prop="name" label="推广渠道">
+              <a-form-model-item prop="channelId" label="推广渠道">
                 <a-select
                   show-search
                   :filter-option="filterOption"
@@ -269,7 +271,7 @@
 </template>
 
 <script>
-import { postLeads } from '@/api/markting'
+import { postLeads, updateLeads } from '@/api/markting'
 export default {
   name: 'MemberForm',
   props: {
@@ -317,6 +319,7 @@ export default {
       }
     }
     return {
+      opraType: 'add',
       visible: false,
       loading: false,
       labelCol: {
@@ -358,7 +361,10 @@ export default {
         parentsPhone: [
           { required: true, message: '请填写家长手机号' },
           { min: 11, max: 11, message: '请填写正确手机号', trigger: 'blur' }
-        ]
+        ],
+        marketActivityId: { required: true, message: '请选择市场活动' },
+        saleId: { required: true, message: '请选择负责销售人' },
+        channelId: { required: true, message: '请选择推广渠道' }
       }
     }
   },
@@ -386,11 +392,11 @@ export default {
         { orderLabel }, { intentionLabel }, { saleLabel }, { sourceLabel }
        )
        this.loading = true
-      const { code, data } = await postLeads($par)
+      const { code, data } = this.opraType === 'add' ? await postLeads($par) : await updateLeads($par)
        this.loading = false
       if (code === 0) {
         console.log(data)
-        this.$message.success('新增成功')
+        this.opraType === 'add' ? this.$message.success('新增成功') : this.$message.success('修改成功')
         this.$emit('success')
       }
       this.visible = false

+ 32 - 7
src/views/markting/seas/list.vue

@@ -85,6 +85,8 @@
         :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
         :columns="columns"
         :data-source="seasList"
+        :pagination="queryParam"
+        @change="onChange"
       >
         <template slot="babyGender" slot-scope="text">
           <a-icon
@@ -102,11 +104,12 @@
           {{ text | filtersImportant }}
         </template>
         <span slot="action" slot-scope="text, record">
-          <a>Invite 一 {{ record.name }}</a>
-          <a-divider type="vertical" />
-          <a>Delete</a>
-          <a-divider type="vertical" />
-          <a class="ant-dropdown-link"> More actions <a-icon type="down" /> </a>
+          <a-popconfirm
+            title="确定删除吗?"
+            @confirm="handleDelete(record.id)"
+          >
+            <a>删除</a>
+          </a-popconfirm>
         </span>
       </a-table>
       <!-- 分配 -->
@@ -154,7 +157,7 @@
 import moment from 'moment'
 import { STable, Ellipsis } from '@/components'
 import { getConfig } from '@/api/basics'
-import { getTnternational, takeleads, alloLeads } from '@/api/markting'
+import { getTnternational, takeleads, alloLeads, delTnternationalById } from '@/api/markting'
 import { searchUser } from '@/api/role'
 const columns = [
   {
@@ -211,6 +214,12 @@ const columns = [
   {
     title: '推广渠道',
     dataIndex: 'channelLabel'
+  },
+  {
+    title: '操作',
+    dataIndex: 'action',
+    key: 'action',
+    scopedSlots: { customRender: 'action' }
   }
 ]
 
@@ -279,7 +288,8 @@ export default {
         channelId: '',
         orderLabel: '',
         label: '',
-        followState: ''
+        followState: '',
+        total: 0
       },
       seasList: [], // 表格数据
       selectedRowKeys: [],
@@ -324,6 +334,20 @@ export default {
 
   methods: {
     moment,
+    onChange ({ current }) {
+      console.log(current)
+      this.queryParam.curPage = current
+      this.searchInternational()
+    },
+    async handleDelete (id) {
+      const { code } = await delTnternationalById(id)
+      if (code === 0) {
+        this.$message.info('删除成功')
+        this.searchInternational()
+      } else {
+        this.$message.error('删除失败')
+      }
+    },
     // 分配线索
     async alloLeads () {
       const $par = {
@@ -408,6 +432,7 @@ export default {
         console.log(data)
         const { records } = data
         this.seasList = records
+        this.queryParam.total = data.total
       }
     },
     toggleAdvanced () {

+ 20 - 25
vue.config.js

@@ -19,28 +19,22 @@ function getGitHash () {
 
 const isProd = process.env.NODE_ENV === 'production'
 
-const assetsCDN = {
-  // webpack build externals
-  externals: {
-    vue: 'Vue',
-    'vue-router': 'VueRouter',
-    vuex: 'Vuex',
-    axios: 'axios'
-  },
-  css: [],
-  // https://unpkg.com/browse/vue@2.6.10/
-  js: [
-    '//cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js',
-    '//cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js',
-    '//cdn.jsdelivr.net/npm/vuex@3.1.1/dist/vuex.min.js',
-    '//cdn.jsdelivr.net/npm/axios@0.19.0/dist/axios.min.js'
-  ]
-}
+// const assetsCDN = {
+//   // webpack build externals
+//   externals: {
+//     vue: 'Vue',
+//     'vue-router': 'VueRouter',
+//     vuex: 'Vuex',
+//     axios: 'axios'
+//   },
+//   css: []
+// }
 
 // vue.config.js
 const vueConfig = {
   assetsDir: '',
   publicPath: './',
+  productionSourceMap: true,
   configureWebpack: {
     // webpack plugins
     plugins: [
@@ -51,9 +45,9 @@ const vueConfig = {
         GIT_HASH: JSON.stringify(getGitHash()),
         BUILD_DATE: buildDate
       })
-    ],
+    ]
     // if prod, add externals
-    externals: isProd ? assetsCDN.externals : {}
+    // externals: isProd ? assetsCDN.externals : {}
   },
 
   chainWebpack: (config) => {
@@ -79,10 +73,11 @@ const vueConfig = {
     // if prod is on
     // assets require on cdn
     if (isProd) {
-      config.plugin('html').tap(args => {
-        args[0].cdn = assetsCDN
-        return args
-      })
+      // config.plugin('html').tap(args => {
+      //   args[0].cdn = assetsCDN
+      //   return args
+      // })
+      config.devtool = 'source-map'
     }
   },
 
@@ -109,9 +104,9 @@ const vueConfig = {
     proxy: {
       '/api': {
         // target: 'http://192.168.1.21:39090',
-        // target: 'http://192.168.1.198:39090',
+        target: 'http://192.168.1.204:39090//town-crm',
         // target: 'https://open.luojigou.vip/town-crm',
-        target: 'https://open.api.luojigou.vip/town-crm',
+        // target: 'https://open.api.luojigou.vip/town-crm',
         ws: false,
         secure: false,
         changeOrigin: true,