Bladeren bron

feat(销售管理): 添加批量推送功能

liujt 6 maanden geleden
bovenliggende
commit
4ddc454630

+ 9 - 0
src/api/saleManage/contact.js

@@ -345,6 +345,15 @@ export async function getBpmCustomFormList(query) {
     params: query
   });
 
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}  
+
+// 推送
+export async function customerAdd(data) {
+  const res = await request.post('/port/Jd/customerAdd', data);
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 9 - 0
src/api/saleManage/saleorder.js

@@ -199,4 +199,13 @@ export async function getProductPrice(id) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
+}
+
+// 推送
+export async function saleOrderAdd(data) {
+  const res = await request.post('/port/Jd/saleOrderAdd', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }

+ 19 - 1
src/views/saleManage/contact/contactList.vue

@@ -79,6 +79,16 @@
               apiUrl="/eom/contact/export"
               :params="params"
             ></exportButton>
+            <el-button
+              v-if="$hasPermission('eom:contact:push')"
+              size="small"
+              type="primary"
+              class="ele-btn-icon"
+              @click="allPushBtn"
+              :disabled="selection?.length === 0"
+            >
+              批量推送
+            </el-button>
           </template>
 
           <template v-slot:name="{ row }">
@@ -167,7 +177,8 @@
     contactDelete,
     contactPage,
     contactTypeTree,
-    updateStatus
+    updateStatus,
+    customerAdd
   } from '@/api/saleManage/contact';
   import dictMixins from '@/mixins/dictMixins';
   import drawer from './components/drawer.vue';
@@ -392,6 +403,13 @@
         };
         return contactPage(this.params);
       },
+      allPushBtn() {
+        const dataId = this.selection.map((v) => v.id);
+        customerAdd(dataId).then((res) => {
+          this.$message.success('推送成功!');
+          this.reload();
+        });
+      },
       async getTreeData() {
         try {
           this.treeLoading = true;

+ 19 - 1
src/views/saleManage/contact/contactListAdmin.vue

@@ -89,6 +89,16 @@
               apiUrl="/eom/contact/export"
               :params="params"
             ></exportButton>
+            <el-button
+              v-if="$hasPermission('eom:contact:push')"
+              size="small"
+              type="primary"
+              class="ele-btn-icon"
+              @click="allPushBtn"
+              :disabled="selection?.length === 0"
+            >
+              批量推送
+            </el-button>
           </template>
           <template v-slot:qrCode="{ row }">
             <el-link type="primary" :underline="false" @click="setCode(row)">
@@ -232,7 +242,8 @@
     contactPage,
     contactTypeTree,
     updateStatus,
-    free
+    free,
+    customerAdd
   } from '@/api/saleManage/contact';
   import dictMixins from '@/mixins/dictMixins';
   import drawer from './components/drawer.vue';
@@ -471,6 +482,13 @@
         };
         return contactPage(this.params);
       },
+      allPushBtn() {
+        const dataId = this.selection.map((v) => v.id);
+        customerAdd(dataId).then((res) => {
+          this.$message.success('推送成功!');
+          this.reload();
+        });
+      },
       async getTreeData() {
         try {
           this.treeLoading = true;

+ 7 - 5
src/views/saleManage/contact/index.vue

@@ -81,7 +81,8 @@
                 >
                   批量删除
                 </el-button>
-                <!-- <el-button
+                <el-button
+                  v-if="$hasPermission('eom:contact:push')"
                   size="small"
                   type="primary"
                   class="ele-btn-icon"
@@ -89,7 +90,7 @@
                   :disabled="selection?.length === 0"
                 >
                   批量推送
-                </el-button> -->
+                </el-button>
               </template>
 
               <template v-slot:name="{ row }">
@@ -248,7 +249,8 @@
     contactPage,
     contactTypeTree,
     updateStatus,
-    contactDetail
+    contactDetail,
+    customerAdd
   } from '@/api/saleManage/contact';
   import dictMixins from '@/mixins/dictMixins';
 
@@ -574,8 +576,8 @@
       },
       allPushBtn() {
         const dataId = this.selection.map((v) => v.id);
-        contactDelete(dataId).then((res) => {
-          this.$message.success('删除成功!');
+        customerAdd(dataId).then((res) => {
+          this.$message.success('推送成功!');
           this.reload();
         });
       },

+ 21 - 1
src/views/saleManage/saleOrder/index.vue

@@ -94,6 +94,17 @@
                   apiUrl="/eom/saleorder/export"
                   :params="params"
                 ></exportButton>
+
+                <el-button
+                  v-if="$hasPermission('eom:contact:push')"
+                  size="small"
+                  type="primary"
+                  class="ele-btn-icon"
+                  @click="allPushBtn"
+                  :disabled="selection?.length === 0"
+                >
+                  批量推送
+                </el-button>
                 <!-- <el-button
                   :disabled="selection?.length === 0"
                   type="primary"
@@ -413,7 +424,8 @@ import {
   saleOrderReminder,
   getByRepeatBomAttribute,
   saveOrderBomList,
-  updateOrderInfo
+  updateOrderInfo,
+  saleOrderAdd
 } from '@/api/saleManage/saleorder';
 import { getToDoReminder } from '@/api/common/index';
 import { exportSaleorder } from '@/api/system/file/index.js';
@@ -969,6 +981,14 @@ export default {
       }
     },
 
+    allPushBtn() {
+      const dataId = this.selection.map((v) => v.id);
+      saleOrderAdd(dataId).then((res) => {
+        this.$message.success('推送成功!');
+        this.reload();
+      });
+    },
+
     invoiceAll() {
       let partaIds = this.selection.map((item) => item.partaId);
       if (new Set(partaIds).size != 1) {