From be7e754d737d6c7a689465928117edb3aa02bad4 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期五, 24 十一月 2023 11:01:40 +0800
Subject: [PATCH] 销售明细单接口修改,确认订单和推送aps合并为同一个

---
 src/views/sales/salesDetails/AddSalesDetailsDialog.vue |    2 
 src/api/sales/salesDetails.js                          |   14 +-----
 src/views/sales/salesDetails/index.vue                 |   48 ++++++------------------
 3 files changed, 16 insertions(+), 48 deletions(-)

diff --git a/src/api/sales/salesDetails.js b/src/api/sales/salesDetails.js
index 5857dd7..466b229 100644
--- a/src/api/sales/salesDetails.js
+++ b/src/api/sales/salesDetails.js
@@ -54,14 +54,6 @@
     method: "get"
   })
 }
-// 鍒涘缓浜у搧鍑哄簱淇℃伅
-export function createOperation(data) {
-  return request({
-    url: "/api/salesDetails/createOperation",
-    method: "post",
-    data
-  })
-}
 // 娣诲姞閿�鍞槑缁�
 export function getProjectList(data) {
   return request({
@@ -70,10 +62,10 @@
     data
   })
 }
-// 鎺ㄩ�侀攢鍞槑缁嗕俊鎭埌aps椤圭洰妯″潡
-export function sendSalesDetailsToApsProject(data) {
+// 鎺ㄩ�侀攢鍞槑缁嗕俊鎭埌aps椤圭洰妯″潡 / 纭鎻愪氦
+export function sendSalesDetailsToOtherSystem(data) {
   return request({
-    url: "/api/salesDetails/sendSalesDetailsToApsProject",
+    url: "/api/salesDetails/sendSalesDetailsToOtherSystem",
     method: "post",
     data
   })
diff --git a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
index 30c0c34..de7e1ce 100644
--- a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
+++ b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -485,7 +485,7 @@
 <script>
 import CommonFormTableView from "@/components/makepager/CommonFormTableView"
 import { getAllData } from "@/api/client/client"
-import { getAddSalesDetails, getUpdateSalesDetails,getProjectList,sendSalesDetailsToApsProject } from "@/api/sales/salesDetails"
+import { getAddSalesDetails, getUpdateSalesDetails,getProjectList} from "@/api/sales/salesDetails"
 import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
 import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog"
 import AddCollectionPlan from "@/views/other/payment/collectionPlan/AddCollectionPlan"
diff --git a/src/views/sales/salesDetails/index.vue b/src/views/sales/salesDetails/index.vue
index ca149e8..1d267bb 100644
--- a/src/views/sales/salesDetails/index.vue
+++ b/src/views/sales/salesDetails/index.vue
@@ -155,10 +155,8 @@
   getProductInventoryInfo,
   getProductOrderInfo,
   updateStatus,
-  createOperation,
   getProjectList,
-  getUpdateSalesDetails,
-  sendSalesDetailsToApsProject
+  sendSalesDetailsToOtherSystem
 } from "@/api/sales/salesDetails"
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 import DetailSpecification from "@/views/sales/salesDetails/DetailSpecification"
@@ -410,7 +408,7 @@
                   ...item,
                   client_name: item.client.name,
                   member_name: item.Member.username,
-                  source: "CRM鍚屾"
+                  source: ""
                 }
               })
               this.tableList.tableInfomation = list || []
@@ -498,16 +496,12 @@
           ...row,
           status: 2
         }
-        await createOperation(params).then((res) => {
+        console.log(params,"鐪嬬湅params")
+        await sendSalesDetailsToOtherSystem(params).then((res)=>{
           if (res.code == 200) {
-            this.$message.success("纭鎻愪氦鎴愬姛")
+            this.$message.success("鎴愬姛鎺ㄩ�佽嚦aps绯荤粺")
             this.getData()
             this.thatRow.status=2
-            sendSalesDetailsToApsProject(this.thatRow).then((res)=>{
-              if(res.code===200){
-                this.$message.success("鎴愬姛鎺ㄩ�佽嚦aps绯荤粺")
-              }
-            })
           }
         })
       }
@@ -680,32 +674,14 @@
         if(valid){
           console.log()
           this.projectListShow=false
-          getUpdateSalesDetails({
-            id:this.thatRow.id,
-            salesDetails:params
-          }).then((res) => {
-            console.log(res)
-            this.editConfig.visible = false
-            if (res.code === 200) {
-              let params2 = {
-                ...this.thatRow,
-                status: 2
-              }
-              createOperation(params2).then((res) => {
-                if (res.code == 200) {
-                  this.$message.success("鎻愪氦鎴愬姛")
-                  this.getData()
-                  this.thatRow.status=2
-                  sendSalesDetailsToApsProject(this.thatRow).then((res)=>{
-                    if(res.code===200){
-                      this.$message.success("鎴愬姛鎺ㄩ�佽嚦aps绯荤粺")
-                    }
-                  })
-                }
-              })
+          console.log(params,"閫夋嫨椤圭洰鍚庣殑params")
+          params.status=2
+          sendSalesDetailsToOtherSystem(params).then((res)=>{
+            if (res.code == 200) {
+              this.$message.success("鎴愬姛鎺ㄩ�佽嚦aps绯荤粺")
+              this.getData()
+              this.thatRow.status=2
             }
-          }).catch((err)=>{
-            this.$message.error(`缂栬緫澶辫触:${err}`)
           })
         }
       })

--
Gitblit v1.8.0