Просмотр исходного кода

Merge branch 'dev_v2' into feat-two

zh 2 лет назад
Родитель
Сommit
070d16e533

+ 7 - 3
src/mixin/print.js

@@ -216,6 +216,9 @@ export default {
     // 添加次数
     async addPrint(funcType = 'getDeliverDetail') {
       let ids = []
+      console.log(this.clonelData);
+      console.log(this.addIds);
+
       for (let i = this.clonelData.length; i > 0; i--) {
         const tempData = this.clonelData[i - 1].invoicePickBeans
         if (tempData.length) {
@@ -241,17 +244,18 @@ export default {
           }
           funcType = addPrints
         }
-
+        console.log(requestParams,'ddsd');
         const promise = await funcType(requestParams)
         // 清空当前克隆数据,避免重复添加次数
         this.clonelData = []
+        this.addIds =[]
         return promise
       } catch (error) {
-
         // console.error('添加打印次数失败')
         this.clonelData = []
+        this.addIds =[]
         // this.$errorMsg('添加打印次数失败' + JSON.stringify(requestParams))
-        return Promise.reject('系统提示:单被商家取消预约,请刷新页面,重新选择打印')
+        return Promise.reject(error.message)
       }
     },
     /**

+ 41 - 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,39 @@ 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])) {
+              this.tableSelection= []
+              this.$errorMsg(`单被商家取消预约,重新选择`)
+              return
+            }
           }
-        })
-      } else {
-        this.getOvalDateil()
-      }
+        } else {
+          this.tableSelection= []
+          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 => {
@@ -769,7 +792,9 @@ export default {
       })
     },
     refreshTableSelection() {
+     this.$refs.table.clearSelection()
       this.tableSelection = []
+      console.log(333,'清空');
     },
     async getNewDetailPrintDisString() {
       const params = []

+ 1 - 1
src/views/supply/pickup/components/design/preview.vue

@@ -144,7 +144,7 @@ export default {
       }
     },
     myConfirm(err) {
-      this.$confirm(err || '系统提示:单被商家取消预约,请刷新页面,重新选择打印', '提示', {
+      this.$confirm(err || '请刷新页面,重新选择打印', '提示', {
         showClose: false,
         confirmButtonText: '确定',
         showCancelButton: false,