瀏覽代碼

feature:添加客户领取说明

liuyaqi 3 年之前
父節點
當前提交
6834144362
共有 3 個文件被更改,包括 129 次插入48 次删除
  1. 69 0
      src/views/customer/components/Pick.vue
  2. 30 24
      src/views/customer/detail.vue
  3. 30 24
      src/views/customer/openSea.vue

+ 69 - 0
src/views/customer/components/Pick.vue

@@ -0,0 +1,69 @@
+<!--
+ * @Author: wanglj 471442253@qq.com
+ * @Date: 2022-12-26 14:34:34
+ * @LastEditors: wanglj
+ * @LastEditTime: 2023-01-13 09:41:38
+ * @Description: file content
+ * @FilePath: \opms_frontend\src\views\customer\components\allocate.vue
+-->
+<template>
+  <el-dialog title="领取客户" :visible.sync="visible" width="50%" @close="handleClose">
+    <el-form label-width="80px" :model="form">
+      <el-form-item label="申请说明">
+        <el-input
+          v-model="form.remark"
+          maxlength="500"
+          placeholder="请输入申请说明"
+          resize="none"
+          :rows="5"
+          show-word-limit
+          type="textarea" />
+      </el-form-item>
+    </el-form>
+    <span slot="footer">
+      <el-button size="mini" type="primary" @click="handleSubmit">确定</el-button>
+      <el-button size="mini" @click="visible = false">取消</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import api from '@/api/customer'
+  import to from 'await-to-js'
+  export default {
+    components: {},
+    data() {
+      return {
+        visible: false,
+        innerVisible: false,
+        form: {
+          remark: '',
+        },
+        ids: [],
+      }
+    },
+    methods: {
+      handleClose() {
+        this.form.allocate = ''
+        this.userList = []
+      },
+      async handleSubmit() {
+        if (!this.form.remark) return this.$message.warning('请输入申请说明')
+        let params = {
+          ids: this.ids,
+          salesId: this.$store.state.user.id,
+          salesName: this.$store.state.user.nickName,
+          receive: '1',
+          applyRemark: this.form.remark,
+        }
+        const [err, res] = await to(api.receiveCustomer(params))
+        if (err) return
+        this.$message.success(res.msg)
+        this.visible = false
+        this.$emit('refresh')
+      },
+    },
+  }
+</script>
+
+<style></style>

+ 30 - 24
src/views/customer/detail.vue

@@ -315,6 +315,8 @@
     <FollowDetail ref="followDetail" />
     <!-- 添加项目 -->
     <Businessedit ref="businessedit" :cust-info="custInfo" @fetch-data="getBusiness" />
+    <!-- 领取客户 -->
+    <Pick ref="pick" @refresh="fetchData" />
   </div>
 </template>
 
@@ -333,6 +335,7 @@
   import ToOpen from './components/ToOpen'
   import FollowDetail from './components/FollowDetail'
   import Businessedit from '../proj/business/components/BusinessEdit'
+  import Pick from './components/Pick'
 
   export default {
     name: 'CustomerDetail',
@@ -341,6 +344,7 @@
       Contact,
       Allocate,
       Shift,
+      Pick,
       ToOpen,
       FollowDetail,
       Businessedit,
@@ -540,30 +544,32 @@
       },
       // 领取
       handleReceive() {
-        this.$confirm('确认领取客户?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning',
-        })
-          .then(async () => {
-            const [err, res] = await to(
-              api.receiveCustomer({
-                ids: [parseInt(this.id)],
-                salesId: this.$store.state.user.id,
-                salesName: this.$store.state.user.nickName,
-                receive: '1',
-              })
-            )
-            if (err) return
-            if (res.code == 200) {
-              this.$message({
-                type: 'success',
-                message: '领取成功!',
-              })
-              this.$router.push('/customer/list')
-            }
-          })
-          .catch(() => {})
+        this.$refs.pick.ids = [parseInt(this.id)]
+        this.$refs.pick.visible = true
+        // this.$confirm('确认领取客户?', '提示', {
+        //   confirmButtonText: '确定',
+        //   cancelButtonText: '取消',
+        //   type: 'warning',
+        // })
+        //   .then(async () => {
+        //     const [err, res] = await to(
+        //       api.receiveCustomer({
+        //         ids: [parseInt(this.id)],
+        //         salesId: this.$store.state.user.id,
+        //         salesName: this.$store.state.user.nickName,
+        //         receive: '1',
+        //       })
+        //     )
+        //     if (err) return
+        //     if (res.code == 200) {
+        //       this.$message({
+        //         type: 'success',
+        //         message: '领取成功!',
+        //       })
+        //       this.$router.push('/customer/list')
+        //     }
+        //   })
+        //   .catch(() => {})
       },
       handleAllocate() {
         this.$refs.allocate.ids = [parseInt(this.id)]

+ 30 - 24
src/views/customer/openSea.vue

@@ -146,6 +146,8 @@
     <Contact ref="contact" />
     <!-- 分配客户 -->
     <Allocate ref="allocate" @refresh="fetchData" />
+    <!-- 领取客户 -->
+    <Pick ref="pick" @refresh="fetchData" />
   </div>
 </template>
 
@@ -155,6 +157,7 @@
   import Contact from './components/Contact'
   import Edit from './components/Edit'
   import Allocate from './components/Allocate'
+  import Pick from './components/Pick'
   import TableTool from '@/components/table/TableTool'
   import downloadFileByByte from '@/utils/base64ToFile'
   export default {
@@ -163,6 +166,7 @@
       Contact,
       Edit,
       Allocate,
+      Pick,
       TableTool,
     },
     data() {
@@ -395,31 +399,33 @@
       handleReceive() {
         if (!this.selectRows.length) return this.$message.warning('请选择客户')
         const arr = this.selectRows.map((item) => item.id)
+        this.$refs.pick.ids = arr
+        this.$refs.pick.visible = true
 
-        this.$confirm('确认领取客户?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning',
-        })
-          .then(async () => {
-            const [err, res] = await to(
-              api.receiveCustomer({
-                ids: arr,
-                salesId: this.$store.state.user.id,
-                salesName: this.$store.state.user.nickName,
-                receive: '1',
-              })
-            )
-            if (err) return
-            if (res.code == 200) {
-              this.$message({
-                type: 'success',
-                message: '领取成功!',
-              })
-              this.fetchData()
-            }
-          })
-          .catch((err) => console.log(err))
+        // this.$confirm('确认领取客户?', '提示', {
+        //   confirmButtonText: '确定',
+        //   cancelButtonText: '取消',
+        //   type: 'warning',
+        // })
+        //   .then(async () => {
+        //     const [err, res] = await to(
+        //       api.receiveCustomer({
+        //         ids: arr,
+        //         salesId: this.$store.state.user.id,
+        //         salesName: this.$store.state.user.nickName,
+        //         receive: '1',
+        //       })
+        //     )
+        //     if (err) return
+        //     if (res.code == 200) {
+        //       this.$message({
+        //         type: 'success',
+        //         message: '领取成功!',
+        //       })
+        //       this.fetchData()
+        //     }
+        //   })
+        //   .catch((err) => console.log(err))
       },
     },
   }