From b07889e22f823fac80a66b503671e170668f4ee6 Mon Sep 17 00:00:00 2001
From: 陶杰 <1378534974@qq.com>
Date: 星期二, 10 十二月 2024 10:10:25 +0800
Subject: [PATCH] 1.供应商子账号
---
sub_pages/supplier/print/print-list.vue | 98 +++++++++++++++++++++++++++++-------------------
1 files changed, 59 insertions(+), 39 deletions(-)
diff --git a/sub_pages/supplier/print/print-list.vue b/sub_pages/supplier/print/print-list.vue
index a4e73c9..9acb176 100644
--- a/sub_pages/supplier/print/print-list.vue
+++ b/sub_pages/supplier/print/print-list.vue
@@ -69,7 +69,8 @@
</view>
<view class="print-container m-t-12">
- <button class="btn" type="primary" @click="startSearch" :loading="isScanning"> 开始搜索 </button>
+ <button class="btn" type="primary" @click="startSearch" :loading="isScanning">
+ 开始搜索({{buffs&&buffs.length || 0}}个) </button>
<button class="btn m-t-12" type="default" @click="breakPrint=true"> 中断打印 </button>
<view v-for="(device,index) of list" :key="device.deviceId" @click="bindViewTap(device)">
<view class="item">
@@ -135,7 +136,7 @@
// list[j] = i;
// j++
// }
-
+
// for (var i = 1; i < 10; i++) {
// numList[i - 1] = i
// }
@@ -145,51 +146,70 @@
that.oneTimeData = 20
// that.printNum = numList
// that.printerNum = numList[0]
-
+
},
- async onLoad() {
+ async onLoad(options) {
var t = this.$storage.getItem('cache_delivery_order_print') || ''
if (t) {
this.items = JSON.parse(t)
- var apitype = ''
+ var requrl = ''
// #ifdef PUB_SUPPLIER
- apitype = '/supplier'
- // #endif
- // #ifdef PUB_PARTNER
// apitype = '/supplier'
+ if (options.source == 'detail') {
+ requrl = `/api/supplier/delivery/list/items/views`
+
+ } else {
+ requrl = `/api/supplier/delivery/list/items/views/new`
+
+ }
+ // #endif
+ // #ifndef PUB_SUPPLIER
+ requrl = `/api/delivery/list/items/views`
// #endif
//获取详情接口
var ids = []
for (var item of this.items) {
- ids.push(item.id)
+ if (item.id)
+ ids.push(item.id)
}
- this.$message.showLoading()
- // const {
- // code,
- // data
- // } = await this.$http.request('get', `/api${apitype}/delivery/list/items/view`, {
- // params: {
- // id: this.item.id,
- // ids: ids
- // }
- // })
- const {
- code,
- data
- } = await this.$http.request('post', `/api${apitype}/delivery/list/items/views`, {
- data: {
- // id: this.item.id,
- ids: ids
+ if (ids.length > 0) {
+
+
+ this.$message.showLoading()
+ // const {
+ // code,
+ // data
+ // } = await this.$http.request('get', `/api${apitype}/delivery/list/items/view`, {
+ // params: {
+ // id: this.item.id,
+ // ids: ids
+ // }
+ // })
+ const {
+ code,
+ data
+ } = await this.$http.request('post', requrl, {
+ data: {
+ // id: this.item.id,
+ ids: ids
+ }
+ })
+ this.$message.hideLoading()
+ if (code == 0 && data && data.length > 0) {
+ // this.item = {
+ // ...this.item,
+ // ...data
+ // }
+ var tarr = []
+ for (var t of data) {
+ if (t) {
+ tarr.push(t)
+ }
+ }
+ if (tarr.length > 0)
+ this.items = tarr || []
+ console.log('items len:', this.items.length)
}
- })
- this.$message.hideLoading()
- if (code == 0 && data) {
- // this.item = {
- // ...this.item,
- // ...data
- // }
- this.items = data || []
- console.log('items len:', this.items.length)
}
} else {
this.$message.showToast('获取详情失败')
@@ -563,7 +583,7 @@
}
command.setText(30, 40, "TSS24.BF2", 1, 1, "" + (each.supplierName || '-'))
command.setText(200, 40, "TSS24.BF2", 1, 1, "" + (each.warehouseName || '待分配'))
- var flowerCategory = each.flowerCategory
+ var flowerCategory = each.flowerCategory || ''
if (flowerCategory) {
//只取二级分类
var tarr = flowerCategory.split("/")
@@ -756,9 +776,9 @@
that.currentTime = 1
// that.Send(that.buffs[that.currentPrint - 1])
that.prepareSend(that.buffs[that.currentPrint - 1])
-
-
- }, 500)
+
+
+ }, 800)
}
--
Gitblit v1.9.3