|
|
@@ -193,24 +193,41 @@ const orderList = computed(() => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
-// 计算总数
|
|
|
-const calculateCount = (key, compareValue = null) => {
|
|
|
+//订单产品总数
|
|
|
+const orderBarcodeCount = computed(() => {
|
|
|
return dataList.value.reduce((sum, item) => {
|
|
|
- if (item.qtyOrdered === compareValue) {
|
|
|
- return sum + Number(item[key])
|
|
|
+ if (item.qtyOrdered != null) {
|
|
|
+ return sum + Number(item.oldQty)
|
|
|
}
|
|
|
return sum
|
|
|
}, 0)
|
|
|
-}
|
|
|
-
|
|
|
-// 订单产品总数
|
|
|
-const orderBarcodeCount = computed(() => calculateCount('oldQty', null))
|
|
|
-
|
|
|
-// 扫描订单产品总数
|
|
|
-const scanOrderBarcodeCount = computed(() => calculateCount('oldQuantity', null))
|
|
|
-
|
|
|
-// 耗材总数
|
|
|
-const materialCount = computed(() => calculateCount('oldQty', undefined))
|
|
|
+})
|
|
|
+//扫描订单产品总数
|
|
|
+const scanOrderBarcodeCount = computed(() => {
|
|
|
+ return dataList.value.reduce((sum, item) => {
|
|
|
+ if (item.qtyOrdered != null) {
|
|
|
+ return sum + Number(item.oldQuantity)
|
|
|
+ }
|
|
|
+ return sum
|
|
|
+ }, 0)
|
|
|
+})
|
|
|
+//耗材总数
|
|
|
+const materialCount = computed(() => {
|
|
|
+ return dataList.value.reduce((sum, item) => {
|
|
|
+ if (item.qtyOrdered == null) {
|
|
|
+ return sum + Number(item.oldQty)
|
|
|
+ }
|
|
|
+ return sum
|
|
|
+ }, 0)
|
|
|
+})
|
|
|
+const scanMaterialCount = computed(() => {
|
|
|
+ return dataList.value.reduce((sum, item) => {
|
|
|
+ if (item.qtyOrdered == null) {
|
|
|
+ return sum + Number(item.quantity)
|
|
|
+ }
|
|
|
+ return sum
|
|
|
+ }, 0)
|
|
|
+})
|
|
|
//匹配条码
|
|
|
const matchBarcodeList = ref([])
|
|
|
//扣除数量
|
|
|
@@ -417,6 +434,9 @@ const setPrinter=()=>{
|
|
|
printerRef.value?.show(warehouse)
|
|
|
}
|
|
|
const printer=ref(null)
|
|
|
+if(localStorage.getItem('check-print')){
|
|
|
+ printer.value=JSON.parse(localStorage.getItem('check-print'))
|
|
|
+}
|
|
|
const print=(templateCode,code)=>{
|
|
|
if(!printer.value){
|
|
|
scanError()
|
|
|
@@ -440,6 +460,7 @@ const print=(templateCode,code)=>{
|
|
|
}
|
|
|
const onPrint=(code)=>{
|
|
|
printer.value=code
|
|
|
+ localStorage.setItem('check-print',JSON.stringify(code))
|
|
|
}
|
|
|
//设置订单号
|
|
|
const setBarcode = (code) => {
|