Przeglądaj źródła

fix: 仓库提货确认

zh 2 lat temu
rodzic
commit
7059225e95
1 zmienionych plików z 38 dodań i 16 usunięć
  1. 38 16
      src/views/supply/pickup/check.vue

+ 38 - 16
src/views/supply/pickup/check.vue

@@ -442,6 +442,7 @@ import { getDealerList, getListCustomer } from '@/api/basic_data/dealer'
 import PickupPrint from '@/views/supply/pickup/components/pickup_print'
 
 import printPreview from './components/design/preview.vue'
+import { async } from 'q'
 
 export default {
   components: {
@@ -693,7 +694,12 @@ export default {
         logisticsId: this.screenForm.logisticsId,
         invoiceId: this.screenForm.invoiceId
       }
-      getPickupList(params).then(res => {
+      // getPickupList(params).then(res => {
+      //   this.dataList = res.data.records
+      //   this.listTotal = res.data.total
+      //   this.listLoading = false
+      // })
+      return getPickupList(params).then(res => {
         this.dataList = res.data.records
         this.listTotal = res.data.total
         this.listLoading = false
@@ -745,22 +751,38 @@ export default {
 
     // 点击打印
     async toPrint() {
-      const { data } = await this.getNewDetailPrintDisString()
-      if (data) {
-        this.$confirm(<p class='text'>{data}</p>, '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          customClass: 'text'
-        }).then(() => {
-          if (this.tableSelection[0].printNum) {
-            this.dialogForm.createMan = JSON.parse(localStorage.getItem('supply_user')).nickName
-            this.dialogForm.createDate = this.getDate()
-            this.isShowDialog = true
+      this.getList().then(async res => {
+        if (this.dataList.length) {
+          const ids = this.tableSelection.map(k => k.id)
+          for (let i = 0; i < ids.length; i++) {
+            console.log(this.dataList.some(e => e.id === ids[i]))
+            if (!this.dataList.some(e => e.id === ids[i])) {
+              console.log(333)
+              this.$errorMsg(`单被商家取消预约,请刷新页面,重新选择`)
+              return
+            }
           }
-        })
-      } else {
-        this.getOvalDateil()
-      }
+        } else {
+          this.$errorMsg(`单被商家取消预约,请刷新页面,重新选择`)
+          return
+        }
+        const { data } = await this.getNewDetailPrintDisString()
+        if (data) {
+          this.$confirm(<p class='text'>{data}</p>, '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            customClass: 'text'
+          }).then(() => {
+            if (this.tableSelection[0].printNum) {
+              this.dialogForm.createMan = JSON.parse(localStorage.getItem('supply_user')).nickName
+              this.dialogForm.createDate = this.getDate()
+              this.isShowDialog = true
+            }
+          })
+        } else {
+          this.getOvalDateil()
+        }
+      })
     },
     getOvalDateil() {
       this.getDateil(this.tableSelection, 'getDtailPrintDis', this.check).then(res => {